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

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.
Files changed (39) hide show
  1. package/THIRD_PARTY_LICENSES.txt +184 -24
  2. package/lib/esm/GLTFExporter-NKUJLBWQ.js +1 -0
  3. package/lib/esm/GLTFLoader-BQHL354R.js +1 -0
  4. package/lib/esm/browser-M5OR7Q7D.js +1 -0
  5. package/lib/esm/chunk-2X6CLJYW.js +1 -0
  6. package/lib/esm/chunk-CHY6WOJT.js +1 -0
  7. package/lib/esm/chunk-CZWLNDLV.js +1 -0
  8. package/lib/esm/chunk-DHRVAJE6.js +1 -0
  9. package/lib/esm/chunk-LQMJ5BHI.js +1 -0
  10. package/lib/esm/chunk-LUJQR5EH.js +1 -0
  11. package/lib/esm/chunk-ZMO3UDDX.js +1 -0
  12. package/lib/esm/index.css +1 -1
  13. package/lib/esm/index.d.ts +26164 -21026
  14. package/lib/esm/index.js +1 -1
  15. package/lib/esm/inspector-O22JOSJ6.css +1 -0
  16. package/lib/esm/inspector-QOSD3H5O.js +1 -0
  17. package/lib/esm/internal-WXMWXAC3.js +1 -0
  18. package/lib/esm/internal-XPQ6EMQC.css +1 -0
  19. package/lib/esm/outdoor-context-v5-N4FV7A64.js +1 -0
  20. package/lib/esm/roboto-regular-NXH7N2CY.js +1 -0
  21. package/lib/esm/text3d-DWR5PXYU.js +1 -0
  22. package/package.json +5 -2
  23. package/lib/esm/GLTFExporter-JCFGXXW5.js +0 -1
  24. package/lib/esm/GLTFLoader-GIMAVLLC.js +0 -1
  25. package/lib/esm/browser-FQUMJJAZ.js +0 -1
  26. package/lib/esm/chunk-6FBLH5OZ.js +0 -1
  27. package/lib/esm/chunk-C7Z2BO6A.js +0 -1
  28. package/lib/esm/chunk-ESMYGLKP.js +0 -1
  29. package/lib/esm/chunk-G6JMXRIH.js +0 -1
  30. package/lib/esm/chunk-I5JALQAT.js +0 -1
  31. package/lib/esm/chunk-TOAWRDBC.js +0 -1
  32. package/lib/esm/chunk-WHD5UHOT.js +0 -1
  33. package/lib/esm/dist-CQQ2UWYH.js +0 -1
  34. package/lib/esm/inspector-AUORSUJQ.css +0 -1
  35. package/lib/esm/inspector-QLDKCE66.js +0 -1
  36. package/lib/esm/internal-CBTUOG7Q.js +0 -1
  37. package/lib/esm/internal-VJNENUAS.css +0 -1
  38. package/lib/esm/outdoor-context-v4-EIE6B6TE.js +0 -1
  39. package/lib/esm/text3d-NII2JXSR.js +0 -1
@@ -1 +0,0 @@
1
- import{$ as fp,A as Ul,Aa as JT,B as AT,Ba as KT,C as Ga,Ca as dp,D as Ar,Da as QT,E as jr,Ea as tP,F as Pn,Fa as z0,G as Te,Ga as Y2,H as Nf,Ha as ig,I as V2,Ia as Bf,J as Ks,Ja as H0,K as k0,Ka as Gf,L as R0,La as Vf,M as hp,N as _i,O as Gi,P as NT,Q as tn,R as ri,S as kT,T as Zn,U as RT,V as Va,W as F0,X as kn,Y as j2,Z as ro,_ as FT,a as nT,aa as Qs,b as iT,ba as Sr,c as K,ca as Er,d as xi,da as B0,e as oT,ea as U2,f as k2,fa as G0,g as D0,ga as z2,h as TT,ha as jT,i as Af,ia as kf,j as L0,ja as UT,k as PT,ka as Rf,l as A0,la as Ff,m as xs,ma as zT,n as Ba,na as es,o as N0,oa as HT,p as rg,pa as XT,q as ET,qa as H2,r as Vl,ra as V0,s as Mr,sa as j0,t as ie,ta as YT,u as jl,ua as qT,v as ng,va as WT,w as G2,wa as U0,x as OT,xa as ZT,y as DT,ya as $T,z as LT,za as X2}from"./chunk-6FBLH5OZ.js";import{a as AL,ca as VT,k as BT,v as GT}from"./chunk-TOAWRDBC.js";import{a as LL}from"./chunk-I5JALQAT.js";import{a as _s}from"./chunk-G6JMXRIH.js";import{$ as ue,A as lT,Aa as P0,B as I0,Ba as B2,C as M0,Ca as ka,D as uT,Da as Ra,E as cT,Ea as $s,Fa as E0,G as pT,Ga as xT,H as Ie,Ha as _T,I as ne,Ja as Js,M as hT,N as fT,O as dT,P as pp,Q as zt,R as _n,S as mT,T as ts,Ta as Lf,U as Bl,V as Gl,W as Qr,Xa as O0,Y as Tn,Ya as CT,Z as Ao,_ as w0,aa as No,ab as ST,b as x0,c as _0,ca as rc,cb as Fa,d as sT,da as gT,db as IT,e as Fl,ea as R2,eb as MT,f as aT,g as Na,ga as nc,gb as wT,la as yT,oa as ic,p as C0,pa as vT,qa as T0,r as S0,ra as F2,ta as Df,ya as bT,z as cp,za as oc}from"./chunk-WHD5UHOT.js";import{a as z,b as et,c as u,e as Zs,f as Lt,g as N2,h as Wr,i as b,j as p,k as F,l as V,m as gt,q as y,r as T}from"./chunk-ESMYGLKP.js";var X0=Lt((MZ,rP)=>{"use strict";y();var eP=Object.getOwnPropertySymbols,kL=Object.prototype.hasOwnProperty,RL=Object.prototype.propertyIsEnumerable;function FL(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}u(FL,"toObject");function BL(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(a){return e[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}}u(BL,"shouldUseNative");rP.exports=BL()?Object.assign:function(r,e){for(var t,n=FL(r),i,a=1;a<arguments.length;a++){t=Object(arguments[a]);for(var l in t)kL.call(t,l)&&(n[l]=t[l]);if(eP){i=eP(t);for(var h=0;h<i.length;h++)RL.call(t,i[h])&&(n[i[h]]=t[i[h]])}}return n}});var K2=Lt(($2,J2)=>{y();(function(r,e){typeof $2=="object"&&typeof J2<"u"?J2.exports=e():typeof define=="function"&&define.amd?define(e):(r=r||self).RBush=e()})($2,function(){"use strict";function r(E,O,N,L,G){u(function j($,q,k,tt,ut){for(;tt>k;){if(tt-k>600){var at=tt-k+1,H=q-k+1,St=Math.log(at),pt=.5*Math.exp(2*St/3),ct=.5*Math.sqrt(St*pt*(at-pt)/at)*(H-at/2<0?-1:1),It=Math.max(k,Math.floor(q-H*pt/at+ct)),Et=Math.min(tt,Math.floor(q+(at-H)*pt/at+ct));j($,q,It,Et,ut)}var dt=$[q],bt=k,Z=tt;for(e($,k,q),ut($[tt],dt)>0&&e($,k,tt);bt<Z;){for(e($,bt,Z),bt++,Z--;ut($[bt],dt)<0;)bt++;for(;ut($[Z],dt)>0;)Z--}ut($[k],dt)===0?e($,k,Z):e($,++Z,tt),Z<=q&&(k=Z+1),q<=Z&&(tt=Z-1)}},"t")(E,O,N||0,L||E.length-1,G||t)}u(r,"t");function e(E,O,N){var L=E[O];E[O]=E[N],E[N]=L}u(e,"i");function t(E,O){return E<O?-1:E>O?1:0}u(t,"n");var n=u(function(E){E===void 0&&(E=9),this._maxEntries=Math.max(4,E),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function i(E,O,N){if(!N)return O.indexOf(E);for(var L=0;L<O.length;L++)if(N(E,O[L]))return L;return-1}u(i,"e");function a(E,O){l(E,0,E.children.length,O,E)}u(a,"a");function l(E,O,N,L,G){G||(G=w(null)),G.minX=1/0,G.minY=1/0,G.maxX=-1/0,G.maxY=-1/0;for(var j=O;j<N;j++){var $=E.children[j];h(G,E.leaf?L($):$)}return G}u(l,"h");function h(E,O){return E.minX=Math.min(E.minX,O.minX),E.minY=Math.min(E.minY,O.minY),E.maxX=Math.max(E.maxX,O.maxX),E.maxY=Math.max(E.maxY,O.maxY),E}u(h,"o");function d(E,O){return E.minX-O.minX}u(d,"s");function m(E,O){return E.minY-O.minY}u(m,"l");function v(E){return(E.maxX-E.minX)*(E.maxY-E.minY)}u(v,"f");function x(E){return E.maxX-E.minX+(E.maxY-E.minY)}u(x,"u");function S(E,O){return E.minX<=O.minX&&E.minY<=O.minY&&O.maxX<=E.maxX&&O.maxY<=E.maxY}u(S,"m");function I(E,O){return O.minX<=E.maxX&&O.minY<=E.maxY&&O.maxX>=E.minX&&O.maxY>=E.minY}u(I,"c");function w(E){return{children:E,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}u(w,"p");function P(E,O,N,L,G){for(var j=[O,N];j.length;)if(!((N=j.pop())-(O=j.pop())<=L)){var $=O+Math.ceil((N-O)/L/2)*L;r(E,$,O,N,G),j.push(O,$,$,N)}}return u(P,"d"),n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(E){var O=this.data,N=[];if(!I(E,O))return N;for(var L=this.toBBox,G=[];O;){for(var j=0;j<O.children.length;j++){var $=O.children[j],q=O.leaf?L($):$;I(E,q)&&(O.leaf?N.push($):S(E,q)?this._all($,N):G.push($))}O=G.pop()}return N},n.prototype.collides=function(E){var O=this.data;if(!I(E,O))return!1;for(var N=[];O;){for(var L=0;L<O.children.length;L++){var G=O.children[L],j=O.leaf?this.toBBox(G):G;if(I(E,j)){if(O.leaf||S(E,j))return!0;N.push(G)}}O=N.pop()}return!1},n.prototype.load=function(E){if(!E||!E.length)return this;if(E.length<this._minEntries){for(var O=0;O<E.length;O++)this.insert(E[O]);return this}var N=this._build(E.slice(),0,E.length-1,0);if(this.data.children.length)if(this.data.height===N.height)this._splitRoot(this.data,N);else{if(this.data.height<N.height){var L=this.data;this.data=N,N=L}this._insert(N,this.data.height-N.height-1,!0)}else this.data=N;return this},n.prototype.insert=function(E){return E&&this._insert(E,this.data.height-1),this},n.prototype.clear=function(){return this.data=w([]),this},n.prototype.remove=function(E,O){if(!E)return this;for(var N,L,G,j=this.data,$=this.toBBox(E),q=[],k=[];j||q.length;){if(j||(j=q.pop(),L=q[q.length-1],N=k.pop(),G=!0),j.leaf){var tt=i(E,j.children,O);if(tt!==-1)return j.children.splice(tt,1),q.push(j),this._condense(q),this}G||j.leaf||!S(j,$)?L?(N++,j=L.children[N],G=!1):j=null:(q.push(j),k.push(N),N=0,L=j,j=j.children[0])}return this},n.prototype.toBBox=function(E){return E},n.prototype.compareMinX=function(E,O){return E.minX-O.minX},n.prototype.compareMinY=function(E,O){return E.minY-O.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(E){return this.data=E,this},n.prototype._all=function(E,O){for(var N=[];E;)E.leaf?O.push.apply(O,E.children):N.push.apply(N,E.children),E=N.pop();return O},n.prototype._build=function(E,O,N,L){var G,j=N-O+1,$=this._maxEntries;if(j<=$)return a(G=w(E.slice(O,N+1)),this.toBBox),G;L||(L=Math.ceil(Math.log(j)/Math.log($)),$=Math.ceil(j/Math.pow($,L-1))),(G=w([])).leaf=!1,G.height=L;var q=Math.ceil(j/$),k=q*Math.ceil(Math.sqrt($));P(E,O,N,k,this.compareMinX);for(var tt=O;tt<=N;tt+=k){var ut=Math.min(tt+k-1,N);P(E,tt,ut,q,this.compareMinY);for(var at=tt;at<=ut;at+=q){var H=Math.min(at+q-1,ut);G.children.push(this._build(E,at,H,L-1))}}return a(G,this.toBBox),G},n.prototype._chooseSubtree=function(E,O,N,L){for(;L.push(O),!O.leaf&&L.length-1!==N;){for(var G=1/0,j=1/0,$=void 0,q=0;q<O.children.length;q++){var k=O.children[q],tt=v(k),ut=(at=E,H=k,(Math.max(H.maxX,at.maxX)-Math.min(H.minX,at.minX))*(Math.max(H.maxY,at.maxY)-Math.min(H.minY,at.minY))-tt);ut<j?(j=ut,G=tt<G?tt:G,$=k):ut===j&&tt<G&&(G=tt,$=k)}O=$||O.children[0]}var at,H;return O},n.prototype._insert=function(E,O,N){var L=N?E:this.toBBox(E),G=[],j=this._chooseSubtree(L,this.data,O,G);for(j.children.push(E),h(j,L);O>=0&&G[O].children.length>this._maxEntries;)this._split(G,O),O--;this._adjustParentBBoxes(L,G,O)},n.prototype._split=function(E,O){var N=E[O],L=N.children.length,G=this._minEntries;this._chooseSplitAxis(N,G,L);var j=this._chooseSplitIndex(N,G,L),$=w(N.children.splice(j,N.children.length-j));$.height=N.height,$.leaf=N.leaf,a(N,this.toBBox),a($,this.toBBox),O?E[O-1].children.push($):this._splitRoot(N,$)},n.prototype._splitRoot=function(E,O){this.data=w([E,O]),this.data.height=E.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(E,O,N){for(var L,G,j,$,q,k,tt,ut=1/0,at=1/0,H=O;H<=N-O;H++){var St=l(E,0,H,this.toBBox),pt=l(E,H,N,this.toBBox),ct=(G=St,j=pt,$=void 0,q=void 0,k=void 0,tt=void 0,$=Math.max(G.minX,j.minX),q=Math.max(G.minY,j.minY),k=Math.min(G.maxX,j.maxX),tt=Math.min(G.maxY,j.maxY),Math.max(0,k-$)*Math.max(0,tt-q)),It=v(St)+v(pt);ct<ut?(ut=ct,L=H,at=It<at?It:at):ct===ut&&It<at&&(at=It,L=H)}return L||N-O},n.prototype._chooseSplitAxis=function(E,O,N){var L=E.leaf?this.compareMinX:d,G=E.leaf?this.compareMinY:m;this._allDistMargin(E,O,N,L)<this._allDistMargin(E,O,N,G)&&E.children.sort(L)},n.prototype._allDistMargin=function(E,O,N,L){E.children.sort(L);for(var G=this.toBBox,j=l(E,0,O,G),$=l(E,N-O,N,G),q=x(j)+x($),k=O;k<N-O;k++){var tt=E.children[k];h(j,E.leaf?G(tt):tt),q+=x(j)}for(var ut=N-O-1;ut>=O;ut--){var at=E.children[ut];h($,E.leaf?G(at):at),q+=x($)}return q},n.prototype._adjustParentBBoxes=function(E,O,N){for(var L=N;L>=0;L--)h(O[L],E)},n.prototype._condense=function(E){for(var O=E.length-1,N=void 0;O>=0;O--)E[O].children.length===0?O>0?(N=E[O-1].children).splice(N.indexOf(E[O]),1):this.clear():a(E[O],this.toBBox)},n})});var iP=Lt((FZ,nP)=>{y();nP.exports=u(function(e,t,n,i){var a=e[0],l=e[1],h=!1;n===void 0&&(n=0),i===void 0&&(i=t.length);for(var d=(i-n)/2,m=0,v=d-1;m<d;v=m++){var x=t[n+m*2+0],S=t[n+m*2+1],I=t[n+v*2+0],w=t[n+v*2+1],P=S>l!=w>l&&a<(I-x)*(l-S)/(w-S)+x;P&&(h=!h)}return h},"pointInPolygonFlat")});var sP=Lt((VZ,oP)=>{y();oP.exports=u(function(e,t,n,i){var a=e[0],l=e[1],h=!1;n===void 0&&(n=0),i===void 0&&(i=t.length);for(var d=i-n,m=0,v=d-1;m<d;v=m++){var x=t[m+n][0],S=t[m+n][1],I=t[v+n][0],w=t[v+n][1],P=S>l!=w>l&&a<(I-x)*(l-S)/(w-S)+x;P&&(h=!h)}return h},"pointInPolygonNested")});var uP=Lt((zZ,q0)=>{y();var aP=iP(),lP=sP();q0.exports=u(function(e,t,n,i){return t.length>0&&Array.isArray(t[0])?lP(e,t,n,i):aP(e,t,n,i)},"pointInPolygon");q0.exports.nested=lP;q0.exports.flat=aP});var pP=Lt((W0,cP)=>{y();(function(r,e){typeof W0=="object"&&typeof cP<"u"?e(W0):typeof define=="function"&&define.amd?define(["exports"],e):e((r=r||self).predicates={})})(W0,function(r){"use strict";let t=33306690738754706e-32;function n(I,w,P,E,O){let N,L,G,j,$=w[0],q=E[0],k=0,tt=0;q>$==q>-$?(N=$,$=w[++k]):(N=q,q=E[++tt]);let ut=0;if(k<I&&tt<P)for(q>$==q>-$?(G=N-((L=$+N)-$),$=w[++k]):(G=N-((L=q+N)-q),q=E[++tt]),N=L,G!==0&&(O[ut++]=G);k<I&&tt<P;)q>$==q>-$?(G=N-((L=N+$)-(j=L-N))+($-j),$=w[++k]):(G=N-((L=N+q)-(j=L-N))+(q-j),q=E[++tt]),N=L,G!==0&&(O[ut++]=G);for(;k<I;)G=N-((L=N+$)-(j=L-N))+($-j),$=w[++k],N=L,G!==0&&(O[ut++]=G);for(;tt<P;)G=N-((L=N+q)-(j=L-N))+(q-j),q=E[++tt],N=L,G!==0&&(O[ut++]=G);return N===0&&ut!==0||(O[ut++]=N),ut}u(n,"r");function i(I){return new Float64Array(I)}u(i,"o");let a=33306690738754716e-32,l=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,P,E,O,N){let L=(w-N)*(P-O),G=(I-O)*(E-N),j=L-G;if(L===0||G===0||L>0!=G>0)return j;let $=Math.abs(L+G);return Math.abs(j)>=a*$?j:-function(q,k,tt,ut,at,H,St){let pt,ct,It,Et,dt,bt,Z,te,jt,ee,Tt,le,vr,Qe,Nt,At,xt,_e,de=q-at,Xr=tt-at,me=k-H,Se=ut-H;dt=(Nt=(te=de-(Z=(bt=134217729*de)-(bt-de)))*(ee=Se-(jt=(bt=134217729*Se)-(bt-Se)))-((Qe=de*Se)-Z*jt-te*jt-Z*ee))-(Tt=Nt-(xt=(te=me-(Z=(bt=134217729*me)-(bt-me)))*(ee=Xr-(jt=(bt=134217729*Xr)-(bt-Xr)))-((At=me*Xr)-Z*jt-te*jt-Z*ee))),d[0]=Nt-(Tt+dt)+(dt-xt),dt=(vr=Qe-((le=Qe+Tt)-(dt=le-Qe))+(Tt-dt))-(Tt=vr-At),d[1]=vr-(Tt+dt)+(dt-At),dt=(_e=le+Tt)-le,d[2]=le-(_e-dt)+(Tt-dt),d[3]=_e;let br=function(lo,Zi){let uo=Zi[0];for(let wn=1;wn<lo;wn++)uo+=Zi[wn];return uo}(4,d),Yr=l*St;if(br>=Yr||-br>=Yr||(pt=q-(de+(dt=q-de))+(dt-at),It=tt-(Xr+(dt=tt-Xr))+(dt-at),ct=k-(me+(dt=k-me))+(dt-H),Et=ut-(Se+(dt=ut-Se))+(dt-H),pt===0&&ct===0&&It===0&&Et===0)||(Yr=h*St+t*Math.abs(br),(br+=de*Et+Se*pt-(me*It+Xr*ct))>=Yr||-br>=Yr))return br;dt=(Nt=(te=pt-(Z=(bt=134217729*pt)-(bt-pt)))*(ee=Se-(jt=(bt=134217729*Se)-(bt-Se)))-((Qe=pt*Se)-Z*jt-te*jt-Z*ee))-(Tt=Nt-(xt=(te=ct-(Z=(bt=134217729*ct)-(bt-ct)))*(ee=Xr-(jt=(bt=134217729*Xr)-(bt-Xr)))-((At=ct*Xr)-Z*jt-te*jt-Z*ee))),S[0]=Nt-(Tt+dt)+(dt-xt),dt=(vr=Qe-((le=Qe+Tt)-(dt=le-Qe))+(Tt-dt))-(Tt=vr-At),S[1]=vr-(Tt+dt)+(dt-At),dt=(_e=le+Tt)-le,S[2]=le-(_e-dt)+(Tt-dt),S[3]=_e;let Wi=n(4,d,4,S,m);dt=(Nt=(te=de-(Z=(bt=134217729*de)-(bt-de)))*(ee=Et-(jt=(bt=134217729*Et)-(bt-Et)))-((Qe=de*Et)-Z*jt-te*jt-Z*ee))-(Tt=Nt-(xt=(te=me-(Z=(bt=134217729*me)-(bt-me)))*(ee=It-(jt=(bt=134217729*It)-(bt-It)))-((At=me*It)-Z*jt-te*jt-Z*ee))),S[0]=Nt-(Tt+dt)+(dt-xt),dt=(vr=Qe-((le=Qe+Tt)-(dt=le-Qe))+(Tt-dt))-(Tt=vr-At),S[1]=vr-(Tt+dt)+(dt-At),dt=(_e=le+Tt)-le,S[2]=le-(_e-dt)+(Tt-dt),S[3]=_e;let Yt=n(Wi,m,4,S,v);dt=(Nt=(te=pt-(Z=(bt=134217729*pt)-(bt-pt)))*(ee=Et-(jt=(bt=134217729*Et)-(bt-Et)))-((Qe=pt*Et)-Z*jt-te*jt-Z*ee))-(Tt=Nt-(xt=(te=ct-(Z=(bt=134217729*ct)-(bt-ct)))*(ee=It-(jt=(bt=134217729*It)-(bt-It)))-((At=ct*It)-Z*jt-te*jt-Z*ee))),S[0]=Nt-(Tt+dt)+(dt-xt),dt=(vr=Qe-((le=Qe+Tt)-(dt=le-Qe))+(Tt-dt))-(Tt=vr-At),S[1]=vr-(Tt+dt)+(dt-At),dt=(_e=le+Tt)-le,S[2]=le-(_e-dt)+(Tt-dt),S[3]=_e;let mr=n(Yt,v,4,S,x);return x[mr-1]}(I,w,P,E,O,N,$)},r.orient2dfast=function(I,w,P,E,O,N){return(w-N)*(P-O)-(I-O)*(E-N)},Object.defineProperty(r,"__esModule",{value:!0})})});var yP=Lt((WZ,r_)=>{"use strict";y();var hP=K2(),$0=LL(),VL=uP(),jL=pP().orient2d;$0.default&&($0=$0.default);r_.exports=gP;r_.exports.default=gP;function gP(r,e,t){e=Math.max(0,e===void 0?2:e),t=t||0;var n=YL(r),i=new hP(16);i.toBBox=function(N){return{minX:N[0],minY:N[1],maxX:N[0],maxY:N[1]}},i.compareMinX=function(N,L){return N[0]-L[0]},i.compareMinY=function(N,L){return N[1]-L[1]},i.load(r);for(var a=[],l=0,h;l<n.length;l++){var d=n[l];i.remove(d),h=mP(d,h),a.push(h)}var m=new hP(16);for(l=0;l<a.length;l++)m.insert(Q2(a[l]));for(var v=e*e,x=t*t;a.length;){var S=a.shift(),I=S.p,w=S.next.p,P=t_(I,w);if(!(P<x)){var E=P/v;d=UL(i,S.prev.p,I,w,S.next.next.p,E,m),d&&Math.min(t_(d,I),t_(d,w))<=E&&(a.push(S),a.push(mP(d,S)),i.remove(d),m.remove(S),m.insert(Q2(S)),m.insert(Q2(S.next)))}}S=h;var O=[];do O.push(S.p),S=S.next;while(S!==h);return O.push(S.p),O}u(gP,"concaveman");function UL(r,e,t,n,i,a,l){for(var h=new $0([],zL),d=r.data;d;){for(var m=0;m<d.children.length;m++){var v=d.children[m],x=d.leaf?e_(v,t,n):HL(t,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=e_(I,e,t),P=e_(I,n,i);if(S.dist<w&&S.dist<P&&dP(t,I,l)&&dP(n,I,l))return I}d=h.pop(),d&&(d=d.node)}return null}u(UL,"findCandidate");function zL(r,e){return r.dist-e.dist}u(zL,"compareDist");function HL(r,e,t){if(fP(r,t)||fP(e,t))return 0;var n=Z0(r[0],r[1],e[0],e[1],t.minX,t.minY,t.maxX,t.minY);if(n===0)return 0;var i=Z0(r[0],r[1],e[0],e[1],t.minX,t.minY,t.minX,t.maxY);if(i===0)return 0;var a=Z0(r[0],r[1],e[0],e[1],t.maxX,t.minY,t.maxX,t.maxY);if(a===0)return 0;var l=Z0(r[0],r[1],e[0],e[1],t.minX,t.maxY,t.maxX,t.maxY);return l===0?0:Math.min(n,i,a,l)}u(HL,"sqSegBoxDist");function fP(r,e){return r[0]>=e.minX&&r[0]<=e.maxX&&r[1]>=e.minY&&r[1]<=e.maxY}u(fP,"inside");function dP(r,e,t){for(var n=Math.min(r[0],e[0]),i=Math.min(r[1],e[1]),a=Math.max(r[0],e[0]),l=Math.max(r[1],e[1]),h=t.search({minX:n,minY:i,maxX:a,maxY:l}),d=0;d<h.length;d++)if(XL(h[d].p,h[d].next.p,r,e))return!1;return!0}u(dP,"noIntersections");function jf(r,e,t){return jL(r[0],r[1],e[0],e[1],t[0],t[1])}u(jf,"cross");function XL(r,e,t,n){return r!==n&&e!==t&&jf(r,e,t)>0!=jf(r,e,n)>0&&jf(t,n,r)>0!=jf(t,n,e)>0}u(XL,"intersects");function Q2(r){var e=r.p,t=r.next.p;return r.minX=Math.min(e[0],t[0]),r.minY=Math.min(e[1],t[1]),r.maxX=Math.max(e[0],t[0]),r.maxY=Math.max(e[1],t[1]),r}u(Q2,"updateBBox");function YL(r){for(var e=r[0],t=r[0],n=r[0],i=r[0],a=0;a<r.length;a++){var l=r[a];l[0]<e[0]&&(e=l),l[0]>n[0]&&(n=l),l[1]<t[1]&&(t=l),l[1]>i[1]&&(i=l)}var h=[e,t,n,i],d=h.slice();for(a=0;a<r.length;a++)VL(r[a],h)||d.push(r[a]);return WL(d)}u(YL,"fastConvexHull");function mP(r,e){var t={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(t.next=e.next,t.prev=e,e.next.prev=t,e.next=t):(t.prev=t,t.next=t),t}u(mP,"insertNode");function t_(r,e){var t=r[0]-e[0],n=r[1]-e[1];return t*t+n*n}u(t_,"getSqDist");function e_(r,e,t){var n=e[0],i=e[1],a=t[0]-n,l=t[1]-i;if(a!==0||l!==0){var h=((r[0]-n)*a+(r[1]-i)*l)/(a*a+l*l);h>1?(n=t[0],i=t[1]):h>0&&(n+=a*h,i+=l*h)}return a=r[0]-n,l=r[1]-i,a*a+l*l}u(e_,"sqSegDist");function Z0(r,e,t,n,i,a,l,h){var d=t-r,m=n-e,v=l-i,x=h-a,S=r-i,I=e-a,w=d*d+m*m,P=d*v+m*x,E=v*v+x*x,O=d*S+m*I,N=v*S+x*I,L=w*E-P*P,G,j,$,q,k=L,tt=L;L===0?(j=0,k=1,q=N,tt=E):(j=P*N-E*O,q=w*N-P*O,j<0?(j=0,q=N,tt=E):j>k&&(j=k,q=N+P,tt=E)),q<0?(q=0,-O<0?j=0:-O>w?j=k:(j=-O,k=w)):q>tt&&(q=tt,-O+P<0?j=0:-O+P>w?j=k:(j=-O+P,k=w)),G=j===0?0:j/k,$=q===0?0:q/tt;var ut=(1-G)*r+G*t,at=(1-G)*e+G*n,H=(1-$)*i+$*l,St=(1-$)*a+$*h,pt=H-ut,ct=St-at;return pt*pt+ct*ct}u(Z0,"sqSegSegDist");function qL(r,e){return r[0]===e[0]?r[1]-e[1]:r[0]-e[0]}u(qL,"compareByX");function WL(r){r.sort(qL);for(var e=[],t=0;t<r.length;t++){for(;e.length>=2&&jf(e[e.length-2],e[e.length-1],r[t])<=0;)e.pop();e.push(r[t])}for(var n=[],i=r.length-1;i>=0;i--){for(;n.length>=2&&jf(n[n.length-2],n[n.length-1],r[i])<=0;)n.pop();n.push(r[i])}return n.pop(),e.pop(),e.concat(n)}u(WL,"convexHull")});var CP=Lt((i_,o_)=>{y();(function(r,e){typeof i_=="object"&&typeof o_<"u"?o_.exports=e():typeof define=="function"&&define.amd?define(e):r.quickselect=e()})(i_,function(){"use strict";function r(i,a,l,h,d){e(i,a,l||0,h||i.length-1,d||n)}u(r,"quickselect");function e(i,a,l,h,d){for(;h>l;){if(h-l>600){var m=h-l+1,v=a-l+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(l,Math.floor(a-v*S/m+I)),P=Math.min(h,Math.floor(a+(m-v)*S/m+I));e(i,a,w,P,d)}var E=i[a],O=l,N=h;for(t(i,l,a),d(i[h],E)>0&&t(i,l,h);O<N;){for(t(i,O,N),O++,N--;d(i[O],E)<0;)O++;for(;d(i[N],E)>0;)N--}d(i[l],E)===0?t(i,l,N):(N++,t(i,N,h)),N<=a&&(l=N+1),a<=N&&(h=N-1)}}u(e,"quickselectStep");function t(i,a,l){var h=i[a];i[a]=i[l],i[l]=h}u(t,"swap");function n(i,a){return i<a?-1:i>a?1:0}return u(n,"defaultCompare"),r})});var u_=Lt((HQ,l_)=>{"use strict";y();l_.exports=ag;l_.exports.default=ag;var lA=CP();function ag(r,e){if(!(this instanceof ag))return new ag(r,e);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),e&&this._initFormat(e),this.clear()}u(ag,"rbush");ag.prototype={all:u(function(){return this._all(this.data,[])},"all"),search:u(function(r){var e=this.data,t=[],n=this.toBBox;if(!K0(r,e))return t;for(var i=[],a,l,h,d;e;){for(a=0,l=e.children.length;a<l;a++)h=e.children[a],d=e.leaf?n(h):h,K0(r,d)&&(e.leaf?t.push(h):a_(r,d)?this._all(h,t):i.push(h));e=i.pop()}return t},"search"),collides:u(function(r){var e=this.data,t=this.toBBox;if(!K0(r,e))return!1;for(var n=[],i,a,l,h;e;){for(i=0,a=e.children.length;i<a;i++)if(l=e.children[i],h=e.leaf?t(l):l,K0(r,h)){if(e.leaf||a_(r,h))return!0;n.push(l)}e=n.pop()}return!1},"collides"),load:u(function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var e=0,t=r.length;e<t;e++)this.insert(r[e]);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:u(function(r){return r&&this._insert(r,this.data.height-1),this},"insert"),clear:u(function(){return this.data=Hf([]),this},"clear"),remove:u(function(r,e){if(!r)return this;for(var t=this.data,n=this.toBBox(r),i=[],a=[],l,h,d,m;t||i.length;){if(t||(t=i.pop(),h=i[i.length-1],l=a.pop(),m=!0),t.leaf&&(d=uA(r,t.children,e),d!==-1))return t.children.splice(d,1),i.push(t),this._condense(i),this;!m&&!t.leaf&&a_(t,n)?(i.push(t),a.push(l),l=0,h=t,t=t.children[0]):h?(l++,t=h.children[l],m=!1):t=null}return this},"remove"),toBBox:u(function(r){return r},"toBBox"),compareMinX:SP,compareMinY:IP,toJSON:u(function(){return this.data},"toJSON"),fromJSON:u(function(r){return this.data=r,this},"fromJSON"),_all:u(function(r,e){for(var t=[];r;)r.leaf?e.push.apply(e,r.children):t.push.apply(t,r.children),r=t.pop();return e},"_all"),_build:u(function(r,e,t,n){var i=t-e+1,a=this._maxEntries,l;if(i<=a)return l=Hf(r.slice(e,t+1)),zf(l,this.toBBox),l;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),l=Hf([]),l.leaf=!1,l.height=n;var h=Math.ceil(i/a),d=h*Math.ceil(Math.sqrt(a)),m,v,x,S;for(MP(r,e,t,d,this.compareMinX),m=e;m<=t;m+=d)for(x=Math.min(m+d-1,t),MP(r,m,x,h,this.compareMinY),v=m;v<=x;v+=h)S=Math.min(v+h-1,x),l.children.push(this._build(r,v,S,n-1));return zf(l,this.toBBox),l},"_build"),_chooseSubtree:u(function(r,e,t,n){for(var i,a,l,h,d,m,v,x;n.push(e),!(e.leaf||n.length-1===t);){for(v=x=1/0,i=0,a=e.children.length;i<a;i++)l=e.children[i],d=s_(l),m=cA(r,l)-d,m<x?(x=m,v=d<v?d:v,h=l):m===x&&d<v&&(v=d,h=l);e=h||e.children[0]}return e},"_chooseSubtree"),_insert:u(function(r,e,t){var n=this.toBBox,i=t?r:n(r),a=[],l=this._chooseSubtree(i,this.data,e,a);for(l.children.push(r),sg(l,i);e>=0&&a[e].children.length>this._maxEntries;)this._split(a,e),e--;this._adjustParentBBoxes(i,a,e)},"_insert"),_split:u(function(r,e){var t=r[e],n=t.children.length,i=this._minEntries;this._chooseSplitAxis(t,i,n);var a=this._chooseSplitIndex(t,i,n),l=Hf(t.children.splice(a,t.children.length-a));l.height=t.height,l.leaf=t.leaf,zf(t,this.toBBox),zf(l,this.toBBox),e?r[e-1].children.push(l):this._splitRoot(t,l)},"_split"),_splitRoot:u(function(r,e){this.data=Hf([r,e]),this.data.height=r.height+1,this.data.leaf=!1,zf(this.data,this.toBBox)},"_splitRoot"),_chooseSplitIndex:u(function(r,e,t){var n,i,a,l,h,d,m,v;for(d=m=1/0,n=e;n<=t-e;n++)i=og(r,0,n,this.toBBox),a=og(r,n,t,this.toBBox),l=pA(i,a),h=s_(i)+s_(a),l<d?(d=l,v=n,m=h<m?h:m):l===d&&h<m&&(m=h,v=n);return v},"_chooseSplitIndex"),_chooseSplitAxis:u(function(r,e,t){var n=r.leaf?this.compareMinX:SP,i=r.leaf?this.compareMinY:IP,a=this._allDistMargin(r,e,t,n),l=this._allDistMargin(r,e,t,i);a<l&&r.children.sort(n)},"_chooseSplitAxis"),_allDistMargin:u(function(r,e,t,n){r.children.sort(n);var i=this.toBBox,a=og(r,0,e,i),l=og(r,t-e,t,i),h=J0(a)+J0(l),d,m;for(d=e;d<t-e;d++)m=r.children[d],sg(a,r.leaf?i(m):m),h+=J0(a);for(d=t-e-1;d>=e;d--)m=r.children[d],sg(l,r.leaf?i(m):m),h+=J0(l);return h},"_allDistMargin"),_adjustParentBBoxes:u(function(r,e,t){for(var n=t;n>=0;n--)sg(e[n],r)},"_adjustParentBBoxes"),_condense:u(function(r){for(var e=r.length-1,t;e>=0;e--)r[e].children.length===0?e>0?(t=r[e-1].children,t.splice(t.indexOf(r[e]),1)):this.clear():zf(r[e],this.toBBox)},"_condense"),_initFormat:u(function(r){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(r[0])),this.compareMinY=new Function("a","b",e.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 uA(r,e,t){if(!t)return e.indexOf(r);for(var n=0;n<e.length;n++)if(t(r,e[n]))return n;return-1}u(uA,"findItem");function zf(r,e){og(r,0,r.children.length,e,r)}u(zf,"calcBBox");function og(r,e,t,n,i){i||(i=Hf(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e,l;a<t;a++)l=r.children[a],sg(i,r.leaf?n(l):l);return i}u(og,"distBBox");function sg(r,e){return r.minX=Math.min(r.minX,e.minX),r.minY=Math.min(r.minY,e.minY),r.maxX=Math.max(r.maxX,e.maxX),r.maxY=Math.max(r.maxY,e.maxY),r}u(sg,"extend");function SP(r,e){return r.minX-e.minX}u(SP,"compareNodeMinX");function IP(r,e){return r.minY-e.minY}u(IP,"compareNodeMinY");function s_(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}u(s_,"bboxArea");function J0(r){return r.maxX-r.minX+(r.maxY-r.minY)}u(J0,"bboxMargin");function cA(r,e){return(Math.max(e.maxX,r.maxX)-Math.min(e.minX,r.minX))*(Math.max(e.maxY,r.maxY)-Math.min(e.minY,r.minY))}u(cA,"enlargedArea");function pA(r,e){var t=Math.max(r.minX,e.minX),n=Math.max(r.minY,e.minY),i=Math.min(r.maxX,e.maxX),a=Math.min(r.maxY,e.maxY);return Math.max(0,i-t)*Math.max(0,a-n)}u(pA,"intersectionArea");function a_(r,e){return r.minX<=e.minX&&r.minY<=e.minY&&e.maxX<=r.maxX&&e.maxY<=r.maxY}u(a_,"contains");function K0(r,e){return e.minX<=r.maxX&&e.minY<=r.maxY&&e.maxX>=r.minX&&e.maxY>=r.minY}u(K0,"intersects");function Hf(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}u(Hf,"createNode");function MP(r,e,t,n,i){for(var a=[e,t],l;a.length;)t=a.pop(),e=a.pop(),!(t-e<=n)&&(l=e+Math.ceil((t-e)/n/2)*n,lA(r,l,e,t,i),a.push(e,l,l,t))}u(MP,"multiSelect")});var m_=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 sc(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}u(sc,"feature");se.feature=sc;function IA(r,e,t){switch(t===void 0&&(t={}),r){case"Point":return p_(e).geometry;case"LineString":return f_(e).geometry;case"Polygon":return h_(e).geometry;case"MultiPoint":return TP(e).geometry;case"MultiLineString":return wP(e).geometry;case"MultiPolygon":return PP(e).geometry;default:throw new Error(r+" is invalid")}}u(IA,"geometry");se.geometry=IA;function p_(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!tv(r[0])||!tv(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return sc(n,e,t)}u(p_,"point");se.point=p_;function MA(r,e,t){return t===void 0&&(t={}),ev(r.map(function(n){return p_(n,e)}),t)}u(MA,"points");se.points=MA;function h_(r,e,t){t===void 0&&(t={});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 l=0;l<a[a.length-1].length;l++)if(a[a.length-1][l]!==a[0][l])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:r};return sc(h,e,t)}u(h_,"polygon");se.polygon=h_;function wA(r,e,t){return t===void 0&&(t={}),ev(r.map(function(n){return h_(n,e)}),t)}u(wA,"polygons");se.polygons=wA;function f_(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return sc(n,e,t)}u(f_,"lineString");se.lineString=f_;function TA(r,e,t){return t===void 0&&(t={}),ev(r.map(function(n){return f_(n,e)}),t)}u(TA,"lineStrings");se.lineStrings=TA;function ev(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}u(ev,"featureCollection");se.featureCollection=ev;function wP(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return sc(n,e,t)}u(wP,"multiLineString");se.multiLineString=wP;function TP(r,e,t){t===void 0&&(t={});var n={type:"MultiPoint",coordinates:r};return sc(n,e,t)}u(TP,"multiPoint");se.multiPoint=TP;function PP(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return sc(n,e,t)}u(PP,"multiPolygon");se.multiPolygon=PP;function PA(r,e,t){t===void 0&&(t={});var n={type:"GeometryCollection",geometries:r};return sc(n,e,t)}u(PA,"geometryCollection");se.geometryCollection=PA;function EA(r,e){if(e===void 0&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var t=Math.pow(10,e||0);return Math.round(r*t)/t}u(EA,"round");se.round=EA;function EP(r,e){e===void 0&&(e="kilometers");var t=se.factors[e];if(!t)throw new Error(e+" units is invalid");return r*t}u(EP,"radiansToLength");se.radiansToLength=EP;function d_(r,e){e===void 0&&(e="kilometers");var t=se.factors[e];if(!t)throw new Error(e+" units is invalid");return r/t}u(d_,"lengthToRadians");se.lengthToRadians=d_;function OA(r,e){return OP(d_(r,e))}u(OA,"lengthToDegrees");se.lengthToDegrees=OA;function DA(r){var e=r%360;return e<0&&(e+=360),e}u(DA,"bearingToAzimuth");se.bearingToAzimuth=DA;function OP(r){var e=r%(2*Math.PI);return e*180/Math.PI}u(OP,"radiansToDegrees");se.radiansToDegrees=OP;function LA(r){var e=r%360;return e*Math.PI/180}u(LA,"degreesToRadians");se.degreesToRadians=LA;function AA(r,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("length must be a positive number");return EP(d_(r,e),t)}u(AA,"convertLength");se.convertLength=AA;function NA(r,e,t){if(e===void 0&&(e="meters"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("area must be a positive number");var n=se.areaFactors[e];if(!n)throw new Error("invalid original units");var i=se.areaFactors[t];if(!i)throw new Error("invalid final units");return r/n*i}u(NA,"convertArea");se.convertArea=NA;function tv(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}u(tv,"isNumber");se.isNumber=tv;function kA(r){return!!r&&r.constructor===Object}u(kA,"isObject");se.isObject=kA;function RA(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(e){if(!tv(e))throw new Error("bbox must only contain numbers")})}u(RA,"validateBBox");se.validateBBox=RA;function FA(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}u(FA,"validateId");se.validateId=FA});var y_=Lt(ii=>{"use strict";y();Object.defineProperty(ii,"__esModule",{value:!0});var io=m_();function ug(r,e,t){if(r!==null)for(var n,i,a,l,h,d,m,v=0,x=0,S,I=r.type,w=I==="FeatureCollection",P=I==="Feature",E=w?r.features.length:1,O=0;O<E;O++){m=w?r.features[O].geometry:P?r.geometry:r,S=m?m.type==="GeometryCollection":!1,h=S?m.geometries.length:1;for(var N=0;N<h;N++){var L=0,G=0;if(l=S?m.geometries[N]:m,l!==null){d=l.coordinates;var j=l.type;switch(v=t&&(j==="Polygon"||j==="MultiPolygon")?1:0,j){case null:break;case"Point":if(e(d,x,O,L,G)===!1)return!1;x++,L++;break;case"LineString":case"MultiPoint":for(n=0;n<d.length;n++){if(e(d[n],x,O,L,G)===!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(e(d[n][i],x,O,L,G)===!1)return!1;x++}j==="MultiLineString"&&L++,j==="Polygon"&&G++}j==="Polygon"&&L++;break;case"MultiPolygon":for(n=0;n<d.length;n++){for(G=0,i=0;i<d[n].length;i++){for(a=0;a<d[n][i].length-v;a++){if(e(d[n][i][a],x,O,L,G)===!1)return!1;x++}G++}L++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(ug(l.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}u(ug,"coordEach");function BA(r,e,t,n){var i=t;return ug(r,function(a,l,h,d,m){l===0&&t===void 0?i=a:i=e(i,a,l,h,d,m)},n),i}u(BA,"coordReduce");function DP(r,e){var t;switch(r.type){case"FeatureCollection":for(t=0;t<r.features.length&&e(r.features[t].properties,t)!==!1;t++);break;case"Feature":e(r.properties,0);break}}u(DP,"propEach");function GA(r,e,t){var n=t;return DP(r,function(i,a){a===0&&t===void 0?n=i:n=e(n,i,a)}),n}u(GA,"propReduce");function LP(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}u(LP,"featureEach");function VA(r,e,t){var n=t;return LP(r,function(i,a){a===0&&t===void 0?n=i:n=e(n,i,a)}),n}u(VA,"featureReduce");function jA(r){var e=[];return ug(r,function(t){e.push(t)}),e}u(jA,"coordAll");function g_(r,e){var t,n,i,a,l,h,d,m,v,x,S=0,I=r.type==="FeatureCollection",w=r.type==="Feature",P=I?r.features.length:1;for(t=0;t<P;t++){for(h=I?r.features[t].geometry:w?r.geometry:r,m=I?r.features[t].properties:w?r.properties:{},v=I?r.features[t].bbox:w?r.bbox:void 0,x=I?r.features[t].id:w?r.id:void 0,d=h?h.type==="GeometryCollection":!1,l=d?h.geometries.length:1,i=0;i<l;i++){if(a=d?h.geometries[i]:h,a===null){if(e(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(e(a,S,m,v,x)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<a.geometries.length;n++)if(e(a.geometries[n],S,m,v,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}S++}}u(g_,"geomEach");function UA(r,e,t){var n=t;return g_(r,function(i,a,l,h,d){a===0&&t===void 0?n=i:n=e(n,i,a,l,h,d)}),n}u(UA,"geomReduce");function rv(r,e){g_(r,function(t,n,i,a,l){var h=t===null?null:t.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return e(io.feature(t,i,{bbox:a,id:l}),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<t.coordinates.length;m++){var v=t.coordinates[m],x={type:d,coordinates:v};if(e(io.feature(x,i),n,m)===!1)return!1}})}u(rv,"flattenEach");function zA(r,e,t){var n=t;return rv(r,function(i,a,l){a===0&&l===0&&t===void 0?n=i:n=e(n,i,a,l)}),n}u(zA,"flattenReduce");function AP(r,e){rv(r,function(t,n,i){var a=0;if(t.geometry){var l=t.geometry.type;if(!(l==="Point"||l==="MultiPoint")){var h,d=0,m=0,v=0;if(ug(t,function(x,S,I,w,P){if(h===void 0||n>d||w>m||P>v){h=x,d=n,m=w,v=P,a=0;return}var E=io.lineString([h,x],t.properties);if(e(E,n,i,P,a)===!1)return!1;a++,h=x})===!1)return!1}}})}u(AP,"segmentEach");function HA(r,e,t){var n=t,i=!1;return AP(r,function(a,l,h,d,m){i===!1&&t===void 0?n=a:n=e(n,a,l,h,d,m),i=!0}),n}u(HA,"segmentReduce");function NP(r,e){if(!r)throw new Error("geojson is required");rv(r,function(t,n,i){if(t.geometry!==null){var a=t.geometry.type,l=t.geometry.coordinates;switch(a){case"LineString":if(e(t,n,i,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<l.length;h++)if(e(io.lineString(l[h],t.properties),n,i,h)===!1)return!1;break}}})}u(NP,"lineEach");function XA(r,e,t){var n=t;return NP(r,function(i,a,l,h){a===0&&t===void 0?n=i:n=e(n,i,a,l,h)}),n}u(XA,"lineReduce");function YA(r,e){if(e=e||{},!io.isObject(e))throw new Error("options is invalid");var t=e.featureIndex||0,n=e.multiFeatureIndex||0,i=e.geometryIndex||0,a=e.segmentIndex||0,l=e.properties,h;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),l=l||r.features[t].properties,h=r.features[t].geometry;break;case"Feature":l=l||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),io.lineString([d[a],d[a+1]],l,e);case"Polygon":return i<0&&(i=d.length+i),a<0&&(a=d[i].length+a-1),io.lineString([d[i][a],d[i][a+1]],l,e);case"MultiLineString":return n<0&&(n=d.length+n),a<0&&(a=d[n].length+a-1),io.lineString([d[n][a],d[n][a+1]],l,e);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),io.lineString([d[n][i][a],d[n][i][a+1]],l,e)}throw new Error("geojson is invalid")}u(YA,"findSegment");function qA(r,e){if(e=e||{},!io.isObject(e))throw new Error("options is invalid");var t=e.featureIndex||0,n=e.multiFeatureIndex||0,i=e.geometryIndex||0,a=e.coordIndex||0,l=e.properties,h;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),l=l||r.features[t].properties,h=r.features[t].geometry;break;case"Feature":l=l||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 io.point(d,l,e);case"MultiPoint":return n<0&&(n=d.length+n),io.point(d[n],l,e);case"LineString":return a<0&&(a=d.length+a),io.point(d[a],l,e);case"Polygon":return i<0&&(i=d.length+i),a<0&&(a=d[i].length+a),io.point(d[i][a],l,e);case"MultiLineString":return n<0&&(n=d.length+n),a<0&&(a=d[n].length+a),io.point(d[n][a],l,e);case"MultiPolygon":return n<0&&(n=d.length+n),i<0&&(i=d[n].length+i),a<0&&(a=d[n][i].length-a),io.point(d[n][i][a],l,e)}throw new Error("geojson is invalid")}u(qA,"findPoint");ii.coordAll=jA;ii.coordEach=ug;ii.coordReduce=BA;ii.featureEach=LP;ii.featureReduce=VA;ii.findPoint=qA;ii.findSegment=YA;ii.flattenEach=rv;ii.flattenReduce=zA;ii.geomEach=g_;ii.geomReduce=UA;ii.lineEach=NP;ii.lineReduce=XA;ii.propEach=DP;ii.propReduce=GA;ii.segmentEach=AP;ii.segmentReduce=HA});var kP=Lt(b_=>{"use strict";y();Object.defineProperty(b_,"__esModule",{value:!0});var WA=y_();function v_(r){var e=[1/0,1/0,-1/0,-1/0];return WA.coordEach(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}u(v_,"bbox");v_.default=v_;b_.default=v_});var nv=Lt((xrt,x_)=>{y();var Ua=K2(),FP=m_(),BP=y_(),Yf=kP().default,ZA=BP.featureEach,vrt=BP.coordEach,brt=FP.polygon,RP=FP.featureCollection;function GP(r){var e=new Ua(r);return e.insert=function(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Yf(t),Ua.prototype.insert.call(this,t)},e.load=function(t){var n=[];return Array.isArray(t)?t.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:Yf(i),n.push(i)}):ZA(t,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:Yf(i),n.push(i)}),Ua.prototype.load.call(this,n)},e.remove=function(t,n){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Yf(t),Ua.prototype.remove.call(this,t,n)},e.clear=function(){return Ua.prototype.clear.call(this)},e.search=function(t){var n=Ua.prototype.search.call(this,this.toBBox(t));return RP(n)},e.collides=function(t){return Ua.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=Ua.prototype.all.call(this);return RP(t)},e.toJSON=function(){return Ua.prototype.toJSON.call(this)},e.fromJSON=function(t){return Ua.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var n;if(t.bbox)n=t.bbox;else if(Array.isArray(t)&&t.length===4)n=t;else if(Array.isArray(t)&&t.length===6)n=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")n=Yf(t);else if(t.type==="FeatureCollection")n=Yf(t);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},e}u(GP,"geojsonRbush");x_.exports=GP;x_.exports.default=GP});var M_=Lt((Oot,QP)=>{"use strict";y();var KP=Object.prototype.toString;QP.exports=u(function(e){var t=KP.call(e),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&KP.call(e.callee)==="[object Function]"),n},"isArguments")});var lE=Lt((Aot,aE)=>{"use strict";y();var sE;Object.keys||(pg=Object.prototype.hasOwnProperty,w_=Object.prototype.toString,tE=M_(),T_=Object.prototype.propertyIsEnumerable,eE=!T_.call({toString:null},"toString"),rE=T_.call(function(){},"prototype"),hg=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],sv=u(function(r){var e=r.constructor;return e&&e.prototype===r},"equalsConstructorPrototype"),nE={$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},iE=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!nE["$"+r]&&pg.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{sv(window[r])}catch(e){return!0}}catch(e){return!0}return!1}(),oE=u(function(r){if(typeof window>"u"||!iE)return sv(r);try{return sv(r)}catch(e){return!1}},"equalsConstructorPrototypeIfNotBuggy"),sE=u(function(e){var t=e!==null&&typeof e=="object",n=w_.call(e)==="[object Function]",i=tE(e),a=t&&w_.call(e)==="[object String]",l=[];if(!t&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var h=rE&&n;if(a&&e.length>0&&!pg.call(e,0))for(var d=0;d<e.length;++d)l.push(String(d));if(i&&e.length>0)for(var m=0;m<e.length;++m)l.push(String(m));else for(var v in e)!(h&&v==="prototype")&&pg.call(e,v)&&l.push(String(v));if(eE)for(var x=oE(e),S=0;S<hg.length;++S)!(x&&hg[S]==="constructor")&&pg.call(e,hg[S])&&l.push(hg[S]);return l},"keys"));var pg,w_,tE,T_,eE,rE,hg,sv,nE,iE,oE;aE.exports=sE});var P_=Lt((Rot,pE)=>{"use strict";y();var cN=Array.prototype.slice,pN=M_(),uE=Object.keys,av=uE?u(function(e){return uE(e)},"keys"):lE(),cE=Object.keys;av.shim=u(function(){if(Object.keys){var e=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);e||(Object.keys=u(function(n){return pN(n)?cE(cN.call(n)):cE(n)},"keys"))}else Object.keys=av;return Object.keys||av},"shimObjectKeys");pE.exports=av});var E_=Lt((Got,hE)=>{"use strict";y();hE.exports=u(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var l=Object.getOwnPropertySymbols(e);if(l.length!==1||l[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(e,t);if(h.value!==i||h.enumerable!==!0)return!1}return!0},"hasSymbols")});var lv=Lt((Uot,fE)=>{"use strict";y();var hN=E_();fE.exports=u(function(){return hN()&&!!Symbol.toStringTag},"hasToStringTagShams")});var O_=Lt((Xot,dE)=>{"use strict";y();dE.exports=Object});var D_=Lt((qot,mE)=>{"use strict";y();mE.exports=Error});var yE=Lt((Zot,gE)=>{"use strict";y();gE.exports=EvalError});var bE=Lt((Jot,vE)=>{"use strict";y();vE.exports=RangeError});var _E=Lt((Qot,xE)=>{"use strict";y();xE.exports=ReferenceError});var L_=Lt((est,CE)=>{"use strict";y();CE.exports=SyntaxError});var xp=Lt((nst,SE)=>{"use strict";y();SE.exports=TypeError});var ME=Lt((ost,IE)=>{"use strict";y();IE.exports=URIError});var TE=Lt((ast,wE)=>{"use strict";y();wE.exports=Math.abs});var EE=Lt((ust,PE)=>{"use strict";y();PE.exports=Math.floor});var DE=Lt((pst,OE)=>{"use strict";y();OE.exports=Math.max});var AE=Lt((fst,LE)=>{"use strict";y();LE.exports=Math.min});var kE=Lt((mst,NE)=>{"use strict";y();NE.exports=Math.pow});var FE=Lt((yst,RE)=>{"use strict";y();RE.exports=Math.round});var GE=Lt((bst,BE)=>{"use strict";y();BE.exports=Number.isNaN||u(function(e){return e!==e},"isNaN")});var jE=Lt((Cst,VE)=>{"use strict";y();var fN=GE();VE.exports=u(function(e){return fN(e)||e===0?e:e<0?-1:1},"sign")});var zE=Lt((Mst,UE)=>{"use strict";y();UE.exports=Object.getOwnPropertyDescriptor});var _p=Lt((Tst,HE)=>{"use strict";y();var uv=zE();if(uv)try{uv([],"length")}catch(r){uv=null}HE.exports=uv});var fg=Lt((Est,XE)=>{"use strict";y();var cv=Object.defineProperty||!1;if(cv)try{cv({},"a",{value:1})}catch(r){cv=!1}XE.exports=cv});var WE=Lt((Dst,qE)=>{"use strict";y();var YE=typeof Symbol<"u"&&Symbol,dN=E_();qE.exports=u(function(){return typeof YE!="function"||typeof Symbol!="function"||typeof YE("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:dN()},"hasNativeSymbols")});var A_=Lt((Nst,ZE)=>{"use strict";y();ZE.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var N_=Lt((Rst,$E)=>{"use strict";y();var mN=O_();$E.exports=mN.getPrototypeOf||null});var QE=Lt((Bst,KE)=>{"use strict";y();var gN="Function.prototype.bind called on incompatible ",yN=Object.prototype.toString,vN=Math.max,bN="[object Function]",JE=u(function(e,t){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var a=0;a<t.length;a+=1)n[a+e.length]=t[a];return n},"concatty"),xN=u(function(e,t){for(var n=[],i=t||0,a=0;i<e.length;i+=1,a+=1)n[a]=e[i];return n},"slicy"),_N=u(function(r,e){for(var t="",n=0;n<r.length;n+=1)t+=r[n],n+1<r.length&&(t+=e);return t},"joiny");KE.exports=u(function(e){var t=this;if(typeof t!="function"||yN.apply(t)!==bN)throw new TypeError(gN+t);for(var n=xN(arguments,1),i,a=u(function(){if(this instanceof i){var v=t.apply(this,JE(n,arguments));return Object(v)===v?v:this}return t.apply(e,JE(n,arguments))},"binder"),l=vN(0,t.length-n.length),h=[],d=0;d<l;d++)h[d]="$"+d;if(i=Function("binder","return function ("+_N(h,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var m=u(function(){},"Empty");m.prototype=t.prototype,i.prototype=new m,m.prototype=null}return i},"bind")});var Wf=Lt((jst,t4)=>{"use strict";y();var CN=QE();t4.exports=Function.prototype.bind||CN});var pv=Lt((zst,e4)=>{"use strict";y();e4.exports=Function.prototype.call});var hv=Lt((Xst,r4)=>{"use strict";y();r4.exports=Function.prototype.apply});var i4=Lt((qst,n4)=>{"use strict";y();n4.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var k_=Lt((Zst,o4)=>{"use strict";y();var SN=Wf(),IN=hv(),MN=pv(),wN=i4();o4.exports=wN||SN.call(MN,IN)});var fv=Lt((Jst,s4)=>{"use strict";y();var TN=Wf(),PN=xp(),EN=pv(),ON=k_();s4.exports=u(function(e){if(e.length<1||typeof e[0]!="function")throw new PN("a function is required");return ON(TN,EN,e)},"callBindBasic")});var h4=Lt((tat,p4)=>{"use strict";y();var DN=fv(),a4=_p(),u4;try{u4=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var R_=!!u4&&a4&&a4(Object.prototype,"__proto__"),c4=Object,l4=c4.getPrototypeOf;p4.exports=R_&&typeof R_.get=="function"?DN([R_.get]):typeof l4=="function"?u(function(e){return l4(e==null?e:c4(e))},"getDunder"):!1});var F_=Lt((nat,g4)=>{"use strict";y();var f4=A_(),d4=N_(),m4=h4();g4.exports=f4?u(function(e){return f4(e)},"getProto"):d4?u(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return d4(e)},"getProto"):m4?u(function(e){return m4(e)},"getProto"):null});var B_=Lt((sat,y4)=>{"use strict";y();var LN=Function.prototype.call,AN=Object.prototype.hasOwnProperty,NN=Wf();y4.exports=NN.call(LN,AN)});var j_=Lt((lat,S4)=>{"use strict";y();var nr,kN=O_(),RN=D_(),FN=yE(),BN=bE(),GN=_E(),Kf=L_(),Jf=xp(),VN=ME(),jN=TE(),UN=EE(),zN=DE(),HN=AE(),XN=kE(),YN=FE(),qN=jE(),_4=Function,G_=u(function(r){try{return _4('"use strict"; return ('+r+").constructor;")()}catch(e){}},"getEvalledConstructor"),dg=_p(),WN=fg(),V_=u(function(){throw new Jf},"throwTypeError"),ZN=dg?function(){try{return arguments.callee,V_}catch(r){try{return dg(arguments,"callee").get}catch(e){return V_}}}():V_,Zf=WE()(),Ci=F_(),$N=N_(),JN=A_(),C4=hv(),mg=pv(),$f={},KN=typeof Uint8Array>"u"||!Ci?nr:Ci(Uint8Array),Cp={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?nr:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?nr:ArrayBuffer,"%ArrayIteratorPrototype%":Zf&&Ci?Ci([][Symbol.iterator]()):nr,"%AsyncFromSyncIteratorPrototype%":nr,"%AsyncFunction%":$f,"%AsyncGenerator%":$f,"%AsyncGeneratorFunction%":$f,"%AsyncIteratorPrototype%":$f,"%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%":RN,"%eval%":eval,"%EvalError%":FN,"%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%":_4,"%GeneratorFunction%":$f,"%Int8Array%":typeof Int8Array>"u"?nr:Int8Array,"%Int16Array%":typeof Int16Array>"u"?nr:Int16Array,"%Int32Array%":typeof Int32Array>"u"?nr:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Zf&&Ci?Ci(Ci([][Symbol.iterator]())):nr,"%JSON%":typeof JSON=="object"?JSON:nr,"%Map%":typeof Map>"u"?nr:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Zf||!Ci?nr:Ci(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":kN,"%Object.getOwnPropertyDescriptor%":dg,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?nr:Promise,"%Proxy%":typeof Proxy>"u"?nr:Proxy,"%RangeError%":BN,"%ReferenceError%":GN,"%Reflect%":typeof Reflect>"u"?nr:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?nr:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Zf||!Ci?nr:Ci(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?nr:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Zf&&Ci?Ci(""[Symbol.iterator]()):nr,"%Symbol%":Zf?Symbol:nr,"%SyntaxError%":Kf,"%ThrowTypeError%":ZN,"%TypedArray%":KN,"%TypeError%":Jf,"%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%":VN,"%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%":C4,"%Object.defineProperty%":WN,"%Object.getPrototypeOf%":$N,"%Math.abs%":jN,"%Math.floor%":UN,"%Math.max%":zN,"%Math.min%":HN,"%Math.pow%":XN,"%Math.round%":YN,"%Math.sign%":qN,"%Reflect.getPrototypeOf%":JN};if(Ci)try{null.error}catch(r){v4=Ci(Ci(r)),Cp["%Error.prototype%"]=v4}var v4,QN=u(function r(e){var t;if(e==="%AsyncFunction%")t=G_("async function () {}");else if(e==="%GeneratorFunction%")t=G_("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=G_("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&Ci&&(t=Ci(i.prototype))}return Cp[e]=t,t},"doEval"),b4={__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"]},gg=Wf(),dv=B_(),tk=gg.call(mg,Array.prototype.concat),ek=gg.call(C4,Array.prototype.splice),x4=gg.call(mg,String.prototype.replace),mv=gg.call(mg,String.prototype.slice),rk=gg.call(mg,RegExp.prototype.exec),nk=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ik=/\\(\\)?/g,ok=u(function(e){var t=mv(e,0,1),n=mv(e,-1);if(t==="%"&&n!=="%")throw new Kf("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Kf("invalid intrinsic syntax, expected opening `%`");var i=[];return x4(e,nk,function(a,l,h,d){i[i.length]=h?x4(d,ik,"$1"):l||a}),i},"stringToPath"),sk=u(function(e,t){var n=e,i;if(dv(b4,n)&&(i=b4[n],n="%"+i[0]+"%"),dv(Cp,n)){var a=Cp[n];if(a===$f&&(a=QN(n)),typeof a>"u"&&!t)throw new Jf("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Kf("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");S4.exports=u(function(e,t){if(typeof e!="string"||e.length===0)throw new Jf("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Jf('"allowMissing" argument must be a boolean');if(rk(/^%?[^%]*%?$/,e)===null)throw new Kf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ok(e),i=n.length>0?n[0]:"",a=sk("%"+i+"%",t),l=a.name,h=a.value,d=!1,m=a.alias;m&&(i=m[0],ek(n,tk([0,1],m)));for(var v=1,x=!0;v<n.length;v+=1){var S=n[v],I=mv(S,0,1),w=mv(S,-1);if((I==='"'||I==="'"||I==="`"||w==='"'||w==="'"||w==="`")&&I!==w)throw new Kf("property names with quotes must have matching quotes");if((S==="constructor"||!x)&&(d=!0),i+="."+S,l="%"+i+"%",dv(Cp,l))h=Cp[l];else if(h!=null){if(!(S in h)){if(!t)throw new Jf("base intrinsic for "+e+" exists, but the property is not available.");return}if(dg&&v+1>=n.length){var P=dg(h,S);x=!!P,x&&"get"in P&&!("originalValue"in P.get)?h=P.get:h=h[S]}else x=dv(h,S),h=h[S];x&&!d&&(Cp[l]=h)}}return h},"GetIntrinsic")});var gv=Lt((pat,w4)=>{"use strict";y();var I4=j_(),M4=fv(),ak=M4([I4("%String.prototype.indexOf%")]);w4.exports=u(function(e,t){var n=I4(e,!!t);return typeof n=="function"&&ak(e,".prototype.")>-1?M4([n]):n},"callBoundIntrinsic")});var E4=Lt((dat,P4)=>{"use strict";y();var lk=lv()(),uk=gv(),U_=uk("Object.prototype.toString"),yv=u(function(e){return lk&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:U_(e)==="[object Arguments]"},"isArguments"),T4=u(function(e){return yv(e)?!0:e!==null&&typeof e=="object"&&"length"in e&&typeof e.length=="number"&&e.length>=0&&U_(e)!=="[object Array]"&&"callee"in e&&U_(e.callee)==="[object Function]"},"isArguments"),ck=function(){return yv(arguments)}();yv.isLegacyArguments=T4;P4.exports=ck?yv:T4});var vv=Lt((yat,L4)=>{"use strict";y();var O4=fg(),pk=L_(),Qf=xp(),D4=_p();L4.exports=u(function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Qf("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Qf("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Qf("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Qf("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Qf("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Qf("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,d=!!D4&&D4(e,t);if(O4)O4(e,t,{configurable:l===null&&d?d.configurable:!l,enumerable:i===null&&d?d.enumerable:!i,value:n,writable:a===null&&d?d.writable:!a});else if(h||!i&&!a&&!l)e[t]=n;else throw new pk("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var bv=Lt((xat,N4)=>{"use strict";y();var z_=fg(),A4=u(function(){return!!z_},"hasPropertyDescriptors");A4.hasArrayLengthDefineBug=u(function(){if(!z_)return null;try{return z_([],"length",{value:1}).length!==1}catch(e){return!0}},"hasArrayLengthDefineBug");N4.exports=A4});var td=Lt((Sat,B4)=>{"use strict";y();var hk=P_(),fk=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",dk=Object.prototype.toString,mk=Array.prototype.concat,k4=vv(),gk=u(function(r){return typeof r=="function"&&dk.call(r)==="[object Function]"},"isFunction"),R4=bv()(),yk=u(function(r,e,t,n){if(e in r){if(n===!0){if(r[e]===t)return}else if(!gk(n)||!n())return}R4?k4(r,e,t,!0):k4(r,e,t)},"defineProperty"),F4=u(function(r,e){var t=arguments.length>2?arguments[2]:{},n=hk(e);fk&&(n=mk.call(n,Object.getOwnPropertySymbols(e)));for(var i=0;i<n.length;i+=1)yk(r,n[i],e[n[i]],t[n[i]])},"defineProperties");F4.supportsDescriptors=!!R4;B4.exports=F4});var z4=Lt((wat,U4)=>{"use strict";y();var vk=j_(),G4=vv(),bk=bv()(),V4=_p(),j4=xp(),xk=vk("%Math.floor%");U4.exports=u(function(e,t){if(typeof e!="function")throw new j4("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||xk(t)!==t)throw new j4("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,a=!0;if("length"in e&&V4){var l=V4(e,"length");l&&!l.configurable&&(i=!1),l&&!l.writable&&(a=!1)}return(i||a||!n)&&(bk?G4(e,"length",t,!0,!0):G4(e,"length",t)),e},"setFunctionLength")});var X4=Lt((Eat,H4)=>{"use strict";y();var _k=Wf(),Ck=hv(),Sk=k_();H4.exports=u(function(){return Sk(_k,Ck,arguments)},"applyBind")});var H_=Lt((Lat,xv)=>{"use strict";y();var Ik=z4(),Y4=fg(),Mk=fv(),q4=X4();xv.exports=u(function(e){var t=Mk(arguments),n=e.length-(arguments.length-1);return Ik(t,1+(n>0?n:0),!0)},"callBind");Y4?Y4(xv.exports,"apply",{value:q4}):xv.exports.apply=q4});var X_=Lt((kat,Z4)=>{"use strict";y();var W4=u(function(r){return r!==r},"numberIsNaN");Z4.exports=u(function(e,t){return e===0&&t===0?1/e===1/t:!!(e===t||W4(e)&&W4(t))},"is")});var Y_=Lt((Bat,$4)=>{"use strict";y();var wk=X_();$4.exports=u(function(){return typeof Object.is=="function"?Object.is:wk},"getPolyfill")});var K4=Lt((jat,J4)=>{"use strict";y();var Tk=Y_(),Pk=td();J4.exports=u(function(){var e=Tk();return Pk(Object,{is:e},{is:u(function(){return Object.is!==e},"testObjectIs")}),e},"shimObjectIs")});var r5=Lt((Hat,e5)=>{"use strict";y();var Ek=td(),Ok=H_(),Dk=X_(),Q4=Y_(),Lk=K4(),t5=Ok(Q4(),Object);Ek(t5,{getPolyfill:Q4,implementation:Dk,shim:Lk});e5.exports=t5});var l5=Lt((Yat,a5)=>{"use strict";y();var n5=gv(),Ak=lv()(),Nk=B_(),kk=_p(),Z_;Ak?(i5=n5("RegExp.prototype.exec"),q_={},_v=u(function(){throw q_},"throwRegexMarker"),W_={toString:_v,valueOf:_v},typeof Symbol.toPrimitive=="symbol"&&(W_[Symbol.toPrimitive]=_v),Z_=u(function(e){if(!e||typeof e!="object")return!1;var t=kk(e,"lastIndex"),n=t&&Nk(t,"value");if(!n)return!1;try{i5(e,W_)}catch(i){return i===q_}},"isRegex")):(o5=n5("Object.prototype.toString"),s5="[object RegExp]",Z_=u(function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:o5(e)===s5},"isRegex"));var i5,q_,_v,W_,o5,s5;a5.exports=Z_});var c5=Lt((Zat,u5)=>{"use strict";y();var vg=u(function(){return typeof u(function(){},"f").name=="string"},"functionsHaveNames"),yg=Object.getOwnPropertyDescriptor;if(yg)try{yg([],"length")}catch(r){yg=null}vg.functionsHaveConfigurableNames=u(function(){if(!vg()||!yg)return!1;var e=yg(function(){},"name");return!!e&&!!e.configurable},"functionsHaveConfigurableNames");var Rk=Function.prototype.bind;vg.boundFunctionsHaveNames=u(function(){return vg()&&typeof Rk=="function"&&u(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");u5.exports=vg});var f5=Lt((Kat,h5)=>{"use strict";y();var p5=vv(),Fk=bv()(),Bk=c5().functionsHaveConfigurableNames(),Gk=xp();h5.exports=u(function(e,t){if(typeof e!="function")throw new Gk("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||Bk)&&(Fk?p5(e,"name",t,!0,!0):p5(e,"name",t)),e},"setFunctionName")});var $_=Lt((elt,d5)=>{"use strict";y();var Vk=f5(),jk=xp(),Uk=Object;d5.exports=Vk(u(function(){if(this==null||this!==Uk(this))throw new jk("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"flags"),"get flags",!0)});var J_=Lt((ilt,m5)=>{"use strict";y();var zk=$_(),Hk=td().supportsDescriptors,Xk=Object.getOwnPropertyDescriptor;m5.exports=u(function(){if(Hk&&/a/mig.flags==="gim"){var e=Xk(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var t="",n={};if(Object.defineProperty(n,"hasIndices",{get:u(function(){t+="d"},"get")}),Object.defineProperty(n,"sticky",{get:u(function(){t+="y"},"get")}),e.get.call(n),t==="dy")return e.get}}return zk},"getPolyfill")});var v5=Lt((alt,y5)=>{"use strict";y();var Yk=td().supportsDescriptors,qk=J_(),Wk=_p(),Zk=Object.defineProperty,$k=D_(),g5=F_(),Jk=/a/;y5.exports=u(function(){if(!Yk||!g5)throw new $k("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=qk(),t=g5(Jk),n=Wk(t,"flags");return(!n||n.get!==e)&&Zk(t,"flags",{configurable:!0,enumerable:!1,get:e}),e},"shimFlags")});var C5=Lt((clt,_5)=>{"use strict";y();var Kk=td(),Qk=H_(),tR=$_(),b5=J_(),eR=v5(),x5=Qk(b5());Kk(x5,{getPolyfill:b5,implementation:tR,shim:eR});_5.exports=x5});var M5=Lt((hlt,I5)=>{"use strict";y();var S5=gv(),rR=S5("Date.prototype.getDay"),nR=u(function(e){try{return rR(e),!0}catch(t){return!1}},"tryDateGetDayCall"),iR=S5("Object.prototype.toString"),oR="[object Date]",sR=lv()();I5.exports=u(function(e){return typeof e!="object"||e===null?!1:sR?nR(e):iR(e)===oR},"isDateObject")});var K_=Lt((mlt,R5)=>{y();var w5=P_(),T5=E4(),P5=r5(),E5=l5(),O5=C5(),D5=M5(),L5=Date.prototype.getTime;function k5(r,e,t){var n=t||{};return(n.strict?P5(r,e):r===e)?!0:!r||!e||typeof r!="object"&&typeof e!="object"?n.strict?P5(r,e):r==e:aR(r,e,n)}u(k5,"deepEqual");function A5(r){return r==null}u(A5,"isUndefinedOrNull");function N5(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")}u(N5,"isBuffer");function aR(r,e,t){var n,i;if(typeof r!=typeof e||A5(r)||A5(e)||r.prototype!==e.prototype||T5(r)!==T5(e))return!1;var a=E5(r),l=E5(e);if(a!==l)return!1;if(a||l)return r.source===e.source&&O5(r)===O5(e);if(D5(r)&&D5(e))return L5.call(r)===L5.call(e);var h=N5(r),d=N5(e);if(h!==d)return!1;if(h||d){if(r.length!==e.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}if(typeof r!=typeof e)return!1;try{var m=w5(r),v=w5(e)}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],!k5(r[i],e[i],t))return!1;return!0}u(aR,"objEquiv");R5.exports=k5});var pC=Lt((cpt,H5)=>{y();var nF=K_(),Ha=u(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:iF},"Equality");Ha.prototype.compare=function(r,e){if(r.type!==e.type||!z5(r,e))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,e.coordinates);case"LineString":return this.compareLine(r.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,e);case"Feature":return this.compareFeature(r,e);default:if(r.type.indexOf("Multi")===0){var t=this,n=U5(r),i=U5(e);return n.every(function(a){return this.some(function(l){return t.compare(a,l)})},i)}}return!1};function U5(r){return r.coordinates.map(function(e){return{type:r.type.replace("Multi",""),coordinates:e}})}u(U5,"explode");function z5(r,e){return r.hasOwnProperty("coordinates")?r.coordinates.length===e.coordinates.length:r.length===e.length}u(z5,"sameLength");Ha.prototype.compareCoord=function(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(r[t].toFixed(this.precision)!==e[t].toFixed(this.precision))return!1;return!0};Ha.prototype.compareLine=function(r,e,t,n){if(!z5(r,e))return!1;var i=this.pseudoNode?r:this.removePseudo(r),a=this.pseudoNode?e:this.removePseudo(e);if(!(n&&!this.compareCoord(i[0],a[0])&&(a=this.fixStartIndex(a,i),!a))){var l=this.compareCoord(i[t],a[t]);return this.direction||l?this.comparePath(i,a):this.compareCoord(i[t],a[a.length-(1+t)])?this.comparePath(i.slice().reverse(),a):!1}};Ha.prototype.fixStartIndex=function(r,e){for(var t,n=-1,i=0;i<r.length;i++)if(this.compareCoord(r[i],e[0])){n=i;break}return n>=0&&(t=[].concat(r.slice(n,r.length),r.slice(1,n+1))),t};Ha.prototype.comparePath=function(r,e){var t=this;return r.every(function(n,i){return t.compareCoord(n,this[i])},e)};Ha.prototype.comparePolygon=function(r,e){if(this.compareLine(r.coordinates[0],e.coordinates[0],1,!0)){var t=r.coordinates.slice(1,r.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length),i=this;return t.every(function(a){return this.some(function(l){return i.compareLine(a,l,1,!0)})},n)}else return!1};Ha.prototype.compareFeature=function(r,e){return r.id!==e.id||!this.objectComparator(r.properties,e.properties)||!this.compareBBox(r,e)?!1:this.compare(r.geometry,e.geometry)};Ha.prototype.compareBBox=function(r,e){return!!(!r.bbox&&!e.bbox||r.bbox&&e.bbox&&this.compareCoord(r.bbox,e.bbox))};Ha.prototype.removePseudo=function(r){return r};function iF(r,e){return nF(r,e,{strict:!0})}u(iF,"objectComparator");H5.exports=Ha});var X5=Lt((Opt,Iv)=>{y();function ac(r,e,t,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,e,t,n)}u(ac,"DBSCAN");ac.prototype.run=function(r,e,t,n){this._init(r,e,t,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 l=this.clusters.length;this.clusters.push([]),this._addToCluster(i,l),this._expandCluster(l,a)}}return this.clusters};ac.prototype._init=function(r,e,t,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)}e&&(this.epsilon=e),t&&(this.minPts=t),n&&(this.distance=n)};ac.prototype._expandCluster=function(r,e){for(var t=0;t<e.length;t++){var n=e[t];if(this._visited[n]!==1){this._visited[n]=1;var i=this._regionQuery(n);i.length>=this.minPts&&(e=this._mergeArrays(e,i))}this._assigned[n]!==1&&this._addToCluster(n,r)}};ac.prototype._addToCluster=function(r,e){this.clusters[e].push(r),this._assigned[r]=1};ac.prototype._regionQuery=function(r){for(var e=[],t=0;t<this._datasetLength;t++){var n=this.distance(this.dataset[r],this.dataset[t]);n<this.epsilon&&e.push(t)}return e};ac.prototype._mergeArrays=function(r,e){for(var t=e.length,n=0;n<t;n++){var i=e[n];r.indexOf(i)<0&&r.push(i)}return r};ac.prototype._euclideanDistance=function(r,e){for(var t=0,n=Math.min(r.length,e.length);n--;)t+=(r[n]-e[n])*(r[n]-e[n]);return Math.sqrt(t)};typeof Iv<"u"&&Iv.exports&&(Iv.exports=ac)});var Y5=Lt((Apt,Mv)=>{y();function lc(r,e,t){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,e,t)}u(lc,"KMEANS");lc.prototype.init=function(r,e,t){this.assignments=[],this.centroids=[],typeof r<"u"&&(this.dataset=r),typeof e<"u"&&(this.k=e),typeof t<"u"&&(this.distance=t)};lc.prototype.run=function(r,e){this.init(r,e);for(var t=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 l=new Array(v),h=0,d=0;d<v;d++)l[d]=0;for(var m=0;m<t;m++){var v=this.dataset[m].length;if(a===this.assignments[m]){for(var d=0;d<v;d++)l[d]+=this.dataset[m][d];h++}}if(h>0){for(var d=0;d<v;d++)l[d]/=h;this.centroids[a]=l}else this.centroids[a]=this.randomCentroid(),i=!0}}return this.getClusters()};lc.prototype.randomCentroid=function(){var r=this.dataset.length-1,e,t;do t=Math.round(Math.random()*r),e=this.dataset[t];while(this.centroids.indexOf(e)>=0);return e};lc.prototype.assign=function(){for(var r=!1,e=this.dataset.length,t,n=0;n<e;n++)t=this.argmin(this.dataset[n],this.centroids,this.distance),t!=this.assignments[n]&&(this.assignments[n]=t,r=!0);return r};lc.prototype.getClusters=function(){for(var r=new Array(this.k),e,t=0;t<this.assignments.length;t++)e=this.assignments[t],typeof r[e]>"u"&&(r[e]=[]),r[e].push(t);return r};lc.prototype.argmin=function(r,e,t){for(var n=Number.MAX_VALUE,i=0,a=e.length,l,h=0;h<a;h++)l=t(r,e[h]),l<n&&(n=l,i=h);return i};lc.prototype.distance=function(r,e){for(var t=0,n=Math.min(r.length,e.length);n--;){var i=r[n]-e[n];t+=i*i}return Math.sqrt(t)};typeof Mv<"u"&&Mv.exports&&(Mv.exports=lc)});var hC=Lt((Rpt,wv)=>{y();function Xa(r,e,t){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,e,t)}u(Xa,"PriorityQueue");Xa.prototype.insert=function(r,e){for(var t=this._queue.length,n=t;n--;){var i=this._priorities[n];this._sorting==="desc"?e>i&&(t=n):e<i&&(t=n)}this._insertAt(r,e,t)};Xa.prototype.remove=function(r){for(var e=this._queue.length;e--;){var t=this._queue[e];if(r===t){this._queue.splice(e,1),this._priorities.splice(e,1);break}}};Xa.prototype.forEach=function(r){this._queue.forEach(r)};Xa.prototype.getElements=function(){return this._queue};Xa.prototype.getElementPriority=function(r){return this._priorities[r]};Xa.prototype.getPriorities=function(){return this._priorities};Xa.prototype.getElementsWithPriorities=function(){for(var r=[],e=0,t=this._queue.length;e<t;e++)r.push([this._queue[e],this._priorities[e]]);return r};Xa.prototype._init=function(r,e,t){if(r&&e){if(this._queue=[],this._priorities=[],r.length!==e.length)throw new Error("Arrays must have the same length");for(var n=0;n<r.length;n++)this.insert(r[n],e[n])}t&&(this._sorting=t)};Xa.prototype._insertAt=function(r,e,t){this._queue.length===t?(this._queue.push(r),this._priorities.push(e)):(this._queue.splice(t,0,r),this._priorities.splice(t,0,e))};typeof wv<"u"&&wv.exports&&(wv.exports=Xa)});var W5=Lt((Gpt,rd)=>{y();typeof rd<"u"&&rd.exports&&(q5=hC());var q5;function Xl(r,e,t,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,e,t,n)}u(Xl,"OPTICS");Xl.prototype.run=function(r,e,t,n){this._init(r,e,t,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 l=this.clusters.length-1;this._orderedList.push(i);var h=new q5(null,null,"asc"),d=this._regionQuery(i);this._distanceToCore(i)!==void 0&&(this._updateQueue(i,d,h),this._expandCluster(l,h))}return this.clusters};Xl.prototype.getReachabilityPlot=function(){for(var r=[],e=0,t=this._orderedList.length;e<t;e++){var n=this._orderedList[e],i=this._reachability[n];r.push([n,i])}return r};Xl.prototype._init=function(r,e,t,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=[]}e&&(this.epsilon=e),t&&(this.minPts=t),n&&(this.distance=n)};Xl.prototype._updateQueue=function(r,e,t){var n=this;this._coreDistance=this._distanceToCore(r),e.forEach(function(i){if(n._processed[i]===void 0){var a=n.distance(n.dataset[r],n.dataset[i]),l=Math.max(n._coreDistance,a);n._reachability[i]===void 0?(n._reachability[i]=l,t.insert(i,l)):l<n._reachability[i]&&(n._reachability[i]=l,t.remove(i),t.insert(i,l))}})};Xl.prototype._expandCluster=function(r,e){for(var t=e.getElements(),n=0,i=t.length;n<i;n++){var a=t[n];if(this._processed[a]===void 0){var l=this._regionQuery(a);this._processed[a]=1,this.clusters[r].push(a),this._orderedList.push(a),this._distanceToCore(a)!==void 0&&(this._updateQueue(a,l,e),this._expandCluster(r,e))}}};Xl.prototype._distanceToCore=function(r){for(var e=this.epsilon,t=0;t<e;t++){var n=this._regionQuery(r,t);if(n.length>=this.minPts)return t}};Xl.prototype._regionQuery=function(r,e){e=e||this.epsilon;for(var t=[],n=0,i=this.dataset.length;n<i;n++)this.distance(this.dataset[r],this.dataset[n])<e&&t.push(n);return t};Xl.prototype._euclideanDistance=function(r,e){for(var t=0,n=Math.min(r.length,e.length);n--;)t+=(r[n]-e[n])*(r[n]-e[n]);return Math.sqrt(t)};typeof rd<"u"&&rd.exports&&(rd.exports=Xl)});var Z5=Lt((Upt,Tv)=>{y();typeof Tv<"u"&&Tv.exports&&(Tv.exports={DBSCAN:X5(),KMEANS:Y5(),OPTICS:W5(),PriorityQueue:hC()})});var fC=Lt((Jpt,J5)=>{"use strict";y();J5.exports={eudist:u(function(e,t,n){for(var i=e.length,a=0,l=0;l<i;l++){var h=(e[l]||0)-(t[l]||0);a+=h*h}return n?Math.sqrt(a):a},"eudist"),mandist:u(function(e,t,n){for(var i=e.length,a=0,l=0;l<i;l++)a+=Math.abs((e[l]||0)-(t[l]||0));return n?Math.sqrt(a):a},"mandist"),dist:u(function(e,t,n){var i=Math.abs(e-t);return n?i:i*i},"dist")}});var t6=Lt((tht,Q5)=>{"use strict";y();var K5=fC(),uF=K5.eudist,cF=K5.dist;Q5.exports={kmrand:u(function(e,t){for(var n={},i=[],a=t<<2,l=e.length,h=e[0].length>0;i.length<t&&a-- >0;){var d=e[Math.floor(Math.random()*l)],m=h?d.join("_"):""+d;n[m]||(n[m]=!0,i.push(d))}if(i.length<t)throw new Error("Error initializating clusters");return i},"kmrand"),kmpp:u(function(e,t){var n=e[0].length?uF:cF,i=[],a=e.length,l=e[0].length>0,h={},d=e[Math.floor(Math.random()*a)],m=l?d.join("_"):""+d;for(i.push(d),h[m]=!0;i.length<t;){for(var v=[],x=i.length,S=0,I=[],w=0;w<a;w++){for(var P=1/0,E=0;E<x;E++){var O=n(e[w],i[E]);O<=P&&(P=O)}v[w]=P}for(var N=0;N<a;N++)S+=v[N];for(var L=0;L<a;L++)I[L]={i:L,v:e[L],pr:v[L]/S,cs:0};I.sort(function(q,k){return q.pr-k.pr}),I[0].cs=I[0].pr;for(var G=1;G<a;G++)I[G].cs=I[G-1].cs+I[G].pr;for(var j=Math.random(),$=0;$<a-1&&I[$++].cs<j;);i.push(I[$-1].v)}return i},"kmpp")}});var o6=Lt((oht,i6)=>{"use strict";y();var dC=fC(),n6=t6(),pF=dC.eudist,nht=dC.mandist,iht=dC.dist,hF=n6.kmrand,fF=n6.kmpp,e6=1e4;function r6(r,e,t){t=t||[];for(var n=0;n<r;n++)t[n]=e;return t}u(r6,"init");function dF(r,e,t,n){var i=[],a=[],l=[],h=[],d=!1,m=n||e6,v=r.length,x=r[0].length,S=x>0,I=[];if(t)t=="kmrand"?i=hF(r,e):t=="kmpp"?i=fF(r,e):i=t;else for(var w={};i.length<e;){var P=Math.floor(Math.random()*v);w[P]||(w[P]=!0,i.push(r[P]))}do{r6(e,0,I);for(var E=0;E<v;E++){for(var O=1/0,N=0,L=0;L<e;L++){var h=S?pF(r[E],i[L]):Math.abs(r[E]-i[L]);h<=O&&(O=h,N=L)}l[E]=N,I[N]++}for(var G=[],a=[],j=0,$=0;$<e;$++)G[$]=S?r6(x,0,G[$]):0,a[$]=i[$];if(S){for(var q=0;q<e;q++)i[q]=[];for(var k=0;k<v;k++)for(var tt=l[k],ut=G[tt],at=r[k],H=0;H<x;H++)ut[H]+=at[H];d=!0;for(var St=0;St<e;St++){for(var pt=i[St],ct=G[St],It=a[St],Et=I[St],dt=0;dt<x;dt++)pt[dt]=ct[dt]/Et||0;if(d){for(var bt=0;bt<x;bt++)if(It[bt]!=pt[bt]){d=!1;break}}}}else{for(var Z=0;Z<v;Z++){var te=l[Z];G[te]+=r[Z]}for(var jt=0;jt<e;jt++)i[jt]=G[jt]/I[jt]||0;d=!0;for(var ee=0;ee<e;ee++)if(a[ee]!=i[ee]){d=!1;break}}d=d||--m<=0}while(!d);return{it:e6-m,k:e,idxs:l,centroids:i}}u(dF,"skmeans");i6.exports=dF});var ad=Lt((xC,_C)=>{y();(function(r,e){typeof xC=="object"&&typeof _C<"u"?_C.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis<"u"?globalThis:r||self,r.polygonClipping=e())})(xC,function(){"use strict";function r(Q,D){var R={label:0,sent:u(function(){if(X[0]&1)throw X[1];return X[1]},"sent"),trys:[],ops:[]},U,Y,X,ht;return ht={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(ht[Symbol.iterator]=function(){return this}),ht;function st(ft){return function(Rt){return yt([ft,Rt])}}function yt(ft){if(U)throw new TypeError("Generator is already executing.");for(;R;)try{if(U=1,Y&&(X=ft[0]&2?Y.return:ft[0]?Y.throw||((X=Y.return)&&X.call(Y),0):Y.next)&&!(X=X.call(Y,ft[1])).done)return X;switch(Y=0,X&&(ft=[ft[0]&2,X.value]),ft[0]){case 0:case 1:X=ft;break;case 4:return R.label++,{value:ft[1],done:!1};case 5:R.label++,Y=ft[1],ft=[0];continue;case 7:ft=R.ops.pop(),R.trys.pop();continue;default:if(X=R.trys,!(X=X.length>0&&X[X.length-1])&&(ft[0]===6||ft[0]===2)){R=0;continue}if(ft[0]===3&&(!X||ft[1]>X[0]&&ft[1]<X[3])){R.label=ft[1];break}if(ft[0]===6&&R.label<X[1]){R.label=X[1],X=ft;break}if(X&&R.label<X[2]){R.label=X[2],R.ops.push(ft);break}X[2]&&R.ops.pop(),R.trys.pop();continue}ft=D.call(Q,R)}catch(Rt){ft=[6,Rt],Y=0}finally{U=X=0}if(ft[0]&5)throw ft[1];return{value:ft[0]?ft[1]:void 0,done:!0}}}u(r,"__generator");var e=function(){function Q(D,R){this.next=null,this.key=D,this.data=R,this.left=null,this.right=null}return u(Q,"Node"),Q}();function t(Q,D){return Q>D?1:Q<D?-1:0}u(t,"DEFAULT_COMPARE");function n(Q,D,R){for(var U=new e(null,null),Y=U,X=U;;){var ht=R(Q,D.key);if(ht<0){if(D.left===null)break;if(R(Q,D.left.key)<0){var st=D.left;if(D.left=st.right,st.right=D,D=st,D.left===null)break}X.left=D,X=D,D=D.left}else if(ht>0){if(D.right===null)break;if(R(Q,D.right.key)>0){var st=D.right;if(D.right=st.left,st.left=D,D=st,D.right===null)break}Y.right=D,Y=D,D=D.right}else break}return Y.right=D.left,X.left=D.right,D.left=U.right,D.right=U.left,D}u(n,"splay");function i(Q,D,R,U){var Y=new e(Q,D);if(R===null)return Y.left=Y.right=null,Y;R=n(Q,R,U);var X=U(Q,R.key);return X<0?(Y.left=R.left,Y.right=R,R.left=null):X>=0&&(Y.right=R.right,Y.left=R,R.right=null),Y}u(i,"insert");function a(Q,D,R){var U=null,Y=null;if(D){D=n(Q,D,R);var X=R(D.key,Q);X===0?(U=D.left,Y=D.right):X<0?(Y=D.right,D.right=null,U=D):(U=D.left,D.left=null,Y=D)}return{left:U,right:Y}}u(a,"split");function l(Q,D,R){return D===null?Q:(Q===null||(D=n(Q.key,D,R),D.left=Q),D)}u(l,"merge");function h(Q,D,R,U,Y){if(Q){U(""+D+(R?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+Y(Q)+"\n");var X=D+(R?" ":"\u2502 ");Q.left&&h(Q.left,X,!1,U,Y),Q.right&&h(Q.right,X,!0,U,Y)}}u(h,"printRow");var d=function(){function Q(D){D===void 0&&(D=t),this._root=null,this._size=0,this._comparator=D}return u(Q,"Tree"),Q.prototype.insert=function(D,R){return this._size++,this._root=i(D,R,this._root,this._comparator)},Q.prototype.add=function(D,R){var U=new e(D,R);this._root===null&&(U.left=U.right=null,this._size++,this._root=U);var Y=this._comparator,X=n(D,this._root,Y),ht=Y(D,X.key);return ht===0?this._root=X:(ht<0?(U.left=X.left,U.right=X,X.left=null):ht>0&&(U.right=X.right,U.left=X,X.right=null),this._size++,this._root=U),this._root},Q.prototype.remove=function(D){this._root=this._remove(D,this._root,this._comparator)},Q.prototype._remove=function(D,R,U){var Y;if(R===null)return null;R=n(D,R,U);var X=U(D,R.key);return X===0?(R.left===null?Y=R.right:(Y=n(D,R.left,U),Y.right=R.right),this._size--,Y):R},Q.prototype.pop=function(){var D=this._root;if(D){for(;D.left;)D=D.left;return this._root=n(D.key,this._root,this._comparator),this._root=this._remove(D.key,this._root,this._comparator),{key:D.key,data:D.data}}return null},Q.prototype.findStatic=function(D){for(var R=this._root,U=this._comparator;R;){var Y=U(D,R.key);if(Y===0)return R;Y<0?R=R.left:R=R.right}return null},Q.prototype.find=function(D){return this._root&&(this._root=n(D,this._root,this._comparator),this._comparator(D,this._root.key)!==0)?null:this._root},Q.prototype.contains=function(D){for(var R=this._root,U=this._comparator;R;){var Y=U(D,R.key);if(Y===0)return!0;Y<0?R=R.left:R=R.right}return!1},Q.prototype.forEach=function(D,R){for(var U=this._root,Y=[],X=!1;!X;)U!==null?(Y.push(U),U=U.left):Y.length!==0?(U=Y.pop(),D.call(R,U),U=U.right):X=!0;return this},Q.prototype.range=function(D,R,U,Y){for(var X=[],ht=this._comparator,st=this._root,yt;X.length!==0||st;)if(st)X.push(st),st=st.left;else{if(st=X.pop(),yt=ht(st.key,R),yt>0)break;if(ht(st.key,D)>=0&&U.call(Y,st))return this;st=st.right}return this},Q.prototype.keys=function(){var D=[];return this.forEach(function(R){var U=R.key;return D.push(U)}),D},Q.prototype.values=function(){var D=[];return this.forEach(function(R){var U=R.data;return D.push(U)}),D},Q.prototype.min=function(){return this._root?this.minNode(this._root).key:null},Q.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},Q.prototype.minNode=function(D){if(D===void 0&&(D=this._root),D)for(;D.left;)D=D.left;return D},Q.prototype.maxNode=function(D){if(D===void 0&&(D=this._root),D)for(;D.right;)D=D.right;return D},Q.prototype.at=function(D){for(var R=this._root,U=!1,Y=0,X=[];!U;)if(R)X.push(R),R=R.left;else if(X.length>0){if(R=X.pop(),Y===D)return R;Y++,R=R.right}else U=!0;return null},Q.prototype.next=function(D){var R=this._root,U=null;if(D.right){for(U=D.right;U.left;)U=U.left;return U}for(var Y=this._comparator;R;){var X=Y(D.key,R.key);if(X===0)break;X<0?(U=R,R=R.left):R=R.right}return U},Q.prototype.prev=function(D){var R=this._root,U=null;if(D.left!==null){for(U=D.left;U.right;)U=U.right;return U}for(var Y=this._comparator;R;){var X=Y(D.key,R.key);if(X===0)break;X<0?R=R.left:(U=R,R=R.right)}return U},Q.prototype.clear=function(){return this._root=null,this._size=0,this},Q.prototype.toList=function(){return x(this._root)},Q.prototype.load=function(D,R,U){R===void 0&&(R=[]),U===void 0&&(U=!1);var Y=D.length,X=this._comparator;if(U&&w(D,R,0,Y-1,X),this._root===null)this._root=m(D,R,0,Y),this._size=Y;else{var ht=I(this.toList(),v(D,R),X);Y=this._size+Y,this._root=S({head:ht},0,Y)}return this},Q.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(Q.prototype,"size",{get:u(function(){return this._size},"get"),enumerable:!0,configurable:!0}),Object.defineProperty(Q.prototype,"root",{get:u(function(){return this._root},"get"),enumerable:!0,configurable:!0}),Q.prototype.toString=function(D){D===void 0&&(D=u(function(U){return String(U.key)},"printNode"));var R=[];return h(this._root,"",!0,function(U){return R.push(U)},D),R.join("")},Q.prototype.update=function(D,R,U){var Y=this._comparator,X=a(D,this._root,Y),ht=X.left,st=X.right;Y(D,R)<0?st=i(R,U,st,Y):ht=i(R,U,ht,Y),this._root=l(ht,st,Y)},Q.prototype.split=function(D){return a(D,this._root,this._comparator)},Q.prototype[Symbol.iterator]=function(){var D,R,U;return r(this,function(Y){switch(Y.label){case 0:D=this._root,R=[],U=!1,Y.label=1;case 1:return U?[3,6]:D===null?[3,2]:(R.push(D),D=D.left,[3,5]);case 2:return R.length===0?[3,4]:(D=R.pop(),[4,D]);case 3:return Y.sent(),D=D.right,[3,5];case 4:U=!0,Y.label=5;case 5:return[3,1];case 6:return[2]}})},Q}();function m(Q,D,R,U){var Y=U-R;if(Y>0){var X=R+Math.floor(Y/2),ht=Q[X],st=D[X],yt=new e(ht,st);return yt.left=m(Q,D,R,X),yt.right=m(Q,D,X+1,U),yt}return null}u(m,"loadRecursive");function v(Q,D){for(var R=new e(null,null),U=R,Y=0;Y<Q.length;Y++)U=U.next=new e(Q[Y],D[Y]);return U.next=null,R.next}u(v,"createList");function x(Q){for(var D=Q,R=[],U=!1,Y=new e(null,null),X=Y;!U;)D?(R.push(D),D=D.left):R.length>0?(D=X=X.next=R.pop(),D=D.right):U=!0;return X.next=null,Y.next}u(x,"toList");function S(Q,D,R){var U=R-D;if(U>0){var Y=D+Math.floor(U/2),X=S(Q,D,Y),ht=Q.head;return ht.left=X,Q.head=Q.head.next,ht.right=S(Q,Y+1,R),ht}return null}u(S,"sortedListToBST");function I(Q,D,R){for(var U=new e(null,null),Y=U,X=Q,ht=D;X!==null&&ht!==null;)R(X.key,ht.key)<0?(Y.next=X,X=X.next):(Y.next=ht,ht=ht.next),Y=Y.next;return X!==null?Y.next=X:ht!==null&&(Y.next=ht),U.next}u(I,"mergeLists");function w(Q,D,R,U,Y){if(!(R>=U)){for(var X=Q[R+U>>1],ht=R-1,st=U+1;;){do ht++;while(Y(Q[ht],X)<0);do st--;while(Y(Q[st],X)>0);if(ht>=st)break;var yt=Q[ht];Q[ht]=Q[st],Q[st]=yt,yt=D[ht],D[ht]=D[st],D[st]=yt}w(Q,D,R,st,Y),w(Q,D,st+1,U,Y)}}u(w,"sort");let P=u((Q,D)=>Q.ll.x<=D.x&&D.x<=Q.ur.x&&Q.ll.y<=D.y&&D.y<=Q.ur.y,"isInBbox"),E=u((Q,D)=>{if(D.ur.x<Q.ll.x||Q.ur.x<D.ll.x||D.ur.y<Q.ll.y||Q.ur.y<D.ll.y)return null;let R=Q.ll.x<D.ll.x?D.ll.x:Q.ll.x,U=Q.ur.x<D.ur.x?Q.ur.x:D.ur.x,Y=Q.ll.y<D.ll.y?D.ll.y:Q.ll.y,X=Q.ur.y<D.ur.y?Q.ur.y:D.ur.y;return{ll:{x:R,y:Y},ur:{x:U,y:X}}},"getBboxOverlap"),O=Number.EPSILON;O===void 0&&(O=Math.pow(2,-52));let N=O*O,L=u((Q,D)=>{if(-O<Q&&Q<O&&-O<D&&D<O)return 0;let R=Q-D;return R*R<N*Q*D?0:Q<D?-1:1},"cmp"),Oi=class Oi{constructor(){this.reset()}reset(){this.xRounder=new j,this.yRounder=new j}round(D,R){return{x:this.xRounder.round(D),y:this.yRounder.round(R)}}};u(Oi,"PtRounder");let G=Oi,jn=class jn{constructor(){this.tree=new d,this.round(0)}round(D){let R=this.tree.add(D),U=this.tree.prev(R);if(U!==null&&L(R.key,U.key)===0)return this.tree.remove(D),U.key;let Y=this.tree.next(R);return Y!==null&&L(R.key,Y.key)===0?(this.tree.remove(D),Y.key):D}};u(jn,"CoordRounder");let j=jn,$=new G,q=11102230246251565e-32,k=134217729,tt=(3+8*q)*q;function ut(Q,D,R,U,Y){let X,ht,st,yt,ft=D[0],Rt=U[0],ot=0,vt=0;Rt>ft==Rt>-ft?(X=ft,ft=D[++ot]):(X=Rt,Rt=U[++vt]);let mt=0;if(ot<Q&&vt<R)for(Rt>ft==Rt>-ft?(ht=ft+X,st=X-(ht-ft),ft=D[++ot]):(ht=Rt+X,st=X-(ht-Rt),Rt=U[++vt]),X=ht,st!==0&&(Y[mt++]=st);ot<Q&&vt<R;)Rt>ft==Rt>-ft?(ht=X+ft,yt=ht-X,st=X-(ht-yt)+(ft-yt),ft=D[++ot]):(ht=X+Rt,yt=ht-X,st=X-(ht-yt)+(Rt-yt),Rt=U[++vt]),X=ht,st!==0&&(Y[mt++]=st);for(;ot<Q;)ht=X+ft,yt=ht-X,st=X-(ht-yt)+(ft-yt),ft=D[++ot],X=ht,st!==0&&(Y[mt++]=st);for(;vt<R;)ht=X+Rt,yt=ht-X,st=X-(ht-yt)+(Rt-yt),Rt=U[++vt],X=ht,st!==0&&(Y[mt++]=st);return(X!==0||mt===0)&&(Y[mt++]=X),mt}u(ut,"sum");function at(Q,D){let R=D[0];for(let U=1;U<Q;U++)R+=D[U];return R}u(at,"estimate");function H(Q){return new Float64Array(Q)}u(H,"vec");let St=(3+16*q)*q,pt=(2+12*q)*q,ct=(9+64*q)*q*q,It=H(4),Et=H(8),dt=H(12),bt=H(16),Z=H(4);function te(Q,D,R,U,Y,X,ht){let st,yt,ft,Rt,ot,vt,mt,Kt,qt,fe,Qt,wr,Or,rn,Dr,Un,we,ye,Ai=Q-Y,Vr=R-Y,Dn=D-X,xr=U-X;rn=Ai*xr,vt=k*Ai,mt=vt-(vt-Ai),Kt=Ai-mt,vt=k*xr,qt=vt-(vt-xr),fe=xr-qt,Dr=Kt*fe-(rn-mt*qt-Kt*qt-mt*fe),Un=Dn*Vr,vt=k*Dn,mt=vt-(vt-Dn),Kt=Dn-mt,vt=k*Vr,qt=vt-(vt-Vr),fe=Vr-qt,we=Kt*fe-(Un-mt*qt-Kt*qt-mt*fe),Qt=Dr-we,ot=Dr-Qt,It[0]=Dr-(Qt+ot)+(ot-we),wr=rn+Qt,ot=wr-rn,Or=rn-(wr-ot)+(Qt-ot),Qt=Or-Un,ot=Or-Qt,It[1]=Or-(Qt+ot)+(ot-Un),ye=wr+Qt,ot=ye-wr,It[2]=wr-(ye-ot)+(Qt-ot),It[3]=ye;let $i=at(4,It),Ni=pt*ht;if($i>=Ni||-$i>=Ni||(ot=Q-Ai,st=Q-(Ai+ot)+(ot-Y),ot=R-Vr,ft=R-(Vr+ot)+(ot-Y),ot=D-Dn,yt=D-(Dn+ot)+(ot-X),ot=U-xr,Rt=U-(xr+ot)+(ot-X),st===0&&yt===0&&ft===0&&Rt===0)||(Ni=ct*ht+tt*Math.abs($i),$i+=Ai*Rt+xr*st-(Dn*ft+Vr*yt),$i>=Ni||-$i>=Ni))return $i;rn=st*xr,vt=k*st,mt=vt-(vt-st),Kt=st-mt,vt=k*xr,qt=vt-(vt-xr),fe=xr-qt,Dr=Kt*fe-(rn-mt*qt-Kt*qt-mt*fe),Un=yt*Vr,vt=k*yt,mt=vt-(vt-yt),Kt=yt-mt,vt=k*Vr,qt=vt-(vt-Vr),fe=Vr-qt,we=Kt*fe-(Un-mt*qt-Kt*qt-mt*fe),Qt=Dr-we,ot=Dr-Qt,Z[0]=Dr-(Qt+ot)+(ot-we),wr=rn+Qt,ot=wr-rn,Or=rn-(wr-ot)+(Qt-ot),Qt=Or-Un,ot=Or-Qt,Z[1]=Or-(Qt+ot)+(ot-Un),ye=wr+Qt,ot=ye-wr,Z[2]=wr-(ye-ot)+(Qt-ot),Z[3]=ye;let Wo=ut(4,It,4,Z,Et);rn=Ai*Rt,vt=k*Ai,mt=vt-(vt-Ai),Kt=Ai-mt,vt=k*Rt,qt=vt-(vt-Rt),fe=Rt-qt,Dr=Kt*fe-(rn-mt*qt-Kt*qt-mt*fe),Un=Dn*ft,vt=k*Dn,mt=vt-(vt-Dn),Kt=Dn-mt,vt=k*ft,qt=vt-(vt-ft),fe=ft-qt,we=Kt*fe-(Un-mt*qt-Kt*qt-mt*fe),Qt=Dr-we,ot=Dr-Qt,Z[0]=Dr-(Qt+ot)+(ot-we),wr=rn+Qt,ot=wr-rn,Or=rn-(wr-ot)+(Qt-ot),Qt=Or-Un,ot=Or-Qt,Z[1]=Or-(Qt+ot)+(ot-Un),ye=wr+Qt,ot=ye-wr,Z[2]=wr-(ye-ot)+(Qt-ot),Z[3]=ye;let Ji=ut(Wo,Et,4,Z,dt);rn=st*Rt,vt=k*st,mt=vt-(vt-st),Kt=st-mt,vt=k*Rt,qt=vt-(vt-Rt),fe=Rt-qt,Dr=Kt*fe-(rn-mt*qt-Kt*qt-mt*fe),Un=yt*ft,vt=k*yt,mt=vt-(vt-yt),Kt=yt-mt,vt=k*ft,qt=vt-(vt-ft),fe=ft-qt,we=Kt*fe-(Un-mt*qt-Kt*qt-mt*fe),Qt=Dr-we,ot=Dr-Qt,Z[0]=Dr-(Qt+ot)+(ot-we),wr=rn+Qt,ot=wr-rn,Or=rn-(wr-ot)+(Qt-ot),Qt=Or-Un,ot=Or-Qt,Z[1]=Or-(Qt+ot)+(ot-Un),ye=wr+Qt,ot=ye-wr,Z[2]=wr-(ye-ot)+(Qt-ot),Z[3]=ye;let bf=ut(Ji,dt,4,Z,bt);return bt[bf-1]}u(te,"orient2dadapt");function jt(Q,D,R,U,Y,X){let ht=(D-X)*(R-Y),st=(Q-Y)*(U-X),yt=ht-st,ft=Math.abs(ht+st);return Math.abs(yt)>=St*ft?yt:-te(Q,D,R,U,Y,X,ft)}u(jt,"orient2d");let ee=u((Q,D)=>Q.x*D.y-Q.y*D.x,"crossProduct"),Tt=u((Q,D)=>Q.x*D.x+Q.y*D.y,"dotProduct"),le=u((Q,D,R)=>{let U=jt(Q.x,Q.y,D.x,D.y,R.x,R.y);return U>0?-1:U<0?1:0},"compareVectorAngles"),vr=u(Q=>Math.sqrt(Tt(Q,Q)),"length"),Qe=u((Q,D,R)=>{let U={x:D.x-Q.x,y:D.y-Q.y},Y={x:R.x-Q.x,y:R.y-Q.y};return ee(Y,U)/vr(Y)/vr(U)},"sineOfAngle"),Nt=u((Q,D,R)=>{let U={x:D.x-Q.x,y:D.y-Q.y},Y={x:R.x-Q.x,y:R.y-Q.y};return Tt(Y,U)/vr(Y)/vr(U)},"cosineOfAngle"),At=u((Q,D,R)=>D.y===0?null:{x:Q.x+D.x/D.y*(R-Q.y),y:R},"horizontalIntersection"),xt=u((Q,D,R)=>D.x===0?null:{x:R,y:Q.y+D.y/D.x*(R-Q.x)},"verticalIntersection"),_e=u((Q,D,R,U)=>{if(D.x===0)return xt(R,U,Q.x);if(U.x===0)return xt(Q,D,R.x);if(D.y===0)return At(R,U,Q.y);if(U.y===0)return At(Q,D,R.y);let Y=ee(D,U);if(Y==0)return null;let X={x:R.x-Q.x,y:R.y-Q.y},ht=ee(X,D)/Y,st=ee(X,U)/Y,yt=Q.x+st*D.x,ft=R.x+ht*U.x,Rt=Q.y+st*D.y,ot=R.y+ht*U.y,vt=(yt+ft)/2,mt=(Rt+ot)/2;return{x:vt,y:mt}},"intersection$1"),Di=class Di{static compare(D,R){let U=Di.comparePoints(D.point,R.point);return U!==0?U:(D.point!==R.point&&D.link(R),D.isLeft!==R.isLeft?D.isLeft?1:-1:me.compare(D.segment,R.segment))}static comparePoints(D,R){return D.x<R.x?-1:D.x>R.x?1:D.y<R.y?-1:D.y>R.y?1:0}constructor(D,R){D.events===void 0?D.events=[this]:D.events.push(this),this.point=D,this.isLeft=R}link(D){if(D.point===this.point)throw new Error("Tried to link already linked events");let R=D.point.events;for(let U=0,Y=R.length;U<Y;U++){let X=R[U];this.point.events.push(X),X.point=this.point}this.checkForConsuming()}checkForConsuming(){let D=this.point.events.length;for(let R=0;R<D;R++){let U=this.point.events[R];if(U.segment.consumedBy===void 0)for(let Y=R+1;Y<D;Y++){let X=this.point.events[Y];X.consumedBy===void 0&&U.otherSE.point.events===X.otherSE.point.events&&U.segment.consume(X.segment)}}}getAvailableLinkedEvents(){let D=[];for(let R=0,U=this.point.events.length;R<U;R++){let Y=this.point.events[R];Y!==this&&!Y.segment.ringOut&&Y.segment.isInResult()&&D.push(Y)}return D}getLeftmostComparator(D){let R=new Map,U=u(Y=>{let X=Y.otherSE;R.set(Y,{sine:Qe(this.point,D.point,X.point),cosine:Nt(this.point,D.point,X.point)})},"fillCache");return(Y,X)=>{R.has(Y)||U(Y),R.has(X)||U(X);let{sine:ht,cosine:st}=R.get(Y),{sine:yt,cosine:ft}=R.get(X);return ht>=0&&yt>=0?st<ft?1:st>ft?-1:0:ht<0&&yt<0?st<ft?-1:st>ft?1:0:yt<ht?-1:yt>ht?1:0}}};u(Di,"SweepEvent");let de=Di,Xr=0,qo=class qo{static compare(D,R){let U=D.leftSE.point.x,Y=R.leftSE.point.x,X=D.rightSE.point.x,ht=R.rightSE.point.x;if(ht<U)return 1;if(X<Y)return-1;let st=D.leftSE.point.y,yt=R.leftSE.point.y,ft=D.rightSE.point.y,Rt=R.rightSE.point.y;if(U<Y){if(yt<st&&yt<ft)return 1;if(yt>st&&yt>ft)return-1;let ot=D.comparePoint(R.leftSE.point);if(ot<0)return 1;if(ot>0)return-1;let vt=R.comparePoint(D.rightSE.point);return vt!==0?vt:-1}if(U>Y){if(st<yt&&st<Rt)return-1;if(st>yt&&st>Rt)return 1;let ot=R.comparePoint(D.leftSE.point);if(ot!==0)return ot;let vt=D.comparePoint(R.rightSE.point);return vt<0?1:vt>0?-1:1}if(st<yt)return-1;if(st>yt)return 1;if(X<ht){let ot=R.comparePoint(D.rightSE.point);if(ot!==0)return ot}if(X>ht){let ot=D.comparePoint(R.rightSE.point);if(ot<0)return 1;if(ot>0)return-1}if(X!==ht){let ot=ft-st,vt=X-U,mt=Rt-yt,Kt=ht-Y;if(ot>vt&&mt<Kt)return 1;if(ot<vt&&mt>Kt)return-1}return X>ht?1:X<ht||ft<Rt?-1:ft>Rt?1:D.id<R.id?-1:D.id>R.id?1:0}constructor(D,R,U,Y){this.id=++Xr,this.leftSE=D,D.segment=this,D.otherSE=R,this.rightSE=R,R.segment=this,R.otherSE=D,this.rings=U,this.windings=Y}static fromRing(D,R,U){let Y,X,ht,st=de.comparePoints(D,R);if(st<0)Y=D,X=R,ht=1;else if(st>0)Y=R,X=D,ht=-1;else throw new Error("Tried to create degenerate segment at [".concat(D.x,", ").concat(D.y,"]"));let yt=new de(Y,!0),ft=new de(X,!1);return new qo(yt,ft,[U],[ht])}replaceRightSE(D){this.rightSE=D,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let D=this.leftSE.point.y,R=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:D<R?D:R},ur:{x:this.rightSE.point.x,y:D>R?D:R}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(D){return D.x===this.leftSE.point.x&&D.y===this.leftSE.point.y||D.x===this.rightSE.point.x&&D.y===this.rightSE.point.y}comparePoint(D){if(this.isAnEndpoint(D))return 0;let R=this.leftSE.point,U=this.rightSE.point,Y=this.vector();if(R.x===U.x)return D.x===R.x?0:D.x<R.x?1:-1;let X=(D.y-R.y)/Y.y,ht=R.x+X*Y.x;if(D.x===ht)return 0;let st=(D.x-R.x)/Y.x,yt=R.y+st*Y.y;return D.y===yt?0:D.y<yt?-1:1}getIntersection(D){let R=this.bbox(),U=D.bbox(),Y=E(R,U);if(Y===null)return null;let X=this.leftSE.point,ht=this.rightSE.point,st=D.leftSE.point,yt=D.rightSE.point,ft=P(R,st)&&this.comparePoint(st)===0,Rt=P(U,X)&&D.comparePoint(X)===0,ot=P(R,yt)&&this.comparePoint(yt)===0,vt=P(U,ht)&&D.comparePoint(ht)===0;if(Rt&&ft)return vt&&!ot?ht:!vt&&ot?yt:null;if(Rt)return ot&&X.x===yt.x&&X.y===yt.y?null:X;if(ft)return vt&&ht.x===st.x&&ht.y===st.y?null:st;if(vt&&ot)return null;if(vt)return ht;if(ot)return yt;let mt=_e(X,this.vector(),st,D.vector());return mt===null||!P(Y,mt)?null:$.round(mt.x,mt.y)}split(D){let R=[],U=D.events!==void 0,Y=new de(D,!0),X=new de(D,!1),ht=this.rightSE;this.replaceRightSE(X),R.push(X),R.push(Y);let st=new qo(Y,ht,this.rings.slice(),this.windings.slice());return de.comparePoints(st.leftSE.point,st.rightSE.point)>0&&st.swapEvents(),de.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),U&&(Y.checkForConsuming(),X.checkForConsuming()),R}swapEvents(){let D=this.rightSE;this.rightSE=this.leftSE,this.leftSE=D,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let R=0,U=this.windings.length;R<U;R++)this.windings[R]*=-1}consume(D){let R=this,U=D;for(;R.consumedBy;)R=R.consumedBy;for(;U.consumedBy;)U=U.consumedBy;let Y=qo.compare(R,U);if(Y!==0){if(Y>0){let X=R;R=U,U=X}if(R.prev===U){let X=R;R=U,U=X}for(let X=0,ht=U.rings.length;X<ht;X++){let st=U.rings[X],yt=U.windings[X],ft=R.rings.indexOf(st);ft===-1?(R.rings.push(st),R.windings.push(yt)):R.windings[ft]+=yt}U.rings=null,U.windings=null,U.consumedBy=R,U.leftSE.consumedBy=R.leftSE,U.rightSE.consumedBy=R.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let D=this.prev.consumedBy||this.prev;this._beforeState=D.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let D=this.beforeState();this._afterState={rings:D.rings.slice(0),windings:D.windings.slice(0),multiPolys:[]};let R=this._afterState.rings,U=this._afterState.windings,Y=this._afterState.multiPolys;for(let st=0,yt=this.rings.length;st<yt;st++){let ft=this.rings[st],Rt=this.windings[st],ot=R.indexOf(ft);ot===-1?(R.push(ft),U.push(Rt)):U[ot]+=Rt}let X=[],ht=[];for(let st=0,yt=R.length;st<yt;st++){if(U[st]===0)continue;let ft=R[st],Rt=ft.poly;if(ht.indexOf(Rt)===-1)if(ft.isExterior)X.push(Rt);else{ht.indexOf(Rt)===-1&&ht.push(Rt);let ot=X.indexOf(ft.poly);ot!==-1&&X.splice(ot,1)}}for(let st=0,yt=X.length;st<yt;st++){let ft=X[st].multiPoly;Y.indexOf(ft)===-1&&Y.push(ft)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let D=this.beforeState().multiPolys,R=this.afterState().multiPolys;switch(Mt.type){case"union":{let U=D.length===0,Y=R.length===0;this._isInResult=U!==Y;break}case"intersection":{let U,Y;D.length<R.length?(U=D.length,Y=R.length):(U=R.length,Y=D.length),this._isInResult=Y===Mt.numMultiPolys&&U<Y;break}case"xor":{let U=Math.abs(D.length-R.length);this._isInResult=U%2===1;break}case"difference":{let U=u(Y=>Y.length===1&&Y[0].isSubject,"isJustSubject");this._isInResult=U(D)!==U(R);break}default:throw new Error("Unrecognized operation type found ".concat(Mt.type))}return this._isInResult}};u(qo,"Segment");let me=qo,Ia=class Ia{constructor(D,R,U){if(!Array.isArray(D)||D.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=R,this.isExterior=U,this.segments=[],typeof D[0][0]!="number"||typeof D[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let Y=$.round(D[0][0],D[0][1]);this.bbox={ll:{x:Y.x,y:Y.y},ur:{x:Y.x,y:Y.y}};let X=Y;for(let ht=1,st=D.length;ht<st;ht++){if(typeof D[ht][0]!="number"||typeof D[ht][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let yt=$.round(D[ht][0],D[ht][1]);yt.x===X.x&&yt.y===X.y||(this.segments.push(me.fromRing(X,yt,this)),yt.x<this.bbox.ll.x&&(this.bbox.ll.x=yt.x),yt.y<this.bbox.ll.y&&(this.bbox.ll.y=yt.y),yt.x>this.bbox.ur.x&&(this.bbox.ur.x=yt.x),yt.y>this.bbox.ur.y&&(this.bbox.ur.y=yt.y),X=yt)}(Y.x!==X.x||Y.y!==X.y)&&this.segments.push(me.fromRing(X,Y,this))}getSweepEvents(){let D=[];for(let R=0,U=this.segments.length;R<U;R++){let Y=this.segments[R];D.push(Y.leftSE),D.push(Y.rightSE)}return D}};u(Ia,"RingIn");let Se=Ia,Ma=class Ma{constructor(D,R){if(!Array.isArray(D))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Se(D[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let U=1,Y=D.length;U<Y;U++){let X=new Se(D[U],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=R}getSweepEvents(){let D=this.exteriorRing.getSweepEvents();for(let R=0,U=this.interiorRings.length;R<U;R++){let Y=this.interiorRings[R].getSweepEvents();for(let X=0,ht=Y.length;X<ht;X++)D.push(Y[X])}return D}};u(Ma,"PolyIn");let br=Ma,wa=class wa{constructor(D,R){if(!Array.isArray(D))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof D[0][0][0]=="number"&&(D=[D])}catch(U){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let U=0,Y=D.length;U<Y;U++){let X=new br(D[U],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=R}getSweepEvents(){let D=[];for(let R=0,U=this.polys.length;R<U;R++){let Y=this.polys[R].getSweepEvents();for(let X=0,ht=Y.length;X<ht;X++)D.push(Y[X])}return D}};u(wa,"MultiPolyIn");let Yr=wa,Nr=class Nr{static factory(D){let R=[];for(let U=0,Y=D.length;U<Y;U++){let X=D[U];if(!X.isInResult()||X.ringOut)continue;let ht=null,st=X.leftSE,yt=X.rightSE,ft=[st],Rt=st.point,ot=[];for(;ht=st,st=yt,ft.push(st),st.point!==Rt;)for(;;){let vt=st.getAvailableLinkedEvents();if(vt.length===0){let qt=ft[0].point,fe=ft[ft.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(vt.length===1){yt=vt[0].otherSE;break}let mt=null;for(let qt=0,fe=ot.length;qt<fe;qt++)if(ot[qt].point===st.point){mt=qt;break}if(mt!==null){let qt=ot.splice(mt)[0],fe=ft.splice(qt.index);fe.unshift(fe[0].otherSE),R.push(new Nr(fe.reverse()));continue}ot.push({index:ft.length,point:st.point});let Kt=st.getLeftmostComparator(ht);yt=vt.sort(Kt)[0].otherSE;break}R.push(new Nr(ft))}return R}constructor(D){this.events=D;for(let R=0,U=D.length;R<U;R++)D[R].segment.ringOut=this;this.poly=null}getGeom(){let D=this.events[0].point,R=[D];for(let ft=1,Rt=this.events.length-1;ft<Rt;ft++){let ot=this.events[ft].point,vt=this.events[ft+1].point;le(ot,D,vt)!==0&&(R.push(ot),D=ot)}if(R.length===1)return null;let U=R[0],Y=R[1];le(U,D,Y)===0&&R.shift(),R.push(R[0]);let X=this.isExteriorRing()?1:-1,ht=this.isExteriorRing()?0:R.length-1,st=this.isExteriorRing()?R.length:-1,yt=[];for(let ft=ht;ft!=st;ft+=X)yt.push([R[ft].x,R[ft].y]);return yt}isExteriorRing(){if(this._isExteriorRing===void 0){let D=this.enclosingRing();this._isExteriorRing=D?!D.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let D=this.events[0];for(let Y=1,X=this.events.length;Y<X;Y++){let ht=this.events[Y];de.compare(D,ht)>0&&(D=ht)}let R=D.segment.prevInResult(),U=R?R.prevInResult():null;for(;;){if(!R)return null;if(!U)return R.ringOut;if(U.ringOut!==R.ringOut)return U.ringOut.enclosingRing()!==R.ringOut?R.ringOut:R.ringOut.enclosingRing();R=U.prevInResult(),U=R?R.prevInResult():null}}};u(Nr,"RingOut");let Wi=Nr,Ta=class Ta{constructor(D){this.exteriorRing=D,D.poly=this,this.interiorRings=[]}addInterior(D){this.interiorRings.push(D),D.poly=this}getGeom(){let D=[this.exteriorRing.getGeom()];if(D[0]===null)return null;for(let R=0,U=this.interiorRings.length;R<U;R++){let Y=this.interiorRings[R].getGeom();Y!==null&&D.push(Y)}return D}};u(Ta,"PolyOut");let Yt=Ta,Li=class Li{constructor(D){this.rings=D,this.polys=this._composePolys(D)}getGeom(){let D=[];for(let R=0,U=this.polys.length;R<U;R++){let Y=this.polys[R].getGeom();Y!==null&&D.push(Y)}return D}_composePolys(D){let R=[];for(let U=0,Y=D.length;U<Y;U++){let X=D[U];if(!X.poly)if(X.isExteriorRing())R.push(new Yt(X));else{let ht=X.enclosingRing();ht.poly||R.push(new Yt(ht)),ht.poly.addInterior(X)}}return R}};u(Li,"MultiPolyOut");let mr=Li,Pt=class Pt{constructor(D){let R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:me.compare;this.queue=D,this.tree=new d(R),this.segments=[]}process(D){let R=D.segment,U=[];if(D.consumedBy)return D.isLeft?this.queue.remove(D.otherSE):this.tree.remove(R),U;let Y=D.isLeft?this.tree.add(R):this.tree.find(R);if(!Y)throw new Error("Unable to find segment #".concat(R.id," ")+"[".concat(R.leftSE.point.x,", ").concat(R.leftSE.point.y,"] -> ")+"[".concat(R.rightSE.point.x,", ").concat(R.rightSE.point.y,"] ")+"in SweepLine tree.");let X=Y,ht=Y,st,yt;for(;st===void 0;)X=this.tree.prev(X),X===null?st=null:X.key.consumedBy===void 0&&(st=X.key);for(;yt===void 0;)ht=this.tree.next(ht),ht===null?yt=null:ht.key.consumedBy===void 0&&(yt=ht.key);if(D.isLeft){let ft=null;if(st){let ot=st.getIntersection(R);if(ot!==null&&(R.isAnEndpoint(ot)||(ft=ot),!st.isAnEndpoint(ot))){let vt=this._splitSafely(st,ot);for(let mt=0,Kt=vt.length;mt<Kt;mt++)U.push(vt[mt])}}let Rt=null;if(yt){let ot=yt.getIntersection(R);if(ot!==null&&(R.isAnEndpoint(ot)||(Rt=ot),!yt.isAnEndpoint(ot))){let vt=this._splitSafely(yt,ot);for(let mt=0,Kt=vt.length;mt<Kt;mt++)U.push(vt[mt])}}if(ft!==null||Rt!==null){let ot=null;ft===null?ot=Rt:Rt===null?ot=ft:ot=de.comparePoints(ft,Rt)<=0?ft:Rt,this.queue.remove(R.rightSE),U.push(R.rightSE);let vt=R.split(ot);for(let mt=0,Kt=vt.length;mt<Kt;mt++)U.push(vt[mt])}U.length>0?(this.tree.remove(R),U.push(D)):(this.segments.push(R),R.prev=st)}else{if(st&&yt){let ft=st.getIntersection(yt);if(ft!==null){if(!st.isAnEndpoint(ft)){let Rt=this._splitSafely(st,ft);for(let ot=0,vt=Rt.length;ot<vt;ot++)U.push(Rt[ot])}if(!yt.isAnEndpoint(ft)){let Rt=this._splitSafely(yt,ft);for(let ot=0,vt=Rt.length;ot<vt;ot++)U.push(Rt[ot])}}}this.tree.remove(R)}return U}_splitSafely(D,R){this.tree.remove(D);let U=D.rightSE;this.queue.remove(U);let Y=D.split(R);return Y.push(U),D.consumedBy===void 0&&this.tree.add(D),Y}};u(Pt,"SweepLine");let lo=Pt,Zi=typeof T<"u"&&T.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,uo=typeof T<"u"&&T.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,jm=class jm{run(D,R,U){Mt.type=D,$.reset();let Y=[new Yr(R,!0)];for(let ot=0,vt=U.length;ot<vt;ot++)Y.push(new Yr(U[ot],!1));if(Mt.numMultiPolys=Y.length,Mt.type==="difference"){let ot=Y[0],vt=1;for(;vt<Y.length;)E(Y[vt].bbox,ot.bbox)!==null?vt++:Y.splice(vt,1)}if(Mt.type==="intersection")for(let ot=0,vt=Y.length;ot<vt;ot++){let mt=Y[ot];for(let Kt=ot+1,qt=Y.length;Kt<qt;Kt++)if(E(mt.bbox,Y[Kt].bbox)===null)return[]}let X=new d(de.compare);for(let ot=0,vt=Y.length;ot<vt;ot++){let mt=Y[ot].getSweepEvents();for(let Kt=0,qt=mt.length;Kt<qt;Kt++)if(X.insert(mt[Kt]),X.size>Zi)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let ht=new lo(X),st=X.size,yt=X.pop();for(;yt;){let ot=yt.key;if(X.size===st){let mt=ot.segment;throw new Error("Unable to pop() ".concat(ot.isLeft?"left":"right"," SweepEvent ")+"[".concat(ot.point.x,", ").concat(ot.point.y,"] from segment #").concat(mt.id," ")+"[".concat(mt.leftSE.point.x,", ").concat(mt.leftSE.point.y,"] -> ")+"[".concat(mt.rightSE.point.x,", ").concat(mt.rightSE.point.y,"] from queue."))}if(X.size>Zi)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(ht.segments.length>uo)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let vt=ht.process(ot);for(let mt=0,Kt=vt.length;mt<Kt;mt++){let qt=vt[mt];qt.consumedBy===void 0&&X.insert(qt)}st=X.size,yt=X.pop()}$.reset();let ft=Wi.factory(ht.segments);return new mr(ft).getGeom()}};u(jm,"Operation");let wn=jm,Mt=new wn;var Sa={union:u(function(Q){for(var D=arguments.length,R=new Array(D>1?D-1:0),U=1;U<D;U++)R[U-1]=arguments[U];return Mt.run("union",Q,R)},"union"),intersection:u(function(Q){for(var D=arguments.length,R=new Array(D>1?D-1:0),U=1;U<D;U++)R[U-1]=arguments[U];return Mt.run("intersection",Q,R)},"intersection"),xor:u(function(Q){for(var D=arguments.length,R=new Array(D>1?D-1:0),U=1;U<D;U++)R[U-1]=arguments[U];return Mt.run("xor",Q,R)},"xor"),difference:u(function(Q){for(var D=arguments.length,R=new Array(D>1?D-1:0),U=1;U<D;U++)R[U-1]=arguments[U];return Mt.run("difference",Q,R)},"difference")};return Sa})});var I6=Lt((Dv,S6)=>{y();(function(r,e){typeof Dv=="object"&&typeof S6<"u"?e(Dv):typeof define=="function"&&define.amd?define(["exports"],e):e(r.jsts={})})(Dv,function(r){"use strict";function e(){}u(e,"e");function t(o){this.message=o||""}u(t,"n");function n(o){this.message=o||""}u(n,"i");function i(o){this.message=o||""}u(i,"r");function a(){}u(a,"o");function l(o){return o===null?ft:o.color}u(l,"s");function h(o){return o===null?null:o.parent}u(h,"a");function d(o,s){o!==null&&(o.color=s)}u(d,"u");function m(o){return o===null?null:o.left}u(m,"l");function v(o){return o===null?null:o.right}u(v,"c");function x(){this.root_=null,this.size_=0}u(x,"p");function S(){}u(S,"h");function I(){this.array_=[],arguments[0]instanceof Nr&&this.addAll(arguments[0])}u(I,"f");function w(){}u(w,"g");function P(o){this.message=o||""}u(P,"d");function E(){this.array_=[]}u(E,"y"),"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:u(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 O=u(function(){},"_");O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.prototype.equalsWithTolerance=function(o,s,c){return Math.abs(o-s)<=c};var N=function(o){function s(c){o.call(this,c),this.name="IllegalArgumentException",this.message=c,this.stack=new o().stack}return u(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s}(Error),L=u(function(){},"v"),G={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)},G.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(L,G);var j=u(function(){},"E"),$=u(function(){},"x"),q=u(function(){},"N"),k=u(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"),tt={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};k.prototype.setOrdinate=function(o,s){switch(o){case k.X:this.x=s;break;case k.Y:this.y=s;break;case k.Z:this.z=s;break;default:throw new N("Invalid ordinate index: "+o)}},k.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!!O.equalsWithTolerance(this.x,s.x,c)&&!!O.equalsWithTolerance(this.y,s.y,c)}},k.prototype.getOrdinate=function(o){switch(o){case k.X:return this.x;case k.Y:return this.y;case k.Z:return this.z}throw new N("Invalid ordinate index: "+o)},k.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)},k.prototype.equals=function(o){return o instanceof k&&this.equals2D(o)},k.prototype.equalInZ=function(o,s){return O.equalsWithTolerance(this.z,o.z,s)},k.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},k.prototype.clone=function(){},k.prototype.copy=function(){return new k(this)},k.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},k.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)},k.prototype.distance=function(o){var s=this.x-o.x,c=this.y-o.y;return Math.sqrt(s*s+c*c)},k.prototype.hashCode=function(){var o=17;return o=37*o+k.hashCode(this.x),o=37*o+k.hashCode(this.y)},k.prototype.setCoordinate=function(o){this.x=o.x,this.y=o.y,this.z=o.z},k.prototype.interfaces_=function(){return[j,$,e]},k.prototype.getClass=function(){return k},k.hashCode=function(){if(arguments.length===1){var o=arguments[0],s=L.doubleToLongBits(o);return Math.trunc((s^s)>>>32)}},tt.DimensionalComparator.get=function(){return ut},tt.serialVersionUID.get=function(){return 6683108902428367e3},tt.NULL_ORDINATE.get=function(){return L.NaN},tt.X.get=function(){return 0},tt.Y.get=function(){return 1},tt.Z.get=function(){return 2},Object.defineProperties(k,tt);var ut=u(function(o){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var s=arguments[0];if(s!==2&&s!==3)throw new N("only 2 or 3 dimensions may be specified");this._dimensionsToTest=s}}},"L");ut.prototype.compare=function(o,s){var c=o,f=s,g=ut.compare(c.x,f.x);if(g!==0)return g;var _=ut.compare(c.y,f.y);return _!==0?_:this._dimensionsToTest<=2?0:ut.compare(c.z,f.z)},ut.prototype.interfaces_=function(){return[q]},ut.prototype.getClass=function(){return ut},ut.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 at=u(function(){},"b");at.prototype.create=function(){},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at};var H=u(function(){},"w"),St={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 N("Unknown location value: "+o)},St.INTERIOR.get=function(){return 0},St.BOUNDARY.get=function(){return 1},St.EXTERIOR.get=function(){return 2},St.NONE.get=function(){return-1},Object.defineProperties(H,St);var pt=u(function(o,s){return o.interfaces_&&o.interfaces_().indexOf(s)>-1},"T"),ct=u(function(){},"R"),It={LOG_10:{configurable:!0}};ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct},ct.log10=function(o){var s=Math.log(o);return L.isInfinite(s)||L.isNaN(s)?s:s/ct.LOG_10},ct.min=function(o,s,c,f){var g=o;return s<g&&(g=s),c<g&&(g=c),f<g&&(g=f),g},ct.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}},ct.wrap=function(o,s){return o<0?s- -o%s:o%s},ct.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],A=arguments[3],B=g;return _>B&&(B=_),M>B&&(B=M),A>B&&(B=A),B}},ct.average=function(o,s){return(o+s)/2},It.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(ct,It);var Et=u(function(o){this.str=o},"D");Et.prototype.append=function(o){this.str+=o},Et.prototype.setCharAt=function(o,s){this.str=this.str.substr(0,o)+s+this.str.substr(o+1)},Et.prototype.toString=function(o){return this.str};var dt=u(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 bt=u(function(){},"A");bt.isWhitespace=function(o){return o<=32&&o>=0||o===127},bt.toUpperCase=function(o){return o.toUpperCase()};var Z=u(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"),te={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}};Z.prototype.le=function(o){return(this._hi<o._hi||this._hi===o._hi)&&this._lo<=o._lo},Z.prototype.extractSignificantDigits=function(o,s){var c=this.abs(),f=Z.magnitude(c._hi),g=Z.TEN.pow(f);(c=c.divide(g)).gt(Z.TEN)?(c=c.divide(Z.TEN),f+=1):c.lt(Z.ONE)&&(c=c.multiply(Z.TEN),f-=1);for(var _=f+1,M=new Et,A=Z.MAX_PRINT_DIGITS-1,B=0;B<=A;B++){o&&B===_&&M.append(".");var W=Math.trunc(c._hi);if(W<0)break;var it=!1,lt=0;W>9?(it=!0,lt="9"):lt="0"+W,M.append(lt),c=c.subtract(Z.valueOf(W)).multiply(Z.TEN),it&&c.selfAdd(Z.TEN);var Ot=!0,Dt=Z.magnitude(c._hi);if(Dt<0&&Math.abs(Dt)>=A-B&&(Ot=!1),!Ot)break}return s[0]=f,M.toString()},Z.prototype.sqr=function(){return this.multiply(this)},Z.prototype.doubleValue=function(){return this._hi+this._lo},Z.prototype.subtract=function(){if(arguments[0]instanceof Z){var o=arguments[0];return this.add(o.negate())}if(typeof arguments[0]=="number"){var s=arguments[0];return this.add(-s)}},Z.prototype.equals=function(){if(arguments.length===1){var o=arguments[0];return this._hi===o._hi&&this._lo===o._lo}},Z.prototype.isZero=function(){return this._hi===0&&this._lo===0},Z.prototype.selfSubtract=function(){if(arguments[0]instanceof Z){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)}},Z.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Z.prototype.min=function(o){return this.le(o)?this:o},Z.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Z){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,A=null,B=null,W=null,it=null,lt=null;return B=this._hi/c,W=Z.SPLIT*B,g=W-B,lt=Z.SPLIT*c,g=W-g,_=B-g,M=lt-c,it=B*c,M=lt-M,A=c-M,lt=g*M-it+g*A+_*M+_*A,W=(this._hi-it-lt+this._lo-B*f)/c,lt=B+W,this._hi=lt,this._lo=B-lt+W,this}},Z.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Z.prototype.divide=function(){if(arguments[0]instanceof Z){var o=arguments[0],s=null,c=null,f=null,g=null,_=null,M=null,A=null,B=null;return c=(_=this._hi/o._hi)-(s=(M=Z.SPLIT*_)-(s=M-_)),B=s*(f=(B=Z.SPLIT*o._hi)-(f=B-o._hi))-(A=_*o._hi)+s*(g=o._hi-f)+c*f+c*g,M=(this._hi-A-B+this._lo-_*o._lo)/o._hi,new Z(B=_+M,_-B+M)}if(typeof arguments[0]=="number"){var W=arguments[0];return L.isNaN(W)?Z.createNaN():Z.copy(this).selfDivide(W,0)}},Z.prototype.ge=function(o){return(this._hi>o._hi||this._hi===o._hi)&&this._lo>=o._lo},Z.prototype.pow=function(o){if(o===0)return Z.valueOf(1);var s=new Z(this),c=Z.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},Z.prototype.ceil=function(){if(this.isNaN())return Z.NaN;var o=Math.ceil(this._hi),s=0;return o===this._hi&&(s=Math.ceil(this._lo)),new Z(o,s)},Z.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},Z.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Z.prototype.setValue=function(){if(arguments[0]instanceof Z){var o=arguments[0];return this.init(o),this}if(typeof arguments[0]=="number"){var s=arguments[0];return this.init(s),this}},Z.prototype.max=function(o){return this.ge(o)?this:o},Z.prototype.sqrt=function(){if(this.isZero())return Z.valueOf(0);if(this.isNegative())return Z.NaN;var o=1/Math.sqrt(this._hi),s=this._hi*o,c=Z.valueOf(s),f=this.subtract(c.sqr())._hi*(.5*o);return c.add(f)},Z.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Z){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,A=null;return g=this._hi+s,M=g-this._hi,_=g-M,_=s-M+(this._hi-_),A=_+this._lo,c=g+A,f=A+(g-c),this._hi=c+f,this._lo=f+(c-this._hi),this}}else if(arguments.length===2){var B=arguments[0],W=arguments[1],it=null,lt=null,Ot=null,Dt=null,Bt=null,Wt=null,Cr=null;Dt=this._hi+B,lt=this._lo+W,Bt=Dt-(Wt=Dt-this._hi),Ot=lt-(Cr=lt-this._lo);var mn=(it=Dt+(Wt=(Bt=B-Wt+(this._hi-Bt))+lt))+(Wt=(Ot=W-Cr+(this._lo-Ot))+(Wt+(Dt-it))),bi=Wt+(it-mn);return this._hi=mn,this._lo=bi,this}},Z.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Z){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,A=null,B=null,W=null;g=(B=Z.SPLIT*this._hi)-this._hi,W=Z.SPLIT*c,g=B-g,_=this._hi-g,M=W-c;var it=(B=this._hi*c)+(W=g*(M=W-M)-B+g*(A=c-M)+_*M+_*A+(this._hi*f+this._lo*c)),lt=W+(g=B-it);return this._hi=it,this._lo=lt,this}},Z.prototype.selfSqr=function(){return this.selfMultiply(this)},Z.prototype.floor=function(){if(this.isNaN())return Z.NaN;var o=Math.floor(this._hi),s=0;return o===this._hi&&(s=Math.floor(this._lo)),new Z(o,s)},Z.prototype.negate=function(){return this.isNaN()?this:new Z(-this._hi,-this._lo)},Z.prototype.clone=function(){},Z.prototype.multiply=function(){if(arguments[0]instanceof Z){var o=arguments[0];return o.isNaN()?Z.createNaN():Z.copy(this).selfMultiply(o)}if(typeof arguments[0]=="number"){var s=arguments[0];return L.isNaN(s)?Z.createNaN():Z.copy(this).selfMultiply(s,0)}},Z.prototype.isNaN=function(){return L.isNaN(this._hi)},Z.prototype.intValue=function(){return Math.trunc(this._hi)},Z.prototype.toString=function(){var o=Z.magnitude(this._hi);return o>=-3&&o<=20?this.toStandardNotation():this.toSciNotation()},Z.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."+Z.stringOfChar("0",-f)+c;else if(c.indexOf(".")===-1){var _=f-c.length;g=c+Z.stringOfChar("0",_)+".0"}return this.isNegative()?"-"+g:g},Z.prototype.reciprocal=function(){var o=null,s=null,c=null,f=null,g=null,_=null,M=null,A=null;s=(g=1/this._hi)-(o=(_=Z.SPLIT*g)-(o=_-g)),c=(A=Z.SPLIT*this._hi)-this._hi;var B=g+(_=(1-(M=g*this._hi)-(A=o*(c=A-c)-M+o*(f=this._hi-c)+s*c+s*f)-g*this._lo)/this._hi);return new Z(B,g-B+_)},Z.prototype.toSciNotation=function(){if(this.isZero())return Z.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=Z.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},Z.prototype.abs=function(){return this.isNaN()?Z.NaN:this.isNegative()?this.negate():new Z(this)},Z.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},Z.prototype.lt=function(o){return(this._hi<o._hi||this._hi===o._hi)&&this._lo<o._lo},Z.prototype.add=function(){if(arguments[0]instanceof Z){var o=arguments[0];return Z.copy(this).selfAdd(o)}if(typeof arguments[0]=="number"){var s=arguments[0];return Z.copy(this).selfAdd(s)}},Z.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 Z){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}},Z.prototype.gt=function(o){return(this._hi>o._hi||this._hi===o._hi)&&this._lo>o._lo},Z.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},Z.prototype.trunc=function(){return this.isNaN()?Z.NaN:this.isPositive()?this.floor():this.ceil()},Z.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Z.prototype.interfaces_=function(){return[e,j,$]},Z.prototype.getClass=function(){return Z},Z.sqr=function(o){return Z.valueOf(o).selfMultiply(o)},Z.valueOf=function(){if(typeof arguments[0]=="string"){var o=arguments[0];return Z.parse(o)}if(typeof arguments[0]=="number"){var s=arguments[0];return new Z(s)}},Z.sqrt=function(o){return Z.valueOf(o).sqrt()},Z.parse=function(o){for(var s=0,c=o.length;bt.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 Z,M=0,A=0,B=0;!(s>=c);){var W=o.charAt(s);if(s++,bt.isDigit(W)){var it=W-"0";_.selfMultiply(Z.TEN),_.selfAdd(it),M++}else{if(W!=="."){if(W==="e"||W==="E"){var lt=o.substring(s);try{B=dt.parseInt(lt)}catch(Cr){throw Cr instanceof Error?new Error("Invalid exponent "+lt+" in string "+o):Cr}break}throw new Error("Unexpected character '"+W+"' at position "+s+" in string "+o)}A=M}}var Ot=_,Dt=M-A-B;if(Dt===0)Ot=_;else if(Dt>0){var Bt=Z.TEN.pow(Dt);Ot=_.divide(Bt)}else if(Dt<0){var Wt=Z.TEN.pow(-Dt);Ot=_.multiply(Wt)}return f?Ot.negate():Ot},Z.createNaN=function(){return new Z(L.NaN,L.NaN)},Z.copy=function(o){return new Z(o)},Z.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},Z.stringOfChar=function(o,s){for(var c=new Et,f=0;f<s;f++)c.append(o);return c.toString()},te.PI.get=function(){return new Z(3.141592653589793,12246467991473532e-32)},te.TWO_PI.get=function(){return new Z(6.283185307179586,24492935982947064e-32)},te.PI_2.get=function(){return new Z(1.5707963267948966,6123233995736766e-32)},te.E.get=function(){return new Z(2.718281828459045,14456468917292502e-32)},te.NaN.get=function(){return new Z(L.NaN,L.NaN)},te.EPS.get=function(){return 123259516440783e-46},te.SPLIT.get=function(){return 134217729},te.MAX_PRINT_DIGITS.get=function(){return 32},te.TEN.get=function(){return Z.valueOf(10)},te.ONE.get=function(){return Z.valueOf(1)},te.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},te.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Z,te);var jt=u(function(){},"q"),ee={DP_SAFE_EPSILON:{configurable:!0}};jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.orientationIndex=function(o,s,c){var f=jt.orientationIndexFilter(o,s,c);if(f<=1)return f;var g=Z.valueOf(s.x).selfAdd(-o.x),_=Z.valueOf(s.y).selfAdd(-o.y),M=Z.valueOf(c.x).selfAdd(-s.x),A=Z.valueOf(c.y).selfAdd(-s.y);return g.selfMultiply(A).selfSubtract(_.selfMultiply(M)).signum()},jt.signOfDet2x2=function(o,s,c,f){return o.multiply(f).selfSubtract(s.multiply(c)).signum()},jt.intersection=function(o,s,c,f){var g=Z.valueOf(f.y).selfSubtract(c.y).selfMultiply(Z.valueOf(s.x).selfSubtract(o.x)),_=Z.valueOf(f.x).selfSubtract(c.x).selfMultiply(Z.valueOf(s.y).selfSubtract(o.y)),M=g.subtract(_),A=Z.valueOf(f.x).selfSubtract(c.x).selfMultiply(Z.valueOf(o.y).selfSubtract(c.y)),B=Z.valueOf(f.y).selfSubtract(c.y).selfMultiply(Z.valueOf(o.x).selfSubtract(c.x)),W=A.subtract(B).selfDivide(M).doubleValue(),it=Z.valueOf(o.x).selfAdd(Z.valueOf(s.x).selfSubtract(o.x).selfMultiply(W)).doubleValue(),lt=Z.valueOf(s.x).selfSubtract(o.x).selfMultiply(Z.valueOf(o.y).selfSubtract(c.y)),Ot=Z.valueOf(s.y).selfSubtract(o.y).selfMultiply(Z.valueOf(o.x).selfSubtract(c.x)),Dt=lt.subtract(Ot).selfDivide(M).doubleValue(),Bt=Z.valueOf(c.y).selfAdd(Z.valueOf(f.y).selfSubtract(c.y).selfMultiply(Dt)).doubleValue();return new k(it,Bt)},jt.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 jt.signum(M);f=g+_}else{if(!(g<0)||_>=0)return jt.signum(M);f=-g-_}var A=jt.DP_SAFE_EPSILON*f;return M>=A||-M>=A?jt.signum(M):2},jt.signum=function(o){return o>0?1:o<0?-1:0},ee.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(jt,ee);var Tt=u(function(){},"V"),le={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};le.X.get=function(){return 0},le.Y.get=function(){return 1},le.Z.get=function(){return 2},le.M.get=function(){return 3},Tt.prototype.setOrdinate=function(o,s,c){},Tt.prototype.size=function(){},Tt.prototype.getOrdinate=function(o,s){},Tt.prototype.getCoordinate=function(){},Tt.prototype.getCoordinateCopy=function(o){},Tt.prototype.getDimension=function(){},Tt.prototype.getX=function(o){},Tt.prototype.clone=function(){},Tt.prototype.expandEnvelope=function(o){},Tt.prototype.copy=function(){},Tt.prototype.getY=function(o){},Tt.prototype.toCoordinateArray=function(){},Tt.prototype.interfaces_=function(){return[$]},Tt.prototype.getClass=function(){return Tt},Object.defineProperties(Tt,le);var vr=u(function(){},"z"),Qe=function(o){function s(){o.call(this,"Projective point not representable on the Cartesian plane.")}return u(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=u(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=u(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 k&&arguments[1]instanceof k){var M=arguments[0],A=arguments[1];this.x=M.y-A.y,this.y=A.x-M.x,this.w=M.x*A.y-A.x*M.y}}else if(arguments.length===3){var B=arguments[0],W=arguments[1],it=arguments[2];this.x=B,this.y=W,this.w=it}else if(arguments.length===4){var lt=arguments[0],Ot=arguments[1],Dt=arguments[2],Bt=arguments[3],Wt=lt.y-Ot.y,Cr=Ot.x-lt.x,mn=lt.x*Ot.y-Ot.x*lt.y,bi=Dt.y-Bt.y,Ws=Bt.x-Dt.x,Rl=Dt.x*Bt.y-Bt.x*Dt.y;this.x=Cr*Rl-Ws*mn,this.y=bi*mn-Wt*Rl,this.w=Wt*Ws-bi*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 k;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,A=c.y-f.y,B=f.x-c.x,W=c.x*f.y-f.x*c.y,it=g*B-A*_,lt=(_*W-B*M)/it,Ot=(A*M-g*W)/it;if(L.isNaN(lt)||L.isInfinite(lt)||L.isNaN(Ot)||L.isInfinite(Ot))throw new Qe;return new k(lt,Ot)};var xt=u(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 k){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],A=arguments[2],B=arguments[3];this.init(_,M,A,B)}},"t"),_e={serialVersionUID:{configurable:!0}};xt.prototype.getArea=function(){return this.getWidth()*this.getHeight()},xt.prototype.equals=function(o){if(!(o instanceof xt))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()},xt.prototype.intersection=function(o){if(this.isNull()||o.isNull()||!this.intersects(o))return new xt;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 xt(s,f,c,g)},xt.prototype.isNull=function(){return this._maxx<this._minx},xt.prototype.getMaxX=function(){return this._maxx},xt.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof k){var o=arguments[0];return this.covers(o.x,o.y)}if(arguments[0]instanceof xt){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}},xt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof xt){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 k){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)}},xt.prototype.getMinY=function(){return this._miny},xt.prototype.getMinX=function(){return this._minx},xt.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof k){var o=arguments[0];this.expandToInclude(o.x,o.y)}else if(arguments[0]instanceof xt){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))}},xt.prototype.minExtent=function(){if(this.isNull())return 0;var o=this.getWidth(),s=this.getHeight();return o<s?o:s},xt.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},xt.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},xt.prototype.translate=function(o,s){if(this.isNull())return null;this.init(this.getMinX()+o,this.getMaxX()+o,this.getMinY()+s,this.getMaxY()+s)},xt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},xt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},xt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},xt.prototype.maxExtent=function(){if(this.isNull())return 0;var o=this.getWidth(),s=this.getHeight();return o>s?o:s},xt.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()}},xt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof xt){var o=arguments[0];return this.covers(o)}if(arguments[0]instanceof k){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)}},xt.prototype.centre=function(){return this.isNull()?null:new k((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},xt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof k){var o=arguments[0];this.init(o.x,o.x,o.y,o.y)}else if(arguments[0]instanceof xt){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],A=arguments[3];g<_?(this._minx=g,this._maxx=_):(this._minx=_,this._maxx=g),M<A?(this._miny=M,this._maxy=A):(this._miny=A,this._maxy=M)}},xt.prototype.getMaxY=function(){return this._maxy},xt.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)},xt.prototype.hashCode=function(){var o=17;return o=37*o+k.hashCode(this._minx),o=37*o+k.hashCode(this._maxx),o=37*o+k.hashCode(this._miny),o=37*o+k.hashCode(this._maxy)},xt.prototype.interfaces_=function(){return[j,e]},xt.prototype.getClass=function(){return xt},xt.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],A=Math.min(_.x,M.x),B=Math.max(_.x,M.x),W=Math.min(f.x,g.x),it=Math.max(f.x,g.x);return!(W>B)&&!(it<A)&&(A=Math.min(_.y,M.y),B=Math.max(_.y,M.y),W=Math.min(f.y,g.y),it=Math.max(f.y,g.y),!(W>B)&&!(it<A))}},_e.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(xt,_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*$/},Xr=u(function(o){this.geometryFactory=o||new ge},"K");Xr.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},Xr.prototype.write=function(o){return this.extractGeometry(o)},Xr.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:u(function(o){return o.x+" "+o.y},"coordinate"),point:u(function(o){return me.coordinate.call(this,o._coordinates._coordinates[0])},"point"),multipoint:u(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:u(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:u(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:u(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:u(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:u(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:u(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:u(function(o){if(o===void 0)return this.geometryFactory.createPoint();var s=o.trim().split(de.spaces);return this.geometryFactory.createPoint(new k(Number.parseFloat(s[0]),Number.parseFloat(s[1])))},"point"),multipoint:u(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:u(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 k(Number.parseFloat(s[0]),Number.parseFloat(s[1])));return this.geometryFactory.createLineString(f)},"linestring"),linearring:u(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 k(Number.parseFloat(s[0]),Number.parseFloat(s[1])));return this.geometryFactory.createLinearRing(f)},"linearring"),multilinestring:u(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:u(function(o){if(o===void 0)return this.geometryFactory.createPolygon();for(var s,c,f,g,_=o.trim().split(de.parenComma),M=[],A=0,B=_.length;A<B;++A)s=_[A].replace(de.trimParens,"$1"),c=Se.linestring.apply(this,[s]),f=this.geometryFactory.createLinearRing(c._points),A===0?g=f:M.push(f);return this.geometryFactory.createPolygon(g,M)},"polygon"),multipolygon:u(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:u(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=u(function(o){this.parser=new Xr(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 Yr=function(o){function s(c){o.call(this,c),this.name="RuntimeException",this.message=c,this.stack=new o().stack}return u(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s}(Error),Wi=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 u(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}(Yr),Yt=u(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 Wi("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 Wi:new Wi(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 Wi("Expected "+o+" but encountered "+s+(c!==null?": "+c:""))};var mr=u(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 k,this._intPt[1]=new k,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},"nt"),lo={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 Et;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),A=Math.abs(o.y-s.y);(_=f>g?M:A)!==0||o.equals(s)||(_=Math.max(M,A))}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"),_},lo.DONT_INTERSECT.get=function(){return 0},lo.DO_INTERSECT.get=function(){return 1},lo.COLLINEAR.get=function(){return 2},lo.NO_INTERSECTION.get=function(){return 0},lo.POINT_INTERSECTION.get=function(){return 1},lo.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(mr,lo);var Zi=function(o){function s(){o.apply(this,arguments)}return u(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 xt(this._inputLines[0][0],this._inputLines[0][1]),g=new xt(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,xt.intersects(f,g,c)&&Mt.orientationIndex(f,g,c)===0&&Mt.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(A){if(!(A instanceof Qe))throw A;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 k(s.nearestEndpoint(c,f,g,_))),this._precisionModel!==null&&this._precisionModel.makePrecise(M),M},s.prototype.smallestInAbsValue=function(c,f,g,_){var M=c,A=Math.abs(M);return Math.abs(f)<A&&(M=f,A=Math.abs(f)),Math.abs(g)<A&&(M=g,A=Math.abs(g)),Math.abs(_)<A&&(M=_),M},s.prototype.checkDD=function(c,f,g,_,M){var A=jt.intersection(c,f,g,_),B=this.isInSegmentEnvelopes(A);Nt.out.println("DD in env = "+B+" --------------------- "+A),M.distance(A)>1e-4&&Nt.out.println("Distance = "+M.distance(A))},s.prototype.intersectionWithNormalization=function(c,f,g,_){var M=new k(c),A=new k(f),B=new k(g),W=new k(_),it=new k;this.normalizeToEnvCentre(M,A,B,W,it);var lt=this.safeHCoordinateIntersection(M,A,B,W);return lt.x+=it.x,lt.y+=it.y,lt},s.prototype.computeCollinearIntersection=function(c,f,g,_){var M=xt.intersects(c,f,g),A=xt.intersects(c,f,_),B=xt.intersects(g,_,c),W=xt.intersects(g,_,f);return M&&A?(this._intPt[0]=g,this._intPt[1]=_,o.COLLINEAR_INTERSECTION):B&&W?(this._intPt[0]=c,this._intPt[1]=f,o.COLLINEAR_INTERSECTION):M&&B?(this._intPt[0]=g,this._intPt[1]=c,!g.equals(c)||A||W?o.COLLINEAR_INTERSECTION:o.POINT_INTERSECTION):M&&W?(this._intPt[0]=g,this._intPt[1]=f,!g.equals(f)||A||B?o.COLLINEAR_INTERSECTION:o.POINT_INTERSECTION):A&&B?(this._intPt[0]=_,this._intPt[1]=c,!_.equals(c)||M||W?o.COLLINEAR_INTERSECTION:o.POINT_INTERSECTION):A&&W?(this._intPt[0]=_,this._intPt[1]=f,!_.equals(f)||M||B?o.COLLINEAR_INTERSECTION:o.POINT_INTERSECTION):o.NO_INTERSECTION},s.prototype.normalizeToEnvCentre=function(c,f,g,_,M){var A=c.x<f.x?c.x:f.x,B=c.y<f.y?c.y:f.y,W=c.x>f.x?c.x:f.x,it=c.y>f.y?c.y:f.y,lt=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=((A>lt?A:lt)+(W<Dt?W:Dt))/2,Cr=((B>Ot?B:Ot)+(it<Bt?it: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,!xt.intersects(c,f,g,_))return o.NO_INTERSECTION;var M=Mt.orientationIndex(c,f,g),A=Mt.orientationIndex(c,f,_);if(M>0&&A>0||M<0&&A<0)return o.NO_INTERSECTION;var B=Mt.orientationIndex(g,_,c),W=Mt.orientationIndex(g,_,f);return B>0&&W>0||B<0&&W<0?o.NO_INTERSECTION:M===0&&A===0&&B===0&&W===0?this.computeCollinearIntersection(c,f,g,_):(M===0||A===0||B===0||W===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 k(g):A===0?this._intPt[0]=new k(_):B===0?this._intPt[0]=new k(c):W===0&&(this._intPt[0]=new k(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,A=Mt.distancePointLine(c,g,_),B=Mt.distancePointLine(f,g,_);return B<A&&(A=B,M=f),(B=Mt.distancePointLine(g,c,f))<A&&(A=B,M=g),(B=Mt.distancePointLine(_,c,f))<A&&(A=B,M=_),M},s}(mr),uo=u(function(){},"ot");uo.prototype.interfaces_=function(){return[]},uo.prototype.getClass=function(){return uo},uo.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 uo.signOfDet2x2(f,g,_,M)},uo.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 wn=u(function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var o=arguments[0];this._p=o},"st");wn.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,A=s.y-this._p.y,B=uo.signOfDet2x2(g,_,M,A);if(B===0)return this._isPointOnSegment=!0,null;A<_&&(B=-B),B>0&&this._crossingCount++}},wn.prototype.isPointInPolygon=function(){return this.getLocation()!==H.EXTERIOR},wn.prototype.getLocation=function(){return this._isPointOnSegment?H.BOUNDARY:this._crossingCount%2==1?H.INTERIOR:H.EXTERIOR},wn.prototype.isOnSegment=function(){return this._isPointOnSegment},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn},wn.locatePointInRing=function(){if(arguments[0]instanceof k&&pt(arguments[1],Tt)){for(var o=arguments[0],s=arguments[1],c=new wn(o),f=new k,g=new k,_=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 k&&arguments[1]instanceof Array){for(var M=arguments[0],A=arguments[1],B=new wn(M),W=1;W<A.length;W++){var it=A[W],lt=A[W-1];if(B.countSegment(it,lt),B.isOnSegment())return B.getLocation()}return B.getLocation()}};var Mt=u(function(){},"at"),Bs={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.orientationIndex=function(o,s,c){return jt.orientationIndex(o,s,c)},Mt.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(pt(arguments[0],Tt)){var M=arguments[0],A=M.size();if(A<3)return 0;var B=new k,W=new k,it=new k;M.getCoordinate(0,W),M.getCoordinate(1,it);var lt=W.x;it.x-=lt;for(var Ot=0,Dt=1;Dt<A-1;Dt++)B.y=W.y,W.x=it.x,W.y=it.y,M.getCoordinate(Dt+1,it),it.x-=lt,Ot+=W.x*(B.y-it.y);return Ot/2}},Mt.distanceLineLine=function(o,s,c,f){if(o.equals(s))return Mt.distancePointLine(o,c,f);if(c.equals(f))return Mt.distancePointLine(f,o,s);var g=!1;if(xt.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),A=((o.y-c.y)*(s.x-o.x)-(o.x-c.x)*(s.y-o.y))/_,B=M/_;(B<0||B>1||A<0||A>1)&&(g=!0)}}else g=!0;return g?ct.min(Mt.distancePointLine(o,c,f),Mt.distancePointLine(s,c,f),Mt.distancePointLine(c,o,s),Mt.distancePointLine(f,o,s)):0},Mt.isPointInRing=function(o,s){return Mt.locatePointInRing(o,s)!==H.EXTERIOR},Mt.computeLength=function(o){var s=o.size();if(s<=1)return 0;var c=0,f=new k;o.getCoordinate(0,f);for(var g=f.x,_=f.y,M=1;M<s;M++){o.getCoordinate(M,f);var A=f.x,B=f.y,W=A-g,it=B-_;c+=Math.sqrt(W*W+it*it),g=A,_=B}return c},Mt.isCCW=function(o){var s=o.length-1;if(s<3)throw new N("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 A=f;do A=(A+1)%s;while(o[A].equals2D(c)&&A!==f);var B=o[M],W=o[A];if(B.equals2D(c)||W.equals2D(c)||B.equals2D(W))return!1;var it=Mt.computeOrientation(B,c,W),lt=!1;return lt=it===0?B.x>W.x:it>0,lt},Mt.locatePointInRing=function(o,s){return wn.locatePointInRing(o,s)},Mt.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)},Mt.computeOrientation=function(o,s,c){return Mt.orientationIndex(o,s,c)},Mt.distancePointLine=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1];if(s.length===0)throw new N("Line array must contain at least one vertex");for(var c=o.distance(s[0]),f=0;f<s.length-1;f++){var g=Mt.distancePointLine(o,s[f],s[f+1]);g<c&&(c=g)}return c}if(arguments.length===3){var _=arguments[0],M=arguments[1],A=arguments[2];if(M.x===A.x&&M.y===A.y)return _.distance(M);var B=(A.x-M.x)*(A.x-M.x)+(A.y-M.y)*(A.y-M.y),W=((_.x-M.x)*(A.x-M.x)+(_.y-M.y)*(A.y-M.y))/B;if(W<=0)return _.distance(M);if(W>=1)return _.distance(A);var it=((M.y-_.y)*(A.x-M.x)-(M.x-_.x)*(A.y-M.y))/B;return Math.abs(it)*Math.sqrt(B)}},Mt.isOnLine=function(o,s){for(var c=new Zi,f=1;f<s.length;f++){var g=s[f-1],_=s[f];if(c.computeIntersection(o,g,_),c.hasIntersection())return!0}return!1},Bs.CLOCKWISE.get=function(){return-1},Bs.RIGHT.get=function(){return Mt.CLOCKWISE},Bs.COUNTERCLOCKWISE.get=function(){return 1},Bs.LEFT.get=function(){return Mt.COUNTERCLOCKWISE},Bs.COLLINEAR.get=function(){return 0},Bs.STRAIGHT.get=function(){return Mt.COLLINEAR},Object.defineProperties(Mt,Bs);var Yo=u(function(){},"lt");Yo.prototype.filter=function(o){},Yo.prototype.interfaces_=function(){return[]},Yo.prototype.getClass=function(){return Yo};var Jt=u(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"),co={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 N("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 xt(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[$,j,e]},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},co.serialVersionUID.get=function(){return 8763622679187377e3},co.SORTINDEX_POINT.get=function(){return 0},co.SORTINDEX_MULTIPOINT.get=function(){return 1},co.SORTINDEX_LINESTRING.get=function(){return 2},co.SORTINDEX_LINEARRING.get=function(){return 3},co.SORTINDEX_MULTILINESTRING.get=function(){return 4},co.SORTINDEX_POLYGON.get=function(){return 5},co.SORTINDEX_MULTIPOLYGON.get=function(){return 6},co.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},co.geometryChangedFilter.get=function(){return Sa},Object.defineProperties(Jt,co);var Sa=u(function(){},"ht");Sa.interfaces_=function(){return[Yo]},Sa.filter=function(o){o.geometryChangedAction()};var Oi=u(function(){},"ft");Oi.prototype.filter=function(o){},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi};var jn=u(function(){},"gt"),Di={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}};jn.prototype.isInBoundary=function(o){},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},Di.Mod2BoundaryNodeRule.get=function(){return qo},Di.EndPointBoundaryNodeRule.get=function(){return Ia},Di.MultiValentEndPointBoundaryNodeRule.get=function(){return Ma},Di.MonoValentEndPointBoundaryNodeRule.get=function(){return wa},Di.MOD2_BOUNDARY_RULE.get=function(){return new qo},Di.ENDPOINT_BOUNDARY_RULE.get=function(){return new Ia},Di.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ma},Di.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new wa},Di.OGC_SFS_BOUNDARY_RULE.get=function(){return jn.MOD2_BOUNDARY_RULE},Object.defineProperties(jn,Di);var qo=u(function(){},"yt");qo.prototype.isInBoundary=function(o){return o%2==1},qo.prototype.interfaces_=function(){return[jn]},qo.prototype.getClass=function(){return qo};var Ia=u(function(){},"_t");Ia.prototype.isInBoundary=function(o){return o>0},Ia.prototype.interfaces_=function(){return[jn]},Ia.prototype.getClass=function(){return Ia};var Ma=u(function(){},"mt");Ma.prototype.isInBoundary=function(o){return o>1},Ma.prototype.interfaces_=function(){return[jn]},Ma.prototype.getClass=function(){return Ma};var wa=u(function(){},"vt");wa.prototype.isInBoundary=function(o){return o===1},wa.prototype.interfaces_=function(){return[jn]},wa.prototype.getClass=function(){return wa};var Nr=u(function(){},"It");Nr.prototype.add=function(){},Nr.prototype.addAll=function(){},Nr.prototype.isEmpty=function(){},Nr.prototype.iterator=function(){},Nr.prototype.size=function(){},Nr.prototype.toArray=function(){},Nr.prototype.remove=function(){},(t.prototype=new Error).name="IndexOutOfBoundsException";var Ta=u(function(){},"Et");Ta.prototype.hasNext=function(){},Ta.prototype.next=function(){},Ta.prototype.remove=function(){};var Li=function(o){function s(){o.apply(this,arguments)}return u(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}(Nr);(n.prototype=new Error).name="NoSuchElementException";var Pt=function(o){function s(){o.call(this),this.array_=[],arguments[0]instanceof Nr&&this.addAll(arguments[0])}return u(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,Nr]},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 jm(this)},s.prototype.get=function(c){if(c<0||c>=this.size())throw new t;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}(Li),jm=function(o){function s(c){o.call(this),this.arrayList_=c,this.position_=0}return u(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}(Ta),Q=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,_)}}}u(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 k&&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 A=arguments[0],B=arguments[1];return this.add(A,B),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var W=arguments[0],it=arguments[1];if(arguments[2])for(var lt=0;lt<W.length;lt++)this.add(W[lt],it);else for(var Ot=W.length-1;Ot>=0;Ot--)this.add(W[Ot],it);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof k){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],mn=arguments[1],bi=arguments[2],Ws=arguments[3],Rl=1;bi>Ws&&(Rl=-1);for(var A2=bi;A2!==Ws;A2+=Rl)this.add(Cr[A2],mn);return!0}},s.prototype.closeRing=function(){this.size()>0&&this.add(new k(this.get(0)),!1)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},Object.defineProperties(s,c),s}(Pt),D=u(function(){},"Lt"),R={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};R.ForwardComparator.get=function(){return U},R.BidirectionalComparator.get=function(){return Y},R.coordArrayType.get=function(){return new Array(0).fill(null)},D.prototype.interfaces_=function(){return[]},D.prototype.getClass=function(){return D},D.isRing=function(o){return!(o.length<4)&&!!o[0].equals2D(o[o.length-1])},D.ptNotInList=function(o,s){for(var c=0;c<o.length;c++){var f=o[c];if(D.indexOf(f,s)<0)return f}return null},D.scroll=function(o,s){var c=D.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)},D.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}},D.intersection=function(o,s){for(var c=new Q,f=0;f<o.length;f++)s.intersects(o[f])&&c.add(o[f],!0);return c.toCoordinateArray()},D.hasRepeatedPoints=function(o){for(var s=1;s<o.length;s++)if(o[s-1].equals(o[s]))return!0;return!1},D.removeRepeatedPoints=function(o){return D.hasRepeatedPoints(o)?new Q(o,!1).toCoordinateArray():o},D.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}},D.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},D.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 k(o[c]);return s}if(arguments.length===5)for(var f=arguments[0],g=arguments[1],_=arguments[2],M=arguments[3],A=arguments[4],B=0;B<A;B++)_[M+B]=new k(f[g+B])},D.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},D.envelope=function(o){for(var s=new xt,c=0;c<o.length;c++)s.expandToInclude(o[c]);return s},D.toCoordinateArray=function(o){return o.toArray(D.coordArrayType)},D.atLeastNCoordinatesOrNothing=function(o,s){return s.length>=o?s:[]},D.indexOf=function(o,s){for(var c=0;c<s.length;c++)if(o.equals(s[c]))return c;return-1},D.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},D.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},D.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},D.extract=function(o,s,c){s=ct.clamp(s,0,o.length);var f=(c=ct.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(D,R);var U=u(function(){},"wt");U.prototype.compare=function(o,s){return D.compare(o,s)},U.prototype.interfaces_=function(){return[q]},U.prototype.getClass=function(){return U};var Y=u(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=D.compare(c,f);return D.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=D.increasingDirection(c),_=D.increasingDirection(f),M=g>0?0:c.length-1,A=_>0?0:c.length-1,B=0;B<c.length;B++){var W=c[M].compareTo(f[A]);if(W!==0)return W;M+=g,A+=_}return 0},Y.prototype.interfaces_=function(){return[q]},Y.prototype.getClass=function(){return Y};var X=u(function(){},"Tt");X.prototype.get=function(){},X.prototype.put=function(){},X.prototype.size=function(){},X.prototype.values=function(){},X.prototype.entrySet=function(){};var ht=function(o){function s(){o.apply(this,arguments)}return u(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 Nr).contains=function(){};var st=function(o){function s(){o.call(this),this.array_=[],arguments[0]instanceof Nr&&this.addAll(arguments[0])}return u(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 yt(this)},s}(a),yt=function(o){function s(c){o.call(this),this.hashSet_=c,this.position_=0}return u(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}(Ta),ft=0;(x.prototype=new ht).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:ft,getValue:u(function(){return this.value},"getValue"),getKey:u(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:ft,getValue:u(function(){return this.value},"getValue"),getKey:u(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)));l(s)===1?(d(h(o),ft),d(s,ft),d(h(h(o)),1),o=h(h(o))):(o===v(h(o))&&(o=h(o),this.rotateLeft(o)),d(h(o),ft),d(h(h(o)),1),this.rotateRight(h(h(o))))}else{var c=m(h(h(o)));l(c)===1?(d(h(o),ft),d(c,ft),d(h(h(o)),1),o=h(h(o))):(o===m(h(o))&&(o=h(o),this.rotateRight(o)),d(h(o),ft),d(h(h(o)),1),this.rotateLeft(h(h(o))))}this.root_.color=ft},x.prototype.values=function(){var o=new Pt,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 st,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=u(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 ot(this)};var ot=u(function(o){this.treeSet_=o,this.position_=0},"Ft");ot.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new n;return this.treeSet_.array_[this.position_++]},ot.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},ot.prototype.remove=function(){throw new i};var vt=u(function(){},"Gt");vt.sort=function(){var o,s,c,f,g=arguments[0];if(arguments.length===1)f=u(function(M,A){return M.compareTo(A)},"i"),g.sort(f);else if(arguments.length===2)c=arguments[1],f=u(function(M,A){return c.compare(M,A)},"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=u(function(M,A){return c.compare(M,A)},"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])},vt.asList=function(o){for(var s=new Pt,c=0,f=o.length;c<f;c++)s.add(o[c]);return s};var mt=u(function(){},"qt"),Kt={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}};Kt.P.get=function(){return 0},Kt.L.get=function(){return 1},Kt.A.get=function(){return 2},Kt.FALSE.get=function(){return-1},Kt.TRUE.get=function(){return-2},Kt.DONTCARE.get=function(){return-3},Kt.SYM_FALSE.get=function(){return"F"},Kt.SYM_TRUE.get=function(){return"T"},Kt.SYM_DONTCARE.get=function(){return"*"},Kt.SYM_P.get=function(){return"0"},Kt.SYM_L.get=function(){return"1"},Kt.SYM_A.get=function(){return"2"},mt.prototype.interfaces_=function(){return[]},mt.prototype.getClass=function(){return mt},mt.toDimensionSymbol=function(o){switch(o){case mt.FALSE:return mt.SYM_FALSE;case mt.TRUE:return mt.SYM_TRUE;case mt.DONTCARE:return mt.SYM_DONTCARE;case mt.P:return mt.SYM_P;case mt.L:return mt.SYM_L;case mt.A:return mt.SYM_A}throw new N("Unknown dimension value: "+o)},mt.toDimensionValue=function(o){switch(bt.toUpperCase(o)){case mt.SYM_FALSE:return mt.FALSE;case mt.SYM_TRUE:return mt.TRUE;case mt.SYM_DONTCARE:return mt.DONTCARE;case mt.SYM_P:return mt.P;case mt.SYM_L:return mt.L;case mt.SYM_A:return mt.A}throw new N("Unknown dimension symbol: "+o)},Object.defineProperties(mt,Kt);var qt=u(function(){},"Vt");qt.prototype.filter=function(o){},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt};var fe=u(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 Qt=function(o){function s(f,g){if(o.call(this,g),this._geometries=f||[],o.hasNullElements(this._geometries))throw new N("geometries must not contain null elements")}u(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 xt,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(),A=0;A<M.length;A++)f[++g]=M[A];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();vt.sort(this._geometries)},s.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},s.prototype.getBoundaryDimension=function(){for(var f=mt.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=mt.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(vt.asList(this._geometries)),_=new I(vt.asList(f._geometries));return this.compare(g,_)}if(arguments.length===2){for(var M=arguments[0],A=arguments[1],B=M,W=this.getNumGeometries(),it=B.getNumGeometries(),lt=0;lt<W&&lt<it;){var Ot=this.getGeometryN(lt),Dt=B.getGeometryN(lt),Bt=Ot.compareToSameClass(Dt,A);if(Bt!==0)return Bt;lt++}return lt<W?1:lt<it?-1:0}},s.prototype.apply=function(){if(pt(arguments[0],Oi))for(var f=arguments[0],g=0;g<this._geometries.length;g++)this._geometries[g].apply(f);else if(pt(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(pt(arguments[0],qt)){var A=arguments[0];A.filter(this);for(var B=0;B<this._geometries.length;B++)this._geometries[B].apply(A)}else if(pt(arguments[0],Yo)){var W=arguments[0];W.filter(this);for(var it=0;it<this._geometries.length;it++)this._geometries[it].apply(W)}},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),wr=function(o){function s(){o.apply(this,arguments)}u(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()?mt.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 Or(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}(Qt),Or=u(function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var o=arguments[0],s=jn.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");Or.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)},Or.prototype.getBoundary=function(){return this._geom instanceof ye?this.boundaryLineString(this._geom):this._geom instanceof wr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Or.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()])},Or.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Or.prototype.computeBoundaryCoordinates=function(o){var s=new Pt;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 D.toCoordinateArray(s)},Or.prototype.addEndpoint=function(o){var s=this._endpointMap.get(o);s===null&&(s=new rn,this._endpointMap.put(o,s)),s.count++},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.getBoundary=function(){if(arguments.length===1){var o=arguments[0];return new Or(o).getBoundary()}if(arguments.length===2){var s=arguments[0],c=arguments[1];return new Or(s,c).getBoundary()}};var rn=u(function(){this.count=null},"kt");rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn};var Dr=u(function(){},"jt"),Un={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr},Dr.chars=function(o,s){for(var c=new Array(s).fill(null),f=0;f<s;f++)c[f]=o;return String(c)},Dr.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(){}(Dr.getStackTrace(f))),A=0;A<g;A++)try{_+=M.readLine()+Dr.NEWLINE}catch(B){if(!(B instanceof w))throw B;Yt.shouldNeverReachHere()}return _}},Dr.split=function(o,s){for(var c=s.length,f=new Pt,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 A=new Array(f.size()).fill(null),B=0;B<A.length;B++)A[B]=f.get(B);return A},Dr.toString=function(){if(arguments.length===1){var o=arguments[0];return Dr.SIMPLE_ORDINATE_FORMAT.format(o)}},Dr.spaces=function(o){return Dr.chars(" ",o)},Un.NEWLINE.get=function(){return Nt.getProperty("line.separator")},Un.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Dr,Un);var we=u(function(){},"Wt");we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},we.copyCoord=function(o,s,c,f){for(var g=Math.min(o.getDimension(),c.getDimension()),_=0;_<g;_++)c.setOrdinate(f,_,o.getOrdinate(s,_))},we.isRing=function(o){var s=o.size();return s===0||!(s<=3)&&o.getOrdinate(0,Tt.X)===o.getOrdinate(s-1,Tt.X)&&o.getOrdinate(0,Tt.Y)===o.getOrdinate(s-1,Tt.Y)},we.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,_),A=s.getOrdinate(g,_);if(o.getOrdinate(g,_)!==s.getOrdinate(g,_)&&(!L.isNaN(M)||!L.isNaN(A)))return!1}return!0},we.extend=function(o,s,c){var f=o.create(c,s.getDimension()),g=s.size();if(we.copy(s,0,f,0,g),g>0)for(var _=g;_<c;_++)we.copy(s,g-1,f,_,1);return f},we.reverse=function(o){for(var s=o.size()-1,c=Math.trunc(s/2),f=0;f<=c;f++)we.swap(o,f,s-f)},we.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)}},we.copy=function(o,s,c,f,g){for(var _=0;_<g;_++)we.copyCoord(o,s+_,c,f+_)},we.toString=function(){if(arguments.length===1){var o=arguments[0],s=o.size();if(s===0)return"()";var c=o.getDimension(),f=new Et;f.append("(");for(var g=0;g<s;g++){g>0&&f.append(" ");for(var _=0;_<c;_++)_>0&&f.append(","),f.append(Dr.toString(o.getOrdinate(g,_)))}return f.append(")"),f.toString()}},we.ensureValidRing=function(o,s){var c=s.size();return c===0?s:c<=3?we.createClosedRing(o,s,4):s.getOrdinate(0,Tt.X)===s.getOrdinate(c-1,Tt.X)&&s.getOrdinate(0,Tt.Y)===s.getOrdinate(c-1,Tt.Y)?s:we.createClosedRing(o,s,c+1)},we.createClosedRing=function(o,s,c){var f=o.create(c,s.getDimension()),g=s.size();we.copy(s,0,f,0,g);for(var _=g;_<c;_++)we.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)}u(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 xt:this._points.expandEnvelope(new xt)},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&&we.reverse(this._points),null}},s.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},s.prototype.getBoundaryDimension=function(){return this.isClosed()?mt.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 Mt.computeLength(this._points)},s.prototype.getNumPoints=function(){return this._points.size()},s.prototype.reverse=function(){var f=this._points.copy();return we.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 A=arguments[0];return arguments[1].compare(this._points,A._points)}},s.prototype.apply=function(){if(pt(arguments[0],Oi))for(var f=arguments[0],g=0;g<this._points.size();g++)f.filter(this._points.getCoordinate(g));else if(pt(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 pt(arguments[0],qt)?arguments[0].filter(this):pt(arguments[0],Yo)&&arguments[0].filter(this)},s.prototype.getBoundary=function(){return new Or(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 N("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),Ai=u(function(){},"Jt");Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai};var Vr=function(o){function s(f,g){o.call(this,g),this._coordinates=f||null,this.init(this._coordinates)}u(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 xt;var f=new xt;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 mt.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(pt(arguments[0],Oi)){var f=arguments[0];if(this.isEmpty())return null;f.filter(this.getCoordinate())}else if(pt(arguments[0],fe)){var g=arguments[0];if(this.isEmpty())return null;g.filter(this._coordinates,0),g.isGeometryChanged()&&this.geometryChanged()}else pt(arguments[0],qt)?arguments[0].filter(this):pt(arguments[0],Yo)&&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[Ai]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(s,c),s}(Jt),Dn=u(function(){},"Zt");Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn};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 N("holes must not contain null elements");if(f.isEmpty()&&o.hasNonEmptyElements(g))throw new N("shell is empty but holes are not");this._shell=f,this._holes=g}u(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 A=0;A<this._holes.length;A++)for(var B=this._holes[A].getCoordinates(),W=0;W<B.length;W++)f[++g]=B[W];return f},s.prototype.getArea=function(){var f=0;f+=Math.abs(Mt.signedArea(this._shell.getCoordinateSequence()));for(var g=0;g<this._holes.length;g++)f-=Math.abs(Mt.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 A=f.getY(_);if(A!==g.getMinY()&&A!==g.getMaxY())return!1}for(var B=f.getX(0),W=f.getY(0),it=1;it<=4;it++){var lt=f.getX(it),Ot=f.getY(it);if(lt!==B==(Ot!==W))return!1;B=lt,W=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,A=_._shell;if(!M.equalsExact(A,g)||this._holes.length!==_._holes.length)return!1;for(var B=0;B<this._holes.length;B++)if(!this._holes[B].equalsExact(_._holes[B],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);vt.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 A=D.minCoordinate(g.getCoordinates());D.scroll(M,A),Nt.arraycopy(M,0,g.getCoordinates(),0,M.length),g.getCoordinates()[M.length]=M[0],Mt.isCCW(g.getCoordinates())===_&&D.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],A=arguments[1],B=M,W=this._shell,it=B._shell,lt=W.compareToSameClass(it,A);if(lt!==0)return lt;for(var Ot=this.getNumInteriorRing(),Dt=B.getNumInteriorRing(),Bt=0;Bt<Ot&&Bt<Dt;){var Wt=this.getInteriorRingN(Bt),Cr=B.getInteriorRingN(Bt),mn=Wt.compareToSameClass(Cr,A);if(mn!==0)return mn;Bt++}return Bt<Ot?1:Bt<Dt?-1:0}},s.prototype.apply=function(f){if(pt(f,Oi)){this._shell.apply(f);for(var g=0;g<this._holes.length;g++)this._holes[g].apply(f)}else if(pt(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(pt(f,qt))f.filter(this);else if(pt(f,Yo)){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[Dn]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(s,c),s}(Jt),$i=function(o){function s(){o.apply(this,arguments)}u(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 mt.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[Ai]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(s,c),s}(Qt),Ni=function(o){function s(f,g){f instanceof k&&g instanceof ge&&(f=g.getCoordinateSequenceFactory().create(f)),o.call(this,f,g),this.validateConstruction()}u(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 mt.FALSE},s.prototype.isClosed=function(){return!!this.isEmpty()||o.prototype.isClosed.call(this)},s.prototype.reverse=function(){var f=this._points.copy();return we.reverse(f),this.getFactory().createLinearRing(f)},s.prototype.validateConstruction=function(){if(!this.isEmpty()&&!o.prototype.isClosed.call(this))throw new N("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<s.MINIMUM_VALID_SIZE)throw new N("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),Wo=function(o){function s(){o.apply(this,arguments)}u(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 Pt,g=0;g<this._geometries.length;g++)for(var _=this._geometries[g].getBoundary(),M=0;M<_.getNumGeometries();M++)f.add(_.getGeometryN(M));var A=new Array(f.size()).fill(null);return this.getFactory().createMultiLineString(f.toArray(A))},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[Dn]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(s,c),s}(Qt),Ji=u(function(o){this._factory=o||null,this._isUserDataCopied=!1},"ie"),bf={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Ji.prototype.setCopyUserData=function(o){this._isUserDataCopied=o},Ji.prototype.edit=function(o,s){if(o===null)return null;var c=this.editInternal(o,s);return this._isUserDataCopied&&c.setUserData(o.getUserData()),c},Ji.prototype.editInternal=function(o,s){return this._factory===null&&(this._factory=o.getFactory()),o instanceof Qt?this.editGeometryCollection(o,s):o instanceof xr?this.editPolygon(o,s):o instanceof Vr?s.edit(o,this._factory):o instanceof ye?s.edit(o,this._factory):(Yt.shouldNeverReachHere("Unsupported Geometry class: "+o.getClass().getName()),null)},Ji.prototype.editGeometryCollection=function(o,s){for(var c=s.edit(o,this._factory),f=new Pt,g=0;g<c.getNumGeometries();g++){var _=this.edit(c.getGeometryN(g),s);_===null||_.isEmpty()||f.add(_)}return c.getClass()===$i?this._factory.createMultiPoint(f.toArray([])):c.getClass()===wr?this._factory.createMultiLineString(f.toArray([])):c.getClass()===Wo?this._factory.createMultiPolygon(f.toArray([])):this._factory.createGeometryCollection(f.toArray([]))},Ji.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 Pt,_=0;_<c.getNumInteriorRing();_++){var M=this.edit(c.getInteriorRingN(_),s);M===null||M.isEmpty()||g.add(M)}return this._factory.createPolygon(f,g.toArray([]))},Ji.prototype.interfaces_=function(){return[]},Ji.prototype.getClass=function(){return Ji},Ji.GeometryEditorOperation=function(){},bf.NoOpGeometryOperation.get=function(){return Um},bf.CoordinateOperation.get=function(){return zm},bf.CoordinateSequenceOperation.get=function(){return Hm},Object.defineProperties(Ji,bf);var Um=u(function(){},"oe");Um.prototype.edit=function(o,s){return o},Um.prototype.interfaces_=function(){return[Ji.GeometryEditorOperation]},Um.prototype.getClass=function(){return Um};var zm=u(function(){},"se");zm.prototype.edit=function(o,s){var c=this.editCoordinates(o.getCoordinates(),o);return c===null?o:o instanceof Ni?s.createLinearRing(c):o instanceof ye?s.createLineString(c):o instanceof Vr?c.length>0?s.createPoint(c[0]):s.createPoint():o},zm.prototype.interfaces_=function(){return[Ji.GeometryEditorOperation]},zm.prototype.getClass=function(){return zm};var Hm=u(function(){},"ae");Hm.prototype.edit=function(o,s){return o instanceof Ni?s.createLinearRing(this.edit(o.getCoordinateSequence(),o)):o instanceof ye?s.createLineString(this.edit(o.getCoordinateSequence(),o)):o instanceof Vr?s.createPoint(this.edit(o.getCoordinateSequence(),o)):o},Hm.prototype.interfaces_=function(){return[Ji.GeometryEditorOperation]},Hm.prototype.getClass=function(){return Hm};var nn=u(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 k}else if(pt(arguments[0],Tt)){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],A=arguments[1];this._coordinates=new Array(M).fill(null),this._dimension=A;for(var B=0;B<M;B++)this._coordinates[B]=new k}}},"ue"),Nw={serialVersionUID:{configurable:!0}};nn.prototype.setOrdinate=function(o,s,c){switch(s){case Tt.X:this._coordinates[o].x=c;break;case Tt.Y:this._coordinates[o].y=c;break;case Tt.Z:this._coordinates[o].z=c;break;default:throw new N("invalid ordinateIndex")}},nn.prototype.size=function(){return this._coordinates.length},nn.prototype.getOrdinate=function(o,s){switch(s){case Tt.X:return this._coordinates[o].x;case Tt.Y:return this._coordinates[o].y;case Tt.Z:return this._coordinates[o].z}return L.NaN},nn.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}},nn.prototype.getCoordinateCopy=function(o){return new k(this._coordinates[o])},nn.prototype.getDimension=function(){return this._dimension},nn.prototype.getX=function(o){return this._coordinates[o].x},nn.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 nn(o,this._dimension)},nn.prototype.expandEnvelope=function(o){for(var s=0;s<this._coordinates.length;s++)o.expandToInclude(this._coordinates[s]);return o},nn.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 nn(o,this._dimension)},nn.prototype.toString=function(){if(this._coordinates.length>0){var o=new Et(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"()"},nn.prototype.getY=function(o){return this._coordinates[o].y},nn.prototype.toCoordinateArray=function(){return this._coordinates},nn.prototype.interfaces_=function(){return[Tt,e]},nn.prototype.getClass=function(){return nn},Nw.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(nn,Nw);var Gs=u(function(){},"ce"),x2={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Gs.prototype.readResolve=function(){return Gs.instance()},Gs.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var o=arguments[0];return new nn(o)}if(pt(arguments[0],Tt)){var s=arguments[0];return new nn(s)}}else if(arguments.length===2){var c=arguments[0],f=arguments[1];return f>3&&(f=3),f<2?new nn(c):new nn(c,f)}},Gs.prototype.interfaces_=function(){return[at,e]},Gs.prototype.getClass=function(){return Gs},Gs.instance=function(){return Gs.instanceObject},x2.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},x2.instanceObject.get=function(){return new Gs},Object.defineProperties(Gs,x2);var kw=function(o){function s(){o.call(this),this.map_=new Map}return u(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 Pt,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 st;return this.map_.entries().forEach(function(f){return c.add(f)}),c},s.prototype.size=function(){return this.map_.size()},s}(X),tr=u(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 cs){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"),_2={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 k){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[e,j]},tr.prototype.getClass=function(){return tr},tr.mostPrecise=function(o,s){return o.compareTo(s)>=0?o:s},_2.serialVersionUID.get=function(){return 7777263578777804e3},_2.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(tr,_2);var cs=u(function o(s){this._name=s||null,o.nameToTypeMap.put(s,this)},"t"),C2={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};cs.prototype.readResolve=function(){return cs.nameToTypeMap.get(this._name)},cs.prototype.toString=function(){return this._name},cs.prototype.interfaces_=function(){return[e]},cs.prototype.getClass=function(){return cs},C2.serialVersionUID.get=function(){return-552860263173159e4},C2.nameToTypeMap.get=function(){return new kw},Object.defineProperties(cs,C2),tr.Type=cs,tr.FIXED=new cs("FIXED"),tr.FLOATING=new cs("FLOATING"),tr.FLOATING_SINGLE=new cs("FLOATING SINGLE");var ge=u(function o(){this._precisionModel=new tr,this._SRID=0,this._coordinateSequenceFactory=o.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?pt(arguments[0],at)?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"),Rw={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 k(o.getMinX(),o.getMinY())):o.getMinX()===o.getMaxX()||o.getMinY()===o.getMaxY()?this.createLineString([new k(o.getMinX(),o.getMinY()),new k(o.getMaxX(),o.getMaxY())]):this.createPolygon(this.createLinearRing([new k(o.getMinX(),o.getMinY()),new k(o.getMinX(),o.getMaxY()),new k(o.getMaxX(),o.getMaxY()),new k(o.getMaxX(),o.getMinY()),new k(o.getMinX(),o.getMinY())]),null)},ge.prototype.createLineString=function(o){return o?o instanceof Array?new ye(this.getCoordinateSequenceFactory().create(o),this):pt(o,Tt)?new ye(o,this):void 0:new ye(this.getCoordinateSequenceFactory().create([]),this)},ge.prototype.createMultiLineString=function(){if(arguments.length===0)return new wr(null,this);if(arguments.length===1){var o=arguments[0];return new wr(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 A=o.iterator().next();if(o.size()>1){if(A instanceof xr)return this.createMultiPolygon(ge.toPolygonArray(o));if(A instanceof ye)return this.createMultiLineString(ge.toLineStringArray(o));if(A instanceof Vr)return this.createMultiPoint(ge.toPointArray(o));Yt.shouldNeverReachHere("Unhandled class: "+A.getClass().getName())}return A},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 k){var o=arguments[0];return this.createPoint(o!==null?this.getCoordinateSequenceFactory().create([o]):null)}if(pt(arguments[0],Tt)){var s=arguments[0];return new Vr(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(pt(arguments[0],Tt)){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 Ni){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 Qt(null,this);if(arguments.length===1){var o=arguments[0];return new Qt(o,this)}},ge.prototype.createGeometry=function(o){return new Ji(this).edit(o,{edit:u(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(pt(arguments[0],Tt)){var s=arguments[0];return new Ni(s,this)}}},ge.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Wo(null,this);if(arguments.length===1){var o=arguments[0];return new Wo(o,this)}},ge.prototype.createMultiPoint=function(){if(arguments.length===0)return new $i(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var o=arguments[0];return new $i(o,this)}if(arguments[0]instanceof Array){var s=arguments[0];return this.createMultiPoint(s!==null?this.getCoordinateSequenceFactory().create(s):null)}if(pt(arguments[0],Tt)){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());we.copy(c,g,_,0,1),f[g]=this.createPoint(_)}return this.createMultiPoint(f)}}},ge.prototype.interfaces_=function(){return[e]},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 Gs.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)},Rw.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(ge,Rw);var IL=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],f0=u(function(o){this.geometryFactory=o||new ge},"Ie");f0.prototype.read=function(o){var s,c=(s=typeof o=="string"?JSON.parse(o):o).type;if(!ps[c])throw new Error("Unknown GeoJSON type: "+s.type);return IL.indexOf(c)!==-1?ps[c].apply(this,[s.coordinates]):c==="GeometryCollection"?ps[c].apply(this,[s.geometries]):ps[c].apply(this,[s])},f0.prototype.write=function(o){var s=o.getGeometryType();if(!Pa[s])throw new Error("Geometry is not supported");return Pa[s].apply(this,[o])};var ps={Feature:u(function(o){var s={};for(var c in o)s[c]=o[c];if(o.geometry){var f=o.geometry.type;if(!ps[f])throw new Error("Unknown GeoJSON type: "+o.type);s.geometry=this.read(o.geometry)}return o.bbox&&(s.bbox=ps.bbox.apply(this,[o.bbox])),s},"Feature"),FeatureCollection:u(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:u(function(o){for(var s=[],c=0;c<o.length;++c){var f=o[c];s.push(new k(f[0],f[1]))}return s},"coordinates"),bbox:u(function(o){return this.geometryFactory.createLinearRing([new k(o[0],o[1]),new k(o[2],o[1]),new k(o[2],o[3]),new k(o[0],o[3]),new k(o[0],o[1])])},"bbox"),Point:u(function(o){var s=new k(o[0],o[1]);return this.geometryFactory.createPoint(s)},"Point"),MultiPoint:u(function(o){for(var s=[],c=0;c<o.length;++c)s.push(ps.Point.apply(this,[o[c]]));return this.geometryFactory.createMultiPoint(s)},"MultiPoint"),LineString:u(function(o){var s=ps.coordinates.apply(this,[o]);return this.geometryFactory.createLineString(s)},"LineString"),MultiLineString:u(function(o){for(var s=[],c=0;c<o.length;++c)s.push(ps.LineString.apply(this,[o[c]]));return this.geometryFactory.createMultiLineString(s)},"MultiLineString"),Polygon:u(function(o){for(var s=ps.coordinates.apply(this,[o[0]]),c=this.geometryFactory.createLinearRing(s),f=[],g=1;g<o.length;++g){var _=o[g],M=ps.coordinates.apply(this,[_]),A=this.geometryFactory.createLinearRing(M);f.push(A)}return this.geometryFactory.createPolygon(c,f)},"Polygon"),MultiPolygon:u(function(o){for(var s=[],c=0;c<o.length;++c){var f=o[c];s.push(ps.Polygon.apply(this,[f]))}return this.geometryFactory.createMultiPolygon(s)},"MultiPolygon"),GeometryCollection:u(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")},Pa={coordinate:u(function(o){return[o.x,o.y]},"coordinate"),Point:u(function(o){return{type:"Point",coordinates:Pa.coordinate.apply(this,[o.getCoordinate()])}},"Point"),MultiPoint:u(function(o){for(var s=[],c=0;c<o._geometries.length;++c){var f=o._geometries[c],g=Pa.Point.apply(this,[f]);s.push(g.coordinates)}return{type:"MultiPoint",coordinates:s}},"MultiPoint"),LineString:u(function(o){for(var s=[],c=o.getCoordinates(),f=0;f<c.length;++f){var g=c[f];s.push(Pa.coordinate.apply(this,[g]))}return{type:"LineString",coordinates:s}},"LineString"),MultiLineString:u(function(o){for(var s=[],c=0;c<o._geometries.length;++c){var f=o._geometries[c],g=Pa.LineString.apply(this,[f]);s.push(g.coordinates)}return{type:"MultiLineString",coordinates:s}},"MultiLineString"),Polygon:u(function(o){var s=[],c=Pa.LineString.apply(this,[o._shell]);s.push(c.coordinates);for(var f=0;f<o._holes.length;++f){var g=o._holes[f],_=Pa.LineString.apply(this,[g]);s.push(_.coordinates)}return{type:"Polygon",coordinates:s}},"Polygon"),MultiPolygon:u(function(o){for(var s=[],c=0;c<o._geometries.length;++c){var f=o._geometries[c],g=Pa.Polygon.apply(this,[f]);s.push(g.coordinates)}return{type:"MultiPolygon",coordinates:s}},"MultiPolygon"),GeometryCollection:u(function(o){for(var s=[],c=0;c<o._geometries.length;++c){var f=o._geometries[c],g=f.getGeometryType();s.push(Pa[g].apply(this,[f]))}return{type:"GeometryCollection",geometries:s}},"GeometryCollection")},S2=u(function(o){this.geometryFactory=o||new ge,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new f0(this.geometryFactory)},"Ne");S2.prototype.read=function(o){var s=this.parser.read(o);return this.precisionModel.getType()===tr.FIXED&&this.reducePrecision(s),s},S2.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 Fw=u(function(){this.parser=new f0(this.geometryFactory)},"Ce");Fw.prototype.write=function(o){return this.parser.write(o)};var Ct=u(function(){},"Se"),d0={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.opposite=function(o){return o===Ct.LEFT?Ct.RIGHT:o===Ct.RIGHT?Ct.LEFT:o},d0.ON.get=function(){return 0},d0.LEFT.get=function(){return 1},d0.RIGHT.get=function(){return 2},Object.defineProperties(Ct,d0),(P.prototype=new Error).name="EmptyStackException",(E.prototype=new Li).add=function(o){return this.array_.push(o),!0},E.prototype.get=function(o){if(o<0||o>=this.size())throw new Error;return this.array_[o]},E.prototype.push=function(o){return this.array_.push(o),o},E.prototype.pop=function(o){if(this.array_.length===0)throw new P;return this.array_.pop()},E.prototype.peek=function(){if(this.array_.length===0)throw new P;return this.array_[this.array_.length-1]},E.prototype.empty=function(){return this.array_.length===0},E.prototype.isEmpty=function(){return this.empty()},E.prototype.search=function(o){return this.array_.indexOf(o)},E.prototype.size=function(){return this.array_.length},E.prototype.toArray=function(){for(var o=[],s=0,c=this.array_.length;s<c;s++)o.push(this.array_[s]);return o};var hs=u(function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null},"be");hs.prototype.getCoordinate=function(){return this._minCoord},hs.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},hs.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=Mt.computeOrientation(this._minCoord,c,s),g=!1;(s.y<this._minCoord.y&&c.y<this._minCoord.y&&f===Mt.COUNTERCLOCKWISE||s.y>this._minCoord.y&&c.y>this._minCoord.y&&f===Mt.CLOCKWISE)&&(g=!0),g&&(this._minIndex=this._minIndex-1)},hs.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=Ct.LEFT;return c[s].y<c[s+1].y&&(f=Ct.RIGHT),f},hs.prototype.getEdge=function(){return this._orientedDe},hs.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])},hs.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)},hs.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)===Ct.LEFT&&(this._orientedDe=this._minDe.getSym())},hs.prototype.interfaces_=function(){return[]},hs.prototype.getClass=function(){return hs};var Ea=function(o){function s(c,f){o.call(this,s.msgWithCoord(c,f)),this.pt=f?new k(f):null,this.name="TopologyException"}return u(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}(Yr),m0=u(function(){this.array_=[]},"Oe");m0.prototype.addLast=function(o){this.array_.push(o)},m0.prototype.removeFirst=function(){return this.array_.shift()},m0.prototype.isEmpty=function(){return this.array_.length===0};var hi=u(function(){this._finder=null,this._dirEdgeList=new Pt,this._nodes=new Pt,this._rightMostCoord=null,this._env=null,this._finder=new hs},"Te");hi.prototype.clearVisitedEdges=function(){for(var o=this._dirEdgeList.iterator();o.hasNext();)o.next().setVisited(!1)},hi.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},hi.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 Ea("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(_)}},hi.prototype.computeDepth=function(o){this.clearVisitedEdges();var s=this._finder.getEdge();s.setEdgeDepths(Ct.RIGHT,o),this.copySymDepths(s),this.computeDepths(s)},hi.prototype.create=function(o){this.addReachable(o),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},hi.prototype.findResultEdges=function(){for(var o=this._dirEdgeList.iterator();o.hasNext();){var s=o.next();s.getDepth(Ct.RIGHT)>=1&&s.getDepth(Ct.LEFT)<=0&&!s.isInteriorAreaEdge()&&s.setInResult(!0)}},hi.prototype.computeDepths=function(o){var s=new st,c=new m0,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 A=M.getNode();s.contains(A)||(c.addLast(A),s.add(A))}}}},hi.prototype.compareTo=function(o){var s=o;return this._rightMostCoord.x<s._rightMostCoord.x?-1:this._rightMostCoord.x>s._rightMostCoord.x?1:0},hi.prototype.getEnvelope=function(){if(this._env===null){for(var o=new xt,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},hi.prototype.addReachable=function(o){var s=new E;for(s.add(o);!s.empty();){var c=s.pop();this.add(c,s)}},hi.prototype.copySymDepths=function(o){var s=o.getSym();s.setDepth(Ct.LEFT,o.getDepth(Ct.RIGHT)),s.setDepth(Ct.RIGHT,o.getDepth(Ct.LEFT))},hi.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)}},hi.prototype.getNodes=function(){return this._nodes},hi.prototype.getDirectedEdges=function(){return this._dirEdgeList},hi.prototype.interfaces_=function(){return[j]},hi.prototype.getClass=function(){return hi};var Lr=u(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[Ct.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],A=arguments[2];this.init(3),this.location[Ct.ON]=_,this.location[Ct.LEFT]=M,this.location[Ct.RIGHT]=A}},"t");Lr.prototype.setAllLocations=function(o){for(var s=0;s<this.location.length;s++)this.location[s]=o},Lr.prototype.isNull=function(){for(var o=0;o<this.location.length;o++)if(this.location[o]!==H.NONE)return!1;return!0},Lr.prototype.setAllLocationsIfNull=function(o){for(var s=0;s<this.location.length;s++)this.location[s]===H.NONE&&(this.location[s]=o)},Lr.prototype.isLine=function(){return this.location.length===1},Lr.prototype.merge=function(o){if(o.location.length>this.location.length){var s=new Array(3).fill(null);s[Ct.ON]=this.location[Ct.ON],s[Ct.LEFT]=H.NONE,s[Ct.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])},Lr.prototype.getLocations=function(){return this.location},Lr.prototype.flip=function(){if(this.location.length<=1)return null;var o=this.location[Ct.LEFT];this.location[Ct.LEFT]=this.location[Ct.RIGHT],this.location[Ct.RIGHT]=o},Lr.prototype.toString=function(){var o=new Et;return this.location.length>1&&o.append(H.toLocationSymbol(this.location[Ct.LEFT])),o.append(H.toLocationSymbol(this.location[Ct.ON])),this.location.length>1&&o.append(H.toLocationSymbol(this.location[Ct.RIGHT])),o.toString()},Lr.prototype.setLocations=function(o,s,c){this.location[Ct.ON]=o,this.location[Ct.LEFT]=s,this.location[Ct.RIGHT]=c},Lr.prototype.get=function(o){return o<this.location.length?this.location[o]:H.NONE},Lr.prototype.isArea=function(){return this.location.length>1},Lr.prototype.isAnyNull=function(){for(var o=0;o<this.location.length;o++)if(this.location[o]===H.NONE)return!0;return!1},Lr.prototype.setLocation=function(){if(arguments.length===1){var o=arguments[0];this.setLocation(Ct.ON,o)}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this.location[s]=c}},Lr.prototype.init=function(o){this.location=new Array(o).fill(null),this.setAllLocations(H.NONE)},Lr.prototype.isEqualOnSide=function(o,s){return this.location[s]===o.location[s]},Lr.prototype.allPositionsEqual=function(o){for(var s=0;s<this.location.length;s++)if(this.location[s]!==o)return!1;return!0},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr};var _r=u(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 Lr(s),this.elt[1]=new Lr(s)}else if(arguments[0]instanceof o){var c=arguments[0];this.elt[0]=new Lr(c.elt[0]),this.elt[1]=new Lr(c.elt[1])}}else if(arguments.length===2){var f=arguments[0],g=arguments[1];this.elt[0]=new Lr(H.NONE),this.elt[1]=new Lr(H.NONE),this.elt[f].setLocation(g)}else if(arguments.length===3){var _=arguments[0],M=arguments[1],A=arguments[2];this.elt[0]=new Lr(_,M,A),this.elt[1]=new Lr(_,M,A)}else if(arguments.length===4){var B=arguments[0],W=arguments[1],it=arguments[2],lt=arguments[3];this.elt[0]=new Lr(H.NONE,H.NONE,H.NONE),this.elt[1]=new Lr(H.NONE,H.NONE,H.NONE),this.elt[B].setLocations(W,it,lt)}},"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 Lr(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(Ct.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 Et;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(Ct.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 Lr(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 hn=u(function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Pt,this._pts=new Pt,this._label=new _r(H.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Pt,this._geometryFactory=null;var o=arguments[0],s=arguments[1];this._geometryFactory=s,this.computePoints(o),this.computeRing()},"De");hn.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=Mt.isCCW(this._ring.getCoordinates())},hn.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},hn.prototype.computePoints=function(o){this._startDe=o;var s=o,c=!0;do{if(s===null)throw new Ea("Found null DirectedEdge");if(s.getEdgeRing()===this)throw new Ea("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)},hn.prototype.getLinearRing=function(){return this._ring},hn.prototype.getCoordinate=function(o){return this._pts.get(o)},hn.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},hn.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 A=M;A>=0;A--)this._pts.add(f[A])}},hn.prototype.isHole=function(){return this._isHole},hn.prototype.setInResult=function(){var o=this._startDe;do o.getEdge().setInResult(!0),o=o.getNext();while(o!==this._startDe)},hn.prototype.containsPoint=function(o){var s=this.getLinearRing();if(!s.getEnvelopeInternal().contains(o)||!Mt.isPointInRing(o,s.getCoordinates()))return!1;for(var c=this._holes.iterator();c.hasNext();)if(c.next().containsPoint(o))return!1;return!0},hn.prototype.addHole=function(o){this._holes.add(o)},hn.prototype.isShell=function(){return this._shell===null},hn.prototype.getLabel=function(){return this._label},hn.prototype.getEdges=function(){return this._edges},hn.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},hn.prototype.getShell=function(){return this._shell},hn.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,Ct.RIGHT);if(f===H.NONE)return null;if(this._label.getLocation(c)===H.NONE)return this._label.setLocation(c,f),null}},hn.prototype.setShell=function(o){this._shell=o,o!==null&&o.addHole(this)},hn.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)},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var ML=function(o){function s(){var c=arguments[0],f=arguments[1];o.call(this,c,f)}return u(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}(hn),wL=function(o){function s(){var c=arguments[0],f=arguments[1];o.call(this,c,f)}return u(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.buildMinimalRings=function(){var c=new Pt,f=this._startDe;do{if(f.getMinEdgeRing()===null){var g=new ML(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}(hn),po=u(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");po.prototype.setVisited=function(o){this._isVisited=o},po.prototype.setInResult=function(o){this._isInResult=o},po.prototype.isCovered=function(){return this._isCovered},po.prototype.isCoveredSet=function(){return this._isCoveredSet},po.prototype.setLabel=function(o){this._label=o},po.prototype.getLabel=function(){return this._label},po.prototype.setCovered=function(o){this._isCovered=o,this._isCoveredSet=!0},po.prototype.updateIM=function(o){Yt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(o)},po.prototype.isInResult=function(){return this._isInResult},po.prototype.isVisited=function(){return this._isVisited},po.prototype.interfaces_=function(){return[]},po.prototype.getClass=function(){return po};var g0=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 u(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}(po),fs=u(function(){this.nodeMap=new x,this.nodeFact=null;var o=arguments[0];this.nodeFact=o},"qe");fs.prototype.find=function(o){return this.nodeMap.get(o)},fs.prototype.addNode=function(){if(arguments[0]instanceof k){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 g0){var c=arguments[0],f=this.nodeMap.get(c.getCoordinate());return f===null?(this.nodeMap.put(c.getCoordinate(),c),c):(f.mergeLabel(c),f)}},fs.prototype.print=function(o){for(var s=this.iterator();s.hasNext();)s.next().print(o)},fs.prototype.iterator=function(){return this.nodeMap.values().iterator()},fs.prototype.values=function(){return this.nodeMap.values()},fs.prototype.getBoundaryNodes=function(o){for(var s=new Pt,c=this.iterator();c.hasNext();){var f=c.next();f.getLabel().getLocation(o)===H.BOUNDARY&&s.add(f)}return s},fs.prototype.add=function(o){var s=o.getCoordinate();this.addNode(s).add(o)},fs.prototype.interfaces_=function(){return[]},fs.prototype.getClass=function(){return fs};var Tr=u(function(){},"Be"),Xm={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.isNorthern=function(o){return o===Tr.NE||o===Tr.NW},Tr.isOpposite=function(o,s){return o===s?!1:(o-s+4)%4===2},Tr.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},Tr.isInHalfPlane=function(o,s){return s===Tr.SE?o===Tr.SE||o===Tr.SW:o===s||o===s+1},Tr.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 N("Cannot compute the quadrant for point ( "+o+", "+s+" )");return o>=0?s>=0?Tr.NE:Tr.SE:s>=0?Tr.NW:Tr.SW}if(arguments[0]instanceof k&&arguments[1]instanceof k){var c=arguments[0],f=arguments[1];if(f.x===c.x&&f.y===c.y)throw new N("Cannot compute the quadrant for two identical points "+c);return f.x>=c.x?f.y>=c.y?Tr.NE:Tr.SE:f.y>=c.y?Tr.NW:Tr.SW}},Xm.NE.get=function(){return 0},Xm.NW.get=function(){return 1},Xm.SW.get=function(){return 2},Xm.SE.get=function(){return 3},Object.defineProperties(Tr,Xm);var Qn=u(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],A=arguments[3];this._edge=g,this.init(_,M),this._label=A}},"Ue");Qn.prototype.compareDirection=function(o){return this._dx===o._dx&&this._dy===o._dy?0:this._quadrant>o._quadrant?1:this._quadrant<o._quadrant?-1:Mt.computeOrientation(o._p0,o._p1,this._p1)},Qn.prototype.getDy=function(){return this._dy},Qn.prototype.getCoordinate=function(){return this._p0},Qn.prototype.setNode=function(o){this._node=o},Qn.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)},Qn.prototype.compareTo=function(o){var s=o;return this.compareDirection(s)},Qn.prototype.getDirectedCoordinate=function(){return this._p1},Qn.prototype.getDx=function(){return this._dx},Qn.prototype.getLabel=function(){return this._label},Qn.prototype.getEdge=function(){return this._edge},Qn.prototype.getQuadrant=function(){return this._quadrant},Qn.prototype.getNode=function(){return this._node},Qn.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},Qn.prototype.computeLabel=function(o){},Qn.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=Tr.quadrant(this._dx,this._dy),Yt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Qn.prototype.interfaces_=function(){return[j]},Qn.prototype.getClass=function(){return Qn};var I2=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 u(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 Ea("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,Ct.LEFT)===H.INTERIOR&&this._label.getLocation(f,Ct.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[Ct.LEFT]+"/"+this._depth[Ct.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===Ct.LEFT&&(_=-1);var M=Ct.opposite(c),A=f+g*_;this.setDepth(c,f),this.setDepth(M,A)},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}(Qn),xf=u(function(){},"Xe");xf.prototype.createNode=function(o){return new g0(o,null)},xf.prototype.interfaces_=function(){return[]},xf.prototype.getClass=function(){return xf};var qr=u(function(){if(this._edges=new Pt,this._nodes=null,this._edgeEndList=new Pt,arguments.length===0)this._nodes=new fs(new xf);else if(arguments.length===1){var o=arguments[0];this._nodes=new fs(o)}},"Ye");qr.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)}},qr.prototype.find=function(o){return this._nodes.find(o)},qr.prototype.addNode=function(){if(arguments[0]instanceof g0){var o=arguments[0];return this._nodes.addNode(o)}if(arguments[0]instanceof k){var s=arguments[0];return this._nodes.addNode(s)}},qr.prototype.getNodeIterator=function(){return this._nodes.iterator()},qr.prototype.linkResultDirectedEdges=function(){for(var o=this._nodes.iterator();o.hasNext();)o.next().getEdges().linkResultDirectedEdges()},qr.prototype.debugPrintln=function(o){Nt.out.println(o)},qr.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},qr.prototype.linkAllDirectedEdges=function(){for(var o=this._nodes.iterator();o.hasNext();)o.next().getEdges().linkAllDirectedEdges()},qr.prototype.matchInSameDirection=function(o,s,c,f){return!!o.equals(c)&&Mt.computeOrientation(o,s,f)===Mt.COLLINEAR&&Tr.quadrant(o,s)===Tr.quadrant(c,f)},qr.prototype.getEdgeEnds=function(){return this._edgeEndList},qr.prototype.debugPrint=function(o){Nt.out.print(o)},qr.prototype.getEdgeIterator=function(){return this._edges.iterator()},qr.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},qr.prototype.insertEdge=function(o){this._edges.add(o)},qr.prototype.findEdgeEnd=function(o){for(var s=this.getEdgeEnds().iterator();s.hasNext();){var c=s.next();if(c.getEdge()===o)return c}return null},qr.prototype.addEdges=function(o){for(var s=o.iterator();s.hasNext();){var c=s.next();this._edges.add(c);var f=new I2(c,!0),g=new I2(c,!1);f.setSym(g),g.setSym(f),this.add(f),this.add(g)}},qr.prototype.add=function(o){this._nodes.add(o),this._edgeEndList.add(o)},qr.prototype.getNodes=function(){return this._nodes.values()},qr.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},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr},qr.linkResultDirectedEdges=function(o){for(var s=o.iterator();s.hasNext();)s.next().getEdges().linkResultDirectedEdges()};var Ki=u(function(){this._geometryFactory=null,this._shellList=new Pt;var o=arguments[0];this._geometryFactory=o},"ke");Ki.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)}},Ki.prototype.computePolygons=function(o){for(var s=new Pt,c=o.iterator();c.hasNext();){var f=c.next().toPolygon(this._geometryFactory);s.add(f)}return s},Ki.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 Ea("unable to assign hole to a shell",f.getCoordinate(0));f.setShell(g)}}},Ki.prototype.buildMinimalEdgeRings=function(o,s,c){for(var f=new Pt,g=o.iterator();g.hasNext();){var _=g.next();if(_.getMaxNodeDegree()>2){_.linkDirectedEdgesForMinimalEdgeRings();var M=_.buildMinimalRings(),A=this.findShell(M);A!==null?(this.placePolygonHoles(A,M),s.add(A)):c.addAll(M)}else f.add(_)}return f},Ki.prototype.containsPoint=function(o){for(var s=this._shellList.iterator();s.hasNext();)if(s.next().containsPoint(o))return!0;return!1},Ki.prototype.buildMaximalEdgeRings=function(o){for(var s=new Pt,c=o.iterator();c.hasNext();){var f=c.next();if(f.isInResult()&&f.getLabel().isArea()&&f.getEdgeRing()===null){var g=new wL(f,this._geometryFactory);s.add(g),g.setInResult()}}return s},Ki.prototype.placePolygonHoles=function(o,s){for(var c=s.iterator();c.hasNext();){var f=c.next();f.isHole()&&f.setShell(o)}},Ki.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ki.prototype.findEdgeRingContaining=function(o,s){for(var c=o.getLinearRing(),f=c.getEnvelopeInternal(),g=c.getCoordinateN(0),_=null,M=null,A=s.iterator();A.hasNext();){var B=A.next(),W=B.getLinearRing(),it=W.getEnvelopeInternal();_!==null&&(M=_.getLinearRing().getEnvelopeInternal());var lt=!1;it.contains(f)&&Mt.isPointInRing(g,W.getCoordinates())&&(lt=!0),lt&&(_===null||M.contains(it))&&(_=B)}return _},Ki.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},Ki.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];qr.linkResultDirectedEdges(c);var f=this.buildMaximalEdgeRings(s),g=new Pt,_=this.buildMinimalEdgeRings(f,this._shellList,g);this.sortShellsAndHoles(_,this._shellList,g),this.placeFreeHoles(this._shellList,g)}},Ki.prototype.interfaces_=function(){return[]},Ki.prototype.getClass=function(){return Ki};var _f=u(function(){},"je");_f.prototype.getBounds=function(){},_f.prototype.interfaces_=function(){return[]},_f.prototype.getClass=function(){return _f};var Zo=u(function(){this._bounds=null,this._item=null;var o=arguments[0],s=arguments[1];this._bounds=o,this._item=s},"He");Zo.prototype.getItem=function(){return this._item},Zo.prototype.getBounds=function(){return this._bounds},Zo.prototype.interfaces_=function(){return[_f,e]},Zo.prototype.getClass=function(){return Zo};var Oa=u(function(){this._size=null,this._items=null,this._size=0,this._items=new Pt,this._items.add(null)},"We");Oa.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},Oa.prototype.size=function(){return this._size},Oa.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)},Oa.prototype.clear=function(){this._size=0,this._items.clear()},Oa.prototype.isEmpty=function(){return this._size===0},Oa.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)},Oa.prototype.interfaces_=function(){return[]},Oa.prototype.getClass=function(){return Oa};var wl=u(function(){},"Ke");wl.prototype.visitItem=function(o){},wl.prototype.interfaces_=function(){return[]},wl.prototype.getClass=function(){return wl};var Qc=u(function(){},"Je");Qc.prototype.insert=function(o,s){},Qc.prototype.remove=function(o,s){},Qc.prototype.query=function(){},Qc.prototype.interfaces_=function(){return[]},Qc.prototype.getClass=function(){return Qc};var xn=u(function(){if(this._childBoundables=new Pt,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var o=arguments[0];this._level=o}}},"Qe"),Bw={serialVersionUID:{configurable:!0}};xn.prototype.getLevel=function(){return this._level},xn.prototype.size=function(){return this._childBoundables.size()},xn.prototype.getChildBoundables=function(){return this._childBoundables},xn.prototype.addChildBoundable=function(o){Yt.isTrue(this._bounds===null),this._childBoundables.add(o)},xn.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},xn.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},xn.prototype.interfaces_=function(){return[_f,e]},xn.prototype.getClass=function(){return xn},Bw.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(xn,Bw);var $o=u(function(){},"$e");$o.reverseOrder=function(){return{compare:u(function(o,s){return s.compareTo(o)},"compare")}},$o.min=function(o){return $o.sort(o),o.get(0)},$o.sort=function(o,s){var c=o.toArray();s?vt.sort(c,s):vt.sort(c);for(var f=o.iterator(),g=0,_=c.length;g<_;g++)f.next(),f.set(c[g])},$o.singletonList=function(o){var s=new Pt;return s.add(o),s};var fn=u(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");fn.prototype.expandToQueue=function(o,s){var c=fn.isComposite(this._boundable1),f=fn.isComposite(this._boundable2);if(c&&f)return fn.area(this._boundable1)>fn.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 N("neither boundable is composite")},fn.prototype.isLeaves=function(){return!(fn.isComposite(this._boundable1)||fn.isComposite(this._boundable2))},fn.prototype.compareTo=function(o){var s=o;return this._distance<s._distance?-1:this._distance>s._distance?1:0},fn.prototype.expand=function(o,s,c,f){for(var g=o.getChildBoundables().iterator();g.hasNext();){var _=g.next(),M=new fn(_,s,this._itemDistance);M.getDistance()<f&&c.add(M)}},fn.prototype.getBoundable=function(o){return o===0?this._boundable1:this._boundable2},fn.prototype.getDistance=function(){return this._distance},fn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},fn.prototype.interfaces_=function(){return[j]},fn.prototype.getClass=function(){return fn},fn.area=function(o){return o.getBounds().getArea()},fn.isComposite=function(o){return o instanceof xn};var Ln=u(function o(){if(this._root=null,this._built=!1,this._itemBoundables=new Pt,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"),y0={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Ln.prototype.getNodeCapacity=function(){return this._nodeCapacity},Ln.prototype.lastNode=function(o){return o.get(o.size()-1)},Ln.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 xn?o+=this.size(c):c instanceof Zo&&(o+=1)}return o}},Ln.prototype.removeItem=function(o,s){for(var c=null,f=o.getChildBoundables().iterator();f.hasNext();){var g=f.next();g instanceof Zo&&g.getItem()===s&&(c=g)}return c!==null&&(o.getChildBoundables().remove(c),!0)},Ln.prototype.itemsTree=function(){if(arguments.length===0){this.build();var o=this.itemsTree(this._root);return o===null?new Pt:o}if(arguments.length===1){for(var s=arguments[0],c=new Pt,f=s.getChildBoundables().iterator();f.hasNext();){var g=f.next();if(g instanceof xn){var _=this.itemsTree(g);_!==null&&c.add(_)}else g instanceof Zo?c.add(g.getItem()):Yt.shouldNeverReachHere()}return c.size()<=0?null:c}},Ln.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 Zo(o,s))},Ln.prototype.boundablesAtLevel=function(){if(arguments.length===1){var o=arguments[0],s=new Pt;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 xn?this.boundablesAtLevel(c,M,g):(Yt.isTrue(M instanceof Zo),c===-1&&g.add(M))}return null}},Ln.prototype.query=function(){if(arguments.length===1){var o=arguments[0];this.build();var s=new Pt;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(pt(arguments[2],wl)&&arguments[0]instanceof Object&&arguments[1]instanceof xn)for(var g=arguments[0],_=arguments[1],M=arguments[2],A=_.getChildBoundables(),B=0;B<A.size();B++){var W=A.get(B);this.getIntersectsOp().intersects(W.getBounds(),g)&&(W instanceof xn?this.query(g,W,M):W instanceof Zo?M.visitItem(W.getItem()):Yt.shouldNeverReachHere())}else if(pt(arguments[2],Li)&&arguments[0]instanceof Object&&arguments[1]instanceof xn)for(var it=arguments[0],lt=arguments[1],Ot=arguments[2],Dt=lt.getChildBoundables(),Bt=0;Bt<Dt.size();Bt++){var Wt=Dt.get(Bt);this.getIntersectsOp().intersects(Wt.getBounds(),it)&&(Wt instanceof xn?this.query(it,Wt,Ot):Wt instanceof Zo?Ot.add(Wt.getItem()):Yt.shouldNeverReachHere())}}},Ln.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},Ln.prototype.getRoot=function(){return this.build(),this._root},Ln.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,A=f.getChildBoundables().iterator();A.hasNext();){var B=A.next();if(this.getIntersectsOp().intersects(B.getBounds(),c)&&B instanceof xn&&(_=this.remove(c,B,g))){M=B;break}}return M!==null&&M.getChildBoundables().isEmpty()&&f.getChildBoundables().remove(M),_}},Ln.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)},Ln.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 xn){var f=this.depth(c);f>o&&(o=f)}}return o+1}},Ln.prototype.createParentBoundables=function(o,s){Yt.isTrue(!o.isEmpty());var c=new Pt;c.add(this.createNode(s));var f=new Pt(o);$o.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},Ln.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Ln.prototype.interfaces_=function(){return[e]},Ln.prototype.getClass=function(){return Ln},Ln.compareDoubles=function(o,s){return o>s?1:o<s?-1:0},y0.IntersectsOp.get=function(){return TL},y0.serialVersionUID.get=function(){return-3886435814360241e3},y0.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Ln,y0);var TL=u(function(){},"rn"),Cf=u(function(){},"on");Cf.prototype.distance=function(o,s){},Cf.prototype.interfaces_=function(){return[]},Cf.prototype.getClass=function(){return Cf};var Gw=function(o){function s(f){f=f||s.DEFAULT_NODE_CAPACITY,o.call(this,f)}u(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 Pt,M=0;M<f.length;M++)_.addAll(this.createParentBoundablesFromVerticalSlice(f[M],g));return _},s.prototype.createNode=function(f){return new Vw(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),A=f.iterator(),B=0;B<g;B++){M[B]=new Pt;for(var W=0;A.hasNext()&&W<_;){var it=A.next();M[B].add(it),W++}}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(pt(arguments[2],wl)&&arguments[0]instanceof Object&&arguments[1]instanceof xn){var M=arguments[0],A=arguments[1],B=arguments[2];o.prototype.query.call(this,M,A,B)}else if(pt(arguments[2],Li)&&arguments[0]instanceof Object&&arguments[1]instanceof xn){var W=arguments[0],it=arguments[1],lt=arguments[2];o.prototype.query.call(this,W,it,lt)}}},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 Pt(f);$o.sort(M,s.xComparator);var A=this.verticalSlices(M,Math.trunc(Math.ceil(Math.sqrt(_))));return this.createParentBoundablesFromVerticalSlices(A,g)},s.prototype.nearestNeighbour=function(){if(arguments.length===1){if(pt(arguments[0],Cf)){var f=arguments[0],g=new fn(this.getRoot(),this.getRoot(),f);return this.nearestNeighbour(g)}if(arguments[0]instanceof fn){var _=arguments[0];return this.nearestNeighbour(_,L.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof s&&pt(arguments[1],Cf)){var M=arguments[0],A=arguments[1],B=new fn(this.getRoot(),M.getRoot(),A);return this.nearestNeighbour(B)}if(arguments[0]instanceof fn&&typeof arguments[1]=="number"){var W=arguments[0],it=arguments[1],lt=null,Ot=new Oa;for(Ot.add(W);!Ot.isEmpty()&&it>0;){var Dt=Ot.poll(),Bt=Dt.getDistance();if(Bt>=it)break;Dt.isLeaves()?(it=Bt,lt=Dt):Dt.expandToQueue(Ot,it)}return[lt.getBoundable(0).getItem(),lt.getBoundable(1).getItem()]}}else if(arguments.length===3){var Wt=arguments[0],Cr=arguments[1],mn=arguments[2],bi=new Zo(Wt,Cr),Ws=new fn(this.getRoot(),bi,mn);return this.nearestNeighbour(Ws)[0]}},s.prototype.interfaces_=function(){return[Qc,e]},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 Vw},c.serialVersionUID.get=function(){return 0x39920f7d5f261e0},c.xComparator.get=function(){return{interfaces_:u(function(){return[q]},"interfaces_"),compare:u(function(f,g){return o.compareDoubles(s.centreX(f.getBounds()),s.centreX(g.getBounds()))},"compare")}},c.yComparator.get=function(){return{interfaces_:u(function(){return[q]},"interfaces_"),compare:u(function(f,g){return o.compareDoubles(s.centreY(f.getBounds()),s.centreY(g.getBounds()))},"compare")}},c.intersectsOp.get=function(){return{interfaces_:u(function(){return[o.IntersectsOp]},"interfaces_"),intersects:u(function(f,g){return f.intersects(g)},"intersects")}},c.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(s,c),s}(Ln),Vw=function(o){function s(){var c=arguments[0];o.call(this,c)}return u(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 xt(g.getBounds()):c.expandToInclude(g.getBounds())}return c},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(xn),ki=u(function(){},"un");ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki},ki.relativeSign=function(o,s){return o<s?-1:o>s?1:0},ki.compare=function(o,s,c){if(s.equals2D(c))return 0;var f=ki.relativeSign(s.x,c.x),g=ki.relativeSign(s.y,c.y);switch(o){case 0:return ki.compareValue(f,g);case 1:return ki.compareValue(g,f);case 2:return ki.compareValue(g,-f);case 3:return ki.compareValue(-f,g);case 4:return ki.compareValue(-f,-g);case 5:return ki.compareValue(-g,-f);case 6:return ki.compareValue(-g,f);case 7:return ki.compareValue(f,-g)}return Yt.shouldNeverReachHere("invalid octant value"),0},ki.compareValue=function(o,s){return o<0?-1:o>0?1:s<0?-1:s>0?1:0};var Tl=u(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 k(s),this.segmentIndex=c,this._segmentOctant=f,this._isInterior=!s.equals2D(o.getCoordinate(c))},"ln");Tl.prototype.getCoordinate=function(){return this.coord},Tl.prototype.print=function(o){o.print(this.coord),o.print(" seg # = "+this.segmentIndex)},Tl.prototype.compareTo=function(o){var s=o;return this.segmentIndex<s.segmentIndex?-1:this.segmentIndex>s.segmentIndex?1:this.coord.equals2D(s.coord)?0:ki.compare(this._segmentOctant,this.coord,s.coord)},Tl.prototype.isEndPoint=function(o){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===o},Tl.prototype.isInterior=function(){return this._isInterior},Tl.prototype.interfaces_=function(){return[j]},Tl.prototype.getClass=function(){return Tl};var fi=u(function(){this._nodeMap=new x,this._edge=null;var o=arguments[0];this._edge=o},"cn");fi.prototype.getSplitCoordinates=function(){var o=new Q;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()},fi.prototype.addCollapsedNodes=function(){var o=new Pt;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)}},fi.prototype.print=function(o){o.println("Intersections:");for(var s=this.iterator();s.hasNext();)s.next().print(o)},fi.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))}},fi.prototype.addEdgeCoordinates=function(o,s,c){var f=this._edge.getCoordinate(s.segmentIndex),g=s.isInterior()||!s.coord.equals2D(f);c.add(new k(o.coord),!1);for(var _=o.segmentIndex+1;_<=s.segmentIndex;_++)c.add(this._edge.getCoordinate(_));g&&c.add(new k(s.coord))},fi.prototype.iterator=function(){return this._nodeMap.values().iterator()},fi.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}},fi.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)},fi.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}},fi.prototype.getEdge=function(){return this._edge},fi.prototype.addEndpoints=function(){var o=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(o),o)},fi.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 k(o.coord);for(var A=o.segmentIndex+1;A<=s.segmentIndex;A++)_[M++]=this._edge.getCoordinate(A);return g&&(_[M]=new k(s.coord)),new on(_,this._edge.getData())},fi.prototype.add=function(o,s){var c=new Tl(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)},fi.prototype.checkSplitEdgesCorrectness=function(o){var s=this._edge.getCoordinates(),c=o.get(0).getCoordinate(0);if(!c.equals2D(s[0]))throw new Yr("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 Yr("bad split edge end point at "+g)},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi};var tp=u(function(){},"pn");tp.prototype.interfaces_=function(){return[]},tp.prototype.getClass=function(){return tp},tp.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 N("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 k&&arguments[1]instanceof k){var g=arguments[0],_=arguments[1],M=_.x-g.x,A=_.y-g.y;if(M===0&&A===0)throw new N("Cannot compute the octant for two identical points "+g);return tp.octant(M,A)}};var Vs=u(function(){},"hn");Vs.prototype.getCoordinates=function(){},Vs.prototype.size=function(){},Vs.prototype.getCoordinate=function(o){},Vs.prototype.isClosed=function(){},Vs.prototype.setData=function(o){},Vs.prototype.getData=function(){},Vs.prototype.interfaces_=function(){return[]},Vs.prototype.getClass=function(){return Vs};var Ym=u(function(){},"fn");Ym.prototype.addIntersection=function(o,s){},Ym.prototype.interfaces_=function(){return[Vs]},Ym.prototype.getClass=function(){return Ym};var on=u(function(){this._nodeList=new fi(this),this._pts=null,this._data=null;var o=arguments[0],s=arguments[1];this._pts=o,this._data=s},"gn");on.prototype.getCoordinates=function(){return this._pts},on.prototype.size=function(){return this._pts.length},on.prototype.getCoordinate=function(o){return this._pts[o]},on.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},on.prototype.getSegmentOctant=function(o){return o===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(o),this.getCoordinate(o+1))},on.prototype.setData=function(o){this._data=o},on.prototype.safeOctant=function(o,s){return o.equals2D(s)?0:tp.octant(o,s)},on.prototype.getData=function(){return this._data},on.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 k(c.getIntersection(g));this.addIntersection(_,f)}},on.prototype.toString=function(){return br.toLineString(new nn(this._pts))},on.prototype.getNodeList=function(){return this._nodeList},on.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)},on.prototype.addIntersections=function(o,s,c){for(var f=0;f<o.getIntersectionNum();f++)this.addIntersection(o,s,c,f)},on.prototype.interfaces_=function(){return[Ym]},on.prototype.getClass=function(){return on},on.getNodedSubstrings=function(){if(arguments.length===1){var o=arguments[0],s=new Pt;return on.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=u(function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new k,this.p1=new k;else if(arguments.length===1){var o=arguments[0];this.p0=new k(o.p0),this.p1=new k(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 k(s,c),this.p1=new k(f,g)}},"dn"),jw={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=Mt.orientationIndex(this.p0,this.p1,o.p0),c=Mt.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 k){var f=arguments[0];return Mt.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 Zi;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 k){var o=arguments[0];if(o.equals(this.p0)||o.equals(this.p1))return new k(o);var s=this.projectionFactor(o),c=new k;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 A=this.project(f.p1);return _<0&&(A=this.p0),_>1&&(A=this.p1),new Ut(M,A)}},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 Mt.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 A=o.closestPoint(this.p0);(g=A.distance(this.p0))<f&&(f=g,c[0]=this.p0,c[1]=A);var B=o.closestPoint(this.p1);return(g=B.distance(this.p1))<f&&(f=g,c[0]=this.p1,c[1]=B),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+_*_),A=0,B=0;if(s!==0){if(M<=0)throw new Error("Cannot compute offset from zero-length line segment");A=s*g/M,B=s*_/M}return new k(c-B,f+A)},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 Mt.distanceLineLine(this.p0,this.p1,o.p0,o.p1)}if(arguments[0]instanceof k){var s=arguments[0];return Mt.distancePointLine(s,this.p0,this.p1)}},Ut.prototype.pointAlong=function(o){var s=new k;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,e]},Ut.prototype.getClass=function(){return Ut},Ut.midPoint=function(o,s){return new k((o.x+s.x)/2,(o.y+s.y)/2)},jw.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Ut,jw);var qm=u(function(){this.tempEnv1=new xt,this.tempEnv2=new xt,this._overlapSeg1=new Ut,this._overlapSeg2=new Ut},"_n");qm.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)}}},qm.prototype.interfaces_=function(){return[]},qm.prototype.getClass=function(){return qm};var Qi=u(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");Qi.prototype.getLineSegment=function(o,s){s.p0=this._pts[o],s.p1=this._pts[o+1]},Qi.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)},Qi.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},Qi.prototype.computeOverlaps=function(o,s){this.computeOverlapsInternal(this._start,this._end,o,o._start,o._end,s)},Qi.prototype.setId=function(o){this._id=o},Qi.prototype.select=function(o,s){this.computeSelect(o,this._start,this._end,s)},Qi.prototype.getEnvelope=function(){if(this._env===null){var o=this._pts[this._start],s=this._pts[this._end];this._env=new xt(o,s)}return this._env},Qi.prototype.getEndIndex=function(){return this._end},Qi.prototype.getStartIndex=function(){return this._start},Qi.prototype.getContext=function(){return this._context},Qi.prototype.getId=function(){return this._id},Qi.prototype.computeOverlapsInternal=function(o,s,c,f,g,_){var M=this._pts[o],A=this._pts[s],B=c._pts[f],W=c._pts[g];if(s-o==1&&g-f==1)return _.overlap(this,o,c,f),null;if(_.tempEnv1.init(M,A),_.tempEnv2.init(B,W),!_.tempEnv1.intersects(_.tempEnv2))return null;var it=Math.trunc((o+s)/2),lt=Math.trunc((f+g)/2);o<it&&(f<lt&&this.computeOverlapsInternal(o,it,c,f,lt,_),lt<g&&this.computeOverlapsInternal(o,it,c,lt,g,_)),it<s&&(f<lt&&this.computeOverlapsInternal(it,s,c,f,lt,_),lt<g&&this.computeOverlapsInternal(it,s,c,lt,g,_))},Qi.prototype.interfaces_=function(){return[]},Qi.prototype.getClass=function(){return Qi};var ds=u(function(){},"vn");ds.prototype.interfaces_=function(){return[]},ds.prototype.getClass=function(){return ds},ds.getChainStartIndices=function(o){var s=0,c=new Pt;c.add(new dt(s));do{var f=ds.findChainEnd(o,s);c.add(new dt(f)),s=f}while(s<o.length-1);return ds.toIntArray(c)},ds.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=Tr.quadrant(o[c],o[c+1]),g=s+1;g<o.length&&!(!o[g-1].equals2D(o[g])&&Tr.quadrant(o[g-1],o[g])!==f);)g++;return g-1},ds.getChains=function(){if(arguments.length===1){var o=arguments[0];return ds.getChains(o,null)}if(arguments.length===2){for(var s=arguments[0],c=arguments[1],f=new Pt,g=ds.getChainStartIndices(s),_=0;_<g.length-1;_++){var M=new Qi(s,g[_],g[_+1],c);f.add(M)}return f}},ds.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 qu=u(function(){},"In");qu.prototype.computeNodes=function(o){},qu.prototype.getNodedSubstrings=function(){},qu.prototype.interfaces_=function(){return[]},qu.prototype.getClass=function(){return qu};var Wm=u(function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var o=arguments[0];this.setSegmentIntersector(o)}}},"En");Wm.prototype.setSegmentIntersector=function(o){this._segInt=o},Wm.prototype.interfaces_=function(){return[qu]},Wm.prototype.getClass=function(){return Wm};var M2=function(o){function s(f){f?o.call(this,f):o.call(this),this._monoChains=new Pt,this._index=new Gw,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}u(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 on.getNodedSubstrings(this._nodedSegStrings)},s.prototype.getIndex=function(){return this._index},s.prototype.add=function(f){for(var g=ds.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 Uw(this._segInt),g=this._monoChains.iterator();g.hasNext();)for(var _=g.next(),M=this._index.query(_.getEnvelope()).iterator();M.hasNext();){var A=M.next();if(A.getId()>_.getId()&&(_.computeOverlaps(A,f),this._nOverlaps++),this._segInt.isDone())return null}},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},c.SegmentOverlapAction.get=function(){return Uw},Object.defineProperties(s,c),s}(Wm),Uw=function(o){function s(){o.call(this),this._si=null;var c=arguments[0];this._si=c}return u(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(),A=g.getContext();this._si.processIntersections(M,f,A,_)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(qm),er=u(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],A=arguments[3];this.setQuadrantSegments(g),this.setEndCapStyle(_),this.setJoinStyle(M),this.setMitreLimit(A)}}},"t"),Da={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)},Da.CAP_ROUND.get=function(){return 1},Da.CAP_FLAT.get=function(){return 2},Da.CAP_SQUARE.get=function(){return 3},Da.JOIN_ROUND.get=function(){return 1},Da.JOIN_MITRE.get=function(){return 2},Da.JOIN_BEVEL.get=function(){return 3},Da.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Da.DEFAULT_MITRE_LIMIT.get=function(){return 5},Da.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(er,Da);var Kr=u(function(o){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Mt.COUNTERCLOCKWISE,this._inputLine=o||null},"Ln"),Zm={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Kr.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)},Kr.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]=Kr.DELETE,g=!0,f=!0),o=g?c:s,s=this.findNextNonDeletedIndex(o),c=this.findNextNonDeletedIndex(s)}return f},Kr.prototype.isShallowConcavity=function(o,s,c,f){return Mt.computeOrientation(o,s,c)!==this._angleOrientation?!1:Mt.distancePointLine(s,o,c)<f},Kr.prototype.isShallowSampled=function(o,s,c,f,g){var _=Math.trunc((f-c)/Kr.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},Kr.prototype.isConcave=function(o,s,c){var f=Mt.computeOrientation(o,s,c)===this._angleOrientation;return f},Kr.prototype.simplify=function(o){this._distanceTol=Math.abs(o),o<0&&(this._angleOrientation=Mt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var s=!1;do s=this.deleteShallowConcavities();while(s);return this.collapseLine()},Kr.prototype.findNextNonDeletedIndex=function(o){for(var s=o+1;s<this._inputLine.length&&this._isDeleted[s]===Kr.DELETE;)s++;return s},Kr.prototype.isShallow=function(o,s,c,f){return Mt.distancePointLine(s,o,c)<f},Kr.prototype.collapseLine=function(){for(var o=new Q,s=0;s<this._inputLine.length;s++)this._isDeleted[s]!==Kr.DELETE&&o.add(this._inputLine[s]);return o.toCoordinateArray()},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.simplify=function(o,s){return new Kr(o).simplify(s)},Zm.INIT.get=function(){return 0},Zm.DELETE.get=function(){return 1},Zm.KEEP.get=function(){return 1},Zm.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Kr,Zm);var ho=u(function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Pt},"wn"),zw={COORDINATE_ARRAY_TYPE:{configurable:!0}};ho.prototype.getCoordinates=function(){return this._ptList.toArray(ho.COORDINATE_ARRAY_TYPE)},ho.prototype.setPrecisionModel=function(o){this._precisionModel=o},ho.prototype.addPt=function(o){var s=new k(o);if(this._precisionModel.makePrecise(s),this.isRedundant(s))return null;this._ptList.add(s)},ho.prototype.revere=function(){},ho.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])},ho.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},ho.prototype.toString=function(){return new ge().createLineString(this.getCoordinates()).toString()},ho.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var o=new k(this._ptList.get(0)),s=this._ptList.get(this._ptList.size()-1);if(o.equals(s))return null;this._ptList.add(o)},ho.prototype.setMinimumVertexDistance=function(o){this._minimimVertexDistance=o},ho.prototype.interfaces_=function(){return[]},ho.prototype.getClass=function(){return ho},zw.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(ho,zw);var xe=u(function(){},"Tn"),ep={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},ep.PI_TIMES_2.get=function(){return 2*Math.PI},ep.PI_OVER_2.get=function(){return Math.PI/2},ep.PI_OVER_4.get=function(){return Math.PI/4},ep.COUNTERCLOCKWISE.get=function(){return Mt.COUNTERCLOCKWISE},ep.CLOCKWISE.get=function(){return Mt.CLOCKWISE},ep.NONE.get=function(){return Mt.COLLINEAR},Object.defineProperties(xe,ep);var kr=u(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 Zi,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"),$m={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}};kr.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=Mt.computeOrientation(this._s0,this._s1,this._s2),f=c===Mt.CLOCKWISE&&this._side===Ct.LEFT||c===Mt.COUNTERCLOCKWISE&&this._side===Ct.RIGHT;c===0?this.addCollinear(s):f?this.addOutsideTurn(c,s):this.addInsideTurn(c,s)},kr.prototype.addLineEndCap=function(o,s){var c=new Ut(o,s),f=new Ut;this.computeOffsetSegment(c,Ct.LEFT,this._distance,f);var g=new Ut;this.computeOffsetSegment(c,Ct.RIGHT,this._distance,g);var _=s.x-o.x,M=s.y-o.y,A=Math.atan2(M,_);switch(this._bufParams.getEndCapStyle()){case er.CAP_ROUND:this._segList.addPt(f.p1),this.addFilletArc(s,A+Math.PI/2,A-Math.PI/2,Mt.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 B=new k;B.x=Math.abs(this._distance)*Math.cos(A),B.y=Math.abs(this._distance)*Math.sin(A);var W=new k(f.p1.x+B.x,f.p1.y+B.y),it=new k(g.p1.x+B.x,g.p1.y+B.y);this._segList.addPt(W),this._segList.addPt(it)}},kr.prototype.getCoordinates=function(){return this._segList.getCoordinates()},kr.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 k(0,0),g=!1}g?this._segList.addPt(_):this.addLimitedMitreJoin(s,c,f,this._bufParams.getMitreLimit())},kr.prototype.addFilletCorner=function(o,s,c,f,g){var _=s.x-o.x,M=s.y-o.y,A=Math.atan2(M,_),B=c.x-o.x,W=c.y-o.y,it=Math.atan2(W,B);f===Mt.CLOCKWISE?A<=it&&(A+=2*Math.PI):A>=it&&(A-=2*Math.PI),this._segList.addPt(s),this.addFilletArc(o,A,it,f,g),this._segList.addPt(c)},kr.prototype.addOutsideTurn=function(o,s){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*kr.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))},kr.prototype.createSquare=function(o){this._segList.addPt(new k(o.x+this._distance,o.y+this._distance)),this._segList.addPt(new k(o.x+this._distance,o.y-this._distance)),this._segList.addPt(new k(o.x-this._distance,o.y-this._distance)),this._segList.addPt(new k(o.x-this._distance,o.y+this._distance)),this._segList.closeRing()},kr.prototype.addSegments=function(o,s){this._segList.addPts(o,s)},kr.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},kr.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},kr.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)},kr.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,A=xe.normalize(_+M),B=xe.normalize(A+Math.PI),W=f*c,it=c-W*Math.abs(Math.sin(M)),lt=g.x+W*Math.cos(B),Ot=g.y+W*Math.sin(B),Dt=new k(lt,Ot),Bt=new Ut(g,Dt),Wt=Bt.pointAlongOffset(1,it),Cr=Bt.pointAlongOffset(1,-it);this._side===Ct.LEFT?(this._segList.addPt(Wt),this._segList.addPt(Cr)):(this._segList.addPt(Cr),this._segList.addPt(Wt))},kr.prototype.computeOffsetSegment=function(o,s,c,f){var g=s===Ct.LEFT?1:-1,_=o.p1.x-o.p0.x,M=o.p1.y-o.p0.y,A=Math.sqrt(_*_+M*M),B=g*c*_/A,W=g*c*M/A;f.p0.x=o.p0.x-W,f.p0.y=o.p0.y+B,f.p1.x=o.p1.x-W,f.p1.y=o.p1.y+B},kr.prototype.addFilletArc=function(o,s,c,f,g){var _=f===Mt.CLOCKWISE?-1:1,M=Math.abs(s-c),A=Math.trunc(M/this._filletAngleQuantum+.5);if(A<1)return null;for(var B=M/A,W=0,it=new k;W<M;){var lt=s+_*W;it.x=o.x+g*Math.cos(lt),it.y=o.y+g*Math.sin(lt),this._segList.addPt(it),W+=B}},kr.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*kr.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 k((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 k((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)}},kr.prototype.createCircle=function(o){var s=new k(o.x+this._distance,o.y);this._segList.addPt(s),this.addFilletArc(o,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},kr.prototype.addBevelJoin=function(o,s){this._segList.addPt(o.p1),this._segList.addPt(s.p0)},kr.prototype.init=function(o){this._distance=o,this._maxCurveSegmentError=o*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new ho,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(o*kr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},kr.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,Mt.CLOCKWISE,this._distance))},kr.prototype.closeRing=function(){this._segList.closeRing()},kr.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},$m.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},$m.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},$m.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},$m.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(kr,$m);var Ri=u(function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var o=arguments[0],s=arguments[1];this._precisionModel=o,this._bufParams=s},"Mn");Ri.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&&D.reverse(_),_},Ri.prototype.computeSingleSidedBufferCurve=function(o,s,c){var f=this.simplifyTolerance(this._distance);if(s){c.addSegments(o,!0);var g=Kr.simplify(o,-f),_=g.length-1;c.initSideSegments(g[_],g[_-1],Ct.LEFT),c.addFirstSegment();for(var M=_-2;M>=0;M--)c.addNextSegment(g[M],!0)}else{c.addSegments(o,!1);var A=Kr.simplify(o,f),B=A.length-1;c.initSideSegments(A[0],A[1],Ct.LEFT),c.addFirstSegment();for(var W=2;W<=B;W++)c.addNextSegment(A[W],!0)}c.addLastSegment(),c.closeRing()},Ri.prototype.computeRingBufferCurve=function(o,s,c){var f=this.simplifyTolerance(this._distance);s===Ct.RIGHT&&(f=-f);var g=Kr.simplify(o,f),_=g.length-1;c.initSideSegments(g[_-1],g[0],s);for(var M=1;M<=_;M++){var A=M!==1;c.addNextSegment(g[M],A)}c.closeRing()},Ri.prototype.computeLineBufferCurve=function(o,s){var c=this.simplifyTolerance(this._distance),f=Kr.simplify(o,c),g=f.length-1;s.initSideSegments(f[0],f[1],Ct.LEFT);for(var _=2;_<=g;_++)s.addNextSegment(f[_],!0);s.addLastSegment(),s.addLineEndCap(f[g-1],f[g]);var M=Kr.simplify(o,-c),A=M.length-1;s.initSideSegments(M[A],M[A-1],Ct.LEFT);for(var B=A-2;B>=0;B--)s.addNextSegment(M[B],!0);s.addLastSegment(),s.addLineEndCap(M[1],M[0]),s.closeRing()},Ri.prototype.computePointCurve=function(o,s){switch(this._bufParams.getEndCapStyle()){case er.CAP_ROUND:s.createCircle(o);break;case er.CAP_SQUARE:s.createSquare(o)}},Ri.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()},Ri.prototype.getBufferParameters=function(){return this._bufParams},Ri.prototype.simplifyTolerance=function(o){return o*this._bufParams.getSimplifyFactor()},Ri.prototype.getRingCurve=function(o,s,c){if(this._distance=c,o.length<=2)return this.getLineCurve(o,c);if(c===0)return Ri.copyCoordinates(o);var f=this.getSegGen(c);return this.computeRingBufferCurve(o,s,f),f.getCoordinates()},Ri.prototype.computeOffsetCurve=function(o,s,c){var f=this.simplifyTolerance(this._distance);if(s){var g=Kr.simplify(o,-f),_=g.length-1;c.initSideSegments(g[_],g[_-1],Ct.LEFT),c.addFirstSegment();for(var M=_-2;M>=0;M--)c.addNextSegment(g[M],!0)}else{var A=Kr.simplify(o,f),B=A.length-1;c.initSideSegments(A[0],A[1],Ct.LEFT),c.addFirstSegment();for(var W=2;W<=B;W++)c.addNextSegment(A[W],!0)}c.addLastSegment()},Ri.prototype.getSegGen=function(o){return new kr(this._precisionModel,this._bufParams,o)},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.copyCoordinates=function(o){for(var s=new Array(o.length).fill(null),c=0;c<s.length;c++)s[c]=new k(o[c]);return s};var rp=u(function(){this._subgraphs=null,this._seg=new Ut,this._cga=new Mt;var o=arguments[0];this._subgraphs=o},"An"),Hw={DepthSegment:{configurable:!0}};rp.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var o=arguments[0],s=new Pt,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(pt(arguments[2],Li)&&arguments[0]instanceof k&&arguments[1]instanceof I2){for(var _=arguments[0],M=arguments[1],A=arguments[2],B=M.getEdge().getCoordinates(),W=0;W<B.length-1;W++)if(this._seg.p0=B[W],this._seg.p1=B[W+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||Mt.computeOrientation(this._seg.p0,this._seg.p1,_)===Mt.RIGHT)){var it=M.getDepth(Ct.LEFT);this._seg.p0.equals(B[W])||(it=M.getDepth(Ct.RIGHT));var lt=new Wu(this._seg,it);A.add(lt)}}else if(pt(arguments[2],Li)&&arguments[0]instanceof k&&pt(arguments[1],Li))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)}}},rp.prototype.getDepth=function(o){var s=this.findStabbedSegments(o);return s.size()===0?0:$o.min(s)._leftDepth},rp.prototype.interfaces_=function(){return[]},rp.prototype.getClass=function(){return rp},Hw.DepthSegment.get=function(){return Wu},Object.defineProperties(rp,Hw);var Wu=u(function(){this._upwardSeg=null,this._leftDepth=null;var o=arguments[0],s=arguments[1];this._upwardSeg=new Ut(o),this._leftDepth=s},"Gn");Wu.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)},Wu.prototype.compareX=function(o,s){var c=o.p0.compareTo(s.p0);return c!==0?c:o.p1.compareTo(s.p1)},Wu.prototype.toString=function(){return this._upwardSeg.toString()},Wu.prototype.interfaces_=function(){return[j]},Wu.prototype.getClass=function(){return Wu};var rr=u(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 N("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,A=f.x-g,B=c.y-_,W=f.y-_,it=M*W-A*B,lt=o.x-g,Ot=o.y-_,Dt=(W*lt-A*Ot)/it,Bt=(-B*lt+M*Ot)/it;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,A=s.x-f,B=s.y-g,W=2*rr.det(_,M,A,B),it=rr.det(M,_*_+M*M,B,A*A+B*B),lt=rr.det(_,_*_+M*M,A,A*A+B*B);return new k(f-it/W,g+lt/W)},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 k(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,A=c.y-o.y,B=c.z-o.z,W=g*B-_*A,it=_*M-f*B,lt=f*A-g*M,Ot=W*W+it*it+lt*lt,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 k(f,g)},rr.inCentre=function(o,s,c){var f=s.distance(c),g=o.distance(c),_=o.distance(s),M=f+g+_,A=(f*o.x+g*s.x+_*c.x)/M,B=(f*o.y+g*s.y+_*c.y)/M;return new k(A,B)};var Do=u(function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Pt;var o=arguments[0],s=arguments[1],c=arguments[2];this._inputGeom=o,this._distance=s,this._curveBuilder=c},"Bn");Do.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)},Do.prototype.addPolygon=function(o){var s=this._distance,c=Ct.LEFT;this._distance<0&&(s=-this._distance,c=Ct.RIGHT);var f=o.getExteriorRing(),g=D.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(_),A=D.removeRepeatedPoints(M.getCoordinates());this._distance>0&&this.isErodedCompletely(M,-this._distance)||this.addPolygonRing(A,s,Ct.opposite(c),H.INTERIOR,H.EXTERIOR)}},Do.prototype.isTriangleErodedCompletely=function(o,s){var c=new rr(o[0],o[1],o[2]),f=c.inCentre();return Mt.distancePointLine(f,c.p0,c.p1)<Math.abs(s)},Do.prototype.addLineString=function(o){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var s=D.removeRepeatedPoints(o.getCoordinates()),c=this._curveBuilder.getLineCurve(s,this._distance);this.addCurve(c,H.EXTERIOR,H.INTERIOR)},Do.prototype.addCurve=function(o,s,c){if(o===null||o.length<2)return null;var f=new on(o,new _r(0,H.BOUNDARY,s,c));this._curveList.add(f)},Do.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Do.prototype.addPolygonRing=function(o,s,c,f,g){if(s===0&&o.length<Ni.MINIMUM_VALID_SIZE)return null;var _=f,M=g;o.length>=Ni.MINIMUM_VALID_SIZE&&Mt.isCCW(o)&&(_=g,M=f,c=Ct.opposite(c));var A=this._curveBuilder.getRingCurve(o,c,s);this.addCurve(A,_,M)},Do.prototype.add=function(o){if(o.isEmpty())return null;o instanceof xr?this.addPolygon(o):o instanceof ye?this.addLineString(o):o instanceof Vr?this.addPoint(o):o instanceof $i?this.addCollection(o):o instanceof wr?this.addCollection(o):o instanceof Wo?this.addCollection(o):o instanceof Qt&&this.addCollection(o)},Do.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},Do.prototype.addCollection=function(o){for(var s=0;s<o.getNumGeometries();s++){var c=o.getGeometryN(s);this.add(c)}},Do.prototype.interfaces_=function(){return[]},Do.prototype.getClass=function(){return Do};var Sf=u(function(){},"Vn");Sf.prototype.locate=function(o){},Sf.prototype.interfaces_=function(){return[]},Sf.prototype.getClass=function(){return Sf};var js=u(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");js.prototype.next=function(){if(this._atStart)return this._atStart=!1,js.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 Qt?(this._subcollectionIterator=new js(o),this._subcollectionIterator.next()):o},js.prototype.remove=function(){throw new Error(this.getClass().getName())},js.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)},js.prototype.interfaces_=function(){return[Ta]},js.prototype.getClass=function(){return js},js.isAtomic=function(o){return!(o instanceof Qt)};var fo=u(function(){this._geom=null;var o=arguments[0];this._geom=o},"zn");fo.prototype.locate=function(o){return fo.locate(o,this._geom)},fo.prototype.interfaces_=function(){return[Sf]},fo.prototype.getClass=function(){return fo},fo.isPointInRing=function(o,s){return!!s.getEnvelopeInternal().intersects(o)&&Mt.isPointInRing(o,s.getCoordinates())},fo.containsPointInPolygon=function(o,s){if(s.isEmpty())return!1;var c=s.getExteriorRing();if(!fo.isPointInRing(o,c))return!1;for(var f=0;f<s.getNumInteriorRing();f++){var g=s.getInteriorRingN(f);if(fo.isPointInRing(o,g))return!1}return!0},fo.containsPoint=function(o,s){if(s instanceof xr)return fo.containsPointInPolygon(o,s);if(s instanceof Qt)for(var c=new js(s);c.hasNext();){var f=c.next();if(f!==s&&fo.containsPoint(o,f))return!0}return!1},fo.locate=function(o,s){return s.isEmpty()?H.EXTERIOR:fo.containsPoint(o,s)?H.INTERIOR:H.EXTERIOR};var ti=u(function(){this._edgeMap=new x,this._edgeList=null,this._ptInAreaLocation=[H.NONE,H.NONE]},"Xn");ti.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)},ti.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,Ct.LEFT)!==H.NONE&&(s=f.getLocation(o,Ct.LEFT))}if(s===H.NONE)return null;for(var g=s,_=this.iterator();_.hasNext();){var M=_.next(),A=M.getLabel();if(A.getLocation(o,Ct.ON)===H.NONE&&A.setLocation(o,Ct.ON,g),A.isArea(o)){var B=A.getLocation(o,Ct.LEFT),W=A.getLocation(o,Ct.RIGHT);if(W!==H.NONE){if(W!==g)throw new Ea("side location conflict",M.getCoordinate());B===H.NONE&&Yt.shouldNeverReachHere("found single null side (at "+M.getCoordinate()+")"),g=B}else Yt.isTrue(A.getLocation(o,Ct.LEFT)===H.NONE,"found single null side"),A.setLocation(o,Ct.RIGHT,g),A.setLocation(o,Ct.LEFT,g)}}},ti.prototype.getCoordinate=function(){var o=this.iterator();return o.hasNext()?o.next().getCoordinate():null},ti.prototype.print=function(o){Nt.out.println("EdgeEndStar: "+this.getCoordinate());for(var s=this.iterator();s.hasNext();)s.next().print(o)},ti.prototype.isAreaLabelsConsistent=function(o){return this.computeEdgeEndLabels(o.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},ti.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,Ct.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 A=M.getLocation(o,Ct.LEFT),B=M.getLocation(o,Ct.RIGHT);if(A===B||B!==g)return!1;g=A}return!0},ti.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},ti.prototype.iterator=function(){return this.getEdges().iterator()},ti.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new Pt(this._edgeMap.values())),this._edgeList},ti.prototype.getLocation=function(o,s,c){return this._ptInAreaLocation[o]===H.NONE&&(this._ptInAreaLocation[o]=fo.locate(s,c[o].getGeometry())),this._ptInAreaLocation[o]},ti.prototype.toString=function(){var o=new Et;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()},ti.prototype.computeEdgeEndLabels=function(o){for(var s=this.iterator();s.hasNext();)s.next().computeLabel(o)},ti.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(),A=M.getLabel(),B=0;B<2;B++)if(A.isAnyNull(B)){var W=H.NONE;if(s[B])W=H.EXTERIOR;else{var it=M.getCoordinate();W=this.getLocation(B,it,o)}A.setAllLocationsIfNull(B,W)}},ti.prototype.getDegree=function(){return this._edgeMap.size()},ti.prototype.insertEdgeEnd=function(o,s){this._edgeMap.put(o,s),this._edgeList=null},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti};var PL=function(o){function s(){o.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return u(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(_),A=M.getSym();if(M.getLabel().isArea())switch(c===null&&M.isInResult()&&(c=M),g){case this._SCANNING_FOR_INCOMING:if(!A.isInResult())continue;f=A,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 Ea("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(),A=_.getQuadrant();return Tr.isNorthern(M)&&Tr.isNorthern(A)?g:Tr.isNorthern(M)||Tr.isNorthern(A)?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 Pt;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(Ct.LEFT),_=c.getDepth(Ct.RIGHT),M=this.computeDepths(f+1,this._edgeList.size(),g);if(this.computeDepths(0,f,M)!==_)throw new Ea("depth mismatch at "+c.getCoordinate())}else if(arguments.length===3){for(var A=arguments[0],B=arguments[1],W=arguments[2],it=A;it<B;it++){var lt=this._edgeList.get(it);lt.setEdgeDepths(Ct.RIGHT,W),W=lt.getDepth(Ct.LEFT)}return W}},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 A=this._resultAreaEdgeList.get(M),B=A.getSym();switch(f===null&&A.getEdgeRing()===c&&(f=A),_){case this._SCANNING_FOR_INCOMING:if(B.getEdgeRing()!==c)continue;g=B,_=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(A.getEdgeRing()!==c)continue;g.setNextMin(A),_=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,A=this.iterator();A.hasNext();){var B=A.next(),W=B.getSym();B.isLineEdge()?B.getEdge().setCovered(M===H.INTERIOR):(B.isInResult()&&(M=H.EXTERIOR),W.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}(ti),Xw=function(o){function s(){o.apply(this,arguments)}return u(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.createNode=function(c){return new g0(c,new PL)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(xf),Pl=u(function o(){this._pts=null,this._orientation=null;var s=arguments[0];this._pts=s,this._orientation=o.orientation(s)},"t");Pl.prototype.compareTo=function(o){var s=o;return Pl.compareOriented(this._pts,this._orientation,s._pts,s._orientation)},Pl.prototype.interfaces_=function(){return[j]},Pl.prototype.getClass=function(){return Pl},Pl.orientation=function(o){return D.increasingDirection(o)===1},Pl.compareOriented=function(o,s,c,f){for(var g=s?1:-1,_=f?1:-1,M=s?o.length:-1,A=f?c.length:-1,B=s?0:o.length-1,W=f?0:c.length-1;;){var it=o[B].compareTo(c[W]);if(it!==0)return it;var lt=(B+=g)===M,Ot=(W+=_)===A;if(lt&&!Ot)return-1;if(!lt&&Ot)return 1;if(lt&&Ot)return 0}};var Jo=u(function(){this._edges=new Pt,this._ocaMap=new x},"Hn");Jo.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(") ")},Jo.prototype.addAll=function(o){for(var s=o.iterator();s.hasNext();)this.add(s.next())},Jo.prototype.findEdgeIndex=function(o){for(var s=0;s<this._edges.size();s++)if(this._edges.get(s).equals(o))return s;return-1},Jo.prototype.iterator=function(){return this._edges.iterator()},Jo.prototype.getEdges=function(){return this._edges},Jo.prototype.get=function(o){return this._edges.get(o)},Jo.prototype.findEqualEdge=function(o){var s=new Pl(o.getCoordinates());return this._ocaMap.get(s)},Jo.prototype.add=function(o){this._edges.add(o);var s=new Pl(o.getCoordinates());this._ocaMap.put(s,o)},Jo.prototype.interfaces_=function(){return[]},Jo.prototype.getClass=function(){return Jo};var Zu=u(function(){},"Wn");Zu.prototype.processIntersections=function(o,s,c,f){},Zu.prototype.isDone=function(){},Zu.prototype.interfaces_=function(){return[]},Zu.prototype.getClass=function(){return Zu};var mo=u(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");mo.prototype.isTrivialIntersection=function(o,s,c,f){if(o===c&&this._li.getIntersectionNum()===1){if(mo.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},mo.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},mo.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},mo.prototype.getLineIntersector=function(){return this._li},mo.prototype.hasProperIntersection=function(){return this._hasProper},mo.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],A=c.getCoordinates()[f+1];this._li.computeIntersection(g,_,M,A),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)))},mo.prototype.hasIntersection=function(){return this._hasIntersection},mo.prototype.isDone=function(){return!1},mo.prototype.hasInteriorIntersection=function(){return this._hasInterior},mo.prototype.interfaces_=function(){return[Zu]},mo.prototype.getClass=function(){return mo},mo.isAdjacentSegments=function(o,s){return Math.abs(o-s)===1};var ms=u(function(){this.coord=null,this.segmentIndex=null,this.dist=null;var o=arguments[0],s=arguments[1],c=arguments[2];this.coord=new k(o),this.segmentIndex=s,this.dist=c},"Jn");ms.prototype.getSegmentIndex=function(){return this.segmentIndex},ms.prototype.getCoordinate=function(){return this.coord},ms.prototype.print=function(o){o.print(this.coord),o.print(" seg # = "+this.segmentIndex),o.println(" dist = "+this.dist)},ms.prototype.compareTo=function(o){var s=o;return this.compare(s.segmentIndex,s.dist)},ms.prototype.isEndPoint=function(o){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===o},ms.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},ms.prototype.getDistance=function(){return this.dist},ms.prototype.compare=function(o,s){return this.segmentIndex<o?-1:this.segmentIndex>o?1:this.dist<s?-1:this.dist>s?1:0},ms.prototype.interfaces_=function(){return[j]},ms.prototype.getClass=function(){return ms};var Us=u(function(){this._nodeMap=new x,this.edge=null;var o=arguments[0];this.edge=o},"Qn");Us.prototype.print=function(o){o.println("Intersections:");for(var s=this.iterator();s.hasNext();)s.next().print(o)},Us.prototype.iterator=function(){return this._nodeMap.values().iterator()},Us.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}},Us.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)},Us.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 k(o.coord);for(var A=o.segmentIndex+1;A<=s.segmentIndex;A++)_[M++]=this.edge.pts[A];return g&&(_[M]=s.coord),new v0(_,new _r(this.edge._label))},Us.prototype.add=function(o,s,c){var f=new ms(o,s,c),g=this._nodeMap.get(f);return g!==null?g:(this._nodeMap.put(f,f),f)},Us.prototype.isIntersection=function(o){for(var s=this.iterator();s.hasNext();)if(s.next().coord.equals(o))return!0;return!1},Us.prototype.interfaces_=function(){return[]},Us.prototype.getClass=function(){return Us};var $u=u(function(){},"Zn");$u.prototype.getChainStartIndices=function(o){var s=0,c=new Pt;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 $u.toIntArray(c)},$u.prototype.findChainEnd=function(o,s){for(var c=Tr.quadrant(o[s],o[s+1]),f=s+1;f<o.length&&Tr.quadrant(o[f-1],o[f])===c;)f++;return f-1},$u.prototype.interfaces_=function(){return[]},$u.prototype.getClass=function(){return $u},$u.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 La=u(function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new xt,this.env2=new xt;var o=arguments[0];this.e=o,this.pts=o.getCoordinates();var s=new $u;this.startIndex=s.getChainStartIndices(this.pts)},"$n");La.prototype.getCoordinates=function(){return this.pts},La.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},La.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},La.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],A=arguments[3],B=arguments[4],W=arguments[5],it=this.pts[g],lt=this.pts[_],Ot=M.pts[A],Dt=M.pts[B];if(_-g==1&&B-A==1)return W.addIntersections(this.e,g,M.e,A),null;if(this.env1.init(it,lt),this.env2.init(Ot,Dt),!this.env1.intersects(this.env2))return null;var Bt=Math.trunc((g+_)/2),Wt=Math.trunc((A+B)/2);g<Bt&&(A<Wt&&this.computeIntersectsForChain(g,Bt,M,A,Wt,W),Wt<B&&this.computeIntersectsForChain(g,Bt,M,Wt,B,W)),Bt<_&&(A<Wt&&this.computeIntersectsForChain(Bt,_,M,A,Wt,W),Wt<B&&this.computeIntersectsForChain(Bt,_,M,Wt,B,W))}},La.prototype.getStartIndexes=function(){return this.startIndex},La.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)},La.prototype.interfaces_=function(){return[]},La.prototype.getClass=function(){return La};var zn=u(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"),Yw={NULL_VALUE:{configurable:!0}};zn.prototype.getDepth=function(o,s){return this._depth[o][s]},zn.prototype.setDepth=function(o,s,c){this._depth[o][s]=c},zn.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]!==zn.NULL_VALUE)return!1;return!0}if(arguments.length===1){var c=arguments[0];return this._depth[c][1]===zn.NULL_VALUE}if(arguments.length===2){var f=arguments[0],g=arguments[1];return this._depth[f][g]===zn.NULL_VALUE}},zn.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}}},zn.prototype.getDelta=function(o){return this._depth[o][Ct.RIGHT]-this._depth[o][Ct.LEFT]},zn.prototype.getLocation=function(o,s){return this._depth[o][s]<=0?H.EXTERIOR:H.INTERIOR},zn.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},zn.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]=zn.depthAtLocation(f):this._depth[s][c]+=zn.depthAtLocation(f))}else if(arguments.length===3){var g=arguments[0],_=arguments[1];arguments[2]===H.INTERIOR&&this._depth[g][_]++}},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn},zn.depthAtLocation=function(o){return o===H.EXTERIOR?0:o===H.INTERIOR?1:zn.NULL_VALUE},Yw.NULL_VALUE.get=function(){return-1},Object.defineProperties(zn,Yw);var v0=function(o){function s(){if(o.call(this),this.pts=null,this._env=null,this.eiList=new Us(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new zn,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 u(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,A=0;A<this.pts.length;A++)if(this.pts[A].equals2D(f.pts[A])||(g=!1),this.pts[A].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 La(this)),this._mce},s.prototype.getEnvelope=function(){if(this._env===null){this._env=new xt;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 k(c.getIntersection(_)),A=f,B=c.getEdgeDistance(g,_),W=A+1;if(W<this.pts.length){var it=this.pts[W];M.equals2D(it)&&(A=W,B=0)}this.eiList.add(M,A,B)},s.prototype.toString=function(){var c=new Et;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,Ct.ON),c.getLocation(1,Ct.ON),1),c.isArea()&&(f.setAtLeastIfValid(c.getLocation(0,Ct.LEFT),c.getLocation(1,Ct.LEFT),2),f.setAtLeastIfValid(c.getLocation(0,Ct.RIGHT),c.getLocation(1,Ct.RIGHT),2))},s}(po),di=u(function(o){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Jo,this._bufParams=o||null},"ii");di.prototype.setWorkingPrecisionModel=function(o){this._workingPrecisionModel=o},di.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=di.depthDelta(f),_=s.getDepthDelta()+g;s.setDepthDelta(_)}else this._edgeList.add(o),o.setDepthDelta(di.depthDelta(o.getLabel()))},di.prototype.buildSubgraphs=function(o,s){for(var c=new Pt,f=o.iterator();f.hasNext();){var g=f.next(),_=g.getRightmostCoordinate(),M=new rp(c).getDepth(_);g.computeDepth(M),g.findResultEdges(),c.add(g),s.add(g.getDirectedEdges(),g.getNodes())}},di.prototype.createSubgraphs=function(o){for(var s=new Pt,c=o.getNodes().iterator();c.hasNext();){var f=c.next();if(!f.isVisited()){var g=new hi;g.create(f),s.add(g)}}return $o.sort(s,$o.reverseOrder()),s},di.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},di.prototype.getNoder=function(o){if(this._workingNoder!==null)return this._workingNoder;var s=new M2,c=new Zi;return c.setPrecisionModel(o),s.setSegmentIntersector(new mo(c)),s},di.prototype.buffer=function(o,s){var c=this._workingPrecisionModel;c===null&&(c=o.getPrecisionModel()),this._geomFact=o.getFactory();var f=new Ri(c,this._bufParams),g=new Do(o,s,f).getCurves();if(g.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(g,c),this._graph=new qr(new Xw),this._graph.addEdges(this._edgeList.getEdges());var _=this.createSubgraphs(this._graph),M=new Ki(this._geomFact);this.buildSubgraphs(_,M);var A=M.getPolygons();return A.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(A)},di.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(),A=new v0(g.getCoordinates(),new _r(M));this.insertUniqueEdge(A)}}},di.prototype.setNoder=function(o){this._workingNoder=o},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di},di.depthDelta=function(o){var s=o.getLocation(0,Ct.LEFT),c=o.getLocation(0,Ct.RIGHT);return s===H.INTERIOR&&c===H.EXTERIOR?1:s===H.EXTERIOR&&c===H.INTERIOR?-1:0},di.convertSegStrings=function(o){for(var s=new ge,c=new Pt;o.hasNext();){var f=o.next(),g=s.createLineString(f.getCoordinates());c.add(g)}return s.buildGeometry(c)};var El=u(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");El.prototype.rescale=function(){if(pt(arguments[0],Nr))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)}},El.prototype.scale=function(){if(pt(arguments[0],Nr)){for(var o=arguments[0],s=new Pt,c=o.iterator();c.hasNext();){var f=c.next();s.add(new on(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 k(Math.round((g[M].x-this._offsetX)*this._scaleFactor),Math.round((g[M].y-this._offsetY)*this._scaleFactor),g[M].z);return D.removeRepeatedPoints(_)}},El.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},El.prototype.getNodedSubstrings=function(){var o=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(o),o},El.prototype.computeNodes=function(o){var s=o;this._isScaled&&(s=this.scale(o)),this._noder.computeNodes(s)},El.prototype.interfaces_=function(){return[qu]},El.prototype.getClass=function(){return El};var gs=u(function(){this._li=new Zi,this._segStrings=null;var o=arguments[0];this._segStrings=o},"oi"),qw={fact:{configurable:!0}};gs.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 Yr("found endpt/interior pt intersection at index "+_+" :pt "+c)}},gs.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(),A=_.getCoordinates(),B=0;B<M.length-1;B++)for(var W=0;W<A.length-1;W++)this.checkInteriorIntersections(g,B,_,W);else if(arguments.length===4){var it=arguments[0],lt=arguments[1],Ot=arguments[2],Dt=arguments[3];if(it===Ot&&lt===Dt)return null;var Bt=it.getCoordinates()[lt],Wt=it.getCoordinates()[lt+1],Cr=Ot.getCoordinates()[Dt],mn=Ot.getCoordinates()[Dt+1];if(this._li.computeIntersection(Bt,Wt,Cr,mn),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,Bt,Wt)||this.hasInteriorIntersection(this._li,Cr,mn)))throw new Yr("found non-noded intersection at "+Bt+"-"+Wt+" and "+Cr+"-"+mn)}},gs.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},gs.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])},gs.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},gs.prototype.checkCollapse=function(o,s,c){if(o.equals(c))throw new Yr("found non-noded collapse at "+gs.fact.createLineString([o,s,c]))},gs.prototype.interfaces_=function(){return[]},gs.prototype.getClass=function(){return gs},qw.fact.get=function(){return new ge},Object.defineProperties(gs,qw);var Fi=u(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 N("Scale factor must be non-zero");s!==1&&(this._pt=new k(this.scale(o.x),this.scale(o.y)),this._p0Scaled=new k,this._p1Scaled=new k),this.initCorners(this._pt)},"ai"),Ww={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Fi.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 A=this.intersectsToleranceSquare(o,s);return Yt.isTrue(!(M&&A),"Found bad envelope test"),A},Fi.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 k(this._maxx,this._maxy),this._corner[1]=new k(this._minx,this._maxy),this._corner[2]=new k(this._minx,this._miny),this._corner[3]=new k(this._maxx,this._miny)},Fi.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))},Fi.prototype.scale=function(o){return Math.round(o*this._scaleFactor)},Fi.prototype.getCoordinate=function(){return this._originalPt},Fi.prototype.copyScaled=function(o,s){s.x=this.scale(o.x),s.y=this.scale(o.y)},Fi.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var o=Fi.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new xt(this._originalPt.x-o,this._originalPt.x+o,this._originalPt.y-o,this._originalPt.y+o)}return this._safeEnv},Fi.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())))},Fi.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))))},Fi.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)},Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi},Ww.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Fi,Ww);var Jm=u(function(){this.tempEnv1=new xt,this.selectedSegment=new Ut},"li");Jm.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)}}},Jm.prototype.interfaces_=function(){return[]},Jm.prototype.getClass=function(){return Jm};var If=u(function(){this._index=null;var o=arguments[0];this._index=o},"ci"),Zw={HotPixelSnapAction:{configurable:!0}};If.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 $w(s,c,f);return this._index.query(g,{interfaces_:u(function(){return[wl]},"interfaces_"),visitItem:u(function(M){M.select(g,_)},"visitItem")}),_.isNodeAdded()}},If.prototype.interfaces_=function(){return[]},If.prototype.getClass=function(){return If},Zw.HotPixelSnapAction.get=function(){return $w},Object.defineProperties(If,Zw);var $w=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 u(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}(Jm),np=u(function(){this._li=null,this._interiorIntersections=null;var o=arguments[0];this._li=o,this._interiorIntersections=new Pt},"fi");np.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],A=c.getCoordinates()[f+1];if(this._li.computeIntersection(g,_,M,A),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var B=0;B<this._li.getIntersectionNum();B++)this._interiorIntersections.add(this._li.getIntersection(B));o.addIntersections(this._li,s,0),c.addIntersections(this._li,f,1)}},np.prototype.isDone=function(){return!1},np.prototype.getInteriorIntersections=function(){return this._interiorIntersections},np.prototype.interfaces_=function(){return[Zu]},np.prototype.getClass=function(){return np};var zs=u(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 Zi,this._li.setPrecisionModel(o),this._scaleFactor=o.getScale()},"gi");zs.prototype.checkCorrectness=function(o){var s=on.getNodedSubstrings(o),c=new gs(s);try{c.checkValid()}catch(f){if(!(f instanceof vr))throw f;f.printStackTrace()}},zs.prototype.getNodedSubstrings=function(){return on.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 np(s);return this._noder.setSegmentIntersector(c),this._noder.computeNodes(o),c.getInteriorIntersections()},zs.prototype.computeVertexSnaps=function(){if(pt(arguments[0],Nr))for(var o=arguments[0].iterator();o.hasNext();){var s=o.next();this.computeVertexSnaps(s)}else if(arguments[0]instanceof on)for(var c=arguments[0],f=c.getCoordinates(),g=0;g<f.length;g++){var _=new Fi(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 M2,this._pointSnapper=new If(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 Fi(c,this._scaleFactor,this._li);this._pointSnapper.snap(f)}},zs.prototype.interfaces_=function(){return[qu]},zs.prototype.getClass=function(){return zs};var Hn=u(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"),Mf={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Hn.prototype.bufferFixedPrecision=function(o){var s=new El(new zs(new tr(1)),o.getScale()),c=new di(this._bufParams);c.setWorkingPrecisionModel(o),c.setNoder(s),this._resultGeometry=c.buffer(this._argGeom,this._distance)},Hn.prototype.bufferReducedPrecision=function(){var o=this;if(arguments.length===0){for(var s=Hn.MAX_PRECISION_DIGITS;s>=0;s--){try{o.bufferReducedPrecision(s)}catch(_){if(!(_ instanceof Ea))throw _;o._saveException=_}if(o._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var c=arguments[0],f=Hn.precisionScaleFactor(this._argGeom,this._distance,c),g=new tr(f);this.bufferFixedPrecision(g)}},Hn.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()},Hn.prototype.setQuadrantSegments=function(o){this._bufParams.setQuadrantSegments(o)},Hn.prototype.bufferOriginalPrecision=function(){try{var o=new di(this._bufParams);this._resultGeometry=o.buffer(this._argGeom,this._distance)}catch(s){if(!(s instanceof Yr))throw s;this._saveException=s}},Hn.prototype.getResultGeometry=function(o){return this._distance=o,this.computeGeometry(),this._resultGeometry},Hn.prototype.setEndCapStyle=function(o){this._bufParams.setEndCapStyle(o)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn},Hn.bufferOp=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1];return new Hn(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 Hn(c);return _.setQuadrantSegments(g),_.getResultGeometry(f)}if(arguments[2]instanceof er&&arguments[0]instanceof Jt&&typeof arguments[1]=="number"){var M=arguments[0],A=arguments[1],B=arguments[2];return new Hn(M,B).getResultGeometry(A)}}else if(arguments.length===4){var W=arguments[0],it=arguments[1],lt=arguments[2],Ot=arguments[3],Dt=new Hn(W);return Dt.setQuadrantSegments(lt),Dt.setEndCapStyle(Ot),Dt.getResultGeometry(it)}},Hn.precisionScaleFactor=function(o,s,c){var f=o.getEnvelopeInternal(),g=ct.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,_)},Mf.CAP_ROUND.get=function(){return er.CAP_ROUND},Mf.CAP_BUTT.get=function(){return er.CAP_FLAT},Mf.CAP_FLAT.get=function(){return er.CAP_FLAT},Mf.CAP_SQUARE.get=function(){return er.CAP_SQUARE},Mf.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Hn,Mf);var mi=u(function(){this._pt=[new k,new k],this._distance=L.NaN,this._isNull=!0},"_i");mi.prototype.getCoordinates=function(){return this._pt},mi.prototype.getCoordinate=function(o){return this._pt[o]},mi.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)}},mi.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}},mi.prototype.getDistance=function(){return this._distance},mi.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)}},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi};var Hs=u(function(){},"mi");Hs.prototype.interfaces_=function(){return[]},Hs.prototype.getClass=function(){return Hs},Hs.computeDistance=function(){if(arguments[2]instanceof mi&&arguments[0]instanceof ye&&arguments[1]instanceof k)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 mi&&arguments[0]instanceof xr&&arguments[1]instanceof k){var A=arguments[0],B=arguments[1],W=arguments[2];Hs.computeDistance(A.getExteriorRing(),B,W);for(var it=0;it<A.getNumInteriorRing();it++)Hs.computeDistance(A.getInteriorRingN(it),B,W)}else if(arguments[2]instanceof mi&&arguments[0]instanceof Jt&&arguments[1]instanceof k){var lt=arguments[0],Ot=arguments[1],Dt=arguments[2];if(lt instanceof ye)Hs.computeDistance(lt,Ot,Dt);else if(lt instanceof xr)Hs.computeDistance(lt,Ot,Dt);else if(lt instanceof Qt)for(var Bt=lt,Wt=0;Wt<Bt.getNumGeometries();Wt++){var Cr=Bt.getGeometryN(Wt);Hs.computeDistance(Cr,Ot,Dt)}else Dt.setMinimum(lt.getCoordinate(),Ot)}else if(arguments[2]instanceof mi&&arguments[0]instanceof Ut&&arguments[1]instanceof k){var mn=arguments[0],bi=arguments[1],Ws=arguments[2],Rl=mn.closestPoint(bi);Ws.setMinimum(Rl,bi)}};var Ju=u(function(o){this._maxPtDist=new mi,this._inputGeom=o||null},"vi"),w2={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Ju.prototype.computeMaxMidpointDistance=function(o){var s=new Ol(this._inputGeom);o.apply(s),this._maxPtDist.setMaximum(s.getMaxPointDistance())},Ju.prototype.computeMaxVertexDistance=function(o){var s=new ip(this._inputGeom);o.apply(s),this._maxPtDist.setMaximum(s.getMaxPointDistance())},Ju.prototype.findDistance=function(o){return this.computeMaxVertexDistance(o),this.computeMaxMidpointDistance(o),this._maxPtDist.getDistance()},Ju.prototype.getDistancePoints=function(){return this._maxPtDist},Ju.prototype.interfaces_=function(){return[]},Ju.prototype.getClass=function(){return Ju},w2.MaxPointDistanceFilter.get=function(){return ip},w2.MaxMidpointDistanceFilter.get=function(){return Ol},Object.defineProperties(Ju,w2);var ip=u(function(o){this._maxPtDist=new mi,this._minPtDist=new mi,this._geom=o||null},"Ei");ip.prototype.filter=function(o){this._minPtDist.initialize(),Hs.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ip.prototype.getMaxPointDistance=function(){return this._maxPtDist},ip.prototype.interfaces_=function(){return[Oi]},ip.prototype.getClass=function(){return ip};var Ol=u(function(o){this._maxPtDist=new mi,this._minPtDist=new mi,this._geom=o||null},"xi");Ol.prototype.filter=function(o,s){if(s===0)return null;var c=o.getCoordinate(s-1),f=o.getCoordinate(s),g=new k((c.x+f.x)/2,(c.y+f.y)/2);this._minPtDist.initialize(),Hs.computeDistance(this._geom,g,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ol.prototype.isDone=function(){return!1},Ol.prototype.isGeometryChanged=function(){return!1},Ol.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ol.prototype.interfaces_=function(){return[fe]},Ol.prototype.getClass=function(){return Ol};var Aa=u(function(o){this._comps=o||null},"Ni");Aa.prototype.filter=function(o){o instanceof xr&&this._comps.add(o)},Aa.prototype.interfaces_=function(){return[qt]},Aa.prototype.getClass=function(){return Aa},Aa.getPolygons=function(){if(arguments.length===1){var o=arguments[0];return Aa.getPolygons(o,new Pt)}if(arguments.length===2){var s=arguments[0],c=arguments[1];return s instanceof xr?c.add(s):s instanceof Qt&&s.apply(new Aa(c)),c}};var Xn=u(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");Xn.prototype.filter=function(o){if(this._isForcedToLineString&&o instanceof Ni){var s=o.getFactory().createLineString(o.getCoordinateSequence());return this._lines.add(s),null}o instanceof ye&&this._lines.add(o)},Xn.prototype.setForceToLineString=function(o){this._isForcedToLineString=o},Xn.prototype.interfaces_=function(){return[Yo]},Xn.prototype.getClass=function(){return Xn},Xn.getGeometry=function(){if(arguments.length===1){var o=arguments[0];return o.getFactory().buildGeometry(Xn.getLines(o))}if(arguments.length===2){var s=arguments[0],c=arguments[1];return s.getFactory().buildGeometry(Xn.getLines(s,c))}},Xn.getLines=function(){if(arguments.length===1){var o=arguments[0];return Xn.getLines(o,!1)}if(arguments.length===2){if(pt(arguments[0],Nr)&&pt(arguments[1],Nr)){for(var s=arguments[0],c=arguments[1],f=s.iterator();f.hasNext();){var g=f.next();Xn.getLines(g,c)}return c}if(arguments[0]instanceof Jt&&typeof arguments[1]=="boolean"){var _=arguments[0],M=arguments[1],A=new Pt;return _.apply(new Xn(A,M)),A}if(arguments[0]instanceof Jt&&pt(arguments[1],Nr)){var B=arguments[0],W=arguments[1];return B instanceof ye?W.add(B):B.apply(new Xn(W)),W}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&pt(arguments[0],Nr)&&pt(arguments[1],Nr)){for(var it=arguments[0],lt=arguments[1],Ot=arguments[2],Dt=it.iterator();Dt.hasNext();){var Bt=Dt.next();Xn.getLines(Bt,lt,Ot)}return lt}if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Jt&&pt(arguments[1],Nr)){var Wt=arguments[0],Cr=arguments[1],mn=arguments[2];return Wt.apply(new Xn(Cr,mn)),Cr}}};var Ko=u(function(){if(this._boundaryRule=jn.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 N("Rule must be non-null");this._boundaryRule=o}}},"Si");Ko.prototype.locateInternal=function(){if(arguments[0]instanceof k&&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 k&&arguments[1]instanceof ye){var A=arguments[0],B=arguments[1];if(!B.getEnvelopeInternal().intersects(A))return H.EXTERIOR;var W=B.getCoordinates();return B.isClosed()||!A.equals(W[0])&&!A.equals(W[W.length-1])?Mt.isOnLine(A,W)?H.INTERIOR:H.EXTERIOR:H.BOUNDARY}if(arguments[0]instanceof k&&arguments[1]instanceof Vr){var it=arguments[0];return arguments[1].getCoordinate().equals2D(it)?H.INTERIOR:H.EXTERIOR}},Ko.prototype.locateInPolygonRing=function(o,s){return s.getEnvelopeInternal().intersects(o)?Mt.locatePointInRing(o,s.getCoordinates()):H.EXTERIOR},Ko.prototype.intersects=function(o,s){return this.locate(o,s)!==H.EXTERIOR},Ko.prototype.updateLocationInfo=function(o){o===H.INTERIOR&&(this._isIn=!0),o===H.BOUNDARY&&this._numBoundaries++},Ko.prototype.computeLocation=function(o,s){if(s instanceof Vr&&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 wr)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 Wo)for(var _=s,M=0;M<_.getNumGeometries();M++){var A=_.getGeometryN(M);this.updateLocationInfo(this.locateInternal(o,A))}else if(s instanceof Qt)for(var B=new js(s);B.hasNext();){var W=B.next();W!==s&&this.computeLocation(o,W)}},Ko.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)},Ko.prototype.interfaces_=function(){return[]},Ko.prototype.getClass=function(){return Ko};var gi=u(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"),Jw={INSIDE_AREA:{configurable:!0}};gi.prototype.isInsideArea=function(){return this._segIndex===gi.INSIDE_AREA},gi.prototype.getCoordinate=function(){return this._pt},gi.prototype.getGeometryComponent=function(){return this._component},gi.prototype.getSegmentIndex=function(){return this._segIndex},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},Jw.INSIDE_AREA.get=function(){return-1},Object.defineProperties(gi,Jw);var Dl=u(function(o){this._pts=o||null},"wi");Dl.prototype.filter=function(o){o instanceof Vr&&this._pts.add(o)},Dl.prototype.interfaces_=function(){return[qt]},Dl.prototype.getClass=function(){return Dl},Dl.getPoints=function(){if(arguments.length===1){var o=arguments[0];return o instanceof Vr?$o.singletonList(o):Dl.getPoints(o,new Pt)}if(arguments.length===2){var s=arguments[0],c=arguments[1];return s instanceof Vr?c.add(s):s instanceof Qt&&s.apply(new Dl(c)),c}};var op=u(function(){this._locations=null;var o=arguments[0];this._locations=o},"Oi");op.prototype.filter=function(o){(o instanceof Vr||o instanceof ye||o instanceof xr)&&this._locations.add(new gi(o,0,o.getCoordinate()))},op.prototype.interfaces_=function(){return[qt]},op.prototype.getClass=function(){return op},op.getLocations=function(o){var s=new Pt;return o.apply(new op(s)),s};var Yn=u(function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ko,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");Yn.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=Aa.getPolygons(this._geom[s]);if(g.size()>0){var _=op.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&&pt(arguments[0],Li)&&pt(arguments[1],Li)){for(var M=arguments[0],A=arguments[1],B=arguments[2],W=0;W<M.size();W++)for(var it=M.get(W),lt=0;lt<A.size();lt++)if(this.computeContainmentDistance(it,A.get(lt),B),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof gi&&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 gi(Dt,Wt),null}}},Yn.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}},Yn.prototype.computeFacetDistance=function(){var o=new Array(2).fill(null),s=Xn.getLines(this._geom[0]),c=Xn.getLines(this._geom[1]),f=Dl.getPoints(this._geom[0]),g=Dl.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))))},Yn.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Yn.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])},Yn.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Yn.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 Vr){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=Mt.distancePointLine(g,f[_],f[_+1]);if(M<this._minDistance){this._minDistance=M;var A=new Ut(f[_],f[_+1]).closestPoint(g);c[0]=new gi(o,_,A),c[1]=new gi(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 B=arguments[0],W=arguments[1],it=arguments[2];if(B.getEnvelopeInternal().distance(W.getEnvelopeInternal())>this._minDistance)return null;for(var lt=B.getCoordinates(),Ot=W.getCoordinates(),Dt=0;Dt<lt.length-1;Dt++)for(var Bt=0;Bt<Ot.length-1;Bt++){var Wt=Mt.distanceLineLine(lt[Dt],lt[Dt+1],Ot[Bt],Ot[Bt+1]);if(Wt<this._minDistance){this._minDistance=Wt;var Cr=new Ut(lt[Dt],lt[Dt+1]),mn=new Ut(Ot[Bt],Ot[Bt+1]),bi=Cr.closestPoints(mn);it[0]=new gi(B,Dt,bi[0]),it[1]=new gi(W,Bt,bi[1])}if(this._minDistance<=this._terminateDistance)return null}}}},Yn.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(_),A=g.getCoordinate().distance(M.getCoordinate());if(A<this._minDistance&&(this._minDistance=A,c[0]=new gi(g,0,g.getCoordinate()),c[1]=new gi(M,0,M.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Yn.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new N("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Yn.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}},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn},Yn.distance=function(o,s){return new Yn(o,s).distance()},Yn.isWithinDistance=function(o,s,c){return new Yn(o,s,c).distance()<=c},Yn.nearestPoints=function(o,s){return new Yn(o,s).nearestPoints()};var ei=u(function(){this._pt=[new k,new k],this._distance=L.NaN,this._isNull=!0},"Ri");ei.prototype.getCoordinates=function(){return this._pt},ei.prototype.getCoordinate=function(o){return this._pt[o]},ei.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)}},ei.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}},ei.prototype.toString=function(){return br.toLineString(this._pt[0],this._pt[1])},ei.prototype.getDistance=function(){return this._distance},ei.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)}},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei};var ys=u(function(){},"Pi");ys.prototype.interfaces_=function(){return[]},ys.prototype.getClass=function(){return ys},ys.computeDistance=function(){if(arguments[2]instanceof ei&&arguments[0]instanceof ye&&arguments[1]instanceof k)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 ei&&arguments[0]instanceof xr&&arguments[1]instanceof k){var A=arguments[0],B=arguments[1],W=arguments[2];ys.computeDistance(A.getExteriorRing(),B,W);for(var it=0;it<A.getNumInteriorRing();it++)ys.computeDistance(A.getInteriorRingN(it),B,W)}else if(arguments[2]instanceof ei&&arguments[0]instanceof Jt&&arguments[1]instanceof k){var lt=arguments[0],Ot=arguments[1],Dt=arguments[2];if(lt instanceof ye)ys.computeDistance(lt,Ot,Dt);else if(lt instanceof xr)ys.computeDistance(lt,Ot,Dt);else if(lt instanceof Qt)for(var Bt=lt,Wt=0;Wt<Bt.getNumGeometries();Wt++){var Cr=Bt.getGeometryN(Wt);ys.computeDistance(Cr,Ot,Dt)}else Dt.setMinimum(lt.getCoordinate(),Ot)}else if(arguments[2]instanceof ei&&arguments[0]instanceof Ut&&arguments[1]instanceof k){var mn=arguments[0],bi=arguments[1],Ws=arguments[2],Rl=mn.closestPoint(bi);Ws.setMinimum(Rl,bi)}};var Lo=u(function(){this._g0=null,this._g1=null,this._ptDist=new ei,this._densifyFrac=0;var o=arguments[0],s=arguments[1];this._g0=o,this._g1=s},"Di"),T2={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Lo.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Lo.prototype.setDensifyFraction=function(o){if(o>1||o<=0)throw new N("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=o},Lo.prototype.compute=function(o,s){this.computeOrientedDistance(o,s,this._ptDist),this.computeOrientedDistance(s,o,this._ptDist)},Lo.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Lo.prototype.computeOrientedDistance=function(o,s,c){var f=new sp(s);if(o.apply(f),c.setMaximum(f.getMaxPointDistance()),this._densifyFrac>0){var g=new Ll(s,this._densifyFrac);o.apply(g),c.setMaximum(g.getMaxPointDistance())}},Lo.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Lo.prototype.interfaces_=function(){return[]},Lo.prototype.getClass=function(){return Lo},Lo.distance=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1];return new Lo(o,s).distance()}if(arguments.length===3){var c=arguments[0],f=arguments[1],g=arguments[2],_=new Lo(c,f);return _.setDensifyFraction(g),_.distance()}},T2.MaxPointDistanceFilter.get=function(){return sp},T2.MaxDensifiedByFractionDistanceFilter.get=function(){return Ll},Object.defineProperties(Lo,T2);var sp=u(function(){this._maxPtDist=new ei,this._minPtDist=new ei,this._euclideanDist=new ys,this._geom=null;var o=arguments[0];this._geom=o},"Ai");sp.prototype.filter=function(o){this._minPtDist.initialize(),ys.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},sp.prototype.getMaxPointDistance=function(){return this._maxPtDist},sp.prototype.interfaces_=function(){return[Oi]},sp.prototype.getClass=function(){return sp};var Ll=u(function(){this._maxPtDist=new ei,this._minPtDist=new ei,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");Ll.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 A=c.x+M*g,B=c.y+M*_,W=new k(A,B);this._minPtDist.initialize(),ys.computeDistance(this._geom,W,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Ll.prototype.isDone=function(){return!1},Ll.prototype.isGeometryChanged=function(){return!1},Ll.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ll.prototype.interfaces_=function(){return[fe]},Ll.prototype.getClass=function(){return Ll};var to=u(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"),P2={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};to.prototype.checkMaximumDistance=function(o,s,c){var f=new Lo(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])+")"}},to.prototype.isValid=function(){var o=Math.abs(this._bufDistance),s=to.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(),to.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)},to.prototype.checkNegativeValid=function(){if(!(this._input instanceof xr||this._input instanceof Wo||this._input instanceof Qt))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)},to.prototype.getErrorIndicator=function(){return this._errorIndicator},to.prototype.checkMinimumDistance=function(o,s,c){var f=new Yn(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])+" )"}},to.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)},to.prototype.getErrorLocation=function(){return this._errorLocation},to.prototype.getPolygonLines=function(o){for(var s=new Pt,c=new Xn(s),f=Aa.getPolygons(o).iterator();f.hasNext();)f.next().apply(c);return o.getFactory().buildGeometry(s)},to.prototype.getErrorMessage=function(){return this._errMsg},to.prototype.interfaces_=function(){return[]},to.prototype.getClass=function(){return to},P2.VERBOSE.get=function(){return!1},P2.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(to,P2);var qn=u(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"),E2={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};qn.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},qn.prototype.checkEnvelope=function(){if(this._distance<0)return null;var o=this._distance*qn.MAX_ENV_DIFF_FRAC;o===0&&(o=.001);var s=new xt(this._input.getEnvelopeInternal());s.expandBy(this._distance);var c=new xt(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")},qn.prototype.checkDistance=function(){var o=new to(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")},qn.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")},qn.prototype.checkPolygonal=function(){this._result instanceof xr||this._result instanceof Wo||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},qn.prototype.getErrorIndicator=function(){return this._errorIndicator},qn.prototype.getErrorLocation=function(){return this._errorLocation},qn.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"))},qn.prototype.report=function(o){if(!qn.VERBOSE)return null;Nt.out.println("Check "+o+": "+(this._isValid?"passed":"FAILED"))},qn.prototype.getErrorMessage=function(){return this._errorMsg},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn},qn.isValidMsg=function(o,s,c){var f=new qn(o,s,c);return f.isValid()?null:f.getErrorMessage()},qn.isValid=function(o,s,c){return!!new qn(o,s,c).isValid()},E2.VERBOSE.get=function(){return!1},E2.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(qn,E2);var vs=u(function(){this._pts=null,this._data=null;var o=arguments[0],s=arguments[1];this._pts=o,this._data=s},"Ui");vs.prototype.getCoordinates=function(){return this._pts},vs.prototype.size=function(){return this._pts.length},vs.prototype.getCoordinate=function(o){return this._pts[o]},vs.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},vs.prototype.getSegmentOctant=function(o){return o===this._pts.length-1?-1:tp.octant(this.getCoordinate(o),this.getCoordinate(o+1))},vs.prototype.setData=function(o){this._data=o},vs.prototype.getData=function(){return this._data},vs.prototype.toString=function(){return br.toLineString(new nn(this._pts))},vs.prototype.interfaces_=function(){return[Vs]},vs.prototype.getClass=function(){return vs};var An=u(function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Pt,this._intersectionCount=0,this._keepIntersections=!0;var o=arguments[0];this._li=o,this._interiorIntersection=null},"zi");An.prototype.getInteriorIntersection=function(){return this._interiorIntersection},An.prototype.setCheckEndSegmentsOnly=function(o){this._isCheckEndSegmentsOnly=o},An.prototype.getIntersectionSegments=function(){return this._intSegments},An.prototype.count=function(){return this._intersectionCount},An.prototype.getIntersections=function(){return this._intersections},An.prototype.setFindAllIntersections=function(o){this._findAllIntersections=o},An.prototype.setKeepIntersections=function(o){this._keepIntersections=o},An.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],A=c.getCoordinates()[f+1];this._li.computeIntersection(g,_,M,A),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]=A,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},An.prototype.isEndSegment=function(o,s){return s===0||s>=o.size()-2},An.prototype.hasIntersection=function(){return this._interiorIntersection!==null},An.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},An.prototype.interfaces_=function(){return[Zu]},An.prototype.getClass=function(){return An},An.createAllIntersectionsFinder=function(o){var s=new An(o);return s.setFindAllIntersections(!0),s},An.createAnyIntersectionFinder=function(o){return new An(o)},An.createIntersectionCounter=function(o){var s=new An(o);return s.setFindAllIntersections(!0),s.setKeepIntersections(!1),s};var Qo=u(function(){this._li=new Zi,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var o=arguments[0];this._segStrings=o},"Xi");Qo.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Qo.prototype.getIntersections=function(){return this._segInt.getIntersections()},Qo.prototype.isValid=function(){return this.execute(),this._isValid},Qo.prototype.setFindAllIntersections=function(o){this._findAllIntersections=o},Qo.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new An(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var o=new M2;if(o.setSegmentIntersector(this._segInt),o.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Qo.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ea(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Qo.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])},Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo},Qo.computeIntersections=function(o){var s=new Qo(o);return s.setFindAllIntersections(!0),s.isValid(),s.getIntersections()};var Ku=u(function o(){this._nv=null;var s=arguments[0];this._nv=new Qo(o.toSegmentStrings(s))},"t");Ku.prototype.checkValid=function(){this._nv.checkValid()},Ku.prototype.interfaces_=function(){return[]},Ku.prototype.getClass=function(){return Ku},Ku.toSegmentStrings=function(o){for(var s=new Pt,c=o.iterator();c.hasNext();){var f=c.next();s.add(new vs(f.getCoordinates(),f))}return s},Ku.checkValid=function(o){new Ku(o).checkValid()};var ap=u(function(o){this._mapOp=o},"ki");ap.prototype.map=function(o){for(var s=new Pt,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))},ap.prototype.interfaces_=function(){return[]},ap.prototype.getClass=function(){return ap},ap.map=function(o,s){return new ap(s).map(o)};var bs=u(function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Pt,this._resultLineList=new Pt;var o=arguments[0],s=arguments[1],c=arguments[2];this._op=o,this._geometryFactory=s,this._ptLocator=c},"ji");bs.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)}},bs.prototype.labelIsolatedLine=function(o,s){var c=this._ptLocator.locate(o.getCoordinate(),this._op.getArgGeometry(s));o.getLabel().setLocation(s,c)},bs.prototype.build=function(o){return this.findCoveredLineEdges(),this.collectLines(o),this.buildLines(o),this._resultLineList},bs.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)))},bs.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)}}},bs.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))}},bs.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)}},bs.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))))},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs};var lp=u(function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Pt;var o=arguments[0],s=arguments[1];this._op=o,this._geometryFactory=s},"Hi");lp.prototype.filterCoveredNodeToPoint=function(o){var s=o.getCoordinate();if(!this._op.isCoveredByLA(s)){var c=this._geometryFactory.createPoint(s);this._resultPointList.add(c)}},lp.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)}}},lp.prototype.build=function(o){return this.extractNonCoveredResultNodes(o),this._resultPointList},lp.prototype.interfaces_=function(){return[]},lp.prototype.getClass=function(){return lp};var Bi=u(function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1},"Wi");Bi.prototype.transformPoint=function(o,s){return this._factory.createPoint(this.transformCoordinates(o.getCoordinateSequence(),o))},Bi.prototype.transformPolygon=function(o,s){var c=!0,f=this.transformLinearRing(o.getExteriorRing(),o);f!==null&&f instanceof Ni&&!f.isEmpty()||(c=!1);for(var g=new Pt,_=0;_<o.getNumInteriorRing();_++){var M=this.transformLinearRing(o.getInteriorRingN(_),o);M===null||M.isEmpty()||(M instanceof Ni||(c=!1),g.add(M))}if(c)return this._factory.createPolygon(f,g.toArray([]));var A=new Pt;return f!==null&&A.add(f),A.addAll(g),this._factory.buildGeometry(A)},Bi.prototype.createCoordinateSequence=function(o){return this._factory.getCoordinateSequenceFactory().create(o)},Bi.prototype.getInputGeometry=function(){return this._inputGeom},Bi.prototype.transformMultiLineString=function(o,s){for(var c=new Pt,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)},Bi.prototype.transformCoordinates=function(o,s){return this.copy(o)},Bi.prototype.transformLineString=function(o,s){return this._factory.createLineString(this.transformCoordinates(o.getCoordinateSequence(),o))},Bi.prototype.transformMultiPoint=function(o,s){for(var c=new Pt,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)},Bi.prototype.transformMultiPolygon=function(o,s){for(var c=new Pt,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)},Bi.prototype.copy=function(o){return o.copy()},Bi.prototype.transformGeometryCollection=function(o,s){for(var c=new Pt,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)},Bi.prototype.transform=function(o){if(this._inputGeom=o,this._factory=o.getFactory(),o instanceof Vr)return this.transformPoint(o,null);if(o instanceof $i)return this.transformMultiPoint(o,null);if(o instanceof Ni)return this.transformLinearRing(o,null);if(o instanceof ye)return this.transformLineString(o,null);if(o instanceof wr)return this.transformMultiLineString(o,null);if(o instanceof xr)return this.transformPolygon(o,null);if(o instanceof Wo)return this.transformMultiPolygon(o,null);if(o instanceof Qt)return this.transformGeometryCollection(o,null);throw new N("Unknown Geometry subtype: "+o.getClass().getName())},Bi.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)},Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi};var Xs=u(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");Xs.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 k(_)),f===0&&this._isClosed&&o.set(o.size()-1,new k(_)))}},Xs.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},Xs.prototype.snapTo=function(o){var s=new Q(this._srcPts);return this.snapVertices(s,o),this.snapSegments(s,o),s.toCoordinateArray()},Xs.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 k(g),!1)}},Xs.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},Xs.prototype.setAllowSnappingToSourceVertices=function(o){this._allowSnappingToSourceVertices=o},Xs.prototype.interfaces_=function(){return[]},Xs.prototype.getClass=function(){return Xs},Xs.isClosed=function(o){return!(o.length<=1)&&o[0].equals2D(o[o.length-1])};var sn=u(function(o){this._srcGeom=o||null},"Ji"),Kw={SNAP_PRECISION_FACTOR:{configurable:!0}};sn.prototype.snapTo=function(o,s){var c=this.extractTargetCoordinates(o);return new Qw(s,c).transform(this._srcGeom)},sn.prototype.snapToSelf=function(o,s){var c=this.extractTargetCoordinates(this._srcGeom),f=new Qw(o,c,!0).transform(this._srcGeom),g=f;return s&&pt(g,Dn)&&(g=f.buffer(0)),g},sn.prototype.computeSnapTolerance=function(o){return this.computeMinimumSegmentLength(o)/10},sn.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))},sn.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},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},sn.snap=function(o,s,c){var f=new Array(2).fill(null),g=new sn(o);f[0]=g.snapTo(s,c);var _=new sn(s);return f[1]=_.snapTo(f[0],c),f},sn.computeOverlaySnapTolerance=function(){if(arguments.length===1){var o=arguments[0],s=sn.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(sn.computeOverlaySnapTolerance(g),sn.computeOverlaySnapTolerance(_))}},sn.computeSizeBasedSnapTolerance=function(o){var s=o.getEnvelopeInternal();return Math.min(s.getHeight(),s.getWidth())*sn.SNAP_PRECISION_FACTOR},sn.snapToSelf=function(o,s,c){return new sn(o).snapToSelf(s,c)},Kw.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(sn,Kw);var Qw=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 u(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 Xs(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}(Bi),yi=u(function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},"$i");yi.prototype.getCommon=function(){return L.longBitsToDouble(this._commonBits)},yi.prototype.add=function(o){var s=L.doubleToLongBits(o);if(this._isFirst)return this._commonBits=s,this._commonSignExp=yi.signExpBits(this._commonBits),this._isFirst=!1,null;if(yi.signExpBits(s)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=yi.numCommonMostSigMantissaBits(this._commonBits,s),this._commonBits=yi.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},yi.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+" ]"}},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi},yi.getBit=function(o,s){return(o&1<<s)!=0?1:0},yi.signExpBits=function(o){return o>>52},yi.zeroLowerBits=function(o,s){return o&~((1<<s)-1)},yi.numCommonMostSigMantissaBits=function(o,s){for(var c=0,f=52;f>=0;f--){if(yi.getBit(o,f)!==yi.getBit(s,f))return c;c++}return 52};var Al=u(function(){this._commonCoord=null,this._ccFilter=new up},"tr"),O2={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Al.prototype.addCommonBits=function(o){var s=new Nl(this._commonCoord);o.apply(s),o.geometryChanged()},Al.prototype.removeCommonBits=function(o){if(this._commonCoord.x===0&&this._commonCoord.y===0)return o;var s=new k(this._commonCoord);s.x=-s.x,s.y=-s.y;var c=new Nl(s);return o.apply(c),o.geometryChanged(),o},Al.prototype.getCommonCoordinate=function(){return this._commonCoord},Al.prototype.add=function(o){o.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Al.prototype.interfaces_=function(){return[]},Al.prototype.getClass=function(){return Al},O2.CommonCoordinateFilter.get=function(){return up},O2.Translater.get=function(){return Nl},Object.defineProperties(Al,O2);var up=u(function(){this._commonBitsX=new yi,this._commonBitsY=new yi},"nr");up.prototype.filter=function(o){this._commonBitsX.add(o.x),this._commonBitsY.add(o.y)},up.prototype.getCommonCoordinate=function(){return new k(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},up.prototype.interfaces_=function(){return[Oi]},up.prototype.getClass=function(){return up};var Nl=u(function(){this.trans=null;var o=arguments[0];this.trans=o},"ir");Nl.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)},Nl.prototype.isDone=function(){return!1},Nl.prototype.isGeometryChanged=function(){return!0},Nl.prototype.interfaces_=function(){return[fe]},Nl.prototype.getClass=function(){return Nl};var Nn=u(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");Nn.prototype.selfSnap=function(o){return new sn(o).snapTo(o,this._snapTolerance)},Nn.prototype.removeCommonBits=function(o){this._cbr=new Al,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},Nn.prototype.prepareResult=function(o){return this._cbr.addCommonBits(o),o},Nn.prototype.getResultGeometry=function(o){var s=this.snap(this._geom),c=oe.overlayOp(s[0],s[1],o);return this.prepareResult(c)},Nn.prototype.checkValid=function(o){o.isValid()||Nt.out.println("Snapped geometry is invalid")},Nn.prototype.computeSnapTolerance=function(){this._snapTolerance=sn.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Nn.prototype.snap=function(o){var s=this.removeCommonBits(o);return sn.snap(s[0],s[1],this._snapTolerance)},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn},Nn.overlayOp=function(o,s,c){return new Nn(o,s).getResultGeometry(c)},Nn.union=function(o,s){return Nn.overlayOp(o,s,oe.UNION)},Nn.intersection=function(o,s){return Nn.overlayOp(o,s,oe.INTERSECTION)},Nn.symDifference=function(o,s){return Nn.overlayOp(o,s,oe.SYMDIFFERENCE)},Nn.difference=function(o,s){return Nn.overlayOp(o,s,oe.DIFFERENCE)};var vi=u(function(o,s){this._geom=new Array(2).fill(null),this._geom[0]=o,this._geom[1]=s},"or");vi.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 Yr))throw g;f=g}if(!c)try{s=Nn.overlayOp(this._geom[0],this._geom[1],o)}catch(g){throw g instanceof Yr?f:g}return s},vi.prototype.interfaces_=function(){return[]},vi.prototype.getClass=function(){return vi},vi.overlayOp=function(o,s,c){return new vi(o,s).getResultGeometry(c)},vi.union=function(o,s){return vi.overlayOp(o,s,oe.UNION)},vi.intersection=function(o,s){return vi.overlayOp(o,s,oe.INTERSECTION)},vi.symDifference=function(o,s){return vi.overlayOp(o,s,oe.SYMDIFFERENCE)},vi.difference=function(o,s){return vi.overlayOp(o,s,oe.DIFFERENCE)};var Km=u(function(){this.mce=null,this.chainIndex=null;var o=arguments[0],s=arguments[1];this.mce=o,this.chainIndex=s},"sr");Km.prototype.computeIntersections=function(o,s){this.mce.computeIntersectsForChain(this.chainIndex,o.mce,o.chainIndex,s)},Km.prototype.interfaces_=function(){return[]},Km.prototype.getClass=function(){return Km};var eo=u(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"),D2={INSERT:{configurable:!0},DELETE:{configurable:!0}};eo.prototype.isDelete=function(){return this._eventType===eo.DELETE},eo.prototype.setDeleteEventIndex=function(o){this._deleteEventIndex=o},eo.prototype.getObject=function(){return this._obj},eo.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},eo.prototype.getInsertEvent=function(){return this._insertEvent},eo.prototype.isInsert=function(){return this._eventType===eo.INSERT},eo.prototype.isSameLabel=function(o){return this._label!==null&&this._label===o._label},eo.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},eo.prototype.interfaces_=function(){return[j]},eo.prototype.getClass=function(){return eo},D2.INSERT.get=function(){return 1},D2.DELETE.get=function(){return 2},Object.defineProperties(eo,D2);var b0=u(function(){},"lr");b0.prototype.interfaces_=function(){return[]},b0.prototype.getClass=function(){return b0};var Wn=u(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");Wn.prototype.isTrivialIntersection=function(o,s,c,f){if(o===c&&this._li.getIntersectionNum()===1){if(Wn.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},Wn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Wn.prototype.setIsDoneIfProperInt=function(o){this._isDoneWhenProperInt=o},Wn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Wn.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},Wn.prototype.hasProperIntersection=function(){return this._hasProper},Wn.prototype.hasIntersection=function(){return this._hasIntersection},Wn.prototype.isDone=function(){return this._isDone},Wn.prototype.isBoundaryPoint=function(o,s){return s!==null&&(!!this.isBoundaryPointInternal(o,s[0])||!!this.isBoundaryPointInternal(o,s[1]))},Wn.prototype.setBoundaryNodes=function(o,s){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=o,this._bdyNodes[1]=s},Wn.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],A=c.getCoordinates()[f+1];this._li.computeIntersection(g,_,M,A),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))))},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn},Wn.isAdjacentSegments=function(o,s){return Math.abs(o-s)===1};var EL=function(o){function s(){o.call(this),this.events=new Pt,this.nOverlaps=null}return u(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.prepareEvents=function(){$o.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 Wn&&pt(arguments[0],Li)&&pt(arguments[1],Li)){var _=arguments[0],M=arguments[1],A=arguments[2];this.addEdges(_,_),this.addEdges(M,M),this.computeIntersections(A)}else if(typeof arguments[2]=="boolean"&&pt(arguments[0],Li)&&arguments[1]instanceof Wn){var B=arguments[0],W=arguments[1];arguments[2]?this.addEdges(B,null):this.addEdges(B),this.computeIntersections(W)}}},s.prototype.addEdge=function(c,f){for(var g=c.getMonotoneChainEdge(),_=g.getStartIndexes(),M=0;M<_.length-1;M++){var A=new Km(g,M),B=new eo(f,g.getMinX(M),A);this.events.add(B),this.events.add(new eo(g.getMaxX(M),B))}},s.prototype.processOverlaps=function(c,f,g,_){for(var M=g.getObject(),A=c;A<f;A++){var B=this.events.get(A);if(B.isInsert()){var W=B.getObject();g.isSameLabel(B)||(M.computeIntersections(W,_),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 A=M.next();this.addEdge(A,_)}},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(b0),Ys=u(function(){this._min=L.POSITIVE_INFINITY,this._max=L.NEGATIVE_INFINITY},"hr"),tT={NodeComparator:{configurable:!0}};Ys.prototype.getMin=function(){return this._min},Ys.prototype.intersects=function(o,s){return!(this._min>s||this._max<o)},Ys.prototype.getMax=function(){return this._max},Ys.prototype.toString=function(){return br.toLineString(new k(this._min,0),new k(this._max,0))},Ys.prototype.interfaces_=function(){return[]},Ys.prototype.getClass=function(){return Ys},tT.NodeComparator.get=function(){return Qm},Object.defineProperties(Ys,tT);var Qm=u(function(){},"gr");Qm.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},Qm.prototype.interfaces_=function(){return[q]},Qm.prototype.getClass=function(){return Qm};var OL=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 u(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}(Ys),DL=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 u(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}(Ys),qs=u(function(){this._leaves=new Pt,this._root=null,this._level=0},"_r");qs.prototype.buildTree=function(){$o.sort(this._leaves,new Ys.NodeComparator);for(var o=this._leaves,s=null,c=new Pt;;){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 OL(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 k(o._min,this._level),new k(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 DL(o.get(c),o.get(c+1));s.add(g)}}},qs.prototype.interfaces_=function(){return[]},qs.prototype.getClass=function(){return qs};var wf=u(function(){this._items=new Pt},"mr");wf.prototype.visitItem=function(o){this._items.add(o)},wf.prototype.getItems=function(){return this._items},wf.prototype.interfaces_=function(){return[wl]},wf.prototype.getClass=function(){return wf};var Tf=u(function(){this._index=null;var o=arguments[0];if(!pt(o,Dn))throw new N("Argument must be Polygonal");this._index=new Qu(o)},"vr"),L2={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Tf.prototype.locate=function(o){var s=new wn(o),c=new Pf(s);return this._index.query(o.y,o.y,c),s.getLocation()},Tf.prototype.interfaces_=function(){return[Sf]},Tf.prototype.getClass=function(){return Tf},L2.SegmentVisitor.get=function(){return Pf},L2.IntervalIndexedGeometry.get=function(){return Qu},Object.defineProperties(Tf,L2);var Pf=u(function(){this._counter=null;var o=arguments[0];this._counter=o},"Er");Pf.prototype.visitItem=function(o){var s=o;this._counter.countSegment(s.getCoordinate(0),s.getCoordinate(1))},Pf.prototype.interfaces_=function(){return[wl]},Pf.prototype.getClass=function(){return Pf};var Qu=u(function(){this._index=new qs;var o=arguments[0];this.init(o)},"xr");Qu.prototype.init=function(o){for(var s=Xn.getLines(o).iterator();s.hasNext();){var c=s.next().getCoordinates();this.addLine(c)}},Qu.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)}},Qu.prototype.query=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1],c=new wf;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,_)}},Qu.prototype.interfaces_=function(){return[]},Qu.prototype.getClass=function(){return Qu};var tg=function(o){function s(){if(o.call(this),this._parentGeom=null,this._lineEdgeMap=new kw,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Ko,arguments.length===2){var c=arguments[0],f=arguments[1],g=jn.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],A=arguments[2];this._argIndex=_,this._parentGeom=M,this._boundaryNodeRule=A,M!==null&&this.add(M)}}return u(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,Ct.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],A=new Wn(g,!0,!1);A.setIsDoneIfProperInt(M);var B=this.createEdgeSetIntersector(),W=this._parentGeom instanceof Ni||this._parentGeom instanceof xr||this._parentGeom instanceof Wo,it=_||!W;return B.computeIntersections(this._edges,A,it),this.addSelfIntersectionNodes(this._argIndex),A}},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 Wn(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 Vr){var c=arguments[0].getCoordinate();this.insertPoint(this._argIndex,c,H.INTERIOR)}else if(arguments[0]instanceof k){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=D.removeRepeatedPoints(c.getCoordinates());if(f.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=f[0],null;var g=new v0(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 _=D.removeRepeatedPoints(c.getCoordinates());if(_.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=_[0],null;var M=f,A=g;Mt.isCCW(_)&&(M=g,A=f);var B=new v0(_,new _r(this._argIndex,H.BOUNDARY,M,A));this._lineEdgeMap.put(c,B),this.insertEdge(B),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 EL},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 A=M.next();this.addSelfIntersectionNode(c,A.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 Wo&&(this._useBoundaryDeterminationRule=!1),c instanceof xr)this.addPolygon(c);else if(c instanceof ye)this.addLineString(c);else if(c instanceof Vr)this.addPoint(c);else if(c instanceof $i)this.addCollection(c);else if(c instanceof wr)this.addCollection(c);else if(c instanceof Wo)this.addCollection(c);else{if(!(c instanceof Qt))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 pt(this._parentGeom,Dn)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Tf(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}(qr),Ef=u(function(){if(this._li=new Zi,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 tg(0,o)}else if(arguments.length===2){var s=arguments[0],c=arguments[1],f=jn.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 tg(0,s,f),this._arg[1]=new tg(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 tg(0,g,M),this._arg[1]=new tg(1,_,M)}},"Cr");Ef.prototype.getArgGeometry=function(o){return this._arg[o].getGeometry()},Ef.prototype.setComputationPrecision=function(o){this._resultPrecisionModel=o,this._li.setPrecisionModel(this._resultPrecisionModel)},Ef.prototype.interfaces_=function(){return[]},Ef.prototype.getClass=function(){return Ef};var tc=u(function(){},"Sr");tc.prototype.interfaces_=function(){return[]},tc.prototype.getClass=function(){return tc},tc.map=function(){if(arguments[0]instanceof Jt&&pt(arguments[1],tc.MapOp)){for(var o=arguments[0],s=arguments[1],c=new Pt,f=0;f<o.getNumGeometries();f++){var g=s.map(o.getGeometryN(f));g!==null&&c.add(g)}return o.getFactory().buildGeometry(c)}if(pt(arguments[0],Nr)&&pt(arguments[1],tc.MapOp)){for(var _=arguments[0],M=arguments[1],A=new Pt,B=_.iterator();B.hasNext();){var W=B.next(),it=M.map(W);it!==null&&A.add(it)}return A}},tc.MapOp=function(){};var oe=function(o){function s(){var c=arguments[0],f=arguments[1];o.call(this,c,f),this._ptLocator=new Ko,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Jo,this._resultPolyList=new Pt,this._resultLineList=new Pt,this._resultPointList=new Pt,this._graph=new qr(new Xw),this._geomFact=c.getFactory()}return u(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 Pt;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 Pt,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 Pt;this._arg[0].computeSplitEdges(f),this._arg[1].computeSplitEdges(f),this.insertUniqueEdges(f),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Ku.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(c),this.cancelDuplicateResultEdges();var g=new Ki(this._geomFact);g.add(this._graph),this._resultPolyList=g.getPolygons();var _=new bs(this,this._geomFact,this._ptLocator);this._resultLineList=_.build(c);var M=new lp(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,Ct.RIGHT),_.getLocation(1,Ct.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,Ct.LEFT),"depth of LEFT side has not been initialized"),g.setLocation(M,Ct.LEFT,_.getLocation(M,Ct.LEFT)),Yt.isTrue(!_.isNull(M,Ct.RIGHT),"depth of RIGHT side has not been initialized"),g.setLocation(M,Ct.RIGHT,_.getLocation(M,Ct.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}(Ef);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 ap.map(o,{interfaces_:u(function(){return[tc.MapOp]},"interfaces_"),map:u(function(f){return f.intersection(c)},"map")})}return o.checkNotGeometryCollection(o),o.checkNotGeometryCollection(s),vi.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),vi.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),vi.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 kl=u(function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Ko,this._seg=new Ut;var o=arguments[0],s=arguments[1];this._g=o,this._boundaryDistanceTolerance=s,this._linework=this.extractLinework(o)},"br");kl.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},kl.prototype.getLocation=function(o){return this.isWithinToleranceOfBoundary(o)?H.BOUNDARY:this._ptLocator.locate(o,this._g)},kl.prototype.extractLinework=function(o){var s=new Of;o.apply(s);var c=s.getLinework(),f=ge.toLineStringArray(c);return o.getFactory().createMultiLineString(f)},kl.prototype.interfaces_=function(){return[]},kl.prototype.getClass=function(){return kl};var Of=u(function(){this._linework=null,this._linework=new Pt},"wr");Of.prototype.getLinework=function(){return this._linework},Of.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))}},Of.prototype.interfaces_=function(){return[qt]},Of.prototype.getClass=function(){return Of};var ec=u(function(){this._g=null,this._doLeft=!0,this._doRight=!0;var o=arguments[0];this._g=o},"Or");ec.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)},ec.prototype.setSidesToGenerate=function(o,s){this._doLeft=o,this._doRight=s},ec.prototype.getPoints=function(o){for(var s=new Pt,c=Xn.getLines(this._g).iterator();c.hasNext();){var f=c.next();this.extractPoints(f,o,s)}return s},ec.prototype.computeOffsetPoints=function(o,s,c,f){var g=s.x-o.x,_=s.y-o.y,M=Math.sqrt(g*g+_*_),A=c*g/M,B=c*_/M,W=(s.x+o.x)/2,it=(s.y+o.y)/2;if(this._doLeft){var lt=new k(W-B,it+A);f.add(lt)}if(this._doRight){var Ot=new k(W+B,it-A);f.add(Ot)}},ec.prototype.interfaces_=function(){return[]},ec.prototype.getClass=function(){return ec};var go=u(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 Pt;var s=arguments[0],c=arguments[1],f=arguments[2];this._boundaryDistanceTolerance=o.computeBoundaryDistanceTolerance(s,c),this._geom=[s,c,f],this._locFinder=[new kl(this._geom[0],this._boundaryDistanceTolerance),new kl(this._geom[1],this._boundaryDistanceTolerance),new kl(this._geom[2],this._boundaryDistanceTolerance)]},"t"),eT={TOLERANCE:{configurable:!0}};go.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]))},go.prototype.isValid=function(o){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var s=this.checkValid(o);return s},go.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),!!go.hasLocation(this._location,H.BOUNDARY)||this.isValidResult(f,this._location)}},go.prototype.addTestPts=function(o){var s=new ec(o);this._testCoords.addAll(s.getPoints(5*this._boundaryDistanceTolerance))},go.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},go.prototype.getInvalidLocation=function(){return this._invalidLocation},go.prototype.interfaces_=function(){return[]},go.prototype.getClass=function(){return go},go.hasLocation=function(o,s){for(var c=0;c<3;c++)if(o[c]===s)return!0;return!1},go.computeBoundaryDistanceTolerance=function(o,s){return Math.min(sn.computeSizeBasedSnapTolerance(o),sn.computeSizeBasedSnapTolerance(s))},go.isValid=function(o,s,c,f){return new go(o,s,f).isValid(c)},eT.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(go,eT);var yo=u(function o(s){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=o.extractFactory(s),this._inputGeoms=s},"t");yo.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)}},yo.prototype.combine=function(){for(var o=new Pt,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)},yo.prototype.interfaces_=function(){return[]},yo.prototype.getClass=function(){return yo},yo.combine=function(){if(arguments.length===1){var o=arguments[0];return new yo(o).combine()}if(arguments.length===2){var s=arguments[0],c=arguments[1];return new yo(yo.createList(s,c)).combine()}if(arguments.length===3){var f=arguments[0],g=arguments[1],_=arguments[2];return new yo(yo.createList(f,g,_)).combine()}},yo.extractFactory=function(o){return o.isEmpty()?null:o.iterator().next().getFactory()},yo.createList=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1],c=new Pt;return c.add(o),c.add(s),c}if(arguments.length===3){var f=arguments[0],g=arguments[1],_=arguments[2],M=new Pt;return M.add(f),M.add(g),M.add(_),M}};var dn=u(function(){this._inputPolys=null,this._geomFactory=null;var o=arguments[0];this._inputPolys=o,this._inputPolys===null&&(this._inputPolys=new Pt)},"Dr"),rT={STRTREE_NODE_CAPACITY:{configurable:!0}};dn.prototype.reduceToGeometries=function(o){for(var s=new Pt,c=o.iterator();c.hasNext();){var f=c.next(),g=null;pt(f,Li)?g=this.unionTree(f):f instanceof Jt&&(g=f),s.add(g)}return s},dn.prototype.extractByEnvelope=function(o,s,c){for(var f=new Pt,g=0;g<s.getNumGeometries();g++){var _=s.getGeometryN(g);_.getEnvelopeInternal().intersects(o)?f.add(_):c.add(_)}return this._geomFactory.buildGeometry(f)},dn.prototype.unionOptimized=function(o,s){var c=o.getEnvelopeInternal(),f=s.getEnvelopeInternal();if(!c.intersects(f))return yo.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)},dn.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 Gw(dn.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)},dn.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=dn.getGeometry(s,c);return this.unionSafe(g,null)}if(f-c==2)return this.unionSafe(dn.getGeometry(s,c),dn.getGeometry(s,c+1));var _=Math.trunc((f+c)/2),M=this.binaryUnion(s,c,_),A=this.binaryUnion(s,_,f);return this.unionSafe(M,A)}},dn.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},dn.prototype.unionSafe=function(o,s){return o===null&&s===null?null:o===null?s.copy():s===null?o.copy():this.unionOptimized(o,s)},dn.prototype.unionActual=function(o,s){return dn.restrictToPolygons(o.union(s))},dn.prototype.unionTree=function(o){var s=this.reduceToGeometries(o);return this.binaryUnion(s)},dn.prototype.unionUsingEnvelopeIntersection=function(o,s,c){var f=new Pt,g=this.extractByEnvelope(c,o,f),_=this.extractByEnvelope(c,s,f),M=this.unionActual(g,_);return f.add(M),yo.combine(f)},dn.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)}},dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn},dn.restrictToPolygons=function(o){if(pt(o,Dn))return o;var s=Aa.getPolygons(o);return s.size()===1?s.get(0):o.getFactory().createMultiPolygon(ge.toPolygonArray(s))},dn.getGeometry=function(o,s){return s>=o.size()?null:o.get(s)},dn.union=function(o){return new dn(o).union()},rT.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(dn,rT);var eg=u(function(){},"Ar");eg.prototype.interfaces_=function(){return[]},eg.prototype.getClass=function(){return eg},eg.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),vi.overlayOp(o,s,oe.UNION)},r.GeoJSONReader=S2,r.GeoJSONWriter=Fw,r.OverlayOp=oe,r.UnionOp=eg,r.BufferOp=Hn,Object.defineProperty(r,"__esModule",{value:!0})})});var l3=Lt((hy,kd)=>{y();var FV=200,c9="__lodash_hash_undefined__",BV=800,GV=16,p9=9007199254740991,h9="[object Arguments]",VV="[object Array]",jV="[object AsyncFunction]",UV="[object Boolean]",zV="[object Date]",HV="[object Error]",f9="[object Function]",XV="[object GeneratorFunction]",YV="[object Map]",qV="[object Number]",WV="[object Null]",d9="[object Object]",ZV="[object Proxy]",$V="[object RegExp]",JV="[object Set]",KV="[object String]",QV="[object Undefined]",tj="[object WeakMap]",ej="[object ArrayBuffer]",rj="[object DataView]",nj="[object Float32Array]",ij="[object Float64Array]",oj="[object Int8Array]",sj="[object Int16Array]",aj="[object Int32Array]",lj="[object Uint8Array]",uj="[object Uint8ClampedArray]",cj="[object Uint16Array]",pj="[object Uint32Array]",hj=/[\\^$.*+?()[\]{}|]/g,fj=/^\[object .+?Constructor\]$/,dj=/^(?:0|[1-9]\d*)$/,ln={};ln[nj]=ln[ij]=ln[oj]=ln[sj]=ln[aj]=ln[lj]=ln[uj]=ln[cj]=ln[pj]=!0;ln[h9]=ln[VV]=ln[ej]=ln[UV]=ln[rj]=ln[zV]=ln[HV]=ln[f9]=ln[YV]=ln[qV]=ln[d9]=ln[$V]=ln[JV]=ln[KV]=ln[tj]=!1;var m9=typeof global=="object"&&global&&global.Object===Object&&global,mj=typeof self=="object"&&self&&self.Object===Object&&self,my=m9||mj||Function("return this")(),g9=typeof hy=="object"&&hy&&!hy.nodeType&&hy,fy=g9&&typeof kd=="object"&&kd&&!kd.nodeType&&kd,y9=fy&&fy.exports===g9,KS=y9&&m9.process,e9=function(){try{var r=fy&&fy.require&&fy.require("util").types;return r||KS&&KS.binding&&KS.binding("util")}catch(e){}}(),r9=e9&&e9.isTypedArray;function gj(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}u(gj,"apply");function yj(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}u(yj,"baseTimes");function vj(r){return function(e){return r(e)}}u(vj,"baseUnary");function bj(r,e){return r==null?void 0:r[e]}u(bj,"getValue");function xj(r,e){return function(t){return r(e(t))}}u(xj,"overArg");var _j=Array.prototype,Cj=Function.prototype,xb=Object.prototype,QS=my["__core-js_shared__"],_b=Cj.toString,uu=xb.hasOwnProperty,n9=function(){var r=/[^.]+$/.exec(QS&&QS.keys&&QS.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),v9=xb.toString,Sj=_b.call(Object),Ij=RegExp("^"+_b.call(uu).replace(hj,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vb=y9?my.Buffer:void 0,i9=my.Symbol,o9=my.Uint8Array,s9=vb?vb.allocUnsafe:void 0,b9=xj(Object.getPrototypeOf,Object),a9=Object.create,Mj=xb.propertyIsEnumerable,wj=_j.splice,Mh=i9?i9.toStringTag:void 0,bb=function(){try{var r=o3(Object,"defineProperty");return r({},"",{}),r}catch(e){}}(),Tj=vb?vb.isBuffer:void 0,l9=Math.max,Pj=Date.now,x9=o3(my,"Map"),dy=o3(Object,"create"),Ej=function(){function r(){}return u(r,"object"),function(e){if(!Th(e))return{};if(a9)return a9(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function wh(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}u(wh,"Hash");function Oj(){this.__data__=dy?dy(null):{},this.size=0}u(Oj,"hashClear");function Dj(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}u(Dj,"hashDelete");function Lj(r){var e=this.__data__;if(dy){var t=e[r];return t===c9?void 0:t}return uu.call(e,r)?e[r]:void 0}u(Lj,"hashGet");function Aj(r){var e=this.__data__;return dy?e[r]!==void 0:uu.call(e,r)}u(Aj,"hashHas");function Nj(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=dy&&e===void 0?c9:e,this}u(Nj,"hashSet");wh.prototype.clear=Oj;wh.prototype.delete=Dj;wh.prototype.get=Lj;wh.prototype.has=Aj;wh.prototype.set=Nj;function cu(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}u(cu,"ListCache");function kj(){this.__data__=[],this.size=0}u(kj,"listCacheClear");function Rj(r){var e=this.__data__,t=Cb(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():wj.call(e,t,1),--this.size,!0}u(Rj,"listCacheDelete");function Fj(r){var e=this.__data__,t=Cb(e,r);return t<0?void 0:e[t][1]}u(Fj,"listCacheGet");function Bj(r){return Cb(this.__data__,r)>-1}u(Bj,"listCacheHas");function Gj(r,e){var t=this.__data__,n=Cb(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}u(Gj,"listCacheSet");cu.prototype.clear=kj;cu.prototype.delete=Rj;cu.prototype.get=Fj;cu.prototype.has=Bj;cu.prototype.set=Gj;function Rd(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}u(Rd,"MapCache");function Vj(){this.size=0,this.__data__={hash:new wh,map:new(x9||cu),string:new wh}}u(Vj,"mapCacheClear");function jj(r){var e=Ib(this,r).delete(r);return this.size-=e?1:0,e}u(jj,"mapCacheDelete");function Uj(r){return Ib(this,r).get(r)}u(Uj,"mapCacheGet");function zj(r){return Ib(this,r).has(r)}u(zj,"mapCacheHas");function Hj(r,e){var t=Ib(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}u(Hj,"mapCacheSet");Rd.prototype.clear=Vj;Rd.prototype.delete=jj;Rd.prototype.get=Uj;Rd.prototype.has=zj;Rd.prototype.set=Hj;function Fd(r){var e=this.__data__=new cu(r);this.size=e.size}u(Fd,"Stack");function Xj(){this.__data__=new cu,this.size=0}u(Xj,"stackClear");function Yj(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}u(Yj,"stackDelete");function qj(r){return this.__data__.get(r)}u(qj,"stackGet");function Wj(r){return this.__data__.has(r)}u(Wj,"stackHas");function Zj(r,e){var t=this.__data__;if(t instanceof cu){var n=t.__data__;if(!x9||n.length<FV-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Rd(n)}return t.set(r,e),this.size=t.size,this}u(Zj,"stackSet");Fd.prototype.clear=Xj;Fd.prototype.delete=Yj;Fd.prototype.get=qj;Fd.prototype.has=Wj;Fd.prototype.set=Zj;function $j(r,e){var t=n3(r),n=!t&&r3(r),i=!t&&!n&&I9(r),a=!t&&!n&&!i&&w9(r),l=t||n||i||a,h=l?yj(r.length,String):[],d=h.length;for(var m in r)(e||uu.call(r,m))&&!(l&&(m=="length"||i&&(m=="offset"||m=="parent")||a&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||C9(m,d)))&&h.push(m);return h}u($j,"arrayLikeKeys");function t3(r,e,t){(t!==void 0&&!Mb(r[e],t)||t===void 0&&!(e in r))&&i3(r,e,t)}u(t3,"assignMergeValue");function Jj(r,e,t){var n=r[e];(!(uu.call(r,e)&&Mb(n,t))||t===void 0&&!(e in r))&&i3(r,e,t)}u(Jj,"assignValue");function Cb(r,e){for(var t=r.length;t--;)if(Mb(r[t][0],e))return t;return-1}u(Cb,"assocIndexOf");function i3(r,e,t){e=="__proto__"&&bb?bb(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}u(i3,"baseAssignValue");var Kj=pU();function Sb(r){return r==null?r===void 0?QV:WV:Mh&&Mh in Object(r)?hU(r):vU(r)}u(Sb,"baseGetTag");function u9(r){return gy(r)&&Sb(r)==h9}u(u9,"baseIsArguments");function Qj(r){if(!Th(r)||gU(r))return!1;var e=a3(r)?Ij:fj;return e.test(CU(r))}u(Qj,"baseIsNative");function tU(r){return gy(r)&&M9(r.length)&&!!ln[Sb(r)]}u(tU,"baseIsTypedArray");function eU(r){if(!Th(r))return yU(r);var e=S9(r),t=[];for(var n in r)n=="constructor"&&(e||!uu.call(r,n))||t.push(n);return t}u(eU,"baseKeysIn");function _9(r,e,t,n,i){r!==e&&Kj(e,function(a,l){if(i||(i=new Fd),Th(a))rU(r,e,l,t,_9,n,i);else{var h=n?n(e3(r,l),a,l+"",r,e,i):void 0;h===void 0&&(h=a),t3(r,l,h)}},T9)}u(_9,"baseMerge");function rU(r,e,t,n,i,a,l){var h=e3(r,t),d=e3(e,t),m=l.get(d);if(m){t3(r,t,m);return}var v=a?a(h,d,t+"",r,e,l):void 0,x=v===void 0;if(x){var S=n3(d),I=!S&&I9(d),w=!S&&!I&&w9(d);v=d,S||I||w?n3(h)?v=h:SU(h)?v=lU(h):I?(x=!1,v=oU(d,!0)):w?(x=!1,v=aU(d,!0)):v=[]:IU(d)||r3(d)?(v=h,r3(h)?v=MU(h):(!Th(h)||a3(h))&&(v=fU(d))):x=!1}x&&(l.set(d,v),i(v,d,n,a,l),l.delete(d)),t3(r,t,v)}u(rU,"baseMergeDeep");function nU(r,e){return xU(bU(r,e,P9),r+"")}u(nU,"baseRest");var iU=bb?function(r,e){return bb(r,"toString",{configurable:!0,enumerable:!1,value:TU(e),writable:!0})}:P9;function oU(r,e){if(e)return r.slice();var t=r.length,n=s9?s9(t):new r.constructor(t);return r.copy(n),n}u(oU,"cloneBuffer");function sU(r){var e=new r.constructor(r.byteLength);return new o9(e).set(new o9(r)),e}u(sU,"cloneArrayBuffer");function aU(r,e){var t=e?sU(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}u(aU,"cloneTypedArray");function lU(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}u(lU,"copyArray");function uU(r,e,t,n){var i=!t;t||(t={});for(var a=-1,l=e.length;++a<l;){var h=e[a],d=n?n(t[h],r[h],h,t,r):void 0;d===void 0&&(d=r[h]),i?i3(t,h,d):Jj(t,h,d)}return t}u(uU,"copyObject");function cU(r){return nU(function(e,t){var n=-1,i=t.length,a=i>1?t[i-1]:void 0,l=i>2?t[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,l&&dU(t[0],t[1],l)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var h=t[n];h&&r(e,h,n,a)}return e})}u(cU,"createAssigner");function pU(r){return function(e,t,n){for(var i=-1,a=Object(e),l=n(e),h=l.length;h--;){var d=l[r?h:++i];if(t(a[d],d,a)===!1)break}return e}}u(pU,"createBaseFor");function Ib(r,e){var t=r.__data__;return mU(e)?t[typeof e=="string"?"string":"hash"]:t.map}u(Ib,"getMapData");function o3(r,e){var t=bj(r,e);return Qj(t)?t:void 0}u(o3,"getNative");function hU(r){var e=uu.call(r,Mh),t=r[Mh];try{r[Mh]=void 0;var n=!0}catch(a){}var i=v9.call(r);return n&&(e?r[Mh]=t:delete r[Mh]),i}u(hU,"getRawTag");function fU(r){return typeof r.constructor=="function"&&!S9(r)?Ej(b9(r)):{}}u(fU,"initCloneObject");function C9(r,e){var t=typeof r;return e=e==null?p9:e,!!e&&(t=="number"||t!="symbol"&&dj.test(r))&&r>-1&&r%1==0&&r<e}u(C9,"isIndex");function dU(r,e,t){if(!Th(t))return!1;var n=typeof e;return(n=="number"?s3(t)&&C9(e,t.length):n=="string"&&e in t)?Mb(t[e],r):!1}u(dU,"isIterateeCall");function mU(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}u(mU,"isKeyable");function gU(r){return!!n9&&n9 in r}u(gU,"isMasked");function S9(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||xb;return r===t}u(S9,"isPrototype");function yU(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}u(yU,"nativeKeysIn");function vU(r){return v9.call(r)}u(vU,"objectToString");function bU(r,e,t){return e=l9(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=l9(n.length-e,0),l=Array(a);++i<a;)l[i]=n[e+i];i=-1;for(var h=Array(e+1);++i<e;)h[i]=n[i];return h[e]=t(l),gj(r,this,h)}}u(bU,"overRest");function e3(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}u(e3,"safeGet");var xU=_U(iU);function _U(r){var e=0,t=0;return function(){var n=Pj(),i=GV-(n-t);if(t=n,i>0){if(++e>=BV)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}u(_U,"shortOut");function CU(r){if(r!=null){try{return _b.call(r)}catch(e){}try{return r+""}catch(e){}}return""}u(CU,"toSource");function Mb(r,e){return r===e||r!==r&&e!==e}u(Mb,"eq");var r3=u9(function(){return arguments}())?u9:function(r){return gy(r)&&uu.call(r,"callee")&&!Mj.call(r,"callee")},n3=Array.isArray;function s3(r){return r!=null&&M9(r.length)&&!a3(r)}u(s3,"isArrayLike");function SU(r){return gy(r)&&s3(r)}u(SU,"isArrayLikeObject");var I9=Tj||PU;function a3(r){if(!Th(r))return!1;var e=Sb(r);return e==f9||e==XV||e==jV||e==ZV}u(a3,"isFunction");function M9(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=p9}u(M9,"isLength");function Th(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}u(Th,"isObject");function gy(r){return r!=null&&typeof r=="object"}u(gy,"isObjectLike");function IU(r){if(!gy(r)||Sb(r)!=d9)return!1;var e=b9(r);if(e===null)return!0;var t=uu.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&_b.call(t)==Sj}u(IU,"isPlainObject");var w9=r9?vj(r9):tU;function MU(r){return uU(r,T9(r))}u(MU,"toPlainObject");function T9(r){return s3(r)?$j(r,!0):eU(r)}u(T9,"keysIn");var wU=cU(function(r,e,t){_9(r,e,t)});function TU(r){return function(){return r}}u(TU,"constant");function P9(r){return r}u(P9,"identity");function PU(){return!1}u(PU,"stubFalse");kd.exports=wU});var S3=Lt((by,Gd)=>{y();var rz=200,Z9="__lodash_hash_undefined__",nz=800,iz=16,$9=9007199254740991,J9="[object Arguments]",oz="[object Array]",sz="[object AsyncFunction]",az="[object Boolean]",lz="[object Date]",uz="[object Error]",K9="[object Function]",cz="[object GeneratorFunction]",pz="[object Map]",hz="[object Number]",fz="[object Null]",Q9="[object Object]",dz="[object Proxy]",mz="[object RegExp]",gz="[object Set]",yz="[object String]",vz="[object Undefined]",bz="[object WeakMap]",xz="[object ArrayBuffer]",_z="[object DataView]",Cz="[object Float32Array]",Sz="[object Float64Array]",Iz="[object Int8Array]",Mz="[object Int16Array]",wz="[object Int32Array]",Tz="[object Uint8Array]",Pz="[object Uint8ClampedArray]",Ez="[object Uint16Array]",Oz="[object Uint32Array]",Dz=/[\\^$.*+?()[\]{}|]/g,Lz=/^\[object .+?Constructor\]$/,Az=/^(?:0|[1-9]\d*)$/,un={};un[Cz]=un[Sz]=un[Iz]=un[Mz]=un[wz]=un[Tz]=un[Pz]=un[Ez]=un[Oz]=!0;un[J9]=un[oz]=un[xz]=un[az]=un[_z]=un[lz]=un[uz]=un[K9]=un[pz]=un[hz]=un[Q9]=un[mz]=un[gz]=un[yz]=un[bz]=!1;var t8=typeof global=="object"&&global&&global.Object===Object&&global,Nz=typeof self=="object"&&self&&self.Object===Object&&self,Cy=t8||Nz||Function("return this")(),e8=typeof by=="object"&&by&&!by.nodeType&&by,xy=e8&&typeof Gd=="object"&&Gd&&!Gd.nodeType&&Gd,r8=xy&&xy.exports===e8,h3=r8&&t8.process,V9=function(){try{var r=xy&&xy.require&&xy.require("util").types;return r||h3&&h3.binding&&h3.binding("util")}catch(e){}}(),j9=V9&&V9.isTypedArray;function n8(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}u(n8,"apply");function kz(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}u(kz,"baseTimes");function Rz(r){return function(e){return r(e)}}u(Rz,"baseUnary");function Fz(r,e){return r==null?void 0:r[e]}u(Fz,"getValue");function Bz(r,e){return function(t){return r(e(t))}}u(Bz,"overArg");var Gz=Array.prototype,Vz=Function.prototype,Ob=Object.prototype,f3=Cy["__core-js_shared__"],Db=Vz.toString,fu=Ob.hasOwnProperty,U9=function(){var r=/[^.]+$/.exec(f3&&f3.keys&&f3.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),i8=Ob.toString,jz=Db.call(Object),Uz=RegExp("^"+Db.call(fu).replace(Dz,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pb=r8?Cy.Buffer:void 0,z9=Cy.Symbol,H9=Cy.Uint8Array,X9=Pb?Pb.allocUnsafe:void 0,o8=Bz(Object.getPrototypeOf,Object),Y9=Object.create,zz=Ob.propertyIsEnumerable,Hz=Gz.splice,Eh=z9?z9.toStringTag:void 0,Eb=function(){try{var r=x3(Object,"defineProperty");return r({},"",{}),r}catch(e){}}(),Xz=Pb?Pb.isBuffer:void 0,q9=Math.max,Yz=Date.now,s8=x3(Cy,"Map"),_y=x3(Object,"create"),qz=function(){function r(){}return u(r,"object"),function(e){if(!hu(e))return{};if(Y9)return Y9(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function Oh(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}u(Oh,"Hash");function Wz(){this.__data__=_y?_y(null):{},this.size=0}u(Wz,"hashClear");function Zz(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}u(Zz,"hashDelete");function $z(r){var e=this.__data__;if(_y){var t=e[r];return t===Z9?void 0:t}return fu.call(e,r)?e[r]:void 0}u($z,"hashGet");function Jz(r){var e=this.__data__;return _y?e[r]!==void 0:fu.call(e,r)}u(Jz,"hashHas");function Kz(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=_y&&e===void 0?Z9:e,this}u(Kz,"hashSet");Oh.prototype.clear=Wz;Oh.prototype.delete=Zz;Oh.prototype.get=$z;Oh.prototype.has=Jz;Oh.prototype.set=Kz;function du(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}u(du,"ListCache");function Qz(){this.__data__=[],this.size=0}u(Qz,"listCacheClear");function tH(r){var e=this.__data__,t=Lb(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Hz.call(e,t,1),--this.size,!0}u(tH,"listCacheDelete");function eH(r){var e=this.__data__,t=Lb(e,r);return t<0?void 0:e[t][1]}u(eH,"listCacheGet");function rH(r){return Lb(this.__data__,r)>-1}u(rH,"listCacheHas");function nH(r,e){var t=this.__data__,n=Lb(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}u(nH,"listCacheSet");du.prototype.clear=Qz;du.prototype.delete=tH;du.prototype.get=eH;du.prototype.has=rH;du.prototype.set=nH;function Vd(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}u(Vd,"MapCache");function iH(){this.size=0,this.__data__={hash:new Oh,map:new(s8||du),string:new Oh}}u(iH,"mapCacheClear");function oH(r){var e=Nb(this,r).delete(r);return this.size-=e?1:0,e}u(oH,"mapCacheDelete");function sH(r){return Nb(this,r).get(r)}u(sH,"mapCacheGet");function aH(r){return Nb(this,r).has(r)}u(aH,"mapCacheHas");function lH(r,e){var t=Nb(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}u(lH,"mapCacheSet");Vd.prototype.clear=iH;Vd.prototype.delete=oH;Vd.prototype.get=sH;Vd.prototype.has=aH;Vd.prototype.set=lH;function jd(r){var e=this.__data__=new du(r);this.size=e.size}u(jd,"Stack");function uH(){this.__data__=new du,this.size=0}u(uH,"stackClear");function cH(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}u(cH,"stackDelete");function pH(r){return this.__data__.get(r)}u(pH,"stackGet");function hH(r){return this.__data__.has(r)}u(hH,"stackHas");function fH(r,e){var t=this.__data__;if(t instanceof du){var n=t.__data__;if(!s8||n.length<rz-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Vd(n)}return t.set(r,e),this.size=t.size,this}u(fH,"stackSet");jd.prototype.clear=uH;jd.prototype.delete=cH;jd.prototype.get=pH;jd.prototype.has=hH;jd.prototype.set=fH;function dH(r,e){var t=y3(r),n=!t&&g3(r),i=!t&&!n&&p8(r),a=!t&&!n&&!i&&f8(r),l=t||n||i||a,h=l?kz(r.length,String):[],d=h.length;for(var m in r)(e||fu.call(r,m))&&!(l&&(m=="length"||i&&(m=="offset"||m=="parent")||a&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||u8(m,d)))&&h.push(m);return h}u(dH,"arrayLikeKeys");function d3(r,e,t){(t!==void 0&&!kb(r[e],t)||t===void 0&&!(e in r))&&v3(r,e,t)}u(d3,"assignMergeValue");function mH(r,e,t){var n=r[e];(!(fu.call(r,e)&&kb(n,t))||t===void 0&&!(e in r))&&v3(r,e,t)}u(mH,"assignValue");function Lb(r,e){for(var t=r.length;t--;)if(kb(r[t][0],e))return t;return-1}u(Lb,"assocIndexOf");function v3(r,e,t){e=="__proto__"&&Eb?Eb(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}u(v3,"baseAssignValue");var gH=PH();function Ab(r){return r==null?r===void 0?vz:fz:Eh&&Eh in Object(r)?EH(r):kH(r)}u(Ab,"baseGetTag");function W9(r){return Sy(r)&&Ab(r)==J9}u(W9,"baseIsArguments");function yH(r){if(!hu(r)||AH(r))return!1;var e=C3(r)?Uz:Lz;return e.test(GH(r))}u(yH,"baseIsNative");function vH(r){return Sy(r)&&h8(r.length)&&!!un[Ab(r)]}u(vH,"baseIsTypedArray");function bH(r){if(!hu(r))return NH(r);var e=c8(r),t=[];for(var n in r)n=="constructor"&&(e||!fu.call(r,n))||t.push(n);return t}u(bH,"baseKeysIn");function b3(r,e,t,n,i){r!==e&&gH(e,function(a,l){if(i||(i=new jd),hu(a))xH(r,e,l,t,b3,n,i);else{var h=n?n(m3(r,l),a,l+"",r,e,i):void 0;h===void 0&&(h=a),d3(r,l,h)}},d8)}u(b3,"baseMerge");function xH(r,e,t,n,i,a,l){var h=m3(r,t),d=m3(e,t),m=l.get(d);if(m){d3(r,t,m);return}var v=a?a(h,d,t+"",r,e,l):void 0,x=v===void 0;if(x){var S=y3(d),I=!S&&p8(d),w=!S&&!I&&f8(d);v=d,S||I||w?y3(h)?v=h:VH(h)?v=MH(h):I?(x=!1,v=CH(d,!0)):w?(x=!1,v=IH(d,!0)):v=[]:jH(d)||g3(d)?(v=h,g3(h)?v=UH(h):(!hu(h)||C3(h))&&(v=OH(d))):x=!1}x&&(l.set(d,v),i(v,d,n,a,l),l.delete(d)),d3(r,t,v)}u(xH,"baseMergeDeep");function a8(r,e){return FH(RH(r,e,m8),r+"")}u(a8,"baseRest");var _H=Eb?function(r,e){return Eb(r,"toString",{configurable:!0,enumerable:!1,value:XH(e),writable:!0})}:m8;function CH(r,e){if(e)return r.slice();var t=r.length,n=X9?X9(t):new r.constructor(t);return r.copy(n),n}u(CH,"cloneBuffer");function SH(r){var e=new r.constructor(r.byteLength);return new H9(e).set(new H9(r)),e}u(SH,"cloneArrayBuffer");function IH(r,e){var t=e?SH(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}u(IH,"cloneTypedArray");function MH(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}u(MH,"copyArray");function wH(r,e,t,n){var i=!t;t||(t={});for(var a=-1,l=e.length;++a<l;){var h=e[a],d=n?n(t[h],r[h],h,t,r):void 0;d===void 0&&(d=r[h]),i?v3(t,h,d):mH(t,h,d)}return t}u(wH,"copyObject");function TH(r){return a8(function(e,t){var n=-1,i=t.length,a=i>1?t[i-1]:void 0,l=i>2?t[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,l&&DH(t[0],t[1],l)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var h=t[n];h&&r(e,h,n,a)}return e})}u(TH,"createAssigner");function PH(r){return function(e,t,n){for(var i=-1,a=Object(e),l=n(e),h=l.length;h--;){var d=l[r?h:++i];if(t(a[d],d,a)===!1)break}return e}}u(PH,"createBaseFor");function l8(r,e,t,n,i,a){return hu(r)&&hu(e)&&(a.set(e,r),b3(r,e,void 0,l8,a),a.delete(e)),r}u(l8,"customDefaultsMerge");function Nb(r,e){var t=r.__data__;return LH(e)?t[typeof e=="string"?"string":"hash"]:t.map}u(Nb,"getMapData");function x3(r,e){var t=Fz(r,e);return yH(t)?t:void 0}u(x3,"getNative");function EH(r){var e=fu.call(r,Eh),t=r[Eh];try{r[Eh]=void 0;var n=!0}catch(a){}var i=i8.call(r);return n&&(e?r[Eh]=t:delete r[Eh]),i}u(EH,"getRawTag");function OH(r){return typeof r.constructor=="function"&&!c8(r)?qz(o8(r)):{}}u(OH,"initCloneObject");function u8(r,e){var t=typeof r;return e=e==null?$9:e,!!e&&(t=="number"||t!="symbol"&&Az.test(r))&&r>-1&&r%1==0&&r<e}u(u8,"isIndex");function DH(r,e,t){if(!hu(t))return!1;var n=typeof e;return(n=="number"?_3(t)&&u8(e,t.length):n=="string"&&e in t)?kb(t[e],r):!1}u(DH,"isIterateeCall");function LH(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}u(LH,"isKeyable");function AH(r){return!!U9&&U9 in r}u(AH,"isMasked");function c8(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Ob;return r===t}u(c8,"isPrototype");function NH(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}u(NH,"nativeKeysIn");function kH(r){return i8.call(r)}u(kH,"objectToString");function RH(r,e,t){return e=q9(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=q9(n.length-e,0),l=Array(a);++i<a;)l[i]=n[e+i];i=-1;for(var h=Array(e+1);++i<e;)h[i]=n[i];return h[e]=t(l),n8(r,this,h)}}u(RH,"overRest");function m3(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}u(m3,"safeGet");var FH=BH(_H);function BH(r){var e=0,t=0;return function(){var n=Yz(),i=iz-(n-t);if(t=n,i>0){if(++e>=nz)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}u(BH,"shortOut");function GH(r){if(r!=null){try{return Db.call(r)}catch(e){}try{return r+""}catch(e){}}return""}u(GH,"toSource");function kb(r,e){return r===e||r!==r&&e!==e}u(kb,"eq");var g3=W9(function(){return arguments}())?W9:function(r){return Sy(r)&&fu.call(r,"callee")&&!zz.call(r,"callee")},y3=Array.isArray;function _3(r){return r!=null&&h8(r.length)&&!C3(r)}u(_3,"isArrayLike");function VH(r){return Sy(r)&&_3(r)}u(VH,"isArrayLikeObject");var p8=Xz||YH;function C3(r){if(!hu(r))return!1;var e=Ab(r);return e==K9||e==cz||e==sz||e==dz}u(C3,"isFunction");function h8(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=$9}u(h8,"isLength");function hu(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}u(hu,"isObject");function Sy(r){return r!=null&&typeof r=="object"}u(Sy,"isObjectLike");function jH(r){if(!Sy(r)||Ab(r)!=Q9)return!1;var e=o8(r);if(e===null)return!0;var t=fu.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Db.call(t)==jz}u(jH,"isPlainObject");var f8=j9?Rz(j9):vH;function UH(r){return wH(r,d8(r))}u(UH,"toPlainObject");var zH=a8(function(r){return r.push(void 0,l8),n8(HH,void 0,r)});function d8(r){return _3(r)?dH(r,!0):bH(r)}u(d8,"keysIn");var HH=TH(function(r,e,t,n){b3(r,e,t,n)});function XH(r){return function(){return r}}u(XH,"constant");function m8(r){return r}u(m8,"identity");function YH(){return!1}u(YH,"stubFalse");Gd.exports=zH});var aO=Lt((V7t,Oy)=>{"use strict";y();var uX=!1,Nh=!1,tO=!0,eO=!1,C={},rO=!1;typeof Oy<"u"&&Oy.exports?(Oy.exports=C,rO=!0):typeof document<"u"?window.ClipperLib=C:self.ClipperLib=C;var Yb;rO?(li="chrome",Yb="Netscape"):(li=navigator.userAgent.toString().toLowerCase(),Yb=navigator.appName);var li,dr={};li.indexOf("chrome")!=-1&&li.indexOf("chromium")==-1?dr.chrome=1:dr.chrome=0;li.indexOf("chromium")!=-1?dr.chromium=1:dr.chromium=0;li.indexOf("safari")!=-1&&li.indexOf("chrome")==-1&&li.indexOf("chromium")==-1?dr.safari=1:dr.safari=0;li.indexOf("firefox")!=-1?dr.firefox=1:dr.firefox=0;li.indexOf("firefox/17")!=-1?dr.firefox17=1:dr.firefox17=0;li.indexOf("firefox/15")!=-1?dr.firefox15=1:dr.firefox15=0;li.indexOf("firefox/3")!=-1?dr.firefox3=1:dr.firefox3=0;li.indexOf("opera")!=-1?dr.opera=1:dr.opera=0;li.indexOf("msie 10")!=-1?dr.msie10=1:dr.msie10=0;li.indexOf("msie 9")!=-1?dr.msie9=1:dr.msie9=0;li.indexOf("msie 8")!=-1?dr.msie8=1:dr.msie8=0;li.indexOf("msie 7")!=-1?dr.msie7=1:dr.msie7=0;li.indexOf("msie ")!=-1?dr.msie=1:dr.msie=0;C.biginteger_used=null;var Oc,cX=0xdeadbeefcafe,K8=(cX&16777215)==15715070;function _t(r,e,t){C.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof e>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,e,t):e==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,e))}u(_t,"BigInteger");function Ir(){return new _t(null)}u(Ir,"nbi");function pX(r,e,t,n,i,a){for(;--a>=0;){var l=e*this[r++]+t[n]+i;i=Math.floor(l/67108864),t[n++]=l&67108863}return i}u(pX,"am1");function hX(r,e,t,n,i,a){for(var l=e&32767,h=e>>15;--a>=0;){var d=this[r]&32767,m=this[r++]>>15,v=h*d+m*l;d=l*d+((v&32767)<<15)+t[n]+(i&1073741823),i=(d>>>30)+(v>>>15)+h*m+(i>>>30),t[n++]=d&1073741823}return i}u(hX,"am2");function fX(r,e,t,n,i,a){for(var l=e&16383,h=e>>14;--a>=0;){var d=this[r]&16383,m=this[r++]>>14,v=h*d+m*l;d=l*d+((v&16383)<<14)+t[n]+i,i=(d>>28)+(v>>14)+h*m,t[n++]=d&268435455}return i}u(fX,"am3");K8&&Yb=="Microsoft Internet Explorer"?(_t.prototype.am=hX,Oc=30):K8&&Yb!="Netscape"?(_t.prototype.am=pX,Oc=26):(_t.prototype.am=fX,Oc=28);_t.prototype.DB=Oc;_t.prototype.DM=(1<<Oc)-1;_t.prototype.DV=1<<Oc;var W3=52;_t.prototype.FV=Math.pow(2,W3);_t.prototype.F1=W3-Oc;_t.prototype.F2=2*Oc-W3;var dX="0123456789abcdefghijklmnopqrstuvwxyz",Wb=new Array,qd,Ds;qd=48;for(Ds=0;Ds<=9;++Ds)Wb[qd++]=Ds;qd=97;for(Ds=10;Ds<36;++Ds)Wb[qd++]=Ds;qd=65;for(Ds=10;Ds<36;++Ds)Wb[qd++]=Ds;function Q8(r){return dX.charAt(r)}u(Q8,"int2char");function nO(r,e){var t=Wb[r.charCodeAt(e)];return t==null?-1:t}u(nO,"intAt");function mX(r){for(var e=this.t-1;e>=0;--e)r[e]=this[e];r.t=this.t,r.s=this.s}u(mX,"bnpCopyTo");function gX(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}u(gX,"bnpFromInt");function Ec(r){var e=Ir();return e.fromInt(r),e}u(Ec,"nbv");function yX(r,e){var t;if(e==16)t=4;else if(e==8)t=3;else if(e==256)t=8;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else{this.fromRadix(r,e);return}this.t=0,this.s=0;for(var n=r.length,i=!1,a=0;--n>=0;){var l=t==8?r[n]&255:nO(r,n);if(l<0){r.charAt(n)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=l:a+t>this.DB?(this[this.t-1]|=(l&(1<<this.DB-a)-1)<<a,this[this.t++]=l>>this.DB-a):this[this.t-1]|=l<<a,a+=t,a>=this.DB&&(a-=this.DB)}t==8&&(r[0]&128)!=0&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&_t.ZERO.subTo(this,this)}u(yX,"bnpFromString");function vX(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}u(vX,"bnpClamp");function bX(r){if(this.s<0)return"-"+this.negate().toString(r);var e;if(r==16)e=4;else if(r==8)e=3;else if(r==2)e=1;else if(r==32)e=5;else if(r==4)e=2;else return this.toRadix(r);var t=(1<<e)-1,n,i=!1,a="",l=this.t,h=this.DB-l*this.DB%e;if(l-- >0)for(h<this.DB&&(n=this[l]>>h)>0&&(i=!0,a=Q8(n));l>=0;)h<e?(n=(this[l]&(1<<h)-1)<<e-h,n|=this[--l]>>(h+=this.DB-e)):(n=this[l]>>(h-=e)&t,h<=0&&(h+=this.DB,--l)),n>0&&(i=!0),i&&(a+=Q8(n));return i?a:"0"}u(bX,"bnToString");function xX(){var r=Ir();return _t.ZERO.subTo(this,r),r}u(xX,"bnNegate");function _X(){return this.s<0?this.negate():this}u(_X,"bnAbs");function CX(r){var e=this.s-r.s;if(e!=0)return e;var t=this.t;if(e=t-r.t,e!=0)return this.s<0?-e:e;for(;--t>=0;)if((e=this[t]-r[t])!=0)return e;return 0}u(CX,"bnCompareTo");function Zb(r){var e=1,t;return(t=r>>>16)!=0&&(r=t,e+=16),(t=r>>8)!=0&&(r=t,e+=8),(t=r>>4)!=0&&(r=t,e+=4),(t=r>>2)!=0&&(r=t,e+=2),(t=r>>1)!=0&&(r=t,e+=1),e}u(Zb,"nbits");function SX(){return this.t<=0?0:this.DB*(this.t-1)+Zb(this[this.t-1]^this.s&this.DM)}u(SX,"bnBitLength");function IX(r,e){var t;for(t=this.t-1;t>=0;--t)e[t+r]=this[t];for(t=r-1;t>=0;--t)e[t]=0;e.t=this.t+r,e.s=this.s}u(IX,"bnpDLShiftTo");function MX(r,e){for(var t=r;t<this.t;++t)e[t-r]=this[t];e.t=Math.max(this.t-r,0),e.s=this.s}u(MX,"bnpDRShiftTo");function wX(r,e){var t=r%this.DB,n=this.DB-t,i=(1<<n)-1,a=Math.floor(r/this.DB),l=this.s<<t&this.DM,h;for(h=this.t-1;h>=0;--h)e[h+a+1]=this[h]>>n|l,l=(this[h]&i)<<t;for(h=a-1;h>=0;--h)e[h]=0;e[a]=l,e.t=this.t+a+1,e.s=this.s,e.clamp()}u(wX,"bnpLShiftTo");function TX(r,e){e.s=this.s;var t=Math.floor(r/this.DB);if(t>=this.t){e.t=0;return}var n=r%this.DB,i=this.DB-n,a=(1<<n)-1;e[0]=this[t]>>n;for(var l=t+1;l<this.t;++l)e[l-t-1]|=(this[l]&a)<<i,e[l-t]=this[l]>>n;n>0&&(e[this.t-t-1]|=(this.s&a)<<i),e.t=this.t-t,e.clamp()}u(TX,"bnpRShiftTo");function PX(r,e){for(var t=0,n=0,i=Math.min(r.t,this.t);t<i;)n+=this[t]-r[t],e[t++]=n&this.DM,n>>=this.DB;if(r.t<this.t){for(n-=r.s;t<this.t;)n+=this[t],e[t++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;t<r.t;)n-=r[t],e[t++]=n&this.DM,n>>=this.DB;n-=r.s}e.s=n<0?-1:0,n<-1?e[t++]=this.DV+n:n>0&&(e[t++]=n),e.t=t,e.clamp()}u(PX,"bnpSubTo");function EX(r,e){var t=this.abs(),n=r.abs(),i=t.t;for(e.t=i+n.t;--i>=0;)e[i]=0;for(i=0;i<n.t;++i)e[i+t.t]=t.am(0,n[i],e,i,0,t.t);e.s=0,e.clamp(),this.s!=r.s&&_t.ZERO.subTo(e,e)}u(EX,"bnpMultiplyTo");function OX(r){for(var e=this.abs(),t=r.t=2*e.t;--t>=0;)r[t]=0;for(t=0;t<e.t-1;++t){var n=e.am(t,e[t],r,2*t,0,1);(r[t+e.t]+=e.am(t+1,2*e[t],r,2*t+1,n,e.t-t-1))>=e.DV&&(r[t+e.t]-=e.DV,r[t+e.t+1]=1)}r.t>0&&(r[r.t-1]+=e.am(t,e[t],r,2*t,0,1)),r.s=0,r.clamp()}u(OX,"bnpSquareTo");function DX(r,e,t){var n=r.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){e!=null&&e.fromInt(0),t!=null&&this.copyTo(t);return}t==null&&(t=Ir());var a=Ir(),l=this.s,h=r.s,d=this.DB-Zb(n[n.t-1]);d>0?(n.lShiftTo(d,a),i.lShiftTo(d,t)):(n.copyTo(a),i.copyTo(t));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,P=t.t,E=P-m,O=e==null?Ir():e;for(a.dlShiftTo(E,O),t.compareTo(O)>=0&&(t[t.t++]=1,t.subTo(O,t)),_t.ONE.dlShiftTo(m,O),O.subTo(a,a);a.t<m;)a[a.t++]=0;for(;--E>=0;){var N=t[--P]==v?this.DM:Math.floor(t[P]*S+(t[P-1]+w)*I);if((t[P]+=a.am(0,N,t,E,0,m))<N)for(a.dlShiftTo(E,O),t.subTo(O,t);t[P]<--N;)t.subTo(O,t)}e!=null&&(t.drShiftTo(m,e),l!=h&&_t.ZERO.subTo(e,e)),t.t=m,t.clamp(),d>0&&t.rShiftTo(d,t),l<0&&_t.ZERO.subTo(t,t)}}}u(DX,"bnpDivRemTo");function LX(r){var e=Ir();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(_t.ZERO)>0&&r.subTo(e,e),e}u(LX,"bnMod");function kh(r){this.m=r}u(kh,"Classic");function AX(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}u(AX,"cConvert");function NX(r){return r}u(NX,"cRevert");function kX(r){r.divRemTo(this.m,null,r)}u(kX,"cReduce");function RX(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(RX,"cMulTo");function FX(r,e){r.squareTo(e),this.reduce(e)}u(FX,"cSqrTo");kh.prototype.convert=AX;kh.prototype.revert=NX;kh.prototype.reduce=kX;kh.prototype.mulTo=RX;kh.prototype.sqrTo=FX;function BX(){if(this.t<1)return 0;var r=this[0];if((r&1)==0)return 0;var e=r&3;return e=e*(2-(r&15)*e)&15,e=e*(2-(r&255)*e)&255,e=e*(2-((r&65535)*e&65535))&65535,e=e*(2-r*e%this.DV)%this.DV,e>0?this.DV-e:-e}u(BX,"bnpInvDigit");function Rh(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}u(Rh,"Montgomery");function GX(r){var e=Ir();return r.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),r.s<0&&e.compareTo(_t.ZERO)>0&&this.m.subTo(e,e),e}u(GX,"montConvert");function VX(r){var e=Ir();return r.copyTo(e),this.reduce(e),e}u(VX,"montRevert");function jX(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var e=0;e<this.m.t;++e){var t=r[e]&32767,n=t*this.mpl+((t*this.mph+(r[e]>>15)*this.mpl&this.um)<<15)&r.DM;for(t=e+this.m.t,r[t]+=this.m.am(0,n,r,e,0,this.m.t);r[t]>=r.DV;)r[t]-=r.DV,r[++t]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}u(jX,"montReduce");function UX(r,e){r.squareTo(e),this.reduce(e)}u(UX,"montSqrTo");function zX(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(zX,"montMulTo");Rh.prototype.convert=GX;Rh.prototype.revert=VX;Rh.prototype.reduce=jX;Rh.prototype.mulTo=zX;Rh.prototype.sqrTo=UX;function HX(){return(this.t>0?this[0]&1:this.s)==0}u(HX,"bnpIsEven");function XX(r,e){if(r>4294967295||r<1)return _t.ONE;var t=Ir(),n=Ir(),i=e.convert(this),a=Zb(r)-1;for(i.copyTo(t);--a>=0;)if(e.sqrTo(t,n),(r&1<<a)>0)e.mulTo(n,i,t);else{var l=t;t=n,n=l}return e.revert(t)}u(XX,"bnpExp");function YX(r,e){var t;return r<256||e.isEven()?t=new kh(e):t=new Rh(e),this.exp(r,t)}u(YX,"bnModPowInt");_t.prototype.copyTo=mX;_t.prototype.fromInt=gX;_t.prototype.fromString=yX;_t.prototype.clamp=vX;_t.prototype.dlShiftTo=IX;_t.prototype.drShiftTo=MX;_t.prototype.lShiftTo=wX;_t.prototype.rShiftTo=TX;_t.prototype.subTo=PX;_t.prototype.multiplyTo=EX;_t.prototype.squareTo=OX;_t.prototype.divRemTo=DX;_t.prototype.invDigit=BX;_t.prototype.isEven=HX;_t.prototype.exp=XX;_t.prototype.toString=bX;_t.prototype.negate=xX;_t.prototype.abs=_X;_t.prototype.compareTo=CX;_t.prototype.bitLength=SX;_t.prototype.mod=LX;_t.prototype.modPowInt=YX;_t.ZERO=Ec(0);_t.ONE=Ec(1);function qX(){var r=Ir();return this.copyTo(r),r}u(qX,"bnClone");function WX(){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]}u(WX,"bnIntValue");function ZX(){return this.t==0?this.s:this[0]<<24>>24}u(ZX,"bnByteValue");function $X(){return this.t==0?this.s:this[0]<<16>>16}u($X,"bnShortValue");function JX(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}u(JX,"bnpChunkSize");function KX(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}u(KX,"bnSigNum");function QX(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var e=this.chunkSize(r),t=Math.pow(r,e),n=Ec(t),i=Ir(),a=Ir(),l="";for(this.divRemTo(n,i,a);i.signum()>0;)l=(t+a.intValue()).toString(r).substr(1)+l,i.divRemTo(n,i,a);return a.intValue().toString(r)+l}u(QX,"bnpToRadix");function tY(r,e){this.fromInt(0),e==null&&(e=10);for(var t=this.chunkSize(e),n=Math.pow(e,t),i=!1,a=0,l=0,h=0;h<r.length;++h){var d=nO(r,h);if(d<0){r.charAt(h)=="-"&&this.signum()==0&&(i=!0);continue}l=e*l+d,++a>=t&&(this.dMultiply(n),this.dAddOffset(l,0),a=0,l=0)}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(l,0)),i&&_t.ZERO.subTo(this,this)}u(tY,"bnpFromRadix");function eY(r,e,t){if(typeof e=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(_t.ONE.shiftLeft(r-1),Z3,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(_t.ONE.shiftLeft(r-1),this);else{var n=new Array,i=r&7;n.length=(r>>3)+1,e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}u(eY,"bnpFromNumber");function rY(){var r=this.t,e=new Array;e[0]=this.s;var t=this.DB-r*this.DB%8,n,i=0;if(r-- >0)for(t<this.DB&&(n=this[r]>>t)!=(this.s&this.DM)>>t&&(e[i++]=n|this.s<<this.DB-t);r>=0;)t<8?(n=(this[r]&(1<<t)-1)<<8-t,n|=this[--r]>>(t+=this.DB-8)):(n=this[r]>>(t-=8)&255,t<=0&&(t+=this.DB,--r)),(n&128)!=0&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}u(rY,"bnToByteArray");function nY(r){return this.compareTo(r)==0}u(nY,"bnEquals");function iY(r){return this.compareTo(r)<0?this:r}u(iY,"bnMin");function oY(r){return this.compareTo(r)>0?this:r}u(oY,"bnMax");function sY(r,e,t){var n,i,a=Math.min(r.t,this.t);for(n=0;n<a;++n)t[n]=e(this[n],r[n]);if(r.t<this.t){for(i=r.s&this.DM,n=a;n<this.t;++n)t[n]=e(this[n],i);t.t=this.t}else{for(i=this.s&this.DM,n=a;n<r.t;++n)t[n]=e(i,r[n]);t.t=r.t}t.s=e(this.s,r.s),t.clamp()}u(sY,"bnpBitwiseTo");function aY(r,e){return r&e}u(aY,"op_and");function lY(r){var e=Ir();return this.bitwiseTo(r,aY,e),e}u(lY,"bnAnd");function Z3(r,e){return r|e}u(Z3,"op_or");function uY(r){var e=Ir();return this.bitwiseTo(r,Z3,e),e}u(uY,"bnOr");function iO(r,e){return r^e}u(iO,"op_xor");function cY(r){var e=Ir();return this.bitwiseTo(r,iO,e),e}u(cY,"bnXor");function oO(r,e){return r&~e}u(oO,"op_andnot");function pY(r){var e=Ir();return this.bitwiseTo(r,oO,e),e}u(pY,"bnAndNot");function hY(){for(var r=Ir(),e=0;e<this.t;++e)r[e]=this.DM&~this[e];return r.t=this.t,r.s=~this.s,r}u(hY,"bnNot");function fY(r){var e=Ir();return r<0?this.rShiftTo(-r,e):this.lShiftTo(r,e),e}u(fY,"bnShiftLeft");function dY(r){var e=Ir();return r<0?this.lShiftTo(-r,e):this.rShiftTo(r,e),e}u(dY,"bnShiftRight");function mY(r){if(r==0)return-1;var e=0;return(r&65535)==0&&(r>>=16,e+=16),(r&255)==0&&(r>>=8,e+=8),(r&15)==0&&(r>>=4,e+=4),(r&3)==0&&(r>>=2,e+=2),(r&1)==0&&++e,e}u(mY,"lbit");function gY(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+mY(this[r]);return this.s<0?this.t*this.DB:-1}u(gY,"bnGetLowestSetBit");function yY(r){for(var e=0;r!=0;)r&=r-1,++e;return e}u(yY,"cbit");function vY(){for(var r=0,e=this.s&this.DM,t=0;t<this.t;++t)r+=yY(this[t]^e);return r}u(vY,"bnBitCount");function bY(r){var e=Math.floor(r/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<r%this.DB)!=0}u(bY,"bnTestBit");function xY(r,e){var t=_t.ONE.shiftLeft(r);return this.bitwiseTo(t,e,t),t}u(xY,"bnpChangeBit");function _Y(r){return this.changeBit(r,Z3)}u(_Y,"bnSetBit");function CY(r){return this.changeBit(r,oO)}u(CY,"bnClearBit");function SY(r){return this.changeBit(r,iO)}u(SY,"bnFlipBit");function IY(r,e){for(var t=0,n=0,i=Math.min(r.t,this.t);t<i;)n+=this[t]+r[t],e[t++]=n&this.DM,n>>=this.DB;if(r.t<this.t){for(n+=r.s;t<this.t;)n+=this[t],e[t++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;t<r.t;)n+=r[t],e[t++]=n&this.DM,n>>=this.DB;n+=r.s}e.s=n<0?-1:0,n>0?e[t++]=n:n<-1&&(e[t++]=this.DV+n),e.t=t,e.clamp()}u(IY,"bnpAddTo");function MY(r){var e=Ir();return this.addTo(r,e),e}u(MY,"bnAdd");function wY(r){var e=Ir();return this.subTo(r,e),e}u(wY,"bnSubtract");function TY(r){var e=Ir();return this.multiplyTo(r,e),e}u(TY,"bnMultiply");function PY(){var r=Ir();return this.squareTo(r),r}u(PY,"bnSquare");function EY(r){var e=Ir();return this.divRemTo(r,e,null),e}u(EY,"bnDivide");function OY(r){var e=Ir();return this.divRemTo(r,null,e),e}u(OY,"bnRemainder");function DY(r){var e=Ir(),t=Ir();return this.divRemTo(r,e,t),new Array(e,t)}u(DY,"bnDivideAndRemainder");function LY(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}u(LY,"bnpDMultiply");function AY(r,e){if(r!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=r;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}u(AY,"bnpDAddOffset");function Dy(){}u(Dy,"NullExp");function sO(r){return r}u(sO,"nNop");function NY(r,e,t){r.multiplyTo(e,t)}u(NY,"nMulTo");function kY(r,e){r.squareTo(e)}u(kY,"nSqrTo");Dy.prototype.convert=sO;Dy.prototype.revert=sO;Dy.prototype.mulTo=NY;Dy.prototype.sqrTo=kY;function RY(r){return this.exp(r,new Dy)}u(RY,"bnPow");function FY(r,e,t){var n=Math.min(this.t+r.t,e);for(t.s=0,t.t=n;n>0;)t[--n]=0;var i;for(i=t.t-this.t;n<i;++n)t[n+this.t]=this.am(0,r[n],t,n,0,this.t);for(i=Math.min(r.t,e);n<i;++n)this.am(0,r[n],t,n,0,e-n);t.clamp()}u(FY,"bnpMultiplyLowerTo");function BY(r,e,t){--e;var n=t.t=this.t+r.t-e;for(t.s=0;--n>=0;)t[n]=0;for(n=Math.max(e-this.t,0);n<r.t;++n)t[this.t+n-e]=this.am(e-n,r[n],t,0,0,this.t+n-e);t.clamp(),t.drShiftTo(1,t)}u(BY,"bnpMultiplyUpperTo");function Wd(r){this.r2=Ir(),this.q3=Ir(),_t.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}u(Wd,"Barrett");function GY(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var e=Ir();return r.copyTo(e),this.reduce(e),e}u(GY,"barrettConvert");function VY(r){return r}u(VY,"barrettRevert");function jY(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)}u(jY,"barrettReduce");function UY(r,e){r.squareTo(e),this.reduce(e)}u(UY,"barrettSqrTo");function zY(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(zY,"barrettMulTo");Wd.prototype.convert=GY;Wd.prototype.revert=VY;Wd.prototype.reduce=jY;Wd.prototype.mulTo=zY;Wd.prototype.sqrTo=UY;function HY(r,e){var t=r.bitLength(),n,i=Ec(1),a;if(t<=0)return i;t<18?n=1:t<48?n=3:t<144?n=4:t<768?n=5:n=6,t<8?a=new kh(e):e.isEven()?a=new Wd(e):a=new Rh(e);var l=new Array,h=3,d=n-1,m=(1<<n)-1;if(l[1]=a.convert(this),n>1){var v=Ir();for(a.sqrTo(l[1],v);h<=m;)l[h]=Ir(),a.mulTo(v,l[h-2],l[h]),h+=2}var x=r.t-1,S,I=!0,w=Ir(),P;for(t=Zb(r[x])-1;x>=0;){for(t>=d?S=r[x]>>t-d&m:(S=(r[x]&(1<<t+1)-1)<<d-t,x>0&&(S|=r[x-1]>>this.DB+t-d)),h=n;(S&1)==0;)S>>=1,--h;if((t-=h)<0&&(t+=this.DB,--x),I)l[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):(P=i,i=w,w=P),a.mulTo(w,l[S],i)}for(;x>=0&&(r[x]&1<<t)==0;)a.sqrTo(i,w),P=i,i=w,w=P,--t<0&&(t=this.DB-1,--x)}return a.revert(i)}u(HY,"bnModPow");function XY(r){var e=this.s<0?this.negate():this.clone(),t=r.s<0?r.negate():r.clone();if(e.compareTo(t)<0){var n=e;e=t,t=n}var i=e.getLowestSetBit(),a=t.getLowestSetBit();if(a<0)return e;for(i<a&&(a=i),a>0&&(e.rShiftTo(a,e),t.rShiftTo(a,t));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return a>0&&t.lShiftTo(a,t),t}u(XY,"bnGCD");function YY(r){if(r<=0)return 0;var e=this.DV%r,t=this.s<0?r-1:0;if(this.t>0)if(e==0)t=this[0]%r;else for(var n=this.t-1;n>=0;--n)t=(e*t+this[n])%r;return t}u(YY,"bnpModInt");function qY(r){var e=r.isEven();if(this.isEven()&&e||r.signum()==0)return _t.ZERO;for(var t=r.clone(),n=this.clone(),i=Ec(1),a=Ec(0),l=Ec(0),h=Ec(1);t.signum()!=0;){for(;t.isEven();)t.rShiftTo(1,t),e?((!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),e?((!l.isEven()||!h.isEven())&&(l.addTo(this,l),h.subTo(r,h)),l.rShiftTo(1,l)):h.isEven()||h.subTo(r,h),h.rShiftTo(1,h);t.compareTo(n)>=0?(t.subTo(n,t),e&&i.subTo(l,i),a.subTo(h,a)):(n.subTo(t,n),e&&l.subTo(i,l),h.subTo(a,h))}if(n.compareTo(_t.ONE)!=0)return _t.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}u(qY,"bnModInverse");var Io=[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],WY=(1<<26)/Io[Io.length-1];function ZY(r){var e,t=this.abs();if(t.t==1&&t[0]<=Io[Io.length-1]){for(e=0;e<Io.length;++e)if(t[0]==Io[e])return!0;return!1}if(t.isEven())return!1;for(e=1;e<Io.length;){for(var n=Io[e],i=e+1;i<Io.length&&n<WY;)n*=Io[i++];for(n=t.modInt(n);e<i;)if(n%Io[e++]==0)return!1}return t.millerRabin(r)}u(ZY,"bnIsProbablePrime");function $Y(r){var e=this.subtract(_t.ONE),t=e.getLowestSetBit();if(t<=0)return!1;var n=e.shiftRight(t);r=r+1>>1,r>Io.length&&(r=Io.length);for(var i=Ir(),a=0;a<r;++a){i.fromInt(Io[Math.floor(Math.random()*Io.length)]);var l=i.modPow(n,this);if(l.compareTo(_t.ONE)!=0&&l.compareTo(e)!=0){for(var h=1;h++<t&&l.compareTo(e)!=0;)if(l=l.modPowInt(2,this),l.compareTo(_t.ONE)==0)return!1;if(l.compareTo(e)!=0)return!1}}return!0}u($Y,"bnpMillerRabin");_t.prototype.chunkSize=JX;_t.prototype.toRadix=QX;_t.prototype.fromRadix=tY;_t.prototype.fromNumber=eY;_t.prototype.bitwiseTo=sY;_t.prototype.changeBit=xY;_t.prototype.addTo=IY;_t.prototype.dMultiply=LY;_t.prototype.dAddOffset=AY;_t.prototype.multiplyLowerTo=FY;_t.prototype.multiplyUpperTo=BY;_t.prototype.modInt=YY;_t.prototype.millerRabin=$Y;_t.prototype.clone=qX;_t.prototype.intValue=WX;_t.prototype.byteValue=ZX;_t.prototype.shortValue=$X;_t.prototype.signum=KX;_t.prototype.toByteArray=rY;_t.prototype.equals=nY;_t.prototype.min=iY;_t.prototype.max=oY;_t.prototype.and=lY;_t.prototype.or=uY;_t.prototype.xor=cY;_t.prototype.andNot=pY;_t.prototype.not=hY;_t.prototype.shiftLeft=fY;_t.prototype.shiftRight=dY;_t.prototype.getLowestSetBit=gY;_t.prototype.bitCount=vY;_t.prototype.testBit=bY;_t.prototype.setBit=_Y;_t.prototype.clearBit=CY;_t.prototype.flipBit=SY;_t.prototype.add=MY;_t.prototype.subtract=wY;_t.prototype.multiply=TY;_t.prototype.divide=EY;_t.prototype.remainder=OY;_t.prototype.divideAndRemainder=DY;_t.prototype.modPow=HY;_t.prototype.modInverse=qY;_t.prototype.pow=RY;_t.prototype.gcd=XY;_t.prototype.isProbablePrime=ZY;_t.prototype.square=PY;var Ke=_t;Ke.prototype.IsNegative=function(){return this.compareTo(Ke.ZERO)==-1};Ke.op_Equality=function(r,e){return r.compareTo(e)==0};Ke.op_Inequality=function(r,e){return r.compareTo(e)!=0};Ke.op_GreaterThan=function(r,e){return r.compareTo(e)>0};Ke.op_LessThan=function(r,e){return r.compareTo(e)<0};Ke.op_Addition=function(r,e){return new Ke(r).add(new Ke(e))};Ke.op_Subtraction=function(r,e){return new Ke(r).subtract(new Ke(e))};Ke.Int128Mul=function(r,e){return new Ke(r).multiply(new Ke(e))};Ke.op_Division=function(r,e){return r.divide(e)};Ke.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof qb>"u"&&(qb=u(function(r,e){var t;if(typeof Object.getOwnPropertyNames>"u"){for(t in e.prototype)(typeof r.prototype[t]>"u"||r.prototype[t]==Object.prototype[t])&&(r.prototype[t]=e.prototype[t]);for(t in e)typeof r[t]>"u"&&(r[t]=e[t]);r.$baseCtor=e}else{for(var n=Object.getOwnPropertyNames(e.prototype),i=0;i<n.length;i++)typeof Object.getOwnPropertyDescriptor(r.prototype,n[i])>"u"&&Object.defineProperty(r.prototype,n[i],Object.getOwnPropertyDescriptor(e.prototype,n[i]));for(t in e)typeof r[t]>"u"&&(r[t]=e[t]);r.$baseCtor=e}},"Inherit"));var qb;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,e){this.X=r,this.Y=e};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,e=this.m_Parent;e!==null;)r=!r,e=e.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 e=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=e};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,e=this.m_AllPolys.length;r<e;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};qb(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,e){return Math.max(r,e)};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,e=r.length;if(this.X=0,this.Y=0,Nh)if(this.Z=0,e==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(e==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(e==1)if(r[0]instanceof C.DoublePoint){var t=r[0];this.X=C.Clipper.Round(t.X),this.Y=C.Clipper.Round(t.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(e==2)this.X=r[0],this.Y=r[1];else if(e==1)if(r[0]instanceof C.DoublePoint){var t=r[0];this.X=C.Clipper.Round(t.X),this.Y=C.Clipper.Round(t.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,e){return r.X==e.X&&r.Y==e.Y};C.IntPoint.op_Inequality=function(r,e){return r.X!=e.X||r.Y!=e.Y};Nh?(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,e){this.X=r,this.Y=e,this.Z=0},C.IntPoint3=function(r,e,t){this.X=r,this.Y=e,this.Z=t}):(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,e){this.X=r,this.Y=e});C.IntRect=function(){var r=arguments,e=r.length;e==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[3]):e==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};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,e,t,n){this.left=r,this.top=e,this.right=t,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};eO&&(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,e){return e.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;uX?(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,e){var t=e;do{if(C.IntPoint.op_Equality(t.Pt,r))return!0;t=t.Next}while(t!=e);return!1};C.ClipperBase.prototype.PointOnLineSegment=function(r,e,t,n){return n?r.X==e.X&&r.Y==e.Y||r.X==t.X&&r.Y==t.Y||r.X>e.X==r.X<t.X&&r.Y>e.Y==r.Y<t.Y&&Ke.op_Equality(Ke.Int128Mul(r.X-e.X,t.Y-e.Y),Ke.Int128Mul(t.X-e.X,r.Y-e.Y)):r.X==e.X&&r.Y==e.Y||r.X==t.X&&r.Y==t.Y||r.X>e.X==r.X<t.X&&r.Y>e.Y==r.Y<t.Y&&(r.X-e.X)*(t.Y-e.Y)==(t.X-e.X)*(r.Y-e.Y)};C.ClipperBase.prototype.PointOnPolygon=function(r,e,t){for(var n=e;;){if(this.PointOnLineSegment(r,n.Pt,n.Next.Pt,t))return!0;if(n=n.Next,n==e)break}return!1};C.ClipperBase.prototype.SlopesEqual=C.ClipperBase.SlopesEqual=function(){var r=arguments,e=r.length,t,n,i,a,l,h,d;return e==3?(t=r[0],n=r[1],d=r[2],d?Ke.op_Equality(Ke.Int128Mul(t.Delta.Y,n.Delta.X),Ke.Int128Mul(t.Delta.X,n.Delta.Y)):C.Cast_Int64(t.Delta.Y*n.Delta.X)==C.Cast_Int64(t.Delta.X*n.Delta.Y)):e==4?(i=r[0],a=r[1],l=r[2],d=r[3],d?Ke.op_Equality(Ke.Int128Mul(i.Y-a.Y,a.X-l.X),Ke.Int128Mul(i.X-a.X,a.Y-l.Y)):C.Cast_Int64((i.Y-a.Y)*(a.X-l.X))-C.Cast_Int64((i.X-a.X)*(a.Y-l.Y))===0):(i=r[0],a=r[1],l=r[2],h=r[3],d=r[4],d?Ke.op_Equality(Ke.Int128Mul(i.Y-a.Y,l.X-h.X),Ke.Int128Mul(i.X-a.X,l.Y-h.Y)):C.Cast_Int64((i.Y-a.Y)*(l.X-h.X))-C.Cast_Int64((i.X-a.X)*(l.Y-h.Y))===0)};C.ClipperBase.SlopesEqual3=function(r,e,t){return t?Ke.op_Equality(Ke.Int128Mul(r.Delta.Y,e.Delta.X),Ke.Int128Mul(r.Delta.X,e.Delta.Y)):C.Cast_Int64(r.Delta.Y*e.Delta.X)==C.Cast_Int64(r.Delta.X*e.Delta.Y)};C.ClipperBase.SlopesEqual4=function(r,e,t,n){return n?Ke.op_Equality(Ke.Int128Mul(r.Y-e.Y,e.X-t.X),Ke.Int128Mul(r.X-e.X,e.Y-t.Y)):C.Cast_Int64((r.Y-e.Y)*(e.X-t.X))-C.Cast_Int64((r.X-e.X)*(e.Y-t.Y))===0};C.ClipperBase.SlopesEqual5=function(r,e,t,n,i){return i?Ke.op_Equality(Ke.Int128Mul(r.Y-e.Y,t.X-n.X),Ke.Int128Mul(r.X-e.X,t.Y-n.Y)):C.Cast_Int64((r.Y-e.Y)*(t.X-n.X))-C.Cast_Int64((r.X-e.X)*(t.Y-n.Y))===0};C.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,e=this.m_edges.length;r<e;++r){for(var t=0,n=this.m_edges[r].length;t<n;++t)this.m_edges[r][t]=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,e){e.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)&&(e.Value=!0,this.RangeTest(r,e))};C.ClipperBase.prototype.InitEdge=function(r,e,t,n){r.Next=e,r.Prev=t,r.Curr.X=n.X,r.Curr.Y=n.Y,r.OutIdx=-1};C.ClipperBase.prototype.InitEdge2=function(r,e){r.Curr.Y>=r.Next.Curr.Y?(r.Bot.X=r.Curr.X,r.Bot.Y=r.Curr.Y,r.Top.X=r.Next.Curr.X,r.Top.Y=r.Next.Curr.Y):(r.Top.X=r.Curr.X,r.Top.Y=r.Curr.Y,r.Bot.X=r.Next.Curr.X,r.Bot.Y=r.Next.Curr.Y),this.SetDx(r),r.PolyTyp=e};C.ClipperBase.prototype.FindNextLocMin=function(r){for(var e;;){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(e=r;r.Dx==C.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){e.Prev.Bot.X<r.Bot.X&&(r=e);break}}return r};C.ClipperBase.prototype.ProcessBound=function(r,e){var t=r,n=r,i,a;if(r.Dx==C.ClipperBase.horizontal&&(e?a=r.Prev.Bot.X:a=r.Next.Bot.X,r.Bot.X!=a&&this.ReverseHorizontal(r)),n.OutIdx!=C.ClipperBase.Skip)if(e){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?e||(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!=t&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==C.ClipperBase.horizontal&&r!=t&&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?e||(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!=t&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==C.ClipperBase.horizontal&&r!=t&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),n=n.Prev}if(n.OutIdx==C.ClipperBase.Skip){if(r=n,e){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)e?n=r.Next:n=r.Prev;else{e?r=n.Next:r=n.Prev;var l=new C.LocalMinima;l.Next=null,l.Y=r.Bot.Y,l.LeftBound=null,l.RightBound=r,l.RightBound.WindDelta=0,n=this.ProcessBound(l.RightBound,e),this.InsertLocalMinima(l)}}return n};C.ClipperBase.prototype.AddPath=function(r,e,t){tO?!t&&e==C.PolyType.ptClip&&C.Error("AddPath: Open paths must be subject."):t||C.Error("AddPath: Open paths have been disabled.");var n=r.length-1;if(t)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(t&&n<2||!t&&n<1)return!1;for(var i=new Array,a=0;a<=n;a++)i.push(new C.TEdge);var l=!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(t&&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(!t&&m==m.Next||t&&m.Prev==m.Next)return!1;t||(this.m_HasOpenPaths=!0,d.Prev.OutIdx=C.ClipperBase.Skip);var x=d;m=d;do this.InitEdge2(m,e),m=m.Next,l&&m.Curr.Y!=d.Curr.Y&&(l=!1);while(m!=d);if(l){if(t)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,t?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 P=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=P)}return!0};C.ClipperBase.prototype.AddPaths=function(r,e,t){for(var n=!1,i=0,a=r.length;i<a;++i)this.AddPath(r[i],e,t)&&(n=!0);return n};C.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,e,t){return C.IntPoint.op_Equality(r,t)||C.IntPoint.op_Equality(r,e)||C.IntPoint.op_Equality(t,e)?!1:r.X!=t.X?e.X>r.X==e.X<t.X:e.Y>r.Y==e.Y<t.Y};C.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var e=r.Next;return r.Prev=null,e};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 e=this.m_MinimaList;e.Next!==null&&r.Y<e.Next.Y;)e=e.Next;r.Next=e.Next,e.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 e=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=e,Nh&&(e=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=e)};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 e=r.LeftBound;e!=null&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=C.EdgeSide.esLeft,e.OutIdx=C.ClipperBase.Unassigned),e=r.RightBound,e!=null&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=C.EdgeSide.esRight,e.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,Nh&&(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 e=new C.Scanbeam;e.Y=r,e.Next=this.m_Scanbeam,this.m_Scanbeam=e}else{for(var t=this.m_Scanbeam;t.Next!==null&&r<=t.Next.Y;)t=t.Next;if(r==t.Y)return;var e=new C.Scanbeam;e.Y=r,e.Next=t.Next,t.Next=e}};C.Clipper.prototype.Execute=function(){var r=arguments,e=r.length,t=r[1]instanceof C.PolyTree;if(e==4&&!t){var n=r[0],i=r[1],a=r[2],l=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=l,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(e==4&&t){var n=r[0],d=r[1],a=r[2],l=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=a,this.m_ClipFillType=l,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(e==2&&!t){var n=r[0],i=r[1];return this.Execute(n,i,C.PolyFillType.pftEvenOdd,C.PolyFillType.pftEvenOdd)}else if(e==2&&t){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 e=r.FirstLeft;e!==null&&(e.IsHole==r.IsHole||e.Pts===null);)e=e.FirstLeft;r.FirstLeft=e}};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 e=this.PopScanbeam();if(!this.ProcessIntersections(r,e))return!1;this.ProcessEdgesAtTopOfScanbeam(e),r=e}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var t=0,n=this.m_PolyOuts.length;t<n;t++){var i=this.m_PolyOuts[t];i.Pts===null||i.IsOpen||(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)}this.JoinCommonEdges();for(var t=0,n=this.m_PolyOuts.length;t<n;t++){var i=this.m_PolyOuts[t];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,e=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,e=null,r};C.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,e=this.m_PolyOuts.length;r<e;++r)this.DisposeOutRec(r);C.Clear(this.m_PolyOuts)};C.Clipper.prototype.DisposeOutRec=function(r){var e=this.m_PolyOuts[r];e.Pts!==null&&this.DisposeOutPts(e.Pts),e=null,this.m_PolyOuts[r]=null};C.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var e=null;for(r.Prev.Next=null;r!==null;)e=r,r=r.Next,e=null}};C.Clipper.prototype.AddJoin=function(r,e,t){var n=new C.Join;n.OutPt1=r,n.OutPt2=e,n.OffPt.X=t.X,n.OffPt.Y=t.Y,this.m_Joins.push(n)};C.Clipper.prototype.AddGhostJoin=function(r,e){var t=new C.Join;t.OutPt1=r,t.OffPt.X=e.X,t.OffPt.Y=e.Y,this.m_GhostJoins.push(t)};Nh&&(C.Clipper.prototype.SetZ=function(r,e){r.Z=0,this.ZFillFunction!==null&&(e.OutIdx<0?this.ZFillFunction(e.Bot,e.Top,r):this.ZFillFunction(e.Top,e.Bot,r))});C.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var e=this.m_CurrentLM.LeftBound,t=this.m_CurrentLM.RightBound;this.PopLocalMinima();var n=null;if(e===null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(n=this.AddOutPt(t,t.Bot))):t==null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(n=this.AddOutPt(e,e.Bot)),this.InsertScanbeam(e.Top.Y)):(this.InsertEdgeIntoAEL(e,null),this.InsertEdgeIntoAEL(t,e),this.SetWindingCount(e),t.WindCnt=e.WindCnt,t.WindCnt2=e.WindCnt2,this.IsContributing(e)&&(n=this.AddLocalMinPoly(e,t,e.Bot)),this.InsertScanbeam(e.Top.Y)),t!=null&&(C.ClipperBase.IsHorizontal(t)?this.AddEdgeToSEL(t):this.InsertScanbeam(t.Top.Y)),!(e==null||t==null)){if(n!==null&&C.ClipperBase.IsHorizontal(t)&&this.m_GhostJoins.length>0&&t.WindDelta!==0)for(var i=0,a=this.m_GhostJoins.length;i<a;i++){var l=this.m_GhostJoins[i];this.HorzSegmentsOverlap(l.OutPt1.Pt,l.OffPt,t.Bot,t.Top)&&this.AddJoin(l.OutPt1,n,l.OffPt)}if(e.OutIdx>=0&&e.PrevInAEL!==null&&e.PrevInAEL.Curr.X==e.Bot.X&&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)}if(e.NextInAEL!=t){if(t.OutIdx>=0&&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)}var d=e.NextInAEL;if(d!==null)for(;d!=t;)this.IntersectEdges(t,d,e.Curr,!1),d=d.NextInAEL}}}};C.Clipper.prototype.InsertEdgeIntoAEL=function(r,e){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(e===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,r))r.PrevInAEL=null,r.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=r,this.m_ActiveEdges=r;else{for(e===null&&(e=this.m_ActiveEdges);e.NextInAEL!==null&&!this.E2InsertsBeforeE1(e.NextInAEL,r);)e=e.NextInAEL;r.NextInAEL=e.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=r),r.PrevInAEL=e,e.NextInAEL=r}};C.Clipper.prototype.E2InsertsBeforeE1=function(r,e){return e.Curr.X==r.Curr.X?e.Top.Y>r.Top.Y?e.Top.X<C.Clipper.TopX(r,e.Top.Y):r.Top.X>C.Clipper.TopX(e,r.Top.Y):e.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 e,t;switch(r.PolyTyp==C.PolyType.ptSubject?(e=this.m_SubjFillType,t=this.m_ClipFillType):(e=this.m_ClipFillType,t=this.m_SubjFillType),e){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(t){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(t){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(t){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(t){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(t){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 e=r.PrevInAEL;e!==null&&(e.PolyTyp!=r.PolyTyp||e.WindDelta===0);)e=e.PrevInAEL;if(e===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,e=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=C.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=e.WindCnt2,e=e.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var t=!0,n=e.PrevInAEL;n!==null;)n.PolyTyp==e.PolyTyp&&n.WindDelta!==0&&(t=!t),n=n.PrevInAEL;r.WindCnt=t?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=e.WindCnt2,e=e.NextInAEL}else e.WindCnt*e.WindDelta<0?Math.abs(e.WindCnt)>1?e.WindDelta*r.WindDelta<0?r.WindCnt=e.WindCnt:r.WindCnt=e.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=e.WindCnt<0?e.WindCnt-1:e.WindCnt+1:e.WindDelta*r.WindDelta<0?r.WindCnt=e.WindCnt:r.WindCnt=e.WindCnt+r.WindDelta,r.WindCnt2=e.WindCnt2,e=e.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;e!=r;)e.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),e=e.NextInAEL;else for(;e!=r;)r.WindCnt2+=e.WindDelta,e=e.NextInAEL};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,e){if(!(r.NextInAEL==r.PrevInAEL||e.NextInAEL==e.PrevInAEL)){if(r.NextInAEL==e){var t=e.NextInAEL;t!==null&&(t.PrevInAEL=r);var n=r.PrevInAEL;n!==null&&(n.NextInAEL=e),e.PrevInAEL=n,e.NextInAEL=r,r.PrevInAEL=e,r.NextInAEL=t}else if(e.NextInAEL==r){var t=r.NextInAEL;t!==null&&(t.PrevInAEL=e);var n=e.PrevInAEL;n!==null&&(n.NextInAEL=r),r.PrevInAEL=n,r.NextInAEL=e,e.PrevInAEL=r,e.NextInAEL=t}else{var t=r.NextInAEL,n=r.PrevInAEL;r.NextInAEL=e.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=e.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),e.NextInAEL=t,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=n,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e)}r.PrevInAEL===null?this.m_ActiveEdges=r:e.PrevInAEL===null&&(this.m_ActiveEdges=e)}};C.Clipper.prototype.SwapPositionsInSEL=function(r,e){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(e.NextInSEL===null&&e.PrevInSEL===null)){if(r.NextInSEL==e){var t=e.NextInSEL;t!==null&&(t.PrevInSEL=r);var n=r.PrevInSEL;n!==null&&(n.NextInSEL=e),e.PrevInSEL=n,e.NextInSEL=r,r.PrevInSEL=e,r.NextInSEL=t}else if(e.NextInSEL==r){var t=r.NextInSEL;t!==null&&(t.PrevInSEL=e);var n=e.PrevInSEL;n!==null&&(n.NextInSEL=r),r.PrevInSEL=n,r.NextInSEL=e,e.PrevInSEL=r,e.NextInSEL=t}else{var t=r.NextInSEL,n=r.PrevInSEL;r.NextInSEL=e.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=e.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),e.NextInSEL=t,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=n,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e)}r.PrevInSEL===null?this.m_SortedEdges=r:e.PrevInSEL===null&&(this.m_SortedEdges=e)}};C.Clipper.prototype.AddLocalMaxPoly=function(r,e,t){this.AddOutPt(r,t),e.WindDelta==0&&this.AddOutPt(e,t),r.OutIdx==e.OutIdx?(r.OutIdx=-1,e.OutIdx=-1):r.OutIdx<e.OutIdx?this.AppendPolygon(r,e):this.AppendPolygon(e,r)};C.Clipper.prototype.AddLocalMinPoly=function(r,e,t){var n,i,a;if(C.ClipperBase.IsHorizontal(e)||r.Dx>e.Dx?(n=this.AddOutPt(r,t),e.OutIdx=r.OutIdx,r.Side=C.EdgeSide.esLeft,e.Side=C.EdgeSide.esRight,i=r,i.PrevInAEL==e?a=e.PrevInAEL:a=i.PrevInAEL):(n=this.AddOutPt(e,t),r.OutIdx=e.OutIdx,r.Side=C.EdgeSide.esRight,e.Side=C.EdgeSide.esLeft,i=e,i.PrevInAEL==r?a=r.PrevInAEL:a=i.PrevInAEL),a!==null&&a.OutIdx>=0&&C.Clipper.TopX(a,t.Y)==C.Clipper.TopX(i,t.Y)&&C.ClipperBase.SlopesEqual(i,a,this.m_UseFullRange)&&i.WindDelta!==0&&a.WindDelta!==0){var l=this.AddOutPt(a,t);this.AddJoin(n,l,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,e){var t=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=e.X,i.Pt.Y=e.Y,i.Next=i,i.Prev=i,n.IsOpen||this.SetHoleState(r,n),Nh&&(C.IntPoint.op_Equality(e,r.Bot)?(i.Pt.X=r.Bot.X,i.Pt.Y=r.Bot.Y,i.Pt.Z=r.Bot.Z):C.IntPoint.op_Equality(e,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(t&&C.IntPoint.op_Equality(e,a.Pt))return a;if(!t&&C.IntPoint.op_Equality(e,a.Prev.Pt))return a.Prev;var i=new C.OutPt;return i.Idx=n.Idx,i.Pt.X=e.X,i.Pt.Y=e.Y,i.Next=a,i.Prev=a.Prev,i.Prev.Next=i,a.Prev=i,t&&(n.Pts=i),Nh&&(C.IntPoint.op_Equality(e,r.Bot)?(i.Pt.X=r.Bot.X,i.Pt.Y=r.Bot.Y,i.Pt.Z=r.Bot.Z):C.IntPoint.op_Equality(e,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,e){var t=new C.IntPoint(r.Value);r.Value.X=e.Value.X,r.Value.Y=e.Value.Y,e.Value.X=t.X,e.Value.Y=t.Y};C.Clipper.prototype.HorzSegmentsOverlap=function(r,e,t,n){return r.X>t.X==r.X<n.X||e.X>t.X==e.X<n.X||t.X>r.X==t.X<e.X||n.X>r.X==n.X<e.X||r.X==t.X&&e.X==n.X?!0:r.X==n.X&&e.X==t.X};C.Clipper.prototype.InsertPolyPtBetween=function(r,e,t){var n=new C.OutPt;return n.Pt.X=t.X,n.Pt.Y=t.Y,e==r.Next?(r.Next=n,e.Prev=n,n.Next=e,n.Prev=r):(e.Next=n,r.Prev=n,n.Next=r,n.Prev=e),n};C.Clipper.prototype.SetHoleState=function(r,e){for(var t=!1,n=r.PrevInAEL;n!==null;)n.OutIdx>=0&&n.WindDelta!=0&&(t=!t,e.FirstLeft===null&&(e.FirstLeft=this.m_PolyOuts[n.OutIdx])),n=n.PrevInAEL;t&&(e.IsHole=!0)};C.Clipper.prototype.GetDx=function(r,e){return r.Y==e.Y?C.ClipperBase.horizontal:(e.X-r.X)/(e.Y-r.Y)};C.Clipper.prototype.FirstIsBottomPt=function(r,e){for(var t=r.Prev;C.IntPoint.op_Equality(t.Pt,r.Pt)&&t!=r;)t=t.Prev;var n=Math.abs(this.GetDx(r.Pt,t.Pt));for(t=r.Next;C.IntPoint.op_Equality(t.Pt,r.Pt)&&t!=r;)t=t.Next;var i=Math.abs(this.GetDx(r.Pt,t.Pt));for(t=e.Prev;C.IntPoint.op_Equality(t.Pt,e.Pt)&&t!=e;)t=t.Prev;var a=Math.abs(this.GetDx(e.Pt,t.Pt));for(t=e.Next;C.IntPoint.op_Equality(t.Pt,e.Pt)&&t!=e;)t=t.Next;var l=Math.abs(this.GetDx(e.Pt,t.Pt));return n>=a&&n>=l||i>=a&&i>=l};C.Clipper.prototype.GetBottomPt=function(r){for(var e=null,t=r.Next;t!=r;)t.Pt.Y>r.Pt.Y?(r=t,e=null):t.Pt.Y==r.Pt.Y&&t.Pt.X<=r.Pt.X&&(t.Pt.X<r.Pt.X?(e=null,r=t):t.Next!=r&&t.Prev!=r&&(e=t)),t=t.Next;if(e!==null)for(;e!=t;)for(this.FirstIsBottomPt(t,e)||(r=e),e=e.Next;C.IntPoint.op_Inequality(e.Pt,r.Pt);)e=e.Next;return r};C.Clipper.prototype.GetLowermostRec=function(r,e){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts));var t=r.BottomPt,n=e.BottomPt;return t.Pt.Y>n.Pt.Y?r:t.Pt.Y<n.Pt.Y?e:t.Pt.X<n.Pt.X?r:t.Pt.X>n.Pt.X||t.Next==t?e:n.Next==n||this.FirstIsBottomPt(t,n)?r:e};C.Clipper.prototype.Param1RightOfParam2=function(r,e){do if(r=r.FirstLeft,r==e)return!0;while(r!==null);return!1};C.Clipper.prototype.GetOutRec=function(r){for(var e=this.m_PolyOuts[r];e!=this.m_PolyOuts[e.Idx];)e=this.m_PolyOuts[e.Idx];return e};C.Clipper.prototype.AppendPolygon=function(r,e){var t=this.m_PolyOuts[r.OutIdx],n=this.m_PolyOuts[e.OutIdx],i;this.Param1RightOfParam2(t,n)?i=n:this.Param1RightOfParam2(n,t)?i=t:i=this.GetLowermostRec(t,n);var a=t.Pts,l=a.Prev,h=n.Pts,d=h.Prev,m;r.Side==C.EdgeSide.esLeft?(e.Side==C.EdgeSide.esLeft?(this.ReversePolyPtLinks(h),h.Next=a,a.Prev=h,l.Next=d,d.Prev=l,t.Pts=d):(d.Next=a,a.Prev=d,h.Prev=l,l.Next=h,t.Pts=h),m=C.EdgeSide.esLeft):(e.Side==C.EdgeSide.esRight?(this.ReversePolyPtLinks(h),l.Next=d,d.Prev=l,h.Next=a,a.Prev=h):(l.Next=h,h.Prev=l,a.Prev=d,d.Next=a),m=C.EdgeSide.esRight),t.BottomPt=null,i==n&&(n.FirstLeft!=t&&(t.FirstLeft=n.FirstLeft),t.IsHole=n.IsHole),n.Pts=null,n.BottomPt=null,n.FirstLeft=t;var v=r.OutIdx,x=e.OutIdx;r.OutIdx=-1,e.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=t.Idx};C.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var e,t;e=r;do t=e.Next,e.Next=e.Prev,e.Prev=t,e=t;while(e!=r)}};C.Clipper.SwapSides=function(r,e){var t=r.Side;r.Side=e.Side,e.Side=t};C.Clipper.SwapPolyIndexes=function(r,e){var t=r.OutIdx;r.OutIdx=e.OutIdx,e.OutIdx=t};C.Clipper.prototype.IntersectEdges=function(r,e,t,n){var i=!n&&r.NextInLML===null&&r.Top.X==t.X&&r.Top.Y==t.Y,a=!n&&e.NextInLML===null&&e.Top.X==t.X&&e.Top.Y==t.Y,l=r.OutIdx>=0,h=e.OutIdx>=0;if(tO&&(r.WindDelta===0||e.WindDelta===0)){r.WindDelta===0&&e.WindDelta===0?(i||a)&&l&&h&&this.AddLocalMaxPoly(r,e,t):r.PolyTyp==e.PolyTyp&&r.WindDelta!=e.WindDelta&&this.m_ClipType==C.ClipType.ctUnion?r.WindDelta===0?h&&(this.AddOutPt(r,t),l&&(r.OutIdx=-1)):l&&(this.AddOutPt(e,t),h&&(e.OutIdx=-1)):r.PolyTyp!=e.PolyTyp&&(r.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=C.ClipType.ctUnion||e.WindCnt2===0)?(this.AddOutPt(r,t),l&&(r.OutIdx=-1)):e.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=C.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(e,t),h&&(e.OutIdx=-1))),i&&(r.OutIdx<0?this.DeleteFromAEL(r):C.Error("Error intersecting polylines")),a&&(e.OutIdx<0?this.DeleteFromAEL(e):C.Error("Error intersecting polylines"));return}if(r.PolyTyp==e.PolyTyp)if(this.IsEvenOddFillType(r)){var d=r.WindCnt;r.WindCnt=e.WindCnt,e.WindCnt=d}else r.WindCnt+e.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=e.WindDelta,e.WindCnt-r.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(e)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=e.WindDelta,this.IsEvenOddFillType(r)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2-=r.WindDelta;var 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),e.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=e.WindCnt;break;case C.PolyFillType.pftNegative:w=-e.WindCnt;break;default:w=Math.abs(e.WindCnt);break}if(l&&h)i||a||I!==0&&I!=1||w!==0&&w!=1||r.PolyTyp!=e.PolyTyp&&this.m_ClipType!=C.ClipType.ctXor?this.AddLocalMaxPoly(r,e,t):(this.AddOutPt(r,t),this.AddOutPt(e,t),C.Clipper.SwapSides(r,e),C.Clipper.SwapPolyIndexes(r,e));else if(l)(w===0||w==1)&&(this.AddOutPt(r,t),C.Clipper.SwapSides(r,e),C.Clipper.SwapPolyIndexes(r,e));else if(h)(I===0||I==1)&&(this.AddOutPt(e,t),C.Clipper.SwapSides(r,e),C.Clipper.SwapPolyIndexes(r,e));else if((I===0||I==1)&&(w===0||w==1)&&!i&&!a){var P,E;switch(x){case C.PolyFillType.pftPositive:P=r.WindCnt2;break;case C.PolyFillType.pftNegative:P=-r.WindCnt2;break;default:P=Math.abs(r.WindCnt2);break}switch(S){case C.PolyFillType.pftPositive:E=e.WindCnt2;break;case C.PolyFillType.pftNegative:E=-e.WindCnt2;break;default:E=Math.abs(e.WindCnt2);break}if(r.PolyTyp!=e.PolyTyp)this.AddLocalMinPoly(r,e,t);else if(I==1&&w==1)switch(this.m_ClipType){case C.ClipType.ctIntersection:P>0&&E>0&&this.AddLocalMinPoly(r,e,t);break;case C.ClipType.ctUnion:P<=0&&E<=0&&this.AddLocalMinPoly(r,e,t);break;case C.ClipType.ctDifference:(r.PolyTyp==C.PolyType.ptClip&&P>0&&E>0||r.PolyTyp==C.PolyType.ptSubject&&P<=0&&E<=0)&&this.AddLocalMinPoly(r,e,t);break;case C.ClipType.ctXor:this.AddLocalMinPoly(r,e,t);break}else C.Clipper.SwapSides(r,e)}i!=a&&(i&&r.OutIdx>=0||a&&e.OutIdx>=0)&&(C.Clipper.SwapSides(r,e),C.Clipper.SwapPolyIndexes(r,e)),i&&this.DeleteFromAEL(r),a&&this.DeleteFromAEL(e)};C.Clipper.prototype.DeleteFromAEL=function(r){var e=r.PrevInAEL,t=r.NextInAEL;e===null&&t===null&&r!=this.m_ActiveEdges||(e!==null?e.NextInAEL=t:this.m_ActiveEdges=t,t!==null&&(t.PrevInAEL=e),r.NextInAEL=null,r.PrevInAEL=null)};C.Clipper.prototype.DeleteFromSEL=function(r){var e=r.PrevInSEL,t=r.NextInSEL;e===null&&t===null&&r!=this.m_SortedEdges||(e!==null?e.NextInSEL=t:this.m_SortedEdges=t,t!==null&&(t.PrevInSEL=e),r.NextInSEL=null,r.PrevInSEL=null)};C.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&C.Error("UpdateEdgeIntoAEL: invalid call");var e=r.PrevInAEL,t=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,e!==null?e.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,t!==null&&(t.PrevInAEL=r.NextInLML),r.NextInLML.Side=r.Side,r.NextInLML.WindDelta=r.WindDelta,r.NextInLML.WindCnt=r.WindCnt,r.NextInLML.WindCnt2=r.WindCnt2,r=r.NextInLML,r.Curr.X=r.Bot.X,r.Curr.Y=r.Bot.Y,r.PrevInAEL=e,r.NextInAEL=t,C.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};C.Clipper.prototype.ProcessHorizontals=function(r){for(var e=this.m_SortedEdges;e!==null;)this.DeleteFromSEL(e),this.ProcessHorizontal(e,r),e=this.m_SortedEdges};C.Clipper.prototype.GetHorzDirection=function(r,e){r.Bot.X<r.Top.X?(e.Left=r.Bot.X,e.Right=r.Top.X,e.Dir=C.Direction.dLeftToRight):(e.Left=r.Top.X,e.Right=r.Bot.X,e.Dir=C.Direction.dRightToLeft)};C.Clipper.prototype.PrepareHorzJoins=function(r,e){var t=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=C.EdgeSide.esLeft&&(t=t.Prev),e&&(C.IntPoint.op_Equality(t.Pt,r.Top)?this.AddGhostJoin(t,r.Bot):this.AddGhostJoin(t,r.Top))};C.Clipper.prototype.ProcessHorizontal=function(r,e){var t={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,t);for(var n=t.Dir,i=t.Left,a=t.Right,l=r,h=null;l.NextInLML!==null&&C.ClipperBase.IsHorizontal(l.NextInLML);)l=l.NextInLML;for(l.NextInLML===null&&(h=this.GetMaximaPair(l));;){for(var d=r==l,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,e),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,e),r.NextInLML!==null&&C.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var t={Dir:n,Left:i,Right:a};this.GetHorzDirection(r,t),n=t.Dir,i=t.Left,a=t.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,e){return e==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,e){return r!==null&&r.Top.Y==e&&r.NextInLML===null};C.Clipper.prototype.IsIntermediate=function(r,e){return r.Top.Y==e&&r.NextInLML!==null};C.Clipper.prototype.GetMaximaPair=function(r){var e=null;return C.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?e=r.Next:C.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(e=r.Prev),e!==null&&(e.OutIdx==-2||e.NextInAEL==e.PrevInAEL&&!C.ClipperBase.IsHorizontal(e))?null:e};C.Clipper.prototype.ProcessIntersections=function(r,e){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,e),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch(t){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,e){if(this.m_ActiveEdges!==null){var t=this.m_ActiveEdges;for(this.m_SortedEdges=t;t!==null;)t.PrevInSEL=t.PrevInAEL,t.NextInSEL=t.NextInAEL,t.Curr.X=C.Clipper.TopX(t,e),t=t.NextInAEL;for(var n=!0;n&&this.m_SortedEdges!==null;){for(n=!1,t=this.m_SortedEdges;t.NextInSEL!==null;){var i=t.NextInSEL,a=new C.IntPoint;if(t.Curr.X>i.Curr.X){!this.IntersectPoint(t,i,a)&&t.Curr.X>i.Curr.X+1&&C.Error("Intersection error"),a.Y>r&&(a.Y=r,Math.abs(t.Dx)>Math.abs(i.Dx)?a.X=C.Clipper.TopX(i,r):a.X=C.Clipper.TopX(t,r));var l=new C.IntersectNode;l.Edge1=t,l.Edge2=i,l.Pt.X=a.X,l.Pt.Y=a.Y,this.m_IntersectList.push(l),this.SwapPositionsInSEL(t,i),n=!0}else t=i}if(t.PrevInSEL!==null)t.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,e){return e.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,e=0;e<r;e++){if(!this.EdgesAdjacent(this.m_IntersectList[e])){for(var t=e+1;t<r&&!this.EdgesAdjacent(this.m_IntersectList[t]);)t++;if(t==r)return!1;var n=this.m_IntersectList[e];this.m_IntersectList[e]=this.m_IntersectList[t],this.m_IntersectList[t]=n}this.SwapPositionsInSEL(this.m_IntersectList[e].Edge1,this.m_IntersectList[e].Edge2)}return!0};C.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,e=this.m_IntersectList.length;r<e;r++){var t=this.m_IntersectList[r];this.IntersectEdges(t.Edge1,t.Edge2,t.Pt,!0),this.SwapPositionsInAEL(t.Edge1,t.Edge2)}this.m_IntersectList.length=0};var JY=u(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),KY=u(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),QY=u(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),tq=u(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=JY:dr.chromium?C.Clipper.Round=QY:dr.safari?C.Clipper.Round=tq:C.Clipper.Round=KY;C.Clipper.TopX=function(r,e){return e==r.Top.Y?r.Top.X:r.Bot.X+C.Clipper.Round(r.Dx*(e-r.Bot.Y))};C.Clipper.prototype.IntersectPoint=function(r,e,t){t.X=0,t.Y=0;var n,i;if(C.ClipperBase.SlopesEqual(r,e,this.m_UseFullRange)||r.Dx==e.Dx)return e.Bot.Y>r.Bot.Y?(t.X=e.Bot.X,t.Y=e.Bot.Y):(t.X=r.Bot.X,t.Y=r.Bot.Y),!1;if(r.Delta.X===0)t.X=r.Bot.X,C.ClipperBase.IsHorizontal(e)?t.Y=e.Bot.Y:(i=e.Bot.Y-e.Bot.X/e.Dx,t.Y=C.Clipper.Round(t.X/e.Dx+i));else if(e.Delta.X===0)t.X=e.Bot.X,C.ClipperBase.IsHorizontal(r)?t.Y=r.Bot.Y:(n=r.Bot.Y-r.Bot.X/r.Dx,t.Y=C.Clipper.Round(t.X/r.Dx+n));else{n=r.Bot.X-r.Bot.Y*r.Dx,i=e.Bot.X-e.Bot.Y*e.Dx;var a=(i-n)/(r.Dx-e.Dx);t.Y=C.Clipper.Round(a),Math.abs(r.Dx)<Math.abs(e.Dx)?t.X=C.Clipper.Round(r.Dx*a+n):t.X=C.Clipper.Round(e.Dx*a+i)}if(t.Y<r.Top.Y||t.Y<e.Top.Y){if(r.Top.Y>e.Top.Y)return t.Y=r.Top.Y,t.X=C.Clipper.TopX(e,r.Top.Y),t.X<r.Top.X;t.Y=e.Top.Y,Math.abs(r.Dx)<Math.abs(e.Dx)?t.X=C.Clipper.TopX(r,t.Y):t.X=C.Clipper.TopX(e,t.Y)}return!0};C.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var e=this.m_ActiveEdges;e!==null;){var t=this.IsMaxima(e,r);if(t){var n=this.GetMaximaPair(e);t=n===null||!C.ClipperBase.IsHorizontal(n)}if(t){var i=e.PrevInAEL;this.DoMaxima(e),i===null?e=this.m_ActiveEdges:e=i.NextInAEL}else{if(this.IsIntermediate(e,r)&&C.ClipperBase.IsHorizontal(e.NextInLML)?(e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot),this.AddEdgeToSEL(e)):(e.Curr.X=C.Clipper.TopX(e,r),e.Curr.Y=r),this.StrictlySimple){var i=e.PrevInAEL;if(e.OutIdx>=0&&e.WindDelta!==0&&i!==null&&i.OutIdx>=0&&i.Curr.X==e.Curr.X&&i.WindDelta!==0){var a=this.AddOutPt(i,e.Curr),l=this.AddOutPt(e,e.Curr);this.AddJoin(a,l,e.Curr)}}e=e.NextInAEL}}for(this.ProcessHorizontals(!0),e=this.m_ActiveEdges;e!==null;){if(this.IsIntermediate(e,r)){var a=null;e.OutIdx>=0&&(a=this.AddOutPt(e,e.Top)),e=this.UpdateEdgeIntoAEL(e);var i=e.PrevInAEL,h=e.NextInAEL;if(i!==null&&i.Curr.X==e.Bot.X&&i.Curr.Y==e.Bot.Y&&a!==null&&i.OutIdx>=0&&i.Curr.Y>i.Top.Y&&C.ClipperBase.SlopesEqual(e,i,this.m_UseFullRange)&&e.WindDelta!==0&&i.WindDelta!==0){var l=this.AddOutPt(i,e.Bot);this.AddJoin(a,l,e.Top)}else if(h!==null&&h.Curr.X==e.Bot.X&&h.Curr.Y==e.Bot.Y&&a!==null&&h.OutIdx>=0&&h.Curr.Y>h.Top.Y&&C.ClipperBase.SlopesEqual(e,h,this.m_UseFullRange)&&e.WindDelta!==0&&h.WindDelta!==0){var l=this.AddOutPt(h,e.Bot);this.AddJoin(a,l,e.Top)}}e=e.NextInAEL}};C.Clipper.prototype.DoMaxima=function(r){var e=this.GetMaximaPair(r);if(e===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var t=r.NextInAEL,n=!0;t!==null&&t!=e;)this.IntersectEdges(r,t,r.Top,!0),this.SwapPositionsInAEL(r,t),t=r.NextInAEL;r.OutIdx==-1&&e.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(e)):r.OutIdx>=0&&e.OutIdx>=0?this.IntersectEdges(r,e,r.Top,!1):n&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),e.OutIdx>=0&&(this.AddOutPt(e,r.Top),e.OutIdx=-1),this.DeleteFromAEL(e)):C.Error("DoMaxima error")};C.Clipper.ReversePaths=function(r){for(var e=0,t=r.length;e<t;e++)r[e].reverse()};C.Clipper.Orientation=function(r){return C.Clipper.Area(r)>=0};C.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var e=0,t=r;do e++,t=t.Next;while(t!=r);return e};C.Clipper.prototype.BuildResult=function(r){C.Clear(r);for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var n=this.m_PolyOuts[e];if(n.Pts!==null){var i=n.Pts.Prev,a=this.PointCount(i);if(!(a<2)){for(var l=new Array(a),h=0;h<a;h++)l[h]=i.Pt,i=i.Prev;r.push(l)}}}};C.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var n=this.m_PolyOuts[e],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 l=n.Pts.Prev,h=0;h<i;h++)a.m_polygon[h]=l.Pt,l=l.Prev}}for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var n=this.m_PolyOuts[e];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 e=null;r.BottomPt=null;for(var t=r.Pts;;){if(t.Prev==t||t.Prev==t.Next){this.DisposeOutPts(t),r.Pts=null;return}if(C.IntPoint.op_Equality(t.Pt,t.Next.Pt)||C.IntPoint.op_Equality(t.Pt,t.Prev.Pt)||C.ClipperBase.SlopesEqual(t.Prev.Pt,t.Pt,t.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(t.Prev.Pt,t.Pt,t.Next.Pt))){e=null;var n=t;t.Prev.Next=t.Next,t.Next.Prev=t.Prev,t=t.Prev,n=null}else{if(t==e)break;e===null&&(e=t),t=t.Next}}r.Pts=t};C.Clipper.prototype.DupOutPt=function(r,e){var t=new C.OutPt;return t.Pt.X=r.Pt.X,t.Pt.Y=r.Pt.Y,t.Idx=r.Idx,e?(t.Next=r.Next,t.Prev=r,r.Next.Prev=t,r.Next=t):(t.Prev=r.Prev,t.Next=r,r.Prev.Next=t,r.Prev=t),t};C.Clipper.prototype.GetOverlap=function(r,e,t,n,i){return r<e?t<n?(i.Left=Math.max(r,t),i.Right=Math.min(e,n)):(i.Left=Math.max(r,n),i.Right=Math.min(e,t)):t<n?(i.Left=Math.max(e,t),i.Right=Math.min(r,n)):(i.Left=Math.max(e,n),i.Right=Math.min(r,t)),i.Left<i.Right};C.Clipper.prototype.JoinHorz=function(r,e,t,n,i,a){var l=r.Pt.X>e.Pt.X?C.Direction.dRightToLeft:C.Direction.dLeftToRight,h=t.Pt.X>n.Pt.X?C.Direction.dRightToLeft:C.Direction.dLeftToRight;if(l==h)return!1;if(l==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),e=this.DupOutPt(r,!a),C.IntPoint.op_Inequality(e.Pt,i)&&(r=e,r.Pt.X=i.X,r.Pt.Y=i.Y,e=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),e=this.DupOutPt(r,a),C.IntPoint.op_Inequality(e.Pt,i)&&(r=e,r.Pt.X=i.X,r.Pt.Y=i.Y,e=this.DupOutPt(r,a))}if(h==C.Direction.dLeftToRight){for(;t.Next.Pt.X<=i.X&&t.Next.Pt.X>=t.Pt.X&&t.Next.Pt.Y==i.Y;)t=t.Next;a&&t.Pt.X!=i.X&&(t=t.Next),n=this.DupOutPt(t,!a),C.IntPoint.op_Inequality(n.Pt,i)&&(t=n,t.Pt.X=i.X,t.Pt.Y=i.Y,n=this.DupOutPt(t,!a))}else{for(;t.Next.Pt.X>=i.X&&t.Next.Pt.X<=t.Pt.X&&t.Next.Pt.Y==i.Y;)t=t.Next;!a&&t.Pt.X!=i.X&&(t=t.Next),n=this.DupOutPt(t,a),C.IntPoint.op_Inequality(n.Pt,i)&&(t=n,t.Pt.X=i.X,t.Pt.Y=i.Y,n=this.DupOutPt(t,a))}return l==C.Direction.dLeftToRight==a?(r.Prev=t,t.Next=r,e.Next=n,n.Prev=e):(r.Next=t,t.Prev=r,e.Prev=n,n.Next=e),!0};C.Clipper.prototype.JoinPoints=function(r,e,t){var n=r.OutPt1,i=new C.OutPt,a=r.OutPt2,l=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(l=r.OutPt2.Next;l!=a&&C.IntPoint.op_Equality(l.Pt,r.OffPt);)l=l.Next;var m=l.Pt.Y>r.OffPt.Y;return d==m?!1:d?(i=this.DupOutPt(n,!1),l=this.DupOutPt(a,!0),n.Prev=a,a.Next=n,i.Next=l,l.Prev=i,r.OutPt1=n,r.OutPt2=i,!0):(i=this.DupOutPt(n,!0),l=this.DupOutPt(a,!1),n.Next=a,a.Prev=n,i.Prev=l,l.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(l=a;a.Prev.Pt.Y==a.Pt.Y&&a.Prev!=l&&a.Prev!=i;)a=a.Prev;for(;l.Next.Pt.Y==l.Pt.Y&&l.Next!=a&&l.Next!=n;)l=l.Next;if(l.Next==a||l.Next==n)return!1;var v={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,i.Pt.X,a.Pt.X,l.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>l.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=l.Pt.X,I.Y=l.Pt.Y,w=l.Pt.X>a.Pt.X),r.OutPt1=n,r.OutPt2=a,this.JoinHorz(n,i,a,l,I,w)}else{for(i=n.Next;C.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Next;var P=i.Pt.Y>n.Pt.Y||!C.ClipperBase.SlopesEqual(n.Pt,i.Pt,r.OffPt,this.m_UseFullRange);if(P){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(l=a.Next;C.IntPoint.op_Equality(l.Pt,a.Pt)&&l!=a;)l=l.Next;var E=l.Pt.Y>a.Pt.Y||!C.ClipperBase.SlopesEqual(a.Pt,l.Pt,r.OffPt,this.m_UseFullRange);if(E){for(l=a.Prev;C.IntPoint.op_Equality(l.Pt,a.Pt)&&l!=a;)l=l.Prev;if(l.Pt.Y>a.Pt.Y||!C.ClipperBase.SlopesEqual(a.Pt,l.Pt,r.OffPt,this.m_UseFullRange))return!1}return i==n||l==a||i==l||e==t&&P==E?!1:P?(i=this.DupOutPt(n,!1),l=this.DupOutPt(a,!0),n.Prev=a,a.Next=n,i.Next=l,l.Prev=i,r.OutPt1=n,r.OutPt2=i,!0):(i=this.DupOutPt(n,!0),l=this.DupOutPt(a,!1),n.Next=a,a.Prev=n,i.Prev=l,l.Next=i,r.OutPt1=n,r.OutPt2=i,!0)}};C.Clipper.GetBounds=function(r){for(var e=0,t=r.length;e<t&&r[e].length==0;)e++;if(e==t)return new C.IntRect(0,0,0,0);var n=new C.IntRect;for(n.left=r[e][0].X,n.right=n.left,n.top=r[e][0].Y,n.bottom=n.top;e<t;e++)for(var i=0,a=r[e].length;i<a;i++)r[e][i].X<n.left?n.left=r[e][i].X:r[e][i].X>n.right&&(n.right=r[e][i].X),r[e][i].Y<n.top?n.top=r[e][i].Y:r[e][i].Y>n.bottom&&(n.bottom=r[e][i].Y);return n};C.Clipper.prototype.GetBounds2=function(r){var e=r,t=new C.IntRect;for(t.left=r.Pt.X,t.right=r.Pt.X,t.top=r.Pt.Y,t.bottom=r.Pt.Y,r=r.Next;r!=e;)r.Pt.X<t.left&&(t.left=r.Pt.X),r.Pt.X>t.right&&(t.right=r.Pt.X),r.Pt.Y<t.top&&(t.top=r.Pt.Y),r.Pt.Y>t.bottom&&(t.bottom=r.Pt.Y),r=r.Next;return t};C.Clipper.PointInPolygon=function(r,e){var t=0,n=e.length;if(n<3)return 0;for(var i=e[0],a=1;a<=n;++a){var l=a==n?e[0]:e[a];if(l.Y==r.Y&&(l.X==r.X||i.Y==r.Y&&l.X>r.X==i.X<r.X))return-1;if(i.Y<r.Y!=l.Y<r.Y){if(i.X>=r.X)if(l.X>r.X)t=1-t;else{var h=(i.X-r.X)*(l.Y-r.Y)-(l.X-r.X)*(i.Y-r.Y);if(h==0)return-1;h>0==l.Y>i.Y&&(t=1-t)}else if(l.X>r.X){var h=(i.X-r.X)*(l.Y-r.Y)-(l.X-r.X)*(i.Y-r.Y);if(h==0)return-1;h>0==l.Y>i.Y&&(t=1-t)}}i=l}return t};C.Clipper.prototype.PointInPolygon=function(r,e){for(var t=0,n=e;;){var i=e.Pt.X,a=e.Pt.Y,l=e.Next.Pt.X,h=e.Next.Pt.Y;if(h==r.Y&&(l==r.X||a==r.Y&&l>r.X==i<r.X))return-1;if(a<r.Y!=h<r.Y){if(i>=r.X)if(l>r.X)t=1-t;else{var d=(i-r.X)*(h-r.Y)-(l-r.X)*(a-r.Y);if(d==0)return-1;d>0==h>a&&(t=1-t)}else if(l>r.X){var d=(i-r.X)*(h-r.Y)-(l-r.X)*(a-r.Y);if(d==0)return-1;d>0==h>a&&(t=1-t)}}if(e=e.Next,n==e)break}return t};C.Clipper.prototype.Poly2ContainsPoly1=function(r,e){var t=r;do{var n=this.PointInPolygon(t.Pt,e);if(n>=0)return n!=0;t=t.Next}while(t!=r);return!0};C.Clipper.prototype.FixupFirstLefts1=function(r,e){for(var t=0,n=this.m_PolyOuts.length;t<n;t++){var i=this.m_PolyOuts[t];i.Pts!==null&&i.FirstLeft==r&&this.Poly2ContainsPoly1(i.Pts,e.Pts)&&(i.FirstLeft=e)}};C.Clipper.prototype.FixupFirstLefts2=function(r,e){for(var t=0,n=this.m_PolyOuts,i=n.length,a=n[t];t<i;t++,a=n[t])a.FirstLeft==r&&(a.FirstLeft=e)};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,e=this.m_Joins.length;r<e;r++){var t=this.m_Joins[r],n=this.GetOutRec(t.OutPt1.Idx),i=this.GetOutRec(t.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(t,n,i))if(n==i){if(n.Pts=t.OutPt1,n.BottomPt=null,i=this.CreateOutRec(),i.Pts=t.OutPt2,this.UpdateOutPtIdxs(i),this.m_UsingPolyTree)for(var l=0,h=this.m_PolyOuts.length;l<h-1;l++){var d=this.m_PolyOuts[l];d.Pts==null||C.Clipper.ParseFirstLeft(d.FirstLeft)!=n||d.IsHole==n.IsHole||this.Poly2ContainsPoly1(d.Pts,t.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 e=r.Pts;do e.Idx=r.Idx,e=e.Prev;while(e!=r.Pts)};C.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var e=this.m_PolyOuts[r++],t=e.Pts;if(t!==null)do{for(var n=t.Next;n!=e.Pts;){if(C.IntPoint.op_Equality(t.Pt,n.Pt)&&n.Next!=t&&n.Prev!=t){var i=t.Prev,a=n.Prev;t.Prev=a,a.Next=t,n.Prev=i,i.Next=n,e.Pts=t;var l=this.CreateOutRec();l.Pts=n,this.UpdateOutPtIdxs(l),this.Poly2ContainsPoly1(l.Pts,e.Pts)?(l.IsHole=!e.IsHole,l.FirstLeft=e):this.Poly2ContainsPoly1(e.Pts,l.Pts)?(l.IsHole=e.IsHole,e.IsHole=!l.IsHole,l.FirstLeft=e.FirstLeft,e.FirstLeft=l):(l.IsHole=e.IsHole,l.FirstLeft=e.FirstLeft),n=t}n=n.Next}t=t.Next}while(t!=e.Pts)}};C.Clipper.Area=function(r){var e=r.length;if(e<3)return 0;for(var t=0,n=0,i=e-1;n<e;++n)t+=(r[i].X+r[n].X)*(r[i].Y-r[n].Y),i=n;return-t*.5};C.Clipper.prototype.Area=function(r){var e=r.Pts;if(e==null)return 0;var t=0;do t=t+(e.Prev.Pt.X+e.Pt.X)*(e.Prev.Pt.Y-e.Pt.Y),e=e.Next;while(e!=r.Pts);return t*.5};eO&&(C.Clipper.OffsetPaths=function(r,e,t,n,i){var a=new C.Paths,l=new C.ClipperOffset(i,i);return l.AddPaths(r,t,n),l.Execute(a,e),a});C.Clipper.SimplifyPolygon=function(r,e){var t=new Array,n=new C.Clipper(0);return n.StrictlySimple=!0,n.AddPath(r,C.PolyType.ptSubject,!0),n.Execute(C.ClipType.ctUnion,t,e,e),t};C.Clipper.SimplifyPolygons=function(r,e){typeof e>"u"&&(e=C.PolyFillType.pftEvenOdd);var t=new Array,n=new C.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(r,C.PolyType.ptSubject,!0),n.Execute(C.ClipType.ctUnion,t,e,e),t};C.Clipper.DistanceSqrd=function(r,e){var t=r.X-e.X,n=r.Y-e.Y;return t*t+n*n};C.Clipper.DistanceFromLineSqrd=function(r,e,t){var n=e.Y-t.Y,i=t.X-e.X,a=n*e.X+i*e.Y;return a=n*r.X+i*r.Y-a,a*a/(n*n+i*i)};C.Clipper.SlopesNearCollinear=function(r,e,t,n){return C.Clipper.DistanceFromLineSqrd(e,r,t)<n};C.Clipper.PointsAreClose=function(r,e,t){var n=r.X-e.X,i=r.Y-e.Y;return n*n+i*i<=t};C.Clipper.ExcludeOp=function(r){var e=r.Prev;return e.Next=r.Next,r.Next.Prev=e,e.Idx=0,e};C.Clipper.CleanPolygon=function(r,e){typeof e>"u"&&(e=1.415);var t=r.length;if(t==0)return new Array;for(var n=new Array(t),i=0;i<t;++i)n[i]=new C.OutPt;for(var i=0;i<t;++i)n[i].Pt=r[i],n[i].Next=n[(i+1)%t],n[i].Next.Prev=n[i],n[i].Idx=0;for(var a=e*e,l=n[0];l.Idx==0&&l.Next!=l.Prev;)C.Clipper.PointsAreClose(l.Pt,l.Prev.Pt,a)?(l=C.Clipper.ExcludeOp(l),t--):C.Clipper.PointsAreClose(l.Prev.Pt,l.Next.Pt,a)?(C.Clipper.ExcludeOp(l.Next),l=C.Clipper.ExcludeOp(l),t-=2):C.Clipper.SlopesNearCollinear(l.Prev.Pt,l.Pt,l.Next.Pt,a)?(l=C.Clipper.ExcludeOp(l),t--):(l.Idx=1,l=l.Next);t<3&&(t=0);for(var h=new Array(t),i=0;i<t;++i)h[i]=new C.IntPoint(l.Pt),l=l.Next;return n=null,h};C.Clipper.CleanPolygons=function(r,e){for(var t=new Array(r.length),n=0,i=r.length;n<i;n++)t[n]=C.Clipper.CleanPolygon(r[n],e);return t};C.Clipper.Minkowski=function(r,e,t,n){var i=n?1:0,a=r.length,l=e.length,h=new Array;if(t)for(var d=0;d<l;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(e[d].X+S.X,e[d].Y+S.Y);h.push(m)}else for(var d=0;d<l;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(e[d].X-S.X,e[d].Y-S.Y);h.push(m)}for(var I=new Array,d=0;d<l-1+i;d++)for(var v=0;v<a;v++){var w=new Array;w.push(h[d%l][v%a]),w.push(h[(d+1)%l][v%a]),w.push(h[(d+1)%l][(v+1)%a]),w.push(h[d%l][(v+1)%a]),C.Clipper.Orientation(w)||w.reverse(),I.push(w)}var P=new C.Clipper(0);return P.AddPaths(I,C.PolyType.ptSubject,!0),P.Execute(C.ClipType.ctUnion,h,C.PolyFillType.pftNonZero,C.PolyFillType.pftNonZero),h};C.Clipper.MinkowskiSum=function(){var r=arguments,e=r.length;if(e==3){var t=r[0],n=r[1],i=r[2];return C.Clipper.Minkowski(t,n,!0,i)}else if(e==4){for(var t=r[0],a=r[1],l=r[2],i=r[3],h=new C.Clipper,d,m=0,v=a.length;m<v;++m){var d=C.Clipper.Minkowski(t,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,l,l),x}};C.Clipper.MinkowskiDiff=function(r,e,t){return C.Clipper.Minkowski(r,e,!1,t)};C.Clipper.PolyTreeToPaths=function(r){var e=new Array;return C.Clipper.AddPolyNodeToPaths(r,C.Clipper.NodeType.ntAny,e),e};C.Clipper.AddPolyNodeToPaths=function(r,e,t){var n=!0;switch(e){case C.Clipper.NodeType.ntOpen:return;case C.Clipper.NodeType.ntClosed:n=!r.IsOpen;break;default:break}r.m_polygon.length>0&&n&&t.push(r.m_polygon);for(var i=0,a=r.Childs(),l=a.length,h=a[i];i<l;i++,h=a[i])C.Clipper.AddPolyNodeToPaths(h,e,t)};C.Clipper.OpenPathsFromPolyTree=function(r){for(var e=new C.Paths,t=0,n=r.ChildCount();t<n;t++)r.Childs()[t].IsOpen&&e.push(r.Childs()[t].m_polygon);return e};C.Clipper.ClosedPathsFromPolyTree=function(r){var e=new C.Paths;return C.Clipper.AddPolyNodeToPaths(r,C.Clipper.NodeType.ntClosed,e),e};qb(C.Clipper,C.ClipperBase);C.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};C.ClipperOffset=function(r,e){typeof r>"u"&&(r=2),typeof e>"u"&&(e=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=e,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,e,t){var n=r.length-1;if(!(n<0)){var i=new C.PolyNode;if(i.m_jointype=e,i.m_endtype=t,t==C.EndType.etClosedLine||t==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,l=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[l].Y||r[h].Y==i.m_polygon[l].Y&&r[h].X<i.m_polygon[l].X)&&(l=a));if(!(t==C.EndType.etClosedPolygon&&a<2||t!=C.EndType.etClosedPolygon&&a<0)&&(this.m_polyNodes.AddChild(i),t==C.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new C.IntPoint(0,l);else{var d=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(i.m_polygon[l].Y>d.Y||i.m_polygon[l].Y==d.Y&&i.m_polygon[l].X<d.X)&&(this.m_lowest=new C.IntPoint(this.m_polyNodes.ChildCount()-1,l))}}};C.ClipperOffset.prototype.AddPaths=function(r,e,t){for(var n=0,i=r.length;n<i;n++)this.AddPath(r[n],e,t)};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 e=this.m_polyNodes.Childs()[r];(e.m_endtype==C.EndType.etClosedPolygon||e.m_endtype==C.EndType.etClosedLine&&C.Clipper.Orientation(e.m_polygon))&&e.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var e=this.m_polyNodes.Childs()[r];e.m_endtype==C.EndType.etClosedLine&&!C.Clipper.Orientation(e.m_polygon)&&e.m_polygon.reverse()}};C.ClipperOffset.GetUnitNormal=function(r,e){var t=e.X-r.X,n=e.Y-r.Y;if(t==0&&n==0)return new C.DoublePoint(0,0);var i=1/Math.sqrt(t*t+n*n);return t*=i,n*=i,new C.DoublePoint(n,-t)};C.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,C.ClipperBase.near_zero(r)){for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==C.EndType.etClosedPolygon&&this.m_destPolys.push(t.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var 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 e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];this.m_srcPoly=t.m_polygon;var a=this.m_srcPoly.length;if(!(a==0||r<=0&&(a<3||t.m_endtype!=C.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,a==1){if(t.m_jointype==C.JoinType.jtRound)for(var l=1,h=0,d=1;d<=i;d++){this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[0].X+l*r),C.ClipperOffset.Round(this.m_srcPoly[0].Y+h*r)));var m=l;l=l*this.m_cos-this.m_sin*h,h=m*this.m_sin+h*this.m_cos}else for(var l=-1,h=-1,d=0;d<4;++d)this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[0].X+l*r),C.ClipperOffset.Round(this.m_srcPoly[0].Y+h*r))),l<0?l=1:h<0?h=1:l=-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(t.m_endtype==C.EndType.etClosedLine||t.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])),t.m_endtype==C.EndType.etClosedPolygon){for(var v=a-1,d=0;d<a;d++)v=this.OffsetPoint(d,v,t.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(t.m_endtype==C.EndType.etClosedLine){for(var v=a-1,d=0;d<a;d++)v=this.OffsetPoint(d,v,t.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,t.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,t.m_jointype);var S;if(t.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),t.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,t.m_jointype);t.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,t.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,e=r[0]instanceof C.PolyTree;if(e){var t=r[0],n=r[1];t.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,t,C.PolyFillType.pftPositive,C.PolyFillType.pftPositive);else{var a=C.Clipper.GetBounds(this.m_destPolys),l=new C.Path;if(l.push(new C.IntPoint(a.left-10,a.bottom+10)),l.push(new C.IntPoint(a.right+10,a.bottom+10)),l.push(new C.IntPoint(a.right+10,a.top-10)),l.push(new C.IntPoint(a.left-10,a.top-10)),i.AddPath(l,C.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(C.ClipType.ctUnion,t,C.PolyFillType.pftNegative,C.PolyFillType.pftNegative),t.ChildCount()==1&&t.Childs()[0].ChildCount()>0){var h=t.Childs()[0];t.Childs()[0]=h.Childs()[0];for(var d=1;d<h.ChildCount();d++)t.AddChild(h.Childs()[d])}else t.Clear()}}else{var t=r[0],n=r[1];C.Clear(t),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,t,C.PolyFillType.pftPositive,C.PolyFillType.pftPositive);else{var a=C.Clipper.GetBounds(this.m_destPolys),l=new C.Path;l.push(new C.IntPoint(a.left-10,a.bottom+10)),l.push(new C.IntPoint(a.right+10,a.bottom+10)),l.push(new C.IntPoint(a.right+10,a.top-10)),l.push(new C.IntPoint(a.left-10,a.top-10)),i.AddPath(l,C.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(C.ClipType.ctUnion,t,C.PolyFillType.pftNegative,C.PolyFillType.pftNegative),t.length>0&&t.splice(0,1)}}};C.ClipperOffset.prototype.OffsetPoint=function(r,e,t){if(this.m_sinA=this.m_normals[e].X*this.m_normals[r].Y-this.m_normals[r].X*this.m_normals[e].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return e;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[e].X*this.m_delta),C.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[e].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(t){case C.JoinType.jtMiter:{var n=1+(this.m_normals[r].X*this.m_normals[e].X+this.m_normals[r].Y*this.m_normals[e].Y);n>=this.m_miterLim?this.DoMiter(r,e,n):this.DoSquare(r,e);break}case C.JoinType.jtSquare:this.DoSquare(r,e);break;case C.JoinType.jtRound:this.DoRound(r,e);break}return e=r,e};C.ClipperOffset.prototype.DoSquare=function(r,e){var t=Math.tan(Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[r].X+this.m_normals[e].Y*this.m_normals[r].Y)/4);this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[e].X-this.m_normals[e].Y*t)),C.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[e].Y+this.m_normals[e].X*t)))),this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*t)),C.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*t))))};C.ClipperOffset.prototype.DoMiter=function(r,e,t){var n=this.m_delta/t;this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[e].X+this.m_normals[r].X)*n),C.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[e].Y+this.m_normals[r].Y)*n)))};C.ClipperOffset.prototype.DoRound=function(r,e){for(var t=Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[r].X+this.m_normals[e].Y*this.m_normals[r].Y),n=C.Cast_Int32(C.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(t))),i=this.m_normals[e].X,a=this.m_normals[e].Y,l,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))),l=i,i=i*this.m_cos-this.m_sin*a,a=l*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(e){alert(e.message)}};C.JS={};C.JS.AreaOfPolygon=function(r,e){return e||(e=1),C.Clipper.Area(r)/(e*e)};C.JS.AreaOfPolygons=function(r,e){e||(e=1);for(var t=0,n=0;n<r.length;n++)t+=C.Clipper.Area(r[n]);return t/(e*e)};C.JS.BoundsOfPath=function(r,e){return C.JS.BoundsOfPaths([r],e)};C.JS.BoundsOfPaths=function(r,e){e||(e=1);var t=C.Clipper.GetBounds(r);return t.left/=e,t.bottom/=e,t.right/=e,t.top/=e,t};C.JS.Clean=function(n,e){if(!(n instanceof Array))return[];var t=n[0]instanceof Array,n=C.JS.Clone(n);if(typeof e!="number"||e===null)return C.Error("Delta is not a number in Clean()."),n;if(n.length===0||n.length==1&&n[0].length===0||e<0)return n;t||(n=[n]);for(var i=n.length,a,l,h,d,m,v,x,S=[],I=0;I<i;I++)if(l=n[I],a=l.length,a!==0){if(a<3){h=l,S.push(h);continue}for(h=l,d=e*e,m=l[0],v=1,x=1;x<a;x++)(l[x].X-m.X)*(l[x].X-m.X)+(l[x].Y-m.Y)*(l[x].Y-m.Y)<=d||(h[v]=l[x],m=l[x],v++);m=l[v-1],(l[0].X-m.X)*(l[0].X-m.X)+(l[0].Y-m.Y)*(l[0].Y-m.Y)<=d&&v--,v<a&&h.splice(v,a-v),h.length&&S.push(h)}return!t&&S.length?S=S[0]:!t&&S.length===0?S=[]:t&&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 e=r[0]instanceof Array;e||(r=[r]);var t=r.length,n,i,a,l,h=new Array(t);for(i=0;i<t;i++){for(n=r[i].length,l=new Array(n),a=0;a<n;a++)l[a]={X:r[i][a].X,Y:r[i][a].Y};h[i]=l}return e||(h=h[0]),h};C.JS.Lighten=function(r,e){if(!(r instanceof Array))return[];if(typeof e!="number"||e===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||e<0)return C.JS.Clone(r);r[0]instanceof Array||(r=[r]);var t,n,i,a,l,h,d,m,v,x,S,I,w,P,E,O,N,L=r.length,G=e*e,j=[];for(t=0;t<L;t++)if(i=r[t],h=i.length,h!=0){for(a=0;a<1e6;a++){for(l=[],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],O=d.X,N=d.Y,w=m.X-O,P=m.Y-N,(w!==0||P!==0)&&(E=((v.X-O)*w+(v.Y-N)*P)/(w*w+P*P),E>1?(O=m.X,N=m.Y):E>0&&(O+=w*E,N+=P*E)),w=v.X-O,P=v.Y-N,x=w*w+P*P,x<=G&&(S[n+1]=1,n++);for(l.push({X:i[0].X,Y:i[0].Y}),n=1;n<h-1;n++)S[n]||l.push({X:i[n].X,Y:i[n].Y});if(l.push({X:i[h-1].X,Y:i[h-1].Y}),I&&i.pop(),S.length)i=l;else break}h=l.length,l[h-1].X==l[0].X&&l[h-1].Y==l[0].Y&&l.pop(),l.length>2&&j.push(l)}return!r[0]instanceof Array&&(j=j[0]),typeof j>"u"&&(j=[[]]),j};C.JS.PerimeterOfPath=function(r,e,t){if(typeof r>"u")return 0;var n=Math.sqrt,i=0,a,l,h=0,d=0,m=0,v=0,x=r.length;if(x<2)return 0;for(e&&(r[x]=r[0],x++);--x;)a=r[x],h=a.X,d=a.Y,l=r[x-1],m=l.X,v=l.Y,i+=n((h-m)*(h-m)+(d-v)*(d-v));return e&&r.pop(),i/t};C.JS.PerimeterOfPaths=function(r,e,t){t||(t=1);for(var n=0,i=0;i<r.length;i++)n+=C.JS.PerimeterOfPath(r[i],e,t);return n};C.JS.ScaleDownPath=function(r,e){var t,n;for(e||(e=1),t=r.length;t--;)n=r[t],n.X=n.X/e,n.Y=n.Y/e};C.JS.ScaleDownPaths=function(r,e){var t,n,i,a=Math.round;for(e||(e=1),t=r.length;t--;)for(n=r[t].length;n--;)i=r[t][n],i.X=i.X/e,i.Y=i.Y/e};C.JS.ScaleUpPath=function(r,e){var t,n,i=Math.round;for(e||(e=1),t=r.length;t--;)n=r[t],n.X=i(n.X*e),n.Y=i(n.Y*e)};C.JS.ScaleUpPaths=function(r,e){var t,n,i,a=Math.round;for(e||(e=1),t=r.length;t--;)for(n=r[t].length;n--;)i=r[t][n],i.X=a(i.X*e),i.Y=a(i.Y*e)};C.ExPolygons=function(){return[]};C.ExPolygon=function(){this.outer=null,this.holes=null};C.JS.AddOuterPolyNodeToExPolygons=function(r,e){var t=new C.ExPolygon;t.outer=r.Contour();var n=r.Childs(),i=n.length;t.holes=new Array(i);var a,l,h,d,m,v;for(h=0;h<i;h++)for(a=n[h],t.holes[h]=a.Contour(),d=0,m=a.Childs(),v=m.length;d<v;d++)l=m[d],C.JS.AddOuterPolyNodeToExPolygons(l,e);e.push(t)};C.JS.ExPolygonsToPaths=function(r){var e,t,n,i,a=new C.Paths;for(e=0,n=r.length;e<n;e++)for(a.push(r[e].outer),t=0,i=r[e].holes.length;t<i;t++)a.push(r[e].holes[t]);return a};C.JS.PolyTreeToExPolygons=function(r){var e=new C.ExPolygons,t,n,i,a;for(n=0,i=r.Childs(),a=i.length;n<a;n++)t=i[n],C.JS.AddOuterPolyNodeToExPolygons(t,e);return e};Oy.exports=C});var FD=Lt((QGt,i2)=>{y();(function(){"use strict";function r(l,h){var d=l.x-h.x,m=l.y-h.y;return d*d+m*m}u(r,"getSqDist");function e(l,h,d){var m=h.x,v=h.y,x=d.x-m,S=d.y-v;if(x!==0||S!==0){var I=((l.x-m)*x+(l.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=l.x-m,S=l.y-v,x*x+S*S}u(e,"getSqSegDist");function t(l,h){for(var d=l[0],m=[d],v,x=1,S=l.length;x<S;x++)v=l[x],r(v,d)>h&&(m.push(v),d=v);return d!==v&&m.push(v),m}u(t,"simplifyRadialDist");function n(l,h,d,m,v){for(var x=m,S,I=h+1;I<d;I++){var w=e(l[I],l[h],l[d]);w>x&&(S=I,x=w)}x>m&&(S-h>1&&n(l,h,S,m,v),v.push(l[S]),d-S>1&&n(l,S,d,m,v))}u(n,"simplifyDPStep");function i(l,h){var d=l.length-1,m=[l[0]];return n(l,0,d,h,m),m.push(l[d]),m}u(i,"simplifyDouglasPeucker");function a(l,h,d){if(l.length<=2)return l;var m=h!==void 0?h*h:1;return l=d?l:t(l,m),l=i(l,m),l}u(a,"simplify"),typeof define=="function"&&define.amd?define(function(){return a}):typeof i2<"u"?(i2.exports=a,i2.exports.default=a):typeof self<"u"?self.simplify=a:window.simplify=a})()});y();y();var q2=class q2{constructor(e){b(this,"id");this.id=e}};u(q2,"BaseMetaData");var ni=q2;y();y();var mp=class mp{constructor(e,t,n){b(this,"__type",mp.__type);b(this,"id",Mr());b(this,"latitude");b(this,"longitude");b(this,"floorId");b(this,"verticalOffset");var i;if(typeof e=="object")this.latitude=e.latitude,this.longitude=e.longitude,this.floorId=e.floorId,this.verticalOffset=(i=e.verticalOffset)!=null?i:0;else{if(t==null)throw new Error("Coordinate longitude is required.");this.latitude=e,this.longitude=t,this.floorId=n,this.verticalOffset=0}}static is(e){return e.__type===mp.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(e){return this.latitude===e.latitude&&this.longitude===e.longitude&&this.floorId===e.floorId}toJSON(){return{__type:mp.__type,latitude:this.latitude,longitude:this.longitude,floorId:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};u(mp,"Coordinate"),b(mp,"__type","coordinate");var W2=mp,ve=W2;y();y();y();function Cn(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")}u(Cn,"getCoord");function Ur(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")}u(Ur,"getCoords");function Z2(r,e,t){if(!r)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+r.geometry.type)}u(Z2,"featureOf");function $n(r){return r.type==="Feature"?r.geometry:r}u($n,"getGeom");function rs(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}u(rs,"getType");var GL=Wr(X0(),1);y();var ZL=Wr(yP(),1);y();y();function an(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=Cn(r),i=$n(e),a=i.type,l=e.bbox,h=i.coordinates;if(l&&$L(n,l)===!1)return!1;a==="Polygon"&&(h=[h]);for(var d=!1,m=0;m<h.length&&!d;m++)if(vP(n,h[m][0],t.ignoreBoundary)){for(var v=!1,x=1;x<h[m].length&&!v;)vP(n,h[m][x],!t.ignoreBoundary)&&(v=!0),x++;v||(d=!0)}return d}u(an,"booleanPointInPolygon");function vP(r,e,t){var n=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,a=e.length-1;i<e.length;a=i++){var l=e[i][0],h=e[i][1],d=e[a][0],m=e[a][1],v=r[1]*(l-d)+h*(d-r[0])+m*(r[0]-l)===0&&(l-r[0])*(d-r[0])<=0&&(h-r[1])*(m-r[1])<=0;if(v)return!t;var x=h>r[1]!=m>r[1]&&r[0]<(d-l)*(r[1]-h)/(m-h)+l;x&&(n=!n)}return n}u(vP,"inRing");function $L(r,e){return e[0]<=r[0]&&e[1]<=r[1]&&e[2]>=r[0]&&e[3]>=r[1]}u($L,"inBBox");y();y();function JL(r,e,t){t===void 0&&(t={});var n=Cn(r),i=Cn(e),a=_i(i[1]-n[1]),l=_i(i[0]-n[0]),h=_i(n[1]),d=_i(i[1]),m=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(h)*Math.cos(d);return k0(2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m)),t.units)}u(JL,"distance");var gn=JL;y();var v$=function(){function r(e,t,n){this.a=e,this.b=t,this.c=n;var i=t.x-e.x,a=t.y-e.y,l=n.x-e.x,h=n.y-e.y,d=i*(e.x+t.x)+a*(e.y+t.y),m=l*(e.x+n.x)+h*(e.y+n.y),v=2*(i*(n.y-t.y)-a*(n.x-t.x)),x,S;this.x=(h*d-a*m)/v,this.y=(i*m-l*d)/v,x=this.x-e.x,S=this.y-e.y,this.r=x*x+S*S}return u(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 xP=new ArrayBuffer(16),sK=new Float64Array(xP),aK=new Uint32Array(xP);y();y();y();y();y();y();var hA=Wr(u_(),1);y();y();y();y();y();var gtt=function(){function r(e){this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var t=0;t<this.length;t++)this.points[t].z=this.points[t].z||0;for(var t=0;t<this.length-1;t++){var n=this.points[t],i=this.points[t+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 t=0;t<this.centers.length-1;t++){var a=this.points[t+1].x-(this.centers[t].x+this.centers[t+1].x)/2,l=this.points[t+1].y-(this.centers[t].y+this.centers[t+1].y)/2,h=this.points[t+1].z-(this.centers[t].y+this.centers[t+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t].x+a),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t].y+l),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t].z+h)},{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t+1].x+a),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t+1].y+l),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t+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 u(r,"Spline"),r.prototype.cacheSteps=function(e){var t=[],n=this.pos(0);t.push(0);for(var i=0;i<this.duration;i+=10){var a=this.pos(i),l=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));l>e&&(t.push(i),n=a)}return t},r.prototype.vector=function(e){var t=this.pos(e+10),n=this.pos(e-10);return{angle:180*Math.atan2(t.y-n.y,t.x-n.x)/3.14,speed:Math.sqrt((n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y)+(n.z-t.z)*(n.z-t.z))}},r.prototype.pos=function(e){var t=e-this.delay;t<0&&(t=0),t>this.duration&&(t=this.duration-1);var n=t/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 fA(a,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},r}();function fA(r,e,t,n,i){var a=dA(r),l={x:i.x*a[0]+n.x*a[1]+t.x*a[2]+e.x*a[3],y:i.y*a[0]+n.y*a[1]+t.y*a[2]+e.y*a[3],z:i.z*a[0]+n.z*a[1]+t.z*a[2]+e.z*a[3]};return l}u(fA,"bezier");function dA(r){var e=r*r,t=e*r;return[t,3*e*(1-r),3*r*(1-r)*(1-r),(1-r)*(1-r)*(1-r)]}u(dA,"B");y();y();y();y();function lg(r,e){e===void 0&&(e={});var t=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 l=[t,n],h=[t,a],d=[i,a],m=[i,n];return jr([[l,m,d,h,l]],e.properties,{bbox:r,id:e.id})}u(lg,"bboxPolygon");function mA(r){return lg(Zn(r))}u(mA,"envelope");var c_=mA;y();y();y();function ns(r,e,t,n){n===void 0&&(n={});var i=Cn(r),a=_i(i[0]),l=_i(i[1]),h=_i(t),d=R0(e,n.units),m=Math.asin(Math.sin(l)*Math.cos(d)+Math.cos(l)*Math.sin(d)*Math.cos(h)),v=a+Math.atan2(Math.sin(h)*Math.sin(d)*Math.cos(l),Math.cos(d)-Math.sin(l)*Math.sin(m)),x=hp(v),S=hp(m);return Ar([x,S],n.properties)}u(ns,"destination");y();y();function zl(r,e,t){if(t===void 0&&(t={}),t.final===!0)return gA(r,e);var n=Cn(r),i=Cn(e),a=_i(n[0]),l=_i(i[0]),h=_i(n[1]),d=_i(i[1]),m=Math.sin(l-a)*Math.cos(d),v=Math.cos(h)*Math.sin(d)-Math.sin(h)*Math.cos(d)*Math.cos(l-a);return hp(Math.atan2(m,v))}u(zl,"bearing");function gA(r,e){var t=zl(e,r);return t=(t+180)%360,t}u(gA,"calculateFinalBearing");y();function yA(r,e){e===void 0&&(e={});var t=Zn(r),n=(t[0]+t[2])/2,i=(t[1]+t[3])/2;return Ar([n,i],e.properties,e)}u(yA,"center");var ja=yA;y();y();y();y();y();var bA=Wr(AL(),1);y();y();y();y();function xA(r){if(!r)throw new Error("geojson is required");var e=[];return ri(r,function(t){_A(t,e)}),Te(e)}u(xA,"lineSegment");function _A(r,e){var t=[],n=r.geometry;if(n!==null){switch(n.type){case"Polygon":t=Ur(n);break;case"LineString":t=[Ur(n)]}t.forEach(function(i){var a=CA(i,r.properties);a.forEach(function(l){l.id=e.length,e.push(l)})})}}u(_A,"lineSegmentFeature");function CA(r,e){var t=[];return r.reduce(function(n,i){var a=Pn([n,i],e);return a.bbox=SA(n,i),t.push(a),i}),t}u(CA,"createSegments");function SA(r,e){var t=r[0],n=r[1],i=e[0],a=e[1],l=t<i?t:i,h=n<a?n:a,d=t>i?t:i,m=n>a?n:a;return[l,h,d,m]}u(SA,"bbox");var yp=xA;var jP=Wr(nv(),1);function $A(r,e){var t={},n=[];if(r.type==="LineString"&&(r=Ga(r)),e.type==="LineString"&&(e=Ga(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var i=VP(r,e);return i&&n.push(i),Te(n)}var a=(0,jP.default)();return a.load(yp(e)),tn(yp(r),function(l){tn(a.search(l),function(h){var d=VP(l,h);if(d){var m=Ur(d).join(",");t[m]||(t[m]=!0,n.push(d))}})}),Te(n)}u($A,"lineIntersect");function VP(r,e){var t=Ur(r),n=Ur(e);if(t.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=t[0][0],a=t[0][1],l=t[1][0],h=t[1][1],d=n[0][0],m=n[0][1],v=n[1][0],x=n[1][1],S=(x-m)*(l-i)-(v-d)*(h-a),I=(v-d)*(a-m)-(x-m)*(i-d),w=(l-i)*(a-m)-(h-a)*(i-d);if(S===0)return null;var P=I/S,E=w/S;if(P>=0&&P<=1&&E>=0&&E<=1){var O=i+P*(l-i),N=a+P*(h-a);return Ar([O,N])}return null}u(VP,"intersects");var za=$A;function JA(r,e,t){t===void 0&&(t={});var n=Ar([1/0,1/0],{dist:1/0}),i=0;return ri(r,function(a){for(var l=Ur(a),h=0;h<l.length-1;h++){var d=Ar(l[h]);d.properties.dist=gn(e,d,t);var m=Ar(l[h+1]);m.properties.dist=gn(e,m,t);var v=gn(d,m,t),x=Math.max(d.properties.dist,m.properties.dist),S=zl(d,m),I=ns(e,x,S+90,t),w=ns(e,x,S-90,t),P=za(Pn([I.geometry.coordinates,w.geometry.coordinates]),Pn([d.geometry.coordinates,m.geometry.coordinates])),E=null;P.features.length>0&&(E=P.features[0],E.properties.dist=gn(e,E,t),E.properties.location=i+gn(d,E,t)),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),E&&E.properties.dist<n.properties.dist&&(n=E,n.properties.index=h),i+=v}}),n}u(JA,"nearestPointOnLine");var Hl=JA;y();y();y();var QA=Wr(X0(),1);y();y();y();y();y();y();function vp(r,e){return e===void 0&&(e={}),kT(r,function(t,n){var i=n.geometry.coordinates;return t+gn(i[0],i[1],e)},0)}u(vp,"length");y();function tN(r,e,t){var n=Ur(t);if(rs(t)!=="LineString")throw new Error("line must be a LineString");var i=Hl(t,r),a=Hl(t,e),l;i.properties.index<=a.properties.index?l=[i,a]:l=[a,i];for(var h=[l[0].geometry.coordinates],d=l[0].properties.index+1;d<l[1].properties.index+1;d++)h.push(n[d]);return h.push(l[1].geometry.coordinates),Pn(h,t.properties)}u(tN,"lineSlice");var ov=tN;y();y();y();y();function eN(r,e,t){t===void 0&&(t={});for(var n=Cn(r),i=Ur(e),a=0;a<i.length-1;a++){var l=!1;if(t.ignoreEndVertices&&(a===0&&(l="start"),a===i.length-2&&(l="end"),a===0&&a+1===i.length-1&&(l="both")),rN(i[a],i[a+1],n,l,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}u(eN,"booleanPointOnLine");function rN(r,e,t,n,i){var a=t[0],l=t[1],h=r[0],d=r[1],m=e[0],v=e[1],x=t[0]-h,S=t[1]-d,I=m-h,w=v-d,P=x*w-S*I;if(i!==null){if(Math.abs(P)>i)return!1}else if(P!==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<l&&l<=v:v<=l&&l<d;if(n==="end")return Math.abs(I)>=Math.abs(w)?I>0?h<=a&&a<m:m<a&&a<=h:w>0?d<=l&&l<v:v<l&&l<=d;if(n==="both")return Math.abs(I)>=Math.abs(w)?I>0?h<a&&a<m:m<a&&a<h:w>0?d<l&&l<v:v<l&&l<d}else return Math.abs(I)>=Math.abs(w)?I>0?h<=a&&a<=m:m<=a&&a<=h:w>0?d<=l&&l<=v:v<=l&&l<=d;return!1}u(rN,"isPointOnLineSegment");var qf=eN;y();y();y();y();var oN=Wr(u_(),1);y();var XP=Math.PI/180,YP=180/Math.PI,cg=u(function(r,e){this.lon=r,this.lat=e,this.x=XP*r,this.y=XP*e},"Coord");cg.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};cg.prototype.antipode=function(){var r=-1*this.lat,e=this.lon<0?180+this.lon:(180-this.lon)*-1;return new cg(e,r)};var qP=u(function(){this.coords=[],this.length=0},"LineString");qP.prototype.move_to=function(r){this.length++,this.coords.push(r)};var I_=u(function(r){this.properties=r||{},this.geometries=[]},"Arc");I_.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=[],e=0;e<this.geometries.length;e++)r.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:r},type:"Feature",properties:this.properties}};I_.prototype.wkt=function(){for(var r="",e="LINESTRING(",t=u(function(a){e+=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(t),r+=e.substring(0,e.length-1)+")"}return r};var WP=u(function(r,e,t){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(!e||e.x===void 0||e.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new cg(r.x,r.y),this.end=new cg(e.x,e.y),this.properties=t||{};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 "+e.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 "+e)},"GreatCircle");WP.prototype.interpolate=function(r){var e=Math.sin((1-r)*this.g)/Math.sin(this.g),t=Math.sin(r*this.g)/Math.sin(this.g),n=e*Math.cos(this.start.y)*Math.cos(this.start.x)+t*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+t*Math.cos(this.end.y)*Math.sin(this.end.x),a=e*Math.sin(this.start.y)+t*Math.sin(this.end.y),l=YP*Math.atan2(a,Math.sqrt(Math.pow(n,2)+Math.pow(i,2))),h=YP*Math.atan2(i,n);return[h,l]};WP.prototype.Arc=function(r,e){var t=[];if(!r||r<=2)t.push([this.start.lon,this.start.lat]),t.push([this.end.lon,this.end.lat]);else for(var n=1/(r-1),i=0;i<r;++i){var a=n*i,l=this.interpolate(a);t.push(l)}for(var h=!1,d=0,m=e&&e.offset?e.offset:10,v=180-m,x=-180+m,S=360-m,I=1;I<t.length;++I){var w=t[I-1][0],P=t[I][0],E=Math.abs(P-w);E>S&&(P>v&&w<x||w>v&&P<x)?h=!0:E>d&&(d=E)}var O=[];if(h&&d<m){var N=[];O.push(N);for(var L=0;L<t.length;++L){var G=parseFloat(t[L][0]);if(L>0&&Math.abs(G-t[L-1][0])>S){var j=parseFloat(t[L-1][0]),$=parseFloat(t[L-1][1]),q=parseFloat(t[L][0]),k=parseFloat(t[L][1]);if(j>-180&&j<x&&q===180&&L+1<t.length&&t[L-1][0]>-180&&t[L-1][0]<x){N.push([-180,t[L][1]]),L++,N.push([t[L][0],t[L][1]]);continue}else if(j>v&&j<180&&q===-180&&L+1<t.length&&t[L-1][0]>v&&t[L-1][0]<180){N.push([180,t[L][1]]),L++,N.push([t[L][0],t[L][1]]);continue}if(j<x&&q>v){var tt=j;j=q,q=tt;var ut=$;$=k,k=ut}if(j>v&&q<x&&(q+=360),j<=180&&q>=180&&j<q){var at=(180-j)/(q-j),H=at*k+(1-at)*$;N.push([t[L-1][0]>v?180:-180,H]),N=[],N.push([t[L-1][0]>v?-180:180,H]),O.push(N)}else N=[],O.push(N);N.push([G,t[L][1]])}else N.push([t[L][0],t[L][1]])}}else{var St=[];O.push(St);for(var pt=0;pt<t.length;++pt)St.push([t[pt][0],t[pt][1]])}for(var ct=new I_(this.properties),It=0;It<O.length;++It){var Et=new qP;ct.geometries.push(Et);for(var dt=O[It],bt=0;bt<dt.length;++bt)Et.move_to(dt[bt])}return ct};y();var lN=Wr(nv(),1);y();y();function bp(r,e){e===void 0&&(e={});var t=$n(r);switch(!e.properties&&r.type==="Feature"&&(e.properties=r.properties),t.type){case"Polygon":return $P(t,e);case"MultiPolygon":return uN(t,e);default:throw new Error("invalid poly")}}u(bp,"default");function $P(r,e){e===void 0&&(e={});var t=$n(r),n=t.coordinates,i=e.properties?e.properties:r.type==="Feature"?r.properties:{};return JP(n,i)}u($P,"polygonToLine");function uN(r,e){e===void 0&&(e={});var t=$n(r),n=t.coordinates,i=e.properties?e.properties:r.type==="Feature"?r.properties:{},a=[];return n.forEach(function(l){a.push(JP(l,i))}),Te(a)}u(uN,"multiPolygonToLine");function JP(r,e){return r.length>1?Nf(r,e):Pn(r[0],e)}u(JP,"coordsToLine");y();y();y();y();var lR=Wr(nv(),1);var uR=Wr(K_(),1);y();y();y();y();y();y();y();var hR=Wr(X0(),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 Q_=u(function(r){return[[r.bottomleft,0],[0,0],[0,r.leftbottom]]},"p00"),tC=u(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0]]},"p01"),eC=u(function(r){return[[r.topright,1],[1,1],[1,r.righttop]]},"p02"),rC=u(function(r){return[[0,r.lefttop],[0,1],[r.topleft,1]]},"p03"),nC=u(function(r){return[[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop]]},"p04"),iC=u(function(r){return[[r.bottomright,0],[r.bottomleft,0],[1,r.righttop],[1,r.rightbottom]]},"p05"),oC=u(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.topleft,1],[r.topright,1]]},"p06"),sC=u(function(r){return[[0,r.leftbottom],[0,r.lefttop],[r.topleft,1],[r.topright,1]]},"p07"),fR=u(function(r){return[[0,0],[0,r.leftbottom],[1,r.rightbottom],[1,0]]},"p08"),dR=u(function(r){return[[1,0],[r.bottomright,0],[r.topright,1],[1,1]]},"p09"),mR=u(function(r){return[[1,1],[1,r.righttop],[0,r.lefttop],[0,1]]},"p10"),gR=u(function(r){return[[r.bottomleft,0],[0,0],[0,1],[r.topleft,1]]},"p11"),yR=u(function(r){return[[1,r.righttop],[1,r.rightbottom],[0,r.leftbottom],[0,r.lefttop]]},"p12"),vR=u(function(r){return[[r.topleft,1],[r.topright,1],[r.bottomright,0],[r.bottomleft,0]]},"p13"),bR=u(function(){return[[0,0],[0,1],[1,1],[1,0]]},"p14"),xR=u(function(r){return[[1,r.rightbottom],[1,0],[0,0],[0,1],[r.topleft,1]]},"p15"),_R=u(function(r){return[[r.topright,1],[1,1],[1,0],[0,0],[0,r.leftbottom]]},"p16"),CR=u(function(r){return[[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[1,1]]},"p17"),SR=u(function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,1]]},"p18"),IR=u(function(r){return[[1,r.righttop],[1,r.rightbottom],[0,r.lefttop],[0,1],[r.topleft,1]]},"p19"),MR=u(function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[r.topright,1]]},"p20"),wR=u(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop]]},"p21"),TR=u(function(r){return[[r.topright,1],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topleft,1]]},"p22"),PR=u(function(r){return[[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1],[r.topleft,1]]},"p23"),ER=u(function(r){return[[1,1],[1,r.righttop],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},"p24"),OR=u(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[r.topleft,1],[r.topright,1]]},"p25"),DR=u(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,r.leftbottom]]},"p26"),LR=u(function(r){return[[1,r.rightbottom],[1,0],[0,0],[0,r.leftbottom],[r.topleft,1],[r.topright,1]]},"p27"),AR=u(function(r){return[[1,1],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},"p28"),NR=u(function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1]]},"p29"),kR=u(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,1],[r.topleft,1]]},"p30"),RR=u(function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topright,1]]},"p31"),FR=u(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[r.topleft,1]]},"p32"),BR=u(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"),GR=u(function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topright,1]]},"p34"),VR=u(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[r.topleft,1]]},"p35"),jR=u(function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},"p36"),UR=u(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topleft,1],[r.topright,1]]},"p37"),zR=u(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1],[r.topleft,1]]},"p38"),HR=u(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]=Q_;kt[4]=kt[166]=tC;kt[16]=kt[154]=eC;kt[64]=kt[106]=rC;kt[168]=kt[2]=nC;kt[162]=kt[8]=iC;kt[138]=kt[32]=oC;kt[42]=kt[128]=sC;kt[5]=kt[165]=fR;kt[20]=kt[150]=dR;kt[80]=kt[90]=mR;kt[65]=kt[105]=gR;kt[160]=kt[10]=yR;kt[130]=kt[40]=vR;kt[85]=bR;kt[101]=kt[69]=xR;kt[149]=kt[21]=_R;kt[86]=kt[84]=CR;kt[89]=kt[81]=SR;kt[96]=kt[74]=IR;kt[24]=kt[146]=MR;kt[6]=kt[164]=wR;kt[129]=kt[41]=TR;kt[66]=kt[104]=PR;kt[144]=kt[26]=ER;kt[36]=kt[134]=OR;kt[9]=kt[161]=DR;kt[37]=kt[133]=LR;kt[148]=kt[22]=AR;kt[82]=kt[88]=NR;kt[73]=kt[97]=kR;kt[145]=kt[25]=RR;kt[70]=kt[100]=FR;kt[34]=function(r){return[sC(r),iC(r)]};kt[35]=BR;kt[136]=function(r){return[oC(r),nC(r)]};kt[153]=function(r){return[eC(r),Q_(r)]};kt[102]=function(r){return[tC(r),rC(r)]};kt[155]=GR;kt[103]=VR;kt[152]=function(r){return[eC(r),nC(r)]};kt[156]=jR;kt[137]=function(r){return[oC(r),Q_(r)]};kt[139]=UR;kt[98]=function(r){return[iC(r),rC(r)]};kt[99]=zR;kt[38]=function(r){return[tC(r),sC(r)]};kt[39]=HR;y();y();y();y();y();y();y();y();function YR(r){return(r>0)-(r<0)||+r}u(YR,"mathSign");function ed(r,e,t){var n=e[0]-r[0],i=e[1]-r[1],a=t[0]-e[0],l=t[1]-e[1];return YR(n*l-a*i)}u(ed,"orientationIndex");function F5(r,e){var t=r.geometry.coordinates[0].map(function(l){return l[0]}),n=r.geometry.coordinates[0].map(function(l){return l[1]}),i=e.geometry.coordinates[0].map(function(l){return l[0]}),a=e.geometry.coordinates[0].map(function(l){return l[1]});return Math.max.apply(null,t)===Math.max.apply(null,i)&&Math.max.apply(null,n)===Math.max.apply(null,a)&&Math.min.apply(null,t)===Math.min.apply(null,i)&&Math.min.apply(null,n)===Math.min.apply(null,a)}u(F5,"envelopeIsEqual");function aC(r,e){return e.geometry.coordinates[0].every(function(t){return an(Ar(t),r)})}u(aC,"envelopeContains");function B5(r,e){return r[0]===e[0]&&r[1]===e[1]}u(B5,"coordinatesEqual");var qR=function(){function r(e){this.id=r.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return u(r,"Node"),r.buildId=function(e){return e.join(",")},r.prototype.removeInnerEdge=function(e){this.innerEdges=this.innerEdges.filter(function(t){return t.from.id!==e.from.id})},r.prototype.removeOuterEdge=function(e){this.outerEdges=this.outerEdges.filter(function(t){return t.to.id!==e.to.id})},r.prototype.addOuterEdge=function(e){this.outerEdges.push(e),this.outerEdgesSorted=!1},r.prototype.sortOuterEdges=function(){var e=this;this.outerEdgesSorted||(this.outerEdges.sort(function(t,n){var i=t.to,a=n.to;if(i.coordinates[0]-e.coordinates[0]>=0&&a.coordinates[0]-e.coordinates[0]<0)return 1;if(i.coordinates[0]-e.coordinates[0]<0&&a.coordinates[0]-e.coordinates[0]>=0)return-1;if(i.coordinates[0]-e.coordinates[0]===0&&a.coordinates[0]-e.coordinates[0]===0)return i.coordinates[1]-e.coordinates[1]>=0||a.coordinates[1]-e.coordinates[1]>=0?i.coordinates[1]-a.coordinates[1]:a.coordinates[1]-i.coordinates[1];var l=ed(e.coordinates,i.coordinates,a.coordinates);if(l<0)return 1;if(l>0)return-1;var h=Math.pow(i.coordinates[0]-e.coordinates[0],2)+Math.pow(i.coordinates[1]-e.coordinates[1],2),d=Math.pow(a.coordinates[0]-e.coordinates[0],2)+Math.pow(a.coordinates[1]-e.coordinates[1],2);return h-d}),this.outerEdgesSorted=!0)},r.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},r.prototype.getOuterEdge=function(e){return this.sortOuterEdges(),this.outerEdges[e]},r.prototype.addInnerEdge=function(e){this.innerEdges.push(e)},r}(),lC=qR;y();var WR=function(){function r(e,t){this.from=e,this.to=t,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 u(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(e){return this.from.id===e.from.id&&this.to.id===e.to.id},r.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},r.prototype.toLineString=function(){return Pn([this.from.coordinates,this.to.coordinates])},r.prototype.compareTo=function(e){return ed(e.from.coordinates,e.to.coordinates,this.to.coordinates)},r}(),G5=WR;y();var ZR=function(){function r(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return u(r,"EdgeRing"),r.prototype.push=function(e){this.edges.push(e),this.polygon=this.envelope=void 0},r.prototype.get=function(e){return this.edges[e]},Object.defineProperty(r.prototype,"length",{get:u(function(){return this.edges.length},"get"),enumerable:!0,configurable:!0}),r.prototype.forEach=function(e){this.edges.forEach(e)},r.prototype.map=function(e){return this.edges.map(e)},r.prototype.some=function(e){return this.edges.some(e)},r.prototype.isValid=function(){return!0},r.prototype.isHole=function(){var e=this,t=this.edges.reduce(function(l,h,d){return h.from.coordinates[1]>e.edges[l].from.coordinates[1]&&(l=d),l},0),n=(t===0?this.length:t)-1,i=(t+1)%this.length,a=ed(this.edges[n].from.coordinates,this.edges[t].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 V2(this.edges.map(function(e){return e.from.coordinates}))},r.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var e=this.edges.map(function(t){return t.from.coordinates});return e.push(this.edges[0].from.coordinates),this.polygon=jr([e])},r.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=c_(this.toPolygon())},r.findEdgeRingContaining=function(e,t){var n=e.getEnvelope(),i,a;return t.forEach(function(l){var h=l.getEnvelope();if(a&&(i=a.getEnvelope()),!F5(h,n)&&aC(h,n)){for(var d=e.map(function(w){return w.from.coordinates}),m=void 0,v=u(function(w){l.some(function(P){return B5(w,P.from.coordinates)})||(m=w)},"_loop_1"),x=0,S=d;x<S.length;x++){var I=S[x];v(I)}m&&l.inside(Ar(m))&&(!a||aC(i,h))&&(a=l)}}),a},r.prototype.inside=function(e){return an(e,this.toPolygon())},r}(),uC=ZR;function $R(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")}u($R,"validateGeoJson");var Dct=function(){function r(){this.edges=[],this.nodes={}}return u(r,"Graph"),r.fromGeoJson=function(e){$R(e);var t=new r;return ri(e,function(n){Z2(n,"LineString","Graph::fromGeoJson"),NT(n,function(i,a){if(i){var l=t.getNode(i),h=t.getNode(a);t.addEdge(l,h)}return a})}),t},r.prototype.getNode=function(e){var t=lC.buildId(e),n=this.nodes[t];return n||(n=this.nodes[t]=new lC(e)),n},r.prototype.addEdge=function(e,t){var n=new G5(e,t),i=n.getSymetric();this.edges.push(n),this.edges.push(i)},r.prototype.deleteDangles=function(){var e=this;Object.keys(this.nodes).map(function(t){return e.nodes[t]}).forEach(function(t){return e._removeIfDangle(t)})},r.prototype._removeIfDangle=function(e){var t=this;if(e.innerEdges.length<=1){var n=e.getOuterEdges().map(function(i){return i.to});this.removeNode(e),n.forEach(function(i){return t._removeIfDangle(i)})}},r.prototype.deleteCutEdges=function(){var e=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(t){t.label===t.symetric.label&&(e.removeEdge(t.symetric),e.removeEdge(t))})},r.prototype._computeNextCWEdges=function(e){var t=this;typeof e>"u"?Object.keys(this.nodes).forEach(function(n){return t._computeNextCWEdges(t.nodes[n])}):e.getOuterEdges().forEach(function(n,i){e.getOuterEdge((i===0?e.getOuterEdges().length:i)-1).symetric.next=n})},r.prototype._computeNextCCWEdges=function(e,t){for(var n=e.getOuterEdges(),i,a,l=n.length-1;l>=0;--l){var h=n[l],d=h.symetric,m=void 0,v=void 0;h.label===t&&(m=h),d.label===t&&(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 e=[],t=0;return this.edges.forEach(function(n){if(!(n.label>=0)){e.push(n);var i=n;do i.label=t,i=i.next;while(!n.isEqual(i));t++}}),e},r.prototype.getEdgeRings=function(){var e=this;this._computeNextCWEdges(),this.edges.forEach(function(n){n.label=void 0}),this._findLabeledEdgeRings().forEach(function(n){e._findIntersectionNodes(n).forEach(function(i){e._computeNextCCWEdges(i,n.label)})});var t=[];return this.edges.forEach(function(n){n.ring||t.push(e._findEdgeRing(n))}),t},r.prototype._findIntersectionNodes=function(e){var t=[],n=e,i=u(function(){var a=0;n.from.getOuterEdges().forEach(function(l){l.label===e.label&&++a}),a>1&&t.push(n.from),n=n.next},"_loop_1");do i();while(!e.isEqual(n));return t},r.prototype._findEdgeRing=function(e){var t=e,n=new uC;do n.push(t),t.ring=n,t=t.next;while(!e.isEqual(t));return n},r.prototype.removeNode=function(e){var t=this;e.getOuterEdges().forEach(function(n){return t.removeEdge(n)}),e.innerEdges.forEach(function(n){return t.removeEdge(n)}),delete this.nodes[e.id]},r.prototype.removeEdge=function(e){this.edges=this.edges.filter(function(t){return!t.isEqual(e)}),e.deleteEdge()},r}();y();function JR(r,e){var t=!0;return ri(r,function(n){ri(e,function(i){if(t===!1)return!1;t=KR(n.geometry,i.geometry)})}),t}u(JR,"booleanDisjoint");function KR(r,e){switch(r.type){case"Point":switch(e.type){case"Point":return!rF(r.coordinates,e.coordinates);case"LineString":return!V5(e,r);case"Polygon":return!an(r,e)}break;case"LineString":switch(e.type){case"Point":return!V5(r,e);case"LineString":return!QR(r,e);case"Polygon":return!j5(e,r)}break;case"Polygon":switch(e.type){case"Point":return!an(e,r);case"LineString":return!j5(r,e);case"Polygon":return!tF(e,r)}}return!1}u(KR,"disjoint");function V5(r,e){for(var t=0;t<r.coordinates.length-1;t++)if(eF(r.coordinates[t],r.coordinates[t+1],e.coordinates))return!0;return!1}u(V5,"isPointOnLine");function QR(r,e){var t=za(r,e);return t.features.length>0}u(QR,"isLineOnLine");function j5(r,e){for(var t=0,n=e.coordinates;t<n.length;t++){var i=n[t];if(an(i,r))return!0}var a=za(e,bp(r));return a.features.length>0}u(j5,"isLineInPoly");function tF(r,e){for(var t=0,n=r.coordinates[0];t<n.length;t++){var i=n[t];if(an(i,e))return!0}for(var a=0,l=e.coordinates[0];a<l.length;a++){var h=l[a];if(an(h,r))return!0}var d=za(bp(r),bp(e));return d.features.length>0}u(tF,"isPolyInPoly");function eF(r,e,t){var n=t[0]-r[0],i=t[1]-r[1],a=e[0]-r[0],l=e[1]-r[1],h=n*l-i*a;return h!==0?!1:Math.abs(a)>=Math.abs(l)?a>0?r[0]<=t[0]&&t[0]<=e[0]:e[0]<=t[0]&&t[0]<=r[0]:l>0?r[1]<=t[1]&&t[1]<=e[1]:e[1]<=t[1]&&t[1]<=r[1]}u(eF,"isPointOnLineSegment");function rF(r,e){return r[0]===e[0]&&r[1]===e[1]}u(rF,"compareCoords");var cC=JR;y();y();y();var sF=Wr(pC(),1);y();var aF=Wr(pC(),1);y();function bg(r,e){var t=!1;return ri(r,function(n){ri(e,function(i){if(t===!0)return!0;t=!cC(n.geometry,i.geometry)})}),t}u(bg,"booleanIntersects");y();var lF=Wr(Z5(),1);y();var mF=Wr(o6(),1);y();y();function a6(r){for(var e=r,t=[];e.parent;)t.unshift(e),e=e.parent;return t}u(a6,"pathTo");function yF(){return new l6(function(r){return r.f})}u(yF,"getHeap");var mC={search:u(function(r,e,t,n){r.cleanDirty(),n=n||{};var i=n.heuristic||mC.heuristics.manhattan,a=n.closest||!1,l=yF(),h=e;for(e.h=i(e,t),l.push(e);l.size()>0;){var d=l.pop();if(d===t)return a6(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,t),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?l.rescoreElement(S):l.push(S))}}}return a?a6(h):[]},"search"),heuristics:{manhattan:u(function(r,e){var t=Math.abs(e.x-r.x),n=Math.abs(e.y-r.y);return t+n},"manhattan"),diagonal:u(function(r,e){var t=1,n=Math.sqrt(2),i=Math.abs(e.x-r.x),a=Math.abs(e.y-r.y);return t*(i+a)+(n-2*t)*Math.min(i,a)},"diagonal")},cleanNode:u(function(r){r.f=0,r.g=0,r.h=0,r.visited=!1,r.closed=!1,r.parent=null},"cleanNode")};function xg(r,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var t=0;t<r.length;t++){this.grid[t]=[];for(var n=0,i=r[t];n<i.length;n++){var a=new Pv(t,n,i[n]);this.grid[t][n]=a,this.nodes.push(a)}}this.init()}u(xg,"Graph");xg.prototype.init=function(){this.dirtyNodes=[];for(var r=0;r<this.nodes.length;r++)mC.cleanNode(this.nodes[r])};xg.prototype.cleanDirty=function(){for(var r=0;r<this.dirtyNodes.length;r++)mC.cleanNode(this.dirtyNodes[r]);this.dirtyNodes=[]};xg.prototype.markDirty=function(r){this.dirtyNodes.push(r)};xg.prototype.neighbors=function(r){var e=[],t=r.x,n=r.y,i=this.grid;return i[t-1]&&i[t-1][n]&&e.push(i[t-1][n]),i[t+1]&&i[t+1][n]&&e.push(i[t+1][n]),i[t]&&i[t][n-1]&&e.push(i[t][n-1]),i[t]&&i[t][n+1]&&e.push(i[t][n+1]),this.diagonal&&(i[t-1]&&i[t-1][n-1]&&e.push(i[t-1][n-1]),i[t+1]&&i[t+1][n-1]&&e.push(i[t+1][n-1]),i[t-1]&&i[t-1][n+1]&&e.push(i[t-1][n+1]),i[t+1]&&i[t+1][n+1]&&e.push(i[t+1][n+1])),e};xg.prototype.toString=function(){for(var r=[],e=this.grid,t,n,i,a,l=0,h=e.length;l<h;l++){for(t=[],n=e[l],i=0,a=n.length;i<a;i++)t.push(n[i].weight);r.push(t.join(" "))}return r.join("\n")};function Pv(r,e,t){this.x=r,this.y=e,this.weight=t}u(Pv,"GridNode");Pv.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Pv.prototype.getCost=function(r){return r&&r.x!==this.x&&r.y!==this.y?this.weight*1.41421:this.weight};Pv.prototype.isWall=function(){return this.weight===0};function l6(r){this.content=[],this.scoreFunction=r}u(l6,"BinaryHeap");l6.prototype={push:u(function(r){this.content.push(r),this.sinkDown(this.content.length-1)},"push"),pop:u(function(){var r=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),r},"pop"),remove:u(function(r){var e=this.content.indexOf(r),t=this.content.pop();e!==this.content.length-1&&(this.content[e]=t,this.scoreFunction(t)<this.scoreFunction(r)?this.sinkDown(e):this.bubbleUp(e))},"remove"),size:u(function(){return this.content.length},"size"),rescoreElement:u(function(r){this.sinkDown(this.content.indexOf(r))},"rescoreElement"),sinkDown:u(function(r){for(var e=this.content[r];r>0;){var t=(r+1>>1)-1,n=this.content[t];if(this.scoreFunction(e)<this.scoreFunction(n))this.content[t]=e,this.content[r]=n,r=t;else break}},"sinkDown"),bubbleUp:u(function(r){for(var e=this.content.length,t=this.content[r],n=this.scoreFunction(t);;){var i=r+1<<1,a=i-1,l=null,h;if(a<e){var d=this.content[a];h=this.scoreFunction(d),h<n&&(l=a)}if(i<e){var m=this.content[i],v=this.scoreFunction(m);v<(l===null?n:h)&&(l=i)}if(l!==null)this.content[r]=this.content[l],this.content[l]=t,r=l;else break}},"bubbleUp")};y();y();y();y();y();y();y();y();function gC(){this._=null}u(gC,"RedBlackTree");function nd(r){r.U=r.C=r.L=r.R=r.P=r.N=null}u(nd,"RedBlackNode");gC.prototype={constructor:gC,insert:u(function(r,e){var t,n,i;if(r){if(e.P=r,e.N=r.N,r.N&&(r.N.P=e),r.N=e,r.R){for(r=r.R;r.L;)r=r.L;r.L=e}else r.R=e;t=r}else this._?(r=u6(this._),e.P=null,e.N=r,r.P=r.L=e,t=r):(e.P=e.N=null,this._=e,t=null);for(e.L=e.R=null,e.U=t,e.C=!0,r=e;t&&t.C;)n=t.U,t===n.L?(i=n.R,i&&i.C?(t.C=i.C=!1,n.C=!0,r=n):(r===t.R&&(_g(this,t),r=t,t=r.U),t.C=!1,n.C=!0,Cg(this,n))):(i=n.L,i&&i.C?(t.C=i.C=!1,n.C=!0,r=n):(r===t.L&&(Cg(this,t),r=t,t=r.U),t.C=!1,n.C=!0,_g(this,n))),t=r.U;this._.C=!1},"insert"),remove:u(function(r){r.N&&(r.N.P=r.P),r.P&&(r.P.N=r.N),r.N=r.P=null;var e=r.U,t,n=r.L,i=r.R,a,l;if(n?i?a=u6(i):a=n:a=i,e?e.L===r?e.L=a:e.R=a:this._=a,n&&i?(l=a.C,a.C=r.C,a.L=n,n.U=a,a!==i?(e=a.U,a.U=r.U,r=a.R,e.L=r,a.R=i,i.U=a):(a.U=e,e=a,r=a.R)):(l=r.C,r=a),r&&(r.U=e),!l){if(r&&r.C){r.C=!1;return}do{if(r===this._)break;if(r===e.L){if(t=e.R,t.C&&(t.C=!1,e.C=!0,_g(this,e),t=e.R),t.L&&t.L.C||t.R&&t.R.C){(!t.R||!t.R.C)&&(t.L.C=!1,t.C=!0,Cg(this,t),t=e.R),t.C=e.C,e.C=t.R.C=!1,_g(this,e),r=this._;break}}else if(t=e.L,t.C&&(t.C=!1,e.C=!0,Cg(this,e),t=e.L),t.L&&t.L.C||t.R&&t.R.C){(!t.L||!t.L.C)&&(t.R.C=!1,t.C=!0,_g(this,t),t=e.L),t.C=e.C,e.C=t.L.C=!1,Cg(this,e),r=this._;break}t.C=!0,r=e,e=e.U}while(!r.C);r&&(r.C=!1)}},"remove")};function _g(r,e){var t=e,n=e.R,i=t.U;i?i.L===t?i.L=n:i.R=n:r._=n,n.U=i,t.U=n,t.R=n.L,t.R&&(t.R.U=t),n.L=t}u(_g,"RedBlackRotateLeft");function Cg(r,e){var t=e,n=e.L,i=t.U;i?i.L===t?i.L=n:i.R=n:r._=n,n.U=i,t.U=n,t.L=n.R,t.L&&(t.L.U=t),n.R=t}u(Cg,"RedBlackRotateRight");function u6(r){for(;r.L;)r=r.L;return r}u(u6,"RedBlackFirst");var yC=gC;y();y();function id(r,e,t,n){var i=[null,null],a=Si.push(i)-1;return i.left=r,i.right=e,t&&Sg(i,r,e,t),n&&Sg(i,e,r,n),vo[r.index].halfedges.push(a),vo[e.index].halfedges.push(a),i}u(id,"createEdge");function od(r,e,t){var n=[e,t];return n.left=r,n}u(od,"createBorderEdge");function Sg(r,e,t,n){!r[0]&&!r[1]?(r[0]=n,r.left=e,r.right=t):r.left===t?r[1]=n:r[0]=n}u(Sg,"setEdgeEnd");function vF(r,e,t,n,i){var a=r[0],l=r[1],h=a[0],d=a[1],m=l[0],v=l[1],x=0,S=1,I=m-h,w=v-d,P;if(P=e-h,!(!I&&P>0)){if(P/=I,I<0){if(P<x)return;P<S&&(S=P)}else if(I>0){if(P>S)return;P>x&&(x=P)}if(P=n-h,!(!I&&P<0)){if(P/=I,I<0){if(P>S)return;P>x&&(x=P)}else if(I>0){if(P<x)return;P<S&&(S=P)}if(P=t-d,!(!w&&P>0)){if(P/=w,w<0){if(P<x)return;P<S&&(S=P)}else if(w>0){if(P>S)return;P>x&&(x=P)}if(P=i-d,!(!w&&P<0)){if(P/=w,w<0){if(P>S)return;P>x&&(x=P)}else if(w>0){if(P<x)return;P<S&&(S=P)}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}}}}}u(vF,"clipEdge");function bF(r,e,t,n,i){var a=r[1];if(a)return!0;var l=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,P,E;if(S===v){if(I<e||I>=n)return;if(m>x){if(!l)l=[I,t];else if(l[1]>=i)return;a=[I,i]}else{if(!l)l=[I,i];else if(l[1]<t)return;a=[I,t]}}else if(P=(m-x)/(S-v),E=w-P*I,P<-1||P>1)if(m>x){if(!l)l=[(t-E)/P,t];else if(l[1]>=i)return;a=[(i-E)/P,i]}else{if(!l)l=[(i-E)/P,i];else if(l[1]<t)return;a=[(t-E)/P,t]}else if(v<S){if(!l)l=[e,P*e+E];else if(l[0]>=n)return;a=[n,P*n+E]}else{if(!l)l=[n,P*n+E];else if(l[0]<e)return;a=[e,P*e+E]}return r[0]=l,r[1]=a,!0}u(bF,"connectEdge");function c6(r,e,t,n){for(var i=Si.length,a;i--;)(!bF(a=Si[i],r,e,t,n)||!vF(a,r,e,t,n)||!(Math.abs(a[0][0]-a[1][0])>zr||Math.abs(a[0][1]-a[1][1])>zr))&&delete Si[i]}u(c6,"clipEdges");function p6(r){return vo[r.index]={site:r,halfedges:[]}}u(p6,"createCell");function xF(r,e){var t=r.site,n=e.left,i=e.right;return t===i&&(i=n,n=t),i?Math.atan2(i[1]-n[1],i[0]-n[0]):(t===n?(n=e[1],i=e[0]):(n=e[0],i=e[1]),Math.atan2(n[0]-i[0],i[1]-n[1]))}u(xF,"cellHalfedgeAngle");function vC(r,e){return e[+(e.left!==r.site)]}u(vC,"cellHalfedgeStart");function _F(r,e){return e[+(e.left===r.site)]}u(_F,"cellHalfedgeEnd");function h6(){for(var r=0,e=vo.length,t,n,i,a;r<e;++r)if((t=vo[r])&&(a=(n=t.halfedges).length)){var l=new Array(a),h=new Array(a);for(i=0;i<a;++i)l[i]=i,h[i]=xF(t,Si[n[i]]);for(l.sort(function(d,m){return h[m]-h[d]}),i=0;i<a;++i)h[i]=n[l[i]];for(i=0;i<a;++i)n[i]=h[i]}}u(h6,"sortCellHalfedges");function f6(r,e,t,n){var i=vo.length,a,l,h,d,m,v,x,S,I,w,P,E,O=!0;for(a=0;a<i;++a)if(l=vo[a]){for(h=l.site,m=l.halfedges,d=m.length;d--;)Si[m[d]]||m.splice(d,1);for(d=0,v=m.length;d<v;)w=_F(l,Si[m[d]]),P=w[0],E=w[1],x=vC(l,Si[m[++d%v]]),S=x[0],I=x[1],(Math.abs(P-S)>zr||Math.abs(E-I)>zr)&&(m.splice(d,0,Si.push(od(h,w,Math.abs(P-r)<zr&&n-E>zr?[r,Math.abs(S-r)<zr?I:n]:Math.abs(E-n)<zr&&t-P>zr?[Math.abs(I-n)<zr?S:t,n]:Math.abs(P-t)<zr&&E-e>zr?[t,Math.abs(S-t)<zr?I:e]:Math.abs(E-e)<zr&&P-r>zr?[Math.abs(I-e)<zr?S:r,e]:null))-1),++v);v&&(O=!1)}if(O){var N,L,G,j=1/0;for(a=0,O=null;a<i;++a)(l=vo[a])&&(h=l.site,N=h[0]-r,L=h[1]-e,G=N*N+L*L,G<j&&(j=G,O=l));if(O){var $=[r,e],q=[r,n],k=[t,n],tt=[t,e];O.halfedges.push(Si.push(od(h=O.site,$,q))-1,Si.push(od(h,q,k))-1,Si.push(od(h,k,tt))-1,Si.push(od(h,tt,$))-1)}}for(a=0;a<i;++a)(l=vo[a])&&(l.halfedges.length||delete vo[a])}u(f6,"clipCells");y();var d6=[],Ev;function CF(){nd(this),this.x=this.y=this.arc=this.site=this.cy=null}u(CF,"Circle");function Sp(r){var e=r.P,t=r.N;if(!(!e||!t)){var n=e.site,i=r.site,a=t.site;if(n!==a){var l=i[0],h=i[1],d=n[0]-l,m=n[1]-h,v=a[0]-l,x=a[1]-h,S=2*(d*x-m*v);if(!(S>=-m6)){var I=d*d+m*m,w=v*v+x*x,P=(x*I-m*w)/S,E=(d*w-v*I)/S,O=d6.pop()||new CF;O.arc=r,O.site=i,O.x=P+l,O.y=(O.cy=E+h)+Math.sqrt(P*P+E*E),r.circle=O;for(var N=null,L=sd._;L;)if(O.y<L.y||O.y===L.y&&O.x<=L.x)if(L.L)L=L.L;else{N=L.P;break}else if(L.R)L=L.R;else{N=L;break}sd.insert(N,O),N||(Ev=O)}}}}u(Sp,"attachCircle");function Ip(r){var e=r.circle;e&&(e.P||(Ev=e.N),sd.remove(e),d6.push(e),nd(e),r.circle=null)}u(Ip,"detachCircle");var y6=[];function SF(){nd(this),this.edge=this.site=this.circle=null}u(SF,"Beach");function g6(r){var e=y6.pop()||new SF;return e.site=r,e}u(g6,"createBeach");function bC(r){Ip(r),Mp.remove(r),y6.push(r),nd(r)}u(bC,"detachBeach");function v6(r){var e=r.circle,t=e.x,n=e.cy,i=[t,n],a=r.P,l=r.N,h=[r];bC(r);for(var d=a;d.circle&&Math.abs(t-d.circle.x)<zr&&Math.abs(n-d.circle.cy)<zr;)a=d.P,h.unshift(d),bC(d),d=a;h.unshift(d),Ip(d);for(var m=l;m.circle&&Math.abs(t-m.circle.x)<zr&&Math.abs(n-m.circle.cy)<zr;)l=m.N,h.push(m),bC(m),m=l;h.push(m),Ip(m);var v=h.length,x;for(x=1;x<v;++x)m=h[x],d=h[x-1],Sg(m.edge,d.site,m.site,i);d=h[0],m=h[v-1],m.edge=id(d.site,m.site,null,i),Sp(d),Sp(m)}u(v6,"removeBeach");function b6(r){for(var e=r[0],t=r[1],n,i,a,l,h=Mp._;h;)if(a=x6(h,t)-e,a>zr)h=h.L;else if(l=e-IF(h,t),l>zr){if(!h.R){n=h;break}h=h.R}else{a>-zr?(n=h.P,i=h):l>-zr?(n=h,i=h.N):n=i=h;break}p6(r);var d=g6(r);if(Mp.insert(n,d),!(!n&&!i)){if(n===i){Ip(n),i=g6(n.site),Mp.insert(d,i),d.edge=i.edge=id(n.site,d.site),Sp(n),Sp(i);return}if(!i){d.edge=id(n.site,d.site);return}Ip(n),Ip(i);var m=n.site,v=m[0],x=m[1],S=r[0]-v,I=r[1]-x,w=i.site,P=w[0]-v,E=w[1]-x,O=2*(S*E-I*P),N=S*S+I*I,L=P*P+E*E,G=[(E*N-I*L)/O+v,(S*L-P*N)/O+x];Sg(i.edge,m,w,G),d.edge=id(m,r,null,G),i.edge=id(r,w,null,G),Sp(n),Sp(i)}}u(b6,"addBeach");function x6(r,e){var t=r.site,n=t[0],i=t[1],a=i-e;if(!a)return n;var l=r.P;if(!l)return-1/0;t=l.site;var h=t[0],d=t[1],m=d-e;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}u(x6,"leftBreakPoint");function IF(r,e){var t=r.N;if(t)return x6(t,e);var n=r.site;return n[1]===e?n[0]:1/0}u(IF,"rightBreakPoint");var zr=1e-6,m6=1e-12,Mp,vo,sd,Si;function MF(r,e,t){return(r[0]-t[0])*(e[1]-r[1])-(r[0]-e[0])*(t[1]-r[1])}u(MF,"triangleArea");function wF(r,e){return e[1]-r[1]||e[0]-r[0]}u(wF,"lexicographic");function Ov(r,e){var t=r.sort(wF).pop(),n,i,a;for(Si=[],vo=new Array(r.length),Mp=new yC,sd=new yC;;)if(a=Ev,t&&(!a||t[1]<a.y||t[1]===a.y&&t[0]<a.x))(t[0]!==n||t[1]!==i)&&(b6(t),n=t[0],i=t[1]),t=r.pop();else if(a)v6(a.arc);else break;if(h6(),e){var l=+e[0][0],h=+e[0][1],d=+e[1][0],m=+e[1][1];c6(l,h,d,m),f6(l,h,d,m)}this.edges=Si,this.cells=vo,Mp=sd=Si=vo=null}u(Ov,"Diagram");Ov.prototype={constructor:Ov,polygons:u(function(){var r=this.edges;return this.cells.map(function(e){var t=e.halfedges.map(function(n){return vC(e,r[n])});return t.data=e.site.data,t})},"polygons"),triangles:u(function(){var r=[],e=this.edges;return this.cells.forEach(function(t,n){if(h=(a=t.halfedges).length)for(var i=t.site,a,l=-1,h,d,m=e[a[h-1]],v=m.left===i?m.right:m.left;++l<h;)d=v,m=e[a[l]],v=m.left===i?m.right:m.left,d&&v&&n<d.index&&n<v.index&&MF(i,d,v)<0&&r.push([i.data,d.data,v.data])}),r},"triangles"),links:u(function(){return this.edges.filter(function(r){return r.right}).map(function(r){return{source:r.left.data,target:r.right.data}})},"links"),find:u(function(r,e,t){for(var n=this,i,a=n._found||0,l=n.cells.length,h;!(h=n.cells[a]);)if(++a>=l)return null;var d=r-h.site[0],m=e-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],P=e-I[1],E=w*w+P*P;E<v&&(v=E,a=I.index)}});while(a!==null);return n._found=i,t==null||v<=t*t?h.site:null},"find")};y();y();y();y();y();y();y();y();y();y();y();y();var NF=Wr(ad(),1);y();var PC=Wr(I6(),1);y();y();y();function bo(){return new Av}u(bo,"default");function Av(){this.reset()}u(Av,"Adder");Av.prototype={constructor:Av,reset:u(function(){this.s=this.t=0},"reset"),add:u(function(r){M6(Lv,r,this.t),M6(this,Lv.s,this.s),this.s?this.t+=Lv.t:this.s=Lv.t},"add"),valueOf:u(function(){return this.s},"valueOf")};var Lv=new Av;function M6(r,e,t){var n=r.s=e+t,i=n-e,a=n-i;r.t=e-a+(t-i)}u(M6,"add");y();var Pr=1e-6;var Rr=Math.PI,oi=Rr/2,Nv=Rr/4,Ya=Rr*2,wp=180/Rr,ko=Rr/180,On=Math.abs,ta=Math.atan,Ro=Math.atan2,gr=Math.cos;var kv=Math.exp;var Ig=Math.log;var Me=Math.sin;var Vi=Math.sqrt,Mg=Math.tan;function CC(r){return r>1?0:r<-1?Rr:Math.acos(r)}u(CC,"acos");function xo(r){return r>1?oi:r<-1?-oi:Math.asin(r)}u(xo,"asin");y();function ea(){}u(ea,"noop");y();var kF=bo(),dmt=bo();y();y();function Tp(r){var e=r[0],t=r[1],n=gr(t);return[n*gr(e),n*Me(e),Me(t)]}u(Tp,"cartesian");function wg(r,e){return[r[1]*e[2]-r[2]*e[1],r[2]*e[0]-r[0]*e[2],r[0]*e[1]-r[1]*e[0]]}u(wg,"cartesianCross");function Tg(r){var e=Vi(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=e,r[1]/=e,r[2]/=e}u(Tg,"cartesianNormalizeInPlace");var Pmt=bo();y();y();y();y();y();function T6(r,e){return[r>Rr?r-Ya:r<-Rr?r+Ya:r,e]}u(T6,"rotationIdentity");T6.invert=T6;y();y();function Rv(){var r=[],e;return{point:u(function(t,n){e.push([t,n])},"point"),lineStart:u(function(){r.push(e=[])},"lineStart"),lineEnd:ea,rejoin:u(function(){r.length>1&&r.push(r.pop().concat(r.shift()))},"rejoin"),result:u(function(){var t=r;return r=[],e=null,t},"result")}}u(Rv,"default");y();y();y();function Fv(r,e){return On(r[0]-e[0])<Pr&&On(r[1]-e[1])<Pr}u(Fv,"default");function Bv(r,e,t,n){this.x=r,this.z=e,this.o=t,this.e=n,this.v=!1,this.n=this.p=null}u(Bv,"Intersection");function Gv(r,e,t,n,i){var a=[],l=[],h,d;if(r.forEach(function(w){if(!((P=w.length-1)<=0)){var P,E=w[0],O=w[P],N;if(Fv(E,O)){for(i.lineStart(),h=0;h<P;++h)i.point((E=w[h])[0],E[1]);i.lineEnd();return}a.push(N=new Bv(E,w,null,!0)),l.push(N.o=new Bv(E,null,N,!1)),a.push(N=new Bv(O,w,null,!1)),l.push(N.o=new Bv(O,null,N,!0))}}),!!a.length){for(l.sort(e),P6(a),P6(l),h=0,d=l.length;h<d;++h)l[h].e=t=!t;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()}}}u(Gv,"default");function P6(r){if(e=r.length){for(var e,t=0,n=r[0],i;++t<e;)n.n=i=r[t],i.p=n,n=i;n.n=i=r[0],i.p=n}}u(P6,"link");y();y();y();function Yl(r,e){return r<e?-1:r>e?1:r>=e?0:NaN}u(Yl,"default");y();function Vv(r){return r.length===1&&(r=BF(r)),{left:u(function(e,t,n,i){for(n==null&&(n=0),i==null&&(i=e.length);n<i;){var a=n+i>>>1;r(e[a],t)<0?n=a+1:i=a}return n},"left"),right:u(function(e,t,n,i){for(n==null&&(n=0),i==null&&(i=e.length);n<i;){var a=n+i>>>1;r(e[a],t)>0?i=a:n=a+1}return n},"right")}}u(Vv,"default");function BF(r){return function(e,t){return Yl(r(e),t)}}u(BF,"ascendingComparator");var E6=Vv(Yl),GF=E6.right,VF=E6.left;y();y();y();y();y();y();y();y();y();var O6=Array.prototype,UF=O6.slice,zF=O6.map;y();y();y();y();var hyt=Math.sqrt(50),fyt=Math.sqrt(10),dyt=Math.sqrt(2);y();y();y();y();y();y();y();y();function Pg(r){for(var e=r.length,t,n=-1,i=0,a,l;++n<e;)i+=r[n].length;for(a=new Array(i);--e>=0;)for(l=r[e],t=l.length;--t>=0;)a[--i]=l[t];return a}u(Pg,"default");y();y();y();y();y();y();y();var JF=1e9,L0t=-JF;y();y();var SC=bo();function Uv(r,e){var t=e[0],n=e[1],i=[Me(t),-gr(t),0],a=0,l=0;SC.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+Nv,w=Me(I),P=gr(I),E=0;E<v;++E,S=N,w=G,P=j,x=O){var O=m[E],N=O[0],L=O[1]/2+Nv,G=Me(L),j=gr(L),$=N-S,q=$>=0?1:-1,k=q*$,tt=k>Rr,ut=w*G;if(SC.add(Ro(ut*q*Me(k),P*j+ut*gr(k))),a+=tt?$+q*Ya:$,tt^S>=t^N>=t){var at=wg(Tp(x),Tp(O));Tg(at);var H=wg(i,at);Tg(H);var St=(tt^$>=0?-1:1)*xo(H[2]);(n>St||n===St&&(at[0]||at[1]))&&(l+=tt^$>=0?1:-1)}}return(a<-Pr||a<Pr&&SC<-Pr)^l&1}u(Uv,"default");y();y();var Y0t=bo();y();y();y();y();y();var Svt=bo(),Ivt=bo();y();var tB=1/0;var Evt=-tB;y();y();function IC(r){this._context=r}u(IC,"PathContext");IC.prototype={_radius:4.5,pointRadius:u(function(r){return this._radius=r,this},"pointRadius"),polygonStart:u(function(){this._line=0},"polygonStart"),polygonEnd:u(function(){this._line=NaN},"polygonEnd"),lineStart:u(function(){this._point=0},"lineStart"),lineEnd:u(function(){this._line===0&&this._context.closePath(),this._point=NaN},"lineEnd"),point:u(function(r,e){switch(this._point){case 0:{this._context.moveTo(r,e),this._point=1;break}case 1:{this._context.lineTo(r,e);break}default:{this._context.moveTo(r+this._radius,e),this._context.arc(r,e,this._radius,0,Ya);break}}},"point"),result:ea};y();var Xvt=bo();y();function MC(){this._string=[]}u(MC,"PathString");MC.prototype={_radius:4.5,_circle:A6(4.5),pointRadius:u(function(r){return(r=+r)!==this._radius&&(this._radius=r,this._circle=null),this},"pointRadius"),polygonStart:u(function(){this._line=0},"polygonStart"),polygonEnd:u(function(){this._line=NaN},"polygonEnd"),lineStart:u(function(){this._point=0},"lineStart"),lineEnd:u(function(){this._line===0&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:u(function(r,e){switch(this._point){case 0:{this._string.push("M",r,",",e),this._point=1;break}case 1:{this._string.push("L",r,",",e);break}default:{this._circle==null&&(this._circle=A6(this._radius)),this._string.push("M",r,",",e,this._circle);break}}},"point"),result:u(function(){if(this._string.length){var r=this._string.join("");return this._string=[],r}else return null},"result")};function A6(r){return"m0,"+r+"a"+r+","+r+" 0 1,1 0,"+-2*r+"a"+r+","+r+" 0 1,1 0,"+2*r+"z"}u(A6,"circle");y();y();y();y();y();y();function zv(r,e,t,n){return function(i,a){var l=e(a),h=i.invert(n[0],n[1]),d=Rv(),m=e(d),v=!1,x,S,I,w={point:P,lineStart:O,lineEnd:N,polygonStart:u(function(){w.point=L,w.lineStart=G,w.lineEnd=j,S=[],x=[]},"polygonStart"),polygonEnd:u(function(){w.point=P,w.lineStart=O,w.lineEnd=N,S=Pg(S);var $=Uv(x,h);S.length?(v||(a.polygonStart(),v=!0),Gv(S,nB,$,t,a)):$&&(v||(a.polygonStart(),v=!0),a.lineStart(),t(null,null,1,a),a.lineEnd()),v&&(a.polygonEnd(),v=!1),S=x=null},"polygonEnd"),sphere:u(function(){a.polygonStart(),a.lineStart(),t(null,null,1,a),a.lineEnd(),a.polygonEnd()},"sphere")};function P($,q){var k=i($,q);r($=k[0],q=k[1])&&a.point($,q)}u(P,"point");function E($,q){var k=i($,q);l.point(k[0],k[1])}u(E,"pointLine");function O(){w.point=E,l.lineStart()}u(O,"lineStart");function N(){w.point=P,l.lineEnd()}u(N,"lineEnd");function L($,q){I.push([$,q]);var k=i($,q);m.point(k[0],k[1])}u(L,"pointRing");function G(){m.lineStart(),I=[]}u(G,"ringStart");function j(){L(I[0][0],I[0][1]),m.lineEnd();var $=m.clean(),q=d.result(),k,tt=q.length,ut,at,H;if(I.pop(),x.push(I),I=null,!!tt){if($&1){if(at=q[0],(ut=at.length-1)>0){for(v||(a.polygonStart(),v=!0),a.lineStart(),k=0;k<ut;++k)a.point((H=at[k])[0],H[1]);a.lineEnd()}return}tt>1&&$&2&&q.push(q.pop().concat(q.shift())),S.push(q.filter(rB))}}return u(j,"ringEnd"),w}}u(zv,"default");function rB(r){return r.length>1}u(rB,"validSegment");function nB(r,e){return((r=r.x)[0]<0?r[1]-oi-Pr:oi-r[1])-((e=e.x)[0]<0?e[1]-oi-Pr:oi-e[1])}u(nB,"compareIntersection");var iB=zv(function(){return!0},oB,aB,[-Rr,-oi]);function oB(r){var e=NaN,t=NaN,n=NaN,i;return{lineStart:u(function(){r.lineStart(),i=1},"lineStart"),point:u(function(a,l){var h=a>0?Rr:-Rr,d=On(a-e);On(d-Rr)<Pr?(r.point(e,t=(t+l)/2>0?oi:-oi),r.point(n,t),r.lineEnd(),r.lineStart(),r.point(h,t),r.point(a,t),i=0):n!==h&&d>=Rr&&(On(e-n)<Pr&&(e-=n*Pr),On(a-h)<Pr&&(a-=h*Pr),t=sB(e,t,a,l),r.point(n,t),r.lineEnd(),r.lineStart(),r.point(h,t),i=0),r.point(e=a,t=l),n=h},"point"),lineEnd:u(function(){r.lineEnd(),e=t=NaN},"lineEnd"),clean:u(function(){return 2-i},"clean")}}u(oB,"clipAntimeridianLine");function sB(r,e,t,n){var i,a,l=Me(r-t);return On(l)>Pr?ta((Me(e)*(a=gr(n))*Me(t)-Me(n)*(i=gr(e))*Me(r))/(i*a*l)):(e+n)/2}u(sB,"clipAntimeridianIntersect");function aB(r,e,t,n){var i;if(r==null)i=t*oi,n.point(-Rr,i),n.point(0,i),n.point(Rr,i),n.point(Rr,0),n.point(Rr,-i),n.point(0,-i),n.point(-Rr,-i),n.point(-Rr,0),n.point(-Rr,i);else if(On(r[0]-e[0])>Pr){var a=r[0]<e[0]?Rr:-Rr;i=t*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])}u(aB,"clipAntimeridianInterpolate");y();y();function Hv(r){return function(e){var t=new wC;for(var n in r)t[n]=r[n];return t.stream=e,t}}u(Hv,"transformer");function wC(){}u(wC,"TransformStream");wC.prototype={constructor:wC,point:u(function(r,e){this.stream.point(r,e)},"point"),sphere:u(function(){this.stream.sphere()},"sphere"),lineStart:u(function(){this.stream.lineStart()},"lineStart"),lineEnd:u(function(){this.stream.lineEnd()},"lineEnd"),polygonStart:u(function(){this.stream.polygonStart()},"polygonStart"),polygonEnd:u(function(){this.stream.polygonEnd()},"polygonEnd")};y();y();var Wbt=gr(30*ko);var cxt=Hv({point:u(function(r,e){this.stream.point(r*ko,e*ko)},"point")});y();y();y();y();function Xv(r){return function(e,t){var n=gr(e),i=gr(t),a=r(n*i);return[a*i*Me(e),a*Me(t)]}}u(Xv,"azimuthalRaw");function qa(r){return function(e,t){var n=Vi(e*e+t*t),i=r(n),a=Me(i),l=gr(i);return[Ro(e*a,n*l),xo(n&&t*a/n)]}}u(qa,"azimuthalInvert");var V6=Xv(function(r){return Vi(2/(1+r))});V6.invert=qa(function(r){return 2*xo(r/2)});y();var j6=Xv(function(r){return(r=CC(r))&&r/Me(r)});j6.invert=qa(function(r){return r});y();y();function TC(r,e){return[r,Ig(Mg((oi+e)/2))]}u(TC,"mercatorRaw");TC.invert=function(r,e){return[r,2*ta(kv(e))-oi]};y();y();function Yv(r,e){return[r,e]}u(Yv,"equirectangularRaw");Yv.invert=Yv;y();function U6(r,e){var t=gr(e),n=gr(r)*t;return[t*Me(r)/n,Me(e)/n]}u(U6,"gnomonicRaw");U6.invert=qa(ta);y();y();function z6(r,e){var t=e*e,n=t*t;return[r*(.8707-.131979*t+n*(-.013791+n*(.003971*t-.001529*n))),e*(1.007226+t*(.015085+n*(-.044475+.028874*t-.005916*n)))]}u(z6,"naturalEarth1Raw");z6.invert=function(r,e){var t=e,n=25,i;do{var a=t*t,l=a*a;t-=i=(t*(1.007226+a*(.015085+l*(-.044475+.028874*a-.005916*l)))-e)/(1.007226+a*(.015085*3+l*(-.044475*7+.028874*9*a-.005916*11*l)))}while(On(i)>Pr&&--n>0);return[r/(.8707+(a=t*t)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),t]};y();function H6(r,e){return[gr(e)*Me(r),Me(e)]}u(H6,"orthographicRaw");H6.invert=qa(xo);y();function X6(r,e){var t=gr(e),n=1+gr(r)*t;return[t*Me(r)/n,Me(e)/n]}u(X6,"stereographicRaw");X6.invert=qa(function(r){return 2*ta(r)});y();function Y6(r,e){return[Ig(Mg((oi+e)/2)),-r]}u(Y6,"transverseMercatorRaw");Y6.invert=function(r,e){return[-e,2*ta(kv(r))-oi]};y();var fB=Wr(ad(),1);y();var dB=Wr(ad(),1);y();var gB=Wr(ad(),1);y();y();var yB=Wr(ad(),1);y();y();y();y();function EC(r){var i,a,l,h,d,m;let e=((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((l=r.enterprise)==null?void 0:l.locationInstances)||[])e[v.id]=v;let t={};for(let v of r["floorstack.json"]||[])t[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":e,"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":t,floor:n}}}u(EC,"parseLocalePackToLanguagePack");function W6(r){return/^https?:\/\/cdn\.mappedin\.com/.test(r)}u(W6,"isMappedinCdnUrl");function Z6(r){let e=r.split("?")[1];return!!(e!=null&&e.includes("sv="))}u(Z6,"hasSasToken");function Ii(r,e){var n;let t=((n=r==null?void 0:r.properties)==null?void 0:n.id)||"unknown";if(r.geometry==null)return K.error('Cannot get the center coordinate for "'.concat(t,'" because it has no geometry.')),new ve({latitude:0,longitude:0,floorId:e});try{if(r.geometry.type==="LineString"){let[[i,a],[l,h]]=r.geometry.coordinates,d=(i+l)/2,m=(a+h)/2;return new ve({latitude:m,longitude:d,floorId:e})}else if(r.geometry.type==="Point"){let[i,a]=r.geometry.coordinates;return new ve({latitude:a,longitude:i,floorId:e})}else if(r.geometry.type==="Polygon"){let i=r;if(i.properties.center!=null){let[a,l]=i.properties.center;return new ve({latitude:l,longitude:a,floorId:e})}}}catch(i){}try{let[i,a]=ja(r).geometry.coordinates;return new ve({latitude:a,longitude:i,floorId:e})}catch(i){return K.error('Failed to get center coordinate for "'.concat(t,'" ').concat(i instanceof Error?i.stack:"")),new ve({latitude:0,longitude:0,floorId:e})}}u(Ii,"getCenterCoordinate");var Wa,_o,Ep,cc,Pp=class Pp extends ni{constructor(t,n){super(n.mvfData.properties.id);b(this,"__type",Pp.__type);F(this,Wa);F(this,_o,{});F(this,Ep);F(this,cc);V(this,Wa,t),V(this,Ep,n.floorId),V(this,cc,n.mvfData)}static is(t){return t.__type===Pp.__type}get locations(){return p(this,_o).locations?p(this,_o).locations:(p(this,_o).locations=(p(this,Wa).locationIdsByNodeId[this.id]||[]).map(t=>p(this,Wa).getById("enterprise-location",t)).filter(Boolean),p(this,_o).locations)}get space(){var t;return p(this,Wa).getById("space",(t=p(this,Wa).spaceIdsByNodeId[this.id])==null?void 0:t[0])}get floor(){let t=p(this,Wa).getById("floor",p(this,Ep));if(t==null)throw new Error("Floor ".concat(p(this,Ep)," not found!"));return t}get coordinate(){return p(this,_o).coordinate==null&&(p(this,_o).coordinate=Ii(p(this,cc),p(this,Ep))),p(this,_o).coordinate}get externalId(){var t;return(t=p(this,cc).properties.externalId)!=null?t:""}get neighbors(){if(p(this,_o).neighbours==null){let t=p(this,cc).properties.neighbors.map(n=>{let i=p(this,Wa).getById("node",n.id);if(i==null)throw new Error("Node ".concat(n.id," not found!"));return i});p(this,_o).neighbours=t}return p(this,_o).neighbours}get geoJSON(){return et(z({},p(this,cc)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Pp.__type,id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(t=>t.id)}}destroy(){for(let t of Object.keys(p(this,_o)))delete p(this,_o)[t]}};Wa=new WeakMap,_o=new WeakMap,Ep=new WeakMap,cc=new WeakMap,u(Pp,"Node"),b(Pp,"__type","node");var OC=Pp,ql=OC;y();y();var Op,DC=class DC{constructor(e,t){b(this,"id");F(this,Op);this.id=e}get geoJSONBoundingBox(){return p(this,Op)?p(this,Op):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(V(this,Op,Zn(this.geoJSON)),p(this,Op))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};Op=new WeakMap,u(DC,"BaseMapData");var ra=DC;var pc,Cs,na,ud,Eg,AC,Dp=class Dp extends ra{constructor(t,n){super(n.mvfData.id,t);F(this,Eg);b(this,"__type",Dp.__type);F(this,pc);F(this,Cs,{});F(this,na);F(this,ud);V(this,pc,t),V(this,na,n.mvfData),V(this,ud,n.facadeId)}static is(t){return t.__type===Dp.__type}get type(){return p(this,na).type}get name(){var t;return(t=gt(this,Eg,AC).call(this,"name"))!=null?t:""}get shortName(){var t;return(t=gt(this,Eg,AC).call(this,"shortName"))!=null?t:""}get externalId(){var t;return(t=p(this,na).externalId)!=null?t:""}get floors(){var t,n;if(p(this,Cs).floors==null){let i=((n=(t=p(this,na).floors)!=null?t:p(this,na).maps)!=null?n:[]).reduce((a,l)=>{let h=p(this,pc).floorsById[l];return h&&a.push(h),a},[]);i.length===0&&K.error("Floor stack ".concat(this.id," has no floors")),p(this,Cs).floors=i.sort((a,l)=>a.elevation-l.elevation)}return p(this,Cs).floors}get defaultFloor(){if(p(this,Cs).defaultFloor!=null)return p(this,Cs).defaultFloor;let t=p(this,na).defaultFloor?p(this,pc).getById("floor",p(this,na).defaultFloor):void 0;return p(this,Cs).defaultFloor=t||this.floors.reduce((n,i)=>Math.abs(i.elevation)<Math.abs(n.elevation)?i:n),p(this,Cs).defaultFloor}get facade(){return p(this,ud)?p(this,pc).facadesById[p(this,ud)]:void 0}toJSON(){return{__type:Dp.__type,id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(p(this,Cs)))delete p(this,Cs)[t]}};pc=new WeakMap,Cs=new WeakMap,na=new WeakMap,ud=new WeakMap,Eg=new WeakSet,AC=u(function(t){return p(this,pc).getPropTranslation(this.__type,t,this.id,p(this,na)[t])},"#translate"),u(Dp,"FloorStack"),b(Dp,"__type","floor-stack");var LC=Dp,Og=LC;y();y();y();y();y();y();var Dg,Wl,Lp=class Lp extends ni{constructor(t){super(String(Mr()));b(this,"__type",Lp.__type);F(this,Dg,{});F(this,Wl);V(this,Wl,t.mvfData)}static is(t){return t.__type===Lp.__type}get url(){return p(this,Wl).url}get name(){if("displayName"in p(this,Wl))return p(this,Wl).displayName;if("label"in p(this,Wl))return p(this,Wl).label}toJSON(){return{__type:Lp.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(p(this,Dg)))delete p(this,Dg)[t]}};Dg=new WeakMap,Wl=new WeakMap,u(Lp,"Hyperlink"),b(Lp,"__type","hyperlink");var NC=Lp,hc=NC;y();y();function Lg(r){return typeof r=="string"?r:r.id}u(Lg,"getId");function RC(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}u(RC,"isPosition");var kC=8,Za=u(r=>typeof r=="number"?r.toFixed(kC):RC(r)?r[1].toFixed(kC)+"-"+r[0].toFixed(kC):r.map(e=>Za(e)).join("-"),"serializeCoords"),MB=u(r=>{let e=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,t=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return e.test(r)||t.test(r)},"isPrivateCdnAsset"),qv=u(r=>{if(!MB(r))return null;let e="";r.startsWith("https://")?(e="https://",r=r.slice(8)):r.startsWith("http://")&&(e="http://",r=r.slice(7));let[t,n,i]=r.split("/");return{origin:e+t,mapId:n,fileName:i}},"parseCdnAssetUrl");var Ag,fc,Np,Ap=class Ap extends ni{constructor(t){super(String(Mr()));b(this,"__type",Ap.__type);F(this,Ag,{});F(this,fc);F(this,Np);V(this,fc,t.mvfData),V(this,Np,t.mapData)}static is(t){return t.__type===Ap.__type}get url(){let t=p(this,fc).url;if(p(this,Np).tokenManager==null)return t;let n=qv(p(this,fc).url);if(n==null)return t;let i=n.mapId;try{if(p(this,Np).tokenManager.isEnterpriseMode())return t;let a=p(this,Np).tokenManager.getSasToken(i).token;if(a==null||a==="")throw new Error("SAS token empty!");return"".concat(t,"?").concat(a)}catch(a){return K.error("Error getting SAS token for image",{error:a,url:t}),t}}get name(){return p(this,fc).altText}get altText(){return p(this,fc).altText}toJSON(){return{__type:Ap.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(p(this,Ag)))delete p(this,Ag)[t]}};Ag=new WeakMap,fc=new WeakMap,Np=new WeakMap,u(Ap,"ImageMetaData"),b(Ap,"__type","image");var FC=Ap,dc=FC;var cd,Zl,$l,BC=class BC extends ra{constructor(t,n){super(n.properties.id,t);F(this,cd);F(this,Zl);F(this,$l,{});V(this,cd,t),V(this,Zl,n)}get externalId(){var t;return(t=p(this,Zl).properties.externalId)!=null?t:""}get name(){var n,i,a,l;let t=(i=(n=p(this,Zl).properties.details)==null?void 0:n.name)!=null?i:"";return t===""&&(t=(l=(a=this.locationProfiles.find(h=>h.name&&h.name.length>0))==null?void 0:a.name)!=null?l:""),t}get description(){var n,i,a,l;let t=(i=(n=p(this,Zl).properties.details)==null?void 0:n.description)!=null?i:"";return t===""&&(t=(l=(a=this.locationProfiles.find(h=>h.description&&h.description.length>0))==null?void 0:a.description)!=null?l:""),t}get images(){var n,i,a,l,h;if(p(this,$l).images!=null)return p(this,$l).images;let t=(a=(i=(n=p(this,Zl).properties.details)==null?void 0:n.images)==null?void 0:i.map(d=>new dc({mvfData:d,mapData:p(this,cd)})))!=null?a:[];return(t==null||t.length===0)&&(t=(h=(l=this.locationProfiles.find(d=>d.images.length>0))==null?void 0:l.images)!=null?h:[]),p(this,$l).images=t,t}get links(){var n,i,a,l,h;if(p(this,$l).links!=null)return p(this,$l).links;let t=(a=(i=(n=p(this,Zl).properties.details)==null?void 0:n.links)==null?void 0:i.map(d=>new hc({mvfData:d})))!=null?a:[];return(t==null||t.length===0)&&(t=(h=(l=this.locationProfiles.find(d=>d.links.length>0))==null?void 0:l.links)!=null?h:[]),p(this,$l).links=t,t}get locationProfiles(){var t;return(t=p(this,cd).locationProfilesByAttachedFeatureId[this.id])!=null?t:[]}};cd=new WeakMap,Zl=new WeakMap,$l=new WeakMap,u(BC,"DetailedMapData");var ji=BC;var Ng,Rp,pd,hd,kp=class kp extends ji{constructor(t,n){super(t,n.mvfData);b(this,"__type",kp.__type);F(this,Ng);F(this,Rp);F(this,pd,{});F(this,hd);V(this,Ng,t),V(this,Rp,n.floorId),V(this,hd,n.mvfData)}static is(t){return t.__type===kp.__type}get center(){return p(this,pd).center==null&&(p(this,pd).center=Ii(p(this,hd),p(this,Rp))),p(this,pd).center}get floor(){let t=p(this,Ng).getById("floor",p(this,Rp));if(t==null)throw new Error("Floor ".concat(p(this,Rp)," not found!"));return t}get geoJSON(){return et(z({},p(this,hd)),{properties:null})}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{__type:kp.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Ng=new WeakMap,Rp=new WeakMap,pd=new WeakMap,hd=new WeakMap,u(kp,"Area"),b(kp,"__type","area");var GC=kp,Jl=GC;y();var Bp,Kl,Gp,fd,Fp=class Fp extends ji{constructor(t,n){super(t,n.mvfData);b(this,"__type",Fp.__type);F(this,Bp);F(this,Kl);F(this,Gp);F(this,fd);V(this,Kl,{}),V(this,fd,n.mvfData),V(this,Bp,t),V(this,Gp,n.floorId)}static is(t){return t.__type===Fp.__type}get floor(){let t=p(this,Bp).getById("floor",p(this,Gp));if(t==null)throw new Error("Floor ".concat(p(this,Gp)," not found!"));return t}get center(){return p(this,Kl).center==null&&(p(this,Kl).center=Ii(p(this,fd),p(this,Gp))),p(this,Kl).center}get isExterior(){var i;let t=p(this,Bp).obstructionIdByEntranceId[this.id],n=p(this,Bp).getMVFFeatureById("obstruction",t);return(i=n==null?void 0:n.properties.footprintComponent)!=null?i:!1}get geoJSON(){return et(z({},p(this,fd)),{properties:null})}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Fp.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of Object.keys(p(this,Kl)))delete p(this,Kl)[t]}};Bp=new WeakMap,Kl=new WeakMap,Gp=new WeakMap,fd=new WeakMap,u(Fp,"Door"),b(Fp,"__type","door");var VC=Fp,ia=VC;y();var mc,jp,is,$a,Vp=class Vp extends ji{constructor(t,n){super(t,n.mvfData);b(this,"__type",Vp.__type);F(this,mc);F(this,jp);F(this,is,{});F(this,$a);V(this,mc,t),V(this,jp,n.floorId),V(this,$a,n.mvfData)}getMvfData(){return p(this,$a)}static is(t){return t.__type===Vp.__type}get type(){return TB(p(this,$a).properties.kind)}get locations(){if(p(this,is).locations)return p(this,is).locations;p(this,is).locations=[];let t=p(this,mc).mvfLocationsBySpaceId[p(this,$a).properties.id];if((t==null?void 0:t.length)>0)for(let n of t){let i=p(this,mc).getById("enterprise-location",n.id);i&&p(this,is).locations.push(i)}return p(this,is).locations}get floor(){let t=p(this,mc).getById("floor",p(this,jp));if(t==null)throw new Error("Floor ".concat(p(this,jp)," not found!"));return t}get doors(){return p(this,$a).properties.destinationNodes.reduce((t,n)=>{let i=p(this,mc).doorsByNodeId[n];return i&&t.push(i),t},[])}get center(){return p(this,is).center==null&&(p(this,is).center=Ii(p(this,$a),p(this,jp))),p(this,is).center}get geoJSON(){return et(z({},p(this,$a)),{properties:null})}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Vp.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of Object.keys(p(this,is)))delete p(this,is)[t]}};mc=new WeakMap,jp=new WeakMap,is=new WeakMap,$a=new WeakMap,u(Vp,"Space"),b(Vp,"__type","space");var jC=Vp,wB=["room","hallway","exterior","void","gate","connection.stairs","connection.elevator","poi"];function TB(r){if(r==null||r==="default")return"room";let e=r.toLowerCase();return wB.includes(e)?e:"room"}u(TB,"validateSpaceType");var si=jC;y();var Ss,Fr,os,dd,Wv,Up=class Up extends ra{constructor(t,n){super(n.mvfData.properties.id,t);F(this,dd);b(this,"__type",Up.__type);F(this,Ss);F(this,Fr,{});F(this,os);V(this,Ss,t),V(this,os,n.mvfData)}static is(t){return t.__type===Up.__type}get focusTarget(){return this}get name(){var t,n;return"name"in p(this,os).properties?(n=gt(this,dd,Wv).call(this,"name"))!=null?n:"":(t=p(this,os).properties.externalId)!=null?t:""}get shortName(){var t,n;return"shortName"in p(this,os).properties?(n=gt(this,dd,Wv).call(this,"shortName"))!=null?n:"":(t=p(this,os).properties.externalId)!=null?t:""}get subtitle(){var t;return(t=gt(this,dd,Wv).call(this,"subtitle"))!=null?t:""}get externalId(){var t;return(t=p(this,os).properties.externalId)!=null?t:""}get elevation(){return p(this,os).properties.elevation}get spaces(){if(p(this,Fr).spaces==null){let t=p(this,Ss).spaces.filter(n=>n.floor.id===this.id);p(this,Fr).spaces=t}return p(this,Fr).spaces}get geoJSON(){var t;return{type:"Feature",properties:null,geometry:(t=p(this,os).geometry)!=null?t:{type:"Polygon",coordinates:[]}}}get objects(){if(p(this,Fr).objects==null){let t=p(this,Ss).objects.filter(n=>n.floor.id===this.id);p(this,Fr).objects=t}return p(this,Fr).objects}get connections(){if(p(this,Fr).connections==null){let t=p(this,Ss).connections.filter(n=>n.floors.includes(this));p(this,Fr).connections=t}return p(this,Fr).connections}get doors(){if(p(this,Fr).doors==null){let t=p(this,Ss).doors.filter(n=>n.floor.id===this.id);p(this,Fr).doors=t}return p(this,Fr).doors}get annotations(){if(p(this,Fr).annotations==null){let t=p(this,Ss).annotations.filter(n=>n.floor.id===this.id);p(this,Fr).annotations=t}return p(this,Fr).annotations}get pois(){if(p(this,Fr).pois==null){let t=p(this,Ss).pointsOfInterest.filter(n=>n.floor.id===this.id);p(this,Fr).pois=t}return p(this,Fr).pois}get floorStack(){if(p(this,Fr).floorStack==null){let t=p(this,Ss).floorStacks.find(n=>n.floors.includes(this));p(this,Fr).floorStack=t}return p(this,Fr).floorStack}get center(){return p(this,Fr).center==null&&(p(this,Fr).center=Ii(p(this,os),this.id)),p(this,Fr).center}toJSON(){return{__type:Up.__type,id:this.id,name:this.name,shortName:this.shortName,subtitle:this.subtitle,elevation:this.elevation,spaces:this.spaces.map(t=>t.id),objects:this.objects.map(t=>t.id),connections:this.connections.map(t=>t.id),doors:this.doors.map(t=>t.id),annotations:this.annotations.map(t=>t.id),pois:this.pois.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(p(this,Fr)))delete p(this,Fr)[t]}};Ss=new WeakMap,Fr=new WeakMap,os=new WeakMap,dd=new WeakSet,Wv=u(function(t){let n=p(this,os).properties[t];return p(this,Ss).getPropTranslation(this.__type,t,this.id,n)},"#translate"),u(Up,"Floor"),b(Up,"__type","floor");var UC=Up,Co=UC;y();y();y();var kg=u(r=>r!=null,"notNull");y();function Rg(r){let e;if(si.is(r)||ia.is(r)||Fo.is(r)||Jl.is(r)||Is.is(r))e=r.center;else if(Ql.is(r)||tu.is(r))e=r.coordinate;else if(ve.is(r))e=r;else if(ql.is(r))e=r.coordinate;else if(Ja.is(r))e=r.coordinates[0];else return;return e}u(Rg,"getCoordinateFromStuffs");y();y();var zp={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}},Ka="ExteriorWalls",gc="Walls",$6=0,md="InteriorDoors",gd="ExteriorDoors",Rn="GeometryLayer",eu="LabelsLayer",Qa="MarkersLayer",Fg="FootprintLayer",Hp="OcclusionLayer",tl="ImagesLayer",Xp="FacadesLayer";var J6=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],K6={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};var PB=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors","hideImagesNotOnCurrentFloor"]),EB=new Set(["style","enabled","layersHiddenByGeometry","lowDpi"]);function zC(r){var e,t;(e=r.outdoorView)!=null&&e.enabled&&!((t=r.outdoorView)!=null&&t.token)&&K.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}u(zC,"validateOptions");function HC(r,e){var i,a,l,h,d,m;let t=((i=r==null?void 0:r.outdoorView)==null?void 0:i.token)||e.outdoorViewToken,n=et(z(z({},zp),r),{outdoorView:z({enabled:((a=r==null?void 0:r.outdoorView)==null?void 0:a.enabled)===void 0?!!t:(l=r==null?void 0:r.outdoorView)==null?void 0:l.enabled,layersHiddenByGeometry:(h=zp.outdoorView)==null?void 0:h.layersHiddenByGeometry},r==null?void 0:r.outdoorView),bearing:(m=(d=r==null?void 0:r.bearing)!=null?d:e.naturalBearing)!=null?m:0,imagePlacementOptions:z(z({},zp.imagePlacementOptions),r==null?void 0:r.imagePlacementOptions),multiFloorView:z(z({},zp.multiFloorView),r==null?void 0:r.multiFloorView)});return t&&n.outdoorView&&(n.outdoorView.token=t),n}u(HC,"handleShow3DMapOptionDefault");function Q6(r){let e={remove_watermark:!1};if(r)try{let t=D0(r);Object.assign(e,t.capabilities)}catch(t){K.error("Error decoding capabilities from token",t)}return e}u(Q6,"handleTokenCapabilities");function t7(r){let e=Object.fromEntries(Object.entries(r).filter(([t])=>PB.has(t)));return e.outdoorView&&(e.outdoorView=Object.fromEntries(Object.entries(e.outdoorView).filter(([t])=>EB.has(t)))),e}u(t7,"getPublicOptions");var yc,Ms,ru,Yp=class Yp extends ji{constructor(t,n){let i=Object.values(n.mvfDataByFloorId)[0];super(t,i);b(this,"__type",Yp.__type);F(this,yc);F(this,Ms);F(this,ru);V(this,Ms,{}),V(this,yc,t),V(this,ru,n.mvfDataByFloorId)}static is(t){return t.__type===Yp.__type}get accessible(){var t;return(t=Object.values(p(this,ru))[0].properties.accessible)!=null?t:!1}get type(){var t,n;return(n=(t=Object.values(p(this,ru))[0].properties.kind)==null?void 0:t.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(p(this,ru))[0].properties.extra}get coordinates(){return p(this,Ms).coordinates==null&&(p(this,Ms).coordinates=Object.entries(p(this,ru)).map(([t,n])=>Ii(n,t))),p(this,Ms).coordinates}get nodes(){return Object.values(p(this,ru))[0].properties.nodes.map(t=>p(this,yc).getById("node",t))}get floors(){return this.coordinates.map(t=>t.floorId?p(this,yc).getById("floor",t.floorId):void 0).filter(kg)}get locationProfiles(){var n,i,a,l,h;if(p(this,Ms).locationProfiles!=null)return p(this,Ms).locationProfiles;let t=super.locationProfiles;if(t==null||t.length===0){let d=[(i=(n=this.coordinates[0])==null?void 0:n.longitude)!=null?i:0,(l=(a=this.coordinates[0])==null?void 0:a.latitude)!=null?l:0],m=Za(d),v=(h=p(this,yc).mvfConnectionIdsByLatLon[m])!=null?h:[];for(let x of v){let S=p(this,yc).locationProfilesByAttachedFeatureId[x];if(S!=null){t=S;break}}}return p(this,Ms).locationProfiles=t!=null?t:[],t}get focusTarget(){return this.coordinates}toJSON(){return{__type:Yp.__type,id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(t=>t.toJSON()),floors:this.floors.map(t=>t.id),extra:this.extra}}destroy(){for(let t of Object.keys(p(this,Ms)))delete p(this,Ms)[t]}};yc=new WeakMap,Ms=new WeakMap,ru=new WeakMap,u(Yp,"Connection"),b(Yp,"__type","connection");var XC=Yp,vc=XC;y();var Bg,Wp,bc,Zp,qp=class qp extends ji{constructor(t,n){super(t,n.mvfData);b(this,"__type",qp.__type);F(this,Bg);F(this,Wp);F(this,bc,{});F(this,Zp);V(this,Bg,t),V(this,Wp,n.floorId),V(this,Zp,n.mvfData)}static is(t){return t.__type===qp.__type}get type(){let t=p(this,Zp).properties.kind;return t==null&&(t="object"),t==="Desks"&&(t="desk"),t.toLowerCase()}get floor(){let t=p(this,Bg).getById("floor",p(this,Wp));if(t==null)throw new Error("Floor ".concat(p(this,Wp)," not found!"));return t}get center(){return p(this,bc).center==null&&(p(this,bc).center=Ii(p(this,Zp),p(this,Wp))),p(this,bc).center}get geoJSON(){return et(z({},p(this,Zp)),{properties:null})}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{__type:qp.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of globalThis.Object.keys(p(this,bc)))p(this,bc)[t]=null}};Bg=new WeakMap,Wp=new WeakMap,bc=new WeakMap,Zp=new WeakMap,u(qp,"MapObject"),b(qp,"__type","object");var YC=qp,Fo=YC;y();var Gg,Jp,xc,yd,$p=class $p extends ji{constructor(t,n){super(t,n.mvfData);b(this,"__type",$p.__type);F(this,Gg);F(this,Jp);F(this,xc,{});F(this,yd);V(this,Gg,t),V(this,yd,n.mvfData),V(this,Jp,n.floorId)}static is(t){return t.__type===$p.__type}get floor(){let t=p(this,Gg).getById("floor",p(this,Jp));if(t==null)throw new Error("Floor ".concat(p(this,Jp)," not found!"));return t}get coordinate(){return p(this,xc).coordinate==null&&(p(this,xc).coordinate=Ii(p(this,yd),p(this,Jp))),p(this,xc).coordinate}get geoJSON(){return et(z({},p(this,yd)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:$p.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let t in p(this,xc))p(this,xc)[t]=null}};Gg=new WeakMap,Jp=new WeakMap,xc=new WeakMap,yd=new WeakMap,u($p,"PointOfInterest"),b($p,"__type","point-of-interest");var qC=$p,Ql=qC;y();var Vg,Qp,_c,th,jg,ZC,Kp=class Kp extends ji{constructor(t,n){super(t,n.mvfData);F(this,jg);b(this,"__type",Kp.__type);F(this,Vg);F(this,Qp);F(this,_c,{});F(this,th);V(this,Vg,t),V(this,Qp,n.floorId),V(this,th,n.mvfData)}static is(t){return t.__type===Kp.__type}get group(){return gt(this,jg,ZC).call(this).group}get type(){return gt(this,jg,ZC).call(this).type}get coordinate(){return p(this,_c).coordinate==null&&(p(this,_c).coordinate=Ii(p(this,th),p(this,Qp))),p(this,_c).coordinate}get floor(){let t=p(this,Vg).getById("floor",p(this,Qp));if(t==null)throw new Error("Floor ".concat(p(this,Qp)," not found!"));return t}get geoJSON(){return et(z({},p(this,th)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Kp.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let t of Object.keys(p(this,_c)))delete p(this,_c)[t]}};Vg=new WeakMap,Qp=new WeakMap,_c=new WeakMap,th=new WeakMap,jg=new WeakSet,ZC=u(function(){let[t,n]=p(this,th).properties.symbolId.split("--");return{group:t,type:n}},"#getGroupAndTypeFromSymbolId"),u(Kp,"Annotation"),b(Kp,"__type","annotation");var WC=Kp,tu=WC;y();var OB=new Set(["wall","area"]),DB=new Set(["void","desk-entrance"]),LB=u((r,e)=>{var d,m,v,x,S,I,w,P,E,O,N;let t={},n={},i={},a={},l={},h={};for(let L of r["location.json"]||[]){let G=new eh(e,{mvfData:L});if(t[L.id]=G,L.externalId&&(a[L.externalId]==null&&(a[L.externalId]=[]),a[L.externalId].push(G)),L.categories)for(let $ of L.categories)l[$]==null&&(l[$]=[]),l[$].push(G);let j=[...(m=(d=L.obstructions)==null?void 0:d.map($=>$.id))!=null?m:[],...(x=(v=L.spaces)==null?void 0:v.map($=>$.id))!=null?x:[],...(I=(S=L.annotations)==null?void 0:S.map($=>$.id))!=null?I:[],...(w=L.connections)!=null?w:[],...(E=(P=L.entrances)==null?void 0:P.map($=>$.id))!=null?E:[],...(N=(O=L.areas)==null?void 0:O.map($=>$.id))!=null?N:[]];for(let $ of j)$&&(h[$]==null&&(h[$]=[]),h[$].push(G))}for(let L of r["category.json"]||[]){let G=new zg(e,{mvfData:L});n[L.id]=G,L.parent&&(i[L.parent]==null&&(i[L.parent]=[]),i[L.parent].push(G))}return{locationCategoriesByParentId:i,locationProfilesById:t,locationCategoriesById:n,locationProfilesByExternalId:a,locationProfilesByCategoryId:l,locationProfilesByAttachedFeatureId:h}},"processMVFLocationProfilesAndCategories"),AB=u((r,e,t)=>{var P,E;let n={},i={},a={},l={},h={},d={},m={},v={},x={},S={},I={},w=globalThis.Object.keys(r.space);for(let O of w){let N=r.space[O];if(N!=null){for(let L of N.features)if(I[L.properties.id]=O,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)),!DB.has((P=L.properties.kind)!=null?P:"")){if((E=L.properties.kind)!=null&&E.includes("connection")){let G=Za(L.geometry.coordinates);x[G]==null&&(x[G]=[]),x[G].push(L.properties.id);continue}if(L.properties.kind==="poi"){let G=new Ql(t,{floorId:O,mvfData:L});a[L.properties.id]=G,v[O]||(v[O]=[]),v[O].push(L),L.properties.externalId&&(l[L.properties.externalId]==null&&(l[L.properties.externalId]=[]),l[L.properties.externalId].push(G))}else{let G=new si(t,{floorId:O,mvfData:L});n[L.properties.id]=G,L.properties.externalId&&(i[L.properties.externalId]==null&&(i[L.properties.externalId]=[]),i[L.properties.externalId].push(G)),m[O]||(m[O]=[]),m[O].push(L)}}}}for(let O in x){let N=x[O],L={};for(let j of N){let $=I[j],q=d[j],k=e==null?void 0:e["n_"+q.properties.id.split("s_")[1]];L[$]=et(z({},q),{properties:et(z({},q.properties),{accessible:(k==null?void 0:k.accessible)===!0})})}let G=new vc(t,{mvfDataByFloorId:L});S[G.id]=G}return{spacesById:n,spacesByExternalId:i,poisById:a,poisByExternalId:l,connectionsById:S,objectEntranceNodeIdsByObstructionId:h,mvfSpacesById:d,connectionIdsByLatLon:x,mvfSpacesByFloorId:m,mvfPoisByFloorId:v}},"processMVFSpaces"),NB=u((r,e)=>{var l,h;let t={},n={},i={},a={};for(let d of r["node.geojson"].features){i[d.properties.id]=d;let m=new ql(e,{mvfData:d,floorId:(l=d.properties.floor)!=null?l:d.properties.map});t[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:t,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:a}},"processMVFNodes"),kB=u((r,e)=>{var h,d;let t={},n={},i={},a={},l=globalThis.Object.keys(r.obstruction);for(let m of l){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(OB.has((d=(h=x.properties.kind)==null?void 0:h.toLowerCase())!=null?d:""))continue;let S=new Fo(e,{floorId:m,mvfData:x});t[x.properties.id]=S,x.properties.externalId&&(n[x.properties.externalId]==null&&(n[x.properties.externalId]=[]),n[x.properties.externalId].push(S))}}return{objectsById:t,objectsByExternalId:n,mvfObstructionById:i,obstructionIdByEntranceId:a}},"processMVFObstructions"),RB=u((r,e)=>{let t={},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 l=new Co(e,{mvfData:a});t[a.properties.id]=l,a.properties.externalId&&(n[a.properties.externalId]==null&&(n[a.properties.externalId]=[]),n[a.properties.externalId].push(l))}else for(let a of r["map.geojson"]){i[a.id]=a;let l=new Co(e,{mvfData:{properties:a}});t[a.id]=l}return{floorsById:t,floorsByExternalId:n,mvfFloorsById:i}},"processMVFFloors"),FB=u((r,e)=>{var d;let t={},n={},i={},a={},l={},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 Og(e,{mvfData:m,facadeId:v==null?void 0:v.id});if(t[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 Is(e,{mvfData:v,floorStackId:m.id});a[v.id]=S;for(let I of v.spaces)l[I.spaceId]=S}}return{floorStacksById:t,floorStacksByExternalId:n,mvfFloorStacksById:i,facadesById:a,facadesBySpaceId:l}},"processMVFFloorStacks"),BB=u((r,e)=>{let t={},n={},i=r["connection.json"].reduce((a,l)=>{l.nodes.forEach(d=>a[d]=l),t[l.id]=l;let h=e==null?void 0:e[l.nodes[0]];if(h!=null){let d=Za(h.geometry.coordinates);n[d]==null&&(n[d]=[]),n[d].push(l.id)}return a},{});return{mvfConnectionsById:t,mvfConnectionsByNodeId:i,mvfConnectionIdsByLatLon:n}},"processMVFConnections"),GB=u((r,e)=>{let t={},n={},i={},a={},l={},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 ia(e,{floorId:d,mvfData:v});v.properties.node&&(i[v.properties.node]=x),t[v.properties.id]=x,v.properties.externalId&&(n[v.properties.externalId]==null&&(n[v.properties.externalId]=[]),n[v.properties.externalId].push(x)),l[d]||(l[d]=[]),l[d].push(v)}}return{doorsById:t,doorsByExternalId:n,doorsByNodeId:i,mvfEntrancesById:a,mvfEntrancesByFloorId:l}},"processMVFEntrances"),VB=u((r,e,t)=>{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 l of a)if("anchorId"in l.properties){let h=l==null?void 0:l.properties,d=e[h.anchorId]||t[h.anchorId];if(d!=null&&h!=null){let m=d.properties;m.textArea=h,m.textArea&&(m.textArea.position=l.geometry.coordinates)}}}}},"processMVFTextAreas"),jB=u((r,e,t)=>{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 l of a)if("anchorId"in l.properties){let h=l==null?void 0:l.properties,d=e[h.anchorId]||t[h.anchorId];if(d!=null&&h!=null){let m=d.properties;m.image=h,m.image&&(m.image.position=l.geometry.coordinates)}}}}},"processMVFPolygonImages"),UB=u((r,e)=>{var n,i;if(((n=r.enterprise)==null?void 0:n.enterpriseStyles)==null)return;let t=(i=r.enterprise)==null?void 0:i.enterpriseStyles;for(let a in t){let l=t[a];l.geometryAnchors.forEach(h=>{let d=e[h.geometryId];if(d!=null){let m=d.properties;m.style={styleId:a,edgeOffset:l.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),zB=u((r,e,t)=>{if(!(r.enterprise==null||r.enterprise.textures==null))for(let n of r.enterprise.textures)for(let i of n.geometryAnchors){let a=e[i.geometryId]||t[i.geometryId];if(a!=null){let l=a.properties;l.textures==null&&(l.textures=[]),l.textures.push(n)}}},"processMVFEnterpriseTextures"),HB=u((r,e)=>{let t={},n={},i={};if(r.annotation==null)return{annotationsById:t,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i};let a=globalThis.Object.keys(r.annotation);for(let l of a){let h=r.annotation[l];if(h!=null)for(let d of h.features){n[d.properties.id]=d;let m=new tu(e,{floorId:l,mvfData:d});t[d.properties.id]=m,i[l]||(i[l]=[]),i[l].push(d)}}return{annotationsById:t,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i}},"processMVFAnnotations"),XB=u((r,e)=>{let t={},n={},i={};if(r.area==null)return{areasById:t,areasByExternalId:n,mvfAreasById:i};let a=globalThis.Object.keys(r.area);for(let l of a){let h=r.area[l];if(h!=null)for(let d of h.features){i[d.properties.id]=d;let m=new Jl(e,{floorId:l,mvfData:d});t[d.properties.id]=m,d.properties.externalId&&(n[d.properties.externalId]==null&&(n[d.properties.externalId]=[]),n[d.properties.externalId].push(m))}}return{areasById:t,areasByExternalId:n,mvfAreasById:i}},"processMVFAreas"),e7=u((r,e)=>{var N,L,G,j,$,q,k,tt,ut,at,H,St,pt;let t={},n={},i={},a={},l=((L=(N=r.enterprise)==null?void 0:N.locations)!=null?L:[]).reduce((ct,It)=>(ct[It.id]=It,ct),{}),h={},d={},m={},v={},x={},S={},I=((G=r.enterprise)==null?void 0:G.venue)||{},w={},P={},E={};for(let ct of($=(j=r.enterprise)==null?void 0:j.categories)!=null?$:[]){let It=new Ug(e,{mvfData:ct});h[ct.id]=It,ct.externalId&&(d[ct.externalId]==null&&(d[ct.externalId]=[]),d[ct.externalId].push(It)),m[ct.id]=ct,ct.locations.forEach(Et=>{x[Et]==null&&(x[Et]=[]),x[Et].push(ct.id)})}let O={};for(let ct of(k=(q=r.enterprise)==null?void 0:q.locationInstances)!=null?k:[]){let It=l[ct.parent],Et=Object.keys(It),dt={};for(let Z of Et)dt[Z]=void 0;let bt=z(et(z({},dt),{polygons:[],nodes:[]}),ct);O[bt.parent]==null&&(O[bt.parent]=[]),O[bt.parent].push(new Ja(e,{mvfData:bt,categoryIds:((ut=(tt=r.enterprise)==null?void 0:tt.categoryPriorities)==null?void 0:ut[bt.id])||x[bt.id],parentId:ct.parent})),w[bt.id]=ct}for(let ct in r.space){let It=r.space[ct];if(It!=null)for(let Et of It.features){for(let dt of Et.properties.destinationNodes)P[dt]==null&&(P[dt]=[]),P[dt].push(Et.properties.id);E[Et.properties.id]=Et.properties.destinationNodes}}for(let ct of(H=(at=r.enterprise)==null?void 0:at.locations)!=null?H:[]){let It=new Ja(e,{mvfData:ct,categoryIds:((pt=(St=r.enterprise)==null?void 0:St.categoryPriorities)==null?void 0:pt[ct.id])||x[ct.id],locationInstances:O[ct.id]});i[ct.id]=It,ct.externalId&&(a[ct.externalId]==null&&(a[ct.externalId]=[]),a[ct.externalId].push(It)),ct.nodes.forEach(Et=>{S[Et.id]==null&&(S[Et.id]=[]),S[Et.id].push(ct.id)});for(let Et of ct.polygons)v[Et.id]==null&&(v[Et.id]=[]),v[Et.id].push(ct)}if(e.enterpriseMode===!0){for(let ct in e.mvfConnectionsById){let It={},Et=e.mvfConnectionsById[ct];for(let dt of e.mvfConnectionsById[ct].nodes){let bt=e.nodesById[dt];bt!=null&&(It[bt.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[bt.coordinate.longitude,bt.coordinate.latitude]},properties:{id:ct,externalId:Et.externalId,kind:"enterprise."+Et.type,destinationNodes:[],flags:"",type:Et.type,nodes:Et.nodes,accessible:Et.accessible,extra:Et.extra,details:Et.details}})}Object.keys(It).length>0&&(t[ct]=new vc(e,{mvfDataByFloorId:It}),Et.externalId&&(n[Et.externalId]==null&&(n[Et.externalId]=[]),n[Et.externalId].push(t[ct])))}e.connectionsById=t}return{spaceIdsByNodeId:P,connectionsByExternalId:n,locationIdsByNodeId:S,mvfLocationsBySpaceId:v,mvfLocationsById:l,mvfCategoriesById:m,locationsById:i,locationsByExternalId:a,locationInstancesById:w,categoriesById:h,categoriesByExternalId:d,destinationNodesIdsBySpaceId:E,venue:I}},"createEnterpriseDataFromMVF"),r7=u((r,e)=>{let{nodesById:t,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:a}=NB(r,e),{mvfConnectionsById:l,mvfConnectionsByNodeId:h,mvfConnectionIdsByLatLon:d}=BB(r,i),{spacesById:m,spacesByExternalId:v,poisById:x,poisByExternalId:S,mvfSpacesById:I,objectEntranceNodeIdsByObstructionId:w,connectionsById:P,connectionIdsByLatLon:E,mvfSpacesByFloorId:O,mvfPoisByFloorId:N}=AB(r,h,e),{objectsById:L,objectsByExternalId:G,mvfObstructionById:j,obstructionIdByEntranceId:$}=kB(r,e),{floorsById:q,floorsByExternalId:k,mvfFloorsById:tt}=RB(r,e),{floorStacksById:ut,floorStacksByExternalId:at,mvfFloorStacksById:H,facadesById:St,facadesBySpaceId:pt}=FB(r,e),{doorsById:ct,doorsByExternalId:It,doorsByNodeId:Et,mvfEntrancesById:dt,mvfEntrancesByFloorId:bt}=GB(r,e),{annotationsById:Z,mvfAnnotationsById:te,mvfAnnotationsByFloorId:jt}=HB(r,e),{areasById:ee,areasByExternalId:Tt,mvfAreasById:le}=XB(r,e);jB(r,I,j),VB(r,I,j),UB(r,I),zB(r,I,j);let{locationCategoriesByParentId:vr,locationProfilesById:Qe,locationCategoriesById:Nt,locationProfilesByExternalId:At,locationProfilesByCategoryId:xt,locationProfilesByAttachedFeatureId:_e}=LB(r,e);return{spacesById:m,spacesByExternalId:v,nodesById:t,nodesByExternalId:n,objectsById:L,objectsByExternalId:G,floorsById:q,floorsByExternalId:k,floorStacksById:ut,floorStacksByExternalId:at,facadesById:St,facadesBySpaceId:pt,connectionsById:P,doorsById:ct,doorsByExternalId:It,doorsByNodeId:Et,poisById:x,poisByExternalId:S,annotationsById:Z,areasById:ee,areasByExternalId:Tt,objectEntranceNodeIdsByObstructionId:w,obstructionIdByEntranceId:$,connectionIdsByLatLon:E,locationProfilesById:Qe,locationCategoriesById:Nt,locationProfilesByExternalId:At,locationProfilesByCategoryId:xt,locationCategoriesByParentId:vr,mvfSpacesById:I,mvfNodesById:i,mvfObstructionById:j,mvfFloorsById:tt,mvfFloorStacksById:H,mvfConnectionsById:l,mvfConnectionsByNodeId:h,mvfEntrancesById:dt,mvfAnnotationsById:te,mvfNodesByFloorId:a,mvfSpacesByFloorId:O,mvfPoisByFloorId:N,mvfAreasById:le,mvfEntrancesByFloorId:bt,mvfAnnotationsByFloorId:jt,locationProfilesByAttachedFeatureId:_e,mvfConnectionIdsByLatLon:d}},"createDataFromMVF");y();y();y();var YB=u(function(){let e=globalThis.fetch;return{fetch(...t){if(!kg(e))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return e==null?void 0:e(...t)},setFetch(t){e=t}}},"createFetchControl")(),n7=YB.fetch;var l7=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],i7=l7[0],u7="https://api-gateway.mappedin.com/track-analytics/a/",c7="deny-watchposition",p7="load-mapview",h7="load-mapdata",f7="change-language",d7="query-directions";var el,ws,nu,JC,Zv,KC=class KC{constructor(){F(this,nu);F(this,el,Object.freeze({}));F(this,ws);b(this,"oneTimeEventsSent",new Set);b(this,"sendGetDirectionsEvent",ET((e,t)=>this.sendAnalyticEvent(d7,{start:e,end:t,type:"location_to_location"}),2500));V(this,ws,gt(this,nu,Zv).call(this,p(this,el)))}init(e){this.reset(),this.updateStateWithOptions(e)}reset(){V(this,el,{}),V(this,ws,gt(this,nu,Zv).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(e){return V(this,el,Object.freeze(Object.assign({},p(this,el),e))),V(this,ws,gt(this,nu,Zv).call(this,e)),gt(this,nu,JC).call(this,p(this,ws)),p(this,ws)}updateState(e){let t=z({},e);t.mapId&&(t.analyticsBaseUrl=$C(et(z({},p(this,ws)),{mapId:t.mapId}))),t.context&&(t.context=a7(t.context)),t.baseUri&&(t.analyticsBaseUrl=$C({baseUri:t.baseUri,mapId:p(this,ws).mapId})),Object.assign(p(this,ws),t),this.handleStateUpdate(e),gt(this,nu,JC).call(this,t)}handleStateUpdate(e){var t;(t=e.userPosition)!=null&&t.floorLevel?this.sendBlueDotEvents("found-floor"):e.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:e,secret:t,accessToken:n}=this.getState();return!!(e&&t)||!!n}getState(){return p(this,ws)}getContext(){return this.getState().context||p(this,el).context||i7}getSessionId(){return this.getState().sessionId||p(this,el).sessionId||s7()}getDeviceId(){return this.getState().deviceId||p(this,el).deviceId||o7()}sendAnalyticEvent(e,t={}){let n=this.getState(),i=qB(n.analyticsBaseUrl,e),a={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(n.logEvents&&K.log("Analytics.track",i,a),!n.sendEvents)return Promise.resolve();if(!this.authReady)return K.warn("Auth needs to be ready to send analytics.");let l=et(z({},t),{g:n.geolocationMode,sdk_version:n.version});return n.userPosition&&Object.assign(l,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)),n7(i,{method:"POST",mode:"cors",headers:a,body:JSON.stringify(l)})}capture(e,t){if(ZB.includes(e))return K.warn("".concat(e," event is sent internally.")),Promise.resolve();let n=WB.includes(e)?e.slice(1):e;return this.sendAnalyticEvent(n,t)}sendGetMapDataEvent(e){return this.sendAnalyticEvent(h7,e)}sendChangeLanguageEvent(e){return this.sendAnalyticEvent(f7,e)}sendWatchPositionDenied(){return this.sendAnalyticEvent(c7)}sendMapViewLoadedEvent({firstRenderDuration:e,dimension:t}){return this.sendAnalyticEvent(p7,{type:"3d",firstRenderDuration:e,width:t.width,height:t.height,devicePixelRatio:globalThis.devicePixelRatio||1})}sendBlueDotEvents(e){if(!((e==="found-floor"||e==="found-position")&&this.oneTimeEventsSent.has(e)))return this.oneTimeEventsSent.add(e),this.sendAnalyticEvent(e)}};el=new WeakMap,ws=new WeakMap,nu=new WeakSet,JC=u(function(e){e.sessionId&&jl.getInstance().saveSessionData("id",e.sessionId),e.deviceId&&jl.getInstance().saveLocalData("deviceId",e.deviceId)},"#saveStateToStorage"),Zv=u(function(e){var n,i,a,l;let t=(n=e.baseUri)!=null?n:u7;return{baseUri:t,analyticsBaseUrl:$C(et(z({},e),{baseUri:t})),version:((i=T==null?void 0:T.env)==null?void 0:i.npm_package_version)||"v6",deviceId:e.deviceId||o7(),accessToken:e.accessToken,mapId:e.mapId,sessionId:e.sessionId||s7(),platformString:e.platformString||"",context:a7(e.context)||i7,geolocationMode:!1,sendEvents:(a=e.sendEvents)!=null?a:!0,logEvents:(l=e.logEvents)!=null?l:!1,noAuth:e.noAuth||!1,key:e.key,secret:e.secret}},"#getStateWithOption"),u(KC,"AnalyticsInternal");var vd=KC;function $C({mapId:r,baseUri:e=u7}){return"".concat(e).concat(r,"/")}u($C,"getBaseUrl");function o7(){return jl.getInstance().loadLocalData("deviceId")}u(o7,"getDeviceIDFromStorage");function s7(){return jl.getInstance().loadSessionData("id")}u(s7,"getSessionIDFromStorage");function qB(r,e){return r+e}u(qB,"buildUrl");function a7(r){return l7.find(e=>e===r)}u(a7,"getValidContext");var WB=["$select-location","$select-category","$query-suggest","$query-search"],ZB=[p7,h7,d7,c7,f7],PTt=new vd,Ts,QC=class QC{constructor(e){F(this,Ts);b(this,"capture");b(this,"updateState");V(this,Ts,e),this.capture=p(this,Ts).capture.bind(p(this,Ts)),this.updateState=p(this,Ts).updateState.bind(p(this,Ts))}getState(){let i=p(this,Ts).getState(),{sessionId:e,deviceId:t}=i;return Zs(i,["sessionId","deviceId"])}getContext(){return p(this,Ts).getContext()}getSessionId(){return p(this,Ts).getSessionId()}getDeviceId(){return p(this,Ts).getDeviceId()}};Ts=new WeakMap,u(QC,"Analytics");var Hg=QC;y();var $B=new Set(["polygons"]),oa,yn,Bo,Xg,rh=class rh extends ni{constructor(t,n){super(n.mvfData.externalId);b(this,"__type",rh.__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);F(this,oa);F(this,yn,{});F(this,Bo);F(this,Xg);V(this,oa,t),V(this,Bo,n.mvfData),V(this,Xg,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let i in n.mvfData)!$B.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{enumerable:!0,get(){if(n.parentId){let a=p(this,oa).locationsById[n.parentId];return p(this,Bo)[i]!=null?p(this,oa).getPropTranslation(this.__type,i,p(this,Bo).id,p(this,Bo)[i]):p(this,oa).getPropTranslation(this.__type,i,p(this,Bo).id,a[i])}return p(this,oa).getPropTranslation(this.__type,i,p(this,Bo).id,p(this,Bo)[i])}})}static is(t){return t.__type===rh.__type}get focusTarget(){return this.spaces}get categories(){return p(this,yn).categories?p(this,yn).categories:(p(this,yn).categories=(p(this,Xg).map(t=>p(this,oa).getById("enterprise-category",t))||[]).filter(Boolean),p(this,yn).categories)}get coordinates(){if(p(this,yn).coordinates)return p(this,yn).coordinates;p(this,yn).coordinates=[];for(let t=0;t<this.nodes.length;t++)p(this,yn).coordinates.push(this.nodes[t].coordinate);return p(this,yn).coordinates}get nodes(){if(p(this,yn).nodes)return p(this,yn).nodes;p(this,yn).nodes=[];for(let t=0;t<p(this,Bo).nodes.length;t++){let n=p(this,oa).getById("node",p(this,Bo).nodes[t].id);n&&p(this,yn).nodes.push(n)}return p(this,yn).nodes}get spaces(){if(p(this,yn).spaces)return p(this,yn).spaces;p(this,yn).spaces=[];for(let t=0;t<p(this,Bo).polygons.length;t++){let n=p(this,oa).getById("space",p(this,Bo).polygons[t].id);n&&p(this,yn).spaces.push(n)}return p(this,yn).spaces}toJSON(){return{__type:rh.__type,id:this.id,name:this.name}}destroy(){for(let t of Object.keys(p(this,yn)))delete p(this,yn)[t]}};oa=new WeakMap,yn=new WeakMap,Bo=new WeakMap,Xg=new WeakMap,u(rh,"EnterpriseLocation"),b(rh,"__type","enterprise-location");var tS=rh,Ja=tS;y();var JB=new Set,ih,So,rl,nh=class nh extends ni{constructor(t,n){super(n.mvfData.externalId);b(this,"__type",nh.__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");F(this,ih);F(this,So,{});F(this,rl);V(this,ih,t),V(this,rl,n.mvfData);for(let i in n.mvfData)!JB.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{get(){return p(this,ih).getPropTranslation(this.__type,i,p(this,rl).id,p(this,rl)[i])}})}static is(t){return t.__type===nh.__type}get children(){if(p(this,So).children)return p(this,So).children;p(this,So).children=[];for(let t=0;t<p(this,rl).children.length;t++){let n=p(this,ih).getById("enterprise-category",p(this,rl).children[t]);n&&p(this,So).children.push(n)}return p(this,So).children}get locations(){if(p(this,So).locations)return p(this,So).locations;p(this,So).locations=[];for(let t=0;t<p(this,rl).locations.length;t++){let n=p(this,ih).getById("enterprise-location",p(this,rl).locations[t]);n&&p(this,So).locations.push(n)}return p(this,So).locations}toJSON(){return{__type:nh.__type,id:this.id,name:this.name}}destroy(){for(let t of Object.keys(p(this,So)))delete p(this,So)[t]}};ih=new WeakMap,So=new WeakMap,rl=new WeakMap,u(nh,"EnterpriseCategory"),b(nh,"__type","enterprise-category");var eS=nh,Ug=eS;y();var KB=new Set,Yg,qg,oh=class oh extends ni{constructor(t,n){super(n.mvfData.externalId);b(this,"__type",oh.__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");F(this,Yg,{});F(this,qg);V(this,qg,n.mvfData);for(let i in n.mvfData)!KB.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&(this[i]=n.mvfData[i])}static is(t){return t.__type===oh.__type}get name(){var t;return(t=p(this,qg).name)!=null?t:""}toJSON(){return{__type:oh.__type,id:this.id,name:this.name}}destroy(){for(let t of Object.keys(p(this,Yg)))delete p(this,Yg)[t]}};Yg=new WeakMap,qg=new WeakMap,u(oh,"EnterpriseVenue"),b(oh,"__type","enterprise-venue");var rS=oh,$v=rS;y();y();function bd(r){return r.endsWith("/")?r:"".concat(r,"/")}u(bd,"normalizeUrl");y();var xd="https://app.mappedin.com/",m7="https://auth.mappedin.com/";y();y();var QB=u(r=>{let e=Date.now();return r-e},"fromNow"),Jv=u((r,e)=>QB(r)<=e*60*1e3,"shouldRefreshToken");var y7=60,v7=y7*60*1e3,g7="accessTokens";async function Wg(r,e=!1){let t="".concat(r.key),n=jl.getInstance(),i=(n==null?void 0:n.loadSessionData(g7))||{},a=Math.floor(Date.now()/1e3);if(i[t]&&!Jv(i[t].expiresTimestamp*1e3,y7))return i[t];let l=e?await tG(r,a):await eG(r,a),h=et(z({},i),{[t]:l});return n==null||n.saveSessionData(g7,h),l}u(Wg,"getAccessToken");async function tG(r,e){var a;let t="".concat((a=r.baseAuthUri)!=null?a:m7,"oauth2/token"),n=await sa()(t,{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:e+i.expires_in}}u(tG,"fetchAccessTokenEnterprise");async function eG(r,e){let t="".concat(r.baseAuthUri?bd(r.baseAuthUri):xd,"api/api-key/token"),n=await sa()(t,{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:e+i.expires_in}}u(eG,"fetchAccessToken");y();var x7=60,_7=x7*60*1e3,b7="miSasTokens";async function nS(r,e){let t="".concat(e,"__").concat(r.mapId),n=jl.getInstance(),i=(n==null?void 0:n.loadSessionData(b7))||{};if(i[t]&&!Jv(i[t].expires,x7))return i[t];let a=await rG(r,e),l=et(z({},i),{[t]:{token:a.token,expires:new Date(a.expires).getTime()}});return n==null||n.saveSessionData(b7,l),a}u(nS,"getSasToken");async function rG(r,e){let t="".concat(r.baseUri?bd(r.baseUri):xd,"api/v1/venue/").concat(r.mapId,"/sas-token"),n=await sa()(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});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()}}u(rG,"fetchSasToken");var C7=globalThis.fetch,M7,nG=(M7=T==null?void 0:T.env)==null?void 0:M7.npm_package_version;function sa(){if(C7==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return C7}u(sa,"isomorphicFetch");var iS={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function w7(r){var t;let e=z(z({},iS),r);return e.headers=et(z({},e.headers),{"mappedin-sdk-version":nG}),e.things=[],"platformString"in r&&(e.headers=et(z({},e.headers),{"mappedin-platform-version":r.platformString})),e.noAuth||(e.accessToken?e.authorization="Bearer ".concat(e.accessToken):e.clientId&&e.clientSecret&&(e.authorization="Basic ".concat(globalThis.btoa("".concat(e.clientId,":").concat(e.clientSecret))))),e.language=(t=e.language)==null?void 0:t.toLowerCase(),e}u(w7,"parseOptions");function iG(r,e,t=!1){let n={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};t&&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&&(e+="&withcdntoken"),{req:a,url:e}}u(iG,"constructParamsForRequest");async function oG(r,e,t=!1){let n=iG(r,e,t),i=await sa()(n.url,n.req);if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}u(oG,"generateAPIRequest");var sG=u(r=>{let e=r!=null&&typeof r=="object"&&"perspectives"in r&&r.perspectives!=null&&typeof r.perspectives=="object"?r.perspectives:null;if(e==null||Object.keys(e).length===0)return K.warn("No perspectives available in response!"),null;let t={};for(let[n,i]of Object.entries(e)){let a="url"in i&&typeof i.url=="string"?i.url:null,l="locale_packs"in i&&typeof i.locale_packs=="object"?i.locale_packs:null;if(a==null||l==null){K.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}t[n]={url:a,locale_packs:l}}return t},"getPerspectivesFromResponse");async function aG(r,e="exports/mvf/1/bundle"){var m,v;let t=w7(z(z({baseUri:"https://api-gateway.mappedin.com/"},iS),r)),n="".concat(t.baseUri+e,"?venue=").concat(t.venue,"&version=").concat((m=t.version)!=null?m:"2.0.0");t.headers["Content-Type"]="application/zip";let i=await oG(t,n),a=i.url,l=i.locale_packs,h=(v=t.perspective)!=null?v:iS.perspective,d=sG(i);if(h!=null&&h!==""&&d!=null){let x=d[h];x==null?K.warn("Perspective ".concat(h," not found in response! Loading default perspective instead.")):(K.log('Loading perspective "'.concat(h,'"')),a=x.url,l=x.locale_packs)}return{url:a,localePacks:l,updated_at:i.updated_at}}u(aG,"getVenueMVFURL");var _d=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function oS(r,{signal:e}){let t=await(await sa()(r,{signal:e})).arrayBuffer();return new Uint8Array(t)}u(oS,"getLanguagePackUnitArray");async function Cd(r){let t=(await import("./browser-FQUMJJAZ.js")).unzipSync(r),n={};if(t["enterprise/"]!=null){n.enterprise={};let i=t["enterprise/locations.json"];i&&(n.enterprise.locations=JSON.parse(_d().decode(i)));let a=t["enterprise/locationInstances.json"];a&&(n.enterprise.locationInstances=JSON.parse(_d().decode(a)));let l=t["enterprise/categories.json"];l&&(n.enterprise.categories=JSON.parse(_d().decode(l)))}return t["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(_d().decode(t["floorstack.json"]))),t["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(_d().decode(t["floor.geojson"]))),t["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(_d().decode(t["manifest.json"]))),n}u(Cd,"parseLanguagePack");async function T7(r,{signal:e}){try{let t=await(await sa()(r,{signal:e})).arrayBuffer();if(e.aborted)return;let n=new Uint8Array(t);return await Cd(n)}catch(t){let n=new Error("downloadLanguagePack failed");throw n.cause=t,n}}u(T7,"downloadLanguagePack");async function sS(r){return new Promise(async(e,t)=>{try{let n=r.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:i,localePacks:a}=await aG(r,n),l=await sa()(i).then(d=>d.arrayBuffer()),h=new Uint8Array(l);e({compressed:h,localePacks:a})}catch(n){t(n)}})}u(sS,"downloadVenueBundleMVFAPIGateway");async function aS(r,e){return new Promise(async(t,n)=>{try{let{url:i}=await lG(r,e),a=await sa()(i).then(h=>h.arrayBuffer()),l=new Uint8Array(a);t(l)}catch(i){n(i)}})}u(aS,"downloadMVF");async function lG(r,e){let t=new URL("".concat(r.baseUri?bd(r.baseUri):xd,"api/venue/").concat(r.mapId,"/mvf"));r.viewId&&t.searchParams.set("configId",r.viewId),r.mvfVersion&&t.searchParams.set("version",r.mvfVersion);let n=await sa()(t.toString(),{headers:{Authorization:"Bearer ".concat(e)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}u(lG,"getMakerBundleURL");function Qv(r){var n,i,a,l,h,d,m,v,x,S,I,w,P,E,O,N,L,G;let e=new TextDecoder,t=e.decode.bind(e);try{let j={"connection.json":JSON.parse(t(r["connection.json"])),"manifest.geojson":JSON.parse(t(r["manifest.geojson"])),"map.geojson":r["map.geojson"]?JSON.parse(t(r["map.geojson"])):void 0,"mapstack.geojson":r["mapstack.geojson"]?JSON.parse(t(r["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(t(r["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":r["tileset.json"]?JSON.parse(t(r["tileset.json"])):void 0};if(r.enterprise!=null&&(j.enterprise={},(n=r.enterprise)!=null&&n["locations.json"]&&(j.enterprise.locations=JSON.parse(t((i=r.enterprise)==null?void 0:i["locations.json"]))),(a=r.enterprise)!=null&&a["categories.json"]&&(j.enterprise.categories=JSON.parse(t((l=r.enterprise)==null?void 0:l["categories.json"]))),(h=r.enterprise)!=null&&h["venue.json"]&&(j.enterprise.venue=JSON.parse(t((d=r.enterprise)==null?void 0:d["venue.json"]))),(m=r.enterprise)!=null&&m["layers.json"]&&(j.enterprise.layers=JSON.parse(t((v=r.enterprise)==null?void 0:v["layers.json"]))),(x=r.enterprise)!=null&&x["locationInstances.json"]&&(j.enterprise.locationInstances=JSON.parse(t((S=r.enterprise)==null?void 0:S["locationInstances.json"]))),(I=r.enterprise)!=null&&I["enterpriseStyles.json"]&&(j.enterprise.enterpriseStyles=JSON.parse(t((w=r.enterprise)==null?void 0:w["enterpriseStyles.json"]))),(P=r.enterprise)!=null&&P["textures.json"]&&(j.enterprise.textures=JSON.parse(t((E=r.enterprise)==null?void 0:E["textures.json"]))),(O=r.enterprise)!=null&&O["floorText.json"]&&(j.enterprise.floorText=JSON.parse(t((N=r.enterprise)==null?void 0:N["floorText.json"]))),(L=r.enterprise)!=null&&L["categoryPriorities.json"]&&(j.enterprise.categoryPriorities=JSON.parse(t((G=r.enterprise)==null?void 0:G["categoryPriorities.json"])))),r["floorstack.json"]!=null?j["floorstack.json"]=JSON.parse(t(r["floorstack.json"])):r["mapstack.json"]!=null&&(j["mapstack.json"]=JSON.parse(t(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(t(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(t(r["styles.json"]))),"shapes.json"in r&&(j["shapes.json"]=JSON.parse(t(r["shapes.json"]))),"location.json"in r&&(j["location.json"]=JSON.parse(t(r["location.json"]))),"category.json"in r&&(j["category.json"]=JSON.parse(t(r["category.json"]))),r.annotation!=null){j.annotation={};let q=Object.keys(r.annotation);for(let k of q){let tt=k.replace(/\.json|\.geojson/g,"");j.annotation[tt]=JSON.parse(t(r.annotation[k]))}}let $=Object.keys(r.space);for(let q of $){let k=q.replace(/\.json|\.geojson/g,"");j.space[k]=JSON.parse(t(r.space[q]))}if(r.obstruction!=null){let q=Object.keys(r.obstruction);for(let k of q){let tt=k.replace(/\.json|\.geojson/g,"");j.obstruction[tt]=JSON.parse(t(r.obstruction[k]))}}else j.obstruction={};if(r.entrance!=null){let q=Object.keys(r.entrance);for(let k of q){let tt=k.replace(/\.json|\.geojson/g,"");j.entrance[tt]=JSON.parse(t(r.entrance[k]))}}else j.entrance={};if("floorImages"in r&&r.floorImages!=null){j.floorImages={};for(let q of Object.keys(r.floorImages)){let k=q.replace(/\.json|\.geojson/g,"");j.floorImages[k]=JSON.parse(t(r.floorImages[q]))}}if("textAreas"in r&&r.textAreas!=null){j.textAreas={};for(let q of Object.keys(r.textAreas)){let k=q.replace(/\.json|\.geojson/g,"");j.textAreas[k]=JSON.parse(t(r.textAreas[q]))}}if("facade"in r&&r.facade!=null){j.facade={};for(let q of Object.keys(r.facade)){let k=q.replace(/\.json|\.geojson/g,"");j.facade[k]=JSON.parse(t(r.facade[q]))}}if("area"in r&&r.area!=null){j.area={};for(let q of Object.keys(r.area)){let k=q.replace(/\.json|\.geojson/g,"");j.area[k]=JSON.parse(t(r.area[q]))}}return j}catch(j){throw K.error(j),new Error("MVF parsing failed! Probably encountered a bad file.")}}u(Qv,"parseMVF");function uG(r){if(r==null||typeof r!="object")return!1;let e=["connection.json","manifest.geojson","floor.geojson"in r?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in r?"floorstack.json":"mapstack.json"in r?"mapstack.json":"mapstack.geojson"];"styles.json"in r&&e.push("styles.json"),"shapes.json"in r&&e.push("shapes.json");for(let t of e)if(r[t]==null||r[t][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}u(uG,"validateStaticMVFFiles");async function tb(r){return new Promise(async(e,t)=>{try{if(r==null||typeof r!="object")throw new Error("Error parsing data! Unzipping failed.");if(r[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let i=(await import("./browser-FQUMJJAZ.js")).unzipSync(r);if(!uG(i))throw new Error("MVF is missing some expect static files. Unzipping failed.");let a={},l=Object.keys(i);for(let h of l){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"){K.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]}e(a)}catch(n){t(n)}})}u(tb,"unzipMVF");function Cc(){let r="us",e={};function t(){return fG(mG(r),e)}return u(t,"getState"),{updateByUserOption(n){var i,a;n.environment&&(r=n.environment),n.baseUri&&(e.baseUri=n.baseUri),n.baseAuthUri&&(e.baseAuthUri=n.baseAuthUri),(i=n.analytics)!=null&&i.baseUri&&(e.analyticsBaseUri=(a=n.analytics)==null?void 0:a.baseUri)},updateTileServerBaseUrl(n){e.tileServerUri=n},updateEnvironment(n){r=n},getBaseUri(n){return r==="us"&&n?S7.baseUri:t().baseUri},getBaseAuthUri(n=!1){return r==="us"&&n?S7.baseAuthUri:t().baseAuthUri},getAnalyticsBaseUri(){return t().analyticsBaseUri},getTileServerUri(){return t().tileServerUri},reset(){r="us",e={}},__getState:t}}u(Cc,"createEnvControl");var P7=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"}),S7=Object.freeze(et(z({},P7),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),cG=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"}),pG=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),hG=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function fG(r,e){return z(z({},r),e)}u(fG,"getAuthStateByEnvironment");var dG={eu:cG,us:P7,"us-staging-enterprise":pG,"us-staging-self-serve":hG};function mG(r){return dG[r]}u(mG,"getEnvironmentAuthState");var eb=u(r=>{var t,n;let e=Object.values((n=(t=r["floorstack.json"])!=null?t:r["mapstack.json"])!=null?n:{});return e.length===1?[]:e.filter(i=>i.type!=="Outdoor").map(i=>i.id.replace("fs_","").replace("ms_",""))},"getBuildingIds"),Kv;async function gG(){return Kv||(Kv=(await import("./dist-CQQ2UWYH.js")).extractAndConvertMVFv3,Kv)}u(gG,"getExtractAndConvertMvfV3");var I7=u(async r=>{let e=performance.now(),t=await(await gG())(r);return K.log("Parsed MVFv3 in ".concat(performance.now()-e,"ms")),t.inspectErr(n=>{throw K.error(n),new Error("MVFv3 parsing failed!")}),t.unwrap()},"unzipAndParseMVFv3ToMVFv2");async function Zg(r,e="2.0.0"){switch(e){case"2.0.0":try{let t=await tb(r);return Qv(t)}catch(t){return I7(r)}case"3.0.0":return I7(r);default:throw new Error("Unsupported MVF version: ".concat(e))}}u(Zg,"unzipAndParseMVFv2");y();y();y();y();var hZ={};N2(hZ,{ACTION_TYPE:()=>pM,Annotation:()=>tu,Area:()=>Jl,BEARING_TYPE:()=>Jx,CONNECTION_TYPE:()=>hM,Connection:()=>vc,Coordinate:()=>ve,DOORS:()=>f1,Directions:()=>Vu,Door:()=>ia,E_SDK_LOG_LEVEL:()=>nT,EnterpriseCategory:()=>Ug,EnterpriseLocation:()=>Ja,EnterpriseVenue:()=>$v,Facade:()=>Is,Floor:()=>Co,FloorStack:()=>Og,Hyperlink:()=>hc,ImageMetaData:()=>dc,LocationCategory:()=>zg,LocationProfile:()=>eh,MAPPEDIN_COLORS:()=>K6,MapObject:()=>Fo,Node:()=>ql,PointOfInterest:()=>Ql,Space:()=>si,WALLS:()=>h1,__setWatermarkOnClickFn:()=>sZ,createMapLibreOverlay:()=>cZ,disableText3DWorker:()=>UD,enableTestMode:()=>fS,findPreferredLanguageInVenue:()=>g2,getMapData:()=>uL,getMapDataEnterprise:()=>uZ,hydrateMapData:()=>QD,hydrateMapDataFromMVF:()=>aZ,parseMVF:()=>Qv,preloadFont:()=>D3,setLoggerLevel:()=>iT,setUseEnterpriseAPI:()=>lZ,setWorkersUrl:()=>WD,show3dMap:()=>cL,show3dMapGeojson:()=>pZ,unzipAndParseMVFv2:()=>Zg,unzipMVF:()=>tb});y();y();y();y();var Jg,Kg,Qg,lS=class lS{constructor(e,t,{enabled:n=!1}={}){F(this,Jg);b(this,"searchInstance");F(this,Kg);F(this,Qg);b(this,"enabled",!1);V(this,Jg,e),V(this,Kg,t),V(this,Qg,()=>{var i;(i=this.searchInstance)==null||i.then(a=>a.populate())}),n&&this.enable()}async query(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return K.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(e,t)}catch(n){return K.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return K.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(e,t)}catch(n){return K.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-CBTUOG7Q.js").then(({InternalSearch:e})=>new e(p(this,Jg)))),p(this,Kg).on("language-change",p(this,Qg)),await this.searchInstance)}};Jg=new WeakMap,Kg=new WeakMap,Qg=new WeakMap,u(lS,"Search");var $g=lS;var E7=new WeakMap,Sn,cS=class cS extends ie{constructor(t,{search:n}={}){super();F(this,Sn);b(this,"Analytics");b(this,"Search");b(this,"Query");b(this,"internal");b(this,"getDirections",u((t,n,i)=>p(this,Sn).getDirections(t,n,i),"getDirections"));b(this,"getDirectionsMultiDestination",u((t,n,i)=>p(this,Sn).getDirectionsMultiDestination(t,n,i),"getDirectionsMultiDestination"));V(this,Sn,t),E7.set(this,t),this.Analytics=new Hg(t.Analytics),this.Query=t.Query,this.internal=t,this.Search=new $g(this,t,{enabled:n==null?void 0:n.enabled}),p(this,Sn).on("language-change",i=>{this.publish("language-change",i)})}getEnv(){return p(this,Sn).getEnv()}getAccessToken(){var t;return(t=p(this,Sn).tokenManager)==null?void 0:t.getAccessToken().token}get mapName(){return p(this,Sn).mapName}get mapId(){var t;return(t=p(this,Sn).getMapDataOptions)==null?void 0:t.mapId}get mapCenter(){return p(this,Sn).mapCenter}get organizationId(){return p(this,Sn).organizationId}get outdoorViewToken(){return p(this,Sn).outdoorViewToken}getByType(t){return p(this,Sn).getByType(t)}getById(t,n){return p(this,Sn).getById(t,n)}getByExternalId(t,n){return p(this,Sn).getByExternalId(t,n)}getGeoJSON(t){return t.geoJSON}async changeLanguage(t){return p(this,Sn).changeLanguage(t)}get currentLanguage(){return p(this,Sn).currentLanguage}get naturalBearing(){var t;return(t=p(this,Sn).naturalBearing)!=null?t:0}getDistance(t,n){return p(this,Sn).getDistance(t,n)}toBinaryBundle({downloadLanguagePacks:t=!0}={}){return p(this,Sn).toBinaryBundle({downloadLanguagePacks:t})}toJSONBundle({downloadLanguagePacks:t=!0}={}){return p(this,Sn).toJSONBundle({downloadLanguagePacks:t})}};Sn=new WeakMap,u(cS,"MapData");var uS=cS,ty=uS;function ey(r){let e=E7.get(r);if(!e)throw new Error("MapDataInternal not found");return e}u(ey,"getMapDataInternal");y();y();y();y();var yG=1e-7;function pS(r){return{type:"Point",coordinates:r}}u(pS,"point");function vG(r,e){let{coordinates:t}=e.geometry,{coordinates:n}=r.geometry,i=t.map(a=>Hl(r,pS(a)));return n.reduce((a,l)=>{let h=ov(pS(l),i[0],r),d=ov(pS(l),i[1],r),m=vp(h)<vp(d)?h:d;return m.properties=et(z({},r.properties),{entrances:[]}),a.concat([m])},[])}u(vG,"splitObstructionByEntrance");function hS(r,e){return e.reduce((t,n)=>{let i={epsilon:yG},a=t.obstructions.findIndex(h=>qf(ja(n),h,i)),l=t.obstructions[a];if(l){let[h,d]=vG(l,n);t.entrances.push(n),t.obstructions.splice(a,1,h,d)}return t},{obstructions:[r],entrances:[]})}u(hS,"findAndSplitObstructionByAllEntrances");y();y();y();y();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:u(function(){return this},"get"),configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var O7="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 D7=!1;function fS(){D7=!0}u(fS,"enableTestMode");function L7(){return D7}u(L7,"isTestMode");var dS=class dS{constructor(e){b(this,"backgroundAlpha",1);b(this,"backgroundColor",new Qr);b(this,"width",0);b(this,"height",0);b(this,"options",{});b(this,"renderer");b(this,"enabledLayers",new Set([0,1]));b(this,"handleWebGLContextCreationError",u(e=>{var t,n;(n=(t=this.options).onWebGLContextCreationError)==null||n.call(t,e)},"handleWebGLContextCreationError"));b(this,"handleWebGLContextLost",u(e=>{var t,n;(n=(t=this.options).onWebGLContextLost)==null||n.call(t,e)},"handleWebGLContextLost"));b(this,"handleWebGLContextRestored",u(e=>{var t,n;(n=(t=this.options).onWebGLContextRestored)==null||n.call(t,e)},"handleWebGLContextRestored"));var t,n,i,a,l;try{this.options=e,L7()?(this.renderer={setSize:u(()=>{},"setSize"),state:{reset:u(()=>{},"reset")},properties:{get:u(()=>{},"get")},getSize:u(()=>({width:window.innerWidth,height:innerHeight}),"getSize"),getDrawingBufferSize:u(()=>({width:window.innerWidth,height:innerHeight}),"getDrawingBufferSize"),getClearAlpha:u(()=>1,"getClearAlpha"),getClearColor:u(()=>new Qr,"getClearColor"),autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:u(()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),"getContext"),readRenderTargetPixelsAsync:u(()=>Promise.resolve([]),"readRenderTargetPixelsAsync"),setRenderTarget:u(()=>{},"setRenderTarget"),setClearColor:u(()=>{},"setClearColor"),clear:u(()=>{},"clear"),render:u(()=>{},"render"),clearStencil:u(()=>{},"clearStencil"),clearDepth:u(()=>{},"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 wT({canvas:e.canvas,alpha:e.alpha||!1,stencil:!0,antialias:typeof e.antialias=="boolean"?e.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new Qr((t=e.backgroundColor)!=null?t:"#ffffff"),this.backgroundAlpha=(n=e.backgroundAlpha)!=null?n:1}catch(h){K.error(h),e.onWebGLRendererError&&e.onWebGLRendererError(h)}(i=this.domElement())==null||i.addEventListener("webglcontextlost",this.handleWebGLContextLost),(a=this.domElement())==null||a.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(l=this.domElement())==null||l.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var e,t,n,i,a;this.renderer&&((t=(e=this.renderer).dispose)==null||t.call(e)),(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(e,t){if(this.renderer){this.renderer.state.reset(),t.layers.disableAll();for(let n of this.enabledLayers.values())t.layers.enable(n);this.renderer.clearStencil(),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(e,t),this.renderer.clearDepth(),t.layers.disableAll(),t.layers.enable(G0.ALWAYS_ON_TOP),this.renderer.render(e,t),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(e,t){T.env.NODE_ENV==="test"||!this.renderer||(this.width=e,this.height=t,this.renderer.setSize(e,t,!1))}setBackgroundColor(e,t){this.backgroundColor=e,this.backgroundAlpha=t}domElement(){var e;return(e=this.renderer)==null?void 0:e.domElement}};u(dS,"Renderer");var rb=dS;y();y();var A7='"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 N7(r,e){return e.x+e.w<r.x+r.w&&e.x>r.x&&e.y>r.y&&e.y+e.h<r.y+r.h}u(N7,"contains");y();function k7(r,e){let[t,n]=e;return t>=r.x&&t<=r.x+r.w&&n>=r.y&&n<=r.y+r.h}u(k7,"intersectPoint");y();function R7(r,e){let t=e.x,n=e.y,i=e.x+e.w,a=e.y+e.h,l=r.x,h=r.y,d=r.x+r.w,m=r.y+r.h;return t<d&&l<i&&n<m&&h<a}u(R7,"intersects");y();function iu(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}u(iu,"appendItems");y();var mS=class mS{constructor(e,t,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=e,this.y=t,this.w=n,this.h=i}contains(e){return e===this?!1:N7(this,e)}intersects(e){return R7(this,e)}intersectsPoint(e){return k7(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};u(mS,"Rectangle");var ai=mS;var sh=class sh{constructor(e,t){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=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:n,h:i}=this.boundary;this.topLeft=new sh(new ai(e,t,n/2,i/2),this),this.topRight=new sh(new ai(e+n/2,t,n/2,i/2),this),this.bottomLeft=new sh(new ai(e,t+i/2,n/2,i/2),this),this.bottomRight=new sh(new ai(e+n/2,t+i/2,n/2,i/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(iu(t,this.topLeft.queryRect(e)),iu(t,this.topRight.queryRect(e)),iu(t,this.bottomLeft.queryRect(e)),iu(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(iu(t,this.topLeft.queryPoint(e)),iu(t,this.topRight.queryPoint(e)),iu(t,this.bottomLeft.queryPoint(e)),iu(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()}};u(sh,"QuadTree");var nl=sh;y();y();var F7=["","","low","medium","high","always-visible"];function B7(r){return Math.min(5,Math.max(2,r))}u(B7,"clampTierNumber");function Sd(r){if(typeof r=="number")return B7(r);let e=F7.indexOf(r);return e===-1?3:e}u(Sd,"convertCollisionRankingTierToNumber");function ry(r){let e=B7(r);return F7[e]}u(ry,"convertNumberToCollisionRankingTier");function V7(r,e,t){let n,i,a,l=null,h=0;t||(t={});let d=u(function(){h=t.leading===!1?0:Date.now(),l=null,a=r.apply(n,i),l||(n=i=null)},"later");return function(){let m=Date.now();!h&&t.leading===!1&&(h=m);let v=e-(m-h);return n=globalThis,i=arguments,v<=0||v>e?(l&&(clearTimeout(l),l=null),h=m,a=r.apply(n,i),l||(n=i=null)):!l&&t.trailing!==!1&&(l=setTimeout(d,v)),a}}u(V7,"throttle");var ah=!1,gS="",xG=150,vS=class vS extends ie{constructor(t,n,i=gS?new Worker(gS):new Worker(URL.createObjectURL(new Blob([A7],{type:"text/javascript"})))){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 nl(new ai(0,0,0,0)));b(this,"interactiveCollidersQTree",new nl(new ai(0,0,0,0)));b(this,"coreState");b(this,"postMessage");b(this,"showCollisionBoxes",u(()=>{ah=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));b(this,"hideCollisionBoxes",u(()=>{ah=!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",u(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));b(this,"componentArray",[]);b(this,"update",u((t,n,i="bottom-left",a=!1)=>{let l=!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(t,n,i),this.collidersDirty=!1,l=!0}else l=this.componentArray.some(h=>h.collisionDirty===!0);l&&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&&!l);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",u(t=>{if(this.working=!1,this.collidersDirty||!t.data)return;let n=t.data.colliders,i=-1,a,l,h;ah&&(this.visibleCollidersQTree=new nl(new ai(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new nl(new ai(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 ai(a.x,a.y,a.w,a.h,{entityId:m.id}),ah&&this.visibleCollidersQTree.insert(h),l=this.coreState.geometry2DMap.get(m.id),(l==null?void 0:l.components[1])!=null&&this.interactiveCollidersQTree.insert(new ai(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)))}ah&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));b(this,"drawDebug",u(()=>{ah&&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",u(()=>{this.worker.terminate()},"destroy"));this.coreState=n,this.debugCanvas=t,this.debugContext=t.getContext("2d"),this.worker=i,this.worker.onmessage=a=>this.resolve(a),this.postMessage=V7(this._postMessage,xG,!1),ah?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(t,n,i){this.packedMessage[6]=i,this.packedMessage[5]=n,this.packedMessage[4]=t,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};u(vS,"CollisionSystem");var nb=vS;function yS(r){gS=r}u(yS,"setWorkerUrl");y();y();y();y();var xS=class xS{constructor(e){b(this,"type");b(this,"event");this.type=0,this.event=e}get timestamp(){return this.event.timeStamp}};u(xS,"Tap");var ib=xS,_S=class _S{constructor(){b(this,"taps",[])}add(e){this.lastPointerDown&&e.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(e)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var e;return this.isSingleTap&&((e=this.lastPointerDown)==null?void 0:e.type)===1}get isSingleTapWithOneFinger(){var e;return this.isSingleTap&&((e=this.lastPointerDown)==null?void 0:e.type)===0}get isDoubleTapWithOneFinger(){var e,t;return this.isDoubleTap&&((e=this.taps[0])==null?void 0:e.type)===0&&((t=this.taps[1])==null?void 0:t.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(e){this.taps=this.taps.filter(t=>e-t.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};u(_S,"TapsController");var ob=_S;y();function CS(r){let e=new Set;for(let t of r){let n=t.object;for(;n.visible&&n.parent&&n.parent.visible===!0&&!e.has(n.parent);)n=n.parent,n instanceof Er&&n.type==="group-container"&&n.visible&&n.components[1]&&e.add(n)}return Array.from(e)}u(CS,"getUniqueIntersectedGroupContainers");var Id,SS=class SS extends ie{constructor(t,n,i,a,l){super();b(this,"raycaster",new Fa);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 nl(new ai(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);F(this,Id);b(this,"onPointerMoveRaf",u(t=>{this.lastPointerEvent=t,p(this,Id)&&cancelAnimationFrame(p(this,Id)),V(this,Id,requestAnimationFrame(()=>{this.onPointerMove(t)}))},"onPointerMoveRaf"));b(this,"onPointerMove",u(t=>{t.preventDefault(),this.updateInteractionStateIfPanning(t),(t.pointerType!=="touch"||t.pointerType===void 0&&this.hasTouched)&&this.handleHover(t),this.handleCursor()},"onPointerMove"));b(this,"tapsControl",new ob);b(this,"onPointerDown",u(t=>{t.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:t.timeStamp,clientX:t.clientX,clientY:t.clientY},this.lastPointerEvent=t,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),t.pointerType==="touch"&&(this.tapsControl.add(new ib(t)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));b(this,"clickTimeout");b(this,"onPointerUp",u(t=>{this.tapsControl.discardOutsideOfWaitWindow(t.timeStamp),this.lastPointerEvent=t,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(t);let{mouseDownStart:n}=this.state.interaction;!n||this.state.interaction.distanceFromMouseDown==null||(Date.now()<n.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(t.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",t),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(t),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",t),this.flush()):this.handleClick(t)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));b(this,"dirty3D",!0);b(this,"cachedHitBoxes",{entities:[]});b(this,"ndcPoint",new ne);b(this,"debugPanel");this.isUserInteracting=l,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=i,this._container=t,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(t){this._quadtree=t}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let t=this.state.hovered3DEntity.components[2];t&&(t.dirty=!0)}}getThreeDIntersectsFromXY(t){this.raycaster.setFromCamera(t,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(a=>{var l,h;return((l=a.object)==null?void 0:l.name)==="worldPlane"||((h=a.object)==null?void 0:h.visible)}),i=n.findIndex(a=>{var l;return((l=a.object)==null?void 0:l.name)==="worldPlane"});return i!==-1&&n.push(n.splice(i,1)[0]),n}getGroupContainerIntersectsFromXY(t){let n=this.getThreeDIntersectsFromXY(t),i;return n!=null&&n.length>0&&(i=CS(n)),i}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(t){let n=t||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!n||this.isUserInteracting())return;let{entity3D:i,entity2D:a,position:l,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:l,groupContainers:h})),this.handleCursor()}handleCursor(){var l;let t=!!(this.state.hovered3DEntity&&((l=this.state.hovered3DEntity)!=null&&l.components[2])||this.state.hovered2DEntity),n=!!this.state.interaction.mouseDownStart,i=this.state.interaction.isPanning,a=IG(t,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(t){return this.state.hovered2DEntity!==t}handleClick(t){let n=this.intersect(t);this.publish("click",{entity2D:n.entity2D,entity3D:n.entity3D,position:n.position,groupContainers:n.groupContainers,pointerEvent:{button:t.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[];let t;for(let n of this.coreState.geometry3DIdsInScene)t=this.coreState.geometry3DMap.get(n),((t==null?void 0:t.type)==="geometry"||(t==null?void 0:t.type)==="model"||(t==null?void 0:t.type)==="path"||(t==null?void 0:t.type)==="custom-geometry")&&t.components[0].mesh&&!this.cachedHitBoxes.entities.includes(t.components[0].mesh)&&this.cachedHitBoxes.entities.push(t.components[0].mesh);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(t){var O,N,L,G,j;let n=[t.offsetX,t.offsetY],i=this._quadtree.queryPoint(n),[a]=i.filter($=>$.intersectsPoint(n)),l=this.coreState.containerOffset[0],h=this.coreState.containerOffset[1];this.ndcPoint.x=(t.clientX-h)/this._container.clientWidth*2-1,this.ndcPoint.y=-((t.clientY-l)/this._container.clientHeight)*2+1;let d=this.getThreeDIntersectsFromXY(this.ndcPoint),m=(O=d[0])==null?void 0:O.point,v=[],x=[],S=d.filter($=>$.object.name!=="worldPlane");for(let $ of S)$.object instanceof ue&&$.object.material.depthTest===!1?v.push($):x.push($);let I=(L=(N=v[0])!=null?N:x[0])!=null?L:void 0,w,P;if(I!=null){if(w=wG(I.object,this.coreState.geometry3DMap),!w){let $=(G=I==null?void 0:I.instanceId)!=null?G:I==null?void 0:I.batchId;w=$!=null&&(I!=null&&I.object.userData.entities)?this.coreState.geometry3DMap.get(I==null?void 0:I.object.userData.entities[$]):this.coreState.geometry3DMap.get(I==null?void 0:I.object.userData.entityId)}w!=null&&w.components[2]&&(P=w)}let E=CS(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:P,position:m,groupContainers:E.length>0?E:void 0}}detect3DEntityHover(t){return this.state.lastHover!==t&&(this.state.lastHover&&U7(this.state.lastHover,!1,this.coreState),t&&U7(t,!0,this.coreState)),this.state.hovered3DEntity!==t}detect3DContainerHover(t){return!N0(this.state.hovered3DContainers,t)}updateInteractionStateIfPanning(t){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(t.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(t.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.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 t=document.createElement("div");t.style.position="absolute",t.style.top="0",t.style.right="0",t.style.backgroundColor="white",t.style.padding="10px",document.body.append(t),t.id="interaction-debug-panel",this.debugPanel=t,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",n=>{var i,a,l;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((l=n.position)==null?void 0:l.toArray().join(", ")),"#fdffb6")}),this.on("hover",n=>{var i,a,l;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((l=n.position)==null?void 0:l.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(t,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=t,(a=this.debugPanel)==null||a.prepend(i),setTimeout(()=>{i.style.opacity="0",setTimeout(()=>{i.remove()},500)},2500)}getCursor(){return this.cursor}};Id=new WeakMap,u(SS,"InteractionSystem");var ny=SS;function U7(r,e,t){var l;let n=r.components[2];n&&n.hover!==!0&&(n.hover=e?"user-interaction":!1,n.dirty=!0);let i=(l=r.components[0].textMesh)==null?void 0:l.userData.entityId;if(!i)return;let a=t.geometry3DMap.get(i);(a==null?void 0:a.type)==="text3d"&&(a.components[1].hoverByPolygon=e,a.components[1].dirty=!0)}u(U7,"updateHover");function IG(r,e,t){return e?"grabbing":r?"pointer":t?"grabbing":"grab"}u(IG,"processCursor");function MG(r){let e=r;for(;e!=null&&e.parent;){if(e instanceof nc)return;if(e.userData.isSingleModel)return e;e=e.parent}}u(MG,"findModelParent");function wG(r,e){let t=MG(r);return t?e.get(t.userData.entityId):void 0}u(wG,"findModelParentEntity");y();y();y();var J={};N2(J,{BRAND:()=>KG,DIRTY:()=>lh,EMPTY_PATH:()=>OG,INVALID:()=>ae,NEVER:()=>RV,OK:()=>oo,ParseStatus:()=>Ui,Schema:()=>Ce,ZodAny:()=>Mc,ZodArray:()=>lu,ZodBigInt:()=>ph,ZodBoolean:()=>hh,ZodBranded:()=>cy,ZodCatch:()=>Sh,ZodDate:()=>fh,ZodDefault:()=>Ch,ZodDiscriminatedUnion:()=>pb,ZodEffects:()=>Os,ZodEnum:()=>xh,ZodError:()=>Go,ZodFirstPartyTypeKind:()=>ce,ZodFunction:()=>fb,ZodIntersection:()=>yh,ZodIssueCode:()=>wt,ZodLazy:()=>vh,ZodLiteral:()=>bh,ZodMap:()=>Ld,ZodNaN:()=>Nd,ZodNativeEnum:()=>_h,ZodNever:()=>aa,ZodNull:()=>mh,ZodNullable:()=>al,ZodNumber:()=>ch,ZodObject:()=>Vo,ZodOptional:()=>Ps,ZodParsedType:()=>Gt,ZodPipeline:()=>py,ZodPromise:()=>wc,ZodReadonly:()=>Ih,ZodRecord:()=>hb,ZodSchema:()=>Ce,ZodSet:()=>Ad,ZodString:()=>Ic,ZodSymbol:()=>Od,ZodTransformer:()=>Os,ZodTuple:()=>sl,ZodType:()=>Ce,ZodUndefined:()=>dh,ZodUnion:()=>gh,ZodUnknown:()=>au,ZodVoid:()=>Dd,addIssueToContext:()=>Ft,any:()=>aV,array:()=>pV,bigint:()=>rV,boolean:()=>Q7,coerce:()=>kV,custom:()=>$7,date:()=>nV,datetimeRegex:()=>W7,defaultErrorMap:()=>ou,discriminatedUnion:()=>mV,effect:()=>TV,enum:()=>IV,function:()=>_V,getErrorMap:()=>Md,getParsedType:()=>ol,instanceof:()=>tV,intersection:()=>gV,isAborted:()=>ub,isAsync:()=>wd,isDirty:()=>cb,isValid:()=>Sc,late:()=>QG,lazy:()=>CV,literal:()=>SV,makeIssue:()=>iy,map:()=>bV,nan:()=>eV,nativeEnum:()=>MV,never:()=>uV,null:()=>sV,nullable:()=>EV,number:()=>K7,object:()=>hV,objectUtil:()=>IS,oboolean:()=>NV,onumber:()=>AV,optional:()=>PV,ostring:()=>LV,pipeline:()=>DV,preprocess:()=>OV,promise:()=>wV,quotelessJson:()=>TG,record:()=>vV,set:()=>xV,setErrorMap:()=>EG,strictObject:()=>fV,string:()=>J7,symbol:()=>iV,transformer:()=>TV,tuple:()=>yV,undefined:()=>oV,union:()=>dV,unknown:()=>lV,util:()=>fr,void:()=>cV});y();y();y();y();y();var fr;(function(r){r.assertEqual=i=>{};function e(i){}u(e,"assertIs"),r.assertIs=e;function t(i){throw new Error}u(t,"assertNever"),r.assertNever=t,r.arrayToEnum=i=>{let a={};for(let l of i)a[l]=l;return a},r.getValidEnumValues=i=>{let a=r.objectKeys(i).filter(h=>typeof i[i[h]]!="number"),l={};for(let h of a)l[h]=i[h];return r.objectValues(l)},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 l in i)Object.prototype.hasOwnProperty.call(i,l)&&a.push(l);return a},r.find=(i,a)=>{for(let l of i)if(a(l))return l},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(l=>typeof l=="string"?"'".concat(l,"'"):l).join(a)}u(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(fr||(fr={}));var IS;(function(r){r.mergeShapes=(e,t)=>z(z({},e),t)})(IS||(IS={}));var Gt=fr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ol=u(r=>{switch(typeof r){case"undefined":return Gt.undefined;case"string":return Gt.string;case"number":return Number.isNaN(r)?Gt.nan:Gt.number;case"boolean":return Gt.boolean;case"function":return Gt.function;case"bigint":return Gt.bigint;case"symbol":return Gt.symbol;case"object":return Array.isArray(r)?Gt.array:r===null?Gt.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?Gt.promise:typeof Map<"u"&&r instanceof Map?Gt.map:typeof Set<"u"&&r instanceof Set?Gt.set:typeof Date<"u"&&r instanceof Date?Gt.date:Gt.object;default:return Gt.unknown}},"getParsedType");var wt=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"]),TG=u(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),ab=class ab extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(a){return a.message},n={_errors:[]},i=u(a=>{for(let l of a.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)n._errors.push(t(l));else{let h=n,d=0;for(;d<l.path.length;){let m=l.path[d];d===l.path.length-1?(h[m]=h[m]||{_errors:[]},h[m]._errors.push(t(l))):h[m]=h[m]||{_errors:[]},h=h[m],d++}}},"processError");return i(this),n}static assert(e){if(!(e instanceof ab))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,fr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};u(ab,"ZodError");var Go=ab;Go.create=r=>new Go(r);var PG=u((r,e)=>{let t;switch(r.code){case wt.invalid_type:r.received===Gt.undefined?t="Required":t="Expected ".concat(r.expected,", received ").concat(r.received);break;case wt.invalid_literal:t="Invalid literal value, expected ".concat(JSON.stringify(r.expected,fr.jsonStringifyReplacer));break;case wt.unrecognized_keys:t="Unrecognized key(s) in object: ".concat(fr.joinValues(r.keys,", "));break;case wt.invalid_union:t="Invalid input";break;case wt.invalid_union_discriminator:t="Invalid discriminator value. Expected ".concat(fr.joinValues(r.options));break;case wt.invalid_enum_value:t="Invalid enum value. Expected ".concat(fr.joinValues(r.options),", received '").concat(r.received,"'");break;case wt.invalid_arguments:t="Invalid function arguments";break;case wt.invalid_return_type:t="Invalid function return type";break;case wt.invalid_date:t="Invalid date";break;case wt.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t='Invalid input: must include "'.concat(r.validation.includes,'"'),typeof r.validation.position=="number"&&(t="".concat(t," at one or more positions greater than or equal to ").concat(r.validation.position))):"startsWith"in r.validation?t='Invalid input: must start with "'.concat(r.validation.startsWith,'"'):"endsWith"in r.validation?t='Invalid input: must end with "'.concat(r.validation.endsWith,'"'):fr.assertNever(r.validation):r.validation!=="regex"?t="Invalid ".concat(r.validation):t="Invalid";break;case wt.too_small:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"more than"," ").concat(r.minimum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"over"," ").concat(r.minimum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(r.minimum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(r.minimum))):t="Invalid input";break;case wt.too_big:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"less than"," ").concat(r.maximum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"under"," ").concat(r.maximum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="bigint"?t="BigInt must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(r.maximum))):t="Invalid input";break;case wt.custom:t="Invalid input";break;case wt.invalid_intersection_types:t="Intersection results could not be merged";break;case wt.not_multiple_of:t="Number must be a multiple of ".concat(r.multipleOf);break;case wt.not_finite:t="Number must be finite";break;default:t=e.defaultError,fr.assertNever(r)}return{message:t}},"errorMap"),ou=PG;var z7=ou;function EG(r){z7=r}u(EG,"setErrorMap");function Md(){return z7}u(Md,"getErrorMap");y();var iy=u(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,a=[...t,...i.path||[]],l=et(z({},i),{path:a});if(i.message!==void 0)return et(z({},i),{path:a,message:i.message});let h="",d=n.filter(m=>!!m).slice().reverse();for(let m of d)h=m(l,{data:e,defaultError:h}).message;return et(z({},i),{path:a,message:h})},"makeIssue"),OG=[];function Ft(r,e){let t=Md(),n=iy({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===ou?void 0:ou].filter(i=>!!i)});r.common.issues.push(n)}u(Ft,"addIssueToContext");var lb=class lb{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return ae;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t){let a=await i.key,l=await i.value;n.push({key:a,value:l})}return lb.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:a,value:l}=i;if(a.status==="aborted"||l.status==="aborted")return ae;a.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(n[a.value]=l.value)}return{status:e.value,value:n}}};u(lb,"ParseStatus");var Ui=lb,ae=Object.freeze({status:"aborted"}),lh=u(r=>({status:"dirty",value:r}),"DIRTY"),oo=u(r=>({status:"valid",value:r}),"OK"),ub=u(r=>r.status==="aborted","isAborted"),cb=u(r=>r.status==="dirty","isDirty"),Sc=u(r=>r.status==="valid","isValid"),wd=u(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");y();y();y();var Zt;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Zt||(Zt={}));var TS=class TS{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,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}};u(TS,"ParseInputLazyPath");var Es=TS,H7=u((r,e)=>{if(Sc(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new Go(r.common.issues);return this._error=t,this._error}}},"handleResult");function be(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=r;if(e&&(t||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:i}:{errorMap:u((l,h)=>{var m,v;let{message:d}=r;return l.code==="invalid_enum_value"?{message:d!=null?d:h.defaultError}:typeof h.data>"u"?{message:(m=d!=null?d:n)!=null?m:h.defaultError}:l.code!=="invalid_type"?{message:h.defaultError}:{message:(v=d!=null?d:t)!=null?v:h.defaultError}},"customMap"),description:i}}u(be,"processCreateParams");var PS=class PS{get description(){return this._def.description}_getType(e){return ol(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ol(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ui,ctx:{common:e.parent.common,data:e.data,parsedType:ol(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(wd(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var a;let n={common:{issues:[],async:(a=t==null?void 0:t.async)!=null?a:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ol(e)},i=this._parseSync({data:e,path:n.path,parent:n});return H7(n,i)}"~validate"(e){var n,i;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ol(e)};if(!this["~standard"].async)try{let a=this._parseSync({data:e,path:[],parent:t});return Sc(a)?{value:a.value}:{issues:t.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),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>Sc(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ol(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(wd(i)?i:Promise.resolve(i));return H7(n,a)}refine(e,t){let n=u(i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,a)=>{let l=e(i),h=u(()=>a.addIssue(z({code:wt.custom},n(i))),"setError");return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(h(),!1)):l?!0:(h(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new Os({schema:this,typeName:ce.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:u(t=>this["~validate"](t),"validate")}}optional(){return Ps.create(this,this._def)}nullable(){return al.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return lu.create(this)}promise(){return wc.create(this,this._def)}or(e){return gh.create([this,e],this._def)}and(e){return yh.create(this,e,this._def)}transform(e){return new Os(et(z({},be(this._def)),{schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let t=typeof e=="function"?e:()=>e;return new Ch(et(z({},be(this._def)),{innerType:this,defaultValue:t,typeName:ce.ZodDefault}))}brand(){return new cy(z({typeName:ce.ZodBranded,type:this},be(this._def)))}catch(e){let t=typeof e=="function"?e:()=>e;return new Sh(et(z({},be(this._def)),{innerType:this,catchValue:t,typeName:ce.ZodCatch}))}describe(e){let t=this.constructor;return new t(et(z({},this._def),{description:e}))}pipe(e){return py.create(this,e)}readonly(){return Ih.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};u(PS,"ZodType");var Ce=PS,DG=/^c[^\s-]{8,}$/i,LG=/^[0-9a-z]+$/,AG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,NG=/^[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,kG=/^[a-z0-9_-]{21}$/i,RG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FG=/^[-+]?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)?)??$/,BG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,GG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",MS,VG=/^(?:(?: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])$/,jG=/^(?:(?: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])$/,UG=/^(([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]))$/,zG=/^(([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])$/,HG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,XG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Y7="((\\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])))",YG=new RegExp("^".concat(Y7,"$"));function q7(r){let e="[0-5]\\d";r.precision?e="".concat(e,"\\.\\d{").concat(r.precision,"}"):r.precision==null&&(e="".concat(e,"(\\.\\d+)?"));let t=r.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(e,")").concat(t)}u(q7,"timeRegexSource");function qG(r){return new RegExp("^".concat(q7(r),"$"))}u(qG,"timeRegex");function W7(r){let e="".concat(Y7,"T").concat(q7(r)),t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(t.join("|"),")"),new RegExp("^".concat(e,"$"))}u(W7,"datetimeRegex");function WG(r,e){return!!((e==="v4"||!e)&&VG.test(r)||(e==="v6"||!e)&&UG.test(r))}u(WG,"isValidIP");function ZG(r,e){if(!RG.test(r))return!1;try{let[t]=r.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.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||e&&i.alg!==e)}catch(t){return!1}}u(ZG,"isValidJWT");function $G(r,e){return!!((e==="v4"||!e)&&jG.test(r)||(e==="v6"||!e)&&zG.test(r))}u($G,"isValidCidr");var uh=class uh extends Ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Gt.string){let a=this._getOrReturnCtx(e);return Ft(a,{code:wt.invalid_type,expected:Gt.string,received:a.parsedType}),ae}let n=new Ui,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Ft(i,{code:wt.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Ft(i,{code:wt.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let l=e.data.length>a.value,h=e.data.length<a.value;(l||h)&&(i=this._getOrReturnCtx(e,i),l?Ft(i,{code:wt.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):h&&Ft(i,{code:wt.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")BG.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"email",code:wt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")MS||(MS=new RegExp(GG,"u")),MS.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"emoji",code:wt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")NG.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"uuid",code:wt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")kG.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"nanoid",code:wt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")DG.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"cuid",code:wt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")LG.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"cuid2",code:wt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")AG.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"ulid",code:wt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch(l){i=this._getOrReturnCtx(e,i),Ft(i,{validation:"url",code:wt.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"regex",code:wt.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),Ft(i,{code:wt.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ft(i,{code:wt.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ft(i,{code:wt.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?W7(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{code:wt.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?YG.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{code:wt.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?qG(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{code:wt.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?FG.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"duration",code:wt.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?WG(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"ip",code:wt.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?ZG(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"jwt",code:wt.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?$G(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"cidr",code:wt.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?HG.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"base64",code:wt.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?XG.test(e.data)||(i=this._getOrReturnCtx(e,i),Ft(i,{validation:"base64url",code:wt.invalid_string,message:a.message}),n.dirty()):fr.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),z({validation:t,code:wt.invalid_string},Zt.errToObj(n)))}_addCheck(e){return new uh(et(z({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(z({kind:"email"},Zt.errToObj(e)))}url(e){return this._addCheck(z({kind:"url"},Zt.errToObj(e)))}emoji(e){return this._addCheck(z({kind:"emoji"},Zt.errToObj(e)))}uuid(e){return this._addCheck(z({kind:"uuid"},Zt.errToObj(e)))}nanoid(e){return this._addCheck(z({kind:"nanoid"},Zt.errToObj(e)))}cuid(e){return this._addCheck(z({kind:"cuid"},Zt.errToObj(e)))}cuid2(e){return this._addCheck(z({kind:"cuid2"},Zt.errToObj(e)))}ulid(e){return this._addCheck(z({kind:"ulid"},Zt.errToObj(e)))}base64(e){return this._addCheck(z({kind:"base64"},Zt.errToObj(e)))}base64url(e){return this._addCheck(z({kind:"base64url"},Zt.errToObj(e)))}jwt(e){return this._addCheck(z({kind:"jwt"},Zt.errToObj(e)))}ip(e){return this._addCheck(z({kind:"ip"},Zt.errToObj(e)))}cidr(e){return this._addCheck(z({kind:"cidr"},Zt.errToObj(e)))}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(z({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(n=e==null?void 0:e.local)!=null?n:!1},Zt.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(z({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision},Zt.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(z({kind:"duration"},Zt.errToObj(e)))}regex(e,t){return this._addCheck(z({kind:"regex",regex:e},Zt.errToObj(t)))}includes(e,t){return this._addCheck(z({kind:"includes",value:e,position:t==null?void 0:t.position},Zt.errToObj(t==null?void 0:t.message)))}startsWith(e,t){return this._addCheck(z({kind:"startsWith",value:e},Zt.errToObj(t)))}endsWith(e,t){return this._addCheck(z({kind:"endsWith",value:e},Zt.errToObj(t)))}min(e,t){return this._addCheck(z({kind:"min",value:e},Zt.errToObj(t)))}max(e,t){return this._addCheck(z({kind:"max",value:e},Zt.errToObj(t)))}length(e,t){return this._addCheck(z({kind:"length",value:e},Zt.errToObj(t)))}nonempty(e){return this.min(1,Zt.errToObj(e))}trim(){return new uh(et(z({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new uh(et(z({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new uh(et(z({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};u(uh,"ZodString");var Ic=uh;Ic.create=r=>{var e;return new Ic(z({checks:[],typeName:ce.ZodString,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},be(r)))};function JG(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,a=Number.parseInt(r.toFixed(i).replace(".","")),l=Number.parseInt(e.toFixed(i).replace(".",""));return a%l/10**i}u(JG,"floatSafeRemainder");var oy=class oy extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Gt.number){let a=this._getOrReturnCtx(e);return Ft(a,{code:wt.invalid_type,expected:Gt.number,received:a.parsedType}),ae}let n,i=new Ui;for(let a of this._def.checks)a.kind==="int"?fr.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ft(n,{code:wt.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),Ft(n,{code:wt.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),Ft(n,{code:wt.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?JG(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),Ft(n,{code:wt.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ft(n,{code:wt.not_finite,message:a.message}),i.dirty()):fr.assertNever(a);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Zt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Zt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Zt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Zt.toString(t))}setLimit(e,t,n,i){return new oy(et(z({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Zt.toString(i)}]}))}_addCheck(e){return new oy(et(z({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:Zt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Zt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Zt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Zt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Zt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Zt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Zt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Zt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Zt.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&fr.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};u(oy,"ZodNumber");var ch=oy;ch.create=r=>new ch(z({checks:[],typeName:ce.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1},be(r)));var sy=class sy extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(a){return this._getInvalidInput(e)}if(this._getType(e)!==Gt.bigint)return this._getInvalidInput(e);let n,i=new Ui;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),Ft(n,{code:wt.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),Ft(n,{code:wt.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Ft(n,{code:wt.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):fr.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Ft(t,{code:wt.invalid_type,expected:Gt.bigint,received:t.parsedType}),ae}gte(e,t){return this.setLimit("min",e,!0,Zt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Zt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Zt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Zt.toString(t))}setLimit(e,t,n,i){return new sy(et(z({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Zt.toString(i)}]}))}_addCheck(e){return new sy(et(z({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Zt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Zt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Zt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Zt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Zt.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};u(sy,"ZodBigInt");var ph=sy;ph.create=r=>{var e;return new ph(z({checks:[],typeName:ce.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},be(r)))};var ES=class ES extends Ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Gt.boolean){let n=this._getOrReturnCtx(e);return Ft(n,{code:wt.invalid_type,expected:Gt.boolean,received:n.parsedType}),ae}return oo(e.data)}};u(ES,"ZodBoolean");var hh=ES;hh.create=r=>new hh(z({typeName:ce.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1},be(r)));var db=class db extends Ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Gt.date){let a=this._getOrReturnCtx(e);return Ft(a,{code:wt.invalid_type,expected:Gt.date,received:a.parsedType}),ae}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return Ft(a,{code:wt.invalid_date}),ae}let n=new Ui,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Ft(i,{code:wt.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Ft(i,{code:wt.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(e.data.getTime())}}_addCheck(e){return new db(et(z({},this._def),{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Zt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Zt.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};u(db,"ZodDate");var fh=db;fh.create=r=>new fh(z({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:ce.ZodDate},be(r)));var OS=class OS extends Ce{_parse(e){if(this._getType(e)!==Gt.symbol){let n=this._getOrReturnCtx(e);return Ft(n,{code:wt.invalid_type,expected:Gt.symbol,received:n.parsedType}),ae}return oo(e.data)}};u(OS,"ZodSymbol");var Od=OS;Od.create=r=>new Od(z({typeName:ce.ZodSymbol},be(r)));var DS=class DS extends Ce{_parse(e){if(this._getType(e)!==Gt.undefined){let n=this._getOrReturnCtx(e);return Ft(n,{code:wt.invalid_type,expected:Gt.undefined,received:n.parsedType}),ae}return oo(e.data)}};u(DS,"ZodUndefined");var dh=DS;dh.create=r=>new dh(z({typeName:ce.ZodUndefined},be(r)));var LS=class LS extends Ce{_parse(e){if(this._getType(e)!==Gt.null){let n=this._getOrReturnCtx(e);return Ft(n,{code:wt.invalid_type,expected:Gt.null,received:n.parsedType}),ae}return oo(e.data)}};u(LS,"ZodNull");var mh=LS;mh.create=r=>new mh(z({typeName:ce.ZodNull},be(r)));var AS=class AS extends Ce{constructor(){super(...arguments),this._any=!0}_parse(e){return oo(e.data)}};u(AS,"ZodAny");var Mc=AS;Mc.create=r=>new Mc(z({typeName:ce.ZodAny},be(r)));var NS=class NS extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return oo(e.data)}};u(NS,"ZodUnknown");var au=NS;au.create=r=>new au(z({typeName:ce.ZodUnknown},be(r)));var kS=class kS extends Ce{_parse(e){let t=this._getOrReturnCtx(e);return Ft(t,{code:wt.invalid_type,expected:Gt.never,received:t.parsedType}),ae}};u(kS,"ZodNever");var aa=kS;aa.create=r=>new aa(z({typeName:ce.ZodNever},be(r)));var RS=class RS extends Ce{_parse(e){if(this._getType(e)!==Gt.undefined){let n=this._getOrReturnCtx(e);return Ft(n,{code:wt.invalid_type,expected:Gt.void,received:n.parsedType}),ae}return oo(e.data)}};u(RS,"ZodVoid");var Dd=RS;Dd.create=r=>new Dd(z({typeName:ce.ZodVoid},be(r)));var Pd=class Pd extends Ce{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==Gt.array)return Ft(t,{code:wt.invalid_type,expected:Gt.array,received:t.parsedType}),ae;if(i.exactLength!==null){let l=t.data.length>i.exactLength.value,h=t.data.length<i.exactLength.value;(l||h)&&(Ft(t,{code:l?wt.too_big:wt.too_small,minimum:h?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(Ft(t,{code:wt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(Ft(t,{code:wt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((l,h)=>i.type._parseAsync(new Es(t,l,t.path,h)))).then(l=>Ui.mergeArray(n,l));let a=[...t.data].map((l,h)=>i.type._parseSync(new Es(t,l,t.path,h)));return Ui.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new Pd(et(z({},this._def),{minLength:{value:e,message:Zt.toString(t)}}))}max(e,t){return new Pd(et(z({},this._def),{maxLength:{value:e,message:Zt.toString(t)}}))}length(e,t){return new Pd(et(z({},this._def),{exactLength:{value:e,message:Zt.toString(t)}}))}nonempty(e){return this.min(1,e)}};u(Pd,"ZodArray");var lu=Pd;lu.create=(r,e)=>new lu(z({type:r,minLength:null,maxLength:null,exactLength:null,typeName:ce.ZodArray},be(e)));function Td(r){if(r instanceof Vo){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Ps.create(Td(n))}return new Vo(et(z({},r._def),{shape:u(()=>e,"shape")}))}else return r instanceof lu?new lu(et(z({},r._def),{type:Td(r.element)})):r instanceof Ps?Ps.create(Td(r.unwrap())):r instanceof al?al.create(Td(r.unwrap())):r instanceof sl?sl.create(r.items.map(e=>Td(e))):r}u(Td,"deepPartialify");var ss=class ss 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 e=this._def.shape(),t=fr.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Gt.object){let m=this._getOrReturnCtx(e);return Ft(m,{code:wt.invalid_type,expected:Gt.object,received:m.parsedType}),ae}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:l}=this._getCached(),h=[];if(!(this._def.catchall instanceof aa&&this._def.unknownKeys==="strip"))for(let m in i.data)l.includes(m)||h.push(m);let d=[];for(let m of l){let v=a[m],x=i.data[m];d.push({key:{status:"valid",value:m},value:v._parse(new Es(i,x,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof aa){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:wt.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 Es(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=>Ui.mergeObjectSync(n,m)):Ui.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return Zt.errToObj,new ss(z(et(z({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:u((t,n)=>{var a,l,h,d;let i=(h=(l=(a=this._def).errorMap)==null?void 0:l.call(a,t,n).message)!=null?h:n.defaultError;return t.code==="unrecognized_keys"?{message:(d=Zt.errToObj(e).message)!=null?d:i}:{message:i}},"errorMap")}:{}))}strip(){return new ss(et(z({},this._def),{unknownKeys:"strip"}))}passthrough(){return new ss(et(z({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new ss(et(z({},this._def),{shape:u(()=>z(z({},this._def.shape()),e),"shape")}))}merge(e){return new ss({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:u(()=>z(z({},this._def.shape()),e._def.shape()),"shape"),typeName:ce.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ss(et(z({},this._def),{catchall:e}))}pick(e){let t={};for(let n of fr.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new ss(et(z({},this._def),{shape:u(()=>t,"shape")}))}omit(e){let t={};for(let n of fr.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new ss(et(z({},this._def),{shape:u(()=>t,"shape")}))}deepPartial(){return Td(this)}partial(e){let t={};for(let n of fr.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}return new ss(et(z({},this._def),{shape:u(()=>t,"shape")}))}required(e){let t={};for(let n of fr.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Ps;)a=a._def.innerType;t[n]=a}return new ss(et(z({},this._def),{shape:u(()=>t,"shape")}))}keyof(){return Z7(fr.objectKeys(this.shape))}};u(ss,"ZodObject");var Vo=ss;Vo.create=(r,e)=>new Vo(z({shape:u(()=>r,"shape"),unknownKeys:"strip",catchall:aa.create(),typeName:ce.ZodObject},be(e)));Vo.strictCreate=(r,e)=>new Vo(z({shape:u(()=>r,"shape"),unknownKeys:"strict",catchall:aa.create(),typeName:ce.ZodObject},be(e)));Vo.lazycreate=(r,e)=>new Vo(z({shape:r,unknownKeys:"strip",catchall:aa.create(),typeName:ce.ZodObject},be(e)));var FS=class FS extends Ce{_parse(e){let{ctx:t}=this._processInputParams(e),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 t.common.issues.push(...h.ctx.common.issues),h.result;let l=a.map(h=>new Go(h.ctx.common.issues));return Ft(t,{code:wt.invalid_union,unionErrors:l}),ae}if(u(i,"handleResults"),t.common.async)return Promise.all(n.map(async a=>{let l=et(z({},t),{common:et(z({},t.common),{issues:[]}),parent:null});return{result:await a._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(i);{let a,l=[];for(let d of n){let m=et(z({},t),{common:et(z({},t.common),{issues:[]}),parent:null}),v=d._parseSync({data:t.data,path:t.path,parent:m});if(v.status==="valid")return v;v.status==="dirty"&&!a&&(a={result:v,ctx:m}),m.common.issues.length&&l.push(m.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let h=l.map(d=>new Go(d));return Ft(t,{code:wt.invalid_union,unionErrors:h}),ae}}get options(){return this._def.options}};u(FS,"ZodUnion");var gh=FS;gh.create=(r,e)=>new gh(z({options:r,typeName:ce.ZodUnion},be(e)));var su=u(r=>r instanceof vh?su(r.schema):r instanceof Os?su(r.innerType()):r instanceof bh?[r.value]:r instanceof xh?r.options:r instanceof _h?fr.objectValues(r.enum):r instanceof Ch?su(r._def.innerType):r instanceof dh?[void 0]:r instanceof mh?[null]:r instanceof Ps?[void 0,...su(r.unwrap())]:r instanceof al?[null,...su(r.unwrap())]:r instanceof cy||r instanceof Ih?su(r.unwrap()):r instanceof Sh?su(r._def.innerType):[],"getDiscriminator"),mb=class mb extends Ce{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Gt.object)return Ft(t,{code:wt.invalid_type,expected:Gt.object,received:t.parsedType}),ae;let n=this.discriminator,i=t.data[n],a=this.optionsMap.get(i);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(Ft(t,{code:wt.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(e,t,n){let i=new Map;for(let a of t){let l=su(a.shape[e]);if(!l.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let h of l){if(i.has(h))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(h)));i.set(h,a)}}return new mb(z({typeName:ce.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i},be(n)))}};u(mb,"ZodDiscriminatedUnion");var pb=mb;function wS(r,e){let t=ol(r),n=ol(e);if(r===e)return{valid:!0,data:r};if(t===Gt.object&&n===Gt.object){let i=fr.objectKeys(e),a=fr.objectKeys(r).filter(h=>i.indexOf(h)!==-1),l=z(z({},r),e);for(let h of a){let d=wS(r[h],e[h]);if(!d.valid)return{valid:!1};l[h]=d.data}return{valid:!0,data:l}}else if(t===Gt.array&&n===Gt.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<r.length;a++){let l=r[a],h=e[a],d=wS(l,h);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return t===Gt.date&&n===Gt.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}u(wS,"mergeValues");var BS=class BS extends Ce{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=u((a,l)=>{if(ub(a)||ub(l))return ae;let h=wS(a.value,l.value);return h.valid?((cb(a)||cb(l))&&t.dirty(),{status:t.value,value:h.data}):(Ft(n,{code:wt.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,l])=>i(a,l)):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}))}};u(BS,"ZodIntersection");var yh=BS;yh.create=(r,e,t)=>new yh(z({left:r,right:e,typeName:ce.ZodIntersection},be(t)));var gb=class gb extends Ce{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Gt.array)return Ft(n,{code:wt.invalid_type,expected:Gt.array,received:n.parsedType}),ae;if(n.data.length<this._def.items.length)return Ft(n,{code:wt.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:wt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...n.data].map((l,h)=>{let d=this._def.items[h]||this._def.rest;return d?d._parse(new Es(n,l,n.path,h)):null}).filter(l=>!!l);return n.common.async?Promise.all(a).then(l=>Ui.mergeArray(t,l)):Ui.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new gb(et(z({},this._def),{rest:e}))}};u(gb,"ZodTuple");var sl=gb;sl.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sl(z({items:r,typeName:ce.ZodTuple,rest:null},be(e)))};var ay=class ay extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Gt.object)return Ft(n,{code:wt.invalid_type,expected:Gt.object,received:n.parsedType}),ae;let i=[],a=this._def.keyType,l=this._def.valueType;for(let h in n.data)i.push({key:a._parse(new Es(n,h,n.path,h)),value:l._parse(new Es(n,n.data[h],n.path,h)),alwaysSet:h in n.data});return n.common.async?Ui.mergeObjectAsync(t,i):Ui.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof Ce?new ay(z({keyType:e,valueType:t,typeName:ce.ZodRecord},be(n))):new ay(z({keyType:Ic.create(),valueType:e,typeName:ce.ZodRecord},be(t)))}};u(ay,"ZodRecord");var hb=ay,GS=class GS extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Gt.map)return Ft(n,{code:wt.invalid_type,expected:Gt.map,received:n.parsedType}),ae;let i=this._def.keyType,a=this._def.valueType,l=[...n.data.entries()].map(([h,d],m)=>({key:i._parse(new Es(n,h,n.path,[m,"key"])),value:a._parse(new Es(n,d,n.path,[m,"value"]))}));if(n.common.async){let h=new Map;return Promise.resolve().then(async()=>{for(let d of l){let m=await d.key,v=await d.value;if(m.status==="aborted"||v.status==="aborted")return ae;(m.status==="dirty"||v.status==="dirty")&&t.dirty(),h.set(m.value,v.value)}return{status:t.value,value:h}})}else{let h=new Map;for(let d of l){let m=d.key,v=d.value;if(m.status==="aborted"||v.status==="aborted")return ae;(m.status==="dirty"||v.status==="dirty")&&t.dirty(),h.set(m.value,v.value)}return{status:t.value,value:h}}}};u(GS,"ZodMap");var Ld=GS;Ld.create=(r,e,t)=>new Ld(z({valueType:e,keyType:r,typeName:ce.ZodMap},be(t)));var ly=class ly extends Ce{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Gt.set)return Ft(n,{code:wt.invalid_type,expected:Gt.set,received:n.parsedType}),ae;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Ft(n,{code:wt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Ft(n,{code:wt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let a=this._def.valueType;function l(d){let m=new Set;for(let v of d){if(v.status==="aborted")return ae;v.status==="dirty"&&t.dirty(),m.add(v.value)}return{status:t.value,value:m}}u(l,"finalizeSet");let h=[...n.data.values()].map((d,m)=>a._parse(new Es(n,d,n.path,m)));return n.common.async?Promise.all(h).then(d=>l(d)):l(h)}min(e,t){return new ly(et(z({},this._def),{minSize:{value:e,message:Zt.toString(t)}}))}max(e,t){return new ly(et(z({},this._def),{maxSize:{value:e,message:Zt.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};u(ly,"ZodSet");var Ad=ly;Ad.create=(r,e)=>new Ad(z({valueType:r,minSize:null,maxSize:null,typeName:ce.ZodSet},be(e)));var Ed=class Ed extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Gt.function)return Ft(t,{code:wt.invalid_type,expected:Gt.function,received:t.parsedType}),ae;function n(h,d){return iy({data:h,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Md(),ou].filter(m=>!!m),issueData:{code:wt.invalid_arguments,argumentsError:d}})}u(n,"makeArgsIssue");function i(h,d){return iy({data:h,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Md(),ou].filter(m=>!!m),issueData:{code:wt.invalid_return_type,returnTypeError:d}})}u(i,"makeReturnsIssue");let a={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof wc){let h=this;return oo(async function(...d){let m=new Go([]),v=await h._def.args.parseAsync(d,a).catch(I=>{throw m.addIssue(n(d,I)),m}),x=await Reflect.apply(l,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 oo(function(...d){let m=h._def.args.safeParse(d,a);if(!m.success)throw new Go([n(d,m.error)]);let v=Reflect.apply(l,this,m.data),x=h._def.returns.safeParse(v,a);if(!x.success)throw new Go([i(v,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ed(et(z({},this._def),{args:sl.create(e).rest(au.create())}))}returns(e){return new Ed(et(z({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ed(z({args:e||sl.create([]).rest(au.create()),returns:t||au.create(),typeName:ce.ZodFunction},be(n)))}};u(Ed,"ZodFunction");var fb=Ed,VS=class VS extends Ce{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};u(VS,"ZodLazy");var vh=VS;vh.create=(r,e)=>new vh(z({getter:r,typeName:ce.ZodLazy},be(e)));var jS=class jS extends Ce{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Ft(t,{received:t.data,code:wt.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:e.data}}get value(){return this._def.value}};u(jS,"ZodLiteral");var bh=jS;bh.create=(r,e)=>new bh(z({value:r,typeName:ce.ZodLiteral},be(e)));function Z7(r,e){return new xh(z({values:r,typeName:ce.ZodEnum},be(e)))}u(Z7,"createZodEnum");var uy=class uy extends Ce{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return Ft(t,{expected:fr.joinValues(n),received:t.parsedType,code:wt.invalid_type}),ae}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Ft(t,{received:t.data,code:wt.invalid_enum_value,options:n}),ae}return oo(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return uy.create(e,z(z({},this._def),t))}exclude(e,t=this._def){return uy.create(this.options.filter(n=>!e.includes(n)),z(z({},this._def),t))}};u(uy,"ZodEnum");var xh=uy;xh.create=Z7;var US=class US extends Ce{_parse(e){let t=fr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Gt.string&&n.parsedType!==Gt.number){let i=fr.objectValues(t);return Ft(n,{expected:fr.joinValues(i),received:n.parsedType,code:wt.invalid_type}),ae}if(this._cache||(this._cache=new Set(fr.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=fr.objectValues(t);return Ft(n,{received:n.data,code:wt.invalid_enum_value,options:i}),ae}return oo(e.data)}get enum(){return this._def.values}};u(US,"ZodNativeEnum");var _h=US;_h.create=(r,e)=>new _h(z({values:r,typeName:ce.ZodNativeEnum},be(e)));var zS=class zS extends Ce{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Gt.promise&&t.common.async===!1)return Ft(t,{code:wt.invalid_type,expected:Gt.promise,received:t.parsedType}),ae;let n=t.parsedType===Gt.promise?t.data:Promise.resolve(t.data);return oo(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};u(zS,"ZodPromise");var wc=zS;wc.create=(r,e)=>new wc(z({type:r,typeName:ce.ZodPromise},be(e)));var HS=class HS extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:u(l=>{Ft(n,l),l.fatal?t.abort():t.dirty()},"addIssue"),get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let l=i.transform(n.data,a);if(n.common.async)return Promise.resolve(l).then(async h=>{if(t.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"?lh(d.value):t.value==="dirty"?lh(d.value):d});{if(t.value==="aborted")return ae;let h=this._def.schema._parseSync({data:l,path:n.path,parent:n});return h.status==="aborted"?ae:h.status==="dirty"?lh(h.value):t.value==="dirty"?lh(h.value):h}}if(i.type==="refinement"){let l=u(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"&&t.dirty(),l(h.value),{status:t.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"&&t.dirty(),l(h.value).then(()=>({status:t.value,value:h.value}))))}if(i.type==="transform")if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Sc(l))return ae;let h=i.transform(l.value,a);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:h}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>Sc(l)?Promise.resolve(i.transform(l.value,a)).then(h=>({status:t.value,value:h})):ae);fr.assertNever(i)}};u(HS,"ZodEffects");var Os=HS;Os.create=(r,e,t)=>new Os(z({schema:r,typeName:ce.ZodEffects,effect:e},be(t)));Os.createWithPreprocess=(r,e,t)=>new Os(z({schema:e,effect:{type:"preprocess",transform:r},typeName:ce.ZodEffects},be(t)));var XS=class XS extends Ce{_parse(e){return this._getType(e)===Gt.undefined?oo(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};u(XS,"ZodOptional");var Ps=XS;Ps.create=(r,e)=>new Ps(z({innerType:r,typeName:ce.ZodOptional},be(e)));var YS=class YS extends Ce{_parse(e){return this._getType(e)===Gt.null?oo(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};u(YS,"ZodNullable");var al=YS;al.create=(r,e)=>new al(z({innerType:r,typeName:ce.ZodNullable},be(e)));var qS=class qS extends Ce{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===Gt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};u(qS,"ZodDefault");var Ch=qS;Ch.create=(r,e)=>new Ch(z({innerType:r,typeName:ce.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},be(e)));var WS=class WS extends Ce{_parse(e){let{ctx:t}=this._processInputParams(e),n=et(z({},t),{common:et(z({},t.common),{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:z({},n)});return wd(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Go(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Go(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};u(WS,"ZodCatch");var Sh=WS;Sh.create=(r,e)=>new Sh(z({innerType:r,typeName:ce.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},be(e)));var ZS=class ZS extends Ce{_parse(e){if(this._getType(e)!==Gt.nan){let n=this._getOrReturnCtx(e);return Ft(n,{code:wt.invalid_type,expected:Gt.nan,received:n.parsedType}),ae}return{status:"valid",value:e.data}}};u(ZS,"ZodNaN");var Nd=ZS;Nd.create=r=>new Nd(z({typeName:ce.ZodNaN},be(r)));var KG=Symbol("zod_brand"),$S=class $S extends Ce{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};u($S,"ZodBranded");var cy=$S,yb=class yb extends Ce{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return u(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ae:a.status==="dirty"?(t.dirty(),lh(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"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new yb({in:e,out:t,typeName:ce.ZodPipeline})}};u(yb,"ZodPipeline");var py=yb,JS=class JS extends Ce{_parse(e){let t=this._def.innerType._parse(e),n=u(i=>(Sc(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return wd(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};u(JS,"ZodReadonly");var Ih=JS;Ih.create=(r,e)=>new Ih(z({innerType:r,typeName:ce.ZodReadonly},be(e)));function X7(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}u(X7,"cleanParams");function $7(r,e={},t){return r?Mc.create().superRefine((n,i)=>{var l,h;let a=r(n);if(a instanceof Promise)return a.then(d=>{var m,v;if(!d){let x=X7(e,n),S=(v=(m=x.fatal)!=null?m:t)!=null?v:!0;i.addIssue(et(z({code:"custom"},x),{fatal:S}))}});if(!a){let d=X7(e,n),m=(h=(l=d.fatal)!=null?l:t)!=null?h:!0;i.addIssue(et(z({code:"custom"},d),{fatal:m}))}}):Mc.create()}u($7,"custom");var QG={object:Vo.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=u((r,e={message:"Input not instance of ".concat(r.name)})=>$7(t=>t instanceof r,e),"instanceOfType"),J7=Ic.create,K7=ch.create,eV=Nd.create,rV=ph.create,Q7=hh.create,nV=fh.create,iV=Od.create,oV=dh.create,sV=mh.create,aV=Mc.create,lV=au.create,uV=aa.create,cV=Dd.create,pV=lu.create,hV=Vo.create,fV=Vo.strictCreate,dV=gh.create,mV=pb.create,gV=yh.create,yV=sl.create,vV=hb.create,bV=Ld.create,xV=Ad.create,_V=fb.create,CV=vh.create,SV=bh.create,IV=xh.create,MV=_h.create,wV=wc.create,TV=Os.create,PV=Ps.create,EV=al.create,OV=Os.createWithPreprocess,DV=py.create,LV=u(()=>J7().optional(),"ostring"),AV=u(()=>K7().optional(),"onumber"),NV=u(()=>Q7().optional(),"oboolean"),kV={string:u(r=>Ic.create(et(z({},r),{coerce:!0})),"string"),number:u(r=>ch.create(et(z({},r),{coerce:!0})),"number"),boolean:u(r=>hh.create(et(z({},r),{coerce:!0})),"boolean"),bigint:u(r=>ph.create(et(z({},r),{coerce:!0})),"bigint"),date:u(r=>fh.create(et(z({},r),{coerce:!0})),"date")};var RV=ae;var t9=J;var zi=t9;var O9=Wr(l3());var yy=4,EU=8,OU="0.6",E9="low-priority-pin",u3=J.object({rank:J.union([J.enum(["low","medium","high","always-visible"]),J.number()]).optional(),interactive:J.union([J.boolean(),J.literal("pointer-events-auto")]).optional(),id:J.string().optional(),anchor:J.union([J.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),J.array(J.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:J.boolean().optional(),zIndex:J.number().optional(),lowPriorityPin:J.object({enabled:J.boolean().optional(),size:J.number().positive().optional(),color:J.string().optional()}).optional()});function D9(r,e,t){J.array(J.number()).min(2).max(3).parse(r),J.string().parse(e),u3.parse(t)}u(D9,"validateMarker");var DU=Object.freeze({enabled:!0,size:EU,color:"#666"}),Ph=class Ph{constructor(e,t={}){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:z({},DU)});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",u((e,t=!1)=>{var i,a;if(this.currentStrategyIndex===e&&!t)return;if(this.currentStrategyIndex=e,e===this.lowPriorityPinStrategyIndex){this.activeAnchor="center",this.markerContainer.setAttribute("data-anchor",E9);let l=this.options.lowPriorityPin,h=l.size,d=l.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(h,"px")),this.markerContainer.style.setProperty("--pin-color",d),this.markerContainer.style.opacity=OU,this.style.top=-h/2+"px",this.style.left=-h/2+"px"}else{this.activeAnchor=(a=(i=this.strategies[e])==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:l,height:h}=this.dimensions,d=-h/2+"px",m=-l/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=-l+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-h+"px",this.style.left=-l+"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=-l+"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=(t==null?void 0:t.id)||Mr(),this.options=(0,O9.default)(this.options,t),typeof t.rank=="string")this.rank=Sd(t.rank);else if(t.rank!=null&&t.rank>0)this.rank=t.rank;else{let l=Math.trunc(T.env.NODE_ENV==="test"?Ph.testId:Ph.testId*10)/10;Ph.testId+=.001,this.rank=l}typeof t.interactive=="string"&&(this.pointerEvents=t.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=e,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(e,t){if(e!=null&&t!=null)this.dimensions={width:e,height:t};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:e,height:t}=this.dimensions;if(e===0||t===0)return[];let i=(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(l=>({name:l,getBoundingBox:u(()=>{let h=t/2,d=t/2,m=e/2,v=e/2;switch(l){case"top":{h=t,d=0;break}case"bottom":{h=0,d=t;break}case"left":{m=e,v=0;break}case"right":{m=0,v=e;break}case"top-left":{h=t,m=e,d=0,v=0;break}case"top-right":{h=t,v=e,d=0,m=0;break}case"bottom-left":{d=t,m=e,h=0,v=0;break}case"bottom-right":{d=t,v=e,h=0,m=0;break}}return[h+yy,d+yy,m+yy,v+yy]},"getBoundingBox")}));if((a=this.options.lowPriorityPin)!=null&&a.enabled&&this.options.rank!=="always-visible"){let l={name:E9,getBoundingBox:u(()=>{let h=Math.max(2,yy/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(l)}return i}toPackedMessage(e=!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 t=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&e&&t&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,t&&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&&t?this.packedMessage.bboxes.unshift([...a.getBoundingBox(),i]):this.packedMessage.bboxes.push([...a.getBoundingBox(),i])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var e;return!((e=this.options.lowPriorityPin)!=null&&e.enabled)||this.options.rank==="always-visible"?-1:Array.isArray(this.options.anchor)?this.options.anchor.length:1}destroy(){}};u(Ph,"MarkerComponent"),b(Ph,"testId",0);var ll=Ph;y();y();y();y();y();var c3=class c3{constructor(){b(this,"hover",!1);b(this,"dirty",!1)}};u(c3,"InteractionComponent");var Bd=c3;y();y();function wb(r){"@babel/helpers - typeof";return wb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wb(r)}u(wb,"_typeof");var LU=/^\s+/,AU=/\s+$/;function Xt(r,e){if(r=r||"",e=e||{},r instanceof Xt)return r;if(!(this instanceof Xt))return new Xt(r,e);var t=NU(r);this._originalInput=r,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=t.ok}u(Xt,"tinycolor");Xt.prototype={isDark:u(function(){return this.getBrightness()<128},"isDark"),isLight:u(function(){return!this.isDark()},"isLight"),isValid:u(function(){return this._ok},"isValid"),getOriginalInput:u(function(){return this._originalInput},"getOriginalInput"),getFormat:u(function(){return this._format},"getFormat"),getAlpha:u(function(){return this._a},"getAlpha"),getBrightness:u(function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},"getBrightness"),getLuminance:u(function(){var e=this.toRgb(),t,n,i,a,l,h;return t=e.r/255,n=e.g/255,i=e.b/255,t<=.03928?a=t/12.92:a=Math.pow((t+.055)/1.055,2.4),n<=.03928?l=n/12.92:l=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*l+.0722*h},"getLuminance"),setAlpha:u(function(e){return this._a=B9(e),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:u(function(){var e=A9(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},"toHsv"),toHsvString:u(function(){var e=A9(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+n+"%, "+i+"%)":"hsva("+t+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHsvString"),toHsl:u(function(){var e=L9(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},"toHsl"),toHslString:u(function(){var e=L9(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+n+"%, "+i+"%)":"hsla("+t+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHslString"),toHex:u(function(e){return N9(this._r,this._g,this._b,e)},"toHex"),toHexString:u(function(e){return"#"+this.toHex(e)},"toHexString"),toHex8:u(function(e){return BU(this._r,this._g,this._b,this._a,e)},"toHex8"),toHex8String:u(function(e){return"#"+this.toHex8(e)},"toHex8String"),toRgb:u(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:u(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:u(function(){return{r:Math.round(vn(this._r,255)*100)+"%",g:Math.round(vn(this._g,255)*100)+"%",b:Math.round(vn(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:u(function(){return this._a==1?"rgb("+Math.round(vn(this._r,255)*100)+"%, "+Math.round(vn(this._g,255)*100)+"%, "+Math.round(vn(this._b,255)*100)+"%)":"rgba("+Math.round(vn(this._r,255)*100)+"%, "+Math.round(vn(this._g,255)*100)+"%, "+Math.round(vn(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:u(function(){return this._a===0?"transparent":this._a<1?!1:$U[N9(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:u(function(e){var t="#"+k9(this._r,this._g,this._b,this._a),n=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var a=Xt(e);n="#"+k9(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+n+")"},"toFilter"),toString:u(function(e){var t=!!e;e=e||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!t&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return a?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},"toString"),clone:u(function(){return Xt(this.toString())},"clone"),_applyModification:u(function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:u(function(){return this._applyModification(UU,arguments)},"lighten"),brighten:u(function(){return this._applyModification(zU,arguments)},"brighten"),darken:u(function(){return this._applyModification(HU,arguments)},"darken"),desaturate:u(function(){return this._applyModification(GU,arguments)},"desaturate"),saturate:u(function(){return this._applyModification(VU,arguments)},"saturate"),greyscale:u(function(){return this._applyModification(jU,arguments)},"greyscale"),spin:u(function(){return this._applyModification(XU,arguments)},"spin"),_applyCombination:u(function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},"_applyCombination"),analogous:u(function(){return this._applyCombination(WU,arguments)},"analogous"),complement:u(function(){return this._applyCombination(YU,arguments)},"complement"),monochromatic:u(function(){return this._applyCombination(ZU,arguments)},"monochromatic"),splitcomplement:u(function(){return this._applyCombination(qU,arguments)},"splitcomplement"),triad:u(function(){return this._applyCombination(R9,[3])},"triad"),tetrad:u(function(){return this._applyCombination(R9,[4])},"tetrad")};Xt.fromRatio=function(r,e){if(wb(r)=="object"){var t={};for(var n in r)r.hasOwnProperty(n)&&(n==="a"?t[n]=r[n]:t[n]=vy(r[n]));r=t}return Xt(r,e)};function NU(r){var e={r:0,g:0,b:0},t=1,n=null,i=null,a=null,l=!1,h=!1;return typeof r=="string"&&(r=tz(r)),wb(r)=="object"&&(pu(r.r)&&pu(r.g)&&pu(r.b)?(e=kU(r.r,r.g,r.b),l=!0,h=String(r.r).substr(-1)==="%"?"prgb":"rgb"):pu(r.h)&&pu(r.s)&&pu(r.v)?(n=vy(r.s),i=vy(r.v),e=FU(r.h,n,i),l=!0,h="hsv"):pu(r.h)&&pu(r.s)&&pu(r.l)&&(n=vy(r.s),a=vy(r.l),e=RU(r.h,n,a),l=!0,h="hsl"),r.hasOwnProperty("a")&&(t=r.a)),t=B9(t),{ok:l,format:r.format||h,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}u(NU,"inputToRGB");function kU(r,e,t){return{r:vn(r,255)*255,g:vn(e,255)*255,b:vn(t,255)*255}}u(kU,"rgbToRgb");function L9(r,e,t){r=vn(r,255),e=vn(e,255),t=vn(t,255);var n=Math.max(r,e,t),i=Math.min(r,e,t),a,l,h=(n+i)/2;if(n==i)a=l=0;else{var d=n-i;switch(l=h>.5?d/(2-n-i):d/(n+i),n){case r:a=(e-t)/d+(e<t?6:0);break;case e:a=(t-r)/d+2;break;case t:a=(r-e)/d+4;break}a/=6}return{h:a,s:l,l:h}}u(L9,"rgbToHsl");function RU(r,e,t){var n,i,a;r=vn(r,360),e=vn(e,100),t=vn(t,100);function l(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(u(l,"hue2rgb"),e===0)n=i=a=t;else{var h=t<.5?t*(1+e):t+e-t*e,d=2*t-h;n=l(d,h,r+1/3),i=l(d,h,r),a=l(d,h,r-1/3)}return{r:n*255,g:i*255,b:a*255}}u(RU,"hslToRgb");function A9(r,e,t){r=vn(r,255),e=vn(e,255),t=vn(t,255);var n=Math.max(r,e,t),i=Math.min(r,e,t),a,l,h=n,d=n-i;if(l=n===0?0:d/n,n==i)a=0;else{switch(n){case r:a=(e-t)/d+(e<t?6:0);break;case e:a=(t-r)/d+2;break;case t:a=(r-e)/d+4;break}a/=6}return{h:a,s:l,v:h}}u(A9,"rgbToHsv");function FU(r,e,t){r=vn(r,360)*6,e=vn(e,100),t=vn(t,100);var n=Math.floor(r),i=r-n,a=t*(1-e),l=t*(1-i*e),h=t*(1-(1-i)*e),d=n%6,m=[t,l,a,a,h,t][d],v=[h,t,t,l,a,a][d],x=[a,a,h,t,t,l][d];return{r:m*255,g:v*255,b:x*255}}u(FU,"hsvToRgb");function N9(r,e,t,n){var i=[ua(Math.round(r).toString(16)),ua(Math.round(e).toString(16)),ua(Math.round(t).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("")}u(N9,"rgbToHex");function BU(r,e,t,n,i){var a=[ua(Math.round(r).toString(16)),ua(Math.round(e).toString(16)),ua(Math.round(t).toString(16)),ua(G9(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("")}u(BU,"rgbaToHex");function k9(r,e,t,n){var i=[ua(G9(n)),ua(Math.round(r).toString(16)),ua(Math.round(e).toString(16)),ua(Math.round(t).toString(16))];return i.join("")}u(k9,"rgbaToArgbHex");Xt.equals=function(r,e){return!r||!e?!1:Xt(r).toRgbString()==Xt(e).toRgbString()};Xt.random=function(){return Xt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function GU(r,e){e=e===0?0:e||10;var t=Xt(r).toHsl();return t.s-=e/100,t.s=Tb(t.s),Xt(t)}u(GU,"_desaturate");function VU(r,e){e=e===0?0:e||10;var t=Xt(r).toHsl();return t.s+=e/100,t.s=Tb(t.s),Xt(t)}u(VU,"_saturate");function jU(r){return Xt(r).desaturate(100)}u(jU,"_greyscale");function UU(r,e){e=e===0?0:e||10;var t=Xt(r).toHsl();return t.l+=e/100,t.l=Tb(t.l),Xt(t)}u(UU,"_lighten");function zU(r,e){e=e===0?0:e||10;var t=Xt(r).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),Xt(t)}u(zU,"_brighten");function HU(r,e){e=e===0?0:e||10;var t=Xt(r).toHsl();return t.l-=e/100,t.l=Tb(t.l),Xt(t)}u(HU,"_darken");function XU(r,e){var t=Xt(r).toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,Xt(t)}u(XU,"_spin");function YU(r){var e=Xt(r).toHsl();return e.h=(e.h+180)%360,Xt(e)}u(YU,"_complement");function R9(r,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=Xt(r).toHsl(),n=[Xt(r)],i=360/e,a=1;a<e;a++)n.push(Xt({h:(t.h+a*i)%360,s:t.s,l:t.l}));return n}u(R9,"polyad");function qU(r){var e=Xt(r).toHsl(),t=e.h;return[Xt(r),Xt({h:(t+72)%360,s:e.s,l:e.l}),Xt({h:(t+216)%360,s:e.s,l:e.l})]}u(qU,"_splitcomplement");function WU(r,e,t){e=e||6,t=t||30;var n=Xt(r).toHsl(),i=360/t,a=[Xt(r)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(Xt(n));return a}u(WU,"_analogous");function ZU(r,e){e=e||6;for(var t=Xt(r).toHsv(),n=t.h,i=t.s,a=t.v,l=[],h=1/e;e--;)l.push(Xt({h:n,s:i,v:a})),a=(a+h)%1;return l}u(ZU,"_monochromatic");Xt.mix=function(r,e,t){t=t===0?0:t||50;var n=Xt(r).toRgb(),i=Xt(e).toRgb(),a=t/100,l={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(l)};Xt.readability=function(r,e){var t=Xt(r),n=Xt(e);return(Math.max(t.getLuminance(),n.getLuminance())+.05)/(Math.min(t.getLuminance(),n.getLuminance())+.05)};Xt.isReadable=function(r,e,t){var n=Xt.readability(r,e),i,a;switch(a=!1,i=ez(t),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,e,t){var n=null,i=0,a,l,h,d;t=t||{},l=t.includeFallbackColors,h=t.level,d=t.size;for(var m=0;m<e.length;m++)a=Xt.readability(r,e[m]),a>i&&(i=a,n=Xt(e[m]));return Xt.isReadable(r,n,{level:h,size:d})||!l?n:(t.includeFallbackColors=!1,Xt.mostReadable(r,["#fff","#000"],t))};var p3=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"},$U=Xt.hexNames=JU(p3);function JU(r){var e={};for(var t in r)r.hasOwnProperty(t)&&(e[r[t]]=t);return e}u(JU,"flip");function B9(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}u(B9,"boundAlpha");function vn(r,e){KU(r)&&(r="100%");var t=QU(r);return r=Math.min(e,Math.max(0,parseFloat(r))),t&&(r=parseInt(r*e,10)/100),Math.abs(r-e)<1e-6?1:r%e/parseFloat(e)}u(vn,"bound01");function Tb(r){return Math.min(1,Math.max(0,r))}u(Tb,"clamp01");function as(r){return parseInt(r,16)}u(as,"parseIntFromHex");function KU(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}u(KU,"isOnePointZero");function QU(r){return typeof r=="string"&&r.indexOf("%")!=-1}u(QU,"isPercentage");function ua(r){return r.length==1?"0"+r:""+r}u(ua,"pad2");function vy(r){return r<=1&&(r=r*100+"%"),r}u(vy,"convertToPercentage");function G9(r){return Math.round(parseFloat(r)*255).toString(16)}u(G9,"convertDecimalToHex");function F9(r){return as(r)/255}u(F9,"convertHexToDecimal");var la=function(){var r="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+r+")",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),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 pu(r){return!!la.CSS_UNIT.exec(r)}u(pu,"isValidCSSUnit");function tz(r){r=r.replace(LU,"").replace(AU,"").toLowerCase();var e=!1;if(p3[r])r=p3[r],e=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=la.rgb.exec(r))?{r:t[1],g:t[2],b:t[3]}:(t=la.rgba.exec(r))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=la.hsl.exec(r))?{h:t[1],s:t[2],l:t[3]}:(t=la.hsla.exec(r))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=la.hsv.exec(r))?{h:t[1],s:t[2],v:t[3]}:(t=la.hsva.exec(r))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=la.hex8.exec(r))?{r:as(t[1]),g:as(t[2]),b:as(t[3]),a:F9(t[4]),format:e?"name":"hex8"}:(t=la.hex6.exec(r))?{r:as(t[1]),g:as(t[2]),b:as(t[3]),format:e?"name":"hex"}:(t=la.hex4.exec(r))?{r:as(t[1]+""+t[1]),g:as(t[2]+""+t[2]),b:as(t[3]+""+t[3]),a:F9(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=la.hex3.exec(r))?{r:as(t[1]+""+t[1]),g:as(t[2]+""+t[2]),b:as(t[3]+""+t[3]),format:e?"name":"hex"}:!1}u(tz,"stringInputToObject");function ez(r){var e,t;return r=r||{level:"AA",size:"small"},e=(r.level||"AA").toUpperCase(),t=(r.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}u(ez,"validateWCAG2Parms");var I3=Wr(S3());y();var ZH=J.object({rank:J.union([J.enum(["low","medium","high","always-visible"]),J.number()]).optional(),interactive:J.boolean().optional(),appearance:J.object({margin:J.number().min(6).optional(),text:J.object({numLines:J.number().optional(),lineHeight:J.number().optional(),size:J.number().optional(),maxWidth:J.number().optional(),foregroundColor:J.string().optional(),backgroundColor:J.string().optional()}).optional(),marker:J.object({size:J.number().optional(),foregroundColor:J.object({active:J.string().optional(),inactive:J.string().optional()}).optional(),backgroundColor:J.object({active:J.string().optional(),inactive:J.string().optional()}).optional(),iconScale:J.union([J.number(),J.object({on:J.literal("zoom-level").optional(),input:J.array(J.number()).nonempty(),output:J.array(J.number()).nonempty(),easing:J.string().optional()})]).optional()}).optional()}).optional()}),T3=u(r=>{var e,t;if(ZH.parse(r!=null?r:{}),typeof((t=(e=r.appearance)==null?void 0:e.marker)==null?void 0:t.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 x8(r,e,t){J.array(J.number()).min(2).max(3).parse(r),J.string().parse(e),T3(t)}u(x8,"validateLabel");var Ud={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}}},$H={lightOnDark:et(z({},Ud),{text:et(z({},Ud.text),{foregroundColor:"white",backgroundColor:"#333"}),marker:et(z({},Ud.marker),{foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}})}),darkOnLight:et(z({},Ud),{text:et(z({},Ud.text),{foregroundColor:"#333",backgroundColor:"white"}),marker:et(z({},Ud.marker),{foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}})})},JH="LOW_PRIORITY",g8=4,KH=6,QH=20,y8=2,tX="cover",eX=-1/0,v8=6.5,b8={heightAbovePolygon:0,appearance:$H.darkOnLight},_8=u((r,e)=>["numLines","lineHeight","size","maxWidth","foregroundColor","backgroundColor"].some(t=>{var n,i,a;return((n=e.text)==null?void 0:n[t])!=null&&((i=r.text)==null?void 0:i[t])!==((a=e.text)==null?void 0:a[t])}),"isOneOfTextDirtyOptions"),C8=u((r,e)=>["foregroundColor","backgroundColor","icon"].some(t=>{var n,i,a;return((n=e.marker)==null?void 0:n[t])!=null&&((i=r.marker)==null?void 0:i[t])!==((a=e.marker)==null?void 0:a[t])}),"isOneOfMarkerDirtyOptions"),Dh=class Dh{constructor(e,t,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",u(e=>{if(this.currentStrategyIndex===e)return;this.currentStrategyIndex=e;let t=this.strategies[this.currentStrategyIndex];if(t){t.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,l;if(this.id=(a=t.id)!=null?a:Mr(),this.options=(0,I3.default)({},t,b8),this.text=e,this.dp=(h=1)=>h*n.pixelRatio,typeof t.rank=="string")this.rank=Sd(t.rank),this.initialRank=this.rank;else if(t.rank!=null&&t.rank>0)this.rank=t.rank,this.initialRank=t.rank;else{let h=Math.trunc(T.env.NODE_ENV==="test"?Dh.testId:Dh.testId*10)/10;Dh.testId+=.001,this.rank=h,this.initialRank=h}let i=(0,I3.default)({},this.options.appearance,b8.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||QH,iconPadding:(l=i.marker.iconPadding)!=null?l:y8,iconFit:i.marker.iconFit||tX,iconOverflow:i.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:i.marker.iconVisibleAtZoomLevel==null?eX:i.marker.iconVisibleAtZoomLevel,iconScale:i.marker.iconScale}}}get scaledMarkerSize(){return this.totalMarkerSize*this.iconScale}get scaledIconPadding(){var e,t,n;return((n=(t=(e=this.appearance)==null?void 0:e.marker)==null?void 0:t.iconPadding)!=null?n:y8)*this.iconScale}setEntity(){}calculateMarkerSize(){let e=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)/e)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:e,height:t}=this.dimensions,{margin:n}=this.appearance,i=Math.max(KH,n),a=this.iconVisible?i/2:0,l=this.iconVisible?this.scaledMarkerSize:v8/2,h=[{name:"RIGHT",getBoundingBox:u(()=>{let d=Math.max(this.scaledMarkerSize,t);return[d/2+i,d/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+e+i]},"getBoundingBox"),onStrategySelected:u(()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=this.scaledMarkerSize/2+g8,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"LEFT",getBoundingBox:u(()=>{let d=Math.max(this.scaledMarkerSize,t);return[d/2+i,d/2+i,this.scaledMarkerSize/2+e+i,this.scaledMarkerSize/2+i]},"getBoundingBox"),onStrategySelected:u(()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=-e-this.scaledMarkerSize/2-g8,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"TOP",getBoundingBox:u(()=>{let d=this.dp();return[t+this.scaledMarkerSize/2/d+i,this.scaledMarkerSize/2+i,e/2+i,e/2+i]},"getBoundingBox"),onStrategySelected:u(()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-t-this.scaledMarkerSize/2,this.newStyle.left=-e/2},"onStrategySelected")},{name:JH,getBoundingBox:u(()=>[l+a,l+a,l+a,l+a],"getBoundingBox"),onStrategySelected:u(()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:u(()=>[this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i],"getBoundingBox"),onStrategySelected:u(()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}]:h}recomputeCurrentStrategy(e=this.iconScale){if(this.iconScale!==e||this.dirty){let t=this.strategies[this.currentStrategyIndex];if(this.iconScale=e,this.collisionDirty=!0,t){t.onStrategySelected(e);let n=this.style;this.style=this.newStyle,this.newStyle=n}this.dirty=!1}}updatePosition(){}disable(){this.visible=!1}toPackedMessage(e=!1){var t;if(this.visible&&e&&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!==((t=this.packedMessage.bboxes[0])==null?void 0:t[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(){}};u(Dh,"LabelComponent"),b(Dh,"testId",0);var M3=Dh,ul=M3;y();y();var A3=class A3 extends ie{constructor(t,n){super();b(this,"rendererState");b(this,"convertTo3DMapPosition");b(this,"textSet",new Set);b(this,"batchedTextMap",new Map);b(this,"debugTextAreaMesh",new Map);this.rendererState=t,this.convertTo3DMapPosition=n}remove(t){this.textSet.delete(t)}update(t){var h,d,m;let n,i,a,l=[];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 Tc))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,zd().then(({BatchedText:w})=>{let P=new w;return P.type="batchedtext",x.add(P),P}));let I=this.batchedTextMap.get(x);if(!I)throw new Error("batched text required");l.push(S8({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,zd().then(({BatchedText:w})=>{let P=new w;return P.type="batchedtext",x.add(P),P}));let I=this.batchedTextMap.get(x);if(!I)throw new Error("batched text required");l.push(S8({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:P}])=>{let{textMesh:E}=w;if(I&&E){let O=L3(I,E);w.visible&&!O?I.add(E):!w.visible&&O&&I.remove(E)}P.flipToFaceCamera&&this.flipIfNeeded(w,t)})}return Promise.all(l)}flipIfNeeded(t,n){let i=t.textMesh;if(!i)return!1;let a=i.rotation.z,l=H2(a+n);l>Math.PI/2&&l<3*Math.PI/2&&(i.rotation.z=H2(a+Math.PI))}showTextAreaMesh(){let t,n;for(let i of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(i),(t==null?void 0:t.type)==="text3d"&&(n=t.components[0],"textArea"in n.feature.properties)){let a=n.feature.properties.textArea;if(!a)continue;let l=new $s(a.maxWidth,a.maxHeight),h=new ue(l,new Tn({color:"pink"})),{textMesh:d}=n;if(!d)continue;let m=this.convertTo3DMapPosition(a.position,Iy);h.position.copy(m),h.position.z=d.position.z-.1,h.rotation.z=d.rotation.z,P3.identity(),P3.makeRotationAxis(new zt(0,0,1),d.userData.rotationZ),Iy.set(a.maxWidth/2,0,0),Iy.applyMatrix4(P3),h.position.x-=Iy.x,h.position.y-=Iy.y,this.rendererState.entityScene.add(h),this.debugTextAreaMesh.set(i,h)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(t=>{this.rendererState.entityScene.remove(t)}),this.debugTextAreaMesh.clear(),this.publish("render")}};u(A3,"Text3DSystem");var Rb=A3;function O3(r){zd().then(({configureTroikaTextBuilder:e})=>{e({useWorker:r})})}u(O3,"configureWorker");var P3=new ts,Iy=new zt,E3;async function D3(r){let{preloadFont:e}=await zd();return e(r)}u(D3,"preloadFont");function zd(){return E3||(E3=import("./text3d-NII2JXSR.js").then(r=>r)),E3}u(zd,"getText3DService");async function S8({entityId:r,textComponent:e,styleComponent:t,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:a,type:l="text-area"}){return Promise.all([zd(),Promise.resolve({entityId:r,meshComponent:e,styleComponent:t})]).then(([{createTroikaTextPoint:h,createTroikaTextArea:d},m])=>l==="text-area"?d(m.entityId,m.meshComponent,m.styleComponent,n):h(m.entityId,m.meshComponent,m.styleComponent,n)).catch(h=>{K.warn("Trouble creating text: ",h)}).then(h=>{if(!(h!=null&&h.text))return;let d=[Promise.resolve(h.text),i,Promise.resolve()];if(e.polygonEntityId){let m=a.geometry3DMap.get(e.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+rX)}}else d[2]=zd().then(({syncText:m})=>m(h.text));return Promise.all(d)}).then(h=>{if(!h)return;let[d,m]=h;m.add(d),e.batchedText||(e.batchedText=m)})}u(S8,"createText");function L3(r,e){return r._members.has(e)}u(L3,"doesBatchedTextContainsText");var rX=.5;var nX=J.object({visible:J.boolean(),color:J.string(),flipToFaceCamera:J.boolean(),font:J.string().optional(),fontSize:J.number(),margin:J.union([J.number(),J.tuple([J.number(),J.number(),J.number(),J.number()])]),outlineColor:J.string(),outlineOpacity:J.number(),outlineBlur:J.union([J.number(),J.string()]),outlineWidth:J.number(),outlineOffsetX:J.number(),outlineOffsetY:J.number(),strokeWidth:J.number(),maxWidth:J.number().optional(),maxHeight:J.number().optional(),strokeOpacity:J.number(),strokeColor:J.string(),fillOpacity:J.number(),hoverColor:J.string().optional(),id:J.union([J.string(),J.number()]),type:J.literal("text3d"),position:J.tuple([J.number(),J.number(),J.number()]),content:J.string()}),I8=nX.partial().omit({id:!0,type:!0}).strict(),M8=I8.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),w8=J.object({appearance:I8.optional(),parentId:J.string().optional()}).strict(),N3=class N3{constructor(e){b(this,"mesh",new Qs);b(this,"textMesh");b(this,"type","text3d");b(this,"feature");b(this,"parent");b(this,"batchedText");b(this,"polygonEntityId");this.feature=e}get visible(){return this.batchedText&&this.textMesh?L3(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(e){this.batchedText&&this.textMesh?e?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=e),this.mesh.visible=e}};u(N3,"Text3DComponent");var Tc=N3;y();var k3=class k3{constructor(e){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=e}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]}};u(k3,"OutlineComponent");var Hd=k3;y();y();y();var R3=class R3 extends yT{constructor(t){let n=t,i=3,a=i*4;super(new Uint8Array(t*a),i,t,S0,C0);b(this,"_width");b(this,"_height");b(this,"_propertiesLength");this._width=a,this._height=n,this._propertiesLength=i}setColor(t,n,i){let a=this.image.data,l=t*this._width;a[l]=Math.round(n.r*255),a[l+1]=Math.round(n.g*255),a[l+2]=Math.round(n.b*255),a[l+3]=0,a[l+4]=Math.round(i.r*255),a[l+5]=Math.round(i.g*255),a[l+6]=Math.round(i.b*255),a[l+7]=0,this.needsUpdate=!0}getColor(t){let n=this.image.data,i=t*this._width,a=new Qr(n[i]/255,n[i+1]/255,n[i+2]/255),l=new Qr(n[i+4]/255,n[i+5]/255,n[i+6]/255);return{color:a,topColor:l}}setTexture(t,n,i){let a=this.image.data,l=t*this._width;a[l+8]=n?255:0,a[l+9]=i?255:0,a[l+10]=0,a[l+11]=0,this.needsUpdate=!0}getTexture(t){let n=this.image.data,i=t*this._width,a=n[i+8]===255,l=n[i+9]===255;return{texture:a,topTexture:l}}};u(R3,"BatchedPropertiesTexture");var Fb=R3;y();var T8="#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 P8="#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 iX=-.05,oX=1,F3=class F3 extends Js{constructor(t,n,i=1){super(t);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",cp);b(this,"showTextures",u(t=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(t,n,i),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new Fb(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=a=>{let l=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=T8,a.fragmentShader=P8,Object.assign(this.uniforms,{uGradientIntensity:l,uGradientEnd:h,uGradientStart:d,uMinSideAlpha:{value:iX},uMaxSideAlpha:{value:oX},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:m,uTexture:v,uRepeatYFactor:x,uBlendTexture:S})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(t){t!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=t,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(t){t.wrapS=Na,t.wrapT=Na,t.colorSpace=this.colorSpace,this.uniforms.uTexture.value=t}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(t){t.wrapS=Na,t.wrapT=Na,t.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=t}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(t){t!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=t,this.colorSpace=t?lT:cp,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(t,n,i){this.uniforms.uGradientStart.value=t,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}setColor(t,n,i){this.propertiesTexture.setColor(t,n,i)}getColor(t){return this.propertiesTexture.getColor(t)}hideTextures(t){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(t,!1,!1),this.needsUpdate=!0)}removeSideTexture(t){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(t,!1,n),this.needsUpdate=!0}}removeTopTexture(t){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(t,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};u(F3,"BatchedStandardMaterial");var Lh=F3;y();function E8(r,e){var m,v,x;let t=0;for(let S of r)t+=((v=(m=S.components[0])==null?void 0:m.geometry)==null?void 0:v.attributes.position.count)||0;let n=new Qr(e.color),i;i=new Lh({color:n,side:e.side==="back"?sT:e.side==="front"?_0:Fl,opacity:(x=e.opacity)!=null?x:1,transparent:e.opacity!==void 0?e.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},r.length);let a=new F0(r.length,t,0,i),l,h,d;for(let S of r)l=S.components[0],!(!(l instanceof kn)||!l.geometry)&&(l.mesh=a,l.material=i,l.instanceIndex=a.addGeometry(l.geometry),a.addInstance(l.instanceIndex),a.userData.entities[l.instanceIndex]=S.id,i instanceof Lh&&i.setColor(l.instanceIndex,n,e.topColor?new Qr(e.topColor):n),h=a.getGeometryIdAt(l.instanceIndex),l.batchedProps&&(d=a.getGeometryRangeAt(h),d&&(l.batchedProps.range=d),l.batchedProps.geometryId=h));return a.perObjectFrustumCulled=!0,a.matrixAutoUpdate=!1,a}u(E8,"batchGeometries");function Xd(r){return Xt(r).darken(30).toRgbString()}u(Xd,"darkenColorForOutline");function O8(r,e,t,n){if(e.length<1)return;r.boundingBox||r.computeBoundingBox();let i=r.boundingBox,a=r.getAttribute("position"),l=r.getAttribute("normal"),h=r.getAttribute("uv"),d,m;r.index?(d=r.index.count/3,m=u(function(L,G){return r.index.getX(L*3+G)},"meshIndex")):(d=a.count/3,m=u(function(L,G){return L*3+G},"meshIndex"));let v=new ts;v.makeRotationFromQuaternion(new pp().setFromEuler(new Bl(0,0,t/180*Math.PI)));let x=e.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=e.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 G=l.getX(m(L,0))+l.getX(m(L,1))+l.getX(m(L,2)),j=l.getY(m(L,0))+l.getY(m(L,1))+l.getY(m(L,2)),$=l.getZ(m(L,0))+l.getZ(m(L,1))+l.getZ(m(L,2)),q=Math.abs(G),k=Math.abs(j),tt=Math.abs($);var P,E;q<=k&&q<=tt?(P="x",k<=tt?E="y":E="z"):k<=q&&k<=tt?(P="y",q<=tt?E="x":E="z"):(P="z",q<=k?E="x":E="y"),P==="z"&&(P=E,E="z");let ut,at,H,St,pt,ct;if(E==="z"||P==="z"){if(!I||!w)continue;ut=I.repeat.u,at=I.repeat.v,H=I.offset.u,St=I.offset.v,pt=I.rotation,ct=w}else{if(!x||!S)continue;ut=x.repeat.u,at=x.repeat.v,H=x.offset.u,St=x.offset.v,pt=(360-t+x.rotation)%360,ct=S}let{min:It,max:Et}=ct,dt=new Gl;dt.position.set(It.x,It.y,0),dt.updateMatrix(),dt.updateMatrixWorld();let bt=It.clone().applyMatrix4(v),Z=Et.clone().applyMatrix4(v),te=Math.abs(Z.x-bt.x),jt=Math.abs(Z.y-bt.y),ee=new zt(te,jt,Et.z).applyMatrix4(dt.matrixWorld),Tt=Math.abs(ee[P]-It[P]),le=Math.abs(ee[E]-It[E]),vr=pt*Math.PI/180||0,Qe=Math.cos(vr),Nt=Math.sin(vr),At=dt.matrixWorld.clone().invert(),xt=new pp().setFromEuler(new Bl(0,0,t/180*Math.PI));for(let _e=0;_e<3;_e++){let Xr=new zt(a.getX(m(L,_e)),a.getY(m(L,_e)),a.getZ(m(L,_e))).applyMatrix4(At);Xr.applyQuaternion(xt);let me=Xr.applyMatrix4(dt.matrixWorld),Se=me.x,br=me.y,Yr=me.z;var O,N;P==="x"?O=ut*(Se-It[P])/Tt+H:P==="y"?O=ut*(br-It[P])/Tt+H:O=ut*(Yr-It[P])/Tt+H,E==="x"?N=at*(Se-It[E])/le+St:E==="y"?N=at*(br-It[E])/le+St:N=at*(Yr-It[E])/le+St,O-=.5,N-=.5;let Wi=O*Qe-N*Nt+.5,Yt=O*Nt+N*Qe+.5;h.setX(m(L,_e),Wi),h.setY(m(L,_e),Yt)}}}u(O8,"updateUVsLegacy");y();var B3=class B3{constructor(){b(this,"focusMesh");b(this,"dirty",!0)}};u(B3,"FocusableComponent");var mu=B3;function wi(r,e,t){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container"||r.type==="custom-geometry")return e===!0?(r instanceof fp&&r.components[1]===void 0?(r.components[1]=new Bd,r.components[1].dirty=!0):r instanceof Sr&&r.components[2]===void 0?(r.components[2]=new Bd,r.components[2].dirty=!0):r instanceof Er&&r.components[1]===void 0&&(r.components[1]=new Bd,r.components[1].dirty=!0),!0):(r instanceof fp?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=t.geometry3DMap.get(i),wi(n,e,t);return!0}}return!1}u(wi,"updateInteractivity");function D8(r,e,t){if(!(!(t!=null&&t.color)&&!("topColor"in t))){if(t!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let n,i,a=r.components[0];for(let l of r.userData.entities3D.values())if(n=e.geometry3DMap.get(l),n){i=n.components[1],i.color===a.color&&(i.initialColor=t.color||a.color,i.color=t.color||a.color,i.dirty=!0);let h=n.components[3];h&&(h.color=Xd(i.color||a.color),h.dirty=!0),i.topColor===a.topColor&&(i.topColor=t.topColor||a.topColor,i.dirty=!0)}return t.color!==void 0&&(a.color=t.color,a.dirty=!0),"topColor"in t&&(a.topColor=t.topColor,a.dirty=!0),!0}return!1}}u(D8,"updateGroupColor");function L8(r,e){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let t=r.components[0];return t.shading=t.shading||{},t.shading&&(e.start!==t.shading.start||e.end!==t.shading.end||e.intensity!==t.shading.intensity)&&(Object.assign(t.shading,e),r.userData.shadingDirty=!0),!0}return!1}u(L8,"updateGroupShading");function A8(r,e){e!==void 0&&r.type==="geometry"&&(e.showImage!==void 0&&(r.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}u(A8,"updateImageProps");function V3(r,e,t){if(t!==void 0){if(r.type==="geometry"){let n=r.components[1];if(n.height!==t)return n.height=t,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=e.geometry3DMap.get(i),l;((a==null?void 0:a.type)==="geometry"||(a==null?void 0:a.type)==="model")&&(l=a.components[1],l.height===n.height&&(a.components[1].height=t,a.components[1].dirty=!0),a.components[3]&&(a.components[3].dirty=!0))}return r.components[0].height=t,!0}}return!1}u(V3,"updateHeight");function j3(r,e){if(e!==void 0){let t=!1;(r.type==="path"||r.type==="geometry")&&(e.initialColor!==void 0&&e.initialColor!==r.components[1].initialColor&&(r.components[1].initialColor=e.initialColor,t=!0),e.color!==void 0&&e.color!==r.components[1].color&&(r.components[1].color=e.color,t=!0,r.components[3]&&(r.components[3].color=Xd(e.color),r.components[3].dirty=!0)),"topColor"in e&&(r.components[1].topColor=e.topColor,t=!0),t&&(r.components[1].dirty=!0))}}u(j3,"updateColor");function U3(r,e,t){e!==void 0&&(r.type==="label"||r.type==="marker"?r.updatePosition(t(e[1],e[0],e[2]||0)):r.type==="custom-geometry"&&r.components[0].position.copy(t(e[1],e[0],e[2]||0)))}u(U3,"updatePosition");function z3(r,e){var t;return e!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parentObject3D!==e&&r.parentObject3D instanceof Er?((t=r.parentObject3D)==null||t.removeEntity(r),e.addEntity(r),!0):!1}u(z3,"updateParent");function N8(r,e){e!==void 0&&(r.type==="marker"||r.type==="label")&&r.components[0].enabled!==e&&(r.components[0].enabled=e)}u(N8,"updateEnabled");function k8(r,e,t){if(e!==void 0&&r.type==="marker"){let n=r.components[0];if(e.contentHTML!==void 0)return n.containerEl.innerHTML=e.contentHTML,n.contentHtml=e.contentHTML,!0;if(e.anchor!==void 0&&(n.options.anchor=e.anchor,n.collisionDirty=!0),e.dynamicResize!==void 0)return n.options.dynamicResize=e.dynamicResize,!0;if(e.options!=null){try{u3.parse(e.options||{})}catch(i){return K.error(i),!1}return e.options.interactive!=null&&(e.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",wi(r,!1,t)):(n.pointerEvents="none",wi(r,e.options.interactive,t))),R8(r,e.options.rank),!0}}return!1}u(k8,"updateMarker");function R8(r,e){return e!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=Sd(e),!0):!1}u(R8,"updateRank");function F8(r,e,t){var n,i,a,l,h,d;if(e!==void 0&&r.type==="label"){let m=r.components[0];e.text!==void 0&&e.text!==m.text&&(m.text=e.text,m.textDirty=!0);try{T3((n=e.options)!=null?n:{})}catch(v){K.error(v);return}_8(m.appearance,((i=e.options)==null?void 0:i.appearance)||{})&&(m.textDirty=!0),C8(m.appearance,((a=e.options)==null?void 0:a.appearance)||{})&&(m.markerDirty=!0),WT(m.appearance,((l=e.options)==null?void 0:l.appearance)||{}),wi(r,(h=e.options)==null?void 0:h.interactive,t),R8(r,(d=e.options)==null?void 0:d.rank)}}u(F8,"updateLabel");function B8(r,e){e!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=e,r.components[1].dirty=!0)}u(B8,"updateHoverColor");function G8(r,e){if(e!==void 0){let t=r.components[2];if(r.type==="geometry"&&t!=null)return t.hover=e,t.dirty=!0,!0}return!1}u(G8,"updateHovered");function H3(r,e){e!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=e)}u(H3,"updateFlipImageToFaceCamera");function cl(r,e,t){if(t!==void 0)if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"||r.type==="text3d"){t!==r.components[1].visible&&(r.components[1].visible=t,r.components[1].dirty=!0);let n=r.components[3];return n&&(n.visible=t,n.dirty=!0),!0}else{if(r.type==="geometry-group")return r.setVisible(t),!0;if(r.type==="group-container"){if(r.visible!==t)return r.setVisible(t),t===!1&&r.traverse(n=>{if(n instanceof FT){let i=e.geometry2DMap.get(n.userData.entityId);if(i){let a=i.components[0];a instanceof ul&&(a.canShow=t)}}}),!0}else if(r.type==="label")return r.components[0].visible=t,!0}return!1}u(cl,"updateVisibility");function X3(r,e,t){if(t!==void 0){if(r.type==="geometry-group"){let n=r.components[0];if(n.opacity!==t){for(let i of r.userData.entities3D.values()){let a=e.geometry3DMap.get(i),l;((a==null?void 0:a.type)==="geometry"||(a==null?void 0:a.type)==="model")&&(l=a.components[1],(!l.opacity||l.opacity===n.opacity)&&(l.opacity=t,l.dirty=!0))}return r.setOpacity(t),n.opacity=t,!0}}else if(r.type==="group-container"&&r.opacity!==t){r.setOpacity(t);let n=1;return r.parent instanceof Er&&(n=r.parent.opacity),V8(r,e,n),!0}}return!1}u(X3,"updateOpacity");function V8(r,e,t=1){if(r.type==="group-container"&&"children"in r&&r.children.length>0){let n=t*r.opacity;r.userData.computedOpacity=n;for(let i of r.children)(i instanceof ro&&i.type==="geometry-group"||i instanceof Er&&i.type==="group-container")&&V8(i,e,n)}else if(r.type==="geometry-group")for(let n of r.userData.entities3D.values()){let i=e.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)}}u(V8,"cascadeOpacity");function j8(r,e){if(e!==void 0&&r.type==="geometry-group"){let t=r.components[0];(e==null?void 0:e.texture)!=null&&t.texture!==(e==null?void 0:e.texture)&&(t.texture=e.texture,t.dirty=!0),(e==null?void 0:e.topTexture)!=null&&t.topTexture!==(e==null?void 0:e.topTexture)&&(t.topTexture=e.topTexture,t.dirty=!0)}}u(j8,"updateGroupTexture");function U8(r,e){if(r.type==="geometry"){let t=!1,n=r.components[1];if((e==null?void 0:e.texture)!=null&&n.texture!==(e==null?void 0:e.texture)&&(n.texture=e.texture,t=!0),(e==null?void 0:e.topTexture)!=null&&n.topTexture!==(e==null?void 0:e.topTexture)&&(n.topTexture=e.topTexture,t=!0),t&&r.components[0]instanceof kn){let i=r.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),r.components[1].dirty=!0,!0}}return!1}u(U8,"updateIndividualGeometryTexture");function z8(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.opacity!==e){t.opacity=e;let n=r.components[0],i=r.components[3];i&&(i.dirty=!0),n.detached===!1&&(n.detached=!0,n.dirty=!0),e===0?t.visible=!1:t.visible=!0,t.dirty=!0;let a=r.parentObject3D;return(a==null?void 0:a.type)==="geometry-group"&&(a.userData.shadingDirty=!0),!0}}return!1}u(z8,"updateIndividualGeometryOpacity");function Yd(r,e){if(e!==void 0)if(r.type==="geometry"||r.type==="path"||r.type==="custom-geometry"){let t=r.components[1];if(t.altitude!==e)return t.altitude=e,t.dirty=!0,r.components[3]&&(r.components[3].dirty=!0),!0}else{if(r.type==="group-container"&&r.altitude!==e)return r.setAltitude(e),!0;if(r.type==="geometry-group"&&r.altitude!==e)return r.setAltitude(e),!0}return!1}u(Yd,"updateAltitude");function Bb(r,e,t){if(t!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)for(let n of r.userData.entities3D.values()){let i=e.geometry3DMap.get(n);i instanceof Sr&&Bb(i,e,t)}else if(r.type==="geometry"){let n=r.components[3],i=r.components[1];!n&&t===!0?r.components[3]=new Hd(Xd(i.color)):n&&(n.visible=t,n.dirty=!0)}return!0}return!1}u(Bb,"updateOutline");function Gb(r,e){if(e!==void 0){let t,n=4;if(r.type==="geometry"?(t=r.components[4],n=4):r.type==="group-container"&&(t=r.components[2],n=2),e===!0&&t==null)return r.components[n]=new mu,!0;if(e===!1&&t!=null)return r.components[n]=void 0,!0}return!1}u(Gb,"updateFocusable");function H8(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.renderOrder!==e){t.renderOrder=e;let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=e+1),t.dirty=!0,!0}}return!1}u(H8,"updateIndividualGeometryRenderOrder");function X8(r,e,t){let{visible:n,color:i}=t;if(r.type!=="path")return;let a=r.components[0];n!=null&&cl(r,e,n),i!=null&&j3(r,{color:i}),Object.assign(a,Y3(t)),HT(t)||(a.materialDirty=!0,(t.nearRadius!=null||t.farRadius!=null)&&(a.dirty=!0),(t.nearZoomLevel!=null||t.farZoomLevel!=null)&&(a.dirty=!0))}u(X8,"handlePathUpdate");function Y3(r){return es(r,aX)}u(Y3,"pickPathOptions");var aX=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel","dashed","visibleThroughGeometry"];function Y8(r){if(!(r instanceof Sr&&r.type==="text3d"))throw new Error("expect target is TextGeometry3D")}u(Y8,"assetGeometryIsText3D");var Vb=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function q8(r,e,t){cl(r,e,t.visible);let n=r.components[1],i=es(t,Vb);"margin"in t&&K.warn("update to margin is not supported atm"),"content"in t&&K.warn("content update is not supported atm");try{M8.parse(i)}catch(a){K.error(a);return}Object.keys(i).length>0&&(Object.assign(n,i),n.dirty=!0)}u(q8,"handleText3DUpdate");var lX=["color","material","opacity","verticalOffset","rotation","position","scale"];function W8(r,e){let t=es(e,lX),n=r.components[1],i=r.components[0];Object.keys(t).length>0&&(t.material&&(n.material=t.material),t.opacity!=null&&(n.opacity=t.opacity,t.opacity===0?n.visible=!1:n.visible=!0,n.dirty=!0),t.verticalOffset!=null&&(n.verticalOffset=t.verticalOffset),t.color!=null&&(n.color=t.color),t.position!=null&&(i.feature.geometry.coordinates=t.position,i.positionDirty=!0),t.rotation!=null&&(n.rotation=t.rotation),t.scale!=null&&(n.scale=t.scale),n.dirty=!0)}u(W8,"handleModelStyleUpdate");var Ah,pl,jb,Pc,Z8,wy,Ub,$8,J8,Ty,zb,Py,Ey,Hb,q3=class q3{constructor(e){F(this,Pc);F(this,Ah,null);F(this,pl);b(this,"getCurrentSceneGLTF",u(async e=>{let t=z({onlyVisible:!0,binary:!0,light:!0,scale:1},e),n=await gt(this,Pc,Z8).call(this),i=p(this,jb).call(this,t),a=await n.parseAsync(i,{trs:!1,maxTextureSize:1/0,onlyVisible:t.onlyVisible,binary:t.binary,scale:t.scale}),l;if(a instanceof ArrayBuffer)l=new Blob([a],{type:"application/octet-stream"});else{let h=JSON.stringify(a,null,2);l=new Blob([h],{type:"text/plain"})}return l},"getCurrentSceneGLTF"));F(this,jb,u(e=>{let{scale:t,light:n,onlyVisible:i}=e,a=new nc,l=new _n().setFromObject(p(this,pl).entityScene);if(p(this,wy).call(this,p(this,pl).entityScene,a,i),n){let h=new O0(16777215,.3*Math.PI);h.position.set(0,Math.max(l.max.x,l.max.y)*t*.5,l.max.y*t*4),h.lookAt(0,0,-1),h.target.position.set(0,0,-1),h.add(h.target),a.add(h)}return a},"#getExportedScene"));F(this,wy,u((e,t,n)=>{e.material&&(e instanceof T0?gt(this,Pc,$8).call(this,e).forEach(i=>t.add(i)):e instanceof Df&&t.add(gt(this,Pc,J8).call(this,e))),e.children.forEach(i=>{(!n||i.visible)&&p(this,wy).call(this,i,t,n)})},"#processObject3D"));F(this,Ub,u((e,t,n)=>{let i=new _T({color:new Qr(e),metalness:0});return i.opacity=t,i.transparent=n,i},"#createStandardMaterial"));F(this,Ty,u(e=>{let{geometry:t,material:n,position:i,rotation:a,quaternion:l,scale:h}=e;if(!(t!=null&&t.isBufferGeometry))return e;let d=t.attributes.position,m=t.attributes.normal,v=t.attributes.uv;return p(this,zb).call(this,d,m),p(this,Ey).call(this,i,h,a,l),v&&p(this,Hb).call(this,v),n!=null&&n.map&&t.type==="PlaneGeometry"&&(e.side=Fl),e},"#convertGeometry"));F(this,zb,u((e,t)=>{let n=new zt,i=new zt;for(let a=0;a<e.count;a++)n.fromBufferAttribute(e,a),p(this,Py).call(this,n),e.setXYZ(a,n.x,n.y,n.z),t&&(i.fromBufferAttribute(t,a),p(this,Py).call(this,i),t.setXYZ(a,i.x,i.y,i.z))},"#convertAttributes"));F(this,Py,u(e=>{let t=e.y;e.y=e.z,e.z=-t},"#convertVector"));F(this,Ey,u((e,t,n,i)=>{let a=e.y;e.y=e.z,e.z=-a;let l=t.y;if(t.y=t.z,t.z=l,n instanceof Bl)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"));F(this,Hb,u(e=>{for(let t=0;t<e.count;t++){let n=e.getX(t),i=e.getY(t);e.setXY(t,n,i)}},"#convertUVs"));V(this,pl,e),p(this,pl).entityScene=e.entityScene,p(this,pl).geometry3DMap=e.geometry3DMap}destroy(){V(this,Ah,null)}};Ah=new WeakMap,pl=new WeakMap,jb=new WeakMap,Pc=new WeakSet,Z8=u(async function(){if(!p(this,Ah)){let{GLTFExporter:e}=await import("./GLTFExporter-JCFGXXW5.js");V(this,Ah,new e)}return p(this,Ah)},"#getGLTFExporter"),wy=new WeakMap,Ub=new WeakMap,$8=u(function(e){var l,h;let t=[],i=((l=e.userData)!=null&&l.entities?Object.values((h=e.userData)==null?void 0:h.entities):[]).map(d=>p(this,pl).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 Va&&m.opacity===0||m instanceof ig||m instanceof H0)return;let x=v!=null&&v.hover?m.hoverColor||p(this,pl).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((O,N)=>{if(N.type==="custom-geometry")return O;let L=N.components[0];return"geometry"in L&&L.geometry instanceof w0&&O.push(L.geometry),O},[]),w=p(this,Ub).call(this,v,Number(x),e.material.transparent),P=_s(I,!0),E=new ue(P,w);E.position.copy(e.position),E.rotation.copy(e.rotation),E.scale.copy(e.scale),E.visible=!!S,p(this,Ey).call(this,E.position,E.scale,E.rotation,E.quaternion),t.push(p(this,Ty).call(this,E))}),t},"#processBatchedMesh"),J8=u(function(e){let t=e.geometry.clone(),n=e.material,i=new Tn({color:n.color,side:Fl});i.opacity=n.opacity,i.transparent=n.transparent;let a=new Df(t,i);return a.position.copy(e.position),a.rotation.copy(e.rotation),a.scale.copy(e.scale),a.visible=e.visible,p(this,Ty).call(this,a)},"#processLineSegments"),Ty=new WeakMap,zb=new WeakMap,Py=new WeakMap,Ey=new WeakMap,Hb=new WeakMap,u(q3,"ExporterSystem");var My=q3;y();y();y();var $3=Wr(aO());function lO(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}u(lO,"JSClipperError");lO.prototype=Error.prototype;$3.default.Error=function(r){throw new lO(r)};var ui=$3.default;var eq="gray",rq=.1,Ly=100,J3=new ui.ClipperOffset;function nq(r,e){J3.Clear(),e/=2;let t=r.map(i=>({X:i.x*Ly,Y:i.y*Ly}));J3.AddPath(t,ui.JoinType.jtMiter,ui.EndType.etClosedPolygon);let n=new ui.Paths;return J3.Execute(n,e*Ly),n.length?n.map(a=>a.map(l=>({x:l.X/Ly,y:l.Y/Ly}))):[r]}u(nq,"offset");function $b(r,e,t){var S,I,w,P,E;let{color:n=eq,opacity:i=1,altitude:a=0,height:l=rq}=t||{};Array.isArray(i)&&(i=1);let h={min:{x:1/0,y:1/0,z:a},max:{x:-1/0,y:-1/0,z:l+a},center:{x:0,y:0,z:(l+a)/2}},m=r.geometry.coordinates[0].map(O=>{let N=e(O[1],O[0]);return h.min.x=Math.min(h.min.x,N.x),h.min.y=Math.min(h.min.y,N.y),h.max.x=Math.max(h.max.x,N.x),h.max.y=Math.max(h.max.y,N.y),N});((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=nq(m,((E=(P=r.properties)==null?void 0:P.style)==null?void 0:E.edgeOffset)||0):m=[m];let v=[];for(let O of m){let N=new ka;N.moveTo(O[0].x,O[0].y),O.slice(1).forEach($=>N.lineTo($.x,$.y)),N.lineTo(O[0].x,O[0].y);let L=r.geometry.coordinates.slice(1);N.holes=L.map($=>{let q=$.map(tt=>e(tt[1],tt[0])),k=new oc;return k.moveTo(q[0].x,q[0].y),q.slice(1).forEach(tt=>k.lineTo(tt.x,tt.y)),k.lineTo(q[0].x,q[0].y),k});let G={bevelEnabled:!1,depth:l},j=new Ra(N,G);j.userData={style:{color:n,opacity:i}},v.push(j)}if(v.length===1)return v[0];let x=_s(v);return x.userData={style:{color:n,opacity:i},_split:!0},x}u($b,"renderPolygonGeometry");y();var iq="gray",oq=.1;function Jb(r,e,t){let{color:n=iq,opacity:i=1,altitude:a=0,height:l=oq}=t||{};Array.isArray(i)&&(i=1);let h={min:{x:1/0,y:1/0,z:a},max:{x:-1/0,y:-1/0,z:l+a}},d={bevelEnabled:!1,depth:l},m=[];r.geometry.coordinates.forEach(x=>{let S=new ka,I=x[0].map(E=>{let O=e(E[1],E[0]);return h.min.x=Math.min(h.min.x,O.x),h.min.y=Math.min(h.min.y,O.y),h.max.x=Math.max(h.max.x,O.x),h.max.y=Math.max(h.max.y,O.y),O});S.moveTo(I[0].x,I[0].y),I.slice(1).forEach(E=>S.lineTo(E.x,E.y)),S.lineTo(I[0].x,I[0].y);let w=x.slice(1);S.holes=w.map(E=>{let O=E.map(L=>e(L[1],L[0])),N=new oc;return N.moveTo(O[0].x,O[0].y),O.slice(1).forEach(L=>N.lineTo(L.x,L.y)),N.lineTo(O[0].x,O[0].y),N});let P=new Ra(S,d);m.push(P)});let v=_s(m);return v.translate(0,0,a||0),v.userData={style:{color:n,opacity:i}},v}u(Jb,"renderMultiPolygonGeometry");y();var sq="gray",K3=new ui.ClipperOffset,Mo=100;function uO(r,e,t){let{color:n=sq,opacity:i=1,width:a=1,join:l="round",cap:h="round",height:d=.01,altitude:m=0}=t||{};Array.isArray(i)&&(i=0);let v=[];for(let P=0;P<r.geometry.coordinates.length-1;P++){let E=e(r.geometry.coordinates[P][1],r.geometry.coordinates[P][0]),O=e(r.geometry.coordinates[P+1][1],r.geometry.coordinates[P+1][0]);v.push([E,O])}K3.AddPaths(v.map(P=>P.map(E=>({X:E.x*Mo,Y:E.y*Mo}))),l==="round"?ui.JoinType.jsRound:l==="miter"?ui.JoinType.jsMiter:ui.JoinType.jsSquare,h==="round"?ui.EndType.etOpenRound:h==="butt"?ui.EndType.etOpenButt:ui.EndType.etOpenSquare);let x=new ui.PolyTree;K3.Execute(x,a/2*Mo);let S=[],I={bevelEnabled:!1,depth:d};for(let P of x.m_AllPolys){let E=new ka;if(P.IsHole())continue;let O=P.m_polygon;E.moveTo(O[0].X/Mo,O[0].Y/Mo),O.slice(1).forEach(N=>E.lineTo(N.X/Mo,N.Y/Mo)),E.lineTo(O[0].X/Mo,O[0].Y/Mo),E.holes=P.m_Childs.map(N=>{let L=new oc,G=N.m_polygon;return L.moveTo(G[0].X/Mo,G[0].Y/Mo),G.slice(1).forEach(j=>L.lineTo(j.X/Mo,j.Y/Mo)),L.lineTo(G[0].X/Mo,G[0].Y/Mo),L}),S.push(new Ra(E,I))}let w=_s(S);return w.translate(0,0,m||0),w.userData={style:{color:n,opacity:i}},K3.Clear(),w}u(uO,"renderLineStringGeometry");y();var wo=100,aq=.22,lq=.01;function cO(r,e,t={}){let{width:n=aq,height:i=lq,color:a="gray",opacity:l=1,altitude:h=0}=t,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 ui.ClipperOffset,x=r.geometry.coordinates.map(P=>P.map(E=>e(E[1],E[0])));v.AddPaths(x.map(P=>P.map(E=>({X:E.x*wo,Y:E.y*wo}))),ui.JoinType.jsMiter,ui.EndType.etOpenRound);let S=new ui.PolyTree;v.Execute(S,n/2*wo);let I=[];for(let P of S.m_AllPolys){let E=new ka;if(P.IsHole())continue;d.min.x=Math.min(d.min.x,P.m_polygon[0].X),d.min.y=Math.min(d.min.y,P.m_polygon[0].Y),d.max.x=Math.max(d.max.x,P.m_polygon[0].X),d.max.y=Math.max(d.max.y,P.m_polygon[0].Y);let O=P.m_polygon;E.moveTo(O[0].X/wo,O[0].Y/wo),O.slice(1).forEach(N=>E.lineTo(N.X/wo,N.Y/wo)),E.lineTo(O[0].X/wo,O[0].Y/wo),E.holes=P.m_Childs.map(N=>{let L=new oc,G=N.m_polygon;return L.moveTo(G[0].X/wo,G[0].Y/wo),G.slice(1).forEach(j=>L.lineTo(j.X/wo,j.Y/wo)),L.lineTo(G[0].X/wo,G[0].Y/wo),L}),I.push(new Ra(E,m))}let w=_s(I);return w.translate(0,0,h||0),w.userData={style:{color:a,opacity:l}},v.Clear(),w}u(cO,"renderMultiLineStringGeometry");y();y();var Zd=J.object({type:J.enum(["Point"]),coordinates:J.array(J.number()).min(2).max(3)});var uq=J.object({rotation:J.array(J.number()).length(3).optional(),altitude:J.number().optional(),scale:J.array(J.number()).length(3).optional(),interactive:J.boolean().optional(),verticalOffset:J.number().optional(),id:J.union([J.number(),J.string()]).optional()}),cq=J.object({type:J.enum(["Feature"]),geometry:Zd,properties:uq}),pq=J.object({type:J.enum(["FeatureCollection"]),features:J.array(cq)}),hq=J.object({color:J.string()}),fq=J.object({url:J.string(),color:J.string().optional(),opacity:J.number().optional(),material:J.record(J.string(),hq).optional()});function hO(r,e,t){J.union([J.number(),J.string()]).parse(r),pq.parse(e),fq.parse(t)}u(hO,"validateModelGroup");var Ay,Ny,Q3=class Q3{constructor(e){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 Qr);b(this,"position",new zt);F(this,Ay,0);F(this,Ny,1);this.feature=e}setOpacity(){}setColor(){}get altitude(){return p(this,Ay)}set altitude(e){this.mesh&&(this.mesh.position.z=e,V(this,Ay,e))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(e){this.mesh&&this.mesh.rotation.set(Ie.degToRad(e[0]),Ie.degToRad(e[1]),Ie.degToRad(e[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(e){this.mesh&&this.mesh.scale.set(e[0],e[1],e[2])}get opacity(){return p(this,Ny)}set opacity(e){var t,n,i;if(this.mesh){if(this.mesh.children[0]instanceof ic){for(let a of this.mesh.children)if(a instanceof ic){((t=a.userData)==null?void 0:t.originalOpacity)===void 0&&(a.userData.originalOpacity=a.material.opacity);let l=Ul(e,0,(n=a.userData)==null?void 0:n.originalOpacity,0,1);a.material.opacity=l,a.material.transparent=l<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(l=>{pO(l,e)}):pO(a.material,e))});V(this,Ny,e)}}};Ay=new WeakMap,Ny=new WeakMap,u(Q3,"ModelComponent");var Dc=Q3;function pO(r,e){r.opacity!==e&&(e===1?(r.opacity=1,r.transparent=!1):(r.opacity=e,r.transparent=!0),r.needsUpdate=!0)}u(pO,"updateMaterialOpacity");y();function Kb(r){var h,d;let e=r.components[0],t=r.components[1];t.opacity!=null&&t.opacity!==e.opacity&&(e.opacity=t.opacity);let n=t.material,i=t.color;if(n||i){let m=dq(i,n);(h=e.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=e.feature.geometry.coordinates[2])!=null?d:0,l=t.verticalOffset+a;e.altitude!==l&&(e.altitude=l),t.visible!==e.visible&&(e.visible=t.visible),t.rotation&&e.setRotation(t.rotation),t.scale&&e.setScale(t.scale)}u(Kb,"applyModelGeometryStyle");function dq(r,e){let t={};if(r&&Object.assign(t,{Default:{color:r},Fabric:{color:r},Mpdn_Logo:{color:r},CouchLogo:{color:r}}),e)for(let n in e)e[n].color&&(t[n]?t[n].color=e[n].color:t[n]={color:e[n].color});return t}u(dq,"consolidateColorAndMaterial");function fO(r,e){var l,h;let t=r.components[0],i=(l=r.components[1].verticalOffset)!=null?l:0,a=t.feature.geometry.coordinates.slice();a[2]=((h=a[2])!=null?h:0)+i,t.mesh?t.mesh.position.copy(e(a)):t.position.copy(e(a))}u(fO,"applyModelPosition");function mq(r){let{color:e,opacity:t,topColor:n,texture:i,topTexture:a}=r;return"".concat(e).concat(t).concat(n||"").concat(i||"").concat(a||"")}u(mq,"generateIndex");var tI=class tI extends ie{constructor(t,n){super();b(this,"state");b(this,"convertTo3DMapPosition");b(this,"loader");b(this,"optimizePromise",[]);this.state=t,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:t}=await import("./GLTFLoader-GIMAVLLC.js");return this.loader=new t,this.loader}createEntityFromFeature(t,n,i){var h,d;let a=new kn(n),l=new Sr(a,new Va(et(z({},i),{url:(d=(h=n.properties)==null?void 0:h.image)==null?void 0:d.path})));return i!=null&&i.outline&&(l.components[3]=new Hd(Xd(i.color))),i!=null&&i.focusable&&(l.components[4]=new mu),l.id=t,l}createModelFromFeature(t,n,i){let a=new Dc(n),l=z({},i);n.properties.verticalOffset!=null&&(l.verticalOffset=n.properties.verticalOffset),n.properties.rotation!=null&&(l.rotation=n.properties.rotation),n.properties.scale!=null&&(l.scale=n.properties.scale);let h=new H0(l),d=new Sr(a,h);return d.id=t,d}populateEntityMesh(t,n){let i=t.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=t.components[1].height,i.dirty=!1}async populateModelGroup(t,n,i){let a=new ts,l=new Bl,h=new pp,d=new zt,m=new Qs,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 P=w;if("isMesh"in P&&P.isMesh===!0){let E=new ic(P.geometry,P.material,t.size);E.userData={entities:{}},m.add(E),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=t.values().next().value,m.userData.type="model")),S()})});return this.optimizePromise.push(x.then(()=>{var w,P,E,O,N,L,G,j,$,q,k,tt;let S=0,I;for(let ut of t.values()){if(I=this.state.geometry3DMap.get(ut),!I||(I==null?void 0:I.type)!=="model")continue;let at=I.components[0],H=I.components[1],St=I.components[0].feature;at.mesh=m,at.instanceIndex=S,Kb(I),I.components[1].dirty=!1;let{x:pt,y:ct}=this.convertTo3DMapPosition(St.geometry.coordinates[1],St.geometry.coordinates[0],0);at.position.set(pt,ct,at.altitude),l.set(Ie.degToRad((P=(w=H.rotation)==null?void 0:w[0])!=null?P:Vf[0]),Ie.degToRad((O=(E=H.rotation)==null?void 0:E[1])!=null?O:Vf[1]),Ie.degToRad((L=(N=H.rotation)==null?void 0:N[2])!=null?L:Vf[2])),d.set((j=(G=H.scale)==null?void 0:G[0])!=null?j:Gf[0],(q=($=H.scale)==null?void 0:$[1])!=null?q:Gf[1],(tt=(k=H.scale)==null?void 0:k[2])!=null?tt:Gf[2]),h.setFromEuler(l),a.compose(at.position,h,d),m.children.forEach(It=>{!I||(I==null?void 0:I.type)!=="model"||!(It instanceof ic)||(It.setMatrixAt(S,a),It.userData.entities[S]=I.id)}),at.mesh.userData.isSingleModel&&(at.mesh.matrix.copy(a),at.mesh.matrix.decompose(at.mesh.position,at.mesh.quaternion,at.mesh.scale)),S++}this.publish("model-loaded")})),m}populateEntityGroup(t){var h;let n,i,a,l;for(let d of t.values())l=this.state.geometry3DMap.get(d),l.components[0]instanceof kn&&(i=l.components[0].feature,a=l.components[1],i.geometry.type==="Polygon"?(n=$b(i,this.convertTo3DMapPosition,a),(h=i.properties)!=null&&h.textures&&i.properties.textures.length>0&&O8(n,i.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(l,n)):i.geometry.type==="MultiPolygon"?(n=Jb(i,this.convertTo3DMapPosition,a),this.populateEntityMesh(l,n)):i.geometry.type==="LineString"?(n=uO(i,this.convertTo3DMapPosition,a),this.populateEntityMesh(l,n)):i.geometry.type==="MultiLineString"&&(n=cO(i,this.convertTo3DMapPosition,a),this.populateEntityMesh(l,n)));return t}update(){var t;for(let n of this.state.geometryGroupIdsToLoad.values()){let i=this.state.geometry3DMap.get(n);if(i instanceof ro&&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){K.warn(h)}let a,l={};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=mq(m);l[v]===void 0&&(l[v]={style:m,entities:[]}),l[v].entities.push(a)}else d&&"mesh"in d&&d.mesh&&((t=d.mesh)==null?void 0:t.parent)!==i&&i.add(d.mesh)}for(let h in l){let d=E8(l[h].entities,l[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()}};u(tI,"MeshCreationAndOptimizationSystem");var Qb=tI;y();var eI=class eI{constructor(e,t){b(this,"state");b(this,"dirty",!0);b(this,"domTree");this.state=e,this.domTree=t}update(){if(this.dirty){let e;for(let t of Array.from(this.domTree.children))if(e=this.state.geometry2DMap.get(t.userData.entityId),e){let n=e.components[0];(!n.enabled||!n.visible||!this.state.geometry2DIdsInScene.has(t.userData.entityId))&&this.domTree.removeChild(t)}else this.domTree.removeChild(t);for(let t of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(t),e){let n=e.components[0];n instanceof ll&&n.enabled&&n.markerContainer&&!this.domTree.contains(n.markerContainer)&&(n.markerContainer.userData={entityId:e.id},this.domTree.appendChild(n.markerContainer),n.updateDimensions())}this.dirty=!1}}};u(eI,"DOMVisibilitySystem");var tx=eI;y();var rI=class rI{constructor(e,t){b(this,"state");b(this,"project");this.state=e,this.project=t}update(){let e,t=0,n,i;for(let a of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(a),e){i=e.components[0];let l=e.attachedTo?this.state.geometry3DMap.get(e.attachedTo):void 0;if(l instanceof Sr)if(this.state.geometry3DIdsInScene.has(l.id)){n=l.components[1],i=e.components[0],(n.dirty||e.components[0].attachedDirty)&&(t=n.height,e.setAltitude(t));let h=n.visible&&n.opacity>0;i.visible!==h&&(i.visible=h)}else i.visible===!0&&(i.visible=!1);this.project(e.components[0].projection,e.position),e.components[0].attachedDirty=!1}}};u(rI,"TwoDProjectionSystem");var ex=rI;y();y();var gq=u(function(){let e,t;return n=>{if((!t||!t)&&(e=document.createElement("canvas"),e.width=500*n,e.height=500*n,e.style.width="500px",e.style.height="500px",t=e.getContext("2d")),!t)throw new Error("Could not get 2D context");return{measureCanvas:e,measureCanvasContext:t}}},"createMeasureCanvasContext")(),dO=u(({text:r,size:e,maxWidth:t,pixelRatio:n,maxLines:i=2,lineHeight:a=1.2,options:l={strokeText:!0}})=>{let h="bold ".concat(e*n,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:d}=gq(n);d.font=h;let m=[],v=r.split(" "),x=0,S=0,I=0;for(;S<v.length;){let O=v[S];if(x===i&&x>0){m[x-1]+="...";break}if(m[x]==null&&(m[x]=O,S++),v.length===1){m[x]=O;break}if(v[S]==null)break;let{width:N}=d.measureText(m[x]+" "+v[S]);N<=t*n?(m[x]+=" "+v[S],S++):x++}m.forEach(O=>{let{width:N}=d.measureText(O);I=Math.max(N,I)});let w=e*n*a,P=m.length*w;return{maxWidth:I,maxHeight:P,lines:m.length,draw:u((O,N,L)=>{m.length===1?(l.strokeText&&O.strokeText(m[0],N,L),O.fillText(m[0],N,L)):(l.strokeText&&(O.strokeText(m[0],N,L-w/2),O.strokeText(m[1],N,L+w/2)),O.fillText(m[0],N,L-w/2),O.fillText(m[1],N,L+w/2))},"draw")}},"shaveText");y();function mO(r){let e=new Image;return r&&(/<svg[\s\S]*>/i.test(r)?e.src="data:image/svg+xml;base64,".concat(btoa(r)):e.src=r),e}u(mO,"createImage");var nI=class nI extends ie{constructor(t,n,i){super();b(this,"dirty",!1);b(this,"state");b(this,"colliderContext");b(this,"colliderCanvas");b(this,"transformRequestFunc");b(this,"transformRequest",u(async t=>this.transformRequestFunc?await this.transformRequestFunc(t):{url:t},"transformRequest"));b(this,"pinCache",{});b(this,"imageCache",{});b(this,"imagePromiseCache",{});b(this,"imageDimensionsCache",{});b(this,"textCache",{});b(this,"update",u(t=>{let n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let i,a,l,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 ul&&!v.disposed)){if(d=m.appearance.marker.iconVisibleAtZoomLevel,m.appearance.marker.icon!=null&&d&&t>=d!==m.iconVisible&&(m.iconVisible=t>=d,m.dirty=!0),(m.dirty||this.dirty)&&m.calculateMarkerSize(),a=m.appearance.marker.foregroundColor,l=m.appearance.marker.backgroundColor,h=Af(m.markerSize,2),i="".concat(a.active,"-").concat(a.inactive,"-").concat(l.active,"-").concat(l.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:P}=this.processText(m.text,m.appearance.text.size,m.appearance.text.maxWidth,m.appearance.text.numLines,m.appearance.text.lineHeight);["left","center","right"].forEach(E=>{this.textCache[m.id][E]=this.textToCanvas(I,m.appearance.text.size,E,w,P,m.appearance.text.foregroundColor,m.appearance.text.backgroundColor)}),m.dimensions={width:Math.ceil(w/n),height:Math.ceil(P/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:P,easing:E}=m.appearance.marker.iconScale;I==="zoom-level"?S=AT(t,w,P,E!=null?E:"linear"):K.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",u((t,n,i,a,l)=>{let h=this.state.pixelRatio,{draw:d,maxWidth:m,maxHeight:v}=dO({text:t,size:n,pixelRatio:h,maxWidth:i,maxLines:a,lineHeight:l});return{textDrawFn:d,width:m+2.5*h*2,height:v+2.5*h*2}},"processText"));b(this,"textToCanvas",u((t,n,i,a,l,h,d)=>{let m=this.state.pixelRatio,v,x=a,S=l;window.OffscreenCanvas!=null&&!zT()?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 t(I,w,(S+2.5*m/2)/2),v},"textToCanvas"));b(this,"cacheImage",u(t=>{if(!t.appearance.marker.icon)return;let n=$T(t.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(i=>{this.transformRequest(t.appearance.marker.icon).then(a=>{let l=mO(a.url);l.onload=()=>{this.imageCache[n]=l,this.publish("img:loaded"),i(l)}})})),t.imageHash!==n&&(t.imageHash=n,this.imagePromiseCache[n].then(()=>{t.dirty=!0}))},"cacheImage"));b(this,"createPinCanvas",u((t,n,i,a,l=1)=>{let h,d=this.state.pixelRatio,m=t.totalMarkerSize*2*d*l;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)*l,0,2*Math.PI),v.fillStyle=i,v.fill(),v.beginPath(),v.arc(m/2,m/2,n/2*l,0,2*Math.PI),v.shadowColor="transparent",v.fillStyle=a,v.fill(),h},"createPinCanvas"));b(this,"prepare",u((t,n,i)=>{let a=this.state.pixelRatio;i.lineWidth=4*a;let l=typeof t.appearance.marker.iconScale=="number"?[t.appearance.marker.iconScale]:t.appearance.marker.iconScale==null?[]:t.appearance.marker.iconScale.output,h=l.length>0?Math.max(...l):void 0,d=this.createPinCanvas(t,t.markerSize,t.appearance.marker.backgroundColor.active,t.appearance.marker.foregroundColor.active,h),m=this.createPinCanvas(t,t.iconVisible?t.markerSize:3.5*a,t.appearance.marker.backgroundColor.inactive,t.appearance.marker.foregroundColor.inactive,h);this.pinCache[n]=[d,m]},"prepare"));this.state=t,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=i}draw(t,n,i){var m,v;if(!t.canShow||!t.visible)return;i.save(),i.globalAlpha=t.opacity;let a=this.state.pixelRatio,l=t.projection.x*a,h=t.projection.y*a,d=t.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1];if(i.drawImage(d,l-t.scaledMarkerSize*a,h-t.scaledMarkerSize*a,t.scaledMarkerSize*2*a,t.scaledMarkerSize*2*a),t.appearance.marker.icon&&t.iconVisible&&t.imageHash&&t.appearance.marker.iconSize&&this.imageCache[t.imageHash]){let x=this.imageCache[t.imageHash],S=(t.scaledMarkerSize-t.scaledIconPadding)*a,I=t.appearance.marker.iconFit,w=S,P=S,E="".concat(t.imageHash,"_").concat(I);if(this.imageDimensionsCache[E])w=this.imageDimensionsCache[E].width,P=this.imageDimensionsCache[E].height;else{let O=x.width*a,N=x.height*a;if(I==="contain"){let L=Math.sqrt(O**2+N**2),G=S/L;w=O*G,P=N*G}if(I==="cover"){let L=S/O,G=S/N,j=Math.max(L,G);w=O*j,P=N*j}}i.save(),i.beginPath(),i.arc(l,h,S/2,0,2*Math.PI),i.closePath(),((v=(m=t==null?void 0:t.appearance)==null?void 0:m.marker)==null?void 0:v.iconOverflow)!=="visible"&&i.clip(),i.drawImage(x,l-w/2,h-P/2,w,P),i.restore()}t.style.textLabelVisible&&t.style.textAlign!=null&&t.style.left!=null&&t.style.top!=null&&i.drawImage(this.textCache[t.id][t.style.textAlign],l+t.style.left*a,h+t.style.top*a),i.restore()}};u(nI,"TwoDDrawSystem");var rx=nI;y();y();var Lc=class Lc{constructor(){b(this,"loader");this.loader=new Lf}static getInstance(){return Lc.instance||(Lc.instance=new Lc),Lc.instance}getLoader(){return this.loader}load(e){return new Promise((t,n)=>{this.loader.load(e,t,void 0,n)})}};u(Lc,"TextureLoaderSingleton"),b(Lc,"instance");var iI=Lc,Ac=iI.getInstance();function xq(r,e){let t=r.components[2],n=r.components[1];return t!=null&&t.hover?[n.hoverColor||e,n.hoverColor||e]:[n.color,n.topColor||n.color]}u(xq,"processColor");var Fh,Ry,oI=class oI extends ie{constructor(t,n){super();F(this,Fh);b(this,"state");b(this,"convertTo3DMapPosition");b(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=n,this.state=t}setShading(t,n){t.material&&t.material.setGradientShading(n.start,n.end,n.intensity)}processTextures(t,n,i){var a;if(n.texture!==t.texture&&n.texture!==""&&gt(this,Fh,Ry).call(this,n.texture,t,"texture"),n.topTexture!==t.topTexture&&n.topTexture!==""&&gt(this,Fh,Ry).call(this,n.topTexture,t,"topTexture"),(t.texture==null||t.topTexture==null)&&Array.isArray((a=t.feature.properties)==null?void 0:a.textures)&&t.feature.properties.textures.length>0)for(let l of t.feature.properties.textures)l.face==="top"&&t.topTexture!==l.path?gt(this,Fh,Ry).call(this,l.path,t,"topTexture"):l.face==="side"&&t.texture!==l.path&&gt(this,Fh,Ry).call(this,l.path,t,"texture"),t.blendTexture=!0;(t.texture!=null||t.topTexture!=null)&&(i!=null&&i.hover&&t.texturesVisible?t.hideTextures():t.texturesVisible||t.showTextures(),n.texture===""&&t.removeSideTexture(),n.topTexture===""&&t.removeTopTexture())}update(){var a,l,h,d,m,v,x,S;let t,n,i;for(let I of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(I),i instanceof ro&&i.type==="geometry-group"){let w=i.components[0];if(i.userData.shadingDirty){let P=i.userData.entities3D.values().next().value;if(P==null)continue;let E=this.state.geometry3DMap.get(P);E instanceof Sr&&(E.type==="geometry"||E.type==="custom-geometry")&&(t=E.components[0],i.userData.shadingDirty&&w.shading&&this.setShading(t,w.shading));let O,N;for(let L of i.userData.entities3D.values())O=this.state.geometry3DMap.get(L),N=O.components[0],O.type==="geometry"&&N.detached&&i.userData.shadingDirty&&w.shading&&this.setShading(N,w.shading);i.userData.shadingDirty=!1}if(w.dirty){let P=i.getfirstChildEntityId();if(P){let O=this.state.geometry3DMap.get(P),N=O==null?void 0:O.components[0];N instanceof kn&&this.processTextures(N,w)}let E=w.opacity*dp(i);i.getOpacity()!==E&&i.setOpacity(E),w.dirty=!1}}else if(i&&(i.type==="geometry"||i.type==="custom-geometry")&&((a=i.components[1])!=null&&a.dirty||(l=i.components[2])!=null&&l.dirty)){let w=i.components[0],P=i.components[1];n=i.components[2];let E=xq(i,this.state.hoverColor);if(w.setColor(E[0],E[1]),P.visible!==w.visible&&(w.visible=P.visible,w instanceof kn&&w.textMesh)){let N=this.state.geometry3DMap.get(w.textMesh.userData.entityId);(N==null?void 0:N.type)==="text3d"&&N.components[0].polygonEntityId!=null&&(N.components[0].visible=P.visible)}P.altitude!==w.altitude&&(w.altitude=P.altitude);let O=P.opacity*dp(i);O!==w.opacity&&(w.opacity=O),P.renderOrder!==w.renderOrder&&(w.renderOrder=P.renderOrder),P.dirty=!1,w instanceof kn&&this.processTextures(w,P,n),i.components[2]&&(i.components[2].dirty=!1)}else if((i==null?void 0:i.type)==="model")i.components[1].dirty&&(Kb(i),i.components[1].dirty=!1),i.components[0].positionDirty&&(fO(i,this.convertTo3DMapPosition),i.components[0].positionDirty=!1);else if((i==null?void 0:i.type)==="image"&&((h=i.components[1])!=null&&h.dirty)){t=i.components[0];let w=i.components[1];w.visible!==t.visible&&(t.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){t=i.components[0];let w=i.components[1];w.visible!=null&&w.visible!==t.visible&&(t.visible=w.visible);let{textMesh:P}=t;if(P){Object.assign(P,w.getState());let E=(m=w.hoverColor)!=null?m:this.state.text3dHoverColor;P.color=w.hoverByPolygon?E:(v=w.color)!=null?v:Bf.color,P.outlineColor=w.hoverByPolygon?E:(x=w.outlineColor)!=null?x:Bf.outlineColor,P.strokeColor=w.hoverByPolygon?E:(S=w.strokeColor)!=null?S:Bf.strokeColor}w.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async t=>{(await t).dispose()}),this.textureLoadingCache.clear()}};Fh=new WeakSet,Ry=u(async function(t,n,i){if(!(!t||!n.showTextures))if(this.textureLoadingCache.has(t)){i==="topTexture"?n.topTexture=await this.textureLoadingCache.get(t):n.texture=await this.textureLoadingCache.get(t),n.showTextures();return}else{let a=new Promise((l,h)=>{Ac.getLoader().load(t,d=>{i==="topTexture"?n.topTexture=d:n.texture=d,n.showTextures(),this.publish("texture-loaded"),l(d)},void 0,()=>{K.error("Failed to load texture: ".concat(t)),h("Failed to load texture: ".concat(t))})});this.textureLoadingCache.set(t,a)}},"#loadTexture"),u(oI,"DrawSystem");var nx=oI;y();var sI=class sI extends ie{constructor(t){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",u(()=>{this.animating.clear();let t,n;for(let i of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(i),t&&(n=t.components[0],n instanceof ul&&(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=t,this.playAnimations=this._playAnimations}_playAnimations(){let t=performance.now();for(let[n,[i,a]]of this.animating.entries()){let l=a===1?this.showDuration:this.hideDuration,h=(t-this.startTime)/l;n.opacity=Ul(h,0,1,i,a,a===0?DT:LT),t-this.startTime>=l&&(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")}};u(sI,"TwoDVisibilitySystem");var ix=sI;y();var aI=class aI extends ie{constructor(t,n,i,a,l,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",u((t=!1)=>{var n;if(((n=this.renderer)==null?void 0:n.renderer)==null)return Promise.resolve();if(t){let i=this.commitRenderState();return this.paint(),i}else return this.frameId?Promise.resolve():new Promise((i,a)=>{this.frameId=requestAnimationFrame(()=>{var l,h;return((l=this.renderer)==null?void 0:l.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",u(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));b(this,"drawEntities2D",u(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));b(this,"updateEntities2D",u(()=>{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",u(()=>{try{let t=[];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(),qT(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(),YT(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&&t.push(n),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),t.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(t)}catch(t){return Promise.reject(t)}},"commitRenderState"));this.renderer=t,this.state=n,this.mode=i,this.scene=a,this.cameraObject=l,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 t;(t=this.renderer)!=null&&t.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)}};u(aI,"RenderSystem");var ox=aI;y();var _q=J.object({interactive:J.boolean().optional(),id:J.string().optional(),nearRadius:J.number().optional(),farRadius:J.number().optional(),accentColor:J.string().optional(),displayArrowsOnPath:J.boolean().optional(),animateArrowsOnPath:J.boolean().optional(),nearZoomLevel:J.number().optional(),farZoomLevel:J.number().optional(),visibleThroughGeometry:J.boolean().optional(),dashed:J.boolean().optional()}),Cq=J.object({type:J.enum(["Feature"]),geometry:Zd,properties:J.object({parentId:J.any().optional()})});function gO(r,e){J.object({features:J.array(Cq)}).parse(r),_q.parse(e)}u(gO,"validatePath");var Fy,lI=class lI{constructor(e,t){b(this,"type","path");b(this,"mesh",new Qs);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);F(this,Fy,0);var n,i,a,l,h,d,m;this.feature=e,this.options=t||{},this.accentColor=(n=t==null?void 0:t.accentColor)!=null?n:this.accentColor,this.nearRadius=(i=t==null?void 0:t.nearRadius)!=null?i:this.nearRadius,this.farRadius=(a=t==null?void 0:t.farRadius)!=null?a:this.farRadius,this.nearZoomLevel=t==null?void 0:t.nearZoomLevel,this.farZoomLevel=t==null?void 0:t.farZoomLevel,this.displayArrowsOnPath=(l=t==null?void 0:t.displayArrowsOnPath)!=null?l:this.displayArrowsOnPath,this.animateArrowsOnPath=(h=t==null?void 0:t.animateArrowsOnPath)!=null?h:this.animateArrowsOnPath,this.visibleThroughGeometry=(d=t==null?void 0:t.visibleThroughGeometry)!=null?d:this.visibleThroughGeometry,this.dashed=(m=t==null?void 0:t.dashed)!=null?m:this.dashed}setColor(){}setOpacity(){}set visible(e){this.mesh&&(this.mesh.visible=e)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return p(this,Fy)}set altitude(e){this.mesh&&(this.mesh.position.z=e,V(this,Fy,e))}set complete(e){this.material&&(this.material.uniforms.complete.value=e,this.material.needsUpdate=!0)}};Fy=new WeakMap,u(lI,"PathComponent");var Nc=lI;y();var uI=class uI{constructor(e){b(this,"rendererState");this.rendererState=e}update(){let e;for(let t of this.rendererState.geometry3DIdsInScene)if(e=this.rendererState.geometry3DMap.get(t),e instanceof Er&&e.components[0]){let n=e.components[0];if(n.dirty){for(let i of e.children)(i instanceof ro||i instanceof Er)&&(i.userData.entityId!==e.components[0].activeId?i.setVisible(!1):i.setVisible(!0));n.dirty=!1}}}};u(uI,"StackSystem");var sx=uI;y();y();y();var Fn=Object.freeze({Linear:Object.freeze({None:u(function(r){return r},"None"),In:u(function(r){return r},"In"),Out:u(function(r){return r},"Out"),InOut:u(function(r){return r},"InOut")}),Quadratic:Object.freeze({In:u(function(r){return r*r},"In"),Out:u(function(r){return r*(2-r)},"Out"),InOut:u(function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},"InOut")}),Cubic:Object.freeze({In:u(function(r){return r*r*r},"In"),Out:u(function(r){return--r*r*r+1},"Out"),InOut:u(function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},"InOut")}),Quartic:Object.freeze({In:u(function(r){return r*r*r*r},"In"),Out:u(function(r){return 1- --r*r*r*r},"Out"),InOut:u(function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},"InOut")}),Quintic:Object.freeze({In:u(function(r){return r*r*r*r*r},"In"),Out:u(function(r){return--r*r*r*r*r+1},"Out"),InOut:u(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:u(function(r){return 1-Math.sin((1-r)*Math.PI/2)},"In"),Out:u(function(r){return Math.sin(r*Math.PI/2)},"Out"),InOut:u(function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))},"InOut")}),Exponential:Object.freeze({In:u(function(r){return r===0?0:Math.pow(1024,r-1)},"In"),Out:u(function(r){return r===1?1:1-Math.pow(2,-10*r)},"Out"),InOut:u(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:u(function(r){return 1-Math.sqrt(1-r*r)},"In"),Out:u(function(r){return Math.sqrt(1- --r*r)},"Out"),InOut:u(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:u(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:u(function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},"Out"),InOut:u(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:u(function(r){var e=1.70158;return r===1?1:r*r*((e+1)*r-e)},"In"),Out:u(function(r){var e=1.70158;return r===0?0:--r*r*((e+1)*r+e)+1},"Out"),InOut:u(function(r){var e=2.5949095;return(r*=2)<1?.5*(r*r*((e+1)*r-e)):.5*((r-=2)*r*((e+1)*r+e)+2)},"InOut")}),Bounce:Object.freeze({In:u(function(r){return 1-Fn.Bounce.Out(1-r)},"In"),Out:u(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:u(function(r){return r<.5?Fn.Bounce.In(r*2)*.5:Fn.Bounce.Out(r*2-1)*.5+.5},"InOut")}),generatePow:u(function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:u(function(e){return Math.pow(e,r)},"In"),Out:u(function(e){return 1-Math.pow(1-e,r)},"Out"),InOut:u(function(e){return e<.5?Math.pow(e*2,r)/2:(1-Math.pow(2-e*2,r))/2+.5},"InOut")}},"generatePow")}),By=u(function(){return performance.now()},"now"),ax=function(){function r(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return u(r,"Group"),r.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,a=t;i<a.length;i++){var l=a[i];(e=l._group)===null||e===void 0||e.remove(l),l._group=this,this._tweens[l.getId()]=l,this._tweensAddedDuringUpdate[l.getId()]=l}},r.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,i=e;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(e){return!e.isPlaying()})},r.prototype.update=function(e,t){e===void 0&&(e=By()),t===void 0&&(t=!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]],l=!t;a&&a.update(e,l)===!1&&!t&&this.remove(a)}n=Object.keys(this._tweensAddedDuringUpdate)}},r}(),$d={Linear:u(function(r,e){var t=r.length-1,n=t*e,i=Math.floor(n),a=$d.Utils.Linear;return e<0?a(r[0],r[1],n):e>1?a(r[t],r[t-1],t-n):a(r[i],r[i+1>t?t:i+1],n-i)},"Linear"),Bezier:u(function(r,e){for(var t=0,n=r.length-1,i=Math.pow,a=$d.Utils.Bernstein,l=0;l<=n;l++)t+=i(1-e,n-l)*i(e,l)*r[l]*a(n,l);return t},"Bezier"),CatmullRom:u(function(r,e){var t=r.length-1,n=t*e,i=Math.floor(n),a=$d.Utils.CatmullRom;return r[0]===r[t]?(e<0&&(i=Math.floor(n=t*(1+e))),a(r[(i-1+t)%t],r[i],r[(i+1)%t],r[(i+2)%t],n-i)):e<0?r[0]-(a(r[0],r[0],r[1],r[1],-n)-r[0]):e>1?r[t]-(a(r[t],r[t],r[t-1],r[t-1],n-t)-r[t]):a(r[i?i-1:0],r[i],r[t<i+1?t:i+1],r[t<i+2?t:i+2],n-i)},"CatmullRom"),Utils:{Linear:u(function(r,e,t){return(e-r)*t+r},"Linear"),Bernstein:u(function(r,e){var t=$d.Utils.Factorial;return t(r)/t(e)/t(r-e)},"Bernstein"),Factorial:function(){var r=[1];return function(e){var t=1;if(r[e])return r[e];for(var n=e;n>1;n--)t*=n;return r[e]=t,t}}(),CatmullRom:u(function(r,e,t,n,i){var a=(t-r)*.5,l=(n-e)*.5,h=i*i,d=i*h;return(2*e-2*t+a+l)*d+(-3*e+3*t-2*a-l)*h+a*i+e},"CatmullRom")}},yO=function(){function r(){}return u(r,"Sequence"),r.nextId=function(){return r._nextId++},r._nextId=0,r}(),cI=new ax,jo=function(){function r(e,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Fn.Linear.None,this._interpolationFunction=$d.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=yO.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof t=="object"?(this._group=t,t.add(this)):t===!0&&(this._group=cI,cI.add(this))}return u(r,"Tween"),r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(e,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},r.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},r.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},r.prototype.start=function(e,t){if(e===void 0&&(e=By()),t===void 0&&(t=!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=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){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,t)}return this},r.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},r.prototype._setupProperties=function(e,t,n,i,a){for(var l in n){var h=e[l],d=Array.isArray(h),m=d?"array":typeof h,v=!d&&Array.isArray(n[l]);if(!(m==="undefined"||m==="function")){if(v){var x=n[l];if(x.length===0)continue;for(var S=[h],I=0,w=x.length;I<w;I+=1){var P=this._handleRelativeValue(h,x[I]);if(isNaN(P)){v=!1,console.warn("Found invalid interpolation list. Skipping.");break}S.push(P)}v&&(n[l]=S)}if((m==="object"||d)&&h&&!v){t[l]=d?[]:{};var E=h;for(var O in E)t[l][O]=E[O];i[l]=d?[]:{};var x=n[l];if(!this._isDynamic){var N={};for(var O in x)N[O]=x[O];n[l]=x=N}this._setupProperties(E,t[l],x,i[l],a)}else(typeof t[l]>"u"||a)&&(t[l]=h),d||(t[l]*=1),v?i[l]=n[l].slice().reverse():i[l]=t[l]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(e){return e===void 0&&(e=By()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},r.prototype.resume=function(e){return e===void 0&&(e=By()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},r.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var e;return(e=this._group)===null||e===void 0||e.remove(this),this},r.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},r.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},r.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},r.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},r.prototype.easing=function(e){return e===void 0&&(e=Fn.Linear.None),this._easingFunction=e,this},r.prototype.interpolation=function(e){return e===void 0&&(e=$d.Linear),this._interpolationFunction=e,this},r.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},r.prototype.onStart=function(e){return this._onStartCallback=e,this},r.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},r.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},r.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},r.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},r.prototype.onStop=function(e){return this._onStopCallback=e,this},r.prototype.update=function(e,t){var n=this,i;if(e===void 0&&(e=By()),t===void 0&&(t=r.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(t)this.start(e,!0);else return!1;if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var l=e-this._startTime,h=this._duration+((i=this._repeatDelayTime)!==null&&i!==void 0?i:this._delayTime),d=this._duration+this._repeat*h,m=u(function(){if(n._duration===0||l>d)return 1;var P=Math.trunc(l/h),E=l-P*h,O=Math.min(E/n._duration,1);return O===0&&l===n._duration?1:O},"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||l>=this._duration)if(this._repeat>0){var S=Math.min(Math.trunc((l-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(e,t,n,i){for(var a in n)if(t[a]!==void 0){var l=t[a]||0,h=n[a],d=Array.isArray(e[a]),m=Array.isArray(h),v=!d&&m;v?e[a]=this._interpolationFunction(h,i):typeof h=="object"&&h?this._updateProperties(e[a],l,h,i):(h=this._handleRelativeValue(l,h),typeof h=="number"&&(e[a]=l+(h-l)*i))}},r.prototype._handleRelativeValue=function(e,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?e+parseFloat(t):parseFloat(t)},r.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],n=this._valuesEnd[e];typeof n=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(n):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},r.autoStartOnUpdate=!1,r}();var rOt=yO.nextId,hl=cI,nOt=hl.getAll.bind(hl),iOt=hl.removeAll.bind(hl),oOt=hl.add.bind(hl),sOt=hl.remove.bind(hl),aOt=hl.update.bind(hl);y();y();y();var vO=u((r,e)=>(e-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),bO=u((r,e)=>new ne(r.clientX-e.offsetLeft,r.clientY-e.offsetTop),"getTouchPos"),pI=u((r,e)=>Math.atan2(e.y-r.y,e.x-r.x),"angle"),Gy=u((r,e)=>Math.sqrt((e.y-r.y)**2+(e.x-r.x)**2),"distance"),hI=u((r,e)=>new ne((r.x+e.x)/2,(r.y+e.y)/2),"average"),fI=u(r=>{let e=0,{wheelDelta:t,detail:n}=r;return t!==void 0?e=t:n!==void 0&&(e=-n),e},"getScrollDelta");var dI=class dI{constructor(e,t){b(this,"input1");b(this,"input2");b(this,"lastAngle");b(this,"lastDistance");b(this,"totalDistance");b(this,"first");b(this,"second");this.input1=e,this.input2=t,this.lastAngle=pI(e,t),this.lastDistance=Gy(e,t),this.totalDistance=0,this.first=e,this.second=t}update(e,t){let n=Gy(e,t);this.input1=e,this.input2=t;let i=pI(e,t);this.lastAngle=i,this.lastDistance=n,this.totalDistance+=(Gy(this.first,e)+Gy(this.second,t))/2,this.first=hI(this.first,e),this.second=hI(this.second,t)}};u(dI,"InputSet");var lx=dI;y();var mI=class mI{constructor(e,t,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=e,this.camera=t,this.cameraPlane=n,this.viewCoordinate={x:e.x,y:e.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let e=new ne(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Fa,this.raycaster.setFromCamera(e,this.snapCamera);let t=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=t&&t.length>0?t[0].point:null,this.snapshotted=!0}updateAnchorState(e,t){this.camera=e,this.snapCamera=e.clone(),this.snapHolderMatrix=e.matrixWorld.clone(),this.updateViewCoordinate(t),this.snapshotCameraState()}updateViewCoordinate(e){this.viewCoordinate={x:e.x,y:e.y}}reUnproject(){var n,i;let e=new ne(this.viewCoordinate.x,this.viewCoordinate.y);(n=this.raycaster)==null||n.setFromCamera(e,this.snapCamera);let t=(i=this.raycaster)==null?void 0:i.intersectObject(this.cameraPlane,!0)[0];return t?t.point:void 0}};u(mI,"TouchAnchor");var Vy=mI;var Ls={};N2(Ls,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>Iq,CLIPPING_RADIUS:()=>jy,CONTROL_OPTIONS:()=>Sq,DEFAULT_ANIMATION_DURATION:()=>xI,DEFAULT_BEARING:()=>Eq,DEFAULT_MAX_ZOOM_LEVEL:()=>Tq,DEFAULT_MIN_ZOOM_LEVEL:()=>_I,DEFAULT_PITCH:()=>Pq,DEFAULT_ZOOM_LEVEL:()=>wq,EVENTS:()=>hx,MAPLIBRE_TILE_SIZE:()=>ux,MAX_LAT:()=>yI,MAX_MERCATOR_ZOOM_LEVEL:()=>px,MIN_LAT:()=>gI,MIN_MERCATOR_ZOOM_LEVEL:()=>cx,ROOM_MERCATOR_ZOOM_LEVEL:()=>Mq,TWO_PI:()=>vI,WHEEL_ZOOM_MULTIPLIER:()=>bI,ZRANGE:()=>Jd});y();var ux=512,gI=-85.051129,yI=85.051129,jy=1e4,Sq={chain:"chain",cancel:"cancel"},vI=Math.PI*2,Jd=100,bI=1e4,cx=0,px=24,Iq=17,Mq=20,xI=200,hx=["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"],wq=18,_I=12,Tq=22,Pq=0,Eq=0;y();function xO(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}u(xO,"scrubMaterial");function Zr(r){for(let e=r.children.length-1;e>=0;e--)Zr(r.children[e]);"geometry"in r&&r.geometry&&r.geometry.dispose(),r.parent&&r.parent.remove(r),"material"in r&&Array.isArray(r.material)?r.material.forEach(function(e){xO(e)}):"material"in r&&typeof r.material<"u"&&xO(r.material)}u(Zr,"destroyObject3D");var fx=!1,Oq=!1;var dx,mx=class mx extends ie{constructor(t,n,i,a,l){super();b(this,"dirty",!1);b(this,"zoomDirty",!1);b(this,"rotationDirty",!1);b(this,"panDirty",!1);b(this,"stateDirty",!1);F(this,dx,_I);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:x0.RIGHT,ZOOM:x0.MIDDLE,PAN:x0.LEFT});b(this,"camera");b(this,"scene");b(this,"renderer");b(this,"elevation");b(this,"orbit");b(this,"cameraPlane");b(this,"raycaster",new Fa);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 ST(!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",u(t=>{this.raycaster.setFromCamera(t,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new zt},"raycastToFloor"));b(this,"isUserInteracting",u(()=>this.userInteracting,"isUserInteracting"));b(this,"getPosition",u(()=>new zt(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));b(this,"getPedestal",u(()=>this.orbit.position.z,"getPedestal"));b(this,"pan",u((t,n)=>{isNaN(t)||isNaN(n)||(this.setPosition(this.orbit.position.x+t,this.orbit.position.y+n),this.publish("position-updated"))},"pan"));b(this,"postRender",u(()=>{(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",u(()=>this.cameraMoving,"isCameraMoving"));b(this,"lastCameraStoppedMovingTime",u(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));b(this,"setPosition",u((t,n)=>{t===void 0||n===void 0||isNaN(t)||isNaN(n)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(t,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",u((t,n)=>{let i=t-this.panBounds.center.x,a=n-this.panBounds.center.y,l=Math.sqrt(i*i+a*a);if(this.stayInsideBounds&&l>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=t,this.orbit.position.y=n},"updateCameraPosition"));b(this,"tilt",u(t=>{if(isNaN(t))return;this.state===-1&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(t+this.getTilt(),this.maxTilt),this.minTilt):t+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",u((t,n,i)=>{let a=this.getZoomAltitude();this.animateCamera({zoom:a/1.5},t,n,i)},"zoomIn"));b(this,"zoomOut",u((t,n,i)=>{let a=this.getZoomAltitude();this.animateCamera({zoom:a*1.5},t,n,i)},"zoomOut"));b(this,"getRotation",u(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));b(this,"cancelAnimation",u(()=>{let t=Array.from(this.tweens.keys()),n=t[t.length-1];n.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(n)},"cancelAnimation"));b(this,"animateCamera",u((t,n,i,a,l,h)=>{let d=z({interruptible:!0},h),m={},v={},x=this.getPosition();if(t.position!=null&&(t.position.x!==void 0&&(m.x=x.x,v.x=t.position.x),t.position.y!==void 0&&(m.y=x.y,v.y=t.position.y),t.position.z!==void 0&&(m.z=x.z,v.z=t.position.z)),t.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=t.zoom:v.zoom=Math.min(Math.max(t.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),t.rotation!==void 0){let{start:L,end:G}=A0(this.getRotation(),t.rotation);m.rotation=L,v.rotation=G}t.tilt!==void 0&&(m.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?v.tilt=t.tilt:v.tilt=Math.max(Math.min(t.tilt,this.maxTilt),this.minTilt));let S=m.zoom!==v.zoom,I=m.rotation!==v.rotation,w=m.tilt!==v.tilt,P=new jo(m).to(v,T.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(P),this.publish("multi-end",{zooming:S,rotating:I,tilting:w}),a&&a()}).onStart(()=>{this.state!==7&&(this.state=7,P.state=7,this.publish("multi-start",{zooming:S,rotating:I,tilting:w})),this.publish("change")});this.rendererState.internalTweenGroup.add(P);let E=Array.from(this.tweens.entries()),O=E[E.length-1],N=!1;return O!=null&&(O[1].interruptible?(typeof O[1].cancelledCallback=="function"&&O[1].cancelledCallback(),this.completeTween(O[0])):(N=!0,O[0].chain(P))),this.tweens.set(P,{cancelledCallback:l,interruptible:d.interruptible}),i?P.easing(i):P.easing(Fn.Quadratic.In),!t.doNotAutoStart&&!N&&(P.start(),this.publish("change")),P.cameraAnimation=!0,P},"animateCamera"));b(this,"setMulti",u((t,n,i,a,l=!0)=>{this.state===-1&&this.publish("multi-start");let h=!1;t!=null&&(t.x!==void 0&&!isNaN(t.x)&&t.y!==void 0&&!isNaN(t.y)&&(this.updateCameraPosition(t.x,t.y),h=!0),t.z!==void 0&&!isNaN(t.z)&&(this.setPedestal(t.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>jy&&(this.camera.near=n-jy,this.camera.far=n+jy):(this.camera.near=n/Jd,this.camera.far=n*Jd),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"))}l&&this.publish("change"),this.state===-1&&this.publish("multi-end",d),this.stateDirty=!0},"setMulti"));b(this,"getZoomScaledMin",u(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));b(this,"getZoomScaledMax",u(()=>{let t=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,t)},"getZoomScaledMax"));b(this,"setRotation",u((t,n)=>{if(isNaN(t))return;this.state===-1&&!n&&this.publish("rotate-start");let i=-(t%vI);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",u(t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let n=this.stayInsideBounds?Math.min(Math.max(t,this.getZoomScaledMin()),this.getZoomScaledMax()):t;n!==this.camera.position.z&&(this.camera.position.z=n,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=n/Jd,this.camera.far=n*Jd,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0,this.stateDirty=!0},"setZoomAltitude"));b(this,"setZoomLevel",u(t=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(t))},"setZoomLevel"));b(this,"getZoomAltitude",u(()=>this.camera.position.z,"getZoomAltitude"));b(this,"getZoomLevel",u(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));b(this,"setTilt",u((t,n)=>{if(isNaN(t))return;this.state===-1&&!n&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(t,this.maxTilt),this.minTilt):t;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",u(()=>this.elevation.rotation.x,"getTilt"));b(this,"setCameraPlaneElevation",u(t=>{this.cameraPlane.position.z=t},"setCameraPlaneElevation"));b(this,"zoom",u(t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let n=this.getZoomAltitude()-t;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",u((t,n,i)=>X2(t,n,i),"getProjectionScaleFactor"));b(this,"update",u(()=>{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",u((t,n=!1,i=!0)=>{typeof t=="number"&&!isNaN(t)&&(this.orbit.position.z=t,n&&(this.publishPedestalChangeEvent(t),this.publish("pedestal-change",{pedestal:t})),this.publish("change"),this.dirty=!0,i&&(this.stateDirty=!0))},"setPedestal"));b(this,"dispose",u(()=>{for(let t of hx)t.endsWith("start")?(this.off(t,this.setCameraMoving),t.startsWith("user")&&this.off(t,this.setUserInteracting)):(t.endsWith("end")||t.endsWith("cancel"))&&(this.off(t,this.unsetCameraMoving),t.startsWith("user")&&this.off(t,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));b(this,"createCameraPlane",u(()=>{let t=fx?2e3:1e10,n=fx?100:1,i=new $s(t,t,n,n),a=new Tn({color:0,wireframe:fx,visible:fx}),l=new ue(i,a);return this.scene.add(l),l},"createCameraPlane"));b(this,"addEventListeners",u(()=>{let{domElement:t}=this.renderer;for(let n of hx)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));t.addEventListener("contextmenu",this.onContextMenu,!1),t.addEventListener("mousedown",this.onMouseDown,!1),t.addEventListener("wheel",this.onMouseWheel,{passive:!1}),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));b(this,"addMouseEventListeners",u(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));b(this,"addMouseMoveEventListeners",u(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));b(this,"removeMouseMoveEventListeners",u(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));b(this,"removeEventListeners",u(()=>{let{domElement:t}=this.renderer;t.removeEventListener("contextmenu",this.onContextMenu,!1),t.removeEventListener("mousedown",this.onMouseDown,!1),t.removeEventListener("wheel",this.onMouseWheel,!1),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));b(this,"removeMouseUpEventListeners",u(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));b(this,"onContextMenu",u(t=>{t.preventDefault()},"onContextMenu"));b(this,"onMouseUp",u(()=>{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",u(t=>{if(this.enabled!==!1)if(t.preventDefault(),this.mouseToScene(t),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(t)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(t)},"onMouseMove"));b(this,"onTouchStart",u(t=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(t),t.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(t),this.state=9):this.enablePan&&(this.handleTouchStartPan(t),this.state=6);break;case 2:this.touch.inputs=new lx(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));b(this,"onTouchMove",u(t=>{if(this.enabled!==!1)switch(this.touchToScene(t),t.touches.length){case 2:t.preventDefault(),t.stopPropagation();let n=z({},this.touch.inputs.first),i=z({},this.touch.inputs.second),a=new ne(this.touch.touches[0].x,this.touch.touches[0].y),l=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(t);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<l.y,d=n.y>a.y&&i.y>l.y;this.enableRotate&&this.state!==4&&(d||h)?(this.handleTouchStartTilt(t),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(t.preventDefault(),t.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(t):this.enablePan&&this.state===6&&this.handleTouchMovePan(t);break;default:this.state=-1}},"onTouchMove"));b(this,"onTouchEnd",u(t=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}t.touches.length?this.onTouchStart(t):this.state=-1}},"onTouchEnd"));b(this,"handleTouchMovePan",u(t=>{let n=Object.hasOwn(t,"x")?new ne(t.x,t.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",u(()=>{let t=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-t/2,this.touch.touches[0].y-n/2);this.coords.floorAnchor=this.raycastToFloor(i),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Vy(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Vy(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",u(()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(t.x,t.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleMouseMovePan"));b(this,"handleTouchStartTilt",u(t=>{this.coords.rotateStart.set(t.touches[1].clientX,t.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));b(this,"handleTouchMovePedestal",u(t=>{this.handleMouseMovePedestal(t.touches[0])},"handleTouchMovePedestal"));b(this,"handleTouchMoveTilt",u(t=>{this.coords.rotateEnd.set(t.touches[1].clientX,t.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));b(this,"handleTouchMoveDolly",u(()=>{let t=this.touch.inputs.first,n=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:t.x,y:t.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,t),this.touch.anchor2.updateAnchorState(this.camera,n)},"handleTouchMoveDolly"));b(this,"handleTouchEnd",u(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));b(this,"handleTouchStartPan",u(t=>{let n=Object.hasOwn(t,"x")?new ne(t.x,t.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",u(t=>{this.handleMouseDownPedestal(t.touches[0])},"handleTouchStartPedestal"));b(this,"onMouseDown",u(t=>{if(this.enabled!==!1){if(this.mouseToScene(t),t.preventDefault(),this.state===3&&this.publish("zoom-end"),t.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else t.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(t),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));b(this,"onMouseWheel",u(t=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(t.preventDefault(),t.stopPropagation(),this.mouseToScene(t),this.canScrollZoom(t)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(t)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(t))},"onMouseWheel"));b(this,"handleMouseWheel",u(t=>{if(this.publish("zoom-start"),!this.canScrollZoom(t)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let n=this.getZoomAltitude(),i=n-fI(t)*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",u(t=>{this.orbit.updateMatrixWorld();let n=new Bl;n.setFromRotationMatrix(t,"ZYX");let i=(t.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),a=n.z,l=new zt(0,0,1);l.applyEuler(n),l.setLength(i);let h=new zt;h.setFromMatrixPosition(t),h.sub(l),this.enablePan&&this.setPosition(h.x,h.y),this.enableZoom&&this.setZoomAltitude(i),this.enableRotate&&this.setRotation(-a)},"setCameraFromTransformMatrix"));b(this,"makeTransformFromTouchAnchors",u((t,n)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let i=this.camera.projectionMatrix.clone(),a=t.worldCoordinate,l=n.worldCoordinate,h=t.reUnproject(),d=n.reUnproject();if(!h||!d||!a||!l)return null;let m=t.viewCoordinate,v=n.viewCoordinate,x=l.x-a.x,S=l.y-a.y,I=Math.atan2(S,x),w=d.x-h.x,P=d.y-h.y,E=Math.atan2(P,w),O=vO(I,E),N=new ts;N.makeRotationZ(-O);let L=N.clone();L.multiply(t.snapHolderMatrix);let G=u((Oi,jn,Di)=>Oi.elements[(jn-1)*4+Di-1],"m"),j=G(i,1,1)*G(L,1,1)-m.x*G(i,3,4)*G(L,3,1),$=G(i,1,1)*G(L,1,2)-m.x*G(i,3,4)*G(L,3,2),q=G(i,1,1)*G(L,1,3)-m.x*G(i,3,4)*G(L,3,3),k=a.x*j+a.y*$+a.z*q,tt=G(i,2,2)*G(L,2,1)-m.y*G(i,3,4)*G(L,3,1),ut=G(i,2,2)*G(L,2,2)-m.y*G(i,3,4)*G(L,3,2),at=G(i,2,2)*G(L,2,3)-m.y*G(i,3,4)*G(L,3,3),H=a.x*tt+a.y*ut+a.z*at,St=G(i,1,1)*G(L,1,1)-v.x*G(i,3,4)*G(L,3,1),pt=G(i,1,1)*G(L,1,2)-v.x*G(i,3,4)*G(L,3,2),ct=G(i,1,1)*G(L,1,3)-v.x*G(i,3,4)*G(L,3,3),It=l.x*St+l.y*pt+l.z*ct,Et=G(i,2,2)*G(L,2,1)-v.y*G(i,3,4)*G(L,3,1),dt=G(i,2,2)*G(L,2,2)-v.y*G(i,3,4)*G(L,3,2),bt=G(i,2,2)*G(L,2,3)-v.y*G(i,3,4)*G(L,3,3),Z=l.x*Et+l.y*dt+l.z*bt,te=Math.abs(St-j),jt=Math.abs(pt-$),ee=Math.abs(ct-q),Tt=Math.abs(St-tt),le=Math.abs(pt-ut),vr=Math.abs(ct-at),Qe=Math.abs(Et-j),Nt=Math.abs(dt-$),At=Math.abs(bt-q),xt=Math.abs(Et-tt),_e=Math.abs(dt-ut),de=Math.abs(bt-at),Xr=Math.min(te+jt+ee,Tt+le+vr),me=Math.min(Qe+Nt+At,xt+_e+de);Xr<me&&(St=Et,pt=dt,ct=bt,It=Z);let Se=tt*q-j*at,br=ut*q-$*at,Yr=H*q-k*at,Wi=St*at-tt*ct,Yt=pt*at-ut*ct,mr=It*at-H*ct,lo=(mr*br-Yr*Yt)/(Wi*br-Se*Yt),Zi=(mr*Se-Yr*Wi)/(Yt*Se-br*Wi),uo=ut*j-$*tt,wn=at*j-q*tt,Mt=H*j-k*tt,Bs=pt*tt-ut*St,Yo=ct*tt-at*St,co=((It*tt-H*St)*uo-Mt*Bs)/(Yo*uo-wn*Bs),Sa=L.clone();return Sa.elements[12]=lo,Sa.elements[13]=Zi,Sa.elements[14]=co,co>0?Sa:null},"makeTransformFromTouchAnchors"));b(this,"updateTouchOrigin",u(()=>{let t=this.renderer.domElement;this.touch.origin.offsetLeft=t.getBoundingClientRect().left,this.touch.origin.offsetTop=t.getBoundingClientRect().top},"updateTouchOrigin"));b(this,"touchToScene",u(t=>{this.touch.touches=[];for(let n=0,i=t.touches.length;n<i;n++){let a=t.touches[n],l=bO(a,this.touch.origin);this.touch.touches.push(new ne(l.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(l.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));b(this,"canScrollZoom",u(t=>{let n=fI(t),i=this.getZoomAltitude();return!(n<0&&i===this.getZoomScaledMax()||n>0&&i===this.getZoomScaledMin())},"canScrollZoom"));b(this,"mouseToScene",u(t=>{let n=this.getMousePos(t);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",u(t=>({x:t.offsetX,y:t.offsetY}),"getMousePos"));b(this,"handleMouseDownRotate",u(t=>{this.coords.rotateStart.set(t.clientX,t.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));b(this,"handleMouseDownPan",u(()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(t.x,t.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));b(this,"handleMouseDownPedestal",u(t=>{let n=new ne(t.clientX,t.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=X2(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));b(this,"handleMouseMovePedestal",u(t=>{let n={x:t.clientX,y:t.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",u(t=>{this.coords.rotateEnd.set(t.clientX,t.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));b(this,"publishUserZoomDebounced",Ff(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));b(this,"publishUserZoomEvent",u(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));b(this,"setCameraMoving",u(()=>{this.cameraMoving=!0},"setCameraMoving"));b(this,"unsetCameraMoving",u(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));b(this,"setUserInteracting",u(()=>{this.userInteracting=!0},"setUserInteracting"));b(this,"unsetUserInteracting",u(()=>{this.userInteracting=!1},"unsetUserInteracting"));b(this,"publishPedestalChangeEvent",u(t=>{this.publish("pedestal-change",{pedestal:t,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));b(this,"convertAltitudeToZoomLevel",u(t=>{let[,n]=this.center,a=t*2*Math.tan(Ie.degToRad(this.camera.fov)/2)/this.options.canvasHeight,l=Math.cos(Ie.degToRad(n))*2*Math.PI*k2/a;return Ie.clamp(Math.log2(l/512),cx,px)},"convertAltitudeToZoomLevel"));b(this,"convertZoomLevelToAltitude",u(t=>{let[,n]=this.center,i=Ie.clamp(t,cx,px),a=Math.pow(2,i),l=Ie.clamp(n,gI,yI),h=a*512;return Math.cos(Ie.degToRad(l))*Math.PI*2*k2/h*this.options.canvasHeight/2/Math.tan(Ie.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));b(this,"completeTween",u(t=>{t.isPlaying()&&t.stop(),this.rendererState.internalTweenGroup.remove(t),this.tweens.delete(t)},"completeTween"));b(this,"debugContainer",new Gl);this.camera=t,this.renderer=i,this.rendererState=a,this.scene=n,this.options=l,this.elevation=t.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=t.position.z,l.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(t){this.minZoomAltitude=this.convertZoomLevelToAltitude(t),this.stateDirty=!0}get defaultMinZoomLevel(){return p(this,dx)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(t){this.maxZoomAltitude=this.convertZoomLevelToAltitude(t),this.stateDirty=!0}get scrollPercent(){let t=this.minPedestal,n=this.maxPedestal,i=this.getPedestal();return i=Math.min(i,n),i=Math.max(i,t),(i-t)/(n-t)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var a,l,h,d;let t=this.getPosition(),{lat:n,lon:i}=V0((l=(a=this.rendererState.center)==null?void 0:a[1])!=null?l:0,(d=(h=this.rendererState.center)==null?void 0:h[0])!=null?d:0,t.x,t.y);return[i,n]}setCenter(t,n){var l,h,d,m;let{x:i,y:a}=j0((h=(l=this.rendererState.center)==null?void 0:l[1])!=null?h:0,(m=(d=this.rendererState.center)==null?void 0:d[0])!=null?m:0,n,t);this.setPosition(i,a)}get isAnimating(){return this.rendererState.internalTweenGroup.getAll().some(t=>t.cameraAnimation)}getCameraFrameForCoordinates(t,n){let i=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,a=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,l=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=_O(t,{canvasWidth:l,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(t,n){if(Oq){this.debugContainer&&Zr(this.debugContainer);let E=new No(4,4,4),O=new Tn({color:65280,depthTest:!1}),N=new ic(E,O,t.length),L=new ts;t.forEach((G,j)=>{L.setPosition(G),N.setMatrixAt(j,L)}),N.instanceMatrix.needsUpdate=!0,this.debugContainer.add(N),this.scene.add(this.debugContainer)}let i=n.curve,a=n.callback,l=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:T.env.TESTING==="true"?x=0:x=xI;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 P=_O(t,{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:P.position,tilt:n.tilt,rotation:n.rotation,zoom:P.zoom},x,i,a,l,n)}resize(t,n){this.options.canvasWidth=t,this.options.canvasHeight=n}};dx=new WeakMap,u(mx,"CameraSystem"),b(mx,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var Kd=mx;function _O(r,{canvasWidth:e,orbit:t,paddingOption:n,verticalPadding:i=0,canvasHeight:a,minZoom:l,maxZoom:h,camera:d,position:m}){let v={zoom:l,position:m};if(r.length===0)return v;for(let Se of Kd.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*e,right:n.right*e,type:"pixel"}:n;if(x.left+x.right>=e||x.top+x.bottom>=a)return v;t.updateMatrixWorld();let S=d.matrixWorldInverse,I=d.fov*(Math.PI/180)/2,w=I,E=Math.atan(Math.tan(I)*(e/a)),O=new zt(1/0,1/0,1/0),N=new zt(-1/0,-1/0,-1/0),L=new _n,G=new zt;for(let Se=0,br=r.length;Se<br;Se++)G.copy(r[Se]),L.expandByPoint(G),G.applyMatrix4(S),O.min(G),N.max(G),G.copy(r[Se]),G.z-=i,G.applyMatrix4(S),O.min(G),N.max(G),G.copy(r[Se]),G.z+=i,G.applyMatrix4(S),O.min(G),N.max(G);let j=N.x-O.x,$=N.y-O.y,q=e-x.left-x.right,k=a-x.top-x.bottom,tt=(N.x+O.x)/2,ut=(N.y+O.y)/2,at=j/q,H=$/k,St=l,pt=h,ct=St*Math.tan(E)*2,It=pt*Math.tan(E)*2,Et=ct/e,dt=It/e,bt=Math.max(at,H);bt=Ie.clamp(bt,Et,dt);let Z=q*bt,te=k*bt,jt={min:{x:tt-Z/2-x.left*bt,y:ut-te/2-x.bottom*bt},max:{x:tt+Z/2+x.right*bt,y:ut+te/2+x.top*bt}},ee=(jt.min.x+jt.max.x)/2,Tt=(jt.min.y+jt.max.y)/2,le=L.getCenter(new zt),vr=Math.abs(ee-jt.min.x),Qe=Math.abs(Tt-jt.min.y),Nt=vr/Math.tan(E),At=Qe/Math.tan(w),xt=new zt;xt.set(ee,Tt,N.z+Math.max(Nt,At)),xt.applyMatrix4(d.matrixWorld);let _e=new zt;_e.set(ee,Tt,N.z),_e.applyMatrix4(d.matrixWorld);let de=new zt().subVectors(_e,xt),Xr=(le.z-xt.z)/de.z,me=new zt().copy(xt).add(de.clone().multiplyScalar(Xr));return _e.set(me.x,me.y,me.z),xt.sub(_e),{position:me,zoom:xt.length()}}u(_O,"getCameraFrameForPoints");y();var Dq=300,Uy,zy,CI=class CI{constructor(e){b(this,"state");F(this,Uy,new zt);F(this,zy,new zt);this.state=e}update(e){var i;let t,n;this.state.cameraObject.getWorldPosition(p(this,zy));for(let a of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(a),t&&(n=t.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{t.object3d.getWorldPosition(p(this,Uy));let l=p(this,zy).distanceTo(p(this,Uy));n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(-l,"px)")}if(n.canShow===!0&&n.visible===!0?n.markerContainer.style.pointerEvents=e?"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:Dq,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};Uy=new WeakMap,zy=new WeakMap,u(CI,"DOMDrawSystem");var gx=CI;y();var SI=class SI{constructor(){b(this,"percentExpanded",0);b(this,"activeId","");b(this,"gap",20);b(this,"dirty",!0)}};u(SI,"StackComponent");var yx=SI;y();var II=class II extends ie{constructor(t,n){super();b(this,"state");b(this,"dirty",!0);b(this,"domTree");b(this,"observers",new Map);b(this,"updateDimensions",u(t=>{t.forEach(n=>{var l;let a=(l=n.target.parentElement)==null?void 0:l.getAttribute("data-marker-id");if(a){let h=this.state.geometry2DMap.get(a),d=h==null?void 0:h.components[0];h&&d instanceof ll&&(d.updateDimensions(n.contentRect.width,n.contentRect.height),d.collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=t,this.domTree=n}setupObserver(){var i;if(this.observers){for(let a of this.observers.values())a.disconnect();this.observers.clear()}let t,n;for(let a of this.domTree.children){let l=a.getAttribute("data-marker-id");if(l!=null&&(t=this.state.geometry2DMap.get(l),n=t.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 t of this.observers.values())t.disconnect();this.observers.clear()}};u(II,"DOMResizeSystem");var vx=II;y();var Lq=0,Aq=90,Nq=(T.env.NODE_ENV==="test",!1),yu={linear:Fn.Linear.None,"ease-in":Fn.Quadratic.In,"ease-out":Fn.Quadratic.Out,"ease-in-out":Fn.Quadratic.InOut},kq=-50,$t,pe,gu,Hy,Xy,wI,TI=class TI{constructor(e,t,n){F(this,Xy);F(this,$t);F(this,pe);F(this,gu);F(this,Hy);V(this,$t,e),V(this,pe,t),V(this,gu,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=kq,p(this,$t).map.triggerRepaint()),p(this,pe).cameraSystem.setCameraPlaneElevation(i)})}get center(){var e,t;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(t=(e=p(this,$t).map).getCenter)==null?void 0:t.call(e).toArray():p(this,pe).cameraSystem.center}setCenter(e){var t;if(p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map){(t=p(this,$t).map)==null||t.setCenter(e),p(this,pe).interactionSystem.handleHover();return}p(this,pe).cameraSystem.setCenter(e[0],e[1]),p(this,pe).interactionSystem.handleHover()}get zoomLevel(){var e;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(e=p(this,$t).map)==null?void 0:e.getZoom():p(this,pe).cameraSystem.getZoomLevel()}setZoomLevel(e){var t;p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map&&((t=p(this,$t).map)==null||t.setZoom(e)),p(this,pe).cameraSystem.setZoomLevel(Ba(e,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(e){p(this,pe).panBoundsSystem.autoMinZoomLevel=e,e&&(p(this,pe).panBoundsSystem.dirty=!0,p(this,pe).panBoundsSystem.update())}get autoMinZoomLevel(){return p(this,pe).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(e,t=!1){var i;t&&this.setAutoMinZoomLevel(!1);let n=Ba(e,Ls.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Ls.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(e){var n;let t=Ba(e,this.minZoomLevel,Ls.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Ls.MAX_MERCATOR_ZOOM_LEVEL,"."));p(this,pe).cameraSystem.setMaxZoomLevel(t),this.zoomLevel>t&&this.setZoomLevel(t),(n=p(this,$t).map)==null||n.setMaxZoom(t)}get maxPitch(){var e,t;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(t=(e=p(this,$t).map)==null?void 0:e.getMaxPitch)==null?void 0:t.call(e):Ie.radToDeg(p(this,pe).cameraSystem.maxTilt)}get minPitch(){var e,t;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(t=(e=p(this,$t).map)==null?void 0:e.getMinPitch)==null?void 0:t.call(e):Ie.radToDeg(p(this,pe).cameraSystem.minTilt)}setMinPitch(e){var n;let t=Math.max(Lq,e);(n=p(this,$t).map)==null||n.setMinPitch(t),p(this,pe).cameraSystem.minTilt=Ie.degToRad(t)}setMaxPitch(e){var n;let t=Math.min(Aq,e);(n=p(this,$t).map)==null||n.setMaxPitch(t),p(this,pe).cameraSystem.maxTilt=Ie.degToRad(t)}get bearing(){var e;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(e=p(this,$t).map)==null?void 0:e.getBearing():Ie.radToDeg(p(this,pe).cameraSystem.getRotation())}setBearing(e){var t;if(p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map){(t=p(this,$t).map)==null||t.setBearing(e);return}p(this,pe).cameraSystem.setRotation(Ie.degToRad(e))}get pitch(){var e;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(e=p(this,$t).map)==null?void 0:e.getPitch():Ie.radToDeg(p(this,pe).cameraSystem.getTilt())}setPitch(e){var t;if(p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map){(t=p(this,$t).map)==null||t.setPitch(e);return}p(this,pe).cameraSystem.setTilt(Ie.degToRad(Ba(e,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return p(this,pe).cameraSystem.getPedestal()}setElevation(e){p(this,pe).cameraSystem.setPedestal(e,!0)}animateElevation(e,t){return p(this,Hy)&&p(this,Hy).stop(),new Promise(n=>{var i;p(this,pe).cameraSystem.animateCamera({position:{z:e}},(t==null?void 0:t.duration)||300,yu[(t==null?void 0:t.easing)||"ease-in-out"],n,n,{interruptible:(i=t==null?void 0:t.interruptible)!=null?i:!0})})}get insetsPadding(){return p(this,gu).insetsPadding}get panMode(){return p(this,pe).cameraSystem.enablePan===!1&&p(this,pe).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(e){if(e!=="default"&&e!=="elevation")throw new Error("Invalid pan mode");e!==this.panMode&&(e==="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(e){p(this,gu).insetsPadding=Object.assign({},p(this,gu).insetsPadding,e)}animateTo(e){var l,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:(l=e.center)!=null?l:this.center,zoom:(h=e.zoomLevel)!=null?h:this.zoomLevel,bearing:(d=e.bearing)!=null?d:this.bearing,pitch:(m=e.pitch)!=null?m:this.pitch,duration:(v=e.duration)!=null?v:600}),Promise.resolve();let t=e.center?p(this,$t).convertTo3DMapPosition(e.center[1],e.center[0],e.center[2]||this.elevation):void 0,n=e.zoomLevel!==void 0?p(this,pe).cameraSystem.convertZoomLevelToAltitude(Ba(e.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,i=e.bearing!==void 0?Ie.degToRad(e.bearing):void 0,a=e.pitch!==void 0?Ie.degToRad(Ba(e.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(S=>{var I;p(this,pe).cameraSystem.animateCamera({position:t,zoom:n,rotation:i,tilt:a},e.duration||0,yu[e.easing||"ease-in-out"],()=>{p(this,pe).interactionSystem.handleHover(),S()},S,{interruptible:(I=e==null?void 0:e.interruptible)!=null?I:!0})})}getCameraFrameForCoordinates(e,t){let n=gt(this,Xy,wI).call(this,t||{},()=>Promise.resolve()),{pointCloud:i}=CO(e,p(this,$t),p(this,gu).geometry3DMap);if(i.length===0)return K.error("No valid coordinates found in targets:",e),{center:this.center,zoomLevel:this.zoomLevel};let{center:a,zoomLevel:l}=p(this,pe).cameraSystem.getCameraFrameForCoordinates(i,n);return{center:p(this,$t).convert3DMapPositionToCoordinate(a),zoomLevel:l}}focusOn(e,t){var l,h,d,m;let{pointCloud:n,geoBounds:i,firstPosition:a}=CO(e,p(this,$t),p(this,gu).geometry3DMap);return n.length===0?(K.error("No valid coordinates found in targets:",e),Promise.resolve()):p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(n.length===1&&a?(l=p(this,$t).map)==null||l.flyTo({center:[a[0],a[1]],duration:(t==null?void 0:t.duration)||p(this,$t).map.getBearing(),animate:!0,bearing:(t==null?void 0:t.bearing)===void 0?p(this,$t).map.getBearing():t==null?void 0:t.bearing,pitch:(t==null?void 0:t.pitch)===void 0?p(this,$t).map.getPitch():t==null?void 0:t.pitch,zoom:(t==null?void 0:t.maxZoomLevel)||p(this,$t).map.getMaxZoom()}):(Nq&&Rq(p(this,$t),i),(m=p(this,$t).map)==null||m.fitBounds(i,{duration:(h=t==null?void 0:t.duration)!=null?h:Ls.DEFAULT_ANIMATION_DURATION,bearing:(t==null?void 0:t.bearing)===void 0?p(this,$t).map.getBearing():t==null?void 0:t.bearing,pitch:(t==null?void 0:t.pitch)===void 0?p(this,$t).map.getPitch():t==null?void 0:t.pitch,maxZoom:(d=t==null?void 0:t.maxZoomLevel)!=null?d:p(this,$t).map.getMaxZoom()})),p(this,pe).interactionSystem.handleHover(),Promise.resolve()):new Promise(v=>{p(this,pe).cameraSystem.focusOn(n,gt(this,Xy,wI).call(this,t||{},v))})}};$t=new WeakMap,pe=new WeakMap,gu=new WeakMap,Hy=new WeakMap,Xy=new WeakSet,wI=u(function(e,t){var n;return{minZoom:(e==null?void 0:e.maxZoomLevel)===void 0?void 0:p(this,pe).cameraSystem.convertZoomLevelToAltitude(Ba(e.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(e==null?void 0:e.minZoomLevel)===void 0?void 0:p(this,pe).cameraSystem.convertZoomLevelToAltitude(Ba(e.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:e!=null&&e.padding?Object.assign({},B0,e==null?void 0:e.padding):this.insetsPadding,curve:yu[(e==null?void 0:e.easing)||"ease-in-out"],rotation:(e==null?void 0:e.bearing)===void 0?void 0:Ie.degToRad(e.bearing),tilt:(e==null?void 0:e.pitch)!==void 0?Ie.degToRad(Ba(e.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:e==null?void 0:e.duration,callback:u(()=>{p(this,pe).interactionSystem.handleHover(),t()},"callback"),cancelledCallback:t,interruptible:(n=e==null?void 0:e.interruptible)!=null?n:!0,verticalPadding:e==null?void 0:e.verticalPadding}},"#convertToLegacy"),u(TI,"Camera");var bx=TI;function MI(r,e){r[0]=Math.min(r[0],e[0]),r[1]=Math.min(r[1],e[1]),r[2]=Math.max(r[2],e[0]),r[3]=Math.max(r[3],e[1])}u(MI,"updateBounds");function CO(r,e,t){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 l=e.getSystems().renderSystem;(l.threeDdirty||l.twoDdirty)&&e.renderSync();for(let d of r)if(typeof d=="string"){let m=t.get(d);if(!m){K.error("Entity not found with id:",d);continue}let v=new _n;UT(e,"userData"in m&&(h=m.userData.entityId)!=null?h:m.id,n,v,m instanceof Er?m.position.z:void 0);let x=e.convert3DMapPositionToCoordinate(v.min),S=e.convert3DMapPositionToCoordinate(v.max);MI(i,x),MI(i,S),a||(a=e.convert3DMapPositionToCoordinate(v.getCenter(new zt)))}else n.push(e.convertTo3DMapPosition(d[1],d[0],d[2]||0)),MI(i,d),a||(a=d);return{pointCloud:n,geoBounds:i,firstPosition:a}}u(CO,"processTargets");function Rq(r,e){var n,i,a,l;let t=[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[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:t}}}),(l=r.map)==null||l.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}u(Rq,"drawBounds");y();y();var SO="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 IO="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 MO=4.291666666666667,wO=15,TO=25,PO=43/60;y();var EO=["horizontal","icon"],Fq=new Map([[EO[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>'],[EO[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>']]),Bq=/<svg([^>]*)>/g;function OO(r,e,t,n){let i=Fq.get(r);return i?i.replace(Bq,'<svg$1 width="'.concat(t,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(e,';">')):""}u(OO,"getLogoIcon");var DO=!1,Hr,vu,Qd,ci,To,Bh,ca,fl,PI=class PI extends ie{constructor(t,n,i){super();F(this,Hr,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:u(()=>{window!=null&&window.open("https://www.mappedin.com")},"onClick"),interactive:!0,visible:!0});F(this,vu);F(this,Qd);F(this,ci);F(this,To);F(this,Bh);F(this,ca,0);F(this,fl,0);b(this,"dirty",!0);b(this,"getPositionAlignedCanvasCoordinates",u((t,n)=>({"top-left":{x:0,y:0},"top-right":{x:t,y:0},"bottom-left":{x:0,y:n},"bottom-right":{x:t,y:n},center:{x:t/2,y:n/2},top:{x:t/2,y:0},bottom:{x:t/2,y:n},left:{x:0,y:n/2},right:{x:t,y:n/2}})[p(this,Hr).position],"getPositionAlignedCanvasCoordinates"));b(this,"getPositionAlignedPadding",u(()=>{var i,a,l,h;let t=p(this,Hr).padding;if(typeof t=="number")return{"top-left":{x:t,y:t},"top-right":{x:-t,y:t},"bottom-left":{x:t,y:-t},"bottom-right":{x:-t,y:-t},center:{x:0,y:0},top:{x:0,y:t},bottom:{x:0,y:-t},left:{x:t,y:0},right:{x:-t,y:0}}[p(this,Hr).position];let n={top:(i=t.top)!=null?i:0,right:(a=t.right)!=null?a:0,bottom:(l=t.bottom)!=null?l:0,left:(h=t.left)!=null?h:0};return{x:n.left-n.right,y:n.top-n.bottom}},"getPositionAlignedPadding"));i&&Object.entries(i).forEach(([a,l])=>{l!==void 0&&(p(this,Hr)[a]=l)}),V(this,Qd,t),V(this,vu,n)}get color(){return p(this,Hr).color==="light"?"white":"#293136"}get iconName(){return p(this,Hr).iconOnly?"icon":"horizontal"}get minWidth(){return p(this,Hr).iconOnly?wO:75}get defaultWidth(){return p(this,Hr).iconOnly?TO:150}get aspectRatio(){return p(this,Hr).iconOnly?PO:MO}get options(){return z({},p(this,Hr))}set options(t){var n,i;V(this,Hr,{padding:t.padding||p(this,Hr).padding,position:t.position||p(this,Hr).position,iconOnly:t.iconOnly||p(this,Hr).iconOnly,color:t.color||p(this,Hr).color,scale:t.scale||p(this,Hr).scale,onClick:p(this,Hr).onClick,interactive:(n=t.interactive)!=null?n:p(this,Hr).interactive,visible:(i=t.visible)!=null?i:p(this,Hr).visible})}get icon(){return OO(this.iconName,this.color,p(this,ca)*p(this,vu).pixelRatio,p(this,fl)*p(this,vu).pixelRatio)}setSize(t,n){p(this,To)&&(p(this,To).uniforms.uSize.value.x=t,p(this,To).uniforms.uSize.value.y=n)}setXY(t,n){p(this,To)&&(p(this,To).uniforms.uSize.value.w=t,p(this,To).uniforms.uSize.value.z=n)}get width(){return p(this,ca)}get height(){return p(this,fl)}getPositionAlignedOffset(t,n){return{"top-left":{x:0,y:0},"top-right":{x:-t,y:0},"bottom-left":{x:0,y:-n},"bottom-right":{x:-t,y:-n},center:{x:-(t/2),y:-(n/2)},top:{x:-(t/2),y:0},bottom:{x:-(t/2),y:-n},left:{x:0,y:-(n/2)},right:{x:-t,y:-(n/2)}}[p(this,Hr).position]}insertIntoQuadTree(t){p(this,Bh)!=null&&typeof p(this,Hr).onClick=="function"&&p(this,Hr).interactive&&t.insert(p(this,Bh))}resize(t,n){if(p(this,Hr).visible!==!0)return;let i=this.getPositionAlignedCanvasCoordinates(t,n),a=this.getPositionAlignedPadding(),l=this.getPositionAlignedOffset(p(this,ca),p(this,fl)),h=Math.min(t-p(this,ca),Math.max(0,i.x+a.x+l.x)),d=Math.min(n-p(this,fl),Math.max(0,i.y+a.y+l.y));this.setSize(p(this,ca)/t,p(this,fl)/n),this.setXY(h/t,d/n),V(this,Bh,new ai(h,d,p(this,ca),p(this,fl),{entityId:"watermark"}))}update(){this.dirty&&(p(this,Hr).visible===!0?(V(this,ca,Math.min(p(this,vu).canvasWidth,Math.max(this.minWidth,this.defaultWidth*p(this,Hr).scale))),V(this,fl,p(this,ca)/this.aspectRatio),Ac.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),t=>{if(V(this,To,new rc({uniforms:{uTexture:{value:t},uSize:{value:new fT(0,0,0,0)},uOpacity:{value:.7}},vertexShader:SO,fragmentShader:IO,depthWrite:!1,depthTest:!1,defines:{debug:DO},wireframe:DO,transparent:!0,visible:!0})),p(this,ci))p(this,ci).visible=!0,p(this,ci).material=p(this,To),p(this,ci).material.needsUpdate=!0;else{let n=new $s(2,2,1,1);V(this,ci,new ue(n,p(this,To))),p(this,ci).position.set(0,0,-1),p(this,ci).frustumCulled=!1,p(this,ci).renderOrder=999;let i=new No(1,1,1),a=new ue(i,new Tn({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));a.frustumCulled=!1,a.layers.set(1),p(this,ci).add(a),p(this,Qd).add(p(this,ci))}this.resize(p(this,vu).canvasWidth,p(this,vu).canvasHeight),this.publish("texture-loaded")})):p(this,ci)&&(p(this,ci).visible=!1),this.dirty=!1)}destroy(){p(this,ci)&&(p(this,Qd).remove(p(this,ci)),Zr(p(this,ci))),V(this,ci,void 0),p(this,To)&&p(this,To).dispose(),V(this,To,void 0),V(this,Bh,void 0)}};Hr=new WeakMap,vu=new WeakMap,Qd=new WeakMap,ci=new WeakMap,To=new WeakMap,Bh=new WeakMap,ca=new WeakMap,fl=new WeakMap,u(PI,"WatermarkSystem");var xx=PI;y();var _x=100,jq=!1,EI=class EI extends ie{constructor(t,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=t,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new _n,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new zt(0,0,0),new zt(_x*2,_x*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(_x)));let t=new _n().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(t);let n=t.getSize(new zt),i=Math.max(n.x,n.y,n.z);for(let l of this.state.geometry2DMap.values())l.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(l.position),l.positionDirty=!1);let a=Cx.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(i,_x)).getBoundingSphere(Uq).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new zt),min:Cx.min,max:Cx.max,radius:a},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,jq&&this.state.entityScene.parent instanceof nc){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Gl,this.debugMesh.add(new ue(new E0(this.cameraSystem.panBounds.radius),new Tn({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let l=new zt;Cx.getSize(l);let h=new No(l.x,l.y,l.z),d=new Tn({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)}}}};u(EI,"PanBoundsSystem");var Sx=EI,Cx=new _n,Uq=new mT;y();var LO="\xA9 Mappedin",zq="https://info.mappedin.com/feedback",DI=["top-left","top-right","bottom-left","bottom-right"],Hq=640,Xq=u(()=>"<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"),OI={custom:[],position:"bottom-right",feedback:!0},LI=class LI{constructor(e){b(this,"controlContainerEl");b(this,"controlPositions");b(this,"compact");b(this,"attribContainerEl");b(this,"attribInnerEl");b(this,"attribButtonEl");b(this,"feedbackLinkEl");b(this,"attribHTML",LO);b(this,"customAttributions",[]);b(this,"toggleAttribution",u(e=>{this.attribContainerEl!=null&&(e.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),e.appendChild(this.controlContainerEl),this.controlPositions=DI.reduce((t,n)=>{let i=document.createElement("div");return i.classList.add("mappedin-ctrl-".concat(n)),this.controlContainerEl.appendChild(i),t[n]=i,t},{})}addAttributionControl(e=OI){var i;let t=e.position&&DI.includes(e.position)?e.position:OI.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(t)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[t].appendChild(this.attribContainerEl),this.attribButtonEl=document.createElement("summary"),this.attribButtonEl.addEventListener("click",this.toggleAttribution),this.attribButtonEl.classList.add("mappedin-ctrl-attrib-button"),this.attribButtonEl.title="Toggle attribution",this.attribButtonEl.ariaLabel="Toggle attribution",this.attribButtonEl.tabIndex=0,this.attribButtonEl.innerHTML=Xq(),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=e.feedback)!=null?i:OI.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=zq,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)),e.custom&&(this.customAttributions=e.custom),this.updateAttributionDisplay()}updateAttribution(e){if(!e.style||!this.attribInnerEl||!this.attribContainerEl)return;let t=[LO],n=e.style.sourceCaches;for(let i in n){let a=n[i];if(a.used||a.usedForTerrain){let l=a.getSource();l.attribution&&t.indexOf(l.attribution)<0&&t.push(l.attribution)}}t=t.filter(i=>String(i).trim()),t=t.filter((i,a)=>{for(let l=a+1;l<t.length;l++)if(t[l].indexOf(i)>=0)return!1;return!0}),this.attribHTML=t.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let e=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=e)}resizeAttribution(e){this.attribContainerEl&&(e<=Hq||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(e){this.resizeAttribution(e)}updateData(e){this.updateAttribution(e)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};u(LI,"HTMLControlsSystem");var Ix=LI;y();var Yy,qy,AI=class AI{constructor(e,t){b(this,"mesh");b(this,"type","custom-geometry");b(this,"dirty",!0);b(this,"feature");b(this,"builder");b(this,"outline");F(this,Yy,1);b(this,"color",new Qr);F(this,qy,0);this.mesh=new Qs,this.feature=e,this.builder=t}get visible(){return this.mesh.visible}set visible(e){this.mesh.visible=e}set opacity(e){V(this,Yy,e)}get opacity(){return p(this,Yy)}setColor(e){this.color.set(e)}get position(){var e;return(e=this.mesh)==null?void 0:e.position}get altitude(){return p(this,qy)}set altitude(e){this.mesh&&(this.mesh.position.z=e,V(this,qy,e))}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}};Yy=new WeakMap,qy=new WeakMap,u(AI,"CustomGeometryComponent");var tm=AI;y();var NI=class NI{constructor(e,t){b(this,"state");b(this,"convertTo3DMapPosition");this.state=e,this.convertTo3DMapPosition=t}update(){let e,t;for(let n of this.state.geometry3DIdsInScene){let i=this.state.geometry3DMap.get(n);(i==null?void 0:i.type)==="custom-geometry"&&(e=i.components[0],t=i.components[1],e.dirty&&t.visible!==!1&&(e.position.copy(this.convertTo3DMapPosition(e.feature.geometry.coordinates[1],e.feature.geometry.coordinates[0],t.altitude)),e.builder.setup(e.mesh),e.mesh.traverse(a=>{a.userData={entityId:n,type:"custom-geometry"}}),e.dirty=!1),t.visible!==!1&&e.builder.update(e.mesh))}}};u(NI,"CustomGeometrySystem");var Mx=NI;y();y();function AO(r){return r.children.some(e=>e.userData.isOutline)}u(AO,"hasOutline");function wx(r,e,t,n){let a=r.getAttribute("position").array,l=-1/0;for(let h=0;h<e.count;h++){let m=(e.start+h)*3,v=a[m+2];l=Math.max(l,v)}for(let h=0;h<e.count;h++){let m=(e.start+h)*3,v=a[m+2];Math.abs(v-l)<1e-4?a[m+2]=Math.max(t+n,2e-4+n):a[m+2]=n}r.attributes.position.needsUpdate=!0}u(wx,"updateBufferGeometryHeight");y();function kI(r){var m,v;let e=new w0,t=(m=r.mesh)==null?void 0:m.geometry;if(!t||!((v=r.batchedProps)!=null&&v.range))return;let n=r.batchedProps.range,i=n.start,a=n.count,l=t.getAttribute("position");if(l){let x=new Float32Array(a*3);for(let S=0;S<a;S++){let I=i+S;x[S*3]=l.array[I*3],x[S*3+1]=l.array[I*3+1],x[S*3+2]=l.array[I*3+2]}e.setAttribute("position",new Ao(x,3))}let h=t.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]}e.setAttribute("normal",new Ao(x,3))}let d=t.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]}e.setAttribute("uv",new Ao(x,2))}if(t.index){let x=t.index,S=new Uint32Array(a);for(let I=0;I<a;I++)S[I]=x.array[i+I];e.setIndex(new Ao(S,1))}return e}u(kI,"extractBufferGeometryFromBatchedGeometry");function NO(r,e){let t=kI(r);if(!t||!r.mesh)return;r.mesh.deleteInstance(r.instanceIndex),r.mesh.optimize();let n=e.addGeometry(t);e.addInstance(n);let i=e.getGeometryIdAt(n),a=e.getGeometryRangeAt(i);return a&&r.batchedProps&&(r.batchedProps.range=a),t.dispose(),n}u(NO,"transferGeometryToNewBatchedMesh");var Wq=80,Gh,em,Px,Ex,RI=class RI{constructor(e){b(this,"rendererState");b(this,"outlineOpacitiesDirty",!0);F(this,Gh,!0);F(this,em,-1/0);F(this,Px,new Map);F(this,Ex,new F2({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:_0}));this.rendererState=e}get geometries3DDirty(){return p(this,Gh)}set geometries3DDirty(e){V(this,Gh,e)}update(e,t=!0){let n;if(this.geometries3DDirty){for(let a of this.rendererState.geometry3DIdsInScene){let l=this.rendererState.geometry3DMap.get(a);if(l instanceof ro&&l.components[0].outline&&!AO(l)&&l.userData.entities3D.size>0){let h=[];for(let w of l.userData.entities3D.values()){let P=this.rendererState.geometry3DMap.get(w);if(P instanceof Sr&&P.type==="geometry"&&P.components[3]&&P.components[3].dirty===!0&&P.components[0].material!=null){let E=P.components[0].geometry,O=!1;E||(E=kI(P.components[0]),O=!0),h.push([P.components[3],new B2(E,Wq)]),O&&(E==null||E.dispose(),E=void 0)}}if(h.length===0)continue;let d=_s(h.map(w=>w[1]),!1);if(d==null)continue;let m=d.getAttribute("position"),v=new Float32Array(m.count*4),x=new Ao(v,4);d.setAttribute("color",x);let S=0;for(let w=0;w<h.length;w++){let[P,E]=h[w],O=E.getAttribute("position").count;P.edgeColors=x,P.geometry=d,P.ranges={count:O,start:S},S+=O,E.dispose()}let I=new Df(d,p(this,Ex));I.userData.isOutline=!0,l.add(I)}}V(this,Gh,!1),this.outlineOpacitiesDirty=!0}for(let a of this.rendererState.geometry3DIdsInScene){let l=this.rendererState.geometry3DMap.get(a);if(l instanceof Sr&&l.type==="geometry"&&l.components[3]&&l.components[3].dirty===!0&&l.components[0].material!=null&&l.parentObject3D instanceof ro){let h=l.components[3].geometry;if(!h)continue;let d=l.components[3];if(!d)continue;let m=d.edgeColors;if(!m||!d.ranges)continue;let v=new Qr(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=l.components[1].height,S=l.components[1].altitude;wx(h,d.ranges,x,S),h.attributes.color.needsUpdate=!0,h.computeBoundingSphere(),d.dirty=!1}}let i=t?Ul(e,16,19,0,1):p(this,em);if((i!==p(this,em)||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 kn){let l=n.components[3];if(l&&l.edgeColors&&l.geometry){let h=l.visible,d=Math.min(i,h?n.components[1].opacity*dp(n):0);if(l.currentOpacity!==d){for(let m=0;m<l.ranges.count;m++){let v=l.ranges.start+m;l.edgeColors.setW(v,d)}l.geometry.attributes.color.needsUpdate=!0}}}}V(this,em,i),V(this,Gh,!1),this.outlineOpacitiesDirty=!1}destroy(){p(this,Px).clear()}};Gh=new WeakMap,em=new WeakMap,Px=new WeakMap,Ex=new WeakMap,u(RI,"OutlineInterpolationSystem");var Tx=RI;y();y();var FI=class FI extends ue{constructor(){super(...arguments);b(this,"userData",{entityId:""})}};u(FI,"EntityMesh");var Ox=FI,Zq=J.object({flipImageToFaceCamera:J.boolean().optional(),url:J.string()}),$q=J.object({type:J.enum(["Feature"]),properties:J.object({width:J.number(),height:J.number(),rotation:J.number().min(0).max(360).optional(),verticalOffset:J.number().optional()}),geometry:Zd});function kO(r,e,t){J.union([J.number(),J.string()]).parse(r),$q.parse(e),Zq.parse(t)}u(kO,"validateImage");var BI=class BI{constructor(e){b(this,"mesh",new Qs);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=e}get visible(){var e,t;return(t=(e=this.mesh)==null?void 0:e.visible)!=null?t:!1}set visible(e){this.mesh&&(this.mesh.visible=e)}};u(BI,"ImageComponent");var Dx=BI;y();function GI(r,e){return{x:r.x*Math.cos(e)-r.y*Math.sin(e),y:r.x*Math.sin(e)+r.y*Math.cos(e)}}u(GI,"rotatePoint");function Jq(r,e){return r.map(t=>GI(t,e))}u(Jq,"rotatePoints");function Kq(r){let e=1/0,t=1/0,n=-1/0,i=-1/0;for(let a of r)e=Math.min(e,a.x),t=Math.min(t,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:e,minY:t,maxX:n,maxY:i}}u(Kq,"getBounds");function Qq(r,e){let t=!1;for(let n=0,i=e.length-1;n<e.length;i=n++){let a=e[n].x,l=e[n].y,h=e[i].x,d=e[i].y;l>r.y!=d>r.y&&r.x<(h-a)*(r.y-l)/(d-l)+a&&(t=!t)}return t}u(Qq,"pointInPolygon");function RO(r,e,t,n,i){for(let a=0;a<i;a++)for(let l=0;l<n;l++)if(r[t+a][e+l]!==1)return!1;return!0}u(RO,"isValidRectangle");function tW(r,e,t){let n=r.maxX-r.minX,i=r.maxY-r.minY,a,l,h=z({},r);return n/i>e?(l=i/t,a=l*e,h.minX+=(n-a*t)/2):(a=n/t,l=a/e,h.minY+=(i-l*t)/2),{dx:a,dy:l,gridBounds:h}}u(tW,"calculateGridDimensions");function eW(r,e,t,n,i){let a=Array(t).fill(0).map(()=>Array(t).fill(0));for(let l=0;l<t;l++)for(let h=0;h<t;h++){let d={x:e.minX+h*n,y:e.minY+l*i};Qq(d,r)&&(a[l][h]=1)}return a}u(eW,"createAndFillGrid");function rW(r,e){let t=Array(e).fill(0).map(()=>Array(e).fill(0));for(let n=0;n<e;n++)for(let i=0;i<e;i++)if(r[n][i]===1){let a=0;for(let l=1;l<=Math.min(e-i,e-n)&&RO(r,i,n,l,l);l++)a=l;t[n][i]=a}return t}u(rW,"calculateRectSizes");function nW(r,e,t,n,i,a){let l=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(e[m][v],2),S=t.minX+v*i,I=t.minY+m*a;l+=x,h+=S*x,d+=I*x}return{x:h/l,y:d/l}}u(nW,"calculatePolygonCenter");function iW(r,e,t,n,i,a,l){let h=-1/0,d=null,m=r.length,v=Math.sqrt(Math.pow(e.maxX-e.minX,2)+Math.pow(e.maxY-e.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)&&RO(r,S,x,I,w)){let P=I*w,E=e.minX+(S+I/2)*t,O=e.minY+(x+w/2)*n,N={x:E,y:O},G=Math.sqrt(Math.pow(N.x-i.x,2)+Math.pow(N.y-i.y,2))/v,j=P*(1-a)-G*a*P;j>h&&(h=j,d={center:N,width:I*t*l,height:I*n*l})}}return d}u(iW,"findBestRectangle");function VI(r,e,t,n={}){let{scaleFactor:i=.9,centerPriority:a=.5,resolution:l=100,minimumSizeRatio:h=.5}=n,d=TT(t),m=r.width/r.height,v=Jq(e,d),x=Kq(v),{dx:S,dy:I,gridBounds:w}=tW(x,m,l),P=eW(v,w,l,S,I),E=rW(P,l),O=nW(P,E,w,l,S,I),N=iW(P,w,S,I,O,a,i);return!N||N.width<r.width*h||N.height<r.height*h?r:et(z({},N),{center:GI(N.center,-d),rotation:t,polygonCenter:GI(O,-d)})}u(VI,"findLargestInteriorRectangle");var Wy=Math.PI*2,oW=Math.PI/2,sW=Math.PI*1.5,aW=Af(oW,2),lW=Af(sW,2),uW=.01,FO=!1,jI=class jI extends ie{constructor(t,n,i=0,a=0,l={}){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=t,this.convertTo3DMapPosition=n,this.initialBearing=i,this.naturalBearing=a,this.imagePlacementOptions=l}createImageMesh(t,n,i,a=0,l,h){var w,P,E;let d={width:i.width,height:i.height,center:this.convertTo3DMapPosition(l),rotation:(w=i.rotation)!=null?w:0},m=(P=this.imagePlacementOptions.mode)!=null?P:"default",v=(()=>{switch(m){case"fit-nearest-90":let O=(this.initialBearing-this.naturalBearing+360)%180;return O>=45&&O<=135?VI(d,h,d.rotation+90,this.imagePlacementOptions):d;case"fit-initial-bearing":return VI(d,h,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return d}})();if(FO&&v.polygonCenter){let O=new ue(new E0(1),new Js({color:65280}));O.position.set(v.polygonCenter.x,v.polygonCenter.y,a),this.rendererState.entityScene.add(O)}let x=new Js({transparent:!0,depthWrite:!1,side:Fl}),S=new $s(v.width,v.height),I=new Ox(S);if(I.visible=!1,(E=this.getOrDownloadImage(n))==null||E.then(O=>{x.map=O,x.needsUpdate=!0,x.map.colorSpace=cp,I.visible=!0,this.publish("image-loaded")}),I.userData.entityId=t,I.material=x,FO){let O=new ue(new $s(i.width,i.height),new Js({color:"gray"}));I.add(O);let N=new MT;I.add(N),N.scale.set(10,10,10)}return I.position.set(v.center.x,v.center.y,a+uW),I.rotation.z=(-Ie.degToRad(v.rotation)+Wy)%Wy,I}getOrDownloadImage(t){var n;if(this.imageLoadingCache.has(t))return(n=this.imageLoadingCache.get(t))==null?void 0:n.promise;{let i=new Promise(a=>{Ac.getLoader().load(t,l=>{let h=this.imageLoadingCache.get(t);h&&!h.loaded&&(h.loaded=!0),a(l)})});return this.imageLoadingCache.set(t,{loaded:!1,promise:i}),i}}flipIfNeeded(t,n){if(t.imageMesh==null)return;let i=-n,a=t.imageMesh.rotation.z,l=Af((a-i+Wy)%Wy,2);l>aW&&l<lW&&(t.imageMesh.rotation.z=(a+Math.PI)%Wy)}update(t){var l,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,t)}else if((n==null?void 0:n.type)==="geometry"){if(i=n.components[0],a=n.components[1],a.showImage&&((l=i.feature.properties)!=null&&l.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 P=this.convertTo3DMapPosition(w);return{x:P.x,y:P.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,t)}}}};u(jI,"ImageSystem");var Lx=jI;y();var cW=250,kc,UI=class UI extends ie{constructor(t,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);F(this,kc);b(this,"update",u((t=!1,n=Date.now())=>{this.focusablesDirty&&this.updateFocusableEntities(),!t&&(Date.now()-n>cW||(p(this,kc)&&cancelAnimationFrame(p(this,kc)),V(this,kc,requestAnimationFrame(()=>{this.updateRaf()}))))},"update"));this.state=t,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let t=new ne(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new ne(t.x/1.2,t.y/1.2),i=new ne(t.x+(t.x-n.x),n.y),a=new ne(n.x,t.y+(t.y-n.y)),l=new ne(i.x,a.y),h=new ne(t.x,t.y/1.5),d=new ne(t.x,t.y+(t.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=[t,h,d,n,i,a,l].map((m,v)=>{if(this.debugRaycasters){let P=document.createElement("div");P.style.position="absolute",P.style.top=m.y+"px",P.style.left=m.x+"px",P.style.width="10px",P.style.height="10px",P.style.backgroundColor="red",this.debugEl.append(P)}let x=m.x/this.state.canvasWidth*2-1,S=-(m.y/this.state.canvasHeight)*2+1,I=new ne(x,S),w=new Fa;return w.setFromCamera(I,this.camera),[w,I,v===0?10:v<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let t,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 mu){if(n=i.components[2],n.dirty===!0||n.focusMesh==null){n.focusMesh&&Zr(n.focusMesh);let l=new _n;l.setFromObject(i);let h=l.max.x-l.min.x,d=l.max.y-l.min.y,m=l.max.z-l.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 No(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 Tn(x),I=new ue(v,S);I.position.set((l.min.x+l.max.x)/2,(l.min.y+l.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 mu&&(t=i.components[0],n=i.components[4],t instanceof kn&&t.geometry!=null&&(n.dirty===!0||n.focusMesh==null))){if(n.focusMesh==null){let l=new ue(t.geometry);l.userData={entityId:i.id},n.focusMesh=l}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 t=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",t),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){p(this,kc)&&cancelAnimationFrame(p(this,kc)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};kc=new WeakMap,u(UI,"GeometryInFocusSystem");var Ax=UI;y();var BO=20,pW=5e3,As,Zy,$y,Rc,Vh,jh,kx,Jy,zI=class zI{constructor(e){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");F(this,As,null);F(this,Zy,u(()=>{p(this,As)&&(clearTimeout(p(this,As)),V(this,As,null),this.dirty=!1)},"#stopTrying"));F(this,$y,u(()=>{p(this,As)&&(clearTimeout(p(this,As)),V(this,As,null)),V(this,As,setTimeout(()=>{p(this,Zy).call(this)},pW))},"#startTrying"));b(this,"handleRender",u(async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(p(this,Rc)&&(p(this,kx).call(this),V(this,Rc,!1)),this.centerPoint){let e=this.map.project(this.centerPoint),t=this.map.queryRenderedFeatures(e,{layers:Array.from(this.hiddenLayersInStyle)});if(t.length>0){for(let n of t)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,Rc,!1),this.dirty=!1}}else if(this.bbox&&this.polygons){let e=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(e.length>0){V(this,Rc,!0);for(let t=0;t<e.length;t+=BO){let n=e.slice(t,t+BO);p(this,Vh).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=jr(i.geometry.coordinates):i.geometry.type==="MultiPolygon"&&(a=Ks(i.geometry.coordinates)),!a)continue;for(let l of this.polygons)if(bg(l,a)){this.expr.push(["!=",["id"],i.id]);continue}}})}p(this,Jy).call(this)}}}},"handleRender"));b(this,"expr",[]);F(this,Rc,!1);F(this,Vh,[]);F(this,jh,null);F(this,kx,u(()=>{p(this,jh)&&(globalThis.cancelAnimationFrame(p(this,jh)),V(this,jh,null)),V(this,Vh,[])},"#cancelJobs"));F(this,Jy,u(()=>{let e=p(this,Vh).pop();typeof e=="function"&&(e(),p(this,Vh).length>0&&V(this,jh,globalThis.requestAnimationFrame(p(this,Jy)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(t=>{this.map.setFilter(t,["all",...this.expr])}),this.dirty=!1),this.expr=[],V(this,Rc,!1),p(this,Zy).call(this)},"#runJobs"));b(this,"handleStyleChange",u(e=>{var t,n;if(this.map&&e&&e.dataType==="style"&&e.type==="styledata"&&this.userHiddenLayers.size>0){let i=(n=(t=e==null?void 0:e.style)==null?void 0:t.stylesheet)==null?void 0:n.id;(!i||i!==this.stylesheetId)&&(this.stylesheetId=i,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));e&&(this.map=e,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(e,t){p(this,$y).call(this),this.centerPoint=e;for(let n of t)this.userHiddenLayers.add(n);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(e,t,n){p(this,As)&&clearTimeout(p(this,As)),p(this,$y).call(this),this.bbox=e,this.polygons=t.reduce((i,a)=>{if(a.geometry.type==="Polygon"){let l=jr(a.geometry.coordinates);i.push(l)}else a.geometry.type==="MultiPolygon"&&i.push(...a.geometry.coordinates.map(l=>jr(l)));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 e of this.userHiddenLayers)this.map.getLayer(e)&&this.hiddenLayersInStyle.add(e)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};As=new WeakMap,Zy=new WeakMap,$y=new WeakMap,Rc=new WeakMap,Vh=new WeakMap,jh=new WeakMap,kx=new WeakMap,Jy=new WeakMap,u(zI,"OutdoorLayers");var Nx=zI;y();y();y();y();var Rx="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 HI="#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 GO="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 VO="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 fW=new Lf;function jO(r,e,t){let{nearRadius:n,farRadius:i,accentColor:a,completeFraction:l,isVertical:h,visibleThroughGeometry:d,dashed:m}=e,{color:v}=t,x=!0,S=0,I=1/0,w=e.displayArrowsOnPath,P=!0,E=w,O=n/2+dW,N=0;r[0].z+=O;for(let Nt=1;Nt<r.length;++Nt){r[Nt].z+=O;let At=r[Nt].x-r[Nt-1].x,xt=r[Nt].z-r[Nt-1].z;if(h)N+=Math.sqrt(At*At+xt*xt);else{let _e=r[Nt].y-r[Nt-1].y;N+=Math.sqrt(At*At+_e*_e+xt*xt)}}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 hT;E&&(L=fW.load(VO),L.colorSpace=cp);let G=new Qr(v),j=new Qr(a),$={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:G},pathLength:{type:"f",value:N},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:P},opacityMultiplier:{type:"f",value:1},dashed:{type:"b",value:m}},q=new bT(r);q.curveType="catmullrom",q.tension=0;let k=30,tt=8,ut=k*r.length,at=new xT(q,ut,n,tt,!1),H=new Float32Array(at.attributes.position.count);for(let Nt=r.length;Nt<H.length;Nt++)H[Nt]=Nt;at.setAttribute("vertexIndex",new Ao(H,1));let St=new Float32Array(at.attributes.position.count),pt=new Ao(St,1);for(let Nt=0;Nt<=ut;Nt++)for(let At=0;At<=tt;++At)pt.setX(Nt*(tt+1)+At,Nt/ut);at.setAttribute("pathDistance",pt);let ct=new Float32Array(at.attributes.normal.count*3),It=new Ao(ct,3);for(let Nt=0;Nt<ut;Nt++){let At=at.tangents[Nt];for(let xt=0;xt<=tt;++xt)It.setXYZ(Nt*(tt+1)+xt,At.x,At.y,At.z)}at.setAttribute("pathTangent",It);let Et=new Float32Array(at.attributes.normal.count*3),dt=new Ao(Et,3);for(let Nt=0;Nt<ut;Nt++){let At=at.tangents[Nt];var bt,Z,te;h?(bt=At.x*At.y,Z=-1+At.y*At.y,te=At.z*At.y):(bt=-At.x*At.z,Z=-At.y*At.z,te=1-At.z*At.z);let xt=Math.sqrt(bt*bt+Z*Z+te*te);xt===0&&(xt=1);let _e=bt/xt,de=Z/xt,Xr=te/xt;for(let me=0;me<=tt;++me)dt.setXYZ(Nt*(tt+1)+me,_e,de,Xr)}at.setAttribute("pathNormal",dt);let jt=new rc({uniforms:$,vertexShader:Rx,fragmentShader:HI});jt.transparent=!0,jt.alphaTest=.5,$.resolution.value.x=1,$.resolution.value.y=1,$.vertexes.value=H.length,$.arrowTexture.value.wrapS=Na,$.arrowTexture.value.wrapT=Na,$.arrowTexture.value.anisotropy=16;let ee=new ue(at,jt),Tt=ee.clone(),le=et(z({},$),{opacityMultiplier:{type:"f",value:.25}});le.complete.value=1,Tt.material=new rc({uniforms:le,vertexShader:Rx,fragmentShader:HI}),Tt.material.transparent=!0,Tt.material.alphaTest=.5,Tt.material.depthWrite=!1,Tt.material.depthTest=!1,le.resolution.value.x=1,le.resolution.value.y=1,le.vertexes.value=H.length,le.arrowTexture.value.wrapS=Na,le.arrowTexture.value.wrapT=Na,le.arrowTexture.value.anisotropy=16,le.complete.value=l,ee.userData=Tt.userData=e.mesh.userData;let vr=e.mesh;if(!d){let Nt=new rc({uniforms:$,vertexShader:Rx,fragmentShader:GO}),At=new ue(at,Nt);At.name="stencil",At.material.colorWrite=!1,At.material.stencilWrite=!0,At.material.stencilRef=1,At.material.stencilFunc=cT,At.material.stencilZPass=M0,At.material.stencilZFail=M0,At.material.stencilFail=M0,At.material.depthWrite=!1,At.material.depthTest=!1,At.userData=e.mesh.userData,vr.add(At),vr.add(Tt)}if(vr.add(ee),h){let Nt=new _n().setFromObject(ee),At=new zt;Nt.getCenter(At),vr.children.forEach(xt=>{xt.geometry.center(),xt.position.copy(At)})}d&&(ee.material.stencilWrite=!0,ee.material.stencilRef=1,ee.material.stencilFunc=uT,ee.material.stencilZPass=I0,ee.material.stencilZFail=I0,ee.material.stencilFail=I0,ee.material.needsUpdate=!0,ee.layers.disableAll(),ee.layers.enable(G0.ALWAYS_ON_TOP)),at.computeBoundingBox();let Qe=new zt;return at.boundingBox.getCenter(Qe),{mesh:vr,material:jt,center:Qe}}u(jO,"buildPath");var dW=.15;var mW=.5,XI=class XI extends ie{constructor(t,n,i,a){super();b(this,"rendererState");b(this,"altitudeDirty",!0);b(this,"convertTo3DMapPosition");b(this,"getParentContainer");b(this,"convertZoomLevelToAltitude");this.rendererState=t,this.convertTo3DMapPosition=n,this.getParentContainer=i,this.convertZoomLevelToAltitude=a}update(t,n,i,a=0){let l,h=!1;for(let d of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(d),l&&l.type==="path"&&l.components[0].type==="path"){let m=l.components[0],v=l.components[1],x=m.isVertical&&this.altitudeDirty;if(!(m instanceof Nc))continue;let S=[];if(m.dirty||x){if(m.mesh.parent!=null)for(let I=m.mesh.children.length-1;I>=0;I--)Zr(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],P,E,O=I.geometry.coordinates[2]||0,N=w.geometry.coordinates[2]||0;I.properties.parentId&&(P=this.getParentContainer(I.properties.parentId,!0),P!=null&&P.altitude!=null&&(O+=P.altitude,m.isVertical=!0)),w.properties.parentId&&(E=this.getParentContainer(w.properties.parentId,!0),E!=null&&E.altitude!=null&&(N+=E.altitude,m.isVertical=!0));let L=this.convertTo3DMapPosition(I.geometry.coordinates[1],I.geometry.coordinates[0],O),G=this.convertTo3DMapPosition(w.geometry.coordinates[1],w.geometry.coordinates[0],N);Math.abs(L.z-G.z)>mW&&P!=null&&P.visible&&E!=null&&E.visible&&(S=[L,G])}else{let I=m.feature.features;for(let w=0;w<I.length;w++)if(w===0||!QT(I[w].geometry.coordinates,I[w-1].geometry.coordinates)){let P=this.convertTo3DMapPosition(I[w].geometry.coordinates[1],I[w].geometry.coordinates[0],I[w].geometry.coordinates[2]||0);S.push(P)}}if(S.length>1){let{mesh:I,material:w,center:P}=jO(S,m,{color:v.color});m.mesh=I,m.material=w,m.position=P}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 P,E;let w=I.material.uniforms;if(I.name==="stencil"){m.materialDirty&&(w.complete.value=m.completeFraction);return}w.nearZoom.value=(P=m.nearZoomAltitude)!=null?P:t,w.farZoom.value=(E=m.farZoomAltitude)!=null?E: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")}};u(XI,"PathSystem");var Ky=XI;y();var Jn,rm,bu,YI=class YI{constructor(e){b(this,"rendererState");b(this,"dirty",!1);F(this,Jn);F(this,rm);F(this,bu);this.rendererState=e}updateOne(e){if(e instanceof Sr&&e.components[0]instanceof kn&&e.components[1]instanceof Va&&e.parentObject3D instanceof ro&&(V(this,Jn,e.components[0]),V(this,bu,e.components[1]),p(this,Jn).detached&&p(this,Jn).dirty&&p(this,Jn).mesh!=null&&p(this,Jn).material!=null&&p(this,Jn).batchedProps!=null)){V(this,rm,e.parentObject3D),p(this,Jn).visible=!1;let t=new Qr(p(this,bu).color),n=p(this,bu).opacity*dp(e),i=new Lh({color:t,side:Fl,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,p(this,Jn).material.repeatYFactor),a=new F0(1,p(this,Jn).batchedProps.positionCount,0,i),l=NO(p(this,Jn),a);if(l==null)return;a.userData={entities:{0:e.id},detached:!0},p(this,Jn).instanceIndex=l,p(this,Jn).material.setColor(p(this,Jn).instanceIndex,t,p(this,bu).topColor?new Qr(p(this,bu).topColor):t),p(this,Jn).mesh=a,p(this,Jn).material=i,p(this,rm).add(a),p(this,Jn).dirty=!1}}update(){if(!this.dirty)return;let e;for(let t of this.rendererState.geometry3DIdsInScene)e=this.rendererState.geometry3DMap.get(t),this.updateOne(e);this.dirty=!1,this.cleanup()}cleanup(){V(this,Jn,void 0),V(this,rm,void 0),V(this,bu,void 0)}};Jn=new WeakMap,rm=new WeakMap,bu=new WeakMap,u(YI,"MeshDetachmentSystem");var Fx=YI;y();y();function UO(r,e,t){var n;if((n=r.batchedProps)!=null&&n.range&&r.mesh){let i=e||1e-4,a=i/Math.max(t,1e-4);return wx(r.mesh.geometry,r.batchedProps.range,i,0),r.material&&(r.material.repeatYFactor=a),r.currentHeight=i,!0}return!1}u(UO,"updateHeight");function zO(r,e,t,n,i,a){return r.mesh&&r.instanceIndex!==-1?(r.mesh.getMatrixAt(r.instanceIndex,t),t.decompose(n,i,a),n.z=e,t.compose(n,i,a),r.mesh.setMatrixAt(r.instanceIndex,t),r.altitude=e,!0):!1}u(zO,"updateAltitude");var pa,dl,Gx,Vx,jx,Ux,qI=class qI{constructor(e){b(this,"rendererState");b(this,"dirty",!1);F(this,pa);F(this,dl);F(this,Gx,new ts);F(this,Vx,new zt);F(this,jx,new pp);F(this,Ux,new zt);this.rendererState=e}updateOne(e){var t;if(e instanceof Sr&&e.type==="geometry"&&((t=e.components[1])!=null&&t.dirty)&&(V(this,pa,e.components[0]),V(this,dl,e.components[1]),e.type==="geometry")){let n=!1;p(this,dl).height!==p(this,pa).currentHeight&&(n=UO(p(this,pa),p(this,dl).height,p(this,dl).initialHeight)),p(this,dl).altitude!==p(this,pa).altitude&&(n=zO(p(this,pa),p(this,dl).altitude,p(this,Gx),p(this,Vx),p(this,jx),p(this,Ux))),n&&p(this,pa).mesh!=null&&p(this,pa).mesh.computeBoundingSphere()}}update(){let e;for(let t of this.rendererState.geometry3DIdsInScene)e=this.rendererState.geometry3DMap.get(t),this.updateOne(e);this.cleanup()}cleanup(){V(this,pa,void 0),V(this,dl,void 0)}};pa=new WeakMap,dl=new WeakMap,Gx=new WeakMap,Vx=new WeakMap,jx=new WeakMap,Ux=new WeakMap,u(qI,"MeshModificationSystem");var Bx=qI;y();var gW={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},WI=class WI{constructor(e){b(this,"state",gW);b(this,"core");this.core=e}update(e){let t={};for(let[n,i]of Object.entries(e))n in this.state&&this.state[n]!==e[n]&&(this.state[n]=i,t[n]=i);this.handleUpdate(t)}handleUpdate(e){e.showPolygonLabelTextAreaMesh!=null&&(e.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),e.showEnvMap!=null&&(e.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),e.showCollisionBoxes!=null&&(e.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};u(WI,"Debug");var zx=WI;y();var Qy=9,yW=!1,HO=.1;function vW(r,e,t){for(let n=0;n<e;n++){let i=(t&16711680)>>16,a=(t&65280)>>8,l=t&255;r[n*3]=i/255,r[n*3+1]=a/255,r[n*3+2]=l/255}}u(vW,"fillArrayWithColor");var ZI=class ZI{constructor(e,t,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",u(()=>{let e=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/e*this.scale),this.height=Math.floor(this.renderer.domElement.height/e*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new dT(this.width,this.height,{format:S0,type:C0,internalFormat:"RGBA"})},"resize"));b(this,"shouldShowByXY",u((e,t,n)=>{if(this.pixelBuffer==null)return!1;let i=e+(this.height-t-1)*this.width,a=this.pixelBuffer[i*4],l=this.pixelBuffer[i*4+1],h=this.pixelBuffer[i*4+2],d=a<<16|l<<8|h;return d===n||d===this.backgroundId},"shouldShowByXY"));b(this,"activeOccluders",new Set);b(this,"update",u(()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let e,t;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(e=a.userData.occluderFeature,e.geometry.type==="Polygon"){let l=$b(e,this.convertTo3DMapPosition,{color:"white",height:HO});t=this.createOccluderMesh(l,a.userData.occluderId),a.add(t)}else if(e.geometry.type==="MultiPolygon"){let l=Jb(e,this.convertTo3DMapPosition,{color:"white",height:HO});t=this.createOccluderMesh(l,a.userData.occluderId),a==null||a.add(t)}a.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new Qr(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(Qy),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(Qy),yW?this.renderService.enabledLayers.add(Qy):this.renderService.enabledLayers.delete(Qy),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 l=a.components[0].projection,h=Math.floor(l.x*this.scale),d=Math.floor(l.y*this.scale),m=this.shouldShowByXY(h,d,a.occluderId);a.components[0].isOccluded=!m}}})},"update"));if(this.state=e,this.convertTo3DMapPosition=t,(n==null?void 0:n.renderer)==null)throw new Error("No Renderer");this.renderService=n,this.renderer=n.renderer,this.resize(),this.pickingMaterial=new rc({glslVersion:pT,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(e,t){let n=e.attributes.position,i=new Float32Array(n.count*3);vW(i,n.count,t),e.setAttribute("color",new Ao(i,3))}createOccluderMesh(e,t){let n=new ue(e,this.pickingMaterial);return n.layers.set(Qy),this.applyId(n.geometry,t),n.userData.occluderId=t,n}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var e;this.destroyed=!0,(e=this.pickingTexture)==null||e.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};u(ZI,"Occlusion2DSystem");var Hx=ZI;y();var $I=class $I{constructor(e){this.state=e;b(this,"dirty",!0)}update(){var e;if(this.dirty){for(let t of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(t);if(n instanceof Sr&&n.type==="geometry"&&((e=n.components[0])==null?void 0:e.geometry)!=null){let i=n.components[0];i.geometry&&(i.geometry.dispose(),i.geometry=void 0)}}this.dirty=!1}}};u($I,"GeometryDisposalSystem");var Xx=$I;var XO=new Fa;var{DEFAULT_PITCH:eM,DEFAULT_BEARING:rM,DEFAULT_ZOOM_LEVEL:nM,DEFAULT_MIN_ZOOM_LEVEL:bW,DEFAULT_MAX_ZOOM_LEVEL:xW}=Ls,_W=Ie.radToDeg(.6435011087932844),In,bn,Uh,t1,nm,Fc,zh,im,Hi,KI,nt,Br,ha,Mn,ml,Ti,rt,e1,Kn,Gr,YO,qO,WO,xu,Yx,r1,n1,i1,om,qx,o1,s1,a1,sm,QI,Hh,l1,u1,Po,Eo,tM,am,c1,iM=class iM extends ie{constructor(t,n={}){var S,I,w,P,E,O,N,L,G,j,$,q;super();F(this,Hi);b(this,"options");b(this,"container");b(this,"Debug");F(this,In);F(this,bn);F(this,Uh);F(this,t1);F(this,nm);F(this,Fc);F(this,zh);F(this,im);b(this,"rendererDomElement");F(this,nt,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,geometryGroupIdsToLoad:new Set,entityScene:new Er("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:B0,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,internalTweenGroup:new ax,externalTweenGroup:new ax,cameraObject:new R2,naturalBearing:0,containerOffset:[0,0],useStandaloneCamera:!1});b(this,"camera");F(this,Br);F(this,ha);F(this,Mn);F(this,ml);F(this,Ti);F(this,rt,{});F(this,e1,window.matchMedia("screen and (min-resolution: 2dppx)"));b(this,"map");F(this,Kn,u(()=>{p(this,rt).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));F(this,Gr,u(()=>{p(this,rt).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));F(this,xu,"standalone");F(this,Yx,u(()=>{p(this,rt).geometryDisposalSystem.dirty=!0,this.render()},"#setGeometryDisposalDirty"));F(this,r1,u(t=>Math.trunc(t*10)/10,"#round10"));F(this,n1,u(()=>{gt(this,Hi,KI).call(this,Rf()),p(this,rt).twoDDrawSystem.dirty=!0,p(this,om).call(this,void 0,void 0,!0)},"#handlePixelRatioChange"));F(this,i1,u(()=>{p(this,om).call(this)},"#handleWindowResizeWithEvent"));F(this,om,u((t,n,i=!1)=>{let a=t!=null?t:this.rendererDomElement.clientWidth,l=n!=null?n:this.rendererDomElement.clientHeight;if((a===0||l===0)&&!i)return;p(this,nt).canvasWidth=a,p(this,nt).canvasHeight=l,gt(this,Hi,KI).call(this,Rf()),p(this,sm).call(this),gt(this,Hi,WO).call(this),p(this,rt).cameraSystem.resize(this.canvasWidth,this.canvasHeight),p(this,rt).cameraSystem.dirty=!0,p(this,rt).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),p(this,rt).htmlControlsSystem.resize(this.canvasWidth),p(this,rt).geometryInFocusSystem.resize(),p(this,rt).occlusion2DSystem.resize();let{top:h,left:d}=this.container.getBoundingClientRect();p(this,nt).containerOffset=[h,d],this.publish("resize"),this.render()},"#handleWindowResize"));F(this,qx,u(()=>{this.renderSync()},"#renderFull"));F(this,o1,new zt);F(this,s1,u((t,n)=>{let i=this.mode==="standalone"?p(this,bn):this.viewCamera;if(p(this,bn).position.z+this.camera.elevation>n.z){p(this,o1).copy(n);let a=p(this,o1).project(i),l=(a.x+1)/2*this.canvasWidth-0/2,h=(-a.y+1)/2*this.canvasHeight-0/2,d=p(this,r1).call(this,l),m=p(this,r1).call(this,h);t.x=d,t.y=m}else t.x=-1e3,t.y=-1e3},"#project"));F(this,a1,u((t,n)=>{p(this,Ti).setBufferSize(t,n),p(this,bn).aspect=t/n,p(this,bn).updateProjectionMatrix(),p(this,bn).updateMatrixWorld(!0),p(this,nm).x=t,p(this,nm).y=n},"#setBufferSize"));F(this,sm,u(()=>{var l;let t=p(this,nt).canvasWidth=this.rendererDomElement.clientWidth,n=p(this,nt).canvasHeight=this.rendererDomElement.clientHeight,i=Math.floor(t*this.resolutionScale),a=Math.floor(n*this.resolutionScale);p(this,a1).call(this,i,a),(l=this.map)==null||l.resize(),p(this,nt).shouldMeasureCanvas=!1},"#measureCanvas"));b(this,"getParentContainer",u((t,n=!0)=>{if(!t)return n?p(this,nt).entityScene:void 0;if(typeof t=="string"||typeof t=="number"){let i=p(this,nt).geometry3DMap.get(t);return i instanceof Er?i:(K.warn("Parent (".concat(typeof t=="object"?t.id:t,") is not a valid container, adding to scene")),n?p(this,nt).entityScene:void 0)}else if(t.type==="group-container"){let i=p(this,nt).geometry3DMap.get(t.id);if(i instanceof Er)return i}return n?p(this,nt).entityScene:void 0},"getParentContainer"));b(this,"showCollisionBoxes",u(()=>{p(this,rt).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));b(this,"hideCollisionBoxes",u(()=>{p(this,rt).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));b(this,"projectScreenXYToCoordinate",u((t,n,i=!1)=>{var S,I;let a=p(this,nt).containerOffset[0],l=p(this,nt).containerOffset[1],h=(t-l)/p(this,nt).canvasWidth*2-1,d=-((n-a)/p(this,nt).canvasHeight)*2+1,m=new ne(h,d),v,x;if(i)XO.setFromCamera(m,p(this,bn)),v=(S=XO.intersectObject(p(this,Fc),!1)[0])==null?void 0:S.point;else{let w=p(this,rt).interactionSystem.getThreeDIntersectsFromXY(m);v=(I=w==null?void 0:w[0])==null?void 0:I.point,x=p(this,rt).interactionSystem.getGroupContainerIntersectsFromXY(m)}if(v)return{coordinate:this.convert3DMapPositionToCoordinate(v),groupContainers:x}},"projectScreenXYToCoordinate"));b(this,"projectCoordinateToScreenXY",u(t=>{let n=this.convertTo3DMapPosition(t[1],t[0],t[2]||0),i=new ne;return p(this,s1).call(this,i,n),{x:i.x,y:i.y}},"projectCoordinateToScreenXY"));b(this,"convert3DMapPositionToCoordinate",u(t=>{var a,l,h,d;let{lat:n,lon:i}=V0((l=(a=p(this,nt).center)==null?void 0:a[1])!=null?l:0,(d=(h=p(this,nt).center)==null?void 0:h[0])!=null?d:0,t.x,t.y);return[i,n,t.z]},"convert3DMapPositionToCoordinate"));b(this,"setBackgroundColor",u((t,n)=>{p(this,Ti).setBackgroundColor(t,n)},"setBackgroundColor"));b(this,"getMetresPerPixel",u(()=>{let t=this.container.clientWidth,n=this.container.clientHeight/2,i=this.projectScreenXYToCoordinate(0,n,!0),a=this.projectScreenXYToCoordinate(t,n,!0);return i==null||a==null?void 0:L0(i.coordinate,a.coordinate)/t},"getMetresPerPixel"));b(this,"hideOutdoorLayersUnderPoint",u((t,n)=>{!this.map||(n==null?void 0:n.length)===0||(p(this,rt).outdoorLayersSystem.hideLayersUnderPoint(t,n),this.render())},"hideOutdoorLayersUnderPoint"));b(this,"hideOutdoorLayersIntersectingPolygons",u((t,n,i)=>{p(this,rt).outdoorLayersSystem.hideLayersIntersectingPolygons(t,n,i),this.render()},"hideOutdoorLayersIntersectingPolygons"));F(this,Hh,new vT);F(this,l1,new ts);F(this,u1,u(t=>{var n;K.error("Render failed: ",t,(n=t.stack)!=null?n:"No stack trace available"),this.publish("render-error",{error:t})},"#onRenderError"));b(this,"render",u(()=>{var t;if(((t=p(this,rt))==null?void 0:t.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return p(this,rt).renderSystem.update().catch(p(this,u1))},"render"));b(this,"renderSync",u(()=>p(this,rt).renderSystem.update(!0).catch(p(this,u1)),"renderSync"));F(this,Po,Ff(()=>{this.publish("user-interaction-start",void 0)},0,!0));F(this,Eo,Ff(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));b(this,"on",u((t,n)=>{super.on(t,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(t)&&this.mode==="standalone"&&T.env.NODE_ENV!=="test"&&(K.warn('"'.concat(t,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(t))},"on"));b(this,"off",u((t,n)=>{super.off(t,n)},"off"));b(this,"getCursor",u(()=>p(this,rt).interactionSystem.getCursor(),"getCursor"));b(this,"destroy",u(()=>{var t;p(this,rt)&&(p(this,rt).cameraSystem.off("user-dolly-start",p(this,Po)),p(this,rt).cameraSystem.off("user-pan-start",p(this,Po)),p(this,rt).cameraSystem.off("user-rotate-start",p(this,Po)),p(this,rt).cameraSystem.off("user-zoom-start",p(this,Po)),p(this,rt).cameraSystem.off("user-tilt-start",p(this,Po)),p(this,rt).cameraSystem.off("user-pedestal-start",p(this,Po)),p(this,rt).cameraSystem.off("user-dolly-end",p(this,Eo)),p(this,rt).cameraSystem.off("user-pan-end",p(this,Eo)),p(this,rt).cameraSystem.off("user-rotate-end",p(this,Eo)),p(this,rt).cameraSystem.off("user-zoom-end",p(this,Eo)),p(this,rt).cameraSystem.off("user-tilt-end",p(this,Eo)),p(this,rt).cameraSystem.off("user-pedestal-end",p(this,Eo)),p(this,rt).renderSystem.off("measure-canvas",p(this,sm)),p(this,rt).meshOptimizationSystem.off("geometry-2d-added",this.render),p(this,rt).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),p(this,Kn).call(this),p(this,Gr).call(this),this.renderSync(),p(this,rt).renderSystem.destroy(),p(this,rt).cameraSystem.off("change",this.render),p(this,rt).pathSystem.off("animate:path",this.render),p(this,rt).cameraSystem.dispose(),p(this,rt).exporterSystem.destroy(),p(this,rt).outdoorLayersSystem.destroy(),p(this,rt).drawSystem.destroy(),window.removeEventListener("resize",p(this,i1),!1),p(this,e1).removeEventListener("change",p(this,n1)),p(this,zh)&&p(this,zh).disconnect(),this._subscribers={},p(this,Ti).destroy(),(t=p(this,In))==null||t.traverse(n=>{Zr(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),V(this,In,void 0),p(this,rt).htmlControlsSystem.destroy(),p(this,rt).collisionSystem.destroy(),p(this,rt).interactionSystem.destroy(),p(this,rt).domMutationSystem.destroy(),p(this,rt).geometryInFocusSystem.destroy(),V(this,rt,void 0),p(this,xu)!=="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,ml)),this.container.removeChild(p(this,Br)),V(this,Ti,void 0))},"destroy"));F(this,am,new zt);F(this,c1,new zt);if(p(this,nt).useStandaloneCamera=(S=n.useStandaloneCamera)!=null?S:!1,p(this,nt).naturalBearing=(I=n.naturalBearing)!=null?I:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!t.clientWidth||!t.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(n.mode==="outdoors-interleaved"||n.mode==="outdoors-overlay")&&n.map&&(V(this,xu,n.mode),this.map=n.map),p(this,nt).entityScene.addEventListener("childadded",()=>{p(this,Gr).call(this),p(this,Kn).call(this)}),p(this,nt).entityScene.addEventListener("childremoved",()=>{p(this,Gr).call(this),p(this,Kn).call(this)}),p(this,nt).geometry3DMap.set(p(this,nt).entityScene.userData.entityId,p(this,nt).entityScene),n.center&&(p(this,nt).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=t,gt(this,Hi,YO).call(this),gt(this,Hi,qO).call(this),p(this,rt).htmlControlsSystem=new Ix(this.container),p(this,xu)!=="outdoors-overlay"&&p(this,rt).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),T.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),V(this,Ti,new rb({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:u(k=>{var tt;(tt=n.onWebGLContextRestored)==null||tt.call(n,k),p(this,Kn).call(this),p(this,Gr).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(P=n.backgroundAlpha)!=null?P:1})),V(this,In,new nc),p(this,xu)!=="standalone"&&p(this,In).add(tP()),p(this,In).add(p(this,nt).entityScene);let i=window.__THREE_DEVTOOLS__;T.env.NODE_ENV==="dev"&&typeof i<"u"&&(i.dispatchEvent(new CustomEvent("observe",{detail:p(this,In)})),i.dispatchEvent(new CustomEvent("observe",{detail:p(this,Ti)}))),V(this,bn,new R2(_W,this.aspect,50,1e5)),p(this,nt).cameraObject=p(this,bn),V(this,t1,new gT),p(this,bn).renderOrder=999;let a=new Gl;a.add(p(this,bn)),V(this,im,new Gl),p(this,im).add(a),p(this,In).add(p(this,im)),p(this,bn).updateProjectionMatrix(),p(this,bn).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:u(()=>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,Ti).domElement(),V(this,nm,new ne);let l=new $s(1e6,1e6),h=new Tn({color:0,visible:!1});V(this,Fc,new ue(l,h)),p(this,Fc).name="worldPlane",p(this,In).add(p(this,Fc)),(E=n.gl)!=null&&E.canvas||t.appendChild(this.rendererDomElement),window.addEventListener("resize",p(this,i1),!1),p(this,e1).addEventListener("change",p(this,n1)),typeof ResizeObserver=="function"&&((O=T.env)==null?void 0:O.NODE_ENV)!=="test"&&(V(this,zh,new ResizeObserver(GT(k=>{p(this,om).call(this,k[0].contentRect.width,k[0].contentRect.height)},50))),(N=p(this,zh))==null||N.observe(t)),t.classList.add("mappedin-map"),this.rendererDomElement.style.width=(L=globalThis.MappedinDebug)!=null&&L.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(G=globalThis.MappedinDebug)!=null&&G.TEST_IOS?"1920px":"100%",T.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),p(this,nt).canvasWidth=this.rendererDomElement.clientWidth,p(this,nt).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let d=this.canvasWidth,m=this.canvasHeight;p(this,rt).watermarkSystem=new xx(p(this,bn),p(this,nt),n==null?void 0:n.watermark),p(this,rt).watermarkSystem.on("texture-loaded",this.render),p(this,nt).shouldMeasureCanvas=!0,p(this,nt).pixelRatio=this.resolutionScale,p(this,a1).call(this,Math.floor(d*this.resolutionScale),Math.floor(m*this.resolutionScale));let v=new O0(16777215,.3*Math.PI);v.position.set(-150,-150,350),p(this,In).add(v);let x=new CT(16777215,.741*Math.PI);p(this,In).add(x),p(this,rt).cameraSystem=new Kd(p(this,bn),p(this,In),p(this,Ti).renderer,p(this,nt),{mode:this.mode,canvasHeight:m,canvasWidth:d}),p(this,rt).cameraSystem.on("user-dolly-start",p(this,Po)),p(this,rt).cameraSystem.on("user-pan-start",p(this,Po)),p(this,rt).cameraSystem.on("user-rotate-start",p(this,Po)),p(this,rt).cameraSystem.on("user-zoom-start",p(this,Po)),p(this,rt).cameraSystem.on("user-tilt-start",p(this,Po)),p(this,rt).cameraSystem.on("user-pedestal-start",p(this,Po)),p(this,rt).cameraSystem.on("user-dolly-end",p(this,Eo)),p(this,rt).cameraSystem.on("user-pan-end",p(this,Eo)),p(this,rt).cameraSystem.on("user-rotate-end",p(this,Eo)),p(this,rt).cameraSystem.on("user-zoom-end",p(this,Eo)),p(this,rt).cameraSystem.on("user-tilt-end",p(this,Eo)),p(this,rt).cameraSystem.on("user-pedestal-end",p(this,Eo)),p(this,rt).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),p(this,rt).geometryInFocusSystem&&(p(this,rt).geometryInFocusSystem.cameraDirty=!0),this.render()}),p(this,rt).pathSystem=new Ky(p(this,nt),this.convertTo3DMapPosition,this.getParentContainer,p(this,rt).cameraSystem.convertZoomLevelToAltitude),p(this,rt).pathSystem.on("animate:path",this.render),p(this,rt).panBoundsSystem=new Sx(p(this,nt),p(this,rt).cameraSystem),p(this,rt).panBoundsSystem.on("update",()=>{let{panBounds:k,fov:tt,convertAltitudeToZoomLevel:ut}=p(this,rt).cameraSystem;if(p(this,rt).panBoundsSystem.autoMinZoomLevel){if(k.radius<=0)return;let at=Math.min(p(this,nt).canvasWidth/p(this,nt).canvasHeight,1),H=tt*Math.PI/180*at,St=Math.tan(H/2),{radius:pt,center:ct}=p(this,rt).cameraSystem.panBounds,It=pt/St,Et=this.getThreeCamera().getWorldPosition(new zt),dt=ct.distanceTo(Et),bt=Math.abs(Et.z-ct.z),Z=It*bt/dt,te=ut(Z);KT(te,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(te)}this.publish("pan-bounds-change",p(this,rt).cameraSystem.panBounds)}),this.camera=new bx(this,p(this,rt),p(this,nt)),this.camera.setZoomLevel((j=n.zoomLevel)!=null?j:nM),this.camera.setBearing(($=n.bearing)!=null?$:rM),this.camera.setPitch((q=n.pitch)!=null?q:eM),this.camera.setMaxZoomLevel(xW),this.camera.setMinZoomLevel(bW),p(this,rt).domVisiblitySystem=new tx(p(this,nt),p(this,ml)),p(this,rt).domMutationSystem=new vx(p(this,nt),p(this,ml)),p(this,rt).domMutationSystem.on("dimensions-update",()=>{p(this,rt).collisionSystem.collidersDirty=!0,this.render()}),p(this,rt).domDrawSystem=new gx(p(this,nt)),p(this,rt).collisionSystem=new nb(p(this,ha),p(this,nt)),p(this,rt).twoDDrawSystem=new rx(p(this,nt),p(this,Mn),n.transformImageRequest),p(this,rt).twoDDrawSystem.on("img:loaded",this.render),p(this,rt).interactionSystem=new ny(this.rendererDomElement,p(this,nt),p(this,bn),p(this,Fc),p(this,rt).cameraSystem.isUserInteracting),p(this,rt).interactionSystem.on("doubletap-with-onefinger",k=>{var tt;this.camera.animateTo({center:(tt=this.projectScreenXYToCoordinate(k.clientX,k.clientY))==null?void 0:tt.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:z2,easing:"ease-out"})}),p(this,rt).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:z2,easing:"ease-out"})}),p(this,rt).interactionSystem.on("hover",this.render),p(this,rt).interactionSystem.on("click",k=>{var ut,at,H,St,pt,ct,It,Et,dt,bt,Z,te;if(((ut=k.entity2D)==null?void 0:ut.id)==="watermark"&&typeof p(this,rt).watermarkSystem.options.onClick=="function"&&p(this,rt).watermarkSystem.options.interactive){p(this,rt).watermarkSystem.options.onClick();return}let tt=k.entity3D?[(at=k.entity3D)==null?void 0:at.id]:[];(pt=(St=(H=k.entity3D)==null?void 0:H.parentObject3D)==null?void 0:St.userData)!=null&&pt.entityId&&tt.push((Et=(It=(ct=k.entity3D)==null?void 0:ct.parentObject3D)==null?void 0:It.userData)==null?void 0:Et.entityId),this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(k.position),geometry:tt,paths:((dt=k.entity3D)==null?void 0:dt.components[0])instanceof Nc?[k.entity3D.id]:[],markers:((bt=k.entity2D)==null?void 0:bt.components[0])instanceof ll?[k.entity2D.id]:[],models:((Z=k.entity3D)==null?void 0:Z.components[0])instanceof Dc?[k.entity3D.id]:[],labels:((te=k.entity2D)==null?void 0:te.components[0])instanceof ul?[k.entity2D.id]:[],containers:Array.isArray(k.groupContainers)?k.groupContainers.map(jt=>jt.userData.entityId):[],pointerEvent:k.pointerEvent})}),p(this,rt).interactionSystem.on("hover",k=>{var tt,ut,at,H,St,pt;k.position&&((tt=k.entity2D)==null?void 0:tt.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(k.position),geometry:k.entity3D?[(ut=k.entity3D)==null?void 0:ut.id]:[],paths:((at=k.entity3D)==null?void 0:at.components[0])instanceof Nc?[k.entity3D.id]:[],markers:((H=k.entity2D)==null?void 0:H.components[0])instanceof ll?[k.entity2D.id]:[],models:((St=k.entity3D)==null?void 0:St.components[0])instanceof Dc?[k.entity3D.id]:[],labels:((pt=k.entity2D)==null?void 0:pt.components[0])instanceof ul?[k.entity2D.id]:[],containers:Array.isArray(k.groupContainers)?k.groupContainers.map(ct=>ct.userData.entityId):[]})}),p(this,rt).geometryInFocusSystem=new Ax(p(this,nt),p(this,bn)),p(this,rt).geometryInFocusSystem.on("geometry-in-focus",k=>{this.publish("geometry-in-focus",k)}),p(this,rt).twoDVisiblitySystem=new ix(p(this,nt)),p(this,rt).drawSystem=new nx(p(this,nt),this.convertTo3DMapPosition),p(this,rt).drawSystem.on("texture-loaded",this.render),p(this,rt).stackSystem=new sx(p(this,nt)),p(this,rt).twoDProjectionSystem=new ex(p(this,nt),p(this,s1)),p(this,rt).exporterSystem=new My(p(this,nt)),p(this,rt).meshOptimizationSystem=new Qb(p(this,nt),this.convertTo3DMapPosition),p(this,rt).meshOptimizationSystem.on("model-loaded",this.render),p(this,rt).meshOptimizationSystem.on("geometry-2d-added",this.render),p(this,rt).meshOptimizationSystem.on("geometry-group-added",p(this,Yx)),p(this,rt).meshDetachmentSystem=new Fx(p(this,nt)),p(this,rt).meshModificationSystem=new Bx(p(this,nt)),p(this,rt).geometryDisposalSystem=new Xx(p(this,nt)),p(this,rt).customGeometrySystem=new Mx(p(this,nt),this.convertTo3DMapPosition),p(this,rt).outlineInterpolationSystem=new Tx(p(this,nt)),p(this,rt).renderSystem=new ox(p(this,Ti),p(this,nt),this.mode,p(this,In),p(this,bn),this.viewCamera,p(this,rt)),p(this,rt).imageSystem=new Lx(p(this,nt),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),p(this,rt).text3DSystem=new Rb(p(this,nt),this.convertTo3DMapPosition),p(this,rt).text3DSystem.on("render",this.render),p(this,rt).imageSystem.on("image-loaded",this.render),p(this,rt).renderSystem.on("pre-render",()=>this.publish("pre-render")),p(this,rt).renderSystem.on("post-render",()=>this.publish("post-render")),p(this,rt).renderSystem.on("measure-canvas",p(this,sm)),p(this,rt).outdoorLayersSystem=new Nx(this.map),p(this,rt).occlusion2DSystem=new Hx(p(this,nt),this.convertTo3DMapPosition,p(this,Ti)),n.occlusionEnabled&&p(this,rt).occlusion2DSystem.enable(),this.Debug=new zx(this),n.environment!==!1&&V(this,Uh,gt(this,Hi,tM).call(this)),p(this,qx).call(this)}get viewCamera(){return p(this,t1)}get canvasWidth(){return p(this,nt).canvasWidth}get canvasHeight(){return p(this,nt).canvasHeight}get resolutionScale(){var t,n;return(n=(t=this.map)==null?void 0:t._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:Rf()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return p(this,xu)}addGroupContainer(t,n,i){if(!p(this,nt).geometry3DMap.has(t)&&!p(this,nt).geometry2DMap.has(t)){let a=new Er(t);a.addEventListener("childadded",()=>{p(this,Gr).call(this),p(this,Kn).call(this)}),a.addEventListener("childremoved",()=>{p(this,Gr).call(this),p(this,Kn).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&&wi(a,n.interactive,p(this,nt)),(n==null?void 0:n.focusable)!==void 0&&Gb(a,n.focusable),(n==null?void 0:n.preloadGeometry)!==void 0&&(a.userData.preloadGeometry=n.preloadGeometry),p(this,nt).geometry3DMap.set(t,a);let l=this.getParentContainer(i);l instanceof Er&&l.addEntity(a),p(this,Gr).call(this),this.render()}else K.error("Group container with ID '".concat(t,"' already exists. The group container cannot be added."));return{id:t,type:"group-container"}}addStackContainer(t,n,i){if(p(this,nt).geometry3DMap.has(t))K.error("Stack container with ID '".concat(t,"' already exists. The stack container cannot be added."));else{let a=new Er(t);a.addEventListener("childadded",()=>{p(this,Gr).call(this),p(this,Kn).call(this)}),a.addEventListener("childremoved",()=>{p(this,Gr).call(this),p(this,Kn).call(this)}),a.components[0]=new yx,(n==null?void 0:n.visible)!==void 0&&(a.visible=n.visible),p(this,nt).geometry3DMap.set(t,a);let l=this.getParentContainer(i);l instanceof Er&&l.addEntity(a)}return{id:t,type:"stack-container"}}addCustomGeometry(t,n,i,a,l){if(p(this,nt).geometry3DMap.has(t))K.error("Custom geometry with ID '".concat(t,"' already exists. The custom geometry cannot be added."));else{let h=new tm(n,i),d=new Sr(h,new Va(a));(a==null?void 0:a.interactive)!==void 0&&wi(d,a.interactive,p(this,nt)),d.id=t,h.mesh.userData={entityId:t,type:"custom-geometry"},p(this,nt).geometry3DMap.set(d.id,d);let m=this.getParentContainer(l);m instanceof Er&&m.addEntity(d),p(this,Gr).call(this),this.render()}return{id:t,type:"custom-geometry"}}addGeometryGroup(t,n,i,a){var l,d;if(!p(this,nt).geometry3DMap.has(t)&&!p(this,nt).geometry2DMap.has(t)){let m=new ro(t,new j2(i));m.addEventListener("childadded",()=>{p(this,Gr).call(this),p(this,Kn).call(this)}),m.addEventListener("childremoved",()=>{p(this,Gr).call(this),p(this,Kn).call(this)}),m.userData.dirty=!0,p(this,nt).geometry3DMap.set(t,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)||((l=x==null?void 0:x.properties)==null?void 0:l.id)||Mr(),h=i||{color:RT},{visible:I,altitude:w}=h,P=Zs(h,["visible","altitude"]),E=p(this,rt).meshOptimizationSystem.createEntityFromFeature(S,x,et(z({},P),{outline:!0}));p(this,nt).geometry3DMap.set(S,E),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,Gr).call(this),this.render()}else K.error("Geometry group with ID '".concat(t,"' already exists. The geometry group cannot be added."));return p(this,rt).outlineInterpolationSystem.geometries3DDirty=!0,{id:t,type:"geometry-group"}}addOccluder(t,n){let i=this.getParentContainer(n),a=p(this,rt).occlusion2DSystem.reserveOccluderId();return i==null||i.addOccluderFeature(t,a),a}addImage(t,n,i,a){try{kO(t,n,i)}catch(l){K.error(l);return}if(!p(this,nt).geometry3DMap.has(t)&&!p(this,nt).geometry2DMap.has(t)){let l=new Dx(n),h=new Sr(l,new Va(i));h.id=t||Mr(),l.mesh.userData={entityId:h.id,type:"path"},p(this,nt).geometry3DMap.set(h.id,h);let d=this.getParentContainer(a);d instanceof Er&&d.addEntity(h),p(this,Gr).call(this),this.render()}else K.error("Image with ID '".concat(t,"' already exists. The image cannot be added."));return{id:t,type:"image"}}addModelGroup(t,n,i,{parent:a,onComplete:l}={}){var h,d;try{hO(t,n,i)}catch(m){K.error(m);return}if(!p(this,nt).geometry3DMap.has(t)&&!p(this,nt).geometry2DMap.has(t)){let m=new ro(t,new j2(et(z({},i),{outline:!1})));m.addEventListener("childadded",()=>{p(this,Gr).call(this),p(this,Kn).call(this)}),m.addEventListener("childremoved",()=>{p(this,Gr).call(this),p(this,Kn).call(this)}),p(this,nt).geometry3DMap.set(t,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,rt).meshOptimizationSystem.createModelFromFeature(S,x,i);(x.properties.interactive!==void 0||i.interactive!=null)&&wi(I,(h=x.properties.interactive)!=null?h:i.interactive,p(this,nt)),p(this,nt).geometry3DMap.set(S,I),m.userData.entities3D.add(S)}let v=this.getParentContainer(a);v instanceof Er&&v.addEntity(m),p(this,Gr).call(this),(d=this.render())==null||d.then(l)}else K.error("Model group with ID '".concat(t,"' already exists. The model group cannot be added."));return{id:t,type:"geometry-group"}}addMarker2D(t,n,i,a){var h;let l=i==null?void 0:i.id;try{D9(t,n,i||{})}catch(d){K.error(d);return}if(l===void 0||!p(this,nt).geometry2DMap.has(l)&&!p(this,nt).geometry3DMap.has(l)){let d=gt(this,Hi,QI).call(this,t,new ll(n,i),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);d.id=l||String(d.id),l=d.id,(i==null?void 0:i.interactive)!=null&&i.interactive!=="pointer-events-auto"&&wi(d,i==null?void 0:i.interactive,p(this,nt));let m=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?p(this,nt).geometry3DMap.get(i.attachTo):void 0;m instanceof Sr&&m.attach(d),(h=this.getParentContainer(a))==null||h.addEntity(d),this.render()}else K.error("Marker2D with ID '".concat(l,"' already exists. The marker cannot be added."));return{id:l,type:"marker"}}addText3D(t,n,i,a){if(!p(this,nt).geometry3DMap.has(t)&&!p(this,nt).geometry2DMap.has(t)){let l=new Tc(et(z({},n),{properties:et(z({},n.properties),{id:t,content:n.properties.text})})),h=new Sr(l,new ig(i==null?void 0:i.appearance));h.id=t,l.mesh.userData.entityId=t.toString(),l.mesh.userData.type="text3d",p(this,nt).geometry3DMap.set(t,h);let d=this.getParentContainer(a);d instanceof Er&&d.addEntity(h),p(this,Gr).call(this),this.render()}else K.error("Text3D with ID '".concat(t,"' already exists. The text3d cannot be added."));return{id:t,type:"text3d"}}labelText3D(t,n,i={}){var m,v;try{if(!n||!t)throw new Error("content and meshGeometryId are required");w8.parse(i)}catch(x){K.error(x);return}let a=p(this,nt).geometry3DMap.get(t);if((a==null?void 0:a.type)!=="geometry"){K.error(".labelText3D failed: target incorrect");return}let l=a==null?void 0:a.components[0];if(!l.feature.properties.textArea)return;if(l.textEntityId){let x=p(this,nt).geometry3DMap.get(l.textEntityId);if((x==null?void 0:x.type)!=="text3d"){K.error(".labelText3D failed: existing text3d not found");return}return{id:x.id,type:x.type}}let h=new Tc({type:"Feature",geometry:{coordinates:(m=l.feature.properties.textArea)==null?void 0:m.position,type:"Point"},properties:{textArea:l.feature.properties.textArea,content:n,id:Mr()}});h.polygonEntityId=t;let d=new Sr(h,new ig(i==null?void 0:i.appearance));return l.textEntityId=d.id.toString(),h.mesh.userData.entityId=d.id.toString(),h.mesh.userData.type="text3d",p(this,nt).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(t,n,i,a){var h;let l=i==null?void 0:i.id;try{x8(t,n,i||{})}catch(d){K.error(d);return}if(l===void 0||!p(this,nt).geometry2DMap.has(l)&&!p(this,nt).geometry3DMap.has(l)){let d=gt(this,Hi,QI).call(this,t,new ul(n,i||{},p(this,nt)),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);d.id=l||String(d.id),l=d.id,(i==null?void 0:i.interactive)!=null&&wi(d,i==null?void 0:i.interactive,p(this,nt));let m=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?p(this,nt).geometry3DMap.get(i.attachTo):void 0;m instanceof Sr&&m.attach(d),(h=this.getParentContainer(a))==null||h.addEntity(d),p(this,Kn).call(this),this.render()}else K.error("Label2D with ID '".concat(l,"' already exists. The label cannot be added."));return{id:l,type:"label"}}addPath(t,n={},i){var d;try{gO(t,n||{})}catch(m){K.error(m);return}let a=new Nc(t,Y3(n)),l=new Sr(a,new Va({color:(d=n==null?void 0:n.color)!=null?d:"#ff834c"}));l.id=(n==null?void 0:n.id)||Mr(),a.mesh.userData={entityId:l.id,type:"path"},p(this,nt).geometry3DMap.set(l.id,l),(n==null?void 0:n.interactive)!=null&&wi(l,n==null?void 0:n.interactive,p(this,nt));let h=this.getParentContainer(i);return h instanceof Er&&h.addEntity(l),p(this,Gr).call(this),this.render(),{id:l.id,type:"path"}}updateWatermark(t){p(this,rt).watermarkSystem.options=t,p(this,rt).watermarkSystem.dirty=!0,p(this,rt).collisionSystem.collidersDirty=!0,this.render()}remove(t){var i;let n;if(typeof t=="string"||typeof t=="number"?(n=p(this,nt).geometry2DMap.get(t),n==null&&(n=p(this,nt).geometry3DMap.get(t))):typeof t.id=="string"||typeof t.id=="number"?(n=p(this,nt).geometry2DMap.get(t.id),n==null&&(n=p(this,nt).geometry3DMap.get(t.id))):n=t,n!=null){if(n.type==="custom-geometry")p(this,nt).geometry3DMap.delete(n.id),n.object3d&&Zr(n.object3d);else if(n.type==="group-container"){p(this,nt).geometry3DMap.delete(n.userData.entityId);for(let l of n.childrenIds.values())this.remove(l),n.userData.entities2D.delete(l);let a=n.components[2];a&&a.focusMesh&&Zr(a.focusMesh),Zr(n)}else if(n.type==="geometry-group"){p(this,nt).geometry3DMap.delete(n.userData.entityId);for(let a of n.userData.entities3D.values())this.remove(a),n.userData.entities3D.delete(a);Zr(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let a=n.components[0],l=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),Zr(n.object3d)),n.type==="geometry"){let h=n.components[3];h&&(h.visible=!1,h.dirty=!0)}l&&"focusMesh"in l&&l.focusMesh!=null&&Zr(l.focusMesh),"textMesh"in a&&a.textMesh!=null&&this.remove(a.textMesh.userData.entityId),p(this,nt).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let a=n.attachedTo;if(a){let l=p(this,nt).geometry3DMap.get(a);l instanceof Sr&&l.detach(n)}n.object3d&&Zr(n.object3d),n.type==="label"&&delete p(this,rt).twoDDrawSystem.textCache[n.id],p(this,nt).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&Zr(n.object3d),p(this,nt).geometry3DMap.delete(n.id);else if(n.type==="text3d"){Zr(n.object3d);let{batchedText:a,textMesh:l,polygonEntityId:h}=n.components[0];if(l&&(a&&a.removeText(l),Zr(l)),h){p(this,rt).text3DSystem.remove(h);let d=p(this,nt).geometry3DMap.get(h);(d==null?void 0:d.type)==="geometry"&&(d.components[0].textMesh=void 0,d.components[0].textEntityId=void 0)}p(this,nt).geometry3DMap.delete(n.id)}p(this,Gr).call(this),p(this,Kn).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return p(this,In)}getThreeCamera(){return p(this,bn)}async setEnvironment(t){if(p(this,In))if(t==="basic"){p(this,Uh)||V(this,Uh,gt(this,Hi,tM).call(this));let n=await p(this,Uh);p(this,In).environment=n}else p(this,In).environment=null}getEnvironment(){var t;return(t=p(this,In))!=null&&t.environment?"basic":!1}getCurrentSceneGLTF(t){return p(this,rt).exporterSystem.getCurrentSceneGLTF(t)}getBoundingArea(t){(p(this,rt).renderSystem.threeDdirty||p(this,rt).renderSystem.twoDdirty)&&this.renderSync();let n=new _n;if(t==null)n.setFromObject(p(this,nt).entityScene);else{let i=kf(p(this,nt),t);if((i==null?void 0:i.type)==="geometry"&&(i==null?void 0:i.object3d)!=null){let a=i.components[0],l=a instanceof kn?a.geometry:void 0;a.mesh instanceof T0&&l?(l.computeBoundingBox(),l.boundingBox&&n.union(l.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(xs(n))return jT(n).map(this.convert3DMapPositionToCoordinate)}hasState(t){return kf(p(this,nt),t)!=null}getState(t){var i,a,l,h,d,m,v,x,S,I;if(t==null)return{type:"map-view",hoverColor:p(this,nt).hoverColor,text3dHoverColor:p(this,nt).text3dHoverColor};let n=kf(p(this,nt),t);if((n==null?void 0:n.type)==="custom-geometry"){let w=n.components[0],P=n.components[1];return{id:n.id,type:"custom-geometry",visible:P.visible,altitude:P.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 E of n.userData.entities3D.values()){let O=this.getState(E);((O==null?void 0:O.type)==="geometry"||(O==null?void 0:O.type)==="model")&&w.push(O)}let P=n.components[0];return{id:n.userData.entityId,type:"geometry-group",visible:n.visible,opacity:P.opacity,color:P.color,initialColor:P.initialColor,height:P.height,altitude:n.altitude,topColor:P.topColor,outline:P.outline,shading:P.shading,texture:P.texture,topTexture:P.topTexture,interactive:Array.from(n.userData.entities3D.values()).map(E=>p(this,nt).geometry3DMap.get(E)).every(E=>E&&E.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(E=>this.getState(E)).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],P=n.object3d.parent,E=P==null?void 0:P.userData.entityId;return{id:n.id,type:"label",text:w.text||"",parent:{id:E,type:P==null?void 0:P.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:w.enabled,visible:w.visible,initialRank:ry(w.initialRank),options:{rank:ry(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],P=n.object3d.parent,E=P==null?void 0:P.userData.entityId;return{id:n.id,type:"marker",enabled:w.enabled,visible:w.visible,anchor:w.options.anchor,dynamicResize:w.options.dynamicResize,parent:{id:E,type:P==null?void 0:P.type},position:this.convert3DMapPositionToCoordinate(n.position),element:w.containerEl,initialRank:ry(w.initialRank),contentHTML:w.contentHtml,options:{rank:ry(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:P,initialColor:E,initialTopColor:O,topColor:N,altitude:L}=n.components[1],G=n.components[0],j=n.components[2],$=n.components[1],q=n.components[2],k=n.components[3],tt=n.parentObject3D;return{id:n.id,type:"geometry",opacity:$.opacity,initialColor:E,color:w,focusable:j!=null&&j.focusMesh!=null,initialTopColor:O,topColor:N,hoverColor:P,hovered:!!(q!=null&&q.hover),height:$.height,visible:$.visible,outline:k==null?void 0:k.visible,showImage:$.showImage,texture:$.texture,topTexture:$.topTexture,flipImageToFaceCamera:$.flipImageToFaceCamera,parent:{id:tt==null?void 0:tt.userData.entityId,type:tt==null?void 0:tt.type},altitude:L,position:this.convert3DMapPositionToCoordinate(G.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let w=n.components[0],P=n.components[1],E=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:E!=null,material:P.material,parent:(l=n.parentObject3D)!=null&&l.parent?{id:n.parentObject3D.parent.userData.entityId,type:n.parentObject3D.parent.type}:void 0,visible:P.visible,verticalOffset:P.verticalOffset,color:P.color,opacity:P.opacity,rotation:(h=P.rotation)!=null?h:Vf,scale:(d=P.scale)!=null?d:Gf}}else if((n==null?void 0:n.type)==="path"){let w=n.components[0],P=n.components[2],E=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(w.position),visible:E.visible,interactive:P!=null,completeFraction:w.completeFraction,color:E.color,accentColor:w.accentColor,nearRadius:w.nearRadius,farRadius:w.farRadius,animateArrowsOnPath:w.animateArrowsOnPath,displayArrowsOnPath:w.displayArrowsOnPath,nearZoomLevel:w.nearZoomLevel,farZoomLevel:w.farZoomLevel,altitude:E.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 Tc&&"textArea"in n.components[0].feature.properties){Y8(n);let w=n.components[0],P=n.components[1],{textMesh:E}=w,O=(v=w.mesh)==null?void 0:v.parent;O instanceof Er&&((x=O.children.find(G=>G.type==="batchedtext"))==null||x.getWorldPosition(p(this,c1))),p(this,am).set(0,0,0);let N=E?E.getWorldPosition(p(this,am)):p(this,am);return Object.assign({},Bf,P.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(N.add(p(this,c1))),visible:(S=w.visible)!=null?S:!1,content:(I=w.feature.properties.content)!=null?I:""})}else return}}setState(t,n){var a,l;if(typeof t=="object"&&n==null){"hoverColor"in t&&(ng(t.hoverColor)?p(this,nt).hoverColor=(a=t.hoverColor)!=null?a:p(this,nt).hoverColor:K.warn('Failed to update global hover color. Invalid color "'.concat(t.hoverColor,'".'))),"text3dHoverColor"in t&&(p(this,nt).text3dHoverColor=(l=t.text3dHoverColor)!=null?l:p(this,nt).text3dHoverColor);return}let i=kf(p(this,nt),t);if(i!=null){if(i.type==="custom-geometry"){let h=p(this,nt).geometry3DMap.get(i.id);if(h instanceof Sr&&h.components[0]instanceof tm){let d=n;cl(i,p(this,nt),d.visible),Yd(i,d.altitude),U3(i,d.position,this.convertTo3DMapPosition),z3(i,this.getParentContainer(d.parent,!1)),wi(i,d.interactive,p(this,nt))&&p(this,Gr).call(this)}}else if(i.type==="path"){let h=n;wi(i,h.interactive,p(this,nt))&&p(this,Gr).call(this),Yd(i,h.altitude),X8(i,p(this,nt),h)}else if(i.type==="model"){let h=n;wi(i,h.interactive,p(this,nt))&&p(this,Gr).call(this),cl(i,p(this,nt),h.visible),W8(i,h)}else if(i.type==="group-container"){let h=n;cl(i,p(this,nt),h.visible)&&(p(this,rt).outlineInterpolationSystem.outlineOpacitiesDirty=!0,p(this,rt).pathSystem.altitudeDirty=!0,p(this,rt).geometryInFocusSystem.focusablesDirty=!0),Yd(i,h.altitude)&&(p(this,rt).pathSystem.altitudeDirty=!0),wi(i,h.interactive,p(this,nt))&&p(this,Gr).call(this),X3(i,p(this,nt),h.opacity)&&(p(this,rt).outlineInterpolationSystem.outlineOpacitiesDirty=!0),h.preloadGeometry&&i.userData.preloadGeometry!==!0&&(i.userData.preloadGeometry=!0,p(this,rt).outlineInterpolationSystem.geometries3DDirty=!0),Gb(i,h.focusable)&&(p(this,rt).geometryInFocusSystem.focusablesDirty=!0)}else if(i.type==="geometry-group"){let h=n;cl(i,p(this,nt),h.visible)&&(p(this,rt).outlineInterpolationSystem.outlineOpacitiesDirty=!0),D8(i,p(this,nt),h),Bb(i,p(this,nt),h.outline),h.height!=null&&V3(i,p(this,nt),h.height),Yd(i,h.altitude),j8(i,h),L8(i,h.shading),X3(i,p(this,nt),h.opacity)&&(p(this,rt).outlineInterpolationSystem.outlineOpacitiesDirty=!0),wi(i,h.interactive,p(this,nt))&&(p(this,Gr).call(this),p(this,Kn).call(this))}else if(i.type==="geometry"){if(i.components[0]instanceof kn){let h=n;cl(i,p(this,nt),h.visible)&&(p(this,rt).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Bb(i,p(this,nt),h.outline),A8(i,h),Gb(i,h.focusable)&&(p(this,rt).geometryInFocusSystem.focusablesDirty=!0),H8(i,h.renderOrder)&&(p(this,rt).meshDetachmentSystem.dirty=!0),z8(i,h.opacity)&&(p(this,rt).meshDetachmentSystem.dirty=!0,p(this,rt).interactionSystem.dirty3D=!0,p(this,rt).outlineInterpolationSystem.outlineOpacitiesDirty=!0),H3(i,h.flipImageToFaceCamera),Yd(i,h.altitude),h.height!=null&&V3(i,p(this,nt),h.height),U8(i,h)&&(p(this,rt).meshDetachmentSystem.dirty=!0),j3(i,h),B8(i,h.hoverColor),wi(i,h.interactive,p(this,nt)),G8(i,h.hovered)}p(this,Gr).call(this)}else if(i.type==="label"||i.type==="marker"){let h=n;F8(i,n,p(this,nt)),k8(i,n,p(this,nt))&&(p(this,Kn).call(this),p(this,rt).domMutationSystem.dirty=!0),U3(i,h.position,this.convertTo3DMapPosition),z3(i,this.getParentContainer(h.parent,!1))&&(p(this,Kn).call(this),p(this,rt).panBoundsSystem.dirty=!0),N8(i,h.enabled),cl(i,p(this,nt),h.visible)}else if(i.type==="image"){let h=n;cl(i,p(this,nt),h.visible),H3(i,h.flipImageToFaceCamera)}else if(i.type==="text3d"){let h=n;q8(i,p(this,nt),h)}this.render()}}convertTo3DMapPosition(t,n,i=0,a){var d,m,v,x,S;if(Array.isArray(t))return this.convertTo3DMapPosition(t[1],t[0],(d=t[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:l,y:h}=j0((v=(m=p(this,nt).center)==null?void 0:m[1])!=null?v:0,(S=(x=p(this,nt).center)==null?void 0:x[0])!=null?S:0,t,n);return a?(a.set(l,h,i),a):new zt(l,h,i)}get backgroundColor(){return typeof p(this,Ti).backgroundColor=="string"?p(this,Ti).backgroundColor:"#".concat(p(this,Ti).backgroundColor.getHexString())}get backgroundAlpha(){return p(this,Ti).backgroundAlpha}getThreeRenderer(){return p(this,Ti)}getCenter(t){let n=Array.isArray(t)?t:this.getBoundingArea(t);return n?JT(n):void 0}isInView(t){let n=kf(p(this,nt),t);if(p(this,l1).identity().multiply(p(this,bn).projectionMatrix).multiply(p(this,bn).matrixWorldInverse),p(this,Hh).setFromProjectionMatrix(p(this,l1)),n instanceof fp)return p(this,Hh).containsPoint(n.position);if(n instanceof Sr){let i=n==null?void 0:n.components[0];if(i instanceof tm||i instanceof Dc)return p(this,Hh).containsPoint(this.convertTo3DMapPosition(i.feature.geometry.coordinates));if(i instanceof kn){let a=new _n(this.convertTo3DMapPosition(i.featureBbox[1],i.featureBbox[0],0),this.convertTo3DMapPosition(i.featureBbox[3],i.featureBbox[2],0));return p(this,Hh).intersectsBox(a)}}return!1}getSystems(){return p(this,rt)}getInternalState(){return p(this,nt)}getInternalTweenGroup(){return p(this,nt).internalTweenGroup}getExternalTweenGroup(){return p(this,nt).externalTweenGroup}computeMinZOffsetBetweenContainers(t,n,i){if(!t||!n)return-1;Vl(t,"group-container"),Vl(n,"group-container");let a=z0(t,this.getThreeCamera()),l=n.clone(),h=z0(l,this.getThreeCamera());if(!xs(a)||!xs(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,l.position.z=d,l.updateMatrixWorld(),h.makeEmpty(),z0(l,p(this,bn),h),m=a.intersectsBox(h),i){let v=Y2(a,"blue",this.container),x=Y2(h,m?"red":"green",this.container);v.classList.add("debug-box"),x.classList.add("debug-box")}}while(m);return d}};In=new WeakMap,bn=new WeakMap,Uh=new WeakMap,t1=new WeakMap,nm=new WeakMap,Fc=new WeakMap,zh=new WeakMap,im=new WeakMap,Hi=new WeakSet,KI=u(function(t){var n;p(this,xu)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(t)),p(this,nt).pixelRatio=this.resolutionScale},"#setResolutionScale"),nt=new WeakMap,Br=new WeakMap,ha=new WeakMap,Mn=new WeakMap,ml=new WeakMap,Ti=new WeakMap,rt=new WeakMap,e1=new WeakMap,Kn=new WeakMap,Gr=new WeakMap,YO=u(function(){V(this,Br,document.createElement("div")),p(this,Br).classList.add("mappedin__smart-collision-engine__container"),V(this,ha,document.createElement("canvas")),p(this,ha).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(p(this,Br)),V(this,Mn,document.createElement("canvas")),p(this,Mn).classList.add("mappedin__smart-collision-engine__container"),p(this,Mn).width=p(this,Br).clientWidth*this.resolutionScale,p(this,Mn).height=p(this,Br).clientHeight*this.resolutionScale,p(this,Mn).style.width=p(this,Br).clientWidth+"px",p(this,Mn).style.height=p(this,Br).clientHeight+"px",p(this,Br).appendChild(p(this,ha)),p(this,Br).appendChild(p(this,Mn)),p(this,ha).width=p(this,Br).clientWidth,p(this,ha).height=p(this,Br).clientHeight,p(this,Mn).width=p(this,Br).clientWidth*this.resolutionScale,p(this,Mn).height=p(this,Br).clientHeight*this.resolutionScale,p(this,Mn).style.width=p(this,Br).clientWidth+"px",p(this,Mn).style.height=p(this,Br).clientHeight+"px"},"#renderEntity2DContainer"),qO=u(function(){V(this,ml,document.createElement("div")),p(this,ml).classList.add("mappedin-2d-entities"),Object.assign(p(this,ml).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(p(this,ml))},"#renderEntityDOMContainer"),WO=u(function(){p(this,Mn).width=p(this,Br).clientWidth*this.resolutionScale,p(this,Mn).height=p(this,Br).clientHeight*this.resolutionScale,p(this,Mn).style.width=p(this,Br).clientWidth+"px",p(this,Mn).style.height=p(this,Br).clientHeight+"px",p(this,ha).width=p(this,Br).clientWidth,p(this,ha).height=p(this,Br).clientHeight,p(this,Mn).width=p(this,Br).clientWidth*this.resolutionScale,p(this,Mn).height=p(this,Br).clientHeight*this.resolutionScale,p(this,Mn).style.width=p(this,Br).clientWidth+"px",p(this,Mn).style.height=p(this,Br).clientHeight+"px",p(this,rt).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),xu=new WeakMap,Yx=new WeakMap,r1=new WeakMap,n1=new WeakMap,i1=new WeakMap,om=new WeakMap,qx=new WeakMap,o1=new WeakMap,s1=new WeakMap,a1=new WeakMap,sm=new WeakMap,QI=u(function(t,n,i,a){let l=new fp(n,this.convertTo3DMapPosition(t[1],t[0],t[2]||0),a);return l.occluderId=i!=null?i:p(this,rt).occlusion2DSystem.backgroundId,p(this,nt).geometry2DMap.set(l.id,l),l},"#createEntity2D"),Hh=new WeakMap,l1=new WeakMap,u1=new WeakMap,Po=new WeakMap,Eo=new WeakMap,tM=u(async function(){return Ac.load(O7).then(t=>{var n;return p(this,In)&&((n=p(this,In).environment)==null||n.dispose(),t.mapping=aT,p(this,In).environment=t,this.render()),t})},"#loadEnvMap"),am=new WeakMap,c1=new WeakMap,u(iM,"Core");var JI=iM,p1=JI;y();function CW(r,e){SW(r,e)(r.getScene(),e),IW(r,e),e.addFolder("Export").add({export:u(async()=>{let l=await r.getCurrentSceneGLTF({binary:!0}),h=new Blob([l],{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=e.addFolder("Camera"),a={get bearing(){return r.camera.bearing},set bearing(l){r.camera.setBearing(l)},get pitch(){return r.camera.pitch},set pitch(l){r.camera.setPitch(l)},get zoomLevel(){return r.camera.zoomLevel},set zoomLevel(l){r.camera.setZoomLevel(l)}};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)}u(CW,"mountSceneGraphVisualizer");function SW(r,e){let t=e;return u(function n(i,a){let l=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}),t.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:u(()=>{},"focus")};l.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))}),l.add(h,"visible"),i.type==="image"?l.add(h,"flipImageToFaceCamera"):(l.add(h,"interactive"),i.type==="path"&&l.add(h,"completeFraction",0,1,.1),i.type!=="model"&&(l.addColor(h,"color"),l.add(h,"outline"))),i.type==="geometry"&&(l.add(h,"height"),l.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}}),t.controllersRecursive().forEach(v=>v.updateDisplay()))},focus:u(()=>{},"focus")};l.add(h,"focus").onChange(()=>{let d=r.getState(i.id);(d==null?void 0:d.type)==="marker"&&r.camera.focusOn([d.position])}),l.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}}),t.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:et(z({},(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:et(z({},(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:et(z({},(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:et(z({},(x=(v=m.options.appearance)==null?void 0:v.marker)==null?void 0:x.backgroundColor),{inactive:d})}}}})},focus:u(()=>{},"focus")};l.add(h,"focus").onChange(()=>{let d=r.getState(i.id);(d==null?void 0:d.type)==="label"&&r.camera.focusOn([d.position])}),l.add(h,"interactive"),l.add(h,"text"),l.add(h,"Text Size",10,50),l.add(h,"Icon Size",10,50),l.addColor(h,"Text Color"),l.addColor(h,"Active Background Color"),l.addColor(h,"Inactive Background Color"),l.addColor(h,"Active Foreground Color"),l.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}),t.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}})}};l.add(h,"visible"),l.add(h,"opacity",0,1,.1),l.add(h,"interactive"),l.add(h,"outline"),l.add(h,"altitude",0,100,1),l.add(h,"shadingStart",0,1,.1),l.add(h,"shadingEnd",0,1,.1),l.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}),t.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}};l.add(h,"visible"),l.add(h,"interactive")}if(l.close(),i.children)for(let h of i.children.values())n(h,l)},"parseChild")}u(SW,"createParseChild");function IW(r,e){let t=e.addFolder("Watermark"),n={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};t.add(n,"padding",0,100,1),t.add(n,"scale",.5,1.5,.1),t.add(n,"color",["dark","light"]),t.add(n,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),t.add(n,"iconOnly"),t.onChange(()=>{r.updateWatermark(n)})}u(IW,"createWatermarkChild");y();y();y();y();y();y();var oM=class oM{constructor({origin:e,destination:t,distance:n=0,angle:i=0,pathWeight:a=0,multiplicativeDistanceWeightScaling:l=!0}){b(this,"origin");b(this,"destination");b(this,"distance");b(this,"angle");b(this,"weight");if(this.origin=e,this.destination=t,this.distance=n,this.angle=i,this.weight=a||0,l?e.properties.floor===t.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):e.properties.map===t.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.")}};u(oM,"Edge");var Xh=oM;y();y();y();y();function _u([r,e],[t,n]){let i=e-n,a=r-t;return(Math.atan2(a,i)+Math.PI*3)%(Math.PI*2)}u(_u,"getAngle");y();var MW=63710088e-1;function fa(r,e){let[t,n]=r.map(v=>v*Math.PI/180),[i,a]=e.map(v=>v*Math.PI/180),l=a-n,h=i-t,d=Math.sin(l/2)*Math.sin(l/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 MW*m}u(fa,"getDistance");y();y();function Wx(r,e,t,n){let[i,a]=r,[l,h]=e,[d,m]=t,[v,x]=n;if(a===h&&i===l||m===x&&d===v)return null;let S=(v-d)*(h-a)-(x-m)*(l-i);if(S===0)return null;let I=((x-m)*(i-d)-(v-d)*(a-m))/S,w=((h-a)*(i-d)-(l-i)*(a-m))/S;if(I<0||I>1||w<0||w>1)return null;let P=a+I*(h-a);return[i+I*(l-i),P]}u(Wx,"getLineIntersection");y();function sM(r,e,t,n){let i=ns(r,t/1e3,n),a=ns(e,t/1e3,n);return[i.geometry.coordinates,a.geometry.coordinates]}u(sM,"getOffsetLine");y();function aM(r){let e=r*(180/Math.PI);return e=e%360,e>180?e-=360:e<-180&&(e+=360),Object.is(e,-0)?0:e}u(aM,"radToDegNormalized");var ZO=111e3;function $O(r,e,t=[],n=0){let i=!0,a=r.geometry.coordinates,l=e.geometry.coordinates,h=aM(_u(a,l)-Math.PI/2),d=aM(_u(a,l)+Math.PI/2),m=n/ZO,v=n/(ZO*Math.cos(a[1]*Math.PI/180)),x=Math.min(a[1],l[1])-m,S=Math.max(a[1],l[1])+m,I=Math.min(a[0],l[0])-v,w=Math.max(a[0],l[0])+v;for(let P of t)if(!(Math.max(P[0][1],P[1][1])<x||Math.min(P[0][1],P[1][1])>S||Math.max(P[0][0],P[1][0])<I||Math.min(P[0][0],P[1][0])>w)){if(n>0){let E=sM(a,l,n,h),O=sM(a,l,n,d);if(Wx(E[0],E[1],P[0],P[1])||Wx(O[0],O[1],P[0],P[1])){i=!1;return}}else if(Wx(a,l,P[0],P[1])){i=!1;return}}return i}u($O,"hasLineOfSight");var Yh,Xi,lM,JO,KO,QO,tD,eD,rD,$x,uM=class uM{constructor({nodes:e,groupBy:t,multiplicativeDistanceWeightScaling:n}){F(this,Xi);b(this,"edges",{});b(this,"nodesById");b(this,"nodesByGroup",new Map);F(this,Yh);F(this,$x,u((e,t)=>{let n=0;for(let i of t)(!i[p(this,Yh)]||i[p(this,Yh)]===e.properties[p(this,Yh)])&&an(e.geometry.coordinates,i.geometry.geometry)&&(n+=Math.max(0,i.cost));return n},"#getZonalCost"));V(this,Yh,t);let{features:i}=e;this.nodesById=gt(this,Xi,JO).call(this,i),gt(this,Xi,KO).call(this),gt(this,Xi,QO).call(this,i,t,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(e,t){return t.reduce((n,i)=>{let a=fa(e.geometry.coordinates,i.geometry.coordinates);return Math.min(n,a)},Number.MAX_VALUE)}aStar({originIds:e,destinationNodeIds:t,excludedNodeIds:n,disabledConnectionNodeIds:i,zones:a,overrideEdgeWeights:l}){var S;let h=gt(this,Xi,lM).call(this,e),d=gt(this,Xi,lM).call(this,t);if(h.length===0||d.length===0)return[];let{frontier:m,cameFrom:v,costSoFar:x}=gt(this,Xi,tD).call(this,h,d);for(;m.length>0;){let I=m.shift();if(!I)break;if(gt(this,Xi,eD).call(this,I.origin,d))return gt(this,Xi,rD).call(this,v,I.origin.properties.id);for(let w of this.edges[I.origin.properties.id]){let P=(S=l==null?void 0:l.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 E=x[I.origin.properties.id]+P+p(this,$x).call(this,w.destination,a);if(!(E===1/0||n!=null&&n.has(w.destination.properties.id))&&(x[w.destination.properties.id]==null||E<x[w.destination.properties.id])){let O=E+this.getShortestEuclideanDistance(w.destination,d);x[w.destination.properties.id]=E,v[w.destination.properties.id]=w,m.push({origin:w.destination,priority:O})}}m.sort((w,P)=>w.priority-P.priority)}return[]}};Yh=new WeakMap,Xi=new WeakSet,lM=u(function(e){return e.map(t=>this.nodesById[t]).filter(Boolean)},"#filterValidNodes"),JO=u(function(e){return e.reduce((t,n)=>(t[n.properties.id]=n,t),{})},"#createNodesById"),KO=u(function(){for(let e in this.nodesById)this.nodesById.hasOwnProperty(e)&&(this.nodesById[e].properties.neighbors=this.nodesById[e].properties.neighbors.filter(({id:t})=>!!this.nodesById[t]))},"#removeInvalidNeighbors"),QO=u(function(e,t,n){e.forEach(i=>{let a=t==="default"?t:i.properties[t];this.nodesByGroup.has(a)||this.nodesByGroup.set(a,[]),this.nodesByGroup.get(a).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:l,weight:h})=>{let d=this.nodesById[l],m=fa(i.geometry.coordinates,d.geometry.coordinates),v=_u(i.geometry.coordinates,d.geometry.coordinates);return new Xh({origin:i,destination:d,pathWeight:h,distance:m,angle:v,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),tD=u(function(e,t){let n=[],i={},a={};return e.forEach(l=>{let h=this.getShortestEuclideanDistance(l,t);n.push({origin:l,priority:h}),i[l.properties.id]=null,a[l.properties.id]=0}),n.sort((l,h)=>l.priority-h.priority),{frontier:n,cameFrom:i,costSoFar:a}},"#initializeSearch"),eD=u(function(e,t){return t.some(n=>n.properties.id===e.properties.id)},"#isDestinationNode"),rD=u(function(e,t){let n=[],i=e[t];for(;i;)n.push(i),i=e[i.origin.properties.id];return n.reverse()},"#reconstructPath"),$x=new WeakMap,u(uM,"NavigationGraph");var Zx=uM;var wW=.4,cM=class cM{constructor({nodes:e,geojsonCollection:t,groupBy:n="default",multiplicativeDistanceWeightScaling:i}){b(this,"groupBy");b(this,"graph");b(this,"geometryEdgesByMapId",new Map);b(this,"generatePath",u(e=>{let{destination:t}=e[e.length-1],n={type:"FeatureCollection",features:[]};for(let a=0;a<e.length;a++){let{origin:l,destination:h}=e[a],d={id:l.properties.id,angle:e[a].angle,distance:e[a].distance,destination:h.properties.id,edges:this.graph.edges[l.properties.id]};this.groupBy!=="default"&&(d.groupBy=l.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[l.geometry.coordinates[0],l.geometry.coordinates[1]]},properties:d})}let i={id:t.properties.id,edges:this.graph.edges[t.properties.id]};return this.groupBy!=="default"&&(i.groupBy=t.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[t.geometry.coordinates[0],t.geometry.coordinates[1]]},properties:i}),n},"generatePath"));b(this,"getDistance",u((e,t)=>fa(e,t),"getDistance"));b(this,"getAngle",u((e,t)=>_u(e,t),"getAngle"));this.groupBy=n,this.graph=new Zx({nodes:e,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:i}),((t==null?void 0:t.features)||[]).forEach(l=>{let h=null;if(l.geometry.type==="LineString"?h=l.geometry.coordinates:l.geometry.type==="Polygon"&&(h=l.geometry.coordinates.flat()),h){let d=this.groupBy==="default"?this.groupBy:l.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:e,originIds:t,destinationNodeIds:n,excludedNodeIds:i,disabledConnectionNodeIds:a,simplify:l,multiplicativeDistanceWeightScaling:h,overrideEdgeWeights:d}){var S,I;let m=(S=l==null?void 0:l.enabled)!=null?S:!0,v=e!=null?e:[],x=this.graph.aStar({originIds:t,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=l==null?void 0:l.bufferRadius)!=null?I:wW,h)),this.generatePath(x))}simplifyAllSteps(e,t,n){var m,v;let i=[],a=[e[0]];for(let x=1;x<e.length;x++)if(this.groupBy!=="default"&&e[x].origin.properties[this.groupBy]!==e[x-1].origin.properties[this.groupBy]){let S=e[x-1].origin.properties[this.groupBy],I=(m=this.geometryEdgesByMapId.get(S))!=null?m:[];i.push(...this.simplifySteps(a,I,t,n)),a=[e[x]]}else a.push(e[x]);let l=e[e.length-1],h=this.groupBy==="default"?this.groupBy:l.origin.properties[this.groupBy],d=(v=this.geometryEdgesByMapId.get(h))!=null?v:[];return i.push(...this.simplifySteps(a,d,t,n)),i}simplifySteps(e,t,n,i){if(e.length<3)return e;let a=[e[0]],l=1;for(let h=l+2;h<e.length;h++)if(e[l].origin.properties.preventSmoothing||!$O(e[l].origin,e[h].origin,t,n)){let d=h-1;a.push(new Xh(et(z({},e[l]),{destination:e[d].origin,distance:fa(e[l].origin.geometry.coordinates,e[d].origin.geometry.coordinates),angle:_u(e[l].origin.geometry.coordinates,e[d].origin.geometry.coordinates)}))),l=d}return a.push(new Xh(et(z({},e[l]),{destination:e[e.length-1].origin,distance:fa(e[l].origin.geometry.coordinates,e[e.length-1].origin.geometry.coordinates),angle:_u(e[l].origin.geometry.coordinates,e[e.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:i})),e[e.length-1]),a}};u(cM,"Navigator");var lm=cM;var nD="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",TW="https://auth.mappedin.com/oauth2/token";async function iD(r,e){var t,n,i,a,l,h;if((t=e==null?void 0:e.outdoorView)!=null&&t.enabled){let{Map:d,MercatorCoordinate:m}=await import("./outdoor-context-v4-EIE6B6TE.js"),v=e.outdoorView.headers;v==null&&(v=await ZT(TW));let x=e.center||[0,0],S=new d({container:r,style:e.outdoorView.style||nD,center:x,attributionControl:!1,zoom:(n=e.zoomLevel)!=null?n:nM,pitch:(i=e.pitch)!=null?i:eM,bearing:(a=e.bearing)!=null?a:rM,transformRequest:XT(v),trackResize:!1,pixelRatio:e.outdoorView.lowDpi?1:Rf(),antialias:typeof e.antialias=="boolean"?e.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),I=S.painter.context.gl,w=new p1(r,{center:x,zoomLevel:S.getZoom(),pitch:S.getPitch(),bearing:S.getBearing(),gl:I,map:S,mode:"outdoors-interleaved",watermark:e.watermark,attribution:e.attribution,antialias:e.antialias,occlusionEnabled:e.occlusionEnabled,transformImageRequest:e.transformImageRequest,naturalBearing:(l=e.naturalBearing)!=null?l:0,imagePlacementOptions:e.imagePlacementOptions,onWebGLContextCreationError:e.onWebGLContextCreationError,onWebGLContextLost:e.onWebGLContextLost,onWebGLContextRestored:e.onWebGLContextRestored,onWebGLRendererError:e.onWebGLRendererError,useStandaloneCamera:(h=e.useStandaloneCamera)!=null?h:!1}),P={center:S.getCenter().toArray(),zoom:S.getZoom(),bearing:S.getBearing(),pitch:S.getPitch()};S.setMinZoom(w.camera.minZoomLevel),S.setMaxZoom(w.camera.maxZoomLevel),w.on("camera-change",j=>{P.center=j.center,P.zoom=j.zoomLevel,P.bearing=j.bearing,P.pitch=j.pitch,S.jumpTo(P)});let E=m.fromLngLat(x,0),O=U0(E,w.viewCamera,w.camera,()=>{w.renderSync()});S.on("style.load",async()=>{S&&(S.addLayer(O),w.renderSync())});let N=!1,L=!1;S.on("idle",()=>{S&&(N||(w.publish("outdoor-view-loaded"),N=!0),L||(L=!0,w.publish("outdoor-style-loaded")))});let G=u(j=>{j&&(j.sourceDataType==="metadata"||j.sourceDataType==="visibility"||j.dataType==="style"||j.type==="terrain")&&w.getSystems().htmlControlsSystem.updateData(S)},"updateData");return S.on("styledata",j=>{S&&j&&j.dataType==="style"&&j.type==="styledata"&&(L=!1),G(j)}),S.on("sourcedata",G),S.on("terrain",G),S.on("error",j=>{var $;if((($=j.error)==null?void 0:$.url)===nD){K.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(v["x-mappedin-tiles-key"],'"'));return}K.warn(j)}),w}else return new p1(r,e)}u(iD,"createRenderer");y();y();y();var pM=(a=>(a.Departure="Departure",a.TakeConnection="TakeConnection",a.ExitConnection="ExitConnection",a.Turn="Turn",a.Arrival="Arrival",a))(pM||{}),Jx=(l=>(l.Straight="Straight",l.Right="Right",l.SlightRight="SlightRight",l.Left="Left",l.SlightLeft="SlightLeft",l.Back="Back",l))(Jx||{}),hM=(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))(hM||{}),h1=(t=>(t.Exterior="exterior-walls",t.Interior="interior-walls",t))(h1||{}),f1=(t=>(t.Interior="interior-doors",t.Exterior="exterior-doors",t))(f1||{});y();y();var um=class um{constructor(e,t,n){b(this,"id");b(this,"text");b(this,"target");b(this,"__type",um.__type);this.id=e,this.text=t,this.target=n}static is(e){return e.__type===um.__type}get focusTarget(){return this.target.anchorTarget}};u(um,"Label"),b(um,"__type","Label");var Bc=um;y();var Wh,qh=class qh{constructor(e,t,n){b(this,"id");F(this,Wh);b(this,"__type",qh.__type);b(this,"contentEl");this.id=e,this.contentEl=t,V(this,Wh,n)}get target(){return p(this,Wh)}get coordinate(){return p(this,Wh).anchorTarget}toJSON(){return{id:this.id,__type:qh.__type,target:this.target,coordinate:this.coordinate}}static is(e){return e.__type===qh.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(e){V(this,Wh,e)}};Wh=new WeakMap,u(qh,"Marker"),b(qh,"__type","Marker");var Cu=qh;y();var m1,g1,cm=class cm{constructor(e,t,n){F(this,m1);F(this,g1);b(this,"target");b(this,"__type",cm.__type);V(this,m1,e),V(this,g1,t),this.target=n}static is(e){return e.__type===cm.__type}get id(){return p(this,m1)}get url(){return p(this,g1)}};m1=new WeakMap,g1=new WeakMap,u(cm,"Image"),b(cm,"__type","Image");var d1=cm;y();var $h,Zh=class Zh{constructor(e,t,n){b(this,"id");b(this,"groupId");b(this,"__type",Zh.__type);F(this,$h);this.id=e,this.groupId=t,V(this,$h,n)}get target(){return p(this,$h)}static is(e){return e.__type===Zh.__type}updateTarget(e){V(this,$h,e)}toJSON(){return{id:this.id,__type:Zh.__type,groupId:this.groupId,target:p(this,$h)}}};$h=new WeakMap,u(Zh,"Model"),b(Zh,"__type","Model");var Jh=Zh;y();var pm=class pm{constructor(e,t){b(this,"id");b(this,"coordinates");b(this,"__type",pm.__type);this.id=e,this.coordinates=t}static is(e){return e.__type===pm.__type}get focusTarget(){return this.coordinates}};u(pm,"PathSegment"),b(pm,"__type","PathSegment");var hm=pm,Kh=class Kh{constructor(e,t,n,i){b(this,"id");b(this,"animation");b(this,"coordinates");b(this,"segments");b(this,"__type",Kh.__type);this.id=e,this.animation=t,this.coordinates=n,this.segments=i.map(({id:a,coordinates:l})=>new hm(a.toString(),l))}static is(e){return e.__type===Kh.__type}get focusTarget(){return this.coordinates}toJSON(){return{__type:Kh.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};u(Kh,"Path"),b(Kh,"__type","Path");var da=Kh;y();var Gc,fM=class fM{constructor(e){F(this,Gc);V(this,Gc,e)}toJSON(){return{center:this.center,bearing:this.bearing,pitch:this.pitch,zoomLevel:this.zoomLevel}}get center(){return p(this,Gc).center}get bearing(){return p(this,Gc).bearing}get pitch(){return p(this,Gc).pitch}get zoomLevel(){return p(this,Gc).zoomLevel}};Gc=new WeakMap,u(fM,"CameraTransform");var y1=fM;y();var fm=class fm{constructor(e){b(this,"id");b(this,"__type",fm.__type);this.id=e}static is(e){return e.__type===fm.__type}get focusTarget(){return this}};u(fm,"Shape"),b(fm,"__type","Shape");var Su=fm;y();var v1=class v1{constructor(e,t){b(this,"id");b(this,"target");b(this,"__type","Text3D");this.id=e,this.target=t}static is(e){return e.__type===v1.__type}};u(v1,"Text3D"),b(v1,"__type","Text3D");var Vc=v1;y();y();y();var PW=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>']]),EW=/<svg([^>]*)>/g;function oD(r,e,t){let n=PW.get(r);return n?n.replace(EW,'<svg$1 style="fill:'.concat(e,"; width:").concat(t,"px; height:").concat(t,'px">')):""}u(oD,"getStyledIcon");var OW=u(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"),DW=u(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"),dM="#722ED1",mM="#1890FF",sD=u(({type:r="departure",color:e=mM})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?OW(e):DW(e),"\n </div>"),"DroppedPin"),LW=u(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),aD=u(({type:r="stairs",color:e=dM,direction:t="up"})=>{let n=LW("default"),i=n/2+2,a=t&&t!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(e,"; width:").concat(n,"px; height:").concat(n,'px;"\n >\n ').concat(oD("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(t==="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 lD=u(async r=>new Promise(e=>setTimeout(e,r)),"ms");var AW={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},NW={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},jc={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:AW,inactivePathOptions:NW,markerOptions:{departureColor:mM,destinationColor:dM},animatePathDrawing:!0},Iu,ma,Mu,yr,_1,wu,Qh,Bn,ga,Uo,Ns,Uc,$r,uD,cD,gM,b1,Kx,dm,yM,mm,vM=class vM extends ie{constructor(t,n,i){super();F(this,$r);F(this,Iu,new Map);F(this,ma);F(this,Mu);F(this,yr,jc);F(this,_1);F(this,wu);F(this,Qh);F(this,Bn,[]);F(this,ga);F(this,Uo,new Map);F(this,Ns,new Map);F(this,Uc,new Map);F(this,mm,u(t=>{var n;if((n=p(this,yr).createMarkers)!=null&&n.connection&&t.markers.length>0){let{instruction:i}=p(this,Iu).get(t.markers[0]);i!=null&&i.action.toFloor&&(p(this,yr).setMapOnConnectionClick&&this.currentMap.setFloor(i.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:i,fromFloor:i.action.fromFloor,toFloor:i.action.toFloor}))}},"#handleClick"));V(this,ma,t),V(this,_1,i),V(this,Mu,n)}get currentMap(){return p(this,_1).call(this)}get isMultiFloor(){if(!p(this,Bn).length)return!1;let t=new Set;for(let n of p(this,Bn))for(let i of n.coordinates)if(i.floorId&&(t.add(i.floorId),t.size>1))return!0;return!1}getPathById(t){return p(this,Uo).get(t)}getMarkerById(t){return p(this,Iu).get(t)}get paths(){let t=new Set;return p(this,Uo).forEach(({path:n})=>t.add(n)),Array.from(t)}get activeDirections(){return p(this,Uc).get(p(this,ga))}get activePath(){var t;if(p(this,ga))return(t=p(this,Uo).get(p(this,ga).id))==null?void 0:t.path}get floorStacks(){let t=p(this,Mu).getMapData();if(!p(this,Bn).length||!t)return[];let n=new Set;for(let i of p(this,Bn))for(let a of i.coordinates)if(a.floorId){let l=t.getById("floor",a.floorId);l&&n.add(l.floorStack)}return Array.from(n)}get floors(){let t=p(this,Mu).getMapData();if(!p(this,Bn).length||!t)return[];let n=new Set;for(let i of p(this,Bn))for(let a of i.coordinates)if(a.floorId){let l=t.getById("floor",a.floorId);l&&n.add(l)}return Array.from(n)}setActivePathByIndex(t){let n=p(this,Bn)[t];if(!p(this,Bn).length){K.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!p(this,Bn)[t]){K.warn("Direction #".concat(t," does not exist"));return}let i=p(this,Ns).get(n);if(!i){K.warn("The direction is not a part of muli-direcional path");return}gt(this,$r,Kx).call(this,i)}setActivePath(t){if(!p(this,Bn).length){K.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!p(this,Uc).get(t)){K.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}gt(this,$r,Kx).call(this,t)}setActivePathByDirections(t){if(!p(this,Bn).length){K.warn("[setActivePathByDirections] Cannot set an active path before drawing. Call Navigation.draw() first.");return}let n=p(this,Ns).get(t);if(!n){let i=p(this,Bn).find(a=>a.id===t.id);if(!i){K.warn("[setActivePathByDirections] Cannot find directions for id");return}n=p(this,Ns).get(i)}if(!n){K.warn("[setActivePathByDirections] Cannot find path for directions");return}gt(this,$r,Kx).call(this,n)}drawSync(t,n={}){var d,m,v;p(this,Qh)&&this.clear(),V(this,Qh,!0),gt(this,$r,gM).call(this,n);let i=Array.isArray(t)?t:[t],a=i[0],l=i[i.length-1],h=a.coordinates[0];V(this,Bn,i),h.floorId&&p(this,yr).setMapToDeparture&&this.currentMap.setFloor(h.floorId),(d=p(this,yr).createMarkers)!=null&&d.departure&&gt(this,$r,dm).call(this,a.coordinates[0],"departure",a.instructions[0]);for(let x=0;x<i.length;x++){let S=i[x],I=x?z({},p(this,yr).inactivePathOptions):z({},p(this,yr).pathOptions);if(S.coordinates.length<2){K.warn("Directions must have at least 2 coordinates");return}let w=this.currentMap.Paths.add(S.coordinates,et(z({},I),{animateDrawing:p(this,yr).animatePathDrawing})),P=w.paths.map(O=>O.id.toString()),E=new da(Mr(),w.animation,S.coordinates,w.paths);for(let O of P){p(this,Uo).set(O,{path:E,entityIds:P});let N=x?et(z({},p(this,yr).inactivePathOptions),{altitude:0}):et(z({},p(this,yr).pathOptions),{altitude:.05});p(this,ma).setState(O,N)}p(this,Uo).set(E.id,{path:E,entityIds:P}),p(this,Ns).set(S,E),p(this,Uc).set(E,S),(m=p(this,yr).createMarkers)!=null&&m.connection&&gt(this,$r,yM).call(this,S.instructions,"connection"),x===0&&(V(this,ga,p(this,Ns).get(p(this,Bn)[0])),p(this,ma).on("click",p(this,mm)))}(v=p(this,yr).createMarkers)!=null&&v.destination&&gt(this,$r,dm).call(this,l.coordinates[l.coordinates.length-1],"destination",l.instructions[l.instructions.length-1]),p(this,Mu).mapObjects.forEach(x=>{x.processFloorChange(x.currentFloorId)}),gt(this,$r,b1).call(this)}async draw(t,n={}){p(this,wu)&&this.clear(),gt(this,$r,gM).call(this,n);let i=Array.isArray(t)?t:[t],l=i[0].coordinates[0];return V(this,Bn,i),l.floorId&&p(this,yr).setMapToDeparture&&this.currentMap.setFloor(l.floorId),gt(this,$r,cD).call(this,i)}clear(){p(this,Iu).forEach((t,n)=>{this.currentMap.Markers.remove(n.toString())}),p(this,Iu).clear(),p(this,Uo).forEach(({path:t,entityIds:n})=>{p(this,Uo).delete(t.id),n.forEach(i=>p(this,Uo).delete(i)),this.currentMap.Paths.remove(n)}),p(this,wu)&&(p(this,wu).cancel(),V(this,wu,void 0)),p(this,Qh)&&V(this,Qh,!1),V(this,Bn,[]),p(this,Ns).clear(),p(this,Uc).clear(),V(this,ga,void 0),p(this,ma).off("click",p(this,mm)),p(this,Mu).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)}),gt(this,$r,b1).call(this)}};Iu=new WeakMap,ma=new WeakMap,Mu=new WeakMap,yr=new WeakMap,_1=new WeakMap,wu=new WeakMap,Qh=new WeakMap,Bn=new WeakMap,ga=new WeakMap,Uo=new WeakMap,Ns=new WeakMap,Uc=new WeakMap,$r=new WeakSet,uD=u(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),cD=u(function(t){let n=t[0],i=t[t.length-1],a=!1;return V(this,wu,{promise:new Promise(async l=>{var h,d,m;if(T.env.NODE_ENV!=="test"&&await lD(500),a||!t.length){l();return}(h=p(this,yr).createMarkers)!=null&&h.departure&&gt(this,$r,dm).call(this,n.coordinates[0],"departure",n.instructions[0]);for(let v=0;v<t.length;v++){let x=t[v],S=v?z({},p(this,yr).inactivePathOptions):z({},p(this,yr).pathOptions);if(x.coordinates.length<2){K.warn("Directions must have at least 2 coordinates"),l();return}let I=this.currentMap.Paths.add(x.coordinates,et(z({},S),{animateDrawing:p(this,yr).animatePathDrawing})),w=I.paths.map(E=>E.id.toString()),P=new da(Mr(),I.animation,x.coordinates,I.paths);for(let E of w){p(this,Uo).set(E,{path:P,entityIds:w});let O=v?et(z({},p(this,yr).inactivePathOptions),{altitude:0}):et(z({},p(this,yr).pathOptions),{altitude:.05});p(this,ma).setState(E,O)}if(p(this,Uo).set(P.id,{path:P,entityIds:w}),p(this,Ns).set(x,P),p(this,Uc).set(P,x),T.env.NODE_ENV!=="test"&&await I.animation,a){l();return}(d=p(this,yr).createMarkers)!=null&&d.connection&&gt(this,$r,yM).call(this,x.instructions,"connection"),v===0&&(V(this,ga,p(this,Ns).get(p(this,Bn)[0])),p(this,ma).on("click",p(this,mm)))}if((m=p(this,yr).createMarkers)!=null&&m.destination&&gt(this,$r,dm).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),a){l();return}p(this,Mu).mapObjects.forEach(v=>{v.processFloorChange(v.currentFloorId)}),gt(this,$r,b1).call(this),l()}),cancel:u(()=>{a=!0},"cancel")}),p(this,wu).promise},"#drawAsync"),gM=u(function(t){var n,i,a;V(this,yr,{setMapOnConnectionClick:(n=t.setMapOnConnectionClick)!=null?n:jc.setMapOnConnectionClick,setMapToDeparture:(i=t.setMapToDeparture)!=null?i:jc.setMapToDeparture,pathOptions:z(z({},jc.pathOptions),t.pathOptions),inactivePathOptions:z(z({},jc.inactivePathOptions),t.inactivePathOptions),createMarkers:z(z({},jc.createMarkers),t.createMarkers),markerOptions:z(z({},jc.markerOptions),t.markerOptions),animatePathDrawing:(a=t.animatePathDrawing)!=null?a:jc.animatePathDrawing})},"#setupOptions"),b1=u(function(){this.publish("navigation-state-change",{isMultiFloor:this.isMultiFloor,floorStacks:this.floorStacks,floors:this.floors,activeDirections:this.activeDirections,activePath:this.activePath,paths:this.paths})},"#emitNavigationStateChanged"),Kx=u(function(t){V(this,ga,t),p(this,Bn).forEach(n=>{let i=p(this,Ns).get(n);if(i){let a=p(this,Uo).get(i.id),l=a.path.id===p(this,ga).id?et(z({},p(this,yr).pathOptions),{altitude:.05}):et(z({},p(this,yr).inactivePathOptions),{altitude:0});a.entityIds.forEach(h=>{p(this,ma).setState(h,l)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath}),gt(this,$r,b1).call(this)},"#setActiveDirections"),dm=u(function(t,n,i){var a,l,h,d,m;if(n==="connection"&&i){let v=i.action.type==="ExitConnection"?p(this,yr).markerOptions.departureColor:p(this,yr).markerOptions.destinationColor,x;if(typeof((a=p(this,yr).createMarkers)==null?void 0:a.connection)=="function"){let I=p(this,yr).createMarkers.connection(i);p(this,ma).setState(I.id.toString(),{options:{interactive:!0}}),x={id:I.id,type:"marker"}}else x=this.currentMap.Markers.add(i.coordinate,aD({type:(h=(l=i.action.connection)==null?void 0:l.type)!=null?h:i.action.connectionType,color:v,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let S=this.currentMap.Markers.getContentEl(x.id.toString());if(!S)throw new Error("marker component should exist");p(this,Iu).set(x.id,{instruction:i,marker:new Cu(x.id.toString(),S,i.coordinate)})}else{let v=n==="departure"?p(this,yr).markerOptions.departureColor:p(this,yr).markerOptions.destinationColor,x;typeof((d=p(this,yr).createMarkers)==null?void 0:d.departure)=="function"&&n==="departure"?x={id:p(this,yr).createMarkers.departure(i).id,type:"marker"}:typeof((m=p(this,yr).createMarkers)==null?void 0:m.destination)=="function"&&n==="destination"?x={id:p(this,yr).createMarkers.destination(i).id,type:"marker"}:x=this.currentMap.Markers.add(t,sD({type:n,color:v}),{anchor:"top",rank:"always-visible"}),p(this,Iu).set(x.id,void 0)}},"#addMarker"),yM=u(function(t,n){t.filter(a=>gt(this,$r,uD).call(this,a.action)).forEach(a=>{gt(this,$r,dm).call(this,a.coordinate,n,a)})},"#addMarkers"),mm=new WeakMap,u(vM,"Navigation");var x1=vM;y();y();y();var kW=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>']]),RW=/<svg([^>]*)>/g;function pD(r,e,t){let n=kW.get(r);return n?n.replace(RW,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(e,"; width:").concat(t,"px; height:").concat(t,'px">')):""}u(pD,"getStyledIcon");var tf,gm,zo,bM,hD,fD,xM,dD,_M=class _M{constructor(e,t){F(this,zo);F(this,tf);F(this,gm);b(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});V(this,tf,e),V(this,gm,t)}auto(){let e=[],t=p(this,gm)[Object.keys(p(this,gm))[0]];return[...t.getByType("connection"),...t.getByType("point-of-interest"),...t.getByType("space")].forEach(n=>{if(n.__type==="connection")n.coordinates.forEach(i=>{let a=n.name||n.externalId;if(a){let l=p(this,tf).Labels.add(i,a,gt(this,zo,bM).call(this,n));e.push(l)}});else{n.__type==="space"&&n.name!==""&&p(this,tf).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let i=n.name;if(i){let a=p(this,tf).Labels.add(n,i,gt(this,zo,bM).call(this,n));e.push(a)}}}),{labels:e}}};tf=new WeakMap,gm=new WeakMap,zo=new WeakSet,bM=u(function(e){let t=pD(gt(this,zo,hD).call(this,e),"white",12);return{appearance:{text:{foregroundColor:gt(this,zo,xM).call(this,e)},marker:{foregroundColor:{active:gt(this,zo,xM).call(this,e)},icon:t,iconSize:12}},interactive:!0,rank:gt(this,zo,dD).call(this,e)}},"#generatLabelAppearance"),hD=u(function(e){return e.__type==="connection"?gt(this,zo,fD).call(this,e.type):e.name.includes("Washroom")?"washroom-14x14":e.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),fD=u(function(e){let t="";switch(e){case"elevator":t="connection-elevator-12x12";break;case"escalator":t="connection-escalator-12x12";break;case"stairs":t="connection-stairs-12x12";break}return t},"#attemptIconNameForConnection"),xM=u(function(e){return e.__type==="connection"?this.colors.connection:e.__type==="point-of-interest"?this.colors.point:"name"in e&&e.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),dD=u(function(e){return e.__type==="connection"?"high":(e.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),u(_M,"Labels");var Qx=_M;var CM=class CM{constructor(e,t){b(this,"Labels");b(this,"auto",u(()=>this.Labels.auto(),"auto"));this.Labels=new Qx(e,t)}};u(CM,"DefaultTheme");var t2=CM;y();var he,S1,Tu,e2,SM,IM=class IM{constructor(e){F(this,Tu);F(this,he);F(this,S1);b(this,"interactions",{set:u(e=>{(e==null?void 0:e.pan)!=null&&(p(this,he).getSystems().cameraSystem.enablePan=e.pan),(e==null?void 0:e.zoom)!=null&&(p(this,he).getSystems().cameraSystem.enableZoom=e.zoom),(e==null?void 0:e.bearingAndPitch)!=null&&(p(this,he).getSystems().cameraSystem.enableRotate=e.bearingAndPitch)},"set"),enable:u(()=>{p(this,he).getSystems().cameraSystem.enablePan=!0,p(this,he).getSystems().cameraSystem.enableZoom=!0,p(this,he).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:u(()=>{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",u(e=>{p(this,he).camera.setMinPitch(e)},"setMinPitch"));b(this,"setMaxPitch",u(e=>{p(this,he).camera.setMaxPitch(e)},"setMaxPitch"));b(this,"setMinZoomLevel",u(e=>{p(this,he).camera.setMinZoomLevel(e,!0)},"setMinZoomLevel"));b(this,"setMaxZoomLevel",u(e=>{p(this,he).camera.setMaxZoomLevel(e)},"setMaxZoomLevel"));V(this,S1,e),V(this,he,e.core)}setScreenOffsets(e){p(this,he).camera.setInsetPadding(e)}get screenOffsets(){return p(this,he).camera.insetsPadding}get panMode(){return p(this,he).camera.panMode}setPanMode(e){if(e!=="default"&&e!=="elevation")throw new Error("Invalid pan mode");e!==this.panMode&&p(this,he).camera.setPanMode(e)}getFocusOnTransform(e,t){var i,a,l;let n=p(this,he).camera.getCameraFrameForCoordinates(gt(this,Tu,SM).call(this,e),{pitch:t==null?void 0:t.pitch,bearing:t==null?void 0:t.bearing,padding:(t==null?void 0:t.screenOffsets)||this.screenOffsets,maxZoomLevel:t==null?void 0:t.maxZoomLevel,verticalPadding:(i=t==null?void 0:t.axisAlignedPadding)==null?void 0:i.vertical,minZoomLevel:t==null?void 0:t.minZoomLevel,duration:t==null?void 0:t.duration,easing:t==null?void 0:t.easing});return{center:new ve(n.center[1],n.center[0]),zoomLevel:n.zoomLevel,bearing:(a=t==null?void 0:t.bearing)!=null?a:this.bearing,pitch:(l=t==null?void 0:t.pitch)!=null?l:this.pitch}}focusOn(e,t){var n;return p(this,he).camera.focusOn(gt(this,Tu,SM).call(this,e),{pitch:t==null?void 0:t.pitch,bearing:t==null?void 0:t.bearing,padding:(t==null?void 0:t.screenOffsets)||this.screenOffsets,maxZoomLevel:t==null?void 0:t.maxZoomLevel,minZoomLevel:t==null?void 0:t.minZoomLevel,duration:t==null?void 0:t.duration,verticalPadding:(n=t==null?void 0:t.axisAlignedPadding)==null?void 0:n.vertical,easing:t==null?void 0:t.easing})}animateTo(e,t){var d;let{center:n,zoomLevel:i,bearing:a,pitch:l}=e,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:l,duration:(d=t==null?void 0:t.duration)!=null?d:600,easing:t==null?void 0:t.easing})}set(e){let{center:t=this.center,zoomLevel:n=this.zoomLevel,bearing:i=this.bearing,pitch:a=this.pitch}=e,l=[t.longitude,t.latitude];p(this,he).camera.setCenter(l),p(this,he).camera.setZoomLevel(n),p(this,he).camera.setBearing(i),p(this,he).camera.setPitch(a)}get center(){let e=p(this,he).camera.center;return new ve(e[1],e[0],void 0)}setAutoMinZoomLevel(e){p(this,he).camera.setAutoMinZoomLevel(e)}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 e=p(this,he).camera.bearing;return(e<0?e+360:e)%360}get minZoomLevel(){return p(this,he).camera.minZoomLevel}get maxZoomLevel(){return p(this,he).camera.maxZoomLevel}setElevation(e){p(this,he).camera.setElevation(e)}get elevation(){return p(this,he).camera.elevation}animateElevation(e,t){return p(this,he).camera.animateElevation(e,t)}updateFacadesInView(){p(this,he).getSystems().geometryInFocusSystem.raycast()}};he=new WeakMap,S1=new WeakMap,Tu=new WeakSet,e2=u(function(e){var n,i,a,l,h,d;let t=p(this,he).camera.elevation;return ve.is(e)&&e.floorId!=null?(i=(n=p(this,he).getState(e.floorId))==null?void 0:n.altitude)!=null?i:t:Co.is(e)?(l=(a=p(this,he).getState(e.id))==null?void 0:a.altitude)!=null?l:t:"floor"in e&&Co.is(e.floor)&&(d=(h=p(this,he).getState(e.floor.id))==null?void 0:h.altitude)!=null?d:t},"#getFloorAltitude"),SM=u(function(e){var a;let t=[],i=(Array.isArray(e)?e:[e]).flatMap(l=>{var h;return(h=l==null?void 0:l.focusTarget)!=null?h:[l]});for(let l of i)if(l!=null)if(ve.is(l)){let h=gt(this,Tu,e2).call(this,l);t.push([l.longitude,l.latitude,h])}else if((l==null?void 0:l.id)!=null){let h=gt(this,Tu,e2).call(this,l);if(Co.is(l)&&((a=p(this,S1).getMapDataInternal())!=null&&a.enterpriseMode)){t.push(l.id);continue}else if("geoJSON"in l&&l.geoJSON.geometry.coordinates.length>0){Gi(l.geoJSON,m=>{t.push([m[0],m[1],h])});continue}let d=p(this,he).getBoundingArea(l.id);if(d)t.push(...d.map(m=>[m[0],m[1],h]));else if("geoJSONBoundingBox"in l){let m=gt(this,Tu,e2).call(this,l);if(l.geoJSONBoundingBox!=null){let v=[[l.geoJSONBoundingBox[0],l.geoJSONBoundingBox[1],m],[l.geoJSONBoundingBox[2],l.geoJSONBoundingBox[3],m]];t.push(...v)}}}else RC(l)&&t.push(l);return t},"#computeCoordinateCloud"),u(IM,"Camera");var C1=IM;y();var ym,MM=class MM{constructor({currentMapGetter:e}){F(this,ym);V(this,ym,e)}get currentMap(){return p(this,ym).call(this)}async getCurrentSceneGLTF(e){let t=p(this,ym).call(this);return t?t==null?void 0:t.Exporter.getCurrentSceneGLTF(e):(K.error("There is no map to export. Please load a map first."),new Blob)}};ym=new WeakMap,u(MM,"Exporter");var I1=MM;y();var gl,w1,wM=class wM{constructor({currentMapGetter:e}){F(this,gl,new Map);F(this,w1);V(this,w1,e)}get currentMap(){return p(this,w1).call(this)}getById(e){return p(this,gl).get(e)}add(e,t,n){let i=e.anchorTarget,a=this.currentMap;if(!a)throw new Error("currentMap should exist");let l=a.Labels.add(i,t,et(z({},n),{attachTo:vm(e),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank})),h=new Bc(l.id.toString(),t,e);return p(this,gl).set(h.id,{label:h,entityId:h.id}),h}all(e){var n;let t=[];return(n=this.currentMap)==null||n.Labels.all({onCreate:u((i,a,l)=>{let h=new Bc(i.toString(),a,l);p(this,gl).set(h.id,{label:h,entityId:h.id}),t.push(h)},"onCreate"),labelOptions:e}),t}remove(e){var n;let t=p(this,gl).get(e.id);t&&((n=this.currentMap)==null||n.Labels.remove(t),p(this,gl).delete(e.id.toString()))}removeAll(){let e=[];return p(this,gl).forEach(({label:t})=>{this.remove(t),e.push(t),p(this,gl).delete(t.id.toString())}),e}};gl=new WeakMap,w1=new WeakMap,u(wM,"Labels");var M1=wM;y();y();var TM={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},mD={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},gD=.5,OM=class OM{constructor(e,t,n=new Map){b(this,"containerId");b(this,"layers");b(this,"renderer");this.containerId=t,this.layers=n,this.renderer=e}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(e){this.renderer.setState(this.containerId,{visible:e})}};u(OM,"Layer");var Pu=OM,ef,DM=class DM{constructor(e,t,n,i,a,l,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);F(this,ef);b(this,"load",u(()=>{var i,a,l,h,d,m,v,x,S,I,w,P,E,O,N,L;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let e=this.renderer.addGroupContainer("".concat(eu,"-").concat(this.id),{},this.id);this.layers.set(eu,new Pu(this.renderer,e.id.toString()));let t=this.renderer.addGroupContainer("".concat(Qa,"-").concat(this.id),{},this.id);this.layers.set(Qa,new Pu(this.renderer,t.id.toString()));let n=this.renderer.addGroupContainer("".concat(Rn,"-").concat(this.id),{},this.id);if(this.layers.set(Rn,new Pu(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 G=TM;if(this.obstructions!=null&&this.obstructions.features.length>0){let q=this.obstructions.features.filter(k=>{var tt;return k.geometry.type==="LineString"&&((tt=k.properties.kind)==null?void 0:tt.toLowerCase())==="wall"&&k.properties.footprintComponent===!0});q!=null&&q.length>0&&(G=this.styleMap[(l=q[0].properties)==null?void 0:l.id])}let j=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},et(z({},G),{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":G.color,renderOrder:2}),this.id);this.layers.set(Fg,new Pu(this.renderer,j.id.toString()));let $=this.renderer.addGroupContainer("".concat(Hp,"-").concat(this.id),{},this.id);this.layers.set(Hp,new Pu(this.renderer,$.id.toString()))}if(this.spaces!=null&&this.spaces.features.length>0){let G=[],j=new Map;this.spaces.features.filter(tt=>{var ut;return tt.geometry.type==="Polygon"&&((ut=tt.properties.kind)==null?void 0:ut.toLowerCase())!=="void"}).forEach(tt=>{var at;let ut=(at=this.mapDataInternal)==null?void 0:at.facadesBySpaceId[tt.properties.id];if(ut){let H=j.get(ut.id)||[];j.set(ut.id,[...H,tt])}else G.push(tt)});let $=r2(G,this.styleMap),q=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),k=0;for(let[tt,ut]of $){let at=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(k),{features:ut},bm(tt,this.options),q);k++;let H=q.id.toString();this.layers.get(Rn).layers.set(tt.id||H,at.id.toString())}if(j.size>0){let tt=this.renderer.addGroupContainer("".concat(Xp,"-").concat(this.id),{},this.id);this.layers.set(Xp,new Pu(this.renderer,tt.id.toString()));for(let[ut,at]of j){let H=this.renderer.addGroupContainer(ut,{focusable:!0},tt),St=this.renderer.addGroupContainer("".concat(ut,"-geometry"),{},H),pt=r2(at,this.styleMap),ct=0;for(let[It,Et]of pt){let dt=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(ut,"-").concat(ct),{features:Et},et(z({},bm(It,this.options)),{renderOrder:3}),St);ct++;let bt=It.id||dt.id.toString();this.layers.get(Xp).layers.set("".concat(ut,"-").concat(bt),dt.id.toString()),this.facadesByStyleId.has(bt)?(x=this.facadesByStyleId.get(bt))==null||x.push(ut):this.facadesByStyleId.set(bt,[ut])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let G=this.obstructions.features.filter(St=>St.geometry.type==="Polygon"&&(St.properties.kind==="object"||St.properties.kind==="unknown")),j=r2(G,this.styleMap),$=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),q=0;for(let[St,pt]of j){let ct=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(q),{features:pt},bm(St,this.options),$);q++;let It=$.id.toString();this.layers.get(Rn).layers.set(St.id||It,ct.id.toString())}let k=this.obstructions.features.filter(St=>{var pt;return St.geometry.type==="LineString"&&((pt=St.properties.kind)==null?void 0:pt.toLowerCase())==="wall"&&St.properties.footprintComponent===!1}),tt=this.obstructions.features.filter(St=>{var pt;return St.geometry.type==="LineString"&&((pt=St.properties.kind)==null?void 0:pt.toLowerCase())==="wall"&&St.properties.footprintComponent===!0}),ut=this.entrances,at=TM,H=TM;if(k!=null&&k.length>0){let St=this.styleMap[(S=k[0].properties)==null?void 0:S.id];St!=null&&(at=z({},St)),H=at;let{walls:pt,entrances:ct}=PM(k,(ut==null?void 0:ut.features)||[]),It=Math.max(at.height-.11,gD),Et=et(z({},mD),{height:It}),dt=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),ct,Et,n);this.layers.get(Rn).layers.set(md,dt.id.toString());let bt=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[pt]},bm(at,this.options),n);this.layers.get(Rn).layers.set(gc,bt.id.toString())}if(tt!=null&&tt.length>0){let St=this.styleMap[(I=tt[0].properties)==null?void 0:I.id];St!=null&&(H=et(z({},St),{id:Ka}));let{walls:pt,entrances:ct}=PM(tt,(ut==null?void 0:ut.features)||[]),It=Math.max(H.height-.11,gD),Et=et(z({},mD),{height:It}),dt=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),ct,Et,n);this.layers.get(Rn).layers.set(gd,dt.id.toString());let bt=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[pt]},bm(H,this.options),n);this.layers.get(Rn).layers.set(Ka,bt.id.toString())}}if(this.floorImages!=null){let G=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:(P=this.options.flipImagesToFaceCamera)!=null?P:!0},G);this.layers.set(tl,new Pu(this.renderer,G.id.toString()))}if(this.floorText!=null)for(let G of this.floorText.features||[]){let j=0;"geometryId"in G.properties?j=(O=(E=this.renderer.getState(G.properties.geometryId))==null?void 0:E.height)!=null?O:0:j=(N=G.properties.verticalOffset)!=null?N:0,this.renderer.addText3D(Mr(),et(z({},G),{properties:et(z({},G.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=t.id,this.options=a;let m=n.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:(v=a.preloadFloors)==null?void 0:v.map(P=>P.id).includes(t.id)},e);this.containerId=m.id.toString(),this.externalId=t.externalId,this.metadata=t.metadata,this.shortName=t.shortName,this.subtitle=t.subtitle,this.name=t.name,this.elevation=t.elevation,l!=null&&h!=null&&(this.styleMap=h,this.spaces=l.space[this.id],this.entrances=l.entrance[this.id],this.obstructions=l.obstruction[this.id],this.floorImages=(x=l.floorImages)==null?void 0:x[this.id],this.floorText=(I=(S=l.enterprise)==null?void 0:S.floorText)==null?void 0:I[this.id],this.footprint=(w=l["floor.geojson"])==null?void 0:w.features.find(P=>P.properties.id===t.id)),this.renderer=n,this.floorStackId=e,this.multiFloorView=i,this.mapDataInternal=d}get geoJSONBoundingBox(){if(p(this,ef))return p(this,ef);if(!this.footprint){K.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return V(this,ef,n2(this.footprint)),p(this,ef)}addOccluder(){let e=this.layers.get(Hp);if(e==null||e.containerId==null||this.footprint==null){K.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,e.containerId)}get hasFacadeGeometry(){return this.facadesByStyleId.size>0}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(e){this.renderer.setState(this.containerId,{visible:e})}};ef=new WeakMap,u(DM,"FloorObject");var T1=DM;y();var LM=50,AM=!1,FW=1e3,cn,xm,yl,ya,Pi,E1,Hc,_m,Xc,Yi,kM,rf,O1,D1,L1,A1,Eu,xD,N1,Yc,RM,FM,_D,CD,nf,BM=class BM extends ie{constructor({currentMapGetter:t}){super();F(this,Yi);F(this,cn);F(this,xm,0);F(this,yl);F(this,ya,!1);F(this,Pi,[]);F(this,E1,0);F(this,Hc,LM);F(this,_m,!1);F(this,Xc,"collapsed");b(this,"expandedFactor",0);F(this,rf,"all-floors");F(this,O1,u(()=>{let t=p(this,cn).call(this);if(p(this,E1)===this.expandedFactor||t==null||!p(this,ya))return;V(this,E1,this.expandedFactor);let n=Ul(this.expandedFactor,0,1,0,this.distanceBetweenFloors),a=Ul(this.expandedFactor,0,.1,0,1)===0;p(this,Pi).forEach((l,h)=>{t.api.updateState(l.containerId,{visible:a?l.id===t.currentFloorId:!0,altitude:n*h})}),this.expandedFactor===0?(V(this,ya,!1),t.renderer.camera.setPanMode("default"),p(this,Yc)&&p(this,Yc).call(this)):this.expandedFactor===1&&(V(this,ya,!1),p(this,Yc)&&p(this,Yc).call(this))},"#handlePreRender"));F(this,D1,u(()=>{var t,n,i;this.expanded&&V(this,xm,(n=(t=p(this,cn).call(this))==null?void 0:t.renderer.camera.elevation)!=null?n:0),(i=p(this,cn).call(this))==null||i.renderer.on("user-interaction-end",p(this,A1))},"#handleUserInteractionStart"));F(this,L1,u(()=>{var n;let t=p(this,cn).call(this);if(t!=null&&this.expanded&&p(this,_m)&&!p(this,ya)){let i=t.currentFloorId,a=[1/0,t.currentFloorId];for(let l=0;l<p(this,Pi).length;l++){let h=p(this,Pi)[l],d=Math.abs(((n=t.renderer.camera.elevation)!=null?n:0)-l*this.distanceBetweenFloors);d<this.distanceBetweenFloors/3&&(a[0]=d,a[1]=h.id)}a[1]!==t.currentFloorId&&(t.currentFloorId=a[1],p(this,Pi).forEach(l=>{t.api.updateState(l.containerId,{visible:p(this,rf)==="all-floors"?!0:t.currentFloor.id===l.id})}),t.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:t.currentFloorId,previousFloorId:i}))}},"#determineCurrentMapBasedOnElevation"));F(this,A1,u(()=>{var n,i;let t=p(this,cn).call(this);if(this.expanded&&t&&p(this,xm)!==((n=t.renderer.camera.elevation)!=null?n:0)){let a=[1/0,t.currentFloorId,0];for(let l=0;l<p(this,Pi).length;l++){let h=p(this,Pi)[l],d=Math.abs(((i=t.renderer.camera.elevation)!=null?i:0)-l*this.distanceBetweenFloors);d<a[0]&&(a[0]=d,a[1]=h.id,a[2]=l*this.distanceBetweenFloors)}p(this,_m)&&gt(this,Yi,xD).call(this,a[2]),V(this,xm,0),t.renderer.off("user-interaction-end",p(this,A1))}},"#handleUserInteractionEnd"));F(this,Eu,null);F(this,N1,null);F(this,Yc);F(this,nf);V(this,cn,t);let n=p(this,cn).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",p(this,D1)),n.renderer.on("camera-change",p(this,L1)),n.renderer.on("pre-render",p(this,O1)))}get state(){return p(this,Xc)}get expanded(){return p(this,Xc)!=="collapsed"}get distanceBetweenFloors(){if(p(this,Hc)==="auto"){if(p(this,nf)!=null)return p(this,nf);let t=gt(this,Yi,CD).call(this);if(t)return V(this,nf,t),t}return typeof p(this,Hc)=="number"?p(this,Hc):LM}clearCachedFloorSeparationDistance(){V(this,nf,void 0)}get includedFloors(){var t;return(t=p(this,Yi,kM))!=null&&t.api.mapData?p(this,Pi).map(n=>{var i,a;return(a=(i=p(this,Yi,kM))==null?void 0:i.api.mapData)==null?void 0:a.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return p(this,rf)}setFloorVisiblityMode(t){V(this,rf,t);let n=p(this,cn).call(this);n!=null&&p(this,Pi).forEach(i=>{n.api.updateState(i.containerId,{visible:p(this,rf)==="all-floors"?!0:n.currentFloor.id===i.id})})}changeFloorOnElevationChanges(t){V(this,_m,t)}async expand(t){var i,a,l;let n=p(this,cn).call(this);if(n!=null)return(t==null?void 0:t.distanceBetweenFloors)==="auto"?V(this,Hc,"auto"):V(this,Hc,(i=t==null?void 0:t.distanceBetweenFloors)!=null?i:LM),V(this,Pi,(t==null?void 0:t.includedFloors)!=null&&(t==null?void 0:t.includedFloors.length)>0?t==null?void 0:t.includedFloors.map(h=>n.floorsById.get(h.id)).filter(Boolean):n.currentFloorStack.floorObjects),p(this,Pi).sort((h,d)=>h.elevation-d.elevation),p(this,Pi).length<=1||this.expanded===!0?Promise.resolve():(V(this,ya,!0),n.api.Camera.setPanMode((a=t==null?void 0:t.cameraPanMode)!=null?a:"elevation"),this.changeFloorOnElevationChanges((l=t==null?void 0:t.changeFloorOnElevationChanges)!=null?l:!0),gt(this,Yi,RM).call(this,"expand",t).then(()=>{V(this,Xc,"expanded"),gt(this,Yi,FM).call(this),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{V(this,ya,!1)}))}async collapse(t){let n=p(this,cn).call(this);if(n!=null)return this.expanded===!0?(V(this,ya,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),gt(this,Yi,RM).call(this,"collapse",t).then(()=>{V(this,Xc,"collapsed"),gt(this,Yi,FM).call(this),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{V(this,ya,!1)})):Promise.resolve()}destroy(){let t=p(this,cn).call(this);t!=null&&(t.renderer.off("user-interaction-start",p(this,D1)),t.renderer.off("camera-change",p(this,L1)),t.renderer.off("pre-render",p(this,O1)))}};cn=new WeakMap,xm=new WeakMap,yl=new WeakMap,ya=new WeakMap,Pi=new WeakMap,E1=new WeakMap,Hc=new WeakMap,_m=new WeakMap,Xc=new WeakMap,Yi=new WeakSet,kM=u(function(){return p(this,cn).call(this)},"#currentMap"),rf=new WeakMap,O1=new WeakMap,D1=new WeakMap,L1=new WeakMap,A1=new WeakMap,Eu=new WeakMap,xD=u(function(t){var i,a,l;p(this,Eu)&&p(this,Eu).stop();let n=p(this,cn).call(this);n!=null&&(V(this,Eu,new jo({elevation:(i=n.renderer.camera.elevation)!=null?i:0}).to({elevation:t},150).easing(Fn.Quadratic.Out).onComplete(()=>{var h;p(this,Eu)&&((h=p(this,cn).call(this))==null||h.renderer.getInternalTweenGroup().remove(p(this,Eu)))}).onUpdate(({elevation:h})=>{n.renderer.camera.setElevation(h)}).start()),(a=p(this,cn).call(this))==null||a.renderer.getInternalTweenGroup().add(p(this,Eu)),(l=p(this,cn).call(this))==null||l.renderer.render())},"#animateElevationTo"),N1=new WeakMap,Yc=new WeakMap,RM=u(function(t,n){var h,d,m,v;p(this,yl)&&p(this,yl).stop();let i=p(this,cn).call(this);if(i==null)return Promise.reject(new Error("No current map"));let a=p(this,Pi).indexOf(i.currentFloor),l=(h=i.renderer.camera.elevation)!=null?h:0;return V(this,N1,new Promise(x=>{V(this,Yc,x)})),V(this,yl,new jo({percentExpanded:this.expandedFactor}).to({percentExpanded:t==="expand"?1:0},(d=n==null?void 0:n.duration)!=null?d:FW).easing(yu[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:x})=>{this.expandedFactor=x;let S=a*this.distanceBetweenFloors;i.renderer.camera.setElevation(t==="expand"?S*x:l*x)}).onComplete(()=>{var x;p(this,yl)&&((x=p(this,cn).call(this))==null||x.renderer.getInternalTweenGroup().remove(p(this,yl)))}).start()),p(this,yl).cameraAnimation=!0,(m=p(this,cn).call(this))==null||m.renderer.getInternalTweenGroup().add(p(this,yl)),(v=p(this,cn).call(this))==null||v.renderer.render(),p(this,N1)},"#animate"),FM=u(function(){var n,i;let t=p(this,cn).call(this);if(t!=null&&t.options.hideImagesNotOnCurrentFloor)for(let a of p(this,Pi)){let l=t.floorsById.get(a.id);l&&(p(this,Xc)==="expanded"?(n=l.layers.get(tl))==null||n.setVisible(!0):(i=l.layers.get(tl))==null||i.setVisible(l.id===t.currentFloor.id))}},"#showOrHideImagesOnAllFloorsInStack"),_D=u(function(t,n,i,a){let l=NM(t,i),h=n.clone(),d=NM(h,i);if(!xs(l)||!xs(d))return-1;let m=0,v;AM&&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(),NM(h,i,d),v=l.intersectsBox(d),AM){let x=bD(l,"blue",a),S=bD(d,v?"red":"green",a);x.classList.add("debug-box"),S.classList.add("debug-box")}}while(v);return m},"#computeMinZOffsetToSeparateFirstTwoFloors"),CD=u(function(){let t=p(this,cn).call(this);if(!t)return;let n=t.renderer,i=n.getThreeScene();if(!t.api.mapData||!i)return;let l=p(this,Pi).length>0?p(this,Pi):t.currentFloorStack.floorObjects;if(l.length<2)return;let h=n.getInternalState().geometry3DMap.get(l[0].id),d=n.getInternalState().geometry3DMap.get(l[1].id);if(!h||!d)return;if(Vl(h,"group-container"),Vl(d,"group-container"),AM){let v=new _n;v.setFromObject(h);let x=new _n;if(x.setFromObject(d),h.children.forEach(N=>{N instanceof ue&&N.userData.debugBox&&Zr(N)}),d.children.forEach(N=>{N instanceof ue&&N.userData.debugBox&&Zr(N)}),!xs(v)||!xs(x))return;let S=new No(v.max.x-v.min.x,v.max.y-v.min.y,v.max.z-v.min.z),I=new Tn({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 P=new No(x.max.x-x.min.x,x.max.y-x.min.y,x.max.z-x.min.z),E=new Tn({color:"cyan",transparent:!0,opacity:.5}),O=new ue(P,E);O.position.set((x.min.x+x.max.x)/2,(x.min.y+x.max.y)/2,(x.min.z+x.max.z)/2),O.userData.debugBox=!0,h.add(w),d.add(O)}let m=gt(this,Yi,_D).call(this,h,d,n.getThreeCamera(),n.container);if(m!==-1)return m},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),nf=new WeakMap,u(BM,"StackedMaps");var P1=BM,zc=new zt,yD=new ne;function NM(r,e,t=new IT){return r.traverse(n=>{if(n instanceof ue){let a=n.geometry.attributes.position;if(e.position.distanceTo(n.position)<e.near)return;for(let h=0;h<a.count;h++)zc.fromBufferAttribute(a,h),zc.applyMatrix4(n.matrixWorld),zc.applyMatrix4(e.matrixWorldInverse),zc.applyMatrix4(e.projectionMatrix),zc.z<1&&zc.z>0&&(yD.set(zc.x,zc.y),t.expandByPoint(yD))}}),t}u(NM,"projectToBox2D");function vD(r,e){let t=e.clientWidth,n=e.clientHeight;return new ne((r.x+1)*t/2,(1-r.y)*n/2)}u(vD,"ndcToScreen");function bD(r,e,t){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(e),n.style.pointerEvents="none";let i=vD(new ne(r.min.x,r.min.y),t),a=vD(new ne(r.max.x,r.max.y),t);n.style.left="".concat(i.x,"px"),n.style.top="".concat(a.y,"px");let l=Math.abs(a.x-i.x),h=Math.abs(a.y-i.y);return n.style.width="".concat(l,"px"),n.style.height="".concat(h,"px"),t.appendChild(n),n}u(bD,"drawProjectedBox");y();var Cm,GM=class GM{constructor(e,t,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");F(this,Cm);var l;this.id=e.id,this.externalId=e.externalId,this.name=e.name,this.type=e.type,this.metadata=e.metadata,this.floorIds=(l=e.floors)!=null?l:e.maps,this.defaultFloorId=e.defaultFloor,this.renderer=n;let a=n.addGroupContainer(this.id,{visible:!0,interactive:!0},t);this.containerId=a.id.toString(),this.facade=i}get defaultFloor(){if(p(this,Cm)==null){if(this.floorObjects.length===0)throw new xi("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let e;this.defaultFloorId&&(e=this.floorObjects.find(t=>t.id===this.defaultFloorId)),e||(e=this.floorObjects.reduce((t,n)=>Math.abs(n.elevation)<Math.abs(t.elevation)?n:t)),V(this,Cm,e)}return p(this,Cm)}get isOutdoors(){var t;return((t=this.type)==null?void 0:t.toLowerCase())==="outdoor"?!0:this.facade!=null?!1:this.floorObjects.some(n=>n.hasFacadeGeometry)}addFloor(e){if(this.floorObjectsByElevation.has(e.elevation)){K.error("Floor with same elevation ".concat(e.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(e.id,") will not be added."));return}e.load(),this.floorObjects.push(e),this.floorObjectsByElevation.set(e.elevation,e),this.facade&&this.renderer.setState(e.containerId,{focusable:!0}),!this.isOutdoors&&!e.hasFacadeGeometry&&e.footprint!=null&&e.addOccluder()}};Cm=new WeakMap,u(GM,"FloorStackObject");var k1=GM;y();function SD(r,e,t,n){let i={outdoorOpacity:1,floorStates:[]},a=r.sort((v,x)=>v.elevation-x.elevation),l=Math.min(0,a[0].elevation),h=a[a.length-1].elevation,d,m;for(let v=l;v<=h;v++){let x=a.find(E=>E.elevation===v);if(x==null){v>=0&&(d==null?d=v:m=v);continue}let S=0,I=v<0?Math.abs(x.elevation)*t:t,w=!1;if(d===0&&m!=null){let E=t*m;S=-E,I=E,w=!0}else if(d!=null&&m!=null){let E=d,O=r.find(L=>L.elevation===E-1),N=i.floorStates.find(L=>L.floor===O);if(N){let L=t*(m-d+2);N.state.footprint=et(z({},N.state.footprint),{altitude:0,height:L,visible:!0})}}d=void 0,m=void 0;let P={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(P),x.id===e.id?(P.state.visible=!0,P.state.geometry.visible=!0,P.state.labels.enabled=!0,P.state.markers.enabled=!0,P.state.occlusion.enabled=!0,(x.elevation<0||w)&&(x.elevation<0&&(i.outdoorOpacity=.2),P.state.footprint.height=I,P.state.footprint.altitude=S,P.state.footprint.visible=!0)):n.includes(x.id)&&x.elevation<e.elevation?(P.state.visible=!0,P.state.geometry.visible=!0,P.state.markers.enabled=!0,P.state.occlusion.enabled=!0,P.state.footprint.visible=!0,x.elevation<0?(P.state.footprint.height=I,P.state.footprint.altitude=S,i.outdoorOpacity=.2):(P.state.footprint.height=I,P.state.footprint.altitude=S)):e.elevation>0&&x.elevation<e.elevation&&x.elevation>=0&&(P.state.visible=!0,P.state.footprint.visible=!0,P.state.footprint.height=t,P.state.footprint.altitude=S)}return i}u(SD,"getMultiFloorState");var BW={linear:Fn.Linear.None,easeIn:Fn.Quadratic.In,easeOut:Fn.Quadratic.Out,easeInOut:Fn.Quadratic.InOut},vl,UM=class UM extends ie{constructor(t,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:u((t,n,i)=>{let x=i,{floorId:a,scale:l}=x,h=Zs(x,["floorId","scale"]),d=a?this.floorsById.get(a):this.currentFloor,m=z({},h);l!=null&&(m.scale=Array.isArray(i.scale)?i.scale:[i.scale,i.scale,i.scale]);let v=this.renderer.addModelGroup(t,{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:ks(S)}}})},m,{parent:d.id});if(v==null)throw new xi("error creating model");return this.renderer.getState(v).children},"add"),remove:u((t,n)=>{this.renderer.remove(t),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)},"remove")});b(this,"Images",{add:u((t,n,i)=>{let v=i,{floorId:a,flipImageToFaceCamera:l}=v,h=Zs(v,["floorId","flipImageToFaceCamera"]),d=a?this.floorsById.get(a):this.currentFloor,m={type:"Feature",properties:h,geometry:{type:"Point",coordinates:t}};return this.renderer.addImage(Mr(),m,{url:n,flipImageToFaceCamera:l!=null?l:!1},d.id)},"add"),remove:u(t=>{this.renderer.remove(t)},"remove"),removeAll:u(()=>{},"removeAll")});b(this,"Markers",{add:u((t,n,i)=>{let a=jM(t,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),x=i,{attachTo:l}=x,h=Zs(x,["attachTo"]),d=h;h.rank==="initial"&&(d.rank="medium");let m=a.layers.get(Qa),v=this.renderer.addMarker2D(ks(t),n,et(z({},d),{occluderId:a==null?void 0:a.occluderId,attachTo:l}),m==null?void 0:m.containerId);if(!v)throw new xi("Failed to create Marker");return v},"add"),remove:u(t=>{this.renderer.remove(t)},"remove"),getContentEl:u(t=>{let n=this.renderer.getState(t);if((n==null?void 0:n.type)==="marker")return n.element},"getContentEl"),removeAll:u(()=>{},"removeAll"),setPosition:u((t,n,i)=>{var h;let a=this.renderer.getState(t),l=i?this.floorsById.get(i):this.currentFloor;if(!a){K.error('Failed to retrieve state for Marker with id "'.concat(t,'".'));return}if(a.type!=="marker"){K.error('Geometry with id "'.concat(t,'" is not of type "marker".'));return}this.renderer.setState(a,{position:n,parent:(h=l==null?void 0:l.layers.get(Qa))==null?void 0:h.containerId})},"setPosition"),animateTo:u((t,n,i,a)=>{let l=this.renderer.getState(t),h=i?this.floorsById.get(i):this.currentFloor;if(!l)return K.error('Failed to retrieve state for Marker with id "'.concat(t,'".')),Promise.resolve();if(l.type!=="marker")return K.error('Geometry with id "'.concat(t,'" is not of type "marker".')),Promise.resolve();let d=z({duration:1e3,easing:"ease-in-out"},a);this.cancelAnimation(t);let m=new jo({lon:l.position[0],lat:l.position[1]}).to({lon:n[0],lat:n[1]},d.duration).easing(BW[d.easing]).onUpdate(({lon:v,lat:x})=>{var I;if(!this.renderer.getState(t))this.cancelAnimation(t);else{let w=(I=h==null?void 0:h.layers.get(Qa))==null?void 0:I.containerId;w&&this.Markers.setPosition(t,[v,x],w)}}).start();return this.renderer.getInternalTweenGroup().add(m),this.renderer.render(),this.animations.set(t,m),VM(m).then(()=>{this.animations.delete(t)})},"animateTo")});b(this,"Exporter",{getCurrentSceneGLTF:u(async t=>this.renderer.getCurrentSceneGLTF(t),"getCurrentSceneGLTF")});b(this,"Shapes",{add:u((t,n,i)=>{let a=i!=null&&i.floorId?this.floorsById.get(i==null?void 0:i.floorId):this.currentFloor,l="shape-"+Mr();return this.renderer.addGeometryGroup(l,t,n,a.id),l},"add"),remove:u(t=>(this.renderer.remove(t.id),t.id),"remove")});b(this,"Text3D",{label:u((t,n,i)=>{var l;if(!((l=this.api.getMapDataInternal())!=null&&l.enterpriseMode)){K.warn("Enterprise mode is not enabled, skipping label creation");return}let a=ID(this.renderer,t,n,i);if(a)return{textInfo:a,target:t}},"label"),labelAll:u((t={})=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode))return K.warn("Enterprise mode is not enabled, skipping label creation"),[];let n=this.api.getMapData();if(!n)return[];let i=[];return n.getByType("space").forEach(l=>{var h,d;if(l.locations[0]){let m=ID(this.renderer,l,(d=(h=l.locations[0])==null?void 0:h.name)!=null?d:l.name,t);m&&i.push({textInfo:m,target:l})}}),i},"labelAll"),remove:u(t=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){K.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(t),t},"remove")});b(this,"Labels",{all:u(({onCreate:t,labelOptions:n={}})=>{for(let i of Object.entries(this.mvf.space)){let[a,l]=i;l&&l.features.forEach(h=>{var P,E,O,N,L;let d=(P=this.api.getMapData())==null?void 0:P.getById("space",h.properties.id);if(!d)return;let m=(E=this.styleMap[h.properties.id])==null?void 0:E.showImage,v=(O=h.properties.details)==null?void 0:O.images,x=m&&((N=v==null?void 0:v[0])!=null&&N.url)?{icon:v[0].url}:{},S=z({marker:z(z({},x),(L=n.appearance)==null?void 0:L.marker)},n.appearance),w=(a?this.floorsById.get(a):this.currentFloor).layers.get(eu);if(h.properties.center&&d.name!==""){let G=this.renderer.addLabel2D(h.properties.center,d.name,et(z({id:h.properties.id+"-label"},n),{appearance:S,rank:n.rank,attachTo:vm(d)}),si.is(d)?d.id:w==null?void 0:w.containerId);G&&t(G.id,d.name,d)}})}},"all"),add:u((t,n,i={})=>{let v=i,{attachTo:a}=v,l=Zs(v,["attachTo"]),h=jM(t,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),d=h.layers.get(eu),m=this.renderer.addLabel2D(ks(t),n,et(z({},l),{occluderId:h.occluderId,attachTo:a}),d==null?void 0:d.containerId);if(!m)throw new xi("label creating failed");return m},"add"),remove:u(({entityId:t})=>{this.renderer.remove(t)},"remove"),removeAll:u(()=>{},"removeAll")});b(this,"Paths",{add:u((t,n)=>{var m;let i=(m=n==null?void 0:n.animateDrawing)!=null?m:!0,a=[],l=t[0].floorId||"root",h=0;for(let v of t){let{floorId:x="root",latitude:S,longitude:I}=v;x!==l&&(h++,l=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 P=a[I-1],E=P.coordinates[P.coordinates.length-1],O=S[0],N=ks(E),L=ks(O),G=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:P.floorId},geometry:{type:"Point",coordinates:N}},{type:"Feature",properties:{parentId:x},geometry:{type:"Point",coordinates:L}}]},n,this.id);G&&(n!=null&&n.animateDrawing&&this.renderer.setState(G.id,{completeFraction:0}),v.push(et(z({},G),{coordinates:[E,O]})))}let w=this.renderer.addPath({type:"FeatureCollection",features:S.map(P=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:ks(P)}}))},n,x);return w&&(n!=null&&n.animateDrawing&&this.renderer.setState(w.id,{completeFraction:0}),v.push(et(z({},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 jo({fraction:0}).to({fraction:1},I===!1?0:(w=n==null?void 0:n.drawDuration)!=null?w:1500).onUpdate(P=>{this.renderer.setState(S.id,{completeFraction:P.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:VM(v[v.length-1]).then(()=>{this.animations.delete(d[0].id.toString())})}}else return{paths:d,animation:Promise.resolve()}},"add"),remove:u(t=>{t.forEach(n=>{this.cancelAnimation(n),this.renderer.remove(n)})},"remove")});F(this,vl,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=a.core,this.api=a,this.id=t,this.renderer.addGroupContainer(t,{},"root"),this.options=i!=null?i:{},this.StackedMaps=new P1({currentMapGetter:u(()=>this,"currentMapGetter")}),this.mvf=(m=n==null?void 0:n.mvf)!=null?m:{};let l=MD(this.mvf["styles.json"]||{});if(this.styleMap=l,V(this,vl,z({enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0},i==null?void 0:i.multiFloorView)),!n){this.id!=="outdoors-container"&&K.warn("Map (".concat(this.id,") created with no data."));let I=new k1({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 T1(I.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,p(this,vl),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 xi("MVF does not contain any Floor Stacks.");for(let I of h){let w=new k1(I,this.id,this.renderer,(v=this.mvf.facade)==null?void 0:v[I.id]);if(w.floorIds.length!==0){for(let P of w.floorIds){let E=n.getMVFFeatureById("floor",P);if(E!=null){let O=this.mvf.space[E.id],N=this.mvf.obstruction[E.id];if((O==null||O.features.length===0)&&(N==null||N.features.length===0))continue;let L=new T1(w.id,E,this.renderer,p(this,vl),i!=null?i:{},this.mvf,l,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=Lg(i.initialFloor);I&&this.floorsById.has(I)?d=I:K.error("Invalid initial floor specified (".concat(i.initialFloor,"), using default behavior instead"))}d||(d=this.currentFloorStack.defaultFloor.id),this.startingFloorId=d}get currentFloorStack(){let t=this.floorStacksById.get(this.currentFloorStackId);if(!t)throw new xi('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return t}setFloorStack(t,n){if(this.currentFloorStackId===t)return;let i=this.floorStacksById.get(t);if(i==null){K.error("Invalid floor stack passed to setFloorStack (".concat(t,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(i.floorObjects.length===0){K.error("Floor stack (".concat(t,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(i.defaultFloor.id,n)}get currentFloor(){let t=this.floorsById.get(this.currentFloorId);if(!t)throw new xi('Floor with id "'.concat(this.currentFloorId,'" not found'));return t}get floors(){return Array.from(this.floorsById.values())}processFloorChange(t){var a,l,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",t),i=(l=this.api.getMapDataInternal())==null?void 0:l.getById("floor-stack",this.currentFloorStackId);if(n&&i)if(!((h=p(this,vl))!=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!==t&&I.setVisible(!1)});else{let S=SD(i.floors,n,p(this,vl).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 P=(w=this.api.getMapData())==null?void 0:w.getById("floor",I.floor.id);P&&this.api.updateState(P,I.state)}}),p(this,vl).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*p(this,vl).floorHeight)}}setFloor(t,n){if(this.currentFloorId===t)return;if(!this.floorsById.get(t)){K.error("Invalid floor passed to setFloor (".concat(t,"), 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:t,reason:n}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.processFloorChange(t),this.currentFloorId=t,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 t,n;if(this.options.hideImagesNotOnCurrentFloor&&!((t=this.options.multiFloorView)!=null&&t.enabled))for(let i of this.floorsById.values())(n=i.layers.get(tl))==null||n.setVisible(i.id===this.currentFloor.id)}cancelAnimation(t){let n=this.animations.get(t);n&&(n.stop(),this.animations.delete(t),this.renderer.getInternalTweenGroup().remove(n))}};vl=new WeakMap,u(UM,"GeojsonApiMapObject");var R1=UM;function ID(r,e,t,n){return r.labelText3D(e.id,t!=null?t:e.name,et(z({},n),{parentId:e.floor.id}))}u(ID,"labelSpace");y();var va,B1,zM=class zM{constructor({currentMapGetter:e}){F(this,va,new Map);F(this,B1);V(this,B1,e)}get currentMap(){return p(this,B1).call(this)}getById(e){return p(this,va).get(e)}add(e,t,n){let i=e.anchorTarget;if(!i)throw new Error("get coordinate failed");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let l=a.Markers.add(i,t,et(z({},n),{rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(n==null?void 0:n.dynamicResize)||!1,attachTo:vm(e)}));if(l==null)throw new Error("error creating marker");let h=a.Markers.getContentEl(l.id.toString());if(!h)throw new Error("marker component should exist");let d=new Cu(l.id.toString(),h,e);return p(this,va).set(d.id,{marker:d,entityId:l.id.toString()}),d}remove(e){var n;let t=p(this,va).get(e.id);t&&((n=this.currentMap)==null||n.Markers.remove(t.entityId),p(this,va).delete(e.id.toString()))}removeAll(){let e=[];return p(this,va).forEach(({marker:t})=>{this.remove(t),e.push(t),p(this,va).delete(t.id.toString())}),e}setPosition(e,t){var l;let n=t.anchorTarget;if(!n){K.error("Cannot determine coordinate from target.");return}let i=this.currentMap;if(!i){K.error("Cannot determine the current map.");return}let a=p(this,va).get(e.id);if(!a){K.error('Cannot find the Marker with id "'.concat(e.id,'".'));return}i.Markers.setPosition(a.entityId,ks(n),(l=n.floorId)!=null?l:i.currentFloorId),a.marker.updateTarget(t)}animateTo(e,t,n){var h;let i=t.anchorTarget;if(!i)return K.error("Cannot determine coordinate from target."),Promise.resolve();let a=this.currentMap;if(!a)return K.error("Cannot determine the current map."),Promise.resolve();let l=p(this,va).get(e.id);return l?(l.marker.updateTarget(t),a.Markers.animateTo(l.entityId,ks(i),(h=i.floorId)!=null?h:a.currentFloorId,n)):(K.error('Cannot find the Marker with id "'.concat(e.id,'".')),Promise.resolve())}};va=new WeakMap,B1=new WeakMap,u(zM,"Markers");var F1=zM;y();var Ou,V1,HM=class HM{constructor({currentMapGetter:e}){F(this,Ou,new Map);F(this,V1);V(this,V1,e)}get currentMap(){return p(this,V1).call(this)}getById(e){return p(this,Ou).get(e)}add(e,t,n){var d;let i=e.anchorTarget;if(!i)throw new Error("Target does not implement IAnchorable.");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let l=a.Images.add(ks(i),t,et(z({},n),{floorId:i.floorId,verticalOffset:i.verticalOffset+((d=n.verticalOffset)!=null?d:0)}));if(!l)throw new Error("image component should exist");let h=new d1(l.id.toString(),t,e);return p(this,Ou).set(h.id,{image:h,entityId:l.id.toString()}),h}remove(e){var n;let t=p(this,Ou).get(e.id);t&&((n=this.currentMap)==null||n.Images.remove(t.entityId),p(this,Ou).delete(e.id.toString()))}removeAll(){let e=[];return p(this,Ou).forEach(({image:t})=>{this.remove(t),e.push(t),p(this,Ou).delete(t.id.toString())}),e}};Ou=new WeakMap,V1=new WeakMap,u(HM,"Images");var G1=HM;y();var bl,U1,XM=class XM{constructor({currentMapGetter:e}){F(this,bl,new Map);F(this,U1);V(this,U1,e)}get currentMap(){return p(this,U1).call(this)}getById(e){return p(this,bl).get(e)}add(e,t,n){let i=[e],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):(K.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 l=this.currentMap;if(!l)throw new Error("currentMap should exist");let h=[];return a.forEach((d,m)=>{let v=Mr();l.Models.add(v,d,et(z({},n),{url:t,floorId:m})).forEach(({id:S})=>{let I=new Jh(S.toString(),v,d[0]);p(this,bl).set(I.id,{model:I,entityId:S.toString(),groupId:v}),h.push(I)})}),h[0]}remove(e){var n;let t=p(this,bl).get(e.id);t&&((n=this.currentMap)==null||n.Models.remove(t.entityId,t.groupId),p(this,bl).delete(e.id.toString()))}removeAll(){let e=[];return p(this,bl).forEach(({model:t})=>{var i;let n=p(this,bl).get(t.id);n&&(e.push(t),(i=this.currentMap)==null||i.Models.remove(n.entityId,n.groupId),p(this,bl).delete(t.id.toString()))}),e}};bl=new WeakMap,U1=new WeakMap,u(XM,"Models");var j1=XM;y();var xl,H1,YM=class YM{constructor({currentMapGetter:e}){F(this,xl,new Map);F(this,H1);V(this,H1,e)}get currentMap(){return p(this,H1).call(this)}getById(e){return p(this,xl).get(e)}add(e,t){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let i=n.Paths.add(e,t),a=i.paths.map(h=>h.id.toString()),l=new da(Mr(),i.animation,e,i.paths);for(let h of a)p(this,xl).set(h,{path:l,entityIds:a});return p(this,xl).set(l.id,{path:l,entityIds:a}),l}remove(e){var n;let t=p(this,xl).get(e.id);t&&((n=this.currentMap)==null||n.Paths.remove(t.entityIds),p(this,xl).delete(e.id),t.entityIds.forEach(i=>p(this,xl).delete(i)))}removeAll(){let e=[];return p(this,xl).forEach(({path:t})=>{this.remove(t),e.push(t)}),e}};xl=new WeakMap,H1=new WeakMap,u(YM,"Paths");var z1=YM;y();y();var GD=Wr(S3(),1);y();var X1="blue-dot",TD="blue-dot-accuracy-ring";var qM="#2266ff",GW="#808080",PD="#f5f5f5";var ED={radius:10,color:qM,inactiveColor:GW,heading:{color:qM,opacity:.7},accuracyRing:{color:qM,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};y();var OD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";y();var DD=u((r,e,t=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let n=t/Math.tan(r/2),i=t/Math.sin(r/2),a=i+e,l=10,h=new ka;h.moveTo(-i*Math.sin(r/2),i*Math.cos(r/2)-n);for(let d=0;d<l;d++)h.lineTo(-(a*Math.sin(r/2-r/l*d)),a*Math.cos(r/2-r/l*d)-n);for(let d=0;d<l;d++)h.lineTo(-(t*Math.sin(Math.PI/-2+Math.PI/l*d)),t*Math.cos(Math.PI/-2+Math.PI/l*d));return new Ra(h,{depth:.1,bevelEnabled:!1,UVGenerator:jW(e)})},"createSectorGeometry"),WM=u((r,e,t)=>{let i=Math.sqrt(Math.pow(r,2)+Math.pow(e,2))/t;return i>1?i=1:i<0&&(i=0),new ne(0,i)},"generateRadialUV"),jW=u(r=>({generateTopUV:u((e,t,n,i,a)=>{let l=t[n*3],h=t[n*3+1],d=t[i*3],m=t[i*3+1],v=t[a*3],x=t[a*3+1];return[WM(l,h,r),WM(d,m,r),WM(v,x,r)]},"generateTopUV"),generateSideWallUV:u(()=>[new ne(0,1),new ne(0,1),new ne(0,1),new ne(0,1)],"generateSideWallUV")}),"radialUVGenerator");function LD(r,e){if(e==null)return r;let t={latitude:r==null?void 0:r.latitude,longitude:r==null?void 0:r.longitude,accuracy:r==null?void 0:r.accuracy,floor:r==null?void 0:r.floor,heading:r==null?void 0:r.heading};return"latitude"in e&&(t.latitude=(e==null?void 0:e.latitude)==null||e.latitude==="device"?r==null?void 0:r.latitude:e.latitude),"longitude"in e&&(t.longitude=e.longitude==null||e.longitude==="device"?r==null?void 0:r.longitude:e.longitude),"accuracy"in e&&(t.accuracy=e.accuracy==="device"?r==null?void 0:r.accuracy:e.accuracy),"floor"in e&&(t.floor=e.floor==="device"?r==null?void 0:r.floor:e.floor),"heading"in e&&(t.heading=e.heading==="device"?r==null?void 0:r.heading:e.heading),t}u(LD,"getPositionWithOverrides");function UW([r,e],[t,n],[i,a]){let l=t-r,h=n-e,d=l**2+h**2;if(d===0)return;let m=((i-r)*l+(a-e)*h)/d,v;m<=0?v=[r,e]:m>=1?v=[t,n]:v=[r+m*l,e+m*h];let x=L0([i,a],v);return{proportion:Math.max(0,Math.min(1,m)),intersection:v,distance:x}}u(UW,"getPointLineIntersection");function AD(r,e){if(r==null||r.length<2)return;let t=Number.MAX_SAFE_INTEGER,n,i=0,a=0;for(let l=0;l<r.length-1;l++){let h=r[l],d=r[l+1],m=UW(h,d,e);m!=null&&m.distance<t&&(t=m.distance,n=m.intersection,i=l,a=m.proportion)}if(n)return{intersection:n,distance:t,segmentIndex:i,proportion:a}}u(AD,"findBlueDotOnPath");function ND(r,e){let t=new Js({color:r,opacity:e,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,i=.35*4,a=DD(Math.PI/6,i,n);new Lf().load(OD,h=>{t.alphaMap=h,t.needsUpdate=!0});let l=new ue(a,t);return l.position.z=-.05,l.renderOrder=0,l}u(ND,"createHeadingCone");function kD(r,e){let t=new P0(1,1,.05,32),n=new Js({transparent:!0,color:r,opacity:e,depthTest:!1,depthWrite:!1}),i=new ue(t,n);return i.scale.set(0,0,.05),i.renderOrder=1,i.rotation.x=Math.PI/2,i}u(kD,"createAccuracyRing");function RD(r){let e=new P0(.35,.35,.07,32),t=new Js({transparent:!0,color:PD,depthTest:!1,depthWrite:!1}),n=new ue(e,t);n.renderOrder=2;let i=new P0(.35*.8,.35*.8,.01,32),a=new Js({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),l=new ue(i,a);return l.renderOrder=3,n.rotation.x=Math.PI/2,n.position.z=.07/2,l.rotation.x=Math.PI/2,l.position.z=.07,{outerMesh:n,innerMesh:l}}u(RD,"createBlueDot");var VD=Wr(FD(),1);var of,Du,ls,us,Lu,sf,af,lf,Gn,Ho,Y1,Au,q1,W1,Z1,o2,s2,$1,a2,J1,l2,_l,Nu,u2,ku,Im,Cl,K1,ZM=class ZM extends ie{constructor(t,n){super();this.core=t;this.geoJSONApi=n;F(this,of,null);b(this,"primaryGeometry");b(this,"secondaryGeometry");F(this,Du);F(this,ls);F(this,us);F(this,Lu);F(this,sf);F(this,af);F(this,lf);F(this,Gn,ED);F(this,Ho,1);F(this,Y1);F(this,Au);b(this,"bounds");b(this,"state","disabled");b(this,"following",!1);F(this,q1,u(t=>{var n;return(n=this.geoJSONApi.getMapData())==null?void 0:n.getById("floor",t)},"#getFloorByFloorId"));F(this,W1,u(t=>{var i;let n;if(t!=null){let a=(i=this.geoJSONApi.currentMap)==null?void 0:i.currentFloorStack.floorObjectsByElevation.get(t);n=a?p(this,q1).call(this,a.id):void 0}return n},"#getFloorByFloorLevel"));F(this,Z1,u(()=>this.state!=="hidden"&&this.state!=="disabled","#shouldUpdateGeometry"));F(this,o2,u((t,n)=>{p(this,l2).call(this),t.scale.set(p(this,Ho),p(this,Ho),p(this,Ho)),t.position.z=.07/2*p(this,Ho),n.scale.set(p(this,Ho),p(this,Ho),p(this,Ho)),n.position.z=.07*p(this,Ho),this.state==="active"?n.material.color.set(p(this,Gn).color):this.state==="inactive"&&n.material.color.set(p(this,Gn).inactiveColor)},"#updatePrimaryGeometry"));F(this,s2,u((t,n)=>{if(this.state==="active"){let i=this.accuracy;i!=null?(t.visible=!0,p(this,af)&&p(this,af).stop(),V(this,af,new jo({scale:t.scale.x}).to({scale:i/2},150).onUpdate(({scale:l})=>{t.scale.set(l,1,l)}).start()),this.core.getInternalTweenGroup().add(p(this,af))):t.visible=!1;let a=this.heading;if(a!=null){n.visible=!0,p(this,lf)&&p(this,lf).stop();let{start:l,end:h}=A0(n.rotation.z,-Ie.degToRad(a));V(this,lf,new jo({rotation:l}).to({rotation:h},150).onUpdate(({rotation:d})=>{n.rotation.z=d}).start()),this.core.getInternalTweenGroup().add(p(this,lf)),n.scale.set(p(this,Ho),p(this,Ho),1)}else n.visible=!1}else this.state==="inactive"&&(n.visible=!1,t.visible=!1)},"#updateSecondaryGeometry"));F(this,$1,u(t=>{if(!p(this,Z1).call(this))return;let[n,i]=t.children;p(this,o2).call(this,n,i)},"#updatePrimaryGeometryPerFrame"));F(this,a2,u(t=>{if(!p(this,Z1).call(this))return;let[n,i]=t.children;p(this,s2).call(this,n,i)},"#updateSecondaryGeometryPerFrame"));F(this,J1,u(t=>{var d,m;let n;try{n=qW.parse(LD(t,p(this,ls)))}catch(v){p(this,_l).call(this,"error"),K.error("BlueDot: Position parse failed",v instanceof J.ZodError?v.message:String(v)),this.publish("error");return}p(this,Gn).debug&&K.log("BlueDot: Parsed position",n);let{min:i,max:a}=this.bounds||{};if(i!=null&&a!=null&&isFinite(i.x)&&isFinite(i.y)&&isFinite(a.x)&&isFinite(a.y)){let v=this.core.convertTo3DMapPosition(n.latitude,n.longitude,0);if(!(v.x>=i.x&&v.x<=a.x&&v.y>=i.y&&v.y<=a.y)){K.warn("BlueDot: Position [".concat(n.longitude,", ").concat(n.latitude,"] is outside map bounds. Position update will be discarded."));return}}V(this,us,n),p(this,_l).call(this,"position-update"),p(this,Lu)&&clearTimeout(p(this,Lu)),typeof p(this,Gn).timeout=="number"&&p(this,Gn).timeout<1/0&&V(this,Lu,setTimeout(()=>{p(this,Gn).debug&&K.log("BlueDot: Position timed out after ".concat(p(this,Gn).timeout,"ms")),p(this,_l).call(this,"timeout"),this.core.render()},p(this,Gn).timeout)),(m=this.geoJSONApi.getMapDataInternal())==null||m.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:n.latitude,longitude:n.longitude,floorLevel:(d=n.floor)==null?void 0:d.elevation,accuracy:n.accuracy}});let l=n.floor!=null?n.floor.id:this.geoJSONApi.currentFloor.id||"outdoors-container",h=[n.longitude,n.latitude];if(!this.primaryGeometry)this.primaryGeometry=this.core.addCustomGeometry(X1,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:h}},{setup:u(v=>{let{outerMesh:x,innerMesh:S}=RD(p(this,Gn).color);v.add(x),v.add(S),p(this,$1).call(this,v)},"setup"),update:p(this,$1)},{visible:!0,interactive:!0},l),this.secondaryGeometry=this.core.addCustomGeometry(TD,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:h}},{setup:u(v=>{let x=kD(p(this,Gn).accuracyRing.color,p(this,Gn).accuracyRing.opacity),S=ND(p(this,Gn).heading.color,p(this,Gn).heading.opacity);v.add(x),x.visible=!1,v.add(S),S.visible=!1},"setup"),update:p(this,a2)},{visible:!0,interactive:!1},l);else{let v=this.core.getState(this.primaryGeometry);h=[v.position[0],v.position[1]]}p(this,sf)&&p(this,sf).stop(),V(this,sf,new jo(h).to([n.longitude,n.latitude],1e3).easing(Fn.Cubic.Out).onUpdate(v=>{let x={position:[v[0],v[1]]};x.parent=l,this.primaryGeometry&&this.secondaryGeometry&&this.core.setState(this.primaryGeometry,x),this.secondaryGeometry&&this.core.setState(this.secondaryGeometry,x)}).start()),this.core.getInternalTweenGroup().add(p(this,sf)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));b(this,"onPositionUpdate",u(t=>{var n,i,a,l,h;if(this.state!=="disabled"){try{YW.parse(t)}catch(d){p(this,_l).call(this,"error"),K.error("BlueDot: Browser sent invalid position",d instanceof J.ZodError?d.message:String(d)),this.publish("error");return}V(this,Du,{latitude:(n=t.coords)==null?void 0:n.latitude,longitude:(i=t.coords)==null?void 0:i.longitude,accuracy:(a=t.coords)==null?void 0:a.accuracy,heading:(l=t.coords)==null?void 0:l.heading,floor:p(this,W1).call(this,(h=t.coords)==null?void 0:h.floorLevel)}),p(this,J1).call(this,p(this,Du))}},"onPositionUpdate"));b(this,"onPositionError",u(t=>{var n;switch(p(this,_l).call(this,"error"),t.code){case t.PERMISSION_DENIED:K.error("Geolocation permission denied by the user.",t),(n=this.geoJSONApi.getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case t.POSITION_UNAVAILABLE:K.error("Geolocation position unavailable.",t);break;case t.TIMEOUT:K.error("Geolocation request timed out.",t);break;default:K.error("An unknown geolocation error occurred.",t);break}this.publish("error",t)},"onPositionError"));F(this,l2,u(()=>{var n;let t=Math.round(this.core.camera.zoomLevel*1e5);if(t!==p(this,Y1)){V(this,Y1,t);let i=(n=this.core.getMetresPerPixel())!=null?n:1;V(this,Ho,Math.max(p(this,Gn).radius/(.35/i),1))}},"#updateScale"));F(this,_l,u(t=>{let n=XW[this.state].actions[t];if(n){switch(p(this,Gn).debug&&K.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(n," using ").concat(t)),n){case"hidden":case"disabled":this.primaryGeometry&&this.core.setState(this.primaryGeometry,{visible:!1}),this.secondaryGeometry&&this.core.setState(this.secondaryGeometry,{visible:!1});break;case"active":this.primaryGeometry&&this.core.setState(this.primaryGeometry,{visible:!0}),this.secondaryGeometry&&this.core.setState(this.secondaryGeometry,{visible:!0});break}this.state!==n&&(this.state=n,this.publish("state-change",{state:n,action:t}))}else K.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(t))},"#transitionAction"));F(this,Nu);F(this,u2,u(()=>{if(p(this,Nu)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let n=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(i=>i.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(i=>i.floorId===this.geoJSONApi.currentFloor.id);V(this,Nu,(0,VD.default)(n.map(i=>({x:i.longitude,y:i.latitude})),1e-5).map(i=>[i.x,i.y]))}return p(this,Nu)},"#getSimplifiedDirections"));F(this,ku,u(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),p(this,Cl)&&(this.off("position-update",p(this,Cl)),V(this,Cl,void 0)),this.following=!1,V(this,Nu,void 0),this.core.off("user-interaction-start",p(this,ku)),this.geoJSONApi.currentMap.off("navigation-active-path-change",p(this,Im)),this.publish("follow-change",{following:!1})},"#cancelFollow"));F(this,Im,u(()=>{V(this,Nu,void 0)},"#pathChangeHandler"));F(this,Cl);b(this,"follow",u((t,n)=>{var a,l,h,d;if(t===!1){p(this,ku).call(this);return}t!=="position-only"&&(n==null?void 0:n.bearing)!=null&&K.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(t,"'. To control the bearing manually, use mode 'position-only'."));let i={zoomLevel:(a=n==null?void 0:n.zoomLevel)!=null?a:21,bearing:t==="position-only"?n==null?void 0:n.bearing:void 0,pitch:(l=n==null?void 0:n.pitch)!=null?l:45,duration:(h=n==null?void 0:n.duration)!=null?h:1e3,easing:(d=n==null?void 0:n.easing)!=null?d:"ease-in-out"};this.following?p(this,Cl)&&this.off("position-update",p(this,Cl)):(this.following=!0,this.core.on("user-interaction-start",p(this,ku)),this.geoJSONApi.currentMap.on("navigation-active-path-change",p(this,Im))),V(this,Cl,m=>{let{coordinate:v,heading:x,floor:S}=m;if(i.center=[v.longitude,v.latitude],S!=null&&S.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(S.id),V(this,Nu,void 0)),t==="position-and-heading")i.bearing=x!=null?x:void 0;else if(t==="position-and-path-direction"){let I=p(this,u2).call(this);if(I!=null){let w=AD(I,[v.longitude,v.latitude]);if(w!=null){let P=I[w.segmentIndex],E=I[w.segmentIndex+1];i.bearing=PT(P,E)}}}this.core.camera.animateTo(i)}),this.on("position-update",p(this,Cl)),this.publish("follow-change",{following:!0,mode:t})},"follow"));F(this,K1,u(t=>{this.bounds=t},"#handlePanBoundsChange"))}get heading(){var t;return(t=p(this,us))==null?void 0:t.heading}get accuracy(){var t;return(t=p(this,us))==null?void 0:t.accuracy}get coordinate(){var t,n;if(p(this,us)!=null)return(p(this,Au)==null||((t=this.floor)==null?void 0:t.id)!==p(this,Au).floorId||p(this,us).latitude!==p(this,Au).latitude||p(this,us).longitude!==p(this,Au).longitude)&&V(this,Au,new ve(p(this,us).latitude,p(this,us).longitude,(n=this.floor)==null?void 0:n.id)),p(this,Au)}get floor(){var t;return(t=p(this,us))==null?void 0:t.floor}enable(t){V(this,Gn,(0,GD.default)({},t,p(this,Gn))),p(this,_l).call(this,"enable"),this.watchDevicePosition(p(this,Gn).watchDevicePosition),this.bounds||(this.bounds=this.core.getSystems().cameraSystem.panBounds,this.core.on("pan-bounds-change",p(this,K1)))}disable(){this.primaryGeometry&&(this.core.remove(this.primaryGeometry.id),this.primaryGeometry=void 0),this.secondaryGeometry&&(this.core.remove(this.secondaryGeometry.id),this.secondaryGeometry=void 0),p(this,Lu)&&(clearTimeout(p(this,Lu)),V(this,Lu,void 0)),this.following&&p(this,ku).call(this),this.watchDevicePosition(!1),V(this,us,void 0),V(this,ls,void 0),p(this,_l).call(this,"disable"),this.core.off("user-interaction-start",p(this,ku)),this.geoJSONApi.currentMap.off("navigation-active-path-change",p(this,Im)),this.off("error",this.onPositionError),this.off("follow-change",p(this,ku)),this.core.off("pan-bounds-change",p(this,K1))}watchDevicePosition(t){if(p(this,of)&&(navigator.geolocation.clearWatch(p(this,of)),V(this,of,null)),p(this,Du)&&V(this,Du,void 0),t){if(this.state==="disabled"){K.warn("BlueDot must be enabled before watching browser position.");return}V(this,of,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(t){var i,a;t==null?V(this,ls,void 0):"coords"in t?V(this,ls,Object.assign({},p(this,ls),{latitude:t.coords.latitude,longitude:t.coords.longitude,accuracy:t.coords.accuracy,heading:t.coords.heading,floor:p(this,W1).call(this,t.coords.floorLevel)})):(V(this,ls,Object.assign({},p(this,ls),t)),"floorOrFloorId"in t&&(p(this,ls).floor=typeof t.floorOrFloorId=="string"&&t.floorOrFloorId!=="device"?p(this,q1).call(this,t.floorOrFloorId):t.floorOrFloorId)),(((i=p(this,ls))==null?void 0:i.latitude)!=null&&((a=p(this,ls))==null?void 0:a.longitude)!=null||p(this,Du)!=null)&&p(this,J1).call(this,p(this,Du))}};of=new WeakMap,Du=new WeakMap,ls=new WeakMap,us=new WeakMap,Lu=new WeakMap,sf=new WeakMap,af=new WeakMap,lf=new WeakMap,Gn=new WeakMap,Ho=new WeakMap,Y1=new WeakMap,Au=new WeakMap,q1=new WeakMap,W1=new WeakMap,Z1=new WeakMap,o2=new WeakMap,s2=new WeakMap,$1=new WeakMap,a2=new WeakMap,J1=new WeakMap,l2=new WeakMap,_l=new WeakMap,Nu=new WeakMap,u2=new WeakMap,ku=new WeakMap,Im=new WeakMap,Cl=new WeakMap,K1=new WeakMap,u(ZM,"BlueDot");var Mm=ZM,XW={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"}}},YW=J.object({coords:J.object({latitude:J.number(),longitude:J.number(),accuracy:J.number(),altitude:J.number().optional().nullable(),altitudeAccuracy:J.number().optional().nullable(),heading:J.number().optional().nullable(),speed:J.number().optional().nullable(),floorLevel:J.number().optional().nullable()}),timestamp:J.number()}),qW=J.object({latitude:J.number(),longitude:J.number(),floor:J.custom().optional(),accuracy:J.number().optional(),heading:J.number().optional().nullable()});y();var Ru,t0,$M=class $M{constructor({currentMapGetter:e}){F(this,Ru,new Map);F(this,t0);V(this,t0,e)}get currentMap(){return p(this,t0).call(this)}getById(e){return p(this,Ru).get(e)}add(e,t,n){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Shapes.add(e,t||{},{floorId:n==null?void 0:n.id}),l=new Su(a);return p(this,Ru).set(l.id,l),l}remove(e){var n;p(this,Ru).get(e.id)&&((n=this.currentMap)==null||n.Shapes.remove(e),p(this,Ru).delete(e.id.toString()))}removeAll(){let e=[];return p(this,Ru).forEach(t=>{this.remove(t),e.push(t.id),p(this,Ru).delete(t.id.toString())}),e}};Ru=new WeakMap,t0=new WeakMap,u($M,"Shapes");var Q1=$M;y();var r0,JM=class JM{constructor({currentMapGetter:e}){F(this,r0);V(this,r0,e)}get currentMap(){return p(this,r0).call(this)}setFromStyleCollection(e){var t,n,i,a;for(let l in e)for(let h of((t=this.currentMap)==null?void 0:t.floors)||[]){if(e[l]==null||!h.layers.has(Rn))continue;let d=h.layers.get(Rn);if(d!=null&&d.layers.has(l)&&"color"in e[l]){let x=d.layers.get(l);x&&((n=this.currentMap)==null||n.renderer.setState(x,{color:e[l].color}))}if(d&&l===gc&&!(Ka in e)){let x=d.layers.get(Ka);x&&"color"in e[l]&&((i=this.currentMap)==null||i.renderer.setState(x,{color:e[l].color}))}if(!h.layers.has(Xp))continue;let m=h.layers.get(Xp),v=h.facadesByStyleId.get(l);if(v&&v.length>0)for(let x of v){let S=m.layers.get("".concat(x,"-").concat(l));S&&"color"in e[l]&&((a=this.currentMap)==null||a.renderer.setState(S,{color:e[l].color}))}}}};r0=new WeakMap,u(JM,"Style");var e0=JM;y();var KM={opacity:1},so,n0,i0,Wc,Fu,uf,QM,jD,tw=class tw{constructor(e,t){F(this,uf);F(this,so);F(this,n0,[]);F(this,i0,{opacity:"initial"});F(this,Wc,{opacity:new Map});F(this,Fu,new Set);V(this,so,e),V(this,n0,t||[]);let n=p(this,so).map;n&&n.on("idle",()=>{p(this,Wc).opacity.size||gt(this,uf,QM).call(this,n)})}setStyle(e){var t,n;if(p(this,so).map){(t=p(this,so).map)==null||t.setStyle(e),p(this,Fu).size&&(p(this,Fu).clear(),this.hide()),gt(this,uf,jD).call(this),gt(this,uf,QM).call(this,p(this,so).map),this.setOpacity(p(this,i0).opacity),(n=p(this,so).map)==null||n.moveLayer(U2);for(let[i,a,l]of p(this,n0)||[])p(this,so).hideOutdoorLayersIntersectingPolygons(i,a,l)}}get map(){return p(this,so).map}get enabled(){return!!p(this,so).map}get visible(){return p(this,Fu).size===0}show(){let e=p(this,so).map;if(!e)return;let t=e.getStyle().layers;t&&(t.forEach(n=>{p(this,Fu).has(n.id)&&e.setLayoutProperty(n.id,"visibility","visible")}),p(this,Fu).clear())}hide(e=[]){let t=p(this,so).map;if(!t)return;let n=t.getStyle().layers;n&&n.forEach(i=>{let a=t.getLayoutProperty(i.id,"visibility");!e.includes(i.id)&&a!=="none"&&(t.setLayoutProperty(i.id,"visibility","none"),p(this,Fu).add(i.id))})}setOpacity(e,t=[]){var a,l;let n=p(this,so).map;if(!n)return;let i=(l=(a=p(this,so).map)==null?void 0:a.getStyle())==null?void 0:l.layers;i&&n.once("idle",()=>{i.forEach(h=>{let d=n.getLayoutProperty(h.id,"visibility");if(!t.includes(h.id)&&d!=="none")try{let m=p(this,Wc).opacity.get(h.id);m!==void 0&&(h.id==="background"||(h.type==="symbol"?(n.setPaintProperty(h.id,"icon-opacity",e==="initial"?m[0]:e),n.setPaintProperty(h.id,"text-opacity",e==="initial"?m[1]:e)):n.setPaintProperty(h.id,"".concat(h.type,"-opacity"),e==="initial"?m[0]:e)),p(this,i0).opacity=e)}catch(m){K.warn("Error setting opacity:",m)}})})}};so=new WeakMap,n0=new WeakMap,i0=new WeakMap,Wc=new WeakMap,Fu=new WeakMap,uf=new WeakSet,QM=u(function(e){let t=e.getStyle().layers;t&&t.forEach(n=>{var a,l,h;e.getLayoutProperty(n.id,"visibility")!=="none"&&(n.id==="background"||(n.type==="symbol"?p(this,Wc).opacity.set(n.id,[(a=e.getPaintProperty(n.id,"icon-opacity"))!=null?a:KM.opacity,(l=e.getPaintProperty(n.id,"text-opacity"))!=null?l:KM.opacity]):p(this,Wc).opacity.set(n.id,[(h=e.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?h:KM.opacity,void 0])))})},"#setInitialStyle"),jD=u(function(){Object.values(p(this,Wc)).forEach(e=>e.clear())},"#clearInitialStyle"),u(tw,"Outdoor");var wm=tw;y();function UD(){O3(!1)}u(UD,"disableText3DWorker");var Bu,Gu,Zc,ew=class ew{constructor({currentMapGetter:e}){F(this,Bu);F(this,Gu,new Map);F(this,Zc,new Map);V(this,Bu,e)}labelAll(e={}){var i,a;let t=[],n=new Set;return(a=(i=p(this,Bu).call(this))==null?void 0:i.Text3D.labelAll(e))==null||a.forEach(({textInfo:l,target:h})=>{let d=l.id.toString(),m=p(this,Zc).get(d);if(m){n.has(d)||t.push(m.text3DView),n.add(d);return}n.add(d);let v=new Vc(d,h);p(this,Gu).set(v.id,{targetId:h.id,text3d:d,text3DView:v}),p(this,Zc).set(d,{text3DView:v}),t.push(v)}),t}label(e,t,n={}){var a;if(p(this,Bu).call(this))if(si.is(e)){let l=(a=p(this,Bu).call(this))==null?void 0:a.Text3D.label(e,t,n);if(!l)return;let h=l.textInfo.id.toString(),d=p(this,Zc).get(h);if(d)return d.text3DView;let m=new Vc(h,l.target);return p(this,Gu).set(m.id,{targetId:l.target.id,text3d:h,text3DView:m}),p(this,Zc).set(h,{text3DView:m}),m}else throw new Error("Non-space target is not supported")}remove(e){var i;let t=typeof e=="string"?e:e.id,n=p(this,Gu).get(t);n&&((i=p(this,Bu).call(this))==null||i.Text3D.remove(n.text3d),p(this,Gu).delete(t),p(this,Zc).delete(n.text3d))}removeAll(){p(this,Gu).forEach(e=>{var t;(t=p(this,Bu).call(this))==null||t.Text3D.remove(e.text3d)}),p(this,Gu).clear()}};Bu=new WeakMap,Gu=new WeakMap,Zc=new WeakMap,u(ew,"Text3D");var c2=ew;var p2=.05,s0,nw=class nw{constructor(e,t){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");F(this,s0,!1);b(this,"mapView");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",u(()=>{this.core.render()},"update"));this.core=e,this.mapView=t,this.Camera=new C1(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new R1("outdoors-container",void 0,void 0,this);this.mapObjects.push(n),this.currentMap=n,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")}),this.core.on("resize",()=>{this.mapView.publish("resize")}),this.core.on("render-error",({error:m})=>{this.mapView.publish("render-error",{error:new oT(m instanceof Error?m.message:"Unknown error")})});let i=u(m=>{let v=this.getMapDataObject(m);switch(v==null?void 0:v.__type){case"facade":return v;case"floor":return v.floorStack.facade;default:return null}},"getFacadeFromEntityId");this.core.on("geometry-in-focus",m=>{let v=new Set;for(let x of m){let S=i(x);S&&v.add(S)}this.mapView.publish("facades-in-view-change",{facades:Array.from(v)})}),this.core.getSystems().renderSystem.on("camera-state-change",()=>{this.mapView.publish("state-change-internal",{Camera:this.getCameraState()})});let a=new y1(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",a)});let l=u(m=>v=>{let x=[],S=[],I=[],w=[];v.labels.forEach(q=>{let k=this.Labels.getById(q.toString());k&&x.push(k.label)}),v.markers.forEach(q=>{let k=this.Markers.getById(q.toString())||this.Navigation.getMarkerById(q.toString());k&&S.push(k.marker)}),v.models.forEach(q=>{let k=this.Models.getById(q.toString());k&&I.push(k.model)}),v.paths.forEach(q=>{let k=this.Paths.getById(q.toString())||this.Navigation.getPathById(q.toString());k&&w.push(k.path)});let P=v.geometry.includes(X1),E=v.geometry.filter(q=>q!==X1),O;E.length>0&&(O=E.map(q=>{var k;return(k=this.getMapDataInternal())==null?void 0:k.getById("space",q)}).filter(Boolean)[0],O||(O=E.map(q=>{var k;return(k=this.getMapDataInternal())==null?void 0:k.getById("object",q)}).filter(Boolean)[0]),O||(O=E.map(q=>this.Shapes.getById(q)).filter(Boolean)[0]));let N=v.containers.reduce((q,k)=>{var ut;let tt=(ut=this.getMapDataInternal())==null?void 0:ut.getById("floor",k);return tt&&Co.is(tt)&&q.push(tt),q},[]),L,G=0;if(N.length>0){L=N[0].id;let q=this.core.getState(L);G=v.coordinate[2]?v.coordinate[2]-q.altitude:G}let j;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(q=>{this.core.setState(q.id,{hovered:!1})}),O&&si.is(O)&&(j=E.map(q=>{var k;return(k=this.getMapDataInternal())==null?void 0:k.facadesBySpaceId[q]}).filter(Boolean)[0],j&&j.spaces.forEach(q=>{this.core.setState(q.id,{hovered:!0})})),this.lastFacadeIntersected=j;let $={coordinate:new ve({latitude:v.coordinate[1],longitude:v.coordinate[0],floorId:L,verticalOffset:G}),spaces:O&&si.is(O)?[O]:[],objects:O&&Fo.is(O)?[O]:[],shapes:O&&Su.is(O)?[O]:[],markers:S,labels:x,models:I,paths:w,blueDot:P,floors:N,facades:j?[j]:[]};"pointerEvent"in v&&($.pointerEvent=v.pointerEvent),this.mapView.publish(m,$)},"createHandler");this.core.on("hover",l("hover")),this.core.on("click",l("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let h={currentMapGetter:u(()=>this.currentMap,"currentMapGetter")};this.Markers=new F1(h),this.Models=new j1(h),this.Labels=new M1(h),this.Text3D=new c2(h),this.Exporter=new I1(h),this.Paths=new z1(h),this.Navigation=new x1(this.core,this,h.currentMapGetter),this.Navigation.on("navigation-state-change",m=>{this.mapView.publish("state-change-internal",{Navigation:m})}),this.BlueDot=new Mm(this.core,this),this.BlueDot.on("position-update",m=>{this._publishBlueDotState({coordinate:this.BlueDot.coordinate,heading:this.BlueDot.heading,accuracy:this.BlueDot.accuracy,floor:this.BlueDot.floor}),this.mapView.publish("blue-dot-position-update",m)}),this.BlueDot.on("state-change",m=>{this._publishBlueDotState({state:this.BlueDot.state}),this.mapView.publish("blue-dot-state-change",m)}),this.BlueDot.on("error",m=>{this.mapView.publish("blue-dot-error",m)}),this.BlueDot.on("follow-change",m=>{this._publishBlueDotState({following:this.BlueDot.following}),this.mapView.publish("blue-dot-follow-change",m)}),this.Outdoor=new wm(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{this.mapView.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{this.mapView.publish("outdoor-style-loaded")})),this.Images=new G1(h),this.Shapes=new Q1(h),this.Style=new e0(h);let d=new t2(t,this.mapDataExternal);this.auto=d.auto}get manualFloorVisibility(){return p(this,s0)}set manualFloorVisibility(e){V(this,s0,e),this.mapView.publish("state-change-internal",{manualFloorVisibility:e})}get StackedMaps(){return this.currentMap.StackedMaps}preloadFloors(e){e.forEach(t=>{t instanceof Co&&this.core.setState(t.id,{preloadGeometry:!0})})}updateState(e,t){if(e==="interior-walls"){this.currentMap.floors.forEach(a=>{let l=a.layers.get(Rn);if(l){let h=l.layers.get(gc);h&&this.core.hasState(h)&&this.core.setState(h,rw(t,this.core.getState(h)))}});return}else if(e==="exterior-walls"){this.currentMap.floors.forEach(a=>{let l=a.layers.get(Rn);if(l){let h=l.layers.get(Ka);h&&this.core.hasState(h)&&this.core.setState(h,rw(t,this.core.getState(h)))}});return}else if(e==="interior-doors"){this.currentMap.floors.forEach(a=>{let l=a.layers.get(Rn);if(l){let h=l.layers.get(md);h&&this.core.hasState(h)&&this.core.setState(h,h2(t,this.core.getState(h)))}});return}else if(e==="exterior-doors"){this.currentMap.floors.forEach(a=>{let l=a.layers.get(Rn);if(l){let h=l.layers.get(gd);h&&this.core.hasState(h)&&this.core.setState(h,h2(t,this.core.getState(h)))}});return}let n=typeof e=="string"?this.getMapDataObject(e):e;if(n){if(n.__type!=="Path"&&!this.core.hasState(n.id)){K.warn('Failed to update state for "'.concat(n.id,'". No ').concat(n.__type," found with that ID."));return}if(Bc.is(n))return this.core.setState(n.id,zD(et(z({},t),{type:"label"}),this.core.getState(n.id)));if(Cu.is(n))return this.core.setState(n.id,HD(et(z({},t),{type:"marker"}),this.core.getState(n.id)));if(si.is(n)||Fo.is(n)){let a=this.core.getState(n.id);if(a!=null){let l=a.parent&&a.parent.type==="geometry-group"?this.core.getState(a.parent):void 0;this.core.setState(n.id,XD(et(z({},t),{type:"geometry"}),a,l))}}if(ia.is(n)&&this.core.setState(n.id,h2(et(z({},t),{type:"doors"}),this.core.getState(n.id))),Su.is(n)&&this.core.setState(n.id,es(t,["altitude","color","opacity","height","visible","interactive"])),Jh.is(n)){let i=t,{position:a,scale:l}=i,d=Zs(i,["position","scale"]);a&&(d.position=[a.longitude,a.latitude,a.verticalOffset]),l!=null&&(Array.isArray(l)?d.scale=l:d.scale=[l,l,l]),a&&n.updateTarget(a),this.core.setState(n.id,d)}if(Co.is(n)){let a=this.currentMap.floorsById.get(n.id);if(a==null)return;this.core.setState(n.id,es(t,["visible","altitude"]));let l=a.layers.get(Rn);l!=null&&"geometry"in t&&this.core.setState(l.containerId,es(t.geometry,["opacity","visible"]));let h=a.layers.get(eu);h!=null&&"labels"in t&&"enabled"in t.labels&&typeof t.labels.enabled=="boolean"&&h.setVisible(t.labels.enabled);let d=a.layers.get(Qa);d!=null&&"markers"in t&&"enabled"in t.markers&&typeof t.markers.enabled=="boolean"&&d.setVisible(t.markers.enabled);let m=a.layers.get(Fg);m!=null&&"footprint"in t&&this.core.setState(m.containerId,es(t.footprint,["visible","height","opacity","side","color","altitude"]));let v=a.layers.get(Hp);v!=null&&"occlusion"in t&&"enabled"in t.occlusion&&typeof t.occlusion.enabled=="boolean"&&v.setVisible(t.occlusion.enabled);let x=a.layers.get(tl);x!=null&&"images"in t&&"visible"in t.images&&typeof t.images.visible=="boolean"&&x.setVisible(t.images.visible)}if(Is.is(n)){let a=this.core.getState(n.id);for(let l of a.children)l.type==="group-container"&&this.core.setState(l.id,es(t,["opacity","visible"]))}if(Vc.is(n)&&this.core.setState(n.id,es(t,Vb)),da.is(n))for(let a of n.segments)this.core.setState(a.id,es(t,WW));hm.is(n)&&this.core.setState(n.id,es(t,ZW))}}getMapDataObject(e){var t;return(t=this.getMapDataInternal())==null?void 0:t.getMapDataById(e)}getMapDataInternal(){if(this.mapData)return ey(this.mapData)}getMapData(){return this.mapData}addMap(e,t){return new Promise(n=>{var x,S,I,w;let i;try{i=ey(e)}catch(P){K.error("Error adding map",P),n(e);return}this.mapDataExternal[e.mapName]=e,this.mapData=e;let{mvf:a}=i,l=a["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new ve(l[1],l[0])});let h=a["manifest.geojson"].features[0].properties.name,d=new R1("mapObject-".concat(h),i,t,this);this.currentMap=d,this.currentMap.setFloor(this.currentMap.startingFloorId);let m=this.core.getBoundingArea(d.currentFloor.id);m==null&&K.error("Could not determine bounding box for map:",d.currentFloor.id);let v=(S=(x=t==null?void 0:t.outdoorView)==null?void 0:x.layersHiddenByGeometry)!=null?S:[];if(v.length>0){let P,E=[];for(let O of d.floorStacksById.values())if(O.defaultFloor.footprint&&O.defaultFloor.footprint.geometry!=null&&((I=O.defaultFloor.footprint.geometry)==null?void 0:I.coordinates.length)>0){let N=O.defaultFloor.footprint,L=n2(N);P==null?P=L:qD(P,L),E.push(N)}E.length>0&&P!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(P,E,v),this.hiddenOutdoorGeometries.push([P,E,v]))}if(this.mapObjects.push(d),i.getMVFFeatureByType("floor").forEach(P=>{this.mapsByFloorId[P.id]=d}),d.on("navigation-connection-click",P=>{this.mapView.publish("navigation-connection-click",P)}),d.on("navigation-active-path-change",P=>{this.mapView.publish("navigation-active-path-change",P)}),d.StackedMaps.on("stacked-maps-state-change",({state:P})=>{this.mapView.publish("stacked-maps-state-change",{state:P})}),d.on("floor-change-start",P=>{var E,O,N,L;this.mapView.publish("floor-change-start",{reason:P.reason,floor:(O=(E=this.getMapDataInternal())==null?void 0:E.getById("floor",P.floorId))!=null?O:this.currentFloor,previousFloor:(L=(N=this.getMapDataInternal())==null?void 0:N.getById("floor",P.previousFloorId))!=null?L:this.currentFloor})}),d.on("floor-change",P=>{var E,O;this.mapView.publish("floor-change",{reason:P.reason,floor:this.currentFloor,previousFloor:(O=(E=this.getMapDataInternal())==null?void 0:E.getById("floor",P.previousFloorId))!=null?O:this.currentFloor}),this.mapView.publish("state-change-internal",{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack})}),(t==null?void 0:t.zoomLevel)!=null)this.core.camera.setZoomLevel(t.zoomLevel),n(e);else if(this.core.mode!=="outdoors-overlay"&&m){let P=(w=t==null?void 0:t.screenOffsets)!=null?w:{top:p2*this.core.canvasHeight,left:p2*this.core.canvasWidth,right:p2*this.core.canvasWidth,bottom:p2*this.core.canvasHeight};this.core.camera.focusOn(m,{duration:$6,padding:P}).then(()=>{this.Camera.setElevation(this.currentFloor.elevation),n(e)})}else n(e)})}setFloor(e,t){return this.currentMap.setFloor(Lg(e),t)}setFloorStack(e,t){return this.currentMap.setFloorStack(Lg(e),t)}updateWatermark(e){this.core.updateWatermark(e)}get currentFloorStack(){var n;let e=this.currentMap.currentFloorStack.id;if(!e)throw new xi("Missing currentFloorStack.");let t=(n=this.mapData)==null?void 0:n.getById("floor-stack",e);if(!t)throw new xi("FloorStack was not found in map data.");return t}get currentFloor(){var n;let e=this.currentMap.currentFloor.id;if(!e)throw new xi("Missing currentFloor object from GeoJsonApi");let t=(n=this.mapData)==null?void 0:n.getById("floor",e);if(!t)throw new xi("Missing currentFloor");return t}getState(e){var i,a,l,h,d,m,v,x,S,I,w,P,E,O,N,L,G,j,$,q,k,tt;typeof e=="object"&&da.is(e)&&K.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let t=YD(e,this),n=this.core.getState(t);if(n)if(["interior-walls","exterior-walls"].includes(e)){let{color:ut,topColor:at,texture:H,topTexture:St,visible:pt,height:ct,opacity:It}=n;return{type:"walls",visible:pt,color:ut,topColor:at,texture:H?{url:H}:void 0,topTexture:St?{url:St}:void 0,height:ct,opacity:It}}else if(["interior-doors","exterior-doors"].includes(e)){let{color:ut,topColor:at,texture:H,topTexture:St,visible:pt,opacity:ct}=n;return{type:"doors",visible:pt,color:ut,topColor:at,opacity:ct,texture:H?{url:H}:void 0,topTexture:St?{url:St}:void 0}}else if(n.type==="geometry"){let ut;"parent"in n&&n.parent&&n.parent.type==="geometry-group"&&(ut=this.core.getState(n.parent));let at=ut!=null&&ut.altitude?n.altitude+ut.altitude:n.altitude;return{type:"geometry",interactive:n.interactive,hoverColor:n.hoverColor,color:n.color,visible:n.visible,opacity:n.opacity,height:n.height,texture:n.texture?{url:n.texture}:void 0,topTexture:n.topTexture?{url:n.topTexture}:void 0,flipImageToFaceCamera:n.flipImageToFaceCamera,topColor:n.topColor,altitude:at}}else{if(n.type==="label"&&n.options.appearance&&n.options.rank!==void 0&&n.options.interactive!==void 0)return{type:"label",text:n.text,appearance:n.options.appearance,rank:n.options.rank,enabled:n.enabled,interactive:n.options.interactive};if(n.type==="marker"&&((i=n.options)==null?void 0:i.rank)!==void 0&&n.options.interactive!==void 0){let ut=typeof n.parent=="object"?n.parent.id:n.parent,at=this.Markers.getById(n.id.toString()),H=at!=null&&at.marker.target?at==null?void 0:at.marker.target.anchorTarget:void 0;return H==null&&(H=new ve(n.position[1],n.position[0],ut.toString())),{type:"marker",rank:n.options.rank,interactive:n.options.interactive,enabled:n.enabled,element:n.element,anchor:n.anchor,zIndex:n.options.zIndex,dynamicResize:n.dynamicResize,lowPriorityPin:n.options.lowPriorityPin,contentHTML:n.contentHTML}}else if(n.type==="model"){let ut=n!=null&&typeof n.parent=="object"?n.parent.id.toString():(a=n.parent)==null?void 0:a.toString();return delete n.parent,et(z({},n),{position:new ve({latitude:n.position[1],longitude:n.position[0],verticalOffset:n.position[2],floorId:ut}),type:"model"})}else{if(n.type==="image")return{type:"image"};if(n.type==="text3d")return n;if(n.type==="geometry-group"&&e&&typeof e!="string"&&Su.is(e)){let[ut]=n.children;if(ut.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(l=n.altitude)!=null?l:0,visible:n.visible,color:n.color,height:ut.height,opacity:n.opacity,interactive:n.interactive}}else{if(n.type==="path")return{type:"path",color:n.color,visible:n.visible,nearRadius:n.nearRadius,farRadius:n.farRadius,altitude:n.altitude,completeFraction:n.completeFraction};if(n.type==="group-container"&&typeof e!="string"&&Co.is(e)){let ut=(h=this.currentMap.floorsById.get(e.id))==null?void 0:h.layers.get(Rn),at=ut?this.core.getState(ut.containerId):void 0,H=(d=this.currentMap.floorsById.get(e.id))==null?void 0:d.layers.get(eu),St=(m=this.currentMap.floorsById.get(e.id))==null?void 0:m.layers.get(Qa),pt=(v=this.currentMap.floorsById.get(e.id))==null?void 0:v.layers.get(Fg),ct=pt?this.core.getState(pt.containerId):void 0,It=(x=this.currentMap.floorsById.get(e.id))==null?void 0:x.layers.get(Hp),Et=It?this.core.getState(It.containerId):void 0,dt=(S=this.currentMap.floorsById.get(e.id))==null?void 0:S.layers.get(tl),bt=dt?this.core.getState(dt.containerId):void 0;return{type:"floor",geometry:{opacity:(I=at==null?void 0:at.opacity)!=null?I:0,visible:(w=at==null?void 0:at.visible)!=null?w:!0},labels:{enabled:(P=H==null?void 0:H.visible)!=null?P:!1},markers:{enabled:(E=St==null?void 0:St.visible)!=null?E:!1},footprint:{altitude:(O=ct==null?void 0:ct.altitude)!=null?O:0,visible:(N=ct==null?void 0:ct.visible)!=null?N:!1,height:(L=ct==null?void 0:ct.height)!=null?L:0,opacity:(G=ct==null?void 0:ct.opacity)!=null?G:0,side:(j=ct==null?void 0:ct.side)!=null?j:"double",color:($=ct==null?void 0:ct.color)!=null?$:"white"},images:{visible:(q=bt==null?void 0:bt.visible)!=null?q:!1},occlusion:{enabled:(k=Et==null?void 0:Et.visible)!=null?k:!1},visible:n.visible,altitude:(tt=n.altitude)!=null?tt:0}}else if(n.type==="group-container"&&n.children.length>0&&typeof e!="string"&&Is.is(e)){let ut=this.core.getState(n.children[0].id);return{type:"facade",opacity:ut.opacity,visible:ut.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,t,n){var d;if(n!=null){let m=this.core.projectScreenXYToCoordinate(e,t,!0);return m?new ve(m.coordinate[1],m.coordinate[0],n.id):void 0}let i=this.core.projectScreenXYToCoordinate(e,t);if(i==null||i.coordinate==null)return;let{coordinate:a,groupContainers:l}=i,h=(d=l==null?void 0:l.find(m=>{let v=m.userData.entityId.toString();return v.includes("f_")||v.includes("m_")}))==null?void 0:d.userData.entityId.toString();return new ve(a[1],a[0],h)}getScreenCoordinateFromCoordinate(e){var n,i,a;let t=0;if(e.floorId!=null){let l=(n=this.mapData)==null?void 0:n.getById("floor",e.floorId);l!=null&&(t=(a=(i=this.getState(l))==null?void 0:i.altitude)!=null?a:0)}return this.core.projectCoordinateToScreenXY([e.longitude,e.latitude,t])}isInView(e){return this.core.isInView(typeof e=="string"?e:e.id)}auto(){return{labels:this.Labels.all()}}tween(e){let t=new jo(e);return this.core.getExternalTweenGroup().add(t),this.core.render(),t}removeTween(e){this.core.getExternalTweenGroup().remove(e)}tweenGroup(){return this.core.getExternalTweenGroup()}get __core(){return this.core}getCameraState(){return this.core.camera.getState()}getNavigationState(){return{isMultiFloor:this.Navigation.isMultiFloor,floorStacks:this.Navigation.floorStacks,floors:this.Navigation.floors,activeDirections:this.Navigation.activeDirections,activePath:this.Navigation.activePath,paths:this.Navigation.paths}}getAllState(){return{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack,Camera:this.getCameraState(),Navigation:this.getNavigationState(),manualFloorVisibility:this.manualFloorVisibility}}publishAllState(){this.mapView.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 t;if(e)t=e;else{let{state:n,following:i,heading:a,accuracy:l,coordinate:h,floor:d}=this.BlueDot;t={state:n,following:i,heading:a,accuracy:l,coordinate:h,floor:d}}this.mapView.publish("state-change-internal",{BlueDot:t})}getOptimalVisualDistanceBetweenFloors(e,t=!1){let n=this.currentMap;if(!n){K.error("Cannot compute optimal visual distance between floors. Missing current map.");return}if(e.length<2){K.warn("Cannot compute optimal visual distance between floors. Must provide at least 2 floors.");return}let i=n.renderer.getInternalState().geometry3DMap.get(e[0].id),a=n.renderer.getInternalState().geometry3DMap.get(e[1].id);if(!i||!a){K.warn("Cannot compute optimal visual distance between floors. Floors not found in current map.");return}if(Vl(i,"group-container"),Vl(a,"group-container"),t){let h=new _n;h.setFromObject(i);let d=new _n;if(d.setFromObject(a),i.children.forEach(P=>{P instanceof ue&&P.userData.debugBox&&Zr(P)}),a.children.forEach(P=>{P instanceof ue&&P.userData.debugBox&&Zr(P)}),!xs(h)||!xs(d))return;let m=new No(h.max.x-h.min.x,h.max.y-h.min.y,h.max.z-h.min.z),v=new Tn({color:255,transparent:!0,opacity:.5}),x=new ue(m,v);x.position.set((h.min.x+h.max.x)/2,(h.min.y+h.max.y)/2,(h.min.z+h.max.z)/2),x.userData.debugBox=!0;let S=new No(d.max.x-d.min.x,d.max.y-d.min.y,d.max.z-d.min.z),I=new Tn({color:"cyan",transparent:!0,opacity:.5}),w=new ue(S,I);w.position.set((d.min.x+d.max.x)/2,(d.min.y+d.max.y)/2,(d.min.z+d.max.z)/2),w.userData.debugBox=!0,i.add(x),a.add(w)}let l=n.renderer.computeMinZOffsetBetweenContainers(i,a);if(l!==-1)return l}};s0=new WeakMap,u(nw,"GeoJsonApi");var o0=nw;function WD(r){VT("".concat(r,"/maplibre-worker.csp.js")),yS("".concat(r,"/collision-worker.csp.js"))}u(WD,"setWorkersUrl");var WW=["color","nearRadius","farRadius","visible","completeFraction","altitude"],ZW=["color","altitude"];y();var iw=class iw{constructor(e){b(this,"state");b(this,"update");this.update=e.Debug.update.bind(e.Debug),this.state=e.Debug.state}};u(iw,"Debug");var f2=iw;y();var ZD=zi.object({environment:zi.union([zi.literal("basic"),zi.literal(!1)]).optional(),text3d:zi.object({hoverColor:zi.string().optional()}).optional(),geometry:zi.object({hoverColor:zi.string().optional()}).optional(),backgroundColor:zi.string().optional(),backgroundAlpha:zi.number().optional()}).strict();y();var ow=Wr(l3(),1);var $W=u((r,e)=>{let t={},n=u((i,a,l)=>{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?(l[h]={},n(d,m,l[h])):l[h]=d}},"processObject");return n(r,e,t),t},"extractProperties"),$D=u((r,e)=>{let t=$W(r,e),n=(0,ow.default)({},t,e),i=(0,ow.default)({},t),a=u((l,h,d,m=i)=>{for(let v in h){let x=l[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(ng(x)&&ng(S)){let I=G2(x),w=G2(S);I&&w?m[v]=OT([I[0]+(w[0]-I[0])*d,I[1]+(w[1]-I[1])*d,I[2]+(w[2]-I[2])*d]):K.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]):K.warn('Value "'.concat(v,'" could not be animated!'))}},"interpolate");return l=>(l=Math.min(Math.max(l,0),1),l===0?r:l===1?n:(a(t,e,l),i))},"animationFactory");var Vt,Sl,sw=class sw extends ie{constructor(t){super();F(this,Vt);F(this,Sl);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",u(()=>{p(this,Vt).core.render()},"update"));b(this,"getDirections",u((t,n,i)=>{var a;return(a=p(this,Vt).getMapData())==null?void 0:a.getDirections(t,n,i)},"getDirections"));b(this,"getDirectionsMultiDestination",u((t,n,i)=>{var a;return(a=p(this,Vt).getMapData())==null?void 0:a.getDirectionsMultiDestination(t,n,i)},"getDirectionsMultiDestination"));b(this,"on",u((t,n)=>{super.on(t,n)},"on"));b(this,"off",u((t,n)=>{super.off(t,n)},"off"));b(this,"Debug");V(this,Sl,t);let n=new o0(t,this);V(this,Vt,n),this.Camera=p(this,Vt).Camera,this.Markers=p(this,Vt).Markers,this.Models=p(this,Vt).Models,this.Labels=p(this,Vt).Labels,this.Text3D=p(this,Vt).Text3D,this.Exporter=p(this,Vt).Exporter,this.Paths=p(this,Vt).Paths,this.Navigation=p(this,Vt).Navigation,this.BlueDot=p(this,Vt).BlueDot,this.Shapes=p(this,Vt).Shapes,this.Style=p(this,Vt).Style,this.auto=p(this,Vt).auto,this.Outdoor=p(this,Vt).Outdoor,this.Images=p(this,Vt).Images,p(this,Sl).container.dataset.version=T.env.npm_package_version,this.Debug=new f2(p(this,Vt).core)}get StackedMaps(){return p(this,Vt).currentMap.StackedMaps}updateState(t,n){return p(this,Vt).updateState(t,n)}animateState(t,n,i){var m;let a=p(this,Vt).getState(t);if(a==null)return K.warn("Cannot animate state of ".concat(t,".")),new Promise(x=>x({result:"completed"}));let l=$D(a,n),h=p(this,Vt).tween({percent:0}).to({percent:1},(m=i==null?void 0:i.duration)!=null?m:1e3).onUpdate(({percent:v})=>{p(this,Vt).updateState(t,l(v))});i!=null&&i.easing&&i.easing in yu&&h.easing(yu[i.easing]);let d=new Promise(v=>{h.onComplete(()=>{p(this,Vt).removeTween(h),v({result:"completed"})}).onStop(()=>{p(this,Vt).removeTween(h),v({result:"cancelled"})}),h.start()});return d.cancel=()=>{h.stop(),p(this,Vt).updateState(t,l(0))},d}updateGlobalState(t){var n,i,a,l;try{ZD.parse(t)}catch(h){K.error("updateGlobalState",h);return}if(typeof t=="object"){let h={};if((n=t.text3d)!=null&&n.hoverColor&&(h.text3dHoverColor=t.text3d.hoverColor),(i=t.geometry)!=null&&i.hoverColor&&(h.hoverColor=t.geometry.hoverColor),t.backgroundColor||t.backgroundAlpha!==void 0){let d=(a=t.backgroundColor)!=null?a:p(this,Vt).core.backgroundColor,m=(l=t.backgroundAlpha)!=null?l:p(this,Vt).core.backgroundAlpha;p(this,Vt).core.setBackgroundColor(d,m)}t.environment!=null&&p(this,Vt).core.setEnvironment(t.environment),p(this,Vt).core.setState(h)}}get options(){return t7(p(this,Vt).currentMap.options)}getGlobalState(){let t=p(this,Vt).core.getState();return{backgroundColor:p(this,Vt).core.backgroundColor,backgroundAlpha:p(this,Vt).core.backgroundAlpha,environment:p(this,Vt).core.getEnvironment(),geometry:{hoverColor:t.hoverColor},text3d:{hoverColor:t.text3dHoverColor}}}getMapData(){if(p(this,Vt).mapData==null)throw new xi("MapData not found.");return p(this,Vt).mapData}getDimensions(){return{width:p(this,Sl).canvasWidth,height:p(this,Sl).canvasHeight}}expand(t){var n;return(n=p(this,Vt).currentMap)==null?void 0:n.StackedMaps.expand(t)}collapse(t){var n;return(n=p(this,Vt).currentMap)==null?void 0:n.StackedMaps.collapse(t)}addMap(t,n){return p(this,Vt).addMap(t,n)}setFloor(t,n){return p(this,Vt).setFloor(t,n==null?void 0:n.context)}setFloorStack(t,n){return p(this,Vt).setFloorStack(t,n==null?void 0:n.context)}preloadFloors(t){p(this,Vt).preloadFloors(t)}tween(t){return p(this,Vt).tween(t)}removeTween(t){p(this,Vt).removeTween(t)}get tweenGroup(){return p(this,Vt).tweenGroup()}get currentFloorStack(){return p(this,Vt).currentFloorStack}get currentFloor(){return p(this,Vt).currentFloor}updateWatermark(t){p(this,Vt).updateWatermark(t)}getState(t){return p(this,Vt).getState(t)}setHoverColor(t){p(this,Vt).setHoverColor(t)}getHoverColor(){return p(this,Vt).getHoverColor()}convertAltitudeToMercatorZoomLevel(t){return p(this,Vt).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(t)}convertMercatorZoomLevelToAltitude(t){return p(this,Vt).core.getSystems().cameraSystem.convertZoomLevelToAltitude(t)}isInView(t){return p(this,Vt).isInView(t)}getDistance(t,n){var i;return(i=p(this,Vt).getMapData())==null?void 0:i.getDistance(t,n)}createCoordinate(t,n,i){return typeof t=="object"?new ve(t):new ve(t,n,i==null?void 0:i.id)}createCoordinateFromScreenCoordinate(t,n,i){return p(this,Vt).createCoordinateFromScreenCoordinate(t,n,i)}getScreenCoordinateFromCoordinate(t){return p(this,Vt).getScreenCoordinateFromCoordinate(t)}auto(){return{labels:this.Labels.all()}}get __core(){if(T.env.INTERNAL==="true")return p(this,Vt).core;throw new Error("__core is not available.")}get container(){return p(this,Sl).container}publishAllState(){p(this,Vt).publishAllState()}clear(){p(this,Vt).clear()}destroy(){p(this,Vt).destroy()}async enableDebug(t={}){let{Inspector:n}=await import("./inspector-QLDKCE66.js");await new n(this,p(this,Vt)).enable(t)}async takeScreenshot(){return await p(this,Sl).renderSync(),p(this,Sl).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return p(this,Vt).manualFloorVisibility}set manualFloorVisibility(t){p(this,Vt).manualFloorVisibility=t}getOptimalVisualDistanceBetweenFloors(t){return p(this,Vt).getOptimalVisualDistanceBetweenFloors(t)}};Vt=new WeakMap,Sl=new WeakMap,u(sw,"MapView");var Tm=sw;y();y();var aw=class aw extends ie{constructor(t){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",u(()=>{!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",u(()=>{if(!this.map)return;let[t,n]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(t,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",u(t=>{K.warn(t)},"handleError"));this.origin=t}onAdd(t){this.origin=this.origin||t.getCenter().toArray(),this.gl=t.painter.context.gl,this.core=new p1(t._container,{center:this.origin,zoomLevel:t.getZoom(),pitch:t.getPitch(),bearing:t.getBearing(),gl:this.gl,map:t,mode:"outdoors-overlay"}),this.map=t,this.core.camera.setMinZoomLevel(t.getMinZoom()),this.core.camera.setMaxZoomLevel(t.getMaxZoom()),this.core.camera.setMinPitch(t.getMinPitch()),this.core.camera.setMaxPitch(t.getMaxPitch()),this.map.on("error",this.handleError);let n=BT.fromLngLat(this.origin,0);return this.layer=U0(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}};u(aw,"MapLibreOverlay");var d2=aw;var cf,Pm,$c,pf,a0=class a0 extends ie{constructor(t,n,i){super();F(this,cf);F(this,Pm);F(this,$c);F(this,pf);b(this,"on",u((t,n)=>{super.on(t,n)},"on"));b(this,"off",u((t,n)=>{super.off(t,n)},"off"));V(this,pf,new d2(t)),V(this,cf,n),V(this,Pm,i)}onAdd(t){var a,l;let n=p(this,pf).onAdd(t),i=et(z(z({},zp),(a=p(this,Pm))!=null?a:{}),{outdoorView:z({token:p(this,cf).outdoorViewToken},(l=p(this,Pm))==null?void 0:l.outdoorView)});return V(this,$c,new Tm(p(this,pf).core)),p(this,$c).addMap(p(this,cf),i).then(()=>{this.publish("loaded",{mapView:p(this,$c),mapData:p(this,cf)})}),n}onRemove(){p(this,$c)&&p(this,$c).clear(),a0.instance=null,p(this,pf).onRemove()}};cf=new WeakMap,Pm=new WeakMap,$c=new WeakMap,pf=new WeakMap,u(a0,"MappedinMapLibreOverlay"),b(a0,"instance");var Em=a0;y();var JW=1e3*60*60*2,Jc,Dm,en,ba,xa,Rs,_a,Lm,Am,l0,pn,JD,KD,Om,m2,lw,uw,cw,pw=class pw{constructor(e,t){F(this,pn);F(this,Jc,new ie);F(this,Dm);F(this,en);F(this,ba);F(this,xa);F(this,Rs);F(this,_a);F(this,Lm);F(this,Am);F(this,l0,u(()=>{"key"in p(this,en)&&"secret"in p(this,en)&&gt(this,pn,Om).call(this),gt(this,pn,m2).call(this)},"#handleWindowFocus"));b(this,"on",u((e,t)=>p(this,Jc).on(e,t),"on"));b(this,"off",u((e,t)=>p(this,Jc).off(e,t),"off"));V(this,Dm,e),V(this,en,t)}setMapIds(e){V(this,Dm,e)}setEnterprise(e){p(this,en).enterprise=e}async readySync(){var i;if((!("key"in p(this,en))||!("secret"in p(this,en)))&&!("accessToken"in p(this,en))){K.error("No API keys or access token provided! Cannot preload tokens.");return}let e=[gt(this,pn,Om).call(this),null];p(this,en).enterprise||(e[1]=this.getSasTokensAsync());let[t,n]=await Promise.all(e);gt(this,pn,cw).call(this),gt(this,pn,lw).call(this,t),n!=null&&gt(this,pn,uw).call(this,n),rg()&&((i=globalThis.addEventListener)==null||i.call(globalThis,"focus",p(this,l0)))}async refreshing(){let e=[];return p(this,ba)!=null&&e.push(p(this,ba)),p(this,xa)!=null&&e.push(p(this,xa)),Promise.all(e)}getAccessTokenAsync(){return gt(this,pn,Om).call(this)}getSasTokensAsync(){return gt(this,pn,m2).call(this)}getAccessToken(){return p(this,Rs)==null?(K.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):p(this,Rs)}getSasToken(e){return this.isEnterpriseMode()?(K.error("SAS tokens are not available in the enterprise mode!"),{token:""}):p(this,_a)==null?(K.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):e in p(this,_a).tokens?p(this,_a).tokens[e]:(K.error("SAS token for map ".concat(e," not found!")),{token:""})}isEnterpriseMode(){var e;return(e=p(this,en).enterprise)!=null?e:!1}destroy(){gt(this,pn,cw).call(this),p(this,Jc).destroy(),rg()&&globalThis.removeEventListener("focus",p(this,l0))}};Jc=new WeakMap,Dm=new WeakMap,en=new WeakMap,ba=new WeakMap,xa=new WeakMap,Rs=new WeakMap,_a=new WeakMap,Lm=new WeakMap,Am=new WeakMap,l0=new WeakMap,pn=new WeakSet,JD=u(function(e){var n;let t=e.token!==((n=p(this,Rs))==null?void 0:n.token);V(this,Rs,e),t&&p(this,Jc).publish("access-token-refreshed",{accessToken:e})},"#setAccessToken"),KD=u(function(e){var n;let t=JSON.stringify(e.tokens)!==JSON.stringify((n=p(this,_a))==null?void 0:n.tokens);V(this,_a,e),t&&p(this,Jc).publish("sas-tokens-refreshed",{sasTokens:e.tokens})},"#setSasTokens"),Om=u(async function(e=!1){var t;if("accessToken"in p(this,en)&&typeof p(this,en).accessToken=="string"){let n={token:p(this,en).accessToken,expires:Date.now()+72e5};return V(this,Rs,n),n}if(!("key"in p(this,en))||!("secret"in p(this,en))||typeof p(this,en).key!="string"||typeof p(this,en).secret!="string")throw new Error("No API keys or access token provided!");return p(this,ba)!=null?p(this,ba):p(this,Rs)!=null&&p(this,Rs).expires!=null&&p(this,Rs).expires>Date.now()&&!e?p(this,Rs):(V(this,ba,Wg(et(z({},p(this,en)),{key:p(this,en).key,secret:p(this,en).secret}),(t=p(this,en).enterprise)!=null?t:!1).then(n=>{let i={token:n.accessToken,expires:n.expiresTimestamp*1e3};return gt(this,pn,JD).call(this,i),i})),p(this,ba).finally(()=>{V(this,ba,void 0)}),p(this,ba))},"#refreshAccessToken"),m2=u(async function(e=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:p(this,xa)!=null?p(this,xa):p(this,_a)!=null&&p(this,_a).expires>Date.now()&&!e?p(this,_a):(V(this,xa,new Promise((t,n)=>{gt(this,pn,Om).call(this).then(i=>{let a={},l=p(this,Dm).map(h=>nS(et(z({},p(this,en)),{mapId:h}),i.token).then(d=>{a[h]={token:d.token,expires:d.expires}}).catch(d=>{K.error("Error getting SAS token for map ".concat(h,":"),d)}));Promise.all(l).then(()=>{let h={tokens:a,expires:Math.min(...Object.values(a).map(d=>{var m;return(m=d.expires)!=null?m:1/0}))};gt(this,pn,KD).call(this,h),t(h)})}).catch(i=>{n(i)})})),p(this,xa).catch(t=>{throw t}).finally(()=>{V(this,xa,void 0)}),p(this,xa))},"#refreshSasTokens"),lw=u(function(e){if(!("key"in p(this,en))||!("secret"in p(this,en)))return;let t=e.expires!=null?e.expires-Date.now():JW;isFinite(t)&&V(this,Lm,setTimeout(()=>{gt(this,pn,Om).call(this,!0).then(n=>{gt(this,pn,lw).call(this,n)})},t-v7))},"#setAccessTokenRefresh"),uw=u(function(e){let t=e.expires-Date.now();isFinite(t)&&V(this,Am,setTimeout(()=>{gt(this,pn,m2).call(this,!0).then(n=>{gt(this,pn,uw).call(this,n)})},t-_7))},"#setSasTokensRefresh"),cw=u(function(){p(this,Lm)!=null&&clearTimeout(p(this,Lm)),p(this,Am)!=null&&clearTimeout(p(this,Am))},"#stopRefreshing"),u(pw,"TokenManager");var Nm=pw;y();var QD=u(async(r,e)=>{var w,P,E,O,N,L,G;let t=(E="mvfVersion"in(e!=null?e:{})?e==null?void 0:e.mvfVersion:void 0)!=null?E:"options"in r&&"version"in((w=r.options)!=null?w:{})?(P=r.options)==null?void 0:P.version:void 0,n=et(z({prefetchTokens:!0},e||{}),{mvfVersion:t}),i,a=Cc();a.updateByUserOption(n);let l={};if("type"in r&&typeof r.type=="string"){if(l.enterprise=(O=r.options)==null?void 0:O.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){i=await Zg(r.main,n.mvfVersion),l.languagePacks=[];for(let j of(N=r.languagePacks)!=null?N:[])j.localePack instanceof Uint8Array&&l.languagePacks.push({language:j.language,localePack:await Cd(j.localePack)})}else if(r.type==="json")i=r.main,l.languagePacks=(L=r.languagePacks)!=null?L:[];else throw new Error("Invalid backup type");r.type==="binary"&&r.main instanceof Uint8Array&&(l.binaryBundle=r.main)}else i=r,l.enterprise=i.enterprise!=null;let h=eb(i),d=h.length>0?h:[n.mapId],m=new Nm(d,et(z({},n),{enterprise:l.enterprise})),v;if("accessToken"in n)v=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=a.getBaseAuthUri(l.enterprise);let j=await m.getAccessTokenAsync();v=(j==null?void 0:j.token)||""}if(l.outdoorViewToken=v,l.env=a,l.getMapDataOptions=n,n.prefetchTokens)try{await m.readySync()}catch(j){K.error("Failed to ready token manager!",j)}let x=new hf(i,l);v&&x.Analytics.init(et(z({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:(G=n.analytics)==null?void 0:G.context}));let S=new ty(x),I=x.findPreferredLanguage({languageCode:n.language,fallbackToNavigatorLanguage:!1});if(I)try{await S.changeLanguage(I.code)}catch(j){}return typeof(e==null?void 0:e.onMVFParsed)=="function"&&e.onMVFParsed(i),S},"hydrateMapData");y();var tL=u((r,{id:e}={})=>{let t=Array.isArray(r)?r:[r];if(!t.every(a=>typeof a=="string"))return;let n=t.join(""),i=null;if(e){let a=document.getElementById(e);a instanceof HTMLStyleElement&&(i=a)}i==null&&(i=document.createElement("style")),e&&e!==""&&(i.id=e),i.textContent=n,document.head.appendChild(i)},"injectCSS");var eL=":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 rL=".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 nL=".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 iL=".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 oL=".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 sL='.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 iZ(r){var e,t;if(!(!r.languages||!rg()||!((t=(e=globalThis.navigator)==null?void 0:e.languages)!=null&&t.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}}}u(iZ,"findNavigatorPreferredLanguageInVenue");function g2(r,e){var l,h,d;let t=(l=e==null?void 0:e.languageCode)!=null?l:"",n=(h=e==null?void 0:e.fallbackToNavigatorLanguage)!=null?h:!0,i=(d=r==null?void 0:r.languages)==null?void 0:d.find(m=>m.code.toLowerCase()===t.toLowerCase()),a;if(i)a=i;else if(n==null||n)try{let m=iZ(r);m&&(a=m)}catch(m){K.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",m)}return a!=null?a:r.defaultLanguage}u(g2,"findPreferredLanguageInVenue");var oZ=[eL,rL,nL,iL,oL,sL],aL;function sZ(r){aL=r}u(sZ,"__setWatermarkOnClickFn");var aZ=u(async(r,e)=>{let t,n=Cc();e&&n.updateByUserOption(e);try{e&&(t=(await Wg(et(z({},e),{baseAuthUri:n.getBaseAuthUri()}))).accessToken)}catch(l){K.warn("Getting access token failed. Outdoor map disabled.",l)}let i=new hf(r,{outdoorViewToken:t,languagePacks:e==null?void 0:e.languagePacks,env:n});return new ty(i)},"hydrateMapDataFromMVF"),lL=!1;function lZ(r){lL=r}u(lZ,"setUseEnterpriseAPI");var uL=u(async r=>{var E,O;let e=lL,t,n=Cc();n.updateByUserOption(r);let i=et(z({prefetchTokens:!0},r),{fallbackToNavigatorLanguage:(E=r.fallbackToNavigatorLanguage)!=null?E:!0}),a=new Nm([i.mapId],i);if("accessToken"in i){t=i.accessToken;let{aud:N,sub:L}=D0(t);(J6.some(G=>N.includes(G))||L&&L.startsWith("client"))&&(e=!0,a.setEnterprise(e))}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_")||(e=!0,a.setEnterprise(e)),i.baseAuthUri=n.getBaseAuthUri(e),t=(await a.getAccessTokenAsync()).token}else throw new Error("Missing key or secret.");i.layoutId!=null&&(e?i.layoutId!=="draft"&&K.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):K.warn("layoutId is currently unsupported!")),i.baseUri=n.getBaseUri(e);let l=performance.now(),h,d;if(e){let N=et(z({},i),{venue:i.mapId,clientId:i.key,clientSecret:i.secret,version:"1.0.0",perspective:i.viewId,useDraftData:i.layoutId==="draft"}),L=await sS(N);h=L.compressed,d=L.localePacks}else h=await aS(i,t);let m=performance.now(),v=await Zg(h,i.mvfVersion),x=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(v);let S=eb(v);if(S.length>0?a.setMapIds(S):a.setMapIds([i.mapId]),i.prefetchTokens)try{await a.readySync()}catch(N){K.error("Failed to ready token manager!",N)}let I=new hf(v,{env:n,outdoorViewToken:t,tokenManager:a,enterprise:e,localePacksUrls:d,binaryBundle:h,getMapDataOptions:i}),w=new ty(I,{search:r.search});I.Analytics.init(et(z({accessToken:t,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:(O=i.analytics)==null?void 0:O.context})),I.Analytics.sendGetMapDataEvent({parseDuration:x-m,downloadDuration:m-l,viewId:i.viewId});let P=I.findPreferredLanguage({languageCode:i.language,fallbackToNavigatorLanguage:i.fallbackToNavigatorLanguage});if(P)try{await w.changeLanguage(P.code)}catch(N){}return w},"getMapData"),uZ=uL,cZ=u((r,e)=>{Em.instance!=null&&K.warn("Only a single map venue is supported at this time.");let t=new Em([r.mapCenter.longitude,r.mapCenter.latitude],r,e);return Em.instance=t,t},"createMapLibreOverlay"),cL=u(async(r,e,t)=>{var m,v,x,S,I,w,P,E,O,N,L,G,j,$,q;let n=performance.now(),i=HC(t,e);i&&zC(i),((m=i.injectStyles)==null||m)&&tL(oZ,{id:"mappedin__styles"});let a=Q6((v=e.outdoorViewToken)!=null?v:""),l=ey(e);(x=i.outdoorView)!=null&&x.style&&l.envControl.updateTileServerBaseUrl((S=i.outdoorView)==null?void 0:S.style);let h=await iD(r,{center:[e.mapCenter.longitude,e.mapCenter.latitude],bearing:i.bearing,pitch:i.pitch,zoomLevel:i.zoomLevel,backgroundAlpha:(I=i.style)==null?void 0:I.backgroundAlpha,backgroundColor:(w=i.style)==null?void 0:w.backgroundColor,outdoorView:(P=i.outdoorView)!=null&&P.token?{headers:{"x-mappedin-tiles-key":(E=i.outdoorView)==null?void 0:E.token},style:e.getEnv().tileServerUri,enabled:!!((O=i.outdoorView)!=null&&O.enabled),lowDpi:(N=i.outdoorView)==null?void 0:N.lowDpi}:void 0,watermark:et(z({},i.watermark),{visible:(G=(L=i.watermark)==null?void 0:L.visible)!=null?G:!l.enterpriseMode&&!a.remove_watermark,onClick:aL||void 0}),attribution:i.attribution,antialias:typeof i.antialiasing=="boolean"?i.antialiasing:!!((j=i.antialiasing)!=null&&j.enabled),accessToken:e.outdoorViewToken,occlusionEnabled:($=i.occlusion)==null?void 0:$.enabled,transformImageRequest:l.enterpriseMode?void 0:l.transformImageRequest,naturalBearing:e.naturalBearing,imagePlacementOptions:i.imagePlacementOptions,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:i.onWebGLContextRestored,onWebGLRendererError:i.onWebGLRendererError,useStandaloneCamera:(q=i.useStandaloneCamera)!=null?q:!1}),d=new Tm(h);return await d.addMap(e,i),l.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:d.getDimensions()}),d},"show3dMap"),pZ=cL;function ks(r){return r.verticalOffset===0?[r.longitude,r.latitude]:[r.longitude,r.latitude,r.verticalOffset]}u(ks,"convertCoordinateToPosition");function fZ(r){return new Map(r.map(e=>{let{properties:t}=e,{id:n}=t;return[n,e]}))}u(fZ,"getEntranceMap");var PM=u((r,e)=>{let t=fZ(e),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],l=(i.properties.entrances||[]).reduce((h,d)=>(t.has(d)&&h.push(t.get(d)),h),[]);if(l.length){let{entrances:h,obstructions:d}=hS(i,l);a=d.map(m=>m.geometry.coordinates),n.entrances.features.push(...h)}n.walls.geometry.coordinates.push(...a)}return n},"cutEntrancesFromLineStrings");function zD(r,e){let t={options:{}};if(!t.options)throw new Error("options should exist");return r.text&&(t.text=r.text),r.appearance&&(t.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=r.rank),r.enabled!==void 0&&(t.enabled=r.enabled),r.interactive!==void 0&&(t.options.interactive=r.interactive),r.enabled!==void 0&&(t.enabled=r.enabled),t}u(zD,"translateLabelStateToGeojsonCore");function HD(r,e){let t={options:{}};if(!t.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=r.rank),r.enabled!=null&&(t.enabled=r.enabled),r.interactive!=null&&(t.options.interactive=r.interactive),r.enabled!==null&&(t.enabled=r.enabled),r.contentHTML!==void 0&&(t.contentHTML=r.contentHTML),t}u(HD,"translateMarkerStateToGeojsonCore");function h2(r,e){var n,i;let t={};return e==null||(r.color&&(r.color==="initial"?t.color=e.initialColor:t.color=r.color),r.topColor&&(r.topColor==="initial"?t.topColor=e.initialTopColor:t.topColor=r.topColor),r.visible!==void 0&&(t.visible=r.visible),((n=r.texture)==null?void 0:n.url)!==void 0&&(t.texture=r.texture.url),((i=r.topTexture)==null?void 0:i.url)!==void 0&&(t.topTexture=r.topTexture.url),r.opacity!==void 0&&(t.opacity=r.opacity)),t}u(h2,"translateDoorsStateToGeojsonCore");function rw(r,e){var n,i;let t={};return e==null||(r.color&&(r.color==="initial"?t.color=e.initialColor:t.color=r.color),r.topColor&&(r.topColor==="initial"?t.topColor=e.initialTopColor:t.topColor=r.topColor),r.visible!==void 0&&(t.visible=r.visible),((n=r.texture)==null?void 0:n.url)!==void 0&&(t.texture=r.texture.url),((i=r.topTexture)==null?void 0:i.url)!==void 0&&(t.topTexture=r.topTexture.url),r.height!==void 0&&(t.height=r.height),r.opacity!==void 0&&(t.opacity=r.opacity)),t}u(rw,"translateWallsStateToGeojsonCore");function XD(r,e,t){var i,a,l;let n={};return e==null||(r.color&&(r.color==="initial"?n.color=e.initialColor:n.color=r.color),r.topColor&&(r.topColor==="initial"?n.topColor=e.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-((l=t==null?void 0:t.altitude)!=null?l:0))),n}u(XD,"translateSpaceStateToGeojsonCore");function pL(r,e){return((e-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}u(pL,"differenceBetweenAngles");function hL(r,e){let t="Left";return r<=-Math.PI/4?t="Right":r<=-e?t="SlightRight":r<=e?t="Straight":r<=Math.PI/4?t="SlightLeft":t="Left",t}u(hL,"getRelativeBearing");function MD(r){let e={};for(let t in r){let n=r[t];if(n!=null){if(n.id=t,"polygons"in n)for(let i of n.polygons)e[i]=n;else if("lineStrings"in n)for(let i of n.lineStrings)e[i]=n;else if("points"in n)for(let i of n.points)e[i]=n}}return e}u(MD,"extractStyleMap");function r2(r,e){return r.reduce((t,n)=>{let i=e[n.properties.id];if(i==null)return t;if("textures"in n.properties&&Array.isArray(n.properties.textures)&&n.properties.textures.length>0){let a=et(z({},i),{id:i.id+"-textures"});t.set(a,[n])}else t.has(i)||t.set(i,[]),t.get(i).push(n);return t},new Map)}u(r2,"groupGeometryByStyle");function bm(r,e={}){var i,a,l,h,d,m,v;let t=et(z({},r),{flipImageToFaceCamera:(i=e==null?void 0:e.flipImagesToFaceCamera)!=null?i:!0}),n=(l=(a=e==null?void 0:e.style)==null?void 0:a.shading)!=null?l:e==null?void 0:e.shadingAndOutlines;if(n===!0?t.shading={start:.1,end:.15,intensity:.4}:typeof n=="object"&&(t.shading={start:n.start,end:n.end,intensity:n.intensity}),t.outline=(d=(h=e==null?void 0:e.style)==null?void 0:h.outlines)!=null?d:e==null?void 0:e.shadingAndOutlines,"lineStrings"in r){let x=(v=(m=e==null?void 0:e.style)==null?void 0:m.wallTopColor)!=null?v:e==null?void 0:e.wallTopColor;x!=null&&(t.topColor=x)}return t}u(bm,"translateToCoreStyle");var YD=u((r,e)=>{var i;let n=((i=e.currentMap)==null?void 0:i.currentFloor).layers.get(Rn);switch(r){case"interior-walls":return n==null?void 0:n.layers.get(gc);case"exterior-walls":return n==null?void 0:n.layers.get(Ka);case"interior-doors":return n==null?void 0:n.layers.get(md);case"exterior-doors":return n==null?void 0:n.layers.get(gd);default:return typeof r=="string"?r:r.id}},"getTargetID");function VM(r){return new Promise(e=>{r.onComplete(e),r.onStop(e)})}u(VM,"tweenToPromise");function n2(r){return r.bbox?r.bbox:Zn(r)}u(n2,"getBoundingBox");function qD(r,e){return[Math.min(r[0],e[0]),Math.min(r[1],e[1]),Math.max(r[2],e[2]),Math.max(r[3],e[3])]}u(qD,"expandBbox");function fL(r){return[...new Set(r)]}u(fL,"unique");function jM(r,e,t){return r.floorId&&e.has(r.floorId)?e.get(r.floorId):t}u(jM,"getTargetFloorObject");function vm(r){if(si.is(r)||Fo.is(r))return r.id}u(vm,"getAttachableGeometryId");function wD(r,e,t){var a,l,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=e==null?void 0:e.getById("floor",r.coordinates[0].floorId),S=e==null?void 0:e.getById("floor",r.coordinates[1].floorId);x&&S&&(i=((l=(a=t.getState(x))==null?void 0:a.visible)!=null?l:!0)&&((d=(h=t.getState(S))==null?void 0:h.visible)!=null?d:!0))}else{let x=r.coordinates[0].floorId!=null?e==null?void 0:e.getById("floor",r.coordinates[0].floorId):void 0;i=x&&(v=(m=t.getState(x))==null?void 0:m.visible)!=null?v:!0}return i}u(wD,"determineFloorVisibleBasedOnPath");y();function ju(r,e){var t,n,i,a;if(eh.is(r))return r.navigationTarget.flatMap(l=>ju(l,e));if(tu.is(r)){let l=e.Query.nearest(r,{types:["node"]});return(t=l==null?void 0:l[0])!=null&&t.feature.id?[l[0].feature.id]:[]}else if(ve.is(r)){let l=e.Query.nearest(r,{types:["node"]});return(n=l==null?void 0:l[0])!=null&&n.feature.id?[l[0].feature.id]:[]}else if(Ql.is(r)){let l=e.Query.nearest(r,{types:["node"]});return(i=l==null?void 0:l[0])!=null&&i.feature.id?[l[0].feature.id]:[]}else if(ia.is(r)){let l=e==null?void 0:e.getMVFFeatureById("entrance",r.id);return l!=null&&l.properties.node?[l==null?void 0:l.properties.node]:[]}else if(Jl.is(r)){let l=e==null?void 0:e.getMVFFeatureById("area",r.id);return(a=l==null?void 0:l.properties.destinationNodes)!=null?a:[]}else if(si.is(r)){let l=e==null?void 0:e.getMVFFeatureById("space",r.id);return l==null?[]:l.properties.destinationNodes}else{if(vc.is(r))return r.coordinates.reduce((l,h)=>{var m;let d=e.Query.nearest(h,{types:["node"]});return(m=d==null?void 0:d[0])!=null&&m.feature.id&&l.push(d[0].feature.id),l},[]);if(Fo.is(r)){let l=e==null?void 0:e.objectEntranceNodeIdsByObstructionId[r.id];return l!=null?l:[]}else return Is.is(r)?r.spaces.flatMap(l=>{var h,d;return(d=(h=e==null?void 0:e.getMVFFeatureById("space",l.id))==null?void 0:h.properties.destinationNodes)!=null?d:[]}).filter(l=>typeof l=="string"):Ja.is(r)?r.nodes.map(l=>l.id):ql.is(r)?[r.id]:[]}}u(ju,"getNodesFromTarget");var dL=Math.PI*.1,Vn,ao,Ei,Uu,zu,Hu,ff,Rm,Fs,mL,km,gL,hw=class hw{constructor(e,t,n,i,a){F(this,Fs);b(this,"id");F(this,Vn,{});F(this,ao);F(this,Ei);F(this,Uu);F(this,zu);F(this,Hu);F(this,ff);F(this,Rm);var l;this.id=(l=a==null?void 0:a.id)!=null?l:Mr(),V(this,ao,t),V(this,Ei,e.features),V(this,Uu,n),V(this,zu,i)}get path(){return p(this,Ei).map(e=>p(this,ao).getById("node",e.properties.id)).filter(Boolean)}get departure(){if(p(this,Vn).departure)return p(this,Vn).departure;if(p(this,Ei).length===0||p(this,Uu).length===0)return;let e=p(this,Ei)[0].properties.id,t=p(this,Uu)[0];if(p(this,Uu).length>1){for(let n of p(this,Uu))if(ju(n,p(this,ao)).includes(e)){t=n;break}}return p(this,Vn).departure=t,t}get destination(){if(p(this,Vn).destination)return p(this,Vn).destination;if(p(this,Ei).length===0||p(this,zu).length===0)return;let e=p(this,Ei)[p(this,Ei).length-1].properties.id,t=p(this,zu)[0];if(p(this,zu).length>1){for(let n of p(this,zu))if(ju(n,p(this,ao)).includes(e)){t=n;break}}return p(this,Vn).destination=t,t}get coordinates(){return p(this,Vn).coordinates?p(this,Vn).coordinates:(p(this,Vn).coordinates=p(this,Ei).map(e=>new ve(e.geometry.coordinates[1],e.geometry.coordinates[0],e.properties.groupBy)),p(this,Vn).coordinates)}get distance(){return p(this,Vn).distance?p(this,Vn).distance:(p(this,Vn).distance=p(this,Ei).reduce((e,t)=>e+(t.properties.distance||0),0),p(this,Vn).distance)}get instructions(){if(p(this,Ei).length<2)return[];if(p(this,Vn).instructions)return p(this,Vn).instructions;let e=[],t=0;for(let n=0;n<p(this,Ei).length;n++){let i=p(this,Ei)[n],a=p(this,Ei)[n-1],l=p(this,Ei)[n+1],h=new ve(i.geometry.coordinates[1],i.geometry.coordinates[0],i.properties.groupBy),d=gt(this,Fs,mL).call(this,{prevDirection:a,direction:i,nextDirection:l});t+=(a==null?void 0:a.properties.distance)||0;for(let m of d)m&&(e.push({action:m,distance:t,coordinate:h,node:p(this,ao).getById("node",i.properties.id)}),t=0)}return p(this,Vn).instructions=e,p(this,Vn).instructions}toJSON(){return{id:this.id,directions:p(this,Ei),__type:"directions",from:p(this,Uu),to:p(this,zu)}}};Vn=new WeakMap,ao=new WeakMap,Ei=new WeakMap,Uu=new WeakMap,zu=new WeakMap,Hu=new WeakMap,ff=new WeakMap,Rm=new WeakMap,Fs=new WeakSet,mL=u(function(e){var w,P;let{prevDirection:t,direction:n,nextDirection:i}=e,a=t&&p(this,ao).getById("floor",t.properties.groupBy),l=p(this,ao).getById("floor",n.properties.groupBy),h=i&&p(this,ao).getById("floor",i.properties.groupBy),d=[];t||d.push({type:"Departure"});let m=p(this,ao).getMVFFeatureByNodeId("connection",n.properties.id),v=m?p(this,ao).getById("connection",m.id):void 0,x=m&&m.nodes.length>1,S=p(this,ao).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,Hu)||p(this,Hu)==="exit")d.push(gt(this,Fs,km).call(this,"TakeConnection",l,h,v,m)),V(this,Hu,"take"),V(this,ff,v),V(this,Rm,m);else{let E=p(this,ao).getMVFFeatureByNodeId("connection",(w=t==null?void 0:t.properties.id)!=null?w:""),O=p(this,ao).getById("connection",(P=E==null?void 0:E.id)!=null?P:"");d.push(gt(this,Fs,km).call(this,"ExitConnection",l,a,O,E)),V(this,Hu,"exit"),V(this,ff,v),V(this,Rm,m)}else p(this,Hu)==="take"?(d.push(gt(this,Fs,km).call(this,"ExitConnection",l,a,p(this,ff),p(this,Rm))),V(this,Hu,"exit"),V(this,ff,v)):h&&l.id!==h.id?d.push(gt(this,Fs,km).call(this,"TakeConnection",l,h,v)):a&&a.id!==l.id?d.push(gt(this,Fs,km).call(this,"ExitConnection",l,a,v)):d.push(gt(this,Fs,gL).call(this,t,n));return i||d.push({type:"Arrival"}),d},"#getActions"),km=u(function(e,t,n,i,a){var d,m;let l="none";if(t.elevation!=null&&(n==null?void 0:n.elevation)!=null){let v=t.elevation-n.elevation;v>0?l="down":v<0&&(l="up")}let h=(m=(d=i==null?void 0:i.type)!=null?d:a==null?void 0:a.type)!=null?m:"stairs";return{type:e,fromFloor:t,toFloor:n,direction:l,connection:i,connectionType:h}},"#createConnectionAction"),gL=u(function(e,t){let n=t.properties.edges;if(!n||n.filter(l=>l.destination.properties.id!==(e==null?void 0:e.properties.id)&&l.destination.properties.id!==t.properties.destination).length===0)return null;let a=e?-pL(e.properties.angle,t.properties.angle):0;return Math.abs(a)>=dL?{type:"Turn",bearing:hL(a,dL),referencePosition:"At"}:null},"#createTurnAction"),u(hw,"Directions");var Vu=hw;y();var fw=class fw{constructor({nodes:e,geojsonCollection:t,connections:n,groupBy:i,multiplicativeDistanceWeightScaling:a}){b(this,"navigator");b(this,"connections");b(this,"getDirections",u((e,t,n,i)=>{let{accessible:a,smoothing:{enabled:l,radius:h},connectionIdWeightMap:d}=n,m=e.flatMap(E=>ju(E,i)),v=t.flatMap(E=>ju(E,i)),x=this.getExcludedNodeIds(n.excludedConnections).filter(E=>!m.includes(E)&&!v.includes(E)),S=this.getDisabledConnectionNodeIds(a).filter(E=>!m.includes(E)&&!v.includes(E)),I=new Map;for(let E in d){let O=i.getMVFFeatureById("connection",E);if(!O)continue;let N=this.navigator.graph.edges[O.nodes[0]];if(N){let L=N.find(G=>G.destination.properties.id===O.nodes[1]);L&&I.set(L,d[E])}}let w=this.navigator.getDirections({zones:n.zones.map(E=>{var O;return{geometry:E.geometry,cost:E.cost,map:(O=E.floor)==null?void 0:O.id}}),originIds:m,destinationNodeIds:v,excludedNodeIds:x,disabledConnectionNodeIds:S,simplify:{enabled:l,bufferRadius:h},overrideEdgeWeights:I,multiplicativeDistanceWeightScaling:!i.enterpriseMode});this.addCoordinateDirections(w,e,t);let P=new Vu(w,i,e,t);if(!(P.distance===0&&new Set([...m,...v]).size===m.length+v.length))return P},"getDirections"));b(this,"getExcludedNodeIds",u(e=>{if(e.length===0)return[];let t=new Set(e.map(n=>n.id));return this.connections.reduce((n,i)=>t.has(i.id)?n.concat(i.nodes):n,[])},"getExcludedNodeIds"));b(this,"getDisabledConnectionNodeIds",u(e=>e===!1?[]:this.connections.reduce((t,n)=>n.accessible?t:t.concat(n.nodes),[]),"getDisabledConnectionNodeIds"));b(this,"addCoordinateDirections",u((e,[t],[n])=>{if(e.features.length){if(ve.is(t)){let i=this.createDirectionFeature(t,this.navigator.getAngle([t.longitude,t.latitude],e.features[0].geometry.coordinates),this.navigator.getDistance([t.longitude,t.latitude],e.features[0].geometry.coordinates));e.features.splice(0,0,i)}if(ve.is(n)){let i=this.createDirectionFeature(n,0,0),a=e.features[e.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]),e.features.push(i)}}},"addCoordinateDirections"));b(this,"createDirectionFeature",u((e,t,n)=>({type:"Feature",geometry:{type:"Point",coordinates:[e.longitude,e.latitude]},properties:{groupBy:e.floorId,id:e.id,angle:t,distance:n,edges:[]}}),"createDirectionFeature"));this.navigator=new lm({nodes:e,geojsonCollection:this.createCollection(t),groupBy:i,multiplicativeDistanceWeightScaling:a}),this.connections=n}createCollection(e){return{type:"FeatureCollection",features:Object.entries(e).reduce((t,[n,i])=>t.concat(i.features.map(a=>(a.properties.map=n,a))),[])}}};u(fw,"DirectionsInternal");var Fm=fw;y();y();y();y();y();y();function dw(r){let e=+this._x.call(null,r),t=+this._y.call(null,r);return yL(this.cover(e,t),e,t,r)}u(dw,"default");function yL(r,e,t,n){if(isNaN(e)||isNaN(t))return r;var i,a=r._root,l={data:n},h=r._x0,d=r._y0,m=r._x1,v=r._y1,x,S,I,w,P,E,O,N;if(!a)return r._root=l,r;for(;a.length;)if((P=e>=(x=(h+m)/2))?h=x:m=x,(E=t>=(S=(d+v)/2))?d=S:v=S,i=a,!(a=a[O=E<<1|P]))return i[O]=l,r;if(I=+r._x.call(null,a.data),w=+r._y.call(null,a.data),e===I&&t===w)return l.next=a,i?i[O]=l:r._root=l,r;do i=i?i[O]=new Array(4):r._root=new Array(4),(P=e>=(x=(h+m)/2))?h=x:m=x,(E=t>=(S=(d+v)/2))?d=S:v=S;while((O=E<<1|P)===(N=(w>=S)<<1|I>=x));return i[N]=a,i[O]=l,r}u(yL,"add");function vL(r){var e,t,n=r.length,i,a,l=new Array(n),h=new Array(n),d=1/0,m=1/0,v=-1/0,x=-1/0;for(t=0;t<n;++t)isNaN(i=+this._x.call(null,e=r[t]))||isNaN(a=+this._y.call(null,e))||(l[t]=i,h[t]=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),t=0;t<n;++t)yL(this,l[t],h[t],r[t]);return this}u(vL,"addAll");y();function mw(r,e){if(isNaN(r=+r)||isNaN(e=+e))return this;var t=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(t))i=(t=Math.floor(r))+1,a=(n=Math.floor(e))+1;else{for(var l=i-t||1,h=this._root,d,m;t>r||r>=i||n>e||e>=a;)switch(m=(e<n)<<1|r<t,d=new Array(4),d[m]=h,h=d,l*=2,m){case 0:i=t+l,a=n+l;break;case 1:t=i-l,a=n+l;break;case 2:i=t+l,n=a-l;break;case 3:t=i-l,n=a-l;break}this._root&&this._root.length&&(this._root=h)}return this._x0=t,this._y0=n,this._x1=i,this._y1=a,this}u(mw,"default");y();function gw(){var r=[];return this.visit(function(e){if(!e.length)do r.push(e.data);while(e=e.next)}),r}u(gw,"default");y();function yw(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]]}u(yw,"default");y();y();function pi(r,e,t,n,i){this.node=r,this.x0=e,this.y0=t,this.x1=n,this.y1=i}u(pi,"default");function vw(r,e,t){var n,i=this._x0,a=this._y0,l,h,d,m,v=this._x1,x=this._y1,S=[],I=this._root,w,P;for(I&&S.push(new pi(I,i,a,v,x)),t==null?t=1/0:(i=r-t,a=e-t,v=r+t,x=e+t,t*=t);w=S.pop();)if(!(!(I=w.node)||(l=w.x0)>v||(h=w.y0)>x||(d=w.x1)<i||(m=w.y1)<a))if(I.length){var E=(l+d)/2,O=(h+m)/2;S.push(new pi(I[3],E,O,d,m),new pi(I[2],l,O,E,m),new pi(I[1],E,h,d,O),new pi(I[0],l,h,E,O)),(P=(e>=O)<<1|r>=E)&&(w=S[S.length-1],S[S.length-1]=S[S.length-1-P],S[S.length-1-P]=w)}else{var N=r-+this._x.call(null,I.data),L=e-+this._y.call(null,I.data),G=N*N+L*L;if(G<t){var j=Math.sqrt(t=G);i=r-j,a=e-j,v=r+j,x=e+j,n=I.data}}return n}u(vw,"default");y();function bw(r){if(isNaN(v=+this._x.call(null,r))||isNaN(x=+this._y.call(null,r)))return this;var e,t=this._root,n,i,a,l=this._x0,h=this._y0,d=this._x1,m=this._y1,v,x,S,I,w,P,E,O;if(!t)return this;if(t.length)for(;;){if((w=v>=(S=(l+d)/2))?l=S:d=S,(P=x>=(I=(h+m)/2))?h=I:m=I,e=t,!(t=t[E=P<<1|w]))return this;if(!t.length)break;(e[E+1&3]||e[E+2&3]||e[E+3&3])&&(n=e,O=E)}for(;t.data!==r;)if(i=t,!(t=t.next))return this;return(a=t.next)&&delete t.next,i?(a?i.next=a:delete i.next,this):e?(a?e[E]=a:delete e[E],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[O]=t:this._root=t),this):(this._root=a,this)}u(bw,"default");function bL(r){for(var e=0,t=r.length;e<t;++e)this.remove(r[e]);return this}u(bL,"removeAll");y();function xw(){return this._root}u(xw,"default");y();function _w(){var r=0;return this.visit(function(e){if(!e.length)do++r;while(e=e.next)}),r}u(_w,"default");y();function Cw(r){var e=[],t,n=this._root,i,a,l,h,d;for(n&&e.push(new pi(n,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!r(n=t.node,a=t.x0,l=t.y0,h=t.x1,d=t.y1)&&n.length){var m=(a+h)/2,v=(l+d)/2;(i=n[3])&&e.push(new pi(i,m,v,h,d)),(i=n[2])&&e.push(new pi(i,a,v,m,d)),(i=n[1])&&e.push(new pi(i,m,l,h,v)),(i=n[0])&&e.push(new pi(i,a,l,m,v))}return this}u(Cw,"default");y();function Sw(r){var e=[],t=[],n;for(this._root&&e.push(new pi(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var a,l=n.x0,h=n.y0,d=n.x1,m=n.y1,v=(l+d)/2,x=(h+m)/2;(a=i[0])&&e.push(new pi(a,l,h,v,x)),(a=i[1])&&e.push(new pi(a,v,h,d,x)),(a=i[2])&&e.push(new pi(a,l,x,v,m)),(a=i[3])&&e.push(new pi(a,v,x,d,m))}t.push(n)}for(;n=t.pop();)r(n.node,n.x0,n.y0,n.x1,n.y1);return this}u(Sw,"default");y();function xL(r){return r[0]}u(xL,"defaultX");function Iw(r){return arguments.length?(this._x=r,this):this._x}u(Iw,"default");y();function _L(r){return r[1]}u(_L,"defaultY");function Mw(r){return arguments.length?(this._y=r,this):this._y}u(Mw,"default");function u0(r,e,t){var n=new ww(e==null?xL:e,t==null?_L:t,NaN,NaN,NaN,NaN);return r==null?n:n.addAll(r)}u(u0,"quadtree");function ww(r,e,t,n,i,a){this._x=r,this._y=e,this._x0=t,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}u(ww,"Quadtree");function CL(r){for(var e={data:r.data},t=e;r=r.next;)t=t.next={data:r.data};return e}u(CL,"leaf_copy");var Oo=u0.prototype=ww.prototype;Oo.copy=function(){var r=new ww(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,n;if(!e)return r;if(!e.length)return r._root=CL(e),r;for(t=[{source:e,target:r._root=new Array(4)}];e=t.pop();)for(var i=0;i<4;++i)(n=e.source[i])&&(n.length?t.push({source:n,target:e.target[i]=new Array(4)}):e.target[i]=CL(n));return r};Oo.add=dw;Oo.addAll=vL;Oo.cover=mw;Oo.data=gw;Oo.extent=yw;Oo.find=vw;Oo.remove=bw;Oo.removeAll=bL;Oo.root=xw;Oo.size=_w;Oo.visit=Cw;Oo.visitAfter=Sw;Oo.x=Iw;Oo.y=Mw;var Ca,Xu,Yu,Tw=class Tw{constructor(e){F(this,Ca,{});F(this,Xu,{});F(this,Yu);V(this,Yu,e)}getTreeByType(e,t,n,i){var m,v;p(this,Ca)[e]||(p(this,Ca)[e]={}),p(this,Xu)[e]||(p(this,Xu)[e]={}),p(this,Xu)[e][t]||(p(this,Xu)[e][t]={});let a=p(this,Xu)[e][t][n],l=!N0(a,i);if((m=p(this,Ca)[e][t])!=null&&m[n]&&!l)return p(this,Ca)[e][t][n];p(this,Ca)[e][t]||(p(this,Ca)[e][t]={}),p(this,Ca)[e][t][n]=u0();let h=p(this,Ca)[e][t][n];h.x(x=>x.geometry.coordinates[1]),h.y(x=>x.geometry.coordinates[0]);let d=[];switch(e){case"node":d=((v=p(this,Yu).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,Yu).mvfPoisByFloorId[n]||[];break;case"door":d=p(this,Yu).mvfEntrancesByFloorId[n]||[];break;case"annotation":d=p(this,Yu).mvfAnnotationsByFloorId[n]||[];break}if(i!=null&&i.length&&(d==null?void 0:d.length)>0){let x=new Set(i);d=d.filter(S=>{let I=p(this,Yu).getById(e,S.properties.id);return I&&!x.has(I)})}return(d==null?void 0:d.length)>0&&h.addAll(d),p(this,Xu)[e][t][n]=i?[...i]:void 0,h}};Ca=new WeakMap,Xu=new WeakMap,Yu=new WeakMap,u(Tw,"QueryCache");var y2=Tw;var dZ=zi.object({limit:zi.enum(["same-floor","same-elevation"]).optional(),radius:zi.number().optional(),types:zi.array(zi.enum(["node","point-of-interest","door","annotation"])).min(1)}),Il,p0,Pw=class Pw{constructor(e){F(this,Il);F(this,p0);V(this,Il,e),V(this,p0,new y2(p(this,Il)))}nearest(e,t){try{dZ.parse(t)}catch(l){K.error(l);return}let n=Rg(e);if(!n)return;let i=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let l of p(this,Il).getByType("floor-stack")){let h=l.defaultFloor;h&&i.push(h.id)}else if(t.limit==="same-elevation"){let l=p(this,Il).floorsById[n.floorId];if(l){let h=l==null?void 0:l.elevation;h&&(i=p(this,Il).getByType("floor-stack").map(d=>{var m;return(m=d.floors.find(v=>v.elevation===h))==null?void 0:m.id}).filter(Boolean))}}let a=[];for(let l of fL(t.types))for(let h of i){let d=p(this,p0).getTreeByType(l,p(this,Il).mapName,h,t.exclude).find(n.latitude,n.longitude,t.radius);if(d){let m=p(this,Il).getById(l,d==null?void 0:d.properties.id);m&&a.push({distance:fa([n.longitude,n.latitude],d.geometry.coordinates),feature:m})}}return a.sort((l,h)=>l.distance-h.distance)}};Il=new WeakMap,p0=new WeakMap,u(Pw,"Query");var c0=Pw;y();y();var h0,Ew=class Ew{constructor(e){F(this,h0);V(this,h0,e||[])}get raw(){return p(this,h0)}};h0=new WeakMap,u(Ew,"OpeningHours");var v2=Ew;var qi,Ht,Jr,df=class df extends ni{constructor(t,n){super(n.mvfData.id);b(this,"__type",df.__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");F(this,qi);F(this,Ht,{});F(this,Jr);V(this,qi,t),V(this,Jr,n.mvfData);for(let i in n.mvfData)i==="links"?this.links=n.mvfData.links.map(a=>new hc({mvfData:a})):i==="pictures"?this.images=n.mvfData.pictures.map(a=>{var l;return a.url?new dc({mvfData:et(z({},a),{url:(l=a.url)!=null?l:""}),mapData:p(this,qi)}):void 0}).filter(a=>a!=null):i==="website"?n.mvfData.website&&(this.website=new hc({mvfData:n.mvfData.website})):i==="icon"?n.mvfData.icon&&(this.icon=new dc({mvfData:{url:n.mvfData.icon},mapData:p(this,qi)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return p(this,Jr)[i]}})}static is(t){return t.__type===df.__type}get spaces(){if(p(this,Ht).spaces)return p(this,Ht).spaces;if(p(this,Jr).spaces==null)return p(this,Ht).spaces=[],p(this,Ht).spaces;p(this,Ht).spaces=[];for(let t=0;t<p(this,Jr).spaces.length;t++){let n=p(this,qi).getById("space",p(this,Jr).spaces[t].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,Jr).spaces==null)return p(this,Ht).points=[],p(this,Ht).points;p(this,Ht).points=[];for(let t=0;t<p(this,Jr).spaces.length;t++){let n=p(this,qi).getById("point-of-interest",p(this,Jr).spaces[t].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,Jr).entrances==null)return p(this,Ht).doors=[],p(this,Ht).doors;p(this,Ht).doors=[];for(let t=0;t<p(this,Jr).entrances.length;t++){let n=p(this,qi).getById("door",p(this,Jr).entrances[t].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,Jr).connections==null)return p(this,Ht).connections=[],p(this,Ht).connections;let t=new Set;for(let i=0;i<p(this,Jr).connections.length;i++){let a=p(this,Jr).connections[i],l=p(this,qi).mvfConnectionsById[a],d=(l==null?[]:l.nodes).map(m=>p(this,qi).getById("node",m)).filter(Boolean);for(let m of d){if(m==null)continue;let v=Za([m.coordinate.longitude,m.coordinate.latitude]),S=((n=p(this,qi).connectionSpaceIdsByLatLon[v])!=null?n:[]).map(I=>p(this,qi).connectionsById[I]).filter(I=>I!=null);for(let I of S)t.add(I)}}return p(this,Ht).connections=Array.from(t),p(this,Ht).connections}get annotations(){if(p(this,Ht).annotations)return p(this,Ht).annotations;if(p(this,Jr).annotations==null)return p(this,Ht).annotations=[],p(this,Ht).annotations;p(this,Ht).annotations=[];for(let t=0;t<p(this,Jr).annotations.length;t++){let n=p(this,qi).getById("annotation",p(this,Jr).annotations[t].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,Jr).categories==null?(p(this,Ht).categories=[],p(this,Ht).categories):(p(this,Ht).categories=p(this,Jr).categories.map(t=>p(this,qi).getById("location-category",t)).filter(t=>t!=null),p(this,Ht).categories)}get mapObjects(){return p(this,Ht).mapObjects?p(this,Ht).mapObjects:p(this,Jr).obstructions==null?(p(this,Ht).mapObjects=[],p(this,Ht).mapObjects):(p(this,Ht).mapObjects=p(this,Jr).obstructions.map(t=>p(this,qi).getById("object",t.id)).filter(t=>t!=null),p(this,Ht).mapObjects)}get areas(){return p(this,Ht).areas?p(this,Ht).areas:p(this,Jr).areas==null?(p(this,Ht).areas=[],p(this,Ht).areas):(p(this,Ht).areas=p(this,Jr).areas.map(t=>p(this,qi).getById("area",t.id)).filter(t=>t!=null),p(this,Ht).areas)}get focusTarget(){if(p(this,Ht).focusTarget)return p(this,Ht).focusTarget;let t=[];for(let n of this.spaces)t.push(n);for(let n of this.connections)t.push(...n.coordinates);for(let n of this.doors)t.push(n.focusTarget);for(let n of this.mapObjects)t.push(n.focusTarget);for(let n of this.annotations)t.push(n.focusTarget);for(let n of this.points)t.push(n.focusTarget);for(let n of this.areas)t.push(n.focusTarget);return p(this,Ht).focusTarget=t,t}get openingHours(){var t;return p(this,Ht).openingHours?p(this,Ht).openingHours:(p(this,Ht).openingHours=new v2((t=p(this,Jr).openingHoursSpecification)!=null?t:[]),p(this,Ht).openingHours)}get navigationTarget(){if(p(this,Ht).navigationTarget)return p(this,Ht).navigationTarget;let t=[];for(let n of this.spaces)t.push(n);for(let n of this.connections)t.push(...n.coordinates);for(let n of this.doors)t.push(n.focusTarget);for(let n of this.mapObjects)t.push(n.focusTarget);for(let n of this.annotations)t.push(n.focusTarget);for(let n of this.points)t.push(n.focusTarget);return p(this,Ht).navigationTarget=t,t}toJSON(){return{__type:df.__type,id:this.id,name:this.name}}};qi=new WeakMap,Ht=new WeakMap,Jr=new WeakMap,u(df,"LocationProfile"),b(df,"__type","location-profile");var Ow=df,eh=Ow;y();var Kc,Xo,gf,mf=class mf extends ni{constructor(t,n){super(n.mvfData.id);b(this,"__type",mf.__type);b(this,"id","cat_");b(this,"name","");b(this,"icon","");F(this,Kc);F(this,Xo,{});F(this,gf);V(this,Kc,t),V(this,gf,n.mvfData);for(let i in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return p(this,gf)[i]}})}static is(t){return t.__type===mf.__type}get parent(){return p(this,Xo).parent?p(this,Xo).parent:(p(this,Xo).parent=p(this,gf).parent?p(this,Kc).getById("location-category",p(this,gf).parent):void 0,p(this,Xo).parent)}get children(){return p(this,Xo).children?p(this,Xo).children:(p(this,Xo).children=p(this,Kc).locationCategoriesByParentId[this.id]||[],p(this,Xo).children)}get locationProfiles(){if(p(this,Xo).locationProfiles)return p(this,Xo).locationProfiles;let t=[];for(let n of p(this,Kc).locationProfilesByCategoryId[this.id]||[]){let i=p(this,Kc).getById("location-profile",n.id);i&&t.push(i)}return p(this,Xo).locationProfiles=t,t}toJSON(){return{__type:mf.__type,id:this.id,name:this.name}}};Kc=new WeakMap,Xo=new WeakMap,gf=new WeakMap,u(mf,"LocationCategory"),b(mf,"__type","location-category");var Dw=mf,zg=Dw;var re,b2,SL,Bm,Lw=class Lw extends ie{constructor(t,n){var l,h,d,m,v;super();F(this,b2);b(this,"Analytics");F(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");F(this,Bm);b(this,"getDirectionsMultiDestination",u((t,n,i)=>this.getDirections(t,n,et(z({},i),{multiDestination:!0})),"getDirectionsMultiDestination"));b(this,"getDirections",u((t,n,i)=>{let{accessible:a=!1,smoothing:l=!0,multiDestination:h=!1}=i||{},d=typeof l=="object"?l.enabled:l,m=typeof l=="object"?l.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(t)?t:[t],I=[];for(let w of n){let P=Array.isArray(w)?w:[w],E=this.directions.getDirections(S,P,x,this);if(!E){K.error("getDirections failed due to missing directions for one of the segments");return}S=P,I.push(E)}return I}else{let S=Array.isArray(t)?t:[t],I=Array.isArray(n)?n:[n];if(Array.isArray(I[0])){K.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){K.error("Unable to get directions",w);return}}},"getDirections"));b(this,"transformImageRequest",u(async t=>{var i;if(this.enterpriseMode||!this.getMapDataOptions)return{url:t};if(!W6(t))return{url:t};if(Z6(t))return{url:t};let n=qv(t);if(!n)return{url:t};try{let a=await((i=this.tokenManager)==null?void 0:i.getSasTokensAsync()),l=a==null?void 0:a[n.mapId];if(l==null)throw new Error("SAS token not found");let[h]=t.split("?");return{url:"".concat(h,"?").concat(l.token)}}catch(a){return K.error("Failed to append SAS token to image request. Requests for private images may fail.",a),{url:t}}},"transformImageRequest"));let i=(l=n==null?void 0:n.env)!=null?l:Cc();if(this.envControl=i,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new vd,this.localePacksUrls=(h=n==null?void 0:n.localePacksUrls)!=null?h:{},this.mvf=t,this.outdoorViewToken=n==null?void 0:n.outdoorViewToken,this.getMapDataOptions=n==null?void 0:n.getMapDataOptions,((d=t["tileset.json"])==null?void 0:d.default)!=null&&(this.tilesets[t["tileset.json"].default.key]=t["tileset.json"].default,i.updateTileServerBaseUrl(t["tileset.json"].default.url),t["tileset.json"].others!=null))for(let x of t["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=r7(t,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=e7(t,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 $v(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]=EC(w)}),this.currentLanguage=this.venue.defaultLanguage}}this.Query=new c0(this),this.directions=new Fm({nodes:t["node.geojson"],geojsonCollection:t.enterprise?t.space:t.obstruction,connections:t["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let t=this;return{get baseUri(){var n;return t.envControl.getBaseUri((n=t.enterpriseMode)!=null?n:!1)},get baseAuthUri(){return t.envControl.getBaseAuthUri()},get analyticsBaseUri(){return t.envControl.getAnalyticsBaseUri()},get tileServerUri(){return t.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var t;return(t=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?t:""}get mapCenter(){return new ve(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var t;return(t=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?t: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(t){switch(t){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(t,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":u(h=>gt(this,b2,SL).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=u(h=>{let d=i[h];if(d!=null)return typeof d=="function"?d(n):d[n]},"getItemFromCollection"),l=u(()=>{for(let h of Object.keys(i)){let d=a(h);if(d!=null)return d}},"getItemFromAllCollections");return t==="unknown"?l():a(t)}getByExternalId(t,n){var i,a,l,h,d,m,v,x,S,I,w,P;switch(t){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(l=this.floorsByExternalId[n])!=null?l:[];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(P=this.categoriesByExternalId[n])!=null?P:[];default:return[]}}getMapDataById(t){var n,i,a,l,h,d,m,v,x,S;return(S=(x=(v=(m=(d=(h=(l=(a=(i=(n=this.spacesById[t])!=null?n:this.floorsById[t])!=null?i:this.floorStacksById[t])!=null?a:this.facadesById[t])!=null?l:this.nodesById[t])!=null?h:this.doorsById[t])!=null?d:this.connectionsById[t])!=null?m:this.objectsById[t])!=null?v:this.pointsOfInterestById[t])!=null?x:this.annotationsById[t])!=null?S:this.areasById[t]}getMVFFeatureById(t,n){switch(t){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(t))}}getMVFFeatureByNodeId(t,n){switch(t){case"connection":return this.mvfConnectionsByNodeId[n];default:throw new Error("Unsupported MVF feature type: ".concat(t))}}getMVFFeatureByType(t){switch(t){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(t))}}getPropTranslation(t,n,i,a){var d,m;if(!this.currentLanguage)return a;let{code:l}=this.currentLanguage,h=(m=(d=this.languagePacks[l])==null?void 0:d.optimized)==null?void 0:m[t];if(h){let v=h[i];if(v!=null&&v[n]!==void 0)return v[n]}return a}findPreferredLanguage(t){if(!this.venue)return;let n=g2(this.venue,t);return(t==null?void 0:t.languageCode)!=null&&t.languageCode.toLowerCase()!==n.code.toLowerCase()&&K.warn('Language code "'.concat(t.languageCode,'" could not be found in the venue. Using "').concat(n.code,'" instead.')),n}async changeLanguage(t){var h;let n=t.toLowerCase();if(!n){K.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){K.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){K.warn('Language code "'.concat(n,'" could not be found in the venue.'));return}if(i===a.code)return;let l=this.languagePacks[a.code];if(!l){let d=this.localePacksUrls[a.code];if(!d){K.error('Locale pack URL not found for language code "'.concat(a.code,'".'));return}p(this,Bm)&&p(this,Bm).abort();let m=new AbortController;V(this,Bm,m);let v;try{v=await T7(d,{signal:m.signal})}catch(x){K.error('Failed to download language pack for language code "'.concat(a.code,'".'),x);return}if(!v||m.signal.aborted)return;l=EC(v),this.languagePacks[a.code]=l}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=a,this.publish("language-change",this.currentLanguage)}getDistance(t,n){let i=Rg(t),a=Rg(n);return fa([i.longitude,i.latitude],[a.longitude,a.latitude])}async toJSONBundle({downloadLanguagePacks:t=!0}={}){var i;let n=[];if(t&&this.enterpriseMode){let a=new AbortController;for(let l of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[l.code]){let h=await oS(this.localePacksUrls[l.code],{signal:a.signal}),d=await Cd(h);d&&n.push({language:{code:l.code,name:l.name},localePack:d})}}catch(h){K.warn("failed downloading language pack",h)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:t=!0}={}){var i;if(!this.binaryBundle){K.error("binary bundle not found");return}let n=[];if(t&&this.enterpriseMode){let a=new AbortController;for(let l of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[l.code]){let h=await oS(this.localePacksUrls[l.code],{signal:a.signal});h&&n.push({language:{code:l.code,name:l.name},localePack:h})}}catch(h){K.warn("failed downloading language pack",h)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.binaryBundle}}destroy(){for(let t of globalThis.Object.keys(p(this,re)))p(this,re)[t]=null}};re=new WeakMap,b2=new WeakSet,SL=u(function(t){var h;let n=(h=t==null?void 0:t.nodes)==null?void 0:h[0],i=this.getById("node",n);if(i==null)return;let a=Za([i.coordinate.longitude,i.coordinate.latitude]),l=this.connectionSpaceIdsByLatLon[a];return l==null?void 0:l.map(d=>this.connectionsById[d]).find(d=>d!=null)},"#getConnectionFromMVFConnection"),Bm=new WeakMap,u(Lw,"MapDataInternal");var hf=Lw;var Gm,vf,Vm,Ml,yf=class yf extends ra{constructor(t,n){super(n.mvfData.id,t);b(this,"__type",yf.__type);F(this,Gm);F(this,vf);F(this,Vm);F(this,Ml,{});V(this,Gm,n.mvfData),V(this,vf,t),V(this,Vm,n.floorStackId)}static is(t){return t.__type===yf.__type}get floorStack(){return p(this,vf).getById("floor-stack",p(this,Vm))}get spaces(){if(!p(this,Ml).spaces){p(this,Ml).spaces=[];for(let t of p(this,Gm).spaces){let n=p(this,vf).getById("space",t.spaceId);n&&p(this,Ml).spaces.push(n)}}return p(this,Ml).spaces}get center(){if(!p(this,Ml).center){let t={type:"FeatureCollection",features:[]};for(let i of this.spaces){let a=p(this,vf).mvfSpacesById[i.id];a&&t.features.push(a)}if(t.features.length===0)throw new xi("No geometry found for facade!");let n=ja(t);p(this,Ml).center=new ve({latitude:n.geometry.coordinates[1],longitude:n.geometry.coordinates[0],floorId:p(this,Gm).spaces[0].floorId})}return p(this,Ml).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}toJSON(){return{id:this.id,__type:yf.__type,floorStackId:p(this,Vm),floorStack:this.floorStack,spaces:this.spaces}}};Gm=new WeakMap,vf=new WeakMap,Vm=new WeakMap,Ml=new WeakMap,u(yf,"Facade"),b(yf,"__type","facade");var Aw=yf,Is=Aw;export{ve as a,ql as b,si as c,Og as d,Is as e,Ja as f,Ug as g,J as h,S3 as i,CW as j,uL as k,cL as l,hZ as m};