@mappedin/react-sdk 6.0.1-beta.53 → 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.
- package/THIRD_PARTY_LICENSES.txt +184 -24
- package/lib/esm/{GLTFExporter-W4OR66GG.js → GLTFExporter-NKUJLBWQ.js} +1 -1
- package/lib/esm/{GLTFLoader-CWW4SC4X.js → GLTFLoader-BQHL354R.js} +1 -1
- package/lib/esm/{browser-6HMQAV4T.js → browser-M5OR7Q7D.js} +1 -1
- package/lib/esm/{chunk-6X6EHSZ7.js → chunk-2X6CLJYW.js} +1 -1
- package/lib/esm/{chunk-YGXQDTMT.js → chunk-CHY6WOJT.js} +1 -1
- package/lib/esm/chunk-CZWLNDLV.js +1 -0
- package/lib/esm/chunk-DHRVAJE6.js +1 -0
- package/lib/esm/chunk-LQMJ5BHI.js +1 -0
- package/lib/esm/chunk-LUJQR5EH.js +1 -0
- package/lib/esm/chunk-ZMO3UDDX.js +1 -0
- package/lib/esm/index.css +1 -1
- package/lib/esm/index.d.ts +26242 -21216
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-O22JOSJ6.css +1 -0
- package/lib/esm/inspector-QOSD3H5O.js +1 -0
- package/lib/esm/internal-WXMWXAC3.js +1 -0
- package/lib/esm/internal-XPQ6EMQC.css +1 -0
- package/lib/esm/outdoor-context-v5-N4FV7A64.js +1 -0
- package/lib/esm/{roboto-regular-3HSVPIGX.js → roboto-regular-NXH7N2CY.js} +1 -1
- package/lib/esm/text3d-DWR5PXYU.js +1 -0
- package/package.json +5 -2
- package/lib/esm/chunk-2LTL6ZVN.js +0 -1
- package/lib/esm/chunk-5SHMBNLX.js +0 -1
- package/lib/esm/chunk-B7NHRA7S.js +0 -1
- package/lib/esm/chunk-L6SCRGG4.js +0 -1
- package/lib/esm/chunk-PEDEW3M6.js +0 -1
- package/lib/esm/chunk-WVB6PZOJ.js +0 -1
- package/lib/esm/dist-NFOUUHU5.js +0 -1
- package/lib/esm/inspector-AUORSUJQ.css +0 -1
- package/lib/esm/inspector-DPNZIY36.js +0 -1
- package/lib/esm/internal-A2RG32A3.js +0 -1
- package/lib/esm/internal-VJNENUAS.css +0 -1
- package/lib/esm/outdoor-context-v4-FKKIRNTV.js +0 -1
- package/lib/esm/text3d-ZRYODT3I.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as al,A as z7,Aa as lD,B as $7,Ba as _w,C as jd,Ca as uD,D as H7,Da as cD,E as W7,Ea as hg,F as Hu,Fa as pD,G as yn,Ga as fD,H as On,Ha as GI,I as Li,Ia as Cw,J as Xt,Ja as v1,K as pg,Ka as mg,L as xw,La as jI,M as Ql,Ma as gg,N as LI,Na as yg,O as DI,P as Ud,Q as ko,R as os,S as q7,T as Wn,U as fo,V as Y7,W as no,X as X7,Y as Wu,Z as AI,_ as Ii,a as an,aa as Z7,b as v7,ba as Vd,c as ae,ca as eu,d as Ro,da as Hr,e as x7,ea as Bn,f as dw,fa as FI,g as TI,ga as bw,h as G7,ha as NI,i as zu,ia as Iw,j as EI,ja as J7,k as j7,ka as fg,l as MI,la as Q7,m as Gd,ma as dg,n as $u,na as y1,o as OI,oa as eD,p as m1,pa as RI,q as yw,qa as tD,r as cg,ra as rD,s as Rt,sa as Sw,t as Kc,ta as kI,u as g1,ua as BI,v as vw,va as nD,w as U7,wa as iD,x as W,xa as oD,y as He,ya as sD,z as V7,za as aD}from"./chunk-ZMO3UDDX.js";import{w as K7}from"./chunk-DHRVAJE6.js";import{a as ll}from"./chunk-CHY6WOJT.js";import{$ as Vt,A as I7,Aa as CI,B as bI,Ba as gw,C as II,Ca as ju,D as S7,Da as Uu,E as _7,Ea as Jl,Fa as wI,G as C7,Ga as A7,H as Br,Ha as F7,I as Ft,Ja as sl,M as w7,N as P7,O as T7,P as Bd,Q as lt,R as ro,S as E7,T as La,Ta as ug,U as Zc,V as Zl,W as Hn,Xa as PI,Y as po,Ya as N7,Z as zs,_ as SI,aa as Kl,ab as R7,b as yI,c as Rd,ca as If,cb as Vu,d as h1,da as M7,e as Xl,ea as hw,eb as k7,f as b7,g as Gu,ga as Sf,gb as B7,la as O7,oa as _f,p as vI,pa as L7,qa as _I,r as xI,ra as mw,ta as lg,ya as D7,z as kd,za as Cf}from"./chunk-2X6CLJYW.js";import{a as g,b as S}from"./chunk-CZWLNDLV.js";import{a as Y,b as Ie,c as o,d as gI,e as is,g as ze,h as bf,i as Mn,j as b,k as d,l as j,m as $,n as Re,o as y7,p as ke}from"./chunk-LUJQR5EH.js";var UI=ze((Cve,hD)=>{"use strict";g();var dD=Object.getOwnPropertySymbols,dq=Object.prototype.hasOwnProperty,hq=Object.prototype.propertyIsEnumerable;function mq(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}o(mq,"toObject");function gq(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(a){return t[a]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(a){i[a]=a}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch(a){return!1}}o(gq,"shouldUseNative");hD.exports=gq()?Object.assign:function(e,t){for(var r,n=mq(e),i,a=1;a<arguments.length;a++){r=Object(arguments[a]);for(var u in r)dq.call(r,u)&&(n[u]=r[u]);if(dD){i=dD(r);for(var c=0;c<i.length;c++)hq.call(r,i[c])&&(n[i[c]]=r[i[c]])}}return n}});var Ow=ze((Ew,Mw)=>{g();(function(e,t){typeof Ew=="object"&&typeof Mw<"u"?Mw.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(Ew,function(){"use strict";function e(P,L,A,M,N){o(function B(H,z,R,X,ie){for(;X>R;){if(X-R>600){var Q=X-R+1,U=z-R+1,Te=Math.log(Q),oe=.5*Math.exp(2*Te/3),fe=.5*Math.sqrt(Te*oe*(Q-oe)/Q)*(U-Q/2<0?-1:1),se=Math.max(R,Math.floor(z-U*oe/Q+fe)),ve=Math.min(X,Math.floor(z+(Q-U)*oe/Q+fe));B(H,z,se,ve,ie)}var ue=H[z],he=R,Z=X;for(t(H,R,z),ie(H[X],ue)>0&&t(H,R,X);he<Z;){for(t(H,he,Z),he++,Z--;ie(H[he],ue)<0;)he++;for(;ie(H[Z],ue)>0;)Z--}ie(H[R],ue)===0?t(H,R,Z):t(H,++Z,X),Z<=z&&(R=Z+1),z<=Z&&(X=Z-1)}},"t")(P,L,A||0,M||P.length-1,N||r)}o(e,"t");function t(P,L,A){var M=P[L];P[L]=P[A],P[A]=M}o(t,"i");function r(P,L){return P<L?-1:P>L?1:0}o(r,"n");var n=o(function(P){P===void 0&&(P=9),this._maxEntries=Math.max(4,P),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function i(P,L,A){if(!A)return L.indexOf(P);for(var M=0;M<L.length;M++)if(A(P,L[M]))return M;return-1}o(i,"e");function a(P,L){u(P,0,P.children.length,L,P)}o(a,"a");function u(P,L,A,M,N){N||(N=T(null)),N.minX=1/0,N.minY=1/0,N.maxX=-1/0,N.maxY=-1/0;for(var B=L;B<A;B++){var H=P.children[B];c(N,P.leaf?M(H):H)}return N}o(u,"h");function c(P,L){return P.minX=Math.min(P.minX,L.minX),P.minY=Math.min(P.minY,L.minY),P.maxX=Math.max(P.maxX,L.maxX),P.maxY=Math.max(P.maxY,L.maxY),P}o(c,"o");function f(P,L){return P.minX-L.minX}o(f,"s");function m(P,L){return P.minY-L.minY}o(m,"l");function v(P){return(P.maxX-P.minX)*(P.maxY-P.minY)}o(v,"f");function x(P){return P.maxX-P.minX+(P.maxY-P.minY)}o(x,"u");function I(P,L){return P.minX<=L.minX&&P.minY<=L.minY&&L.maxX<=P.maxX&&L.maxY<=P.maxY}o(I,"m");function C(P,L){return L.minX<=P.maxX&&L.minY<=P.maxY&&L.maxX>=P.minX&&L.maxY>=P.minY}o(C,"c");function T(P){return{children:P,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}o(T,"p");function O(P,L,A,M,N){for(var B=[L,A];B.length;)if(!((A=B.pop())-(L=B.pop())<=M)){var H=L+Math.ceil((A-L)/M/2)*M;e(P,H,L,A,N),B.push(L,H,H,A)}}return o(O,"d"),n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(P){var L=this.data,A=[];if(!C(P,L))return A;for(var M=this.toBBox,N=[];L;){for(var B=0;B<L.children.length;B++){var H=L.children[B],z=L.leaf?M(H):H;C(P,z)&&(L.leaf?A.push(H):I(P,z)?this._all(H,A):N.push(H))}L=N.pop()}return A},n.prototype.collides=function(P){var L=this.data;if(!C(P,L))return!1;for(var A=[];L;){for(var M=0;M<L.children.length;M++){var N=L.children[M],B=L.leaf?this.toBBox(N):N;if(C(P,B)){if(L.leaf||I(P,B))return!0;A.push(N)}}L=A.pop()}return!1},n.prototype.load=function(P){if(!P||!P.length)return this;if(P.length<this._minEntries){for(var L=0;L<P.length;L++)this.insert(P[L]);return this}var A=this._build(P.slice(),0,P.length-1,0);if(this.data.children.length)if(this.data.height===A.height)this._splitRoot(this.data,A);else{if(this.data.height<A.height){var M=this.data;this.data=A,A=M}this._insert(A,this.data.height-A.height-1,!0)}else this.data=A;return this},n.prototype.insert=function(P){return P&&this._insert(P,this.data.height-1),this},n.prototype.clear=function(){return this.data=T([]),this},n.prototype.remove=function(P,L){if(!P)return this;for(var A,M,N,B=this.data,H=this.toBBox(P),z=[],R=[];B||z.length;){if(B||(B=z.pop(),M=z[z.length-1],A=R.pop(),N=!0),B.leaf){var X=i(P,B.children,L);if(X!==-1)return B.children.splice(X,1),z.push(B),this._condense(z),this}N||B.leaf||!I(B,H)?M?(A++,B=M.children[A],N=!1):B=null:(z.push(B),R.push(A),A=0,M=B,B=B.children[0])}return this},n.prototype.toBBox=function(P){return P},n.prototype.compareMinX=function(P,L){return P.minX-L.minX},n.prototype.compareMinY=function(P,L){return P.minY-L.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(P){return this.data=P,this},n.prototype._all=function(P,L){for(var A=[];P;)P.leaf?L.push.apply(L,P.children):A.push.apply(A,P.children),P=A.pop();return L},n.prototype._build=function(P,L,A,M){var N,B=A-L+1,H=this._maxEntries;if(B<=H)return a(N=T(P.slice(L,A+1)),this.toBBox),N;M||(M=Math.ceil(Math.log(B)/Math.log(H)),H=Math.ceil(B/Math.pow(H,M-1))),(N=T([])).leaf=!1,N.height=M;var z=Math.ceil(B/H),R=z*Math.ceil(Math.sqrt(H));O(P,L,A,R,this.compareMinX);for(var X=L;X<=A;X+=R){var ie=Math.min(X+R-1,A);O(P,X,ie,z,this.compareMinY);for(var Q=X;Q<=ie;Q+=z){var U=Math.min(Q+z-1,ie);N.children.push(this._build(P,Q,U,M-1))}}return a(N,this.toBBox),N},n.prototype._chooseSubtree=function(P,L,A,M){for(;M.push(L),!L.leaf&&M.length-1!==A;){for(var N=1/0,B=1/0,H=void 0,z=0;z<L.children.length;z++){var R=L.children[z],X=v(R),ie=(Q=P,U=R,(Math.max(U.maxX,Q.maxX)-Math.min(U.minX,Q.minX))*(Math.max(U.maxY,Q.maxY)-Math.min(U.minY,Q.minY))-X);ie<B?(B=ie,N=X<N?X:N,H=R):ie===B&&X<N&&(N=X,H=R)}L=H||L.children[0]}var Q,U;return L},n.prototype._insert=function(P,L,A){var M=A?P:this.toBBox(P),N=[],B=this._chooseSubtree(M,this.data,L,N);for(B.children.push(P),c(B,M);L>=0&&N[L].children.length>this._maxEntries;)this._split(N,L),L--;this._adjustParentBBoxes(M,N,L)},n.prototype._split=function(P,L){var A=P[L],M=A.children.length,N=this._minEntries;this._chooseSplitAxis(A,N,M);var B=this._chooseSplitIndex(A,N,M),H=T(A.children.splice(B,A.children.length-B));H.height=A.height,H.leaf=A.leaf,a(A,this.toBBox),a(H,this.toBBox),L?P[L-1].children.push(H):this._splitRoot(A,H)},n.prototype._splitRoot=function(P,L){this.data=T([P,L]),this.data.height=P.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(P,L,A){for(var M,N,B,H,z,R,X,ie=1/0,Q=1/0,U=L;U<=A-L;U++){var Te=u(P,0,U,this.toBBox),oe=u(P,U,A,this.toBBox),fe=(N=Te,B=oe,H=void 0,z=void 0,R=void 0,X=void 0,H=Math.max(N.minX,B.minX),z=Math.max(N.minY,B.minY),R=Math.min(N.maxX,B.maxX),X=Math.min(N.maxY,B.maxY),Math.max(0,R-H)*Math.max(0,X-z)),se=v(Te)+v(oe);fe<ie?(ie=fe,M=U,Q=se<Q?se:Q):fe===ie&&se<Q&&(Q=se,M=U)}return M||A-L},n.prototype._chooseSplitAxis=function(P,L,A){var M=P.leaf?this.compareMinX:f,N=P.leaf?this.compareMinY:m;this._allDistMargin(P,L,A,M)<this._allDistMargin(P,L,A,N)&&P.children.sort(M)},n.prototype._allDistMargin=function(P,L,A,M){P.children.sort(M);for(var N=this.toBBox,B=u(P,0,L,N),H=u(P,A-L,A,N),z=x(B)+x(H),R=L;R<A-L;R++){var X=P.children[R];c(B,P.leaf?N(X):X),z+=x(B)}for(var ie=A-L-1;ie>=L;ie--){var Q=P.children[ie];c(H,P.leaf?N(Q):Q),z+=x(H)}return z},n.prototype._adjustParentBBoxes=function(P,L,A){for(var M=A;M>=0;M--)c(L[M],P)},n.prototype._condense=function(P){for(var L=P.length-1,A=void 0;L>=0;L--)P[L].children.length===0?L>0?(A=P[L-1].children).splice(A.indexOf(P[L]),1):this.clear():a(P[L],this.toBBox)},n})});var Aw=ze((Lw,Dw)=>{g();(function(e,t){typeof Lw=="object"&&typeof Dw<"u"?Dw.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.TinyQueue=t())})(Lw,function(){"use strict";var e=o(function(n,i){if(n===void 0&&(n=[]),i===void 0&&(i=t),this.data=n,this.length=this.data.length,this.compare=i,this.length>0)for(var a=(this.length>>1)-1;a>=0;a--)this._down(a)},"TinyQueue");e.prototype.push=o(function(n){this.data.push(n),this.length++,this._up(this.length-1)},"push"),e.prototype.pop=o(function(){if(this.length!==0){var n=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),n}},"pop"),e.prototype.peek=o(function(){return this.data[0]},"peek"),e.prototype._up=o(function(n){for(var i=this,a=i.data,u=i.compare,c=a[n];n>0;){var f=n-1>>1,m=a[f];if(u(c,m)>=0)break;a[n]=m,n=f}a[n]=c},"_up"),e.prototype._down=o(function(n){for(var i=this,a=i.data,u=i.compare,c=this.length>>1,f=a[n];n<c;){var m=(n<<1)+1,v=a[m],x=m+1;if(x<this.length&&u(a[x],v)<0&&(m=x,v=a[x]),u(v,f)>=0)break;a[n]=v,n=m}a[n]=f},"_down");function t(r,n){return r<n?-1:r>n?1:0}return o(t,"defaultCompare"),e})});var gD=ze((Bve,mD)=>{g();mD.exports=o(function(t,r,n,i){var a=t[0],u=t[1],c=!1;n===void 0&&(n=0),i===void 0&&(i=r.length);for(var f=(i-n)/2,m=0,v=f-1;m<f;v=m++){var x=r[n+m*2+0],I=r[n+m*2+1],C=r[n+v*2+0],T=r[n+v*2+1],O=I>u!=T>u&&a<(C-x)*(u-I)/(T-I)+x;O&&(c=!c)}return c},"pointInPolygonFlat")});var vD=ze((Uve,yD)=>{g();yD.exports=o(function(t,r,n,i){var a=t[0],u=t[1],c=!1;n===void 0&&(n=0),i===void 0&&(i=r.length);for(var f=i-n,m=0,v=f-1;m<f;v=m++){var x=r[m+n][0],I=r[m+n][1],C=r[v+n][0],T=r[v+n][1],O=I>u!=T>u&&a<(C-x)*(u-I)/(T-I)+x;O&&(c=!c)}return c},"pointInPolygonNested")});var ID=ze(($ve,zI)=>{g();var xD=gD(),bD=vD();zI.exports=o(function(t,r,n,i){return r.length>0&&Array.isArray(r[0])?bD(t,r,n,i):xD(t,r,n,i)},"pointInPolygon");zI.exports.nested=bD;zI.exports.flat=xD});var _D=ze(($I,SD)=>{g();(function(e,t){typeof $I=="object"&&typeof SD<"u"?t($I):typeof define=="function"&&define.amd?define(["exports"],t):t((e=e||self).predicates={})})($I,function(e){"use strict";let r=33306690738754706e-32;function n(C,T,O,P,L){let A,M,N,B,H=T[0],z=P[0],R=0,X=0;z>H==z>-H?(A=H,H=T[++R]):(A=z,z=P[++X]);let ie=0;if(R<C&&X<O)for(z>H==z>-H?(N=A-((M=H+A)-H),H=T[++R]):(N=A-((M=z+A)-z),z=P[++X]),A=M,N!==0&&(L[ie++]=N);R<C&&X<O;)z>H==z>-H?(N=A-((M=A+H)-(B=M-A))+(H-B),H=T[++R]):(N=A-((M=A+z)-(B=M-A))+(z-B),z=P[++X]),A=M,N!==0&&(L[ie++]=N);for(;R<C;)N=A-((M=A+H)-(B=M-A))+(H-B),H=T[++R],A=M,N!==0&&(L[ie++]=N);for(;X<O;)N=A-((M=A+z)-(B=M-A))+(z-B),z=P[++X],A=M,N!==0&&(L[ie++]=N);return A===0&&ie!==0||(L[ie++]=A),ie}o(n,"r");function i(C){return new Float64Array(C)}o(i,"o");let a=33306690738754716e-32,u=22204460492503146e-32,c=11093356479670487e-47,f=i(4),m=i(8),v=i(12),x=i(16),I=i(4);e.orient2d=function(C,T,O,P,L,A){let M=(T-A)*(O-L),N=(C-L)*(P-A),B=M-N;if(M===0||N===0||M>0!=N>0)return B;let H=Math.abs(M+N);return Math.abs(B)>=a*H?B:-function(z,R,X,ie,Q,U,Te){let oe,fe,se,ve,ue,he,Z,Ke,Ue,rt,Ee,We,St,yt,pt,te,ce,ee,be=z-Q,Me=X-Q,Fe=R-U,it=ie-U;ue=(pt=(Ke=be-(Z=(he=134217729*be)-(he-be)))*(rt=it-(Ue=(he=134217729*it)-(he-it)))-((yt=be*it)-Z*Ue-Ke*Ue-Z*rt))-(Ee=pt-(ce=(Ke=Fe-(Z=(he=134217729*Fe)-(he-Fe)))*(rt=Me-(Ue=(he=134217729*Me)-(he-Me)))-((te=Fe*Me)-Z*Ue-Ke*Ue-Z*rt))),f[0]=pt-(Ee+ue)+(ue-ce),ue=(St=yt-((We=yt+Ee)-(ue=We-yt))+(Ee-ue))-(Ee=St-te),f[1]=St-(Ee+ue)+(ue-te),ue=(ee=We+Ee)-We,f[2]=We-(ee-ue)+(Ee-ue),f[3]=ee;let xt=function(Yi,Gi){let Po=Gi[0];for(let Zn=1;Zn<Yi;Zn++)Po+=Gi[Zn];return Po}(4,f),Bt=u*Te;if(xt>=Bt||-xt>=Bt||(oe=z-(be+(ue=z-be))+(ue-Q),se=X-(Me+(ue=X-Me))+(ue-Q),fe=R-(Fe+(ue=R-Fe))+(ue-U),ve=ie-(it+(ue=ie-it))+(ue-U),oe===0&&fe===0&&se===0&&ve===0)||(Bt=c*Te+r*Math.abs(xt),(xt+=be*ve+it*oe-(Fe*se+Me*fe))>=Bt||-xt>=Bt))return xt;ue=(pt=(Ke=oe-(Z=(he=134217729*oe)-(he-oe)))*(rt=it-(Ue=(he=134217729*it)-(he-it)))-((yt=oe*it)-Z*Ue-Ke*Ue-Z*rt))-(Ee=pt-(ce=(Ke=fe-(Z=(he=134217729*fe)-(he-fe)))*(rt=Me-(Ue=(he=134217729*Me)-(he-Me)))-((te=fe*Me)-Z*Ue-Ke*Ue-Z*rt))),I[0]=pt-(Ee+ue)+(ue-ce),ue=(St=yt-((We=yt+Ee)-(ue=We-yt))+(Ee-ue))-(Ee=St-te),I[1]=St-(Ee+ue)+(ue-te),ue=(ee=We+Ee)-We,I[2]=We-(ee-ue)+(Ee-ue),I[3]=ee;let pn=n(4,f,4,I,m);ue=(pt=(Ke=be-(Z=(he=134217729*be)-(he-be)))*(rt=ve-(Ue=(he=134217729*ve)-(he-ve)))-((yt=be*ve)-Z*Ue-Ke*Ue-Z*rt))-(Ee=pt-(ce=(Ke=Fe-(Z=(he=134217729*Fe)-(he-Fe)))*(rt=se-(Ue=(he=134217729*se)-(he-se)))-((te=Fe*se)-Z*Ue-Ke*Ue-Z*rt))),I[0]=pt-(Ee+ue)+(ue-ce),ue=(St=yt-((We=yt+Ee)-(ue=We-yt))+(Ee-ue))-(Ee=St-te),I[1]=St-(Ee+ue)+(ue-te),ue=(ee=We+Ee)-We,I[2]=We-(ee-ue)+(Ee-ue),I[3]=ee;let Xe=n(pn,m,4,I,v);ue=(pt=(Ke=oe-(Z=(he=134217729*oe)-(he-oe)))*(rt=ve-(Ue=(he=134217729*ve)-(he-ve)))-((yt=oe*ve)-Z*Ue-Ke*Ue-Z*rt))-(Ee=pt-(ce=(Ke=fe-(Z=(he=134217729*fe)-(he-fe)))*(rt=se-(Ue=(he=134217729*se)-(he-se)))-((te=fe*se)-Z*Ue-Ke*Ue-Z*rt))),I[0]=pt-(Ee+ue)+(ue-ce),ue=(St=yt-((We=yt+Ee)-(ue=We-yt))+(Ee-ue))-(Ee=St-te),I[1]=St-(Ee+ue)+(ue-te),ue=(ee=We+Ee)-We,I[2]=We-(ee-ue)+(Ee-ue),I[3]=ee;let Gt=n(Xe,v,4,I,x);return x[Gt-1]}(C,T,O,P,L,A,H)},e.orient2dfast=function(C,T,O,P,L,A){return(T-A)*(O-L)-(C-L)*(P-A)},Object.defineProperty(e,"__esModule",{value:!0})})});var MD=ze((Xve,kw)=>{"use strict";g();var CD=Ow(),WI=Aw(),vq=ID(),xq=_D().orient2d;WI.default&&(WI=WI.default);kw.exports=ED;kw.exports.default=ED;function ED(e,t,r){t=Math.max(0,t===void 0?2:t),r=r||0;var n=Cq(e),i=new CD(16);i.toBBox=function(A){return{minX:A[0],minY:A[1],maxX:A[0],maxY:A[1]}},i.compareMinX=function(A,M){return A[0]-M[0]},i.compareMinY=function(A,M){return A[1]-M[1]},i.load(e);for(var a=[],u=0,c;u<n.length;u++){var f=n[u];i.remove(f),c=TD(f,c),a.push(c)}var m=new CD(16);for(u=0;u<a.length;u++)m.insert(Fw(a[u]));for(var v=t*t,x=r*r;a.length;){var I=a.shift(),C=I.p,T=I.next.p,O=Nw(C,T);if(!(O<x)){var P=O/v;f=bq(i,I.prev.p,C,T,I.next.next.p,P,m),f&&Math.min(Nw(f,C),Nw(f,T))<=P&&(a.push(I),a.push(TD(f,I)),i.remove(f),m.remove(I),m.insert(Fw(I)),m.insert(Fw(I.next)))}}I=c;var L=[];do L.push(I.p),I=I.next;while(I!==c);return L.push(I.p),L}o(ED,"concaveman");function bq(e,t,r,n,i,a,u){for(var c=new WI([],Iq),f=e.data;f;){for(var m=0;m<f.children.length;m++){var v=f.children[m],x=f.leaf?Rw(v,r,n):Sq(r,n,v);x>a||c.push({node:v,dist:x})}for(;c.length&&!c.peek().node.children;){var I=c.pop(),C=I.node,T=Rw(C,t,r),O=Rw(C,n,i);if(I.dist<T&&I.dist<O&&PD(r,C,u)&&PD(n,C,u))return C}f=c.pop(),f&&(f=f.node)}return null}o(bq,"findCandidate");function Iq(e,t){return e.dist-t.dist}o(Iq,"compareDist");function Sq(e,t,r){if(wD(e,r)||wD(t,r))return 0;var n=HI(e[0],e[1],t[0],t[1],r.minX,r.minY,r.maxX,r.minY);if(n===0)return 0;var i=HI(e[0],e[1],t[0],t[1],r.minX,r.minY,r.minX,r.maxY);if(i===0)return 0;var a=HI(e[0],e[1],t[0],t[1],r.maxX,r.minY,r.maxX,r.maxY);if(a===0)return 0;var u=HI(e[0],e[1],t[0],t[1],r.minX,r.maxY,r.maxX,r.maxY);return u===0?0:Math.min(n,i,a,u)}o(Sq,"sqSegBoxDist");function wD(e,t){return e[0]>=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}o(wD,"inside");function PD(e,t,r){for(var n=Math.min(e[0],t[0]),i=Math.min(e[1],t[1]),a=Math.max(e[0],t[0]),u=Math.max(e[1],t[1]),c=r.search({minX:n,minY:i,maxX:a,maxY:u}),f=0;f<c.length;f++)if(_q(c[f].p,c[f].next.p,e,t))return!1;return!0}o(PD,"noIntersections");function vg(e,t,r){return xq(e[0],e[1],t[0],t[1],r[0],r[1])}o(vg,"cross");function _q(e,t,r,n){return e!==n&&t!==r&&vg(e,t,r)>0!=vg(e,t,n)>0&&vg(r,n,e)>0!=vg(r,n,t)>0}o(_q,"intersects");function Fw(e){var t=e.p,r=e.next.p;return e.minX=Math.min(t[0],r[0]),e.minY=Math.min(t[1],r[1]),e.maxX=Math.max(t[0],r[0]),e.maxY=Math.max(t[1],r[1]),e}o(Fw,"updateBBox");function Cq(e){for(var t=e[0],r=e[0],n=e[0],i=e[0],a=0;a<e.length;a++){var u=e[a];u[0]<t[0]&&(t=u),u[0]>n[0]&&(n=u),u[1]<r[1]&&(r=u),u[1]>i[1]&&(i=u)}var c=[t,r,n,i],f=c.slice();for(a=0;a<e.length;a++)vq(e[a],c)||f.push(e[a]);return Pq(f)}o(Cq,"fastConvexHull");function TD(e,t){var r={p:e,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(r.next=t.next,r.prev=t,t.next.prev=r,t.next=r):(r.prev=r,r.next=r),r}o(TD,"insertNode");function Nw(e,t){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}o(Nw,"getSqDist");function Rw(e,t,r){var n=t[0],i=t[1],a=r[0]-n,u=r[1]-i;if(a!==0||u!==0){var c=((e[0]-n)*a+(e[1]-i)*u)/(a*a+u*u);c>1?(n=r[0],i=r[1]):c>0&&(n+=a*c,i+=u*c)}return a=e[0]-n,u=e[1]-i,a*a+u*u}o(Rw,"sqSegDist");function HI(e,t,r,n,i,a,u,c){var f=r-e,m=n-t,v=u-i,x=c-a,I=e-i,C=t-a,T=f*f+m*m,O=f*v+m*x,P=v*v+x*x,L=f*I+m*C,A=v*I+x*C,M=T*P-O*O,N,B,H,z,R=M,X=M;M===0?(B=0,R=1,z=A,X=P):(B=O*A-P*L,z=T*A-O*L,B<0?(B=0,z=A,X=P):B>R&&(B=R,z=A+O,X=P)),z<0?(z=0,-L<0?B=0:-L>T?B=R:(B=-L,R=T)):z>X&&(z=X,-L+O<0?B=0:-L+O>T?B=R:(B=-L+O,R=T)),N=B===0?0:B/R,H=z===0?0:z/X;var ie=(1-N)*e+N*r,Q=(1-N)*t+N*n,U=(1-H)*i+H*u,Te=(1-H)*a+H*c,oe=U-ie,fe=Te-Q;return oe*oe+fe*fe}o(HI,"sqSegSegDist");function wq(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}o(wq,"compareByX");function Pq(e){e.sort(wq);for(var t=[],r=0;r<e.length;r++){for(;t.length>=2&&vg(t[t.length-2],t[t.length-1],e[r])<=0;)t.pop();t.push(e[r])}for(var n=[],i=e.length-1;i>=0;i--){for(;n.length>=2&&vg(n[n.length-2],n[n.length-1],e[i])<=0;)n.pop();n.push(e[i])}return n.pop(),t.pop(),t.concat(n)}o(Pq,"convexHull")});var FD=ze((Gw,jw)=>{g();(function(e,t){typeof Gw=="object"&&typeof jw<"u"?jw.exports=t():typeof define=="function"&&define.amd?define(t):e.quickselect=t()})(Gw,function(){"use strict";function e(i,a,u,c,f){t(i,a,u||0,c||i.length-1,f||n)}o(e,"quickselect");function t(i,a,u,c,f){for(;c>u;){if(c-u>600){var m=c-u+1,v=a-u+1,x=Math.log(m),I=.5*Math.exp(2*x/3),C=.5*Math.sqrt(x*I*(m-I)/m)*(v-m/2<0?-1:1),T=Math.max(u,Math.floor(a-v*I/m+C)),O=Math.min(c,Math.floor(a+(m-v)*I/m+C));t(i,a,T,O,f)}var P=i[a],L=u,A=c;for(r(i,u,a),f(i[c],P)>0&&r(i,u,c);L<A;){for(r(i,L,A),L++,A--;f(i[L],P)<0;)L++;for(;f(i[A],P)>0;)A--}f(i[u],P)===0?r(i,u,A):(A++,r(i,A,c)),A<=a&&(u=A+1),a<=A&&(c=A-1)}}o(t,"quickselectStep");function r(i,a,u){var c=i[a];i[a]=i[u],i[u]=c}o(r,"swap");function n(i,a){return i<a?-1:i>a?1:0}return o(n,"defaultCompare"),e})});var $w=ze((H2e,zw)=>{"use strict";g();zw.exports=I1;zw.exports.default=I1;var jq=FD();function I1(e,t){if(!(this instanceof I1))return new I1(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}o(I1,"rbush");I1.prototype={all:o(function(){return this._all(this.data,[])},"all"),search:o(function(e){var t=this.data,r=[],n=this.toBBox;if(!YI(e,t))return r;for(var i=[],a,u,c,f;t;){for(a=0,u=t.children.length;a<u;a++)c=t.children[a],f=t.leaf?n(c):c,YI(e,f)&&(t.leaf?r.push(c):Vw(e,f)?this._all(c,r):i.push(c));t=i.pop()}return r},"search"),collides:o(function(e){var t=this.data,r=this.toBBox;if(!YI(e,t))return!1;for(var n=[],i,a,u,c;t;){for(i=0,a=t.children.length;i<a;i++)if(u=t.children[i],c=t.leaf?r(u):u,YI(e,c)){if(t.leaf||Vw(e,c))return!0;n.push(u)}t=n.pop()}return!1},"collides"),load:o(function(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(var t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.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:o(function(e){return e&&this._insert(e,this.data.height-1),this},"insert"),clear:o(function(){return this.data=Ig([]),this},"clear"),remove:o(function(e,t){if(!e)return this;for(var r=this.data,n=this.toBBox(e),i=[],a=[],u,c,f,m;r||i.length;){if(r||(r=i.pop(),c=i[i.length-1],u=a.pop(),m=!0),r.leaf&&(f=Uq(e,r.children,t),f!==-1))return r.children.splice(f,1),i.push(r),this._condense(i),this;!m&&!r.leaf&&Vw(r,n)?(i.push(r),a.push(u),u=0,c=r,r=r.children[0]):c?(u++,r=c.children[u],m=!1):r=null}return this},"remove"),toBBox:o(function(e){return e},"toBBox"),compareMinX:ND,compareMinY:RD,toJSON:o(function(){return this.data},"toJSON"),fromJSON:o(function(e){return this.data=e,this},"fromJSON"),_all:o(function(e,t){for(var r=[];e;)e.leaf?t.push.apply(t,e.children):r.push.apply(r,e.children),e=r.pop();return t},"_all"),_build:o(function(e,t,r,n){var i=r-t+1,a=this._maxEntries,u;if(i<=a)return u=Ig(e.slice(t,r+1)),bg(u,this.toBBox),u;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),u=Ig([]),u.leaf=!1,u.height=n;var c=Math.ceil(i/a),f=c*Math.ceil(Math.sqrt(a)),m,v,x,I;for(kD(e,t,r,f,this.compareMinX),m=t;m<=r;m+=f)for(x=Math.min(m+f-1,r),kD(e,m,x,c,this.compareMinY),v=m;v<=x;v+=c)I=Math.min(v+c-1,x),u.children.push(this._build(e,v,I,n-1));return bg(u,this.toBBox),u},"_build"),_chooseSubtree:o(function(e,t,r,n){for(var i,a,u,c,f,m,v,x;n.push(t),!(t.leaf||n.length-1===r);){for(v=x=1/0,i=0,a=t.children.length;i<a;i++)u=t.children[i],f=Uw(u),m=Vq(e,u)-f,m<x?(x=m,v=f<v?f:v,c=u):m===x&&f<v&&(v=f,c=u);t=c||t.children[0]}return t},"_chooseSubtree"),_insert:o(function(e,t,r){var n=this.toBBox,i=r?e:n(e),a=[],u=this._chooseSubtree(i,this.data,t,a);for(u.children.push(e),b1(u,i);t>=0&&a[t].children.length>this._maxEntries;)this._split(a,t),t--;this._adjustParentBBoxes(i,a,t)},"_insert"),_split:o(function(e,t){var r=e[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var a=this._chooseSplitIndex(r,i,n),u=Ig(r.children.splice(a,r.children.length-a));u.height=r.height,u.leaf=r.leaf,bg(r,this.toBBox),bg(u,this.toBBox),t?e[t-1].children.push(u):this._splitRoot(r,u)},"_split"),_splitRoot:o(function(e,t){this.data=Ig([e,t]),this.data.height=e.height+1,this.data.leaf=!1,bg(this.data,this.toBBox)},"_splitRoot"),_chooseSplitIndex:o(function(e,t,r){var n,i,a,u,c,f,m,v;for(f=m=1/0,n=t;n<=r-t;n++)i=x1(e,0,n,this.toBBox),a=x1(e,n,r,this.toBBox),u=zq(i,a),c=Uw(i)+Uw(a),u<f?(f=u,v=n,m=c<m?c:m):u===f&&c<m&&(m=c,v=n);return v},"_chooseSplitIndex"),_chooseSplitAxis:o(function(e,t,r){var n=e.leaf?this.compareMinX:ND,i=e.leaf?this.compareMinY:RD,a=this._allDistMargin(e,t,r,n),u=this._allDistMargin(e,t,r,i);a<u&&e.children.sort(n)},"_chooseSplitAxis"),_allDistMargin:o(function(e,t,r,n){e.children.sort(n);var i=this.toBBox,a=x1(e,0,t,i),u=x1(e,r-t,r,i),c=qI(a)+qI(u),f,m;for(f=t;f<r-t;f++)m=e.children[f],b1(a,e.leaf?i(m):m),c+=qI(a);for(f=r-t-1;f>=t;f--)m=e.children[f],b1(u,e.leaf?i(m):m),c+=qI(u);return c},"_allDistMargin"),_adjustParentBBoxes:o(function(e,t,r){for(var n=r;n>=0;n--)b1(t[n],e)},"_adjustParentBBoxes"),_condense:o(function(e){for(var t=e.length-1,r;t>=0;t--)e[t].children.length===0?t>0?(r=e[t-1].children,r.splice(r.indexOf(e[t]),1)):this.clear():bg(e[t],this.toBBox)},"_condense"),_initFormat:o(function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")},"_initFormat")};function Uq(e,t,r){if(!r)return t.indexOf(e);for(var n=0;n<t.length;n++)if(r(e,t[n]))return n;return-1}o(Uq,"findItem");function bg(e,t){x1(e,0,e.children.length,t,e)}o(bg,"calcBBox");function x1(e,t,r,n,i){i||(i=Ig(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=t,u;a<r;a++)u=e.children[a],b1(i,e.leaf?n(u):u);return i}o(x1,"distBBox");function b1(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}o(b1,"extend");function ND(e,t){return e.minX-t.minX}o(ND,"compareNodeMinX");function RD(e,t){return e.minY-t.minY}o(RD,"compareNodeMinY");function Uw(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}o(Uw,"bboxArea");function qI(e){return e.maxX-e.minX+(e.maxY-e.minY)}o(qI,"bboxMargin");function Vq(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}o(Vq,"enlargedArea");function zq(e,t){var r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,a-n)}o(zq,"intersectionArea");function Vw(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}o(Vw,"contains");function YI(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}o(YI,"intersects");function Ig(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}o(Ig,"createNode");function kD(e,t,r,n,i){for(var a=[t,r],u;a.length;)r=a.pop(),t=a.pop(),!(r-t<=n)&&(u=t+Math.ceil((r-t)/n/2)*n,jq(e,u,t,r,i),a.push(t,u,u,r))}o(kD,"multiSelect")});var VD=ze((W_e,Xw)=>{"use strict";g();Xw.exports=JI;Xw.exports.default=JI;function JI(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,a=GD(e,0,i,r,!0),u=[];if(!a||a.next===a.prev)return u;var c,f,m,v,x,I,C;if(n&&(a=tY(e,t,a,r)),e.length>80*r){c=m=e[0],f=v=e[1];for(var T=r;T<i;T+=r)x=e[T],I=e[T+1],x<c&&(c=x),I<f&&(f=I),x>m&&(m=x),I>v&&(v=I);C=Math.max(m-c,v-f),C=C!==0?32767/C:0}return _1(a,u,r,c,f,C,0),u}o(JI,"earcut");function GD(e,t,r,n,i){var a,u;if(i===Yw(e,t,r,n)>0)for(a=t;a<r;a+=n)u=BD(a,e[a],e[a+1],u);else for(a=r-n;a>=t;a-=n)u=BD(a,e[a],e[a+1],u);return u&&QI(u,u.next)&&(w1(u),u=u.next),u}o(GD,"linkedList");function Hd(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(QI(r,r.next)||_i(r.prev,r,r.next)===0)){if(w1(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}o(Hd,"filterPoints");function _1(e,t,r,n,i,a,u){if(e){!u&&a&&sY(e,n,i,a);for(var c=e,f,m;e.prev!==e.next;){if(f=e.prev,m=e.next,a?Jq(e,n,i,a):Kq(e)){t.push(f.i/r|0),t.push(e.i/r|0),t.push(m.i/r|0),w1(e),e=m.next,c=m.next;continue}if(e=m,e===c){u?u===1?(e=Qq(Hd(e),t,r),_1(e,t,r,n,i,a,2)):u===2&&eY(e,t,r,n,i,a):_1(Hd(e),t,r,n,i,a,1);break}}}}o(_1,"earcutLinked");function Kq(e){var t=e.prev,r=e,n=e.next;if(_i(t,r,n)>=0)return!1;for(var i=t.x,a=r.x,u=n.x,c=t.y,f=r.y,m=n.y,v=i<a?i<u?i:u:a<u?a:u,x=c<f?c<m?c:m:f<m?f:m,I=i>a?i>u?i:u:a>u?a:u,C=c>f?c>m?c:m:f>m?f:m,T=n.next;T!==t;){if(T.x>=v&&T.x<=I&&T.y>=x&&T.y<=C&&_g(i,c,a,f,u,m,T.x,T.y)&&_i(T.prev,T,T.next)>=0)return!1;T=T.next}return!0}o(Kq,"isEar");function Jq(e,t,r,n){var i=e.prev,a=e,u=e.next;if(_i(i,a,u)>=0)return!1;for(var c=i.x,f=a.x,m=u.x,v=i.y,x=a.y,I=u.y,C=c<f?c<m?c:m:f<m?f:m,T=v<x?v<I?v:I:x<I?x:I,O=c>f?c>m?c:m:f>m?f:m,P=v>x?v>I?v:I:x>I?x:I,L=Ww(C,T,t,r,n),A=Ww(O,P,t,r,n),M=e.prevZ,N=e.nextZ;M&&M.z>=L&&N&&N.z<=A;){if(M.x>=C&&M.x<=O&&M.y>=T&&M.y<=P&&M!==i&&M!==u&&_g(c,v,f,x,m,I,M.x,M.y)&&_i(M.prev,M,M.next)>=0||(M=M.prevZ,N.x>=C&&N.x<=O&&N.y>=T&&N.y<=P&&N!==i&&N!==u&&_g(c,v,f,x,m,I,N.x,N.y)&&_i(N.prev,N,N.next)>=0))return!1;N=N.nextZ}for(;M&&M.z>=L;){if(M.x>=C&&M.x<=O&&M.y>=T&&M.y<=P&&M!==i&&M!==u&&_g(c,v,f,x,m,I,M.x,M.y)&&_i(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;N&&N.z<=A;){if(N.x>=C&&N.x<=O&&N.y>=T&&N.y<=P&&N!==i&&N!==u&&_g(c,v,f,x,m,I,N.x,N.y)&&_i(N.prev,N,N.next)>=0)return!1;N=N.nextZ}return!0}o(Jq,"isEarHashed");function Qq(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!QI(i,a)&&jD(i,n,n.next,a)&&C1(i,a)&&C1(a,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(a.i/r|0),w1(n),w1(n.next),n=e=a),n=n.next}while(n!==e);return Hd(n)}o(Qq,"cureLocalIntersections");function eY(e,t,r,n,i,a){var u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&uY(u,c)){var f=UD(u,c);u=Hd(u,u.next),f=Hd(f,f.next),_1(u,t,r,n,i,a,0),_1(f,t,r,n,i,a,0);return}c=c.next}u=u.next}while(u!==e)}o(eY,"splitEarcut");function tY(e,t,r,n){var i=[],a,u,c,f,m;for(a=0,u=t.length;a<u;a++)c=t[a]*n,f=a<u-1?t[a+1]*n:e.length,m=GD(e,c,f,n,!1),m===m.next&&(m.steiner=!0),i.push(lY(m));for(i.sort(rY),a=0;a<i.length;a++)r=nY(i[a],r);return r}o(tY,"eliminateHoles");function rY(e,t){return e.x-t.x}o(rY,"compareX");function nY(e,t){var r=iY(e,t);if(!r)return t;var n=UD(r,e);return Hd(n,n.next),Hd(r,r.next)}o(nY,"eliminateHole");function iY(e,t){var r=t,n=e.x,i=e.y,a=-1/0,u;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var c=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(c<=n&&c>a&&(a=c,u=r.x<r.next.x?r:r.next,c===n))return u}r=r.next}while(r!==t);if(!u)return null;var f=u,m=u.x,v=u.y,x=1/0,I;r=u;do n>=r.x&&r.x>=m&&n!==r.x&&_g(i<v?n:a,i,m,v,i<v?a:n,i,r.x,r.y)&&(I=Math.abs(i-r.y)/(n-r.x),C1(r,e)&&(I<x||I===x&&(r.x>u.x||r.x===u.x&&oY(u,r)))&&(u=r,x=I)),r=r.next;while(r!==f);return u}o(iY,"findHoleBridge");function oY(e,t){return _i(e.prev,e,t.prev)<0&&_i(t.next,e,e.next)<0}o(oY,"sectorContainsSector");function sY(e,t,r,n){var i=e;do i.z===0&&(i.z=Ww(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,aY(i)}o(sY,"indexCurve");function aY(e){var t,r,n,i,a,u,c,f,m=1;do{for(r=e,e=null,a=null,u=0;r;){for(u++,n=r,c=0,t=0;t<m&&(c++,n=n.nextZ,!!n);t++);for(f=m;c>0||f>0&&n;)c!==0&&(f===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,c--):(i=n,n=n.nextZ,f--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,m*=2}while(u>1);return e}o(aY,"sortLinked");function Ww(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}o(Ww,"zOrder");function lY(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}o(lY,"getLeftmost");function _g(e,t,r,n,i,a,u,c){return(i-u)*(t-c)>=(e-u)*(a-c)&&(e-u)*(n-c)>=(r-u)*(t-c)&&(r-u)*(a-c)>=(i-u)*(n-c)}o(_g,"pointInTriangle");function uY(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!cY(e,t)&&(C1(e,t)&&C1(t,e)&&pY(e,t)&&(_i(e.prev,e,t.prev)||_i(e,t.prev,t))||QI(e,t)&&_i(e.prev,e,e.next)>0&&_i(t.prev,t,t.next)>0)}o(uY,"isValidDiagonal");function _i(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}o(_i,"area");function QI(e,t){return e.x===t.x&&e.y===t.y}o(QI,"equals");function jD(e,t,r,n){var i=KI(_i(e,t,r)),a=KI(_i(e,t,n)),u=KI(_i(r,n,e)),c=KI(_i(r,n,t));return!!(i!==a&&u!==c||i===0&&ZI(e,r,t)||a===0&&ZI(e,n,t)||u===0&&ZI(r,e,n)||c===0&&ZI(r,t,n))}o(jD,"intersects");function ZI(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}o(ZI,"onSegment");function KI(e){return e>0?1:e<0?-1:0}o(KI,"sign");function cY(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&jD(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}o(cY,"intersectsPolygon");function C1(e,t){return _i(e.prev,e,e.next)<0?_i(e,t,e.next)>=0&&_i(e,e.prev,t)>=0:_i(e,t,e.prev)<0||_i(e,e.next,t)<0}o(C1,"locallyInside");function pY(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}o(pY,"middleInside");function UD(e,t){var r=new qw(e.i,e.x,e.y),n=new qw(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}o(UD,"splitPolygon");function BD(e,t,r,n){var i=new qw(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}o(BD,"insertNode");function w1(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}o(w1,"removeNode");function qw(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}o(qw,"Node");JI.deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,u=Math.abs(Yw(e,0,a,r));if(i)for(var c=0,f=t.length;c<f;c++){var m=t[c]*r,v=c<f-1?t[c+1]*r:e.length;u-=Math.abs(Yw(e,m,v,r))}var x=0;for(c=0;c<n.length;c+=3){var I=n[c]*r,C=n[c+1]*r,T=n[c+2]*r;x+=Math.abs((e[I]-e[T])*(e[C+1]-e[I+1])-(e[I]-e[C])*(e[T+1]-e[I+1]))}return u===0&&x===0?0:Math.abs((x-u)/u)};function Yw(e,t,r,n){for(var i=0,a=t,u=r-n;a<r;a+=n)i+=(e[u]-e[a])*(e[a+1]+e[u+1]),u=a;return i}o(Yw,"signedArea");JI.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var u=0;u<t;u++)r.vertices.push(e[i][a][u]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}});var eP=ze(Pt=>{"use strict";g();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.earthRadius=63710088e-1;Pt.factors={centimeters:Pt.earthRadius*100,centimetres:Pt.earthRadius*100,degrees:Pt.earthRadius/111325,feet:Pt.earthRadius*3.28084,inches:Pt.earthRadius*39.37,kilometers:Pt.earthRadius/1e3,kilometres:Pt.earthRadius/1e3,meters:Pt.earthRadius,metres:Pt.earthRadius,miles:Pt.earthRadius/1609.344,millimeters:Pt.earthRadius*1e3,millimetres:Pt.earthRadius*1e3,nauticalmiles:Pt.earthRadius/1852,radians:1,yards:Pt.earthRadius*1.0936};Pt.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/Pt.earthRadius,yards:1.0936133};Pt.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 wf(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}o(wf,"feature");Pt.feature=wf;function yY(e,t,r){switch(r===void 0&&(r={}),e){case"Point":return Zw(t).geometry;case"LineString":return Jw(t).geometry;case"Polygon":return Kw(t).geometry;case"MultiPoint":return $D(t).geometry;case"MultiLineString":return zD(t).geometry;case"MultiPolygon":return HD(t).geometry;default:throw new Error(e+" is invalid")}}o(yY,"geometry");Pt.geometry=yY;function Zw(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!e2(e[0])||!e2(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return wf(n,t,r)}o(Zw,"point");Pt.point=Zw;function vY(e,t,r){return r===void 0&&(r={}),t2(e.map(function(n){return Zw(n,t)}),r)}o(vY,"points");Pt.points=vY;function Kw(e,t,r){r===void 0&&(r={});for(var n=0,i=e;n<i.length;n++){var a=i[n];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var u=0;u<a[a.length-1].length;u++)if(a[a.length-1][u]!==a[0][u])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:e};return wf(c,t,r)}o(Kw,"polygon");Pt.polygon=Kw;function xY(e,t,r){return r===void 0&&(r={}),t2(e.map(function(n){return Kw(n,t)}),r)}o(xY,"polygons");Pt.polygons=xY;function Jw(e,t,r){if(r===void 0&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:e};return wf(n,t,r)}o(Jw,"lineString");Pt.lineString=Jw;function bY(e,t,r){return r===void 0&&(r={}),t2(e.map(function(n){return Jw(n,t)}),r)}o(bY,"lineStrings");Pt.lineStrings=bY;function t2(e,t){t===void 0&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}o(t2,"featureCollection");Pt.featureCollection=t2;function zD(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return wf(n,t,r)}o(zD,"multiLineString");Pt.multiLineString=zD;function $D(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return wf(n,t,r)}o($D,"multiPoint");Pt.multiPoint=$D;function HD(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return wf(n,t,r)}o(HD,"multiPolygon");Pt.multiPolygon=HD;function IY(e,t,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:e};return wf(n,t,r)}o(IY,"geometryCollection");Pt.geometryCollection=IY;function SY(e,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r}o(SY,"round");Pt.round=SY;function WD(e,t){t===void 0&&(t="kilometers");var r=Pt.factors[t];if(!r)throw new Error(t+" units is invalid");return e*r}o(WD,"radiansToLength");Pt.radiansToLength=WD;function Qw(e,t){t===void 0&&(t="kilometers");var r=Pt.factors[t];if(!r)throw new Error(t+" units is invalid");return e/r}o(Qw,"lengthToRadians");Pt.lengthToRadians=Qw;function _Y(e,t){return qD(Qw(e,t))}o(_Y,"lengthToDegrees");Pt.lengthToDegrees=_Y;function CY(e){var t=e%360;return t<0&&(t+=360),t}o(CY,"bearingToAzimuth");Pt.bearingToAzimuth=CY;function qD(e){var t=e%(2*Math.PI);return t*180/Math.PI}o(qD,"radiansToDegrees");Pt.radiansToDegrees=qD;function wY(e){var t=e%360;return t*Math.PI/180}o(wY,"degreesToRadians");Pt.degreesToRadians=wY;function PY(e,t,r){if(t===void 0&&(t="kilometers"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return WD(Qw(e,t),r)}o(PY,"convertLength");Pt.convertLength=PY;function TY(e,t,r){if(t===void 0&&(t="meters"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("area must be a positive number");var n=Pt.areaFactors[t];if(!n)throw new Error("invalid original units");var i=Pt.areaFactors[r];if(!i)throw new Error("invalid final units");return e/n*i}o(TY,"convertArea");Pt.convertArea=TY;function e2(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}o(e2,"isNumber");Pt.isNumber=e2;function EY(e){return!!e&&e.constructor===Object}o(EY,"isObject");Pt.isObject=EY;function MY(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(t){if(!e2(t))throw new Error("bbox must only contain numbers")})}o(MY,"validateBBox");Pt.validateBBox=MY;function OY(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}o(OY,"validateId");Pt.validateId=OY});var rP=ze(mo=>{"use strict";g();Object.defineProperty(mo,"__esModule",{value:!0});var Ts=eP();function P1(e,t,r){if(e!==null)for(var n,i,a,u,c,f,m,v=0,x=0,I,C=e.type,T=C==="FeatureCollection",O=C==="Feature",P=T?e.features.length:1,L=0;L<P;L++){m=T?e.features[L].geometry:O?e.geometry:e,I=m?m.type==="GeometryCollection":!1,c=I?m.geometries.length:1;for(var A=0;A<c;A++){var M=0,N=0;if(u=I?m.geometries[A]:m,u!==null){f=u.coordinates;var B=u.type;switch(v=r&&(B==="Polygon"||B==="MultiPolygon")?1:0,B){case null:break;case"Point":if(t(f,x,L,M,N)===!1)return!1;x++,M++;break;case"LineString":case"MultiPoint":for(n=0;n<f.length;n++){if(t(f[n],x,L,M,N)===!1)return!1;x++,B==="MultiPoint"&&M++}B==="LineString"&&M++;break;case"Polygon":case"MultiLineString":for(n=0;n<f.length;n++){for(i=0;i<f[n].length-v;i++){if(t(f[n][i],x,L,M,N)===!1)return!1;x++}B==="MultiLineString"&&M++,B==="Polygon"&&N++}B==="Polygon"&&M++;break;case"MultiPolygon":for(n=0;n<f.length;n++){for(N=0,i=0;i<f[n].length;i++){for(a=0;a<f[n][i].length-v;a++){if(t(f[n][i][a],x,L,M,N)===!1)return!1;x++}N++}M++}break;case"GeometryCollection":for(n=0;n<u.geometries.length;n++)if(P1(u.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}o(P1,"coordEach");function LY(e,t,r,n){var i=r;return P1(e,function(a,u,c,f,m){u===0&&r===void 0?i=a:i=t(i,a,u,c,f,m)},n),i}o(LY,"coordReduce");function YD(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&t(e.features[r].properties,r)!==!1;r++);break;case"Feature":t(e.properties,0);break}}o(YD,"propEach");function DY(e,t,r){var n=r;return YD(e,function(i,a){a===0&&r===void 0?n=i:n=t(n,i,a)}),n}o(DY,"propReduce");function XD(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&t(e.features[r],r)!==!1;r++);}o(XD,"featureEach");function AY(e,t,r){var n=r;return XD(e,function(i,a){a===0&&r===void 0?n=i:n=t(n,i,a)}),n}o(AY,"featureReduce");function FY(e){var t=[];return P1(e,function(r){t.push(r)}),t}o(FY,"coordAll");function tP(e,t){var r,n,i,a,u,c,f,m,v,x,I=0,C=e.type==="FeatureCollection",T=e.type==="Feature",O=C?e.features.length:1;for(r=0;r<O;r++){for(c=C?e.features[r].geometry:T?e.geometry:e,m=C?e.features[r].properties:T?e.properties:{},v=C?e.features[r].bbox:T?e.bbox:void 0,x=C?e.features[r].id:T?e.id:void 0,f=c?c.type==="GeometryCollection":!1,u=f?c.geometries.length:1,i=0;i<u;i++){if(a=f?c.geometries[i]:c,a===null){if(t(null,I,m,v,x)===!1)return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(a,I,m,v,x)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<a.geometries.length;n++)if(t(a.geometries[n],I,m,v,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}I++}}o(tP,"geomEach");function NY(e,t,r){var n=r;return tP(e,function(i,a,u,c,f){a===0&&r===void 0?n=i:n=t(n,i,a,u,c,f)}),n}o(NY,"geomReduce");function r2(e,t){tP(e,function(r,n,i,a,u){var c=r===null?null:r.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(Ts.feature(r,i,{bbox:a,id:u}),n,0)===!1?!1:void 0}var f;switch(c){case"MultiPoint":f="Point";break;case"MultiLineString":f="LineString";break;case"MultiPolygon":f="Polygon";break}for(var m=0;m<r.coordinates.length;m++){var v=r.coordinates[m],x={type:f,coordinates:v};if(t(Ts.feature(x,i),n,m)===!1)return!1}})}o(r2,"flattenEach");function RY(e,t,r){var n=r;return r2(e,function(i,a,u){a===0&&u===0&&r===void 0?n=i:n=t(n,i,a,u)}),n}o(RY,"flattenReduce");function ZD(e,t){r2(e,function(r,n,i){var a=0;if(r.geometry){var u=r.geometry.type;if(!(u==="Point"||u==="MultiPoint")){var c,f=0,m=0,v=0;if(P1(r,function(x,I,C,T,O){if(c===void 0||n>f||T>m||O>v){c=x,f=n,m=T,v=O,a=0;return}var P=Ts.lineString([c,x],r.properties);if(t(P,n,i,O,a)===!1)return!1;a++,c=x})===!1)return!1}}})}o(ZD,"segmentEach");function kY(e,t,r){var n=r,i=!1;return ZD(e,function(a,u,c,f,m){i===!1&&r===void 0?n=a:n=t(n,a,u,c,f,m),i=!0}),n}o(kY,"segmentReduce");function KD(e,t){if(!e)throw new Error("geojson is required");r2(e,function(r,n,i){if(r.geometry!==null){var a=r.geometry.type,u=r.geometry.coordinates;switch(a){case"LineString":if(t(r,n,i,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<u.length;c++)if(t(Ts.lineString(u[c],r.properties),n,i,c)===!1)return!1;break}}})}o(KD,"lineEach");function BY(e,t,r){var n=r;return KD(e,function(i,a,u,c){a===0&&r===void 0?n=i:n=t(n,i,a,u,c)}),n}o(BY,"lineReduce");function GY(e,t){if(t=t||{},!Ts.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,a=t.segmentIndex||0,u=t.properties,c;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),u=u||e.features[r].properties,c=e.features[r].geometry;break;case"Feature":u=u||e.properties,c=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=e;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var f=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=f.length+a-1),Ts.lineString([f[a],f[a+1]],u,t);case"Polygon":return i<0&&(i=f.length+i),a<0&&(a=f[i].length+a-1),Ts.lineString([f[i][a],f[i][a+1]],u,t);case"MultiLineString":return n<0&&(n=f.length+n),a<0&&(a=f[n].length+a-1),Ts.lineString([f[n][a],f[n][a+1]],u,t);case"MultiPolygon":return n<0&&(n=f.length+n),i<0&&(i=f[n].length+i),a<0&&(a=f[n][i].length-a-1),Ts.lineString([f[n][i][a],f[n][i][a+1]],u,t)}throw new Error("geojson is invalid")}o(GY,"findSegment");function jY(e,t){if(t=t||{},!Ts.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,a=t.coordIndex||0,u=t.properties,c;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),u=u||e.features[r].properties,c=e.features[r].geometry;break;case"Feature":u=u||e.properties,c=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=e;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var f=c.coordinates;switch(c.type){case"Point":return Ts.point(f,u,t);case"MultiPoint":return n<0&&(n=f.length+n),Ts.point(f[n],u,t);case"LineString":return a<0&&(a=f.length+a),Ts.point(f[a],u,t);case"Polygon":return i<0&&(i=f.length+i),a<0&&(a=f[i].length+a),Ts.point(f[i][a],u,t);case"MultiLineString":return n<0&&(n=f.length+n),a<0&&(a=f[n].length+a),Ts.point(f[n][a],u,t);case"MultiPolygon":return n<0&&(n=f.length+n),i<0&&(i=f[n].length+i),a<0&&(a=f[n][i].length-a),Ts.point(f[n][i][a],u,t)}throw new Error("geojson is invalid")}o(jY,"findPoint");mo.coordAll=FY;mo.coordEach=P1;mo.coordReduce=LY;mo.featureEach=XD;mo.featureReduce=AY;mo.findPoint=jY;mo.findSegment=GY;mo.flattenEach=r2;mo.flattenReduce=RY;mo.geomEach=tP;mo.geomReduce=NY;mo.lineEach=KD;mo.lineReduce=BY;mo.propEach=YD;mo.propReduce=DY;mo.segmentEach=ZD;mo.segmentReduce=kY});var JD=ze(iP=>{"use strict";g();Object.defineProperty(iP,"__esModule",{value:!0});var UY=rP();function nP(e){var t=[1/0,1/0,-1/0,-1/0];return UY.coordEach(e,function(r){t[0]>r[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]<r[0]&&(t[2]=r[0]),t[3]<r[1]&&(t[3]=r[1])}),t}o(nP,"bbox");nP.default=nP;iP.default=nP});var n2=ze((SCe,oP)=>{g();var Yu=Ow(),eA=eP(),tA=rP(),Cg=JD().default,VY=tA.featureEach,bCe=tA.coordEach,ICe=eA.polygon,QD=eA.featureCollection;function rA(e){var t=new Yu(e);return t.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:Cg(r),Yu.prototype.insert.call(this,r)},t.load=function(r){var n=[];return Array.isArray(r)?r.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:Cg(i),n.push(i)}):VY(r,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:Cg(i),n.push(i)}),Yu.prototype.load.call(this,n)},t.remove=function(r,n){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:Cg(r),Yu.prototype.remove.call(this,r,n)},t.clear=function(){return Yu.prototype.clear.call(this)},t.search=function(r){var n=Yu.prototype.search.call(this,this.toBBox(r));return QD(n)},t.collides=function(r){return Yu.prototype.collides.call(this,this.toBBox(r))},t.all=function(){var r=Yu.prototype.all.call(this);return QD(r)},t.toJSON=function(){return Yu.prototype.toJSON.call(this)},t.fromJSON=function(r){return Yu.prototype.fromJSON.call(this,r)},t.toBBox=function(r){var n;if(r.bbox)n=r.bbox;else if(Array.isArray(r)&&r.length===4)n=r;else if(Array.isArray(r)&&r.length===6)n=[r[0],r[1],r[3],r[4]];else if(r.type==="Feature")n=Cg(r);else if(r.type==="FeatureCollection")n=Cg(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}o(rA,"geojsonRbush");oP.exports=rA;oP.exports.default=rA});var cP=ze((DPe,gA)=>{"use strict";g();var mA=Object.prototype.toString;gA.exports=o(function(t){var r=mA.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&mA.call(t.callee)==="[object Function]"),n},"isArguments")});var wA=ze((NPe,CA)=>{"use strict";g();var _A;Object.keys||(E1=Object.prototype.hasOwnProperty,pP=Object.prototype.toString,yA=cP(),fP=Object.prototype.propertyIsEnumerable,vA=!fP.call({toString:null},"toString"),xA=fP.call(function(){},"prototype"),M1=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s2=o(function(e){var t=e.constructor;return t&&t.prototype===e},"equalsConstructorPrototype"),bA={$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},IA=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!bA["$"+e]&&E1.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{s2(window[e])}catch(t){return!0}}catch(t){return!0}return!1}(),SA=o(function(e){if(typeof window>"u"||!IA)return s2(e);try{return s2(e)}catch(t){return!1}},"equalsConstructorPrototypeIfNotBuggy"),_A=o(function(t){var r=t!==null&&typeof t=="object",n=pP.call(t)==="[object Function]",i=yA(t),a=r&&pP.call(t)==="[object String]",u=[];if(!r&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var c=xA&&n;if(a&&t.length>0&&!E1.call(t,0))for(var f=0;f<t.length;++f)u.push(String(f));if(i&&t.length>0)for(var m=0;m<t.length;++m)u.push(String(m));else for(var v in t)!(c&&v==="prototype")&&E1.call(t,v)&&u.push(String(v));if(vA)for(var x=SA(t),I=0;I<M1.length;++I)!(x&&M1[I]==="constructor")&&E1.call(t,M1[I])&&u.push(M1[I]);return u},"keys"));var E1,pP,yA,fP,vA,xA,M1,s2,bA,IA,SA;CA.exports=_A});var dP=ze((BPe,EA)=>{"use strict";g();var nX=Array.prototype.slice,iX=cP(),PA=Object.keys,a2=PA?o(function(t){return PA(t)},"keys"):wA(),TA=Object.keys;a2.shim=o(function(){if(Object.keys){var t=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);t||(Object.keys=o(function(n){return iX(n)?TA(nX.call(n)):TA(n)},"keys"))}else Object.keys=a2;return Object.keys||a2},"shimObjectKeys");EA.exports=a2});var hP=ze((UPe,MA)=>{"use strict";g();MA.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(t,r);if(c.value!==i||c.enumerable!==!0)return!1}return!0},"hasSymbols")});var l2=ze(($Pe,OA)=>{"use strict";g();var oX=hP();OA.exports=o(function(){return oX()&&!!Symbol.toStringTag},"hasToStringTagShams")});var mP=ze((qPe,LA)=>{"use strict";g();LA.exports=Object});var gP=ze((XPe,DA)=>{"use strict";g();DA.exports=Error});var FA=ze((KPe,AA)=>{"use strict";g();AA.exports=EvalError});var RA=ze((QPe,NA)=>{"use strict";g();NA.exports=RangeError});var BA=ze((tTe,kA)=>{"use strict";g();kA.exports=ReferenceError});var yP=ze((nTe,GA)=>{"use strict";g();GA.exports=SyntaxError});var Xd=ze((oTe,jA)=>{"use strict";g();jA.exports=TypeError});var VA=ze((aTe,UA)=>{"use strict";g();UA.exports=URIError});var $A=ze((uTe,zA)=>{"use strict";g();zA.exports=Math.abs});var WA=ze((pTe,HA)=>{"use strict";g();HA.exports=Math.floor});var YA=ze((dTe,qA)=>{"use strict";g();qA.exports=Math.max});var ZA=ze((mTe,XA)=>{"use strict";g();XA.exports=Math.min});var JA=ze((yTe,KA)=>{"use strict";g();KA.exports=Math.pow});var e8=ze((xTe,QA)=>{"use strict";g();QA.exports=Math.round});var r8=ze((ITe,t8)=>{"use strict";g();t8.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var i8=ze((CTe,n8)=>{"use strict";g();var sX=r8();n8.exports=o(function(t){return sX(t)||t===0?t:t<0?-1:1},"sign")});var s8=ze((TTe,o8)=>{"use strict";g();o8.exports=Object.getOwnPropertyDescriptor});var Zd=ze((MTe,a8)=>{"use strict";g();var u2=s8();if(u2)try{u2([],"length")}catch(e){u2=null}a8.exports=u2});var O1=ze((LTe,l8)=>{"use strict";g();var c2=Object.defineProperty||!1;if(c2)try{c2({},"a",{value:1})}catch(e){c2=!1}l8.exports=c2});var p8=ze((ATe,c8)=>{"use strict";g();var u8=typeof Symbol<"u"&&Symbol,aX=hP();c8.exports=o(function(){return typeof u8!="function"||typeof Symbol!="function"||typeof u8("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:aX()},"hasNativeSymbols")});var vP=ze((RTe,f8)=>{"use strict";g();f8.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var xP=ze((BTe,d8)=>{"use strict";g();var lX=mP();d8.exports=lX.getPrototypeOf||null});var g8=ze((jTe,m8)=>{"use strict";g();var uX="Function.prototype.bind called on incompatible ",cX=Object.prototype.toString,pX=Math.max,fX="[object Function]",h8=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var a=0;a<r.length;a+=1)n[a+t.length]=r[a];return n},"concatty"),dX=o(function(t,r){for(var n=[],i=r||0,a=0;i<t.length;i+=1,a+=1)n[a]=t[i];return n},"slicy"),hX=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");m8.exports=o(function(t){var r=this;if(typeof r!="function"||cX.apply(r)!==fX)throw new TypeError(uX+r);for(var n=dX(arguments,1),i,a=o(function(){if(this instanceof i){var v=r.apply(this,h8(n,arguments));return Object(v)===v?v:this}return r.apply(t,h8(n,arguments))},"binder"),u=pX(0,r.length-n.length),c=[],f=0;f<u;f++)c[f]="$"+f;if(i=Function("binder","return function ("+hX(c,",")+"){ return binder.apply(this,arguments); }")(a),r.prototype){var m=o(function(){},"Empty");m.prototype=r.prototype,i.prototype=new m,m.prototype=null}return i},"bind")});var Pg=ze((zTe,y8)=>{"use strict";g();var mX=g8();y8.exports=Function.prototype.bind||mX});var p2=ze((HTe,v8)=>{"use strict";g();v8.exports=Function.prototype.call});var f2=ze((qTe,x8)=>{"use strict";g();x8.exports=Function.prototype.apply});var I8=ze((XTe,b8)=>{"use strict";g();b8.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var bP=ze((KTe,S8)=>{"use strict";g();var gX=Pg(),yX=f2(),vX=p2(),xX=I8();S8.exports=xX||gX.call(vX,yX)});var d2=ze((QTe,_8)=>{"use strict";g();var bX=Pg(),IX=Xd(),SX=p2(),_X=bP();_8.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new IX("a function is required");return _X(bX,SX,t)},"callBindBasic")});var M8=ze((rEe,E8)=>{"use strict";g();var CX=d2(),C8=Zd(),P8;try{P8=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var IP=!!P8&&C8&&C8(Object.prototype,"__proto__"),T8=Object,w8=T8.getPrototypeOf;E8.exports=IP&&typeof IP.get=="function"?CX([IP.get]):typeof w8=="function"?o(function(t){return w8(t==null?t:T8(t))},"getDunder"):!1});var SP=ze((oEe,A8)=>{"use strict";g();var O8=vP(),L8=xP(),D8=M8();A8.exports=O8?o(function(t){return O8(t)},"getProto"):L8?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return L8(t)},"getProto"):D8?o(function(t){return D8(t)},"getProto"):null});var _P=ze((lEe,F8)=>{"use strict";g();var wX=Function.prototype.call,PX=Object.prototype.hasOwnProperty,TX=Pg();F8.exports=TX.call(wX,PX)});var PP=ze((cEe,j8)=>{"use strict";g();var Pr,EX=mP(),MX=gP(),OX=FA(),LX=RA(),DX=BA(),Og=yP(),Mg=Xd(),AX=VA(),FX=$A(),NX=WA(),RX=YA(),kX=ZA(),BX=JA(),GX=e8(),jX=i8(),B8=Function,CP=o(function(e){try{return B8('"use strict"; return ('+e+").constructor;")()}catch(t){}},"getEvalledConstructor"),L1=Zd(),UX=O1(),wP=o(function(){throw new Mg},"throwTypeError"),VX=L1?function(){try{return arguments.callee,wP}catch(e){try{return L1(arguments,"callee").get}catch(t){return wP}}}():wP,Tg=p8()(),Bo=SP(),zX=xP(),$X=vP(),G8=f2(),D1=p2(),Eg={},HX=typeof Uint8Array>"u"||!Bo?Pr:Bo(Uint8Array),Kd={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Pr:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Pr:ArrayBuffer,"%ArrayIteratorPrototype%":Tg&&Bo?Bo([][Symbol.iterator]()):Pr,"%AsyncFromSyncIteratorPrototype%":Pr,"%AsyncFunction%":Eg,"%AsyncGenerator%":Eg,"%AsyncGeneratorFunction%":Eg,"%AsyncIteratorPrototype%":Eg,"%Atomics%":typeof Atomics>"u"?Pr:Atomics,"%BigInt%":typeof BigInt>"u"?Pr:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Pr:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Pr:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Pr:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":MX,"%eval%":eval,"%EvalError%":OX,"%Float16Array%":typeof Float16Array>"u"?Pr:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Pr:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Pr:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Pr:FinalizationRegistry,"%Function%":B8,"%GeneratorFunction%":Eg,"%Int8Array%":typeof Int8Array>"u"?Pr:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Pr:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Pr:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Tg&&Bo?Bo(Bo([][Symbol.iterator]())):Pr,"%JSON%":typeof JSON=="object"?JSON:Pr,"%Map%":typeof Map>"u"?Pr:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Tg||!Bo?Pr:Bo(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":EX,"%Object.getOwnPropertyDescriptor%":L1,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Pr:Promise,"%Proxy%":typeof Proxy>"u"?Pr:Proxy,"%RangeError%":LX,"%ReferenceError%":DX,"%Reflect%":typeof Reflect>"u"?Pr:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Pr:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Tg||!Bo?Pr:Bo(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Pr:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Tg&&Bo?Bo(""[Symbol.iterator]()):Pr,"%Symbol%":Tg?Symbol:Pr,"%SyntaxError%":Og,"%ThrowTypeError%":VX,"%TypedArray%":HX,"%TypeError%":Mg,"%Uint8Array%":typeof Uint8Array>"u"?Pr:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Pr:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Pr:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Pr:Uint32Array,"%URIError%":AX,"%WeakMap%":typeof WeakMap>"u"?Pr:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Pr:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Pr:WeakSet,"%Function.prototype.call%":D1,"%Function.prototype.apply%":G8,"%Object.defineProperty%":UX,"%Object.getPrototypeOf%":zX,"%Math.abs%":FX,"%Math.floor%":NX,"%Math.max%":RX,"%Math.min%":kX,"%Math.pow%":BX,"%Math.round%":GX,"%Math.sign%":jX,"%Reflect.getPrototypeOf%":$X};if(Bo)try{null.error}catch(e){N8=Bo(Bo(e)),Kd["%Error.prototype%"]=N8}var N8,WX=o(function e(t){var r;if(t==="%AsyncFunction%")r=CP("async function () {}");else if(t==="%GeneratorFunction%")r=CP("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=CP("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Bo&&(r=Bo(i.prototype))}return Kd[t]=r,r},"doEval"),R8={__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"]},A1=Pg(),h2=_P(),qX=A1.call(D1,Array.prototype.concat),YX=A1.call(G8,Array.prototype.splice),k8=A1.call(D1,String.prototype.replace),m2=A1.call(D1,String.prototype.slice),XX=A1.call(D1,RegExp.prototype.exec),ZX=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,KX=/\\(\\)?/g,JX=o(function(t){var r=m2(t,0,1),n=m2(t,-1);if(r==="%"&&n!=="%")throw new Og("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Og("invalid intrinsic syntax, expected opening `%`");var i=[];return k8(t,ZX,function(a,u,c,f){i[i.length]=c?k8(f,KX,"$1"):u||a}),i},"stringToPath"),QX=o(function(t,r){var n=t,i;if(h2(R8,n)&&(i=R8[n],n="%"+i[0]+"%"),h2(Kd,n)){var a=Kd[n];if(a===Eg&&(a=WX(n)),typeof a>"u"&&!r)throw new Mg("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Og("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");j8.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Mg("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Mg('"allowMissing" argument must be a boolean');if(XX(/^%?[^%]*%?$/,t)===null)throw new Og("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=JX(t),i=n.length>0?n[0]:"",a=QX("%"+i+"%",r),u=a.name,c=a.value,f=!1,m=a.alias;m&&(i=m[0],YX(n,qX([0,1],m)));for(var v=1,x=!0;v<n.length;v+=1){var I=n[v],C=m2(I,0,1),T=m2(I,-1);if((C==='"'||C==="'"||C==="`"||T==='"'||T==="'"||T==="`")&&C!==T)throw new Og("property names with quotes must have matching quotes");if((I==="constructor"||!x)&&(f=!0),i+="."+I,u="%"+i+"%",h2(Kd,u))c=Kd[u];else if(c!=null){if(!(I in c)){if(!r)throw new Mg("base intrinsic for "+t+" exists, but the property is not available.");return}if(L1&&v+1>=n.length){var O=L1(c,I);x=!!O,x&&"get"in O&&!("originalValue"in O.get)?c=O.get:c=c[I]}else x=h2(c,I),c=c[I];x&&!f&&(Kd[u]=c)}}return c},"GetIntrinsic")});var g2=ze((dEe,z8)=>{"use strict";g();var U8=PP(),V8=d2(),eZ=V8([U8("%String.prototype.indexOf%")]);z8.exports=o(function(t,r){var n=U8(t,!!r);return typeof n=="function"&&eZ(t,".prototype.")>-1?V8([n]):n},"callBoundIntrinsic")});var W8=ze((gEe,H8)=>{"use strict";g();var tZ=l2()(),rZ=g2(),TP=rZ("Object.prototype.toString"),y2=o(function(t){return tZ&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:TP(t)==="[object Arguments]"},"isArguments"),$8=o(function(t){return y2(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&TP(t)!=="[object Array]"&&"callee"in t&&TP(t.callee)==="[object Function]"},"isArguments"),nZ=function(){return y2(arguments)}();y2.isLegacyArguments=$8;H8.exports=nZ?y2:$8});var v2=ze((xEe,X8)=>{"use strict";g();var q8=O1(),iZ=yP(),Lg=Xd(),Y8=Zd();X8.exports=o(function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Lg("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Lg("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Lg("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Lg("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Lg("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Lg("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,f=!!Y8&&Y8(t,r);if(q8)q8(t,r,{configurable:u===null&&f?f.configurable:!u,enumerable:i===null&&f?f.enumerable:!i,value:n,writable:a===null&&f?f.writable:!a});else if(c||!i&&!a&&!u)t[r]=n;else throw new iZ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var x2=ze((SEe,K8)=>{"use strict";g();var EP=O1(),Z8=o(function(){return!!EP},"hasPropertyDescriptors");Z8.hasArrayLengthDefineBug=o(function(){if(!EP)return null;try{return EP([],"length",{value:1}).length!==1}catch(t){return!0}},"hasArrayLengthDefineBug");K8.exports=Z8});var Dg=ze((wEe,t9)=>{"use strict";g();var oZ=dP(),sZ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",aZ=Object.prototype.toString,lZ=Array.prototype.concat,J8=v2(),uZ=o(function(e){return typeof e=="function"&&aZ.call(e)==="[object Function]"},"isFunction"),Q8=x2()(),cZ=o(function(e,t,r,n){if(t in e){if(n===!0){if(e[t]===r)return}else if(!uZ(n)||!n())return}Q8?J8(e,t,r,!0):J8(e,t,r)},"defineProperty"),e9=o(function(e,t){var r=arguments.length>2?arguments[2]:{},n=oZ(t);sZ&&(n=lZ.call(n,Object.getOwnPropertySymbols(t)));for(var i=0;i<n.length;i+=1)cZ(e,n[i],t[n[i]],r[n[i]])},"defineProperties");e9.supportsDescriptors=!!Q8;t9.exports=e9});var s9=ze((EEe,o9)=>{"use strict";g();var pZ=PP(),r9=v2(),fZ=x2()(),n9=Zd(),i9=Xd(),dZ=pZ("%Math.floor%");o9.exports=o(function(t,r){if(typeof t!="function")throw new i9("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||dZ(r)!==r)throw new i9("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,a=!0;if("length"in t&&n9){var u=n9(t,"length");u&&!u.configurable&&(i=!1),u&&!u.writable&&(a=!1)}return(i||a||!n)&&(fZ?r9(t,"length",r,!0,!0):r9(t,"length",r)),t},"setFunctionLength")});var l9=ze((LEe,a9)=>{"use strict";g();var hZ=Pg(),mZ=f2(),gZ=bP();a9.exports=o(function(){return gZ(hZ,mZ,arguments)},"applyBind")});var MP=ze((FEe,b2)=>{"use strict";g();var yZ=s9(),u9=O1(),vZ=d2(),c9=l9();b2.exports=o(function(t){var r=vZ(arguments),n=t.length-(arguments.length-1);return yZ(r,1+(n>0?n:0),!0)},"callBind");u9?u9(b2.exports,"apply",{value:c9}):b2.exports.apply=c9});var OP=ze((kEe,f9)=>{"use strict";g();var p9=o(function(e){return e!==e},"numberIsNaN");f9.exports=o(function(t,r){return t===0&&r===0?1/t===1/r:!!(t===r||p9(t)&&p9(r))},"is")});var LP=ze((jEe,d9)=>{"use strict";g();var xZ=OP();d9.exports=o(function(){return typeof Object.is=="function"?Object.is:xZ},"getPolyfill")});var m9=ze((zEe,h9)=>{"use strict";g();var bZ=LP(),IZ=Dg();h9.exports=o(function(){var t=bZ();return IZ(Object,{is:t},{is:o(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var x9=ze((WEe,v9)=>{"use strict";g();var SZ=Dg(),_Z=MP(),CZ=OP(),g9=LP(),wZ=m9(),y9=_Z(g9(),Object);SZ(y9,{getPolyfill:g9,implementation:CZ,shim:wZ});v9.exports=y9});var w9=ze((YEe,C9)=>{"use strict";g();var b9=g2(),PZ=l2()(),TZ=_P(),EZ=Zd(),FP;PZ?(I9=b9("RegExp.prototype.exec"),DP={},I2=o(function(){throw DP},"throwRegexMarker"),AP={toString:I2,valueOf:I2},typeof Symbol.toPrimitive=="symbol"&&(AP[Symbol.toPrimitive]=I2),FP=o(function(t){if(!t||typeof t!="object")return!1;var r=EZ(t,"lastIndex"),n=r&&TZ(r,"value");if(!n)return!1;try{I9(t,AP)}catch(i){return i===DP}},"isRegex")):(S9=b9("Object.prototype.toString"),_9="[object RegExp]",FP=o(function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:S9(t)===_9},"isRegex"));var I9,DP,I2,AP,S9,_9;C9.exports=FP});var T9=ze((KEe,P9)=>{"use strict";g();var N1=o(function(){return typeof o(function(){},"f").name=="string"},"functionsHaveNames"),F1=Object.getOwnPropertyDescriptor;if(F1)try{F1([],"length")}catch(e){F1=null}N1.functionsHaveConfigurableNames=o(function(){if(!N1()||!F1)return!1;var t=F1(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var MZ=Function.prototype.bind;N1.boundFunctionsHaveNames=o(function(){return N1()&&typeof MZ=="function"&&o(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");P9.exports=N1});var O9=ze((eMe,M9)=>{"use strict";g();var E9=v2(),OZ=x2()(),LZ=T9().functionsHaveConfigurableNames(),DZ=Xd();M9.exports=o(function(t,r){if(typeof t!="function")throw new DZ("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||LZ)&&(OZ?E9(t,"name",r,!0,!0):E9(t,"name",r)),t},"setFunctionName")});var NP=ze((nMe,L9)=>{"use strict";g();var AZ=O9(),FZ=Xd(),NZ=Object;L9.exports=AZ(o(function(){if(this==null||this!==NZ(this))throw new FZ("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"flags"),"get flags",!0)});var RP=ze((sMe,D9)=>{"use strict";g();var RZ=NP(),kZ=Dg().supportsDescriptors,BZ=Object.getOwnPropertyDescriptor;D9.exports=o(function(){if(kZ&&/a/mig.flags==="gim"){var t=BZ(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:o(function(){r+="d"},"get")}),Object.defineProperty(n,"sticky",{get:o(function(){r+="y"},"get")}),t.get.call(n),r==="dy")return t.get}}return RZ},"getPolyfill")});var N9=ze((uMe,F9)=>{"use strict";g();var GZ=Dg().supportsDescriptors,jZ=RP(),UZ=Zd(),VZ=Object.defineProperty,zZ=gP(),A9=SP(),$Z=/a/;F9.exports=o(function(){if(!GZ||!A9)throw new zZ("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=jZ(),r=A9($Z),n=UZ(r,"flags");return(!n||n.get!==t)&&VZ(r,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var G9=ze((fMe,B9)=>{"use strict";g();var HZ=Dg(),WZ=MP(),qZ=NP(),R9=RP(),YZ=N9(),k9=WZ(R9());HZ(k9,{getPolyfill:R9,implementation:qZ,shim:YZ});B9.exports=k9});var V9=ze((hMe,U9)=>{"use strict";g();var j9=g2(),XZ=j9("Date.prototype.getDay"),ZZ=o(function(t){try{return XZ(t),!0}catch(r){return!1}},"tryDateGetDayCall"),KZ=j9("Object.prototype.toString"),JZ="[object Date]",QZ=l2()();U9.exports=o(function(t){return typeof t!="object"||t===null?!1:QZ?ZZ(t):KZ(t)===JZ},"isDateObject")});var kP=ze((yMe,Q9)=>{g();var z9=dP(),$9=W8(),H9=x9(),W9=w9(),q9=G9(),Y9=V9(),X9=Date.prototype.getTime;function J9(e,t,r){var n=r||{};return(n.strict?H9(e,t):e===t)?!0:!e||!t||typeof e!="object"&&typeof t!="object"?n.strict?H9(e,t):e==t:eK(e,t,n)}o(J9,"deepEqual");function Z9(e){return e==null}o(Z9,"isUndefinedOrNull");function K9(e){return!(!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number")}o(K9,"isBuffer");function eK(e,t,r){var n,i;if(typeof e!=typeof t||Z9(e)||Z9(t)||e.prototype!==t.prototype||$9(e)!==$9(t))return!1;var a=W9(e),u=W9(t);if(a!==u)return!1;if(a||u)return e.source===t.source&&q9(e)===q9(t);if(Y9(e)&&Y9(t))return X9.call(e)===X9.call(t);var c=K9(e),f=K9(t);if(c!==f)return!1;if(c||f){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(typeof e!=typeof t)return!1;try{var m=z9(e),v=z9(t)}catch(x){return!1}if(m.length!==v.length)return!1;for(m.sort(),v.sort(),n=m.length-1;n>=0;n--)if(m[n]!=v[n])return!1;for(n=m.length-1;n>=0;n--)if(i=m[n],!J9(e[i],t[i],r))return!1;return!0}o(eK,"objEquiv");Q9.exports=J9});var ZP=ze((fOe,aF)=>{g();var ZK=kP(),Zu=o(function(e){this.precision=e&&e.precision?e.precision:17,this.direction=e&&e.direction?e.direction:!1,this.pseudoNode=e&&e.pseudoNode?e.pseudoNode:!1,this.objectComparator=e&&e.objectComparator?e.objectComparator:KK},"Equality");Zu.prototype.compare=function(e,t){if(e.type!==t.type||!sF(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(e,t);case"Feature":return this.compareFeature(e,t);default:if(e.type.indexOf("Multi")===0){var r=this,n=oF(e),i=oF(t);return n.every(function(a){return this.some(function(u){return r.compare(a,u)})},i)}}return!1};function oF(e){return e.coordinates.map(function(t){return{type:e.type.replace("Multi",""),coordinates:t}})}o(oF,"explode");function sF(e,t){return e.hasOwnProperty("coordinates")?e.coordinates.length===t.coordinates.length:e.length===t.length}o(sF,"sameLength");Zu.prototype.compareCoord=function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r].toFixed(this.precision)!==t[r].toFixed(this.precision))return!1;return!0};Zu.prototype.compareLine=function(e,t,r,n){if(!sF(e,t))return!1;var i=this.pseudoNode?e:this.removePseudo(e),a=this.pseudoNode?t:this.removePseudo(t);if(!(n&&!this.compareCoord(i[0],a[0])&&(a=this.fixStartIndex(a,i),!a))){var u=this.compareCoord(i[r],a[r]);return this.direction||u?this.comparePath(i,a):this.compareCoord(i[r],a[a.length-(1+r)])?this.comparePath(i.slice().reverse(),a):!1}};Zu.prototype.fixStartIndex=function(e,t){for(var r,n=-1,i=0;i<e.length;i++)if(this.compareCoord(e[i],t[0])){n=i;break}return n>=0&&(r=[].concat(e.slice(n,e.length),e.slice(1,n+1))),r};Zu.prototype.comparePath=function(e,t){var r=this;return e.every(function(n,i){return r.compareCoord(n,this[i])},t)};Zu.prototype.comparePolygon=function(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){var r=e.coordinates.slice(1,e.coordinates.length),n=t.coordinates.slice(1,t.coordinates.length),i=this;return r.every(function(a){return this.some(function(u){return i.compareLine(a,u,1,!0)})},n)}else return!1};Zu.prototype.compareFeature=function(e,t){return e.id!==t.id||!this.objectComparator(e.properties,t.properties)||!this.compareBBox(e,t)?!1:this.compare(e.geometry,t.geometry)};Zu.prototype.compareBBox=function(e,t){return!!(!e.bbox&&!t.bbox||e.bbox&&t.bbox&&this.compareCoord(e.bbox,t.bbox))};Zu.prototype.removePseudo=function(e){return e};function KK(e,t){return ZK(e,t,{strict:!0})}o(KK,"objectComparator");aF.exports=Zu});var lF=ze((DOe,C2)=>{g();function Pf(e,t,r,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(e,t,r,n)}o(Pf,"DBSCAN");Pf.prototype.run=function(e,t,r,n){this._init(e,t,r,n);for(var i=0;i<this._datasetLength;i++)if(this._visited[i]!==1){this._visited[i]=1;var a=this._regionQuery(i);if(a.length<this.minPts)this.noise.push(i);else{var u=this.clusters.length;this.clusters.push([]),this._addToCluster(i,u),this._expandCluster(u,a)}}return this.clusters};Pf.prototype._init=function(e,t,r,n){if(e){if(!(e instanceof Array))throw Error("Dataset must be of type array, "+typeof e+" given");this.dataset=e,this.clusters=[],this.noise=[],this._datasetLength=e.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),r&&(this.minPts=r),n&&(this.distance=n)};Pf.prototype._expandCluster=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(this._visited[n]!==1){this._visited[n]=1;var i=this._regionQuery(n);i.length>=this.minPts&&(t=this._mergeArrays(t,i))}this._assigned[n]!==1&&this._addToCluster(n,e)}};Pf.prototype._addToCluster=function(e,t){this.clusters[t].push(e),this._assigned[e]=1};Pf.prototype._regionQuery=function(e){for(var t=[],r=0;r<this._datasetLength;r++){var n=this.distance(this.dataset[e],this.dataset[r]);n<this.epsilon&&t.push(r)}return t};Pf.prototype._mergeArrays=function(e,t){for(var r=t.length,n=0;n<r;n++){var i=t[n];e.indexOf(i)<0&&e.push(i)}return e};Pf.prototype._euclideanDistance=function(e,t){for(var r=0,n=Math.min(e.length,t.length);n--;)r+=(e[n]-t[n])*(e[n]-t[n]);return Math.sqrt(r)};typeof C2<"u"&&C2.exports&&(C2.exports=Pf)});var uF=ze((NOe,w2)=>{g();function Tf(e,t,r){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(e,t,r)}o(Tf,"KMEANS");Tf.prototype.init=function(e,t,r){this.assignments=[],this.centroids=[],typeof e<"u"&&(this.dataset=e),typeof t<"u"&&(this.k=t),typeof r<"u"&&(this.distance=r)};Tf.prototype.run=function(e,t){this.init(e,t);for(var r=this.dataset.length,n=0;n<this.k;n++)this.centroids[n]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var a=0;a<this.k;a++){for(var u=new Array(v),c=0,f=0;f<v;f++)u[f]=0;for(var m=0;m<r;m++){var v=this.dataset[m].length;if(a===this.assignments[m]){for(var f=0;f<v;f++)u[f]+=this.dataset[m][f];c++}}if(c>0){for(var f=0;f<v;f++)u[f]/=c;this.centroids[a]=u}else this.centroids[a]=this.randomCentroid(),i=!0}}return this.getClusters()};Tf.prototype.randomCentroid=function(){var e=this.dataset.length-1,t,r;do r=Math.round(Math.random()*e),t=this.dataset[r];while(this.centroids.indexOf(t)>=0);return t};Tf.prototype.assign=function(){for(var e=!1,t=this.dataset.length,r,n=0;n<t;n++)r=this.argmin(this.dataset[n],this.centroids,this.distance),r!=this.assignments[n]&&(this.assignments[n]=r,e=!0);return e};Tf.prototype.getClusters=function(){for(var e=new Array(this.k),t,r=0;r<this.assignments.length;r++)t=this.assignments[r],typeof e[t]>"u"&&(e[t]=[]),e[t].push(r);return e};Tf.prototype.argmin=function(e,t,r){for(var n=Number.MAX_VALUE,i=0,a=t.length,u,c=0;c<a;c++)u=r(e,t[c]),u<n&&(n=u,i=c);return i};Tf.prototype.distance=function(e,t){for(var r=0,n=Math.min(e.length,t.length);n--;){var i=e[n]-t[n];r+=i*i}return Math.sqrt(r)};typeof w2<"u"&&w2.exports&&(w2.exports=Tf)});var KP=ze((BOe,P2)=>{g();function Ku(e,t,r){this._queue=[],this._priorities=[],this._sorting="desc",this._init(e,t,r)}o(Ku,"PriorityQueue");Ku.prototype.insert=function(e,t){for(var r=this._queue.length,n=r;n--;){var i=this._priorities[n];this._sorting==="desc"?t>i&&(r=n):t<i&&(r=n)}this._insertAt(e,t,r)};Ku.prototype.remove=function(e){for(var t=this._queue.length;t--;){var r=this._queue[t];if(e===r){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};Ku.prototype.forEach=function(e){this._queue.forEach(e)};Ku.prototype.getElements=function(){return this._queue};Ku.prototype.getElementPriority=function(e){return this._priorities[e]};Ku.prototype.getPriorities=function(){return this._priorities};Ku.prototype.getElementsWithPriorities=function(){for(var e=[],t=0,r=this._queue.length;t<r;t++)e.push([this._queue[t],this._priorities[t]]);return e};Ku.prototype._init=function(e,t,r){if(e&&t){if(this._queue=[],this._priorities=[],e.length!==t.length)throw new Error("Arrays must have the same length");for(var n=0;n<e.length;n++)this.insert(e[n],t[n])}r&&(this._sorting=r)};Ku.prototype._insertAt=function(e,t,r){this._queue.length===r?(this._queue.push(e),this._priorities.push(t)):(this._queue.splice(r,0,e),this._priorities.splice(r,0,t))};typeof P2<"u"&&P2.exports&&(P2.exports=Ku)});var pF=ze((UOe,Fg)=>{g();typeof Fg<"u"&&Fg.exports&&(cF=KP());var cF;function ep(e,t,r,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(e,t,r,n)}o(ep,"OPTICS");ep.prototype.run=function(e,t,r,n){this._init(e,t,r,n);for(var i=0,a=this.dataset.length;i<a;i++)if(this._processed[i]!==1){this._processed[i]=1,this.clusters.push([i]);var u=this.clusters.length-1;this._orderedList.push(i);var c=new cF(null,null,"asc"),f=this._regionQuery(i);this._distanceToCore(i)!==void 0&&(this._updateQueue(i,f,c),this._expandCluster(u,c))}return this.clusters};ep.prototype.getReachabilityPlot=function(){for(var e=[],t=0,r=this._orderedList.length;t<r;t++){var n=this._orderedList[t],i=this._reachability[n];e.push([n,i])}return e};ep.prototype._init=function(e,t,r,n){if(e){if(!(e instanceof Array))throw Error("Dataset must be of type array, "+typeof e+" given");this.dataset=e,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),r&&(this.minPts=r),n&&(this.distance=n)};ep.prototype._updateQueue=function(e,t,r){var n=this;this._coreDistance=this._distanceToCore(e),t.forEach(function(i){if(n._processed[i]===void 0){var a=n.distance(n.dataset[e],n.dataset[i]),u=Math.max(n._coreDistance,a);n._reachability[i]===void 0?(n._reachability[i]=u,r.insert(i,u)):u<n._reachability[i]&&(n._reachability[i]=u,r.remove(i),r.insert(i,u))}})};ep.prototype._expandCluster=function(e,t){for(var r=t.getElements(),n=0,i=r.length;n<i;n++){var a=r[n];if(this._processed[a]===void 0){var u=this._regionQuery(a);this._processed[a]=1,this.clusters[e].push(a),this._orderedList.push(a),this._distanceToCore(a)!==void 0&&(this._updateQueue(a,u,t),this._expandCluster(e,t))}}};ep.prototype._distanceToCore=function(e){for(var t=this.epsilon,r=0;r<t;r++){var n=this._regionQuery(e,r);if(n.length>=this.minPts)return r}};ep.prototype._regionQuery=function(e,t){t=t||this.epsilon;for(var r=[],n=0,i=this.dataset.length;n<i;n++)this.distance(this.dataset[e],this.dataset[n])<t&&r.push(n);return r};ep.prototype._euclideanDistance=function(e,t){for(var r=0,n=Math.min(e.length,t.length);n--;)r+=(e[n]-t[n])*(e[n]-t[n]);return Math.sqrt(r)};typeof Fg<"u"&&Fg.exports&&(Fg.exports=ep)});var fF=ze(($Oe,T2)=>{g();typeof T2<"u"&&T2.exports&&(T2.exports={DBSCAN:lF(),KMEANS:uF(),OPTICS:pF(),PriorityQueue:KP()})});var JP=ze((QOe,hF)=>{"use strict";g();hF.exports={eudist:o(function(t,r,n){for(var i=t.length,a=0,u=0;u<i;u++){var c=(t[u]||0)-(r[u]||0);a+=c*c}return n?Math.sqrt(a):a},"eudist"),mandist:o(function(t,r,n){for(var i=t.length,a=0,u=0;u<i;u++)a+=Math.abs((t[u]||0)-(r[u]||0));return n?Math.sqrt(a):a},"mandist"),dist:o(function(t,r,n){var i=Math.abs(t-r);return n?i:i*i},"dist")}});var yF=ze((r6e,gF)=>{"use strict";g();var mF=JP(),rJ=mF.eudist,nJ=mF.dist;gF.exports={kmrand:o(function(t,r){for(var n={},i=[],a=r<<2,u=t.length,c=t[0].length>0;i.length<r&&a-- >0;){var f=t[Math.floor(Math.random()*u)],m=c?f.join("_"):""+f;n[m]||(n[m]=!0,i.push(f))}if(i.length<r)throw new Error("Error initializating clusters");return i},"kmrand"),kmpp:o(function(t,r){var n=t[0].length?rJ:nJ,i=[],a=t.length,u=t[0].length>0,c={},f=t[Math.floor(Math.random()*a)],m=u?f.join("_"):""+f;for(i.push(f),c[m]=!0;i.length<r;){for(var v=[],x=i.length,I=0,C=[],T=0;T<a;T++){for(var O=1/0,P=0;P<x;P++){var L=n(t[T],i[P]);L<=O&&(O=L)}v[T]=O}for(var A=0;A<a;A++)I+=v[A];for(var M=0;M<a;M++)C[M]={i:M,v:t[M],pr:v[M]/I,cs:0};C.sort(function(z,R){return z.pr-R.pr}),C[0].cs=C[0].pr;for(var N=1;N<a;N++)C[N].cs=C[N-1].cs+C[N].pr;for(var B=Math.random(),H=0;H<a-1&&C[H++].cs<B;);i.push(C[H-1].v)}return i},"kmpp")}});var SF=ze((a6e,IF)=>{"use strict";g();var QP=JP(),bF=yF(),iJ=QP.eudist,o6e=QP.mandist,s6e=QP.dist,oJ=bF.kmrand,sJ=bF.kmpp,vF=1e4;function xF(e,t,r){r=r||[];for(var n=0;n<e;n++)r[n]=t;return r}o(xF,"init");function aJ(e,t,r,n){var i=[],a=[],u=[],c=[],f=!1,m=n||vF,v=e.length,x=e[0].length,I=x>0,C=[];if(r)r=="kmrand"?i=oJ(e,t):r=="kmpp"?i=sJ(e,t):i=r;else for(var T={};i.length<t;){var O=Math.floor(Math.random()*v);T[O]||(T[O]=!0,i.push(e[O]))}do{xF(t,0,C);for(var P=0;P<v;P++){for(var L=1/0,A=0,M=0;M<t;M++){var c=I?iJ(e[P],i[M]):Math.abs(e[P]-i[M]);c<=L&&(L=c,A=M)}u[P]=A,C[A]++}for(var N=[],a=[],B=0,H=0;H<t;H++)N[H]=I?xF(x,0,N[H]):0,a[H]=i[H];if(I){for(var z=0;z<t;z++)i[z]=[];for(var R=0;R<v;R++)for(var X=u[R],ie=N[X],Q=e[R],U=0;U<x;U++)ie[U]+=Q[U];f=!0;for(var Te=0;Te<t;Te++){for(var oe=i[Te],fe=N[Te],se=a[Te],ve=C[Te],ue=0;ue<x;ue++)oe[ue]=fe[ue]/ve||0;if(f){for(var he=0;he<x;he++)if(se[he]!=oe[he]){f=!1;break}}}}else{for(var Z=0;Z<v;Z++){var Ke=u[Z];N[Ke]+=e[Z]}for(var Ue=0;Ue<t;Ue++)i[Ue]=N[Ue]/C[Ue]||0;f=!0;for(var rt=0;rt<t;rt++)if(a[rt]!=i[rt]){f=!1;break}}f=f||--m<=0}while(!f);return{it:vF-m,k:t,idxs:u,centroids:i}}o(aJ,"skmeans");IF.exports=aJ});var Gg=ze((oT,sT)=>{g();(function(e,t){typeof oT=="object"&&typeof sT<"u"?sT.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(oT,function(){"use strict";function e(le,F){var G={label:0,sent:o(function(){if(K[0]&1)throw K[1];return K[1]},"sent"),trys:[],ops:[]},q,J,K,Ce;return Ce={next:ye(0),throw:ye(1),return:ye(2)},typeof Symbol=="function"&&(Ce[Symbol.iterator]=function(){return this}),Ce;function ye(we){return function(Ze){return De([we,Ze])}}function De(we){if(q)throw new TypeError("Generator is already executing.");for(;G;)try{if(q=1,J&&(K=we[0]&2?J.return:we[0]?J.throw||((K=J.return)&&K.call(J),0):J.next)&&!(K=K.call(J,we[1])).done)return K;switch(J=0,K&&(we=[we[0]&2,K.value]),we[0]){case 0:case 1:K=we;break;case 4:return G.label++,{value:we[1],done:!1};case 5:G.label++,J=we[1],we=[0];continue;case 7:we=G.ops.pop(),G.trys.pop();continue;default:if(K=G.trys,!(K=K.length>0&&K[K.length-1])&&(we[0]===6||we[0]===2)){G=0;continue}if(we[0]===3&&(!K||we[1]>K[0]&&we[1]<K[3])){G.label=we[1];break}if(we[0]===6&&G.label<K[1]){G.label=K[1],K=we;break}if(K&&G.label<K[2]){G.label=K[2],G.ops.push(we);break}K[2]&&G.ops.pop(),G.trys.pop();continue}we=F.call(le,G)}catch(Ze){we=[6,Ze],J=0}finally{q=K=0}if(we[0]&5)throw we[1];return{value:we[0]?we[1]:void 0,done:!0}}}o(e,"__generator");var t=function(){function le(F,G){this.next=null,this.key=F,this.data=G,this.left=null,this.right=null}return o(le,"Node"),le}();function r(le,F){return le>F?1:le<F?-1:0}o(r,"DEFAULT_COMPARE");function n(le,F,G){for(var q=new t(null,null),J=q,K=q;;){var Ce=G(le,F.key);if(Ce<0){if(F.left===null)break;if(G(le,F.left.key)<0){var ye=F.left;if(F.left=ye.right,ye.right=F,F=ye,F.left===null)break}K.left=F,K=F,F=F.left}else if(Ce>0){if(F.right===null)break;if(G(le,F.right.key)>0){var ye=F.right;if(F.right=ye.left,ye.left=F,F=ye,F.right===null)break}J.right=F,J=F,F=F.right}else break}return J.right=F.left,K.left=F.right,F.left=q.right,F.right=q.left,F}o(n,"splay");function i(le,F,G,q){var J=new t(le,F);if(G===null)return J.left=J.right=null,J;G=n(le,G,q);var K=q(le,G.key);return K<0?(J.left=G.left,J.right=G,G.left=null):K>=0&&(J.right=G.right,J.left=G,G.right=null),J}o(i,"insert");function a(le,F,G){var q=null,J=null;if(F){F=n(le,F,G);var K=G(F.key,le);K===0?(q=F.left,J=F.right):K<0?(J=F.right,F.right=null,q=F):(q=F.left,F.left=null,J=F)}return{left:q,right:J}}o(a,"split");function u(le,F,G){return F===null?le:(le===null||(F=n(le.key,F,G),F.left=le),F)}o(u,"merge");function c(le,F,G,q,J){if(le){q(""+F+(G?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+J(le)+"\n");var K=F+(G?" ":"\u2502 ");le.left&&c(le.left,K,!1,q,J),le.right&&c(le.right,K,!0,q,J)}}o(c,"printRow");var f=function(){function le(F){F===void 0&&(F=r),this._root=null,this._size=0,this._comparator=F}return o(le,"Tree"),le.prototype.insert=function(F,G){return this._size++,this._root=i(F,G,this._root,this._comparator)},le.prototype.add=function(F,G){var q=new t(F,G);this._root===null&&(q.left=q.right=null,this._size++,this._root=q);var J=this._comparator,K=n(F,this._root,J),Ce=J(F,K.key);return Ce===0?this._root=K:(Ce<0?(q.left=K.left,q.right=K,K.left=null):Ce>0&&(q.right=K.right,q.left=K,K.right=null),this._size++,this._root=q),this._root},le.prototype.remove=function(F){this._root=this._remove(F,this._root,this._comparator)},le.prototype._remove=function(F,G,q){var J;if(G===null)return null;G=n(F,G,q);var K=q(F,G.key);return K===0?(G.left===null?J=G.right:(J=n(F,G.left,q),J.right=G.right),this._size--,J):G},le.prototype.pop=function(){var F=this._root;if(F){for(;F.left;)F=F.left;return this._root=n(F.key,this._root,this._comparator),this._root=this._remove(F.key,this._root,this._comparator),{key:F.key,data:F.data}}return null},le.prototype.findStatic=function(F){for(var G=this._root,q=this._comparator;G;){var J=q(F,G.key);if(J===0)return G;J<0?G=G.left:G=G.right}return null},le.prototype.find=function(F){return this._root&&(this._root=n(F,this._root,this._comparator),this._comparator(F,this._root.key)!==0)?null:this._root},le.prototype.contains=function(F){for(var G=this._root,q=this._comparator;G;){var J=q(F,G.key);if(J===0)return!0;J<0?G=G.left:G=G.right}return!1},le.prototype.forEach=function(F,G){for(var q=this._root,J=[],K=!1;!K;)q!==null?(J.push(q),q=q.left):J.length!==0?(q=J.pop(),F.call(G,q),q=q.right):K=!0;return this},le.prototype.range=function(F,G,q,J){for(var K=[],Ce=this._comparator,ye=this._root,De;K.length!==0||ye;)if(ye)K.push(ye),ye=ye.left;else{if(ye=K.pop(),De=Ce(ye.key,G),De>0)break;if(Ce(ye.key,F)>=0&&q.call(J,ye))return this;ye=ye.right}return this},le.prototype.keys=function(){var F=[];return this.forEach(function(G){var q=G.key;return F.push(q)}),F},le.prototype.values=function(){var F=[];return this.forEach(function(G){var q=G.data;return F.push(q)}),F},le.prototype.min=function(){return this._root?this.minNode(this._root).key:null},le.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},le.prototype.minNode=function(F){if(F===void 0&&(F=this._root),F)for(;F.left;)F=F.left;return F},le.prototype.maxNode=function(F){if(F===void 0&&(F=this._root),F)for(;F.right;)F=F.right;return F},le.prototype.at=function(F){for(var G=this._root,q=!1,J=0,K=[];!q;)if(G)K.push(G),G=G.left;else if(K.length>0){if(G=K.pop(),J===F)return G;J++,G=G.right}else q=!0;return null},le.prototype.next=function(F){var G=this._root,q=null;if(F.right){for(q=F.right;q.left;)q=q.left;return q}for(var J=this._comparator;G;){var K=J(F.key,G.key);if(K===0)break;K<0?(q=G,G=G.left):G=G.right}return q},le.prototype.prev=function(F){var G=this._root,q=null;if(F.left!==null){for(q=F.left;q.right;)q=q.right;return q}for(var J=this._comparator;G;){var K=J(F.key,G.key);if(K===0)break;K<0?G=G.left:(q=G,G=G.right)}return q},le.prototype.clear=function(){return this._root=null,this._size=0,this},le.prototype.toList=function(){return x(this._root)},le.prototype.load=function(F,G,q){G===void 0&&(G=[]),q===void 0&&(q=!1);var J=F.length,K=this._comparator;if(q&&T(F,G,0,J-1,K),this._root===null)this._root=m(F,G,0,J),this._size=J;else{var Ce=C(this.toList(),v(F,G),K);J=this._size+J,this._root=I({head:Ce},0,J)}return this},le.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(le.prototype,"size",{get:o(function(){return this._size},"get"),enumerable:!0,configurable:!0}),Object.defineProperty(le.prototype,"root",{get:o(function(){return this._root},"get"),enumerable:!0,configurable:!0}),le.prototype.toString=function(F){F===void 0&&(F=o(function(q){return String(q.key)},"printNode"));var G=[];return c(this._root,"",!0,function(q){return G.push(q)},F),G.join("")},le.prototype.update=function(F,G,q){var J=this._comparator,K=a(F,this._root,J),Ce=K.left,ye=K.right;J(F,G)<0?ye=i(G,q,ye,J):Ce=i(G,q,Ce,J),this._root=u(Ce,ye,J)},le.prototype.split=function(F){return a(F,this._root,this._comparator)},le.prototype[Symbol.iterator]=function(){var F,G,q;return e(this,function(J){switch(J.label){case 0:F=this._root,G=[],q=!1,J.label=1;case 1:return q?[3,6]:F===null?[3,2]:(G.push(F),F=F.left,[3,5]);case 2:return G.length===0?[3,4]:(F=G.pop(),[4,F]);case 3:return J.sent(),F=F.right,[3,5];case 4:q=!0,J.label=5;case 5:return[3,1];case 6:return[2]}})},le}();function m(le,F,G,q){var J=q-G;if(J>0){var K=G+Math.floor(J/2),Ce=le[K],ye=F[K],De=new t(Ce,ye);return De.left=m(le,F,G,K),De.right=m(le,F,K+1,q),De}return null}o(m,"loadRecursive");function v(le,F){for(var G=new t(null,null),q=G,J=0;J<le.length;J++)q=q.next=new t(le[J],F[J]);return q.next=null,G.next}o(v,"createList");function x(le){for(var F=le,G=[],q=!1,J=new t(null,null),K=J;!q;)F?(G.push(F),F=F.left):G.length>0?(F=K=K.next=G.pop(),F=F.right):q=!0;return K.next=null,J.next}o(x,"toList");function I(le,F,G){var q=G-F;if(q>0){var J=F+Math.floor(q/2),K=I(le,F,J),Ce=le.head;return Ce.left=K,le.head=le.head.next,Ce.right=I(le,J+1,G),Ce}return null}o(I,"sortedListToBST");function C(le,F,G){for(var q=new t(null,null),J=q,K=le,Ce=F;K!==null&&Ce!==null;)G(K.key,Ce.key)<0?(J.next=K,K=K.next):(J.next=Ce,Ce=Ce.next),J=J.next;return K!==null?J.next=K:Ce!==null&&(J.next=Ce),q.next}o(C,"mergeLists");function T(le,F,G,q,J){if(!(G>=q)){for(var K=le[G+q>>1],Ce=G-1,ye=q+1;;){do Ce++;while(J(le[Ce],K)<0);do ye--;while(J(le[ye],K)>0);if(Ce>=ye)break;var De=le[Ce];le[Ce]=le[ye],le[ye]=De,De=F[Ce],F[Ce]=F[ye],F[ye]=De}T(le,F,G,ye,J),T(le,F,ye+1,q,J)}}o(T,"sort");let O=o((le,F)=>le.ll.x<=F.x&&F.x<=le.ur.x&&le.ll.y<=F.y&&F.y<=le.ur.y,"isInBbox"),P=o((le,F)=>{if(F.ur.x<le.ll.x||le.ur.x<F.ll.x||F.ur.y<le.ll.y||le.ur.y<F.ll.y)return null;let G=le.ll.x<F.ll.x?F.ll.x:le.ll.x,q=le.ur.x<F.ur.x?le.ur.x:F.ur.x,J=le.ll.y<F.ll.y?F.ll.y:le.ll.y,K=le.ur.y<F.ur.y?le.ur.y:F.ur.y;return{ll:{x:G,y:J},ur:{x:q,y:K}}},"getBboxOverlap"),L=Number.EPSILON;L===void 0&&(L=Math.pow(2,-52));let A=L*L,M=o((le,F)=>{if(-L<le&&le<L&&-L<F&&F<L)return 0;let G=le-F;return G*G<A*le*F?0:le<F?-1:1},"cmp"),Ht=class Ht{constructor(){this.reset()}reset(){this.xRounder=new B,this.yRounder=new B}round(F,G){return{x:this.xRounder.round(F),y:this.yRounder.round(G)}}};o(Ht,"PtRounder");let N=Ht,ot=class ot{constructor(){this.tree=new f,this.round(0)}round(F){let G=this.tree.add(F),q=this.tree.prev(G);if(q!==null&&M(G.key,q.key)===0)return this.tree.remove(F),q.key;let J=this.tree.next(G);return J!==null&&M(G.key,J.key)===0?(this.tree.remove(F),J.key):F}};o(ot,"CoordRounder");let B=ot,H=new N,z=11102230246251565e-32,R=134217729,X=(3+8*z)*z;function ie(le,F,G,q,J){let K,Ce,ye,De,we=F[0],Ze=q[0],ge=0,Ae=0;Ze>we==Ze>-we?(K=we,we=F[++ge]):(K=Ze,Ze=q[++Ae]);let Oe=0;if(ge<le&&Ae<G)for(Ze>we==Ze>-we?(Ce=we+K,ye=K-(Ce-we),we=F[++ge]):(Ce=Ze+K,ye=K-(Ce-Ze),Ze=q[++Ae]),K=Ce,ye!==0&&(J[Oe++]=ye);ge<le&&Ae<G;)Ze>we==Ze>-we?(Ce=K+we,De=Ce-K,ye=K-(Ce-De)+(we-De),we=F[++ge]):(Ce=K+Ze,De=Ce-K,ye=K-(Ce-De)+(Ze-De),Ze=q[++Ae]),K=Ce,ye!==0&&(J[Oe++]=ye);for(;ge<le;)Ce=K+we,De=Ce-K,ye=K-(Ce-De)+(we-De),we=F[++ge],K=Ce,ye!==0&&(J[Oe++]=ye);for(;Ae<G;)Ce=K+Ze,De=Ce-K,ye=K-(Ce-De)+(Ze-De),Ze=q[++Ae],K=Ce,ye!==0&&(J[Oe++]=ye);return(K!==0||Oe===0)&&(J[Oe++]=K),Oe}o(ie,"sum");function Q(le,F){let G=F[0];for(let q=1;q<le;q++)G+=F[q];return G}o(Q,"estimate");function U(le){return new Float64Array(le)}o(U,"vec");let Te=(3+16*z)*z,oe=(2+12*z)*z,fe=(9+64*z)*z*z,se=U(4),ve=U(8),ue=U(12),he=U(16),Z=U(4);function Ke(le,F,G,q,J,K,Ce){let ye,De,we,Ze,ge,Ae,Oe,ht,ft,At,mt,on,fn,Kn,dn,Xi,Yt,Ut,Jo=le-J,En=G-J,ji=F-K,Vr=q-K;Kn=Jo*Vr,Ae=R*Jo,Oe=Ae-(Ae-Jo),ht=Jo-Oe,Ae=R*Vr,ft=Ae-(Ae-Vr),At=Vr-ft,dn=ht*At-(Kn-Oe*ft-ht*ft-Oe*At),Xi=ji*En,Ae=R*ji,Oe=Ae-(Ae-ji),ht=ji-Oe,Ae=R*En,ft=Ae-(Ae-En),At=En-ft,Yt=ht*At-(Xi-Oe*ft-ht*ft-Oe*At),mt=dn-Yt,ge=dn-mt,se[0]=dn-(mt+ge)+(ge-Yt),on=Kn+mt,ge=on-Kn,fn=Kn-(on-ge)+(mt-ge),mt=fn-Xi,ge=fn-mt,se[1]=fn-(mt+ge)+(ge-Xi),Ut=on+mt,ge=Ut-on,se[2]=on-(Ut-ge)+(mt-ge),se[3]=Ut;let bs=Q(4,se),Qo=oe*Ce;if(bs>=Qo||-bs>=Qo||(ge=le-Jo,ye=le-(Jo+ge)+(ge-J),ge=G-En,we=G-(En+ge)+(ge-J),ge=F-ji,De=F-(ji+ge)+(ge-K),ge=q-Vr,Ze=q-(Vr+ge)+(ge-K),ye===0&&De===0&&we===0&&Ze===0)||(Qo=fe*Ce+X*Math.abs(bs),bs+=Jo*Ze+Vr*ye-(ji*we+En*De),bs>=Qo||-bs>=Qo))return bs;Kn=ye*Vr,Ae=R*ye,Oe=Ae-(Ae-ye),ht=ye-Oe,Ae=R*Vr,ft=Ae-(Ae-Vr),At=Vr-ft,dn=ht*At-(Kn-Oe*ft-ht*ft-Oe*At),Xi=De*En,Ae=R*De,Oe=Ae-(Ae-De),ht=De-Oe,Ae=R*En,ft=Ae-(Ae-En),At=En-ft,Yt=ht*At-(Xi-Oe*ft-ht*ft-Oe*At),mt=dn-Yt,ge=dn-mt,Z[0]=dn-(mt+ge)+(ge-Yt),on=Kn+mt,ge=on-Kn,fn=Kn-(on-ge)+(mt-ge),mt=fn-Xi,ge=fn-mt,Z[1]=fn-(mt+ge)+(ge-Xi),Ut=on+mt,ge=Ut-on,Z[2]=on-(Ut-ge)+(mt-ge),Z[3]=Ut;let wa=ie(4,se,4,Z,ve);Kn=Jo*Ze,Ae=R*Jo,Oe=Ae-(Ae-Jo),ht=Jo-Oe,Ae=R*Ze,ft=Ae-(Ae-Ze),At=Ze-ft,dn=ht*At-(Kn-Oe*ft-ht*ft-Oe*At),Xi=ji*we,Ae=R*ji,Oe=Ae-(Ae-ji),ht=ji-Oe,Ae=R*we,ft=Ae-(Ae-we),At=we-ft,Yt=ht*At-(Xi-Oe*ft-ht*ft-Oe*At),mt=dn-Yt,ge=dn-mt,Z[0]=dn-(mt+ge)+(ge-Yt),on=Kn+mt,ge=on-Kn,fn=Kn-(on-ge)+(mt-ge),mt=fn-Xi,ge=fn-mt,Z[1]=fn-(mt+ge)+(ge-Xi),Ut=on+mt,ge=Ut-on,Z[2]=on-(Ut-ge)+(mt-ge),Z[3]=Ut;let Is=ie(wa,ve,4,Z,ue);Kn=ye*Ze,Ae=R*ye,Oe=Ae-(Ae-ye),ht=ye-Oe,Ae=R*Ze,ft=Ae-(Ae-Ze),At=Ze-ft,dn=ht*At-(Kn-Oe*ft-ht*ft-Oe*At),Xi=De*we,Ae=R*De,Oe=Ae-(Ae-De),ht=De-Oe,Ae=R*we,ft=Ae-(Ae-we),At=we-ft,Yt=ht*At-(Xi-Oe*ft-ht*ft-Oe*At),mt=dn-Yt,ge=dn-mt,Z[0]=dn-(mt+ge)+(ge-Yt),on=Kn+mt,ge=on-Kn,fn=Kn-(on-ge)+(mt-ge),mt=fn-Xi,ge=fn-mt,Z[1]=fn-(mt+ge)+(ge-Xi),Ut=on+mt,ge=Ut-on,Z[2]=on-(Ut-ge)+(mt-ge),Z[3]=Ut;let Zm=ie(Is,ue,4,Z,he);return he[Zm-1]}o(Ke,"orient2dadapt");function Ue(le,F,G,q,J,K){let Ce=(F-K)*(G-J),ye=(le-J)*(q-K),De=Ce-ye,we=Math.abs(Ce+ye);return Math.abs(De)>=Te*we?De:-Ke(le,F,G,q,J,K,we)}o(Ue,"orient2d");let rt=o((le,F)=>le.x*F.y-le.y*F.x,"crossProduct"),Ee=o((le,F)=>le.x*F.x+le.y*F.y,"dotProduct"),We=o((le,F,G)=>{let q=Ue(le.x,le.y,F.x,F.y,G.x,G.y);return q>0?-1:q<0?1:0},"compareVectorAngles"),St=o(le=>Math.sqrt(Ee(le,le)),"length"),yt=o((le,F,G)=>{let q={x:F.x-le.x,y:F.y-le.y},J={x:G.x-le.x,y:G.y-le.y};return rt(J,q)/St(J)/St(q)},"sineOfAngle"),pt=o((le,F,G)=>{let q={x:F.x-le.x,y:F.y-le.y},J={x:G.x-le.x,y:G.y-le.y};return Ee(J,q)/St(J)/St(q)},"cosineOfAngle"),te=o((le,F,G)=>F.y===0?null:{x:le.x+F.x/F.y*(G-le.y),y:G},"horizontalIntersection"),ce=o((le,F,G)=>F.x===0?null:{x:G,y:le.y+F.y/F.x*(G-le.x)},"verticalIntersection"),ee=o((le,F,G,q)=>{if(F.x===0)return ce(G,q,le.x);if(q.x===0)return ce(le,F,G.x);if(F.y===0)return te(G,q,le.y);if(q.y===0)return te(le,F,G.y);let J=rt(F,q);if(J==0)return null;let K={x:G.x-le.x,y:G.y-le.y},Ce=rt(K,F)/J,ye=rt(K,q)/J,De=le.x+ye*F.x,we=G.x+Ce*q.x,Ze=le.y+ye*F.y,ge=G.y+Ce*q.y,Ae=(De+we)/2,Oe=(Ze+ge)/2;return{x:Ae,y:Oe}},"intersection$1"),qe=class qe{static compare(F,G){let q=qe.comparePoints(F.point,G.point);return q!==0?q:(F.point!==G.point&&F.link(G),F.isLeft!==G.isLeft?F.isLeft?1:-1:Fe.compare(F.segment,G.segment))}static comparePoints(F,G){return F.x<G.x?-1:F.x>G.x?1:F.y<G.y?-1:F.y>G.y?1:0}constructor(F,G){F.events===void 0?F.events=[this]:F.events.push(this),this.point=F,this.isLeft=G}link(F){if(F.point===this.point)throw new Error("Tried to link already linked events");let G=F.point.events;for(let q=0,J=G.length;q<J;q++){let K=G[q];this.point.events.push(K),K.point=this.point}this.checkForConsuming()}checkForConsuming(){let F=this.point.events.length;for(let G=0;G<F;G++){let q=this.point.events[G];if(q.segment.consumedBy===void 0)for(let J=G+1;J<F;J++){let K=this.point.events[J];K.consumedBy===void 0&&q.otherSE.point.events===K.otherSE.point.events&&q.segment.consume(K.segment)}}}getAvailableLinkedEvents(){let F=[];for(let G=0,q=this.point.events.length;G<q;G++){let J=this.point.events[G];J!==this&&!J.segment.ringOut&&J.segment.isInResult()&&F.push(J)}return F}getLeftmostComparator(F){let G=new Map,q=o(J=>{let K=J.otherSE;G.set(J,{sine:yt(this.point,F.point,K.point),cosine:pt(this.point,F.point,K.point)})},"fillCache");return(J,K)=>{G.has(J)||q(J),G.has(K)||q(K);let{sine:Ce,cosine:ye}=G.get(J),{sine:De,cosine:we}=G.get(K);return Ce>=0&&De>=0?ye<we?1:ye>we?-1:0:Ce<0&&De<0?ye<we?-1:ye>we?1:0:De<Ce?-1:De>Ce?1:0}}};o(qe,"SweepEvent");let be=qe,Me=0,It=class It{static compare(F,G){let q=F.leftSE.point.x,J=G.leftSE.point.x,K=F.rightSE.point.x,Ce=G.rightSE.point.x;if(Ce<q)return 1;if(K<J)return-1;let ye=F.leftSE.point.y,De=G.leftSE.point.y,we=F.rightSE.point.y,Ze=G.rightSE.point.y;if(q<J){if(De<ye&&De<we)return 1;if(De>ye&&De>we)return-1;let ge=F.comparePoint(G.leftSE.point);if(ge<0)return 1;if(ge>0)return-1;let Ae=G.comparePoint(F.rightSE.point);return Ae!==0?Ae:-1}if(q>J){if(ye<De&&ye<Ze)return-1;if(ye>De&&ye>Ze)return 1;let ge=G.comparePoint(F.leftSE.point);if(ge!==0)return ge;let Ae=F.comparePoint(G.rightSE.point);return Ae<0?1:Ae>0?-1:1}if(ye<De)return-1;if(ye>De)return 1;if(K<Ce){let ge=G.comparePoint(F.rightSE.point);if(ge!==0)return ge}if(K>Ce){let ge=F.comparePoint(G.rightSE.point);if(ge<0)return 1;if(ge>0)return-1}if(K!==Ce){let ge=we-ye,Ae=K-q,Oe=Ze-De,ht=Ce-J;if(ge>Ae&&Oe<ht)return 1;if(ge<Ae&&Oe>ht)return-1}return K>Ce?1:K<Ce||we<Ze?-1:we>Ze?1:F.id<G.id?-1:F.id>G.id?1:0}constructor(F,G,q,J){this.id=++Me,this.leftSE=F,F.segment=this,F.otherSE=G,this.rightSE=G,G.segment=this,G.otherSE=F,this.rings=q,this.windings=J}static fromRing(F,G,q){let J,K,Ce,ye=be.comparePoints(F,G);if(ye<0)J=F,K=G,Ce=1;else if(ye>0)J=G,K=F,Ce=-1;else throw new Error("Tried to create degenerate segment at [".concat(F.x,", ").concat(F.y,"]"));let De=new be(J,!0),we=new be(K,!1);return new It(De,we,[q],[Ce])}replaceRightSE(F){this.rightSE=F,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let F=this.leftSE.point.y,G=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:F<G?F:G},ur:{x:this.rightSE.point.x,y:F>G?F:G}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(F){return F.x===this.leftSE.point.x&&F.y===this.leftSE.point.y||F.x===this.rightSE.point.x&&F.y===this.rightSE.point.y}comparePoint(F){if(this.isAnEndpoint(F))return 0;let G=this.leftSE.point,q=this.rightSE.point,J=this.vector();if(G.x===q.x)return F.x===G.x?0:F.x<G.x?1:-1;let K=(F.y-G.y)/J.y,Ce=G.x+K*J.x;if(F.x===Ce)return 0;let ye=(F.x-G.x)/J.x,De=G.y+ye*J.y;return F.y===De?0:F.y<De?-1:1}getIntersection(F){let G=this.bbox(),q=F.bbox(),J=P(G,q);if(J===null)return null;let K=this.leftSE.point,Ce=this.rightSE.point,ye=F.leftSE.point,De=F.rightSE.point,we=O(G,ye)&&this.comparePoint(ye)===0,Ze=O(q,K)&&F.comparePoint(K)===0,ge=O(G,De)&&this.comparePoint(De)===0,Ae=O(q,Ce)&&F.comparePoint(Ce)===0;if(Ze&&we)return Ae&&!ge?Ce:!Ae&&ge?De:null;if(Ze)return ge&&K.x===De.x&&K.y===De.y?null:K;if(we)return Ae&&Ce.x===ye.x&&Ce.y===ye.y?null:ye;if(Ae&&ge)return null;if(Ae)return Ce;if(ge)return De;let Oe=ee(K,this.vector(),ye,F.vector());return Oe===null||!O(J,Oe)?null:H.round(Oe.x,Oe.y)}split(F){let G=[],q=F.events!==void 0,J=new be(F,!0),K=new be(F,!1),Ce=this.rightSE;this.replaceRightSE(K),G.push(K),G.push(J);let ye=new It(J,Ce,this.rings.slice(),this.windings.slice());return be.comparePoints(ye.leftSE.point,ye.rightSE.point)>0&&ye.swapEvents(),be.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),q&&(J.checkForConsuming(),K.checkForConsuming()),G}swapEvents(){let F=this.rightSE;this.rightSE=this.leftSE,this.leftSE=F,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let G=0,q=this.windings.length;G<q;G++)this.windings[G]*=-1}consume(F){let G=this,q=F;for(;G.consumedBy;)G=G.consumedBy;for(;q.consumedBy;)q=q.consumedBy;let J=It.compare(G,q);if(J!==0){if(J>0){let K=G;G=q,q=K}if(G.prev===q){let K=G;G=q,q=K}for(let K=0,Ce=q.rings.length;K<Ce;K++){let ye=q.rings[K],De=q.windings[K],we=G.rings.indexOf(ye);we===-1?(G.rings.push(ye),G.windings.push(De)):G.windings[we]+=De}q.rings=null,q.windings=null,q.consumedBy=G,q.leftSE.consumedBy=G.leftSE,q.rightSE.consumedBy=G.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 F=this.prev.consumedBy||this.prev;this._beforeState=F.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let F=this.beforeState();this._afterState={rings:F.rings.slice(0),windings:F.windings.slice(0),multiPolys:[]};let G=this._afterState.rings,q=this._afterState.windings,J=this._afterState.multiPolys;for(let ye=0,De=this.rings.length;ye<De;ye++){let we=this.rings[ye],Ze=this.windings[ye],ge=G.indexOf(we);ge===-1?(G.push(we),q.push(Ze)):q[ge]+=Ze}let K=[],Ce=[];for(let ye=0,De=G.length;ye<De;ye++){if(q[ye]===0)continue;let we=G[ye],Ze=we.poly;if(Ce.indexOf(Ze)===-1)if(we.isExterior)K.push(Ze);else{Ce.indexOf(Ze)===-1&&Ce.push(Ze);let ge=K.indexOf(we.poly);ge!==-1&&K.splice(ge,1)}}for(let ye=0,De=K.length;ye<De;ye++){let we=K[ye].multiPoly;J.indexOf(we)===-1&&J.push(we)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let F=this.beforeState().multiPolys,G=this.afterState().multiPolys;switch(Ge.type){case"union":{let q=F.length===0,J=G.length===0;this._isInResult=q!==J;break}case"intersection":{let q,J;F.length<G.length?(q=F.length,J=G.length):(q=G.length,J=F.length),this._isInResult=J===Ge.numMultiPolys&&q<J;break}case"xor":{let q=Math.abs(F.length-G.length);this._isInResult=q%2===1;break}case"difference":{let q=o(J=>J.length===1&&J[0].isSubject,"isJustSubject");this._isInResult=q(F)!==q(G);break}default:throw new Error("Unrecognized operation type found ".concat(Ge.type))}return this._isInResult}};o(It,"Segment");let Fe=It,Ct=class Ct{constructor(F,G,q){if(!Array.isArray(F)||F.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=G,this.isExterior=q,this.segments=[],typeof F[0][0]!="number"||typeof F[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let J=H.round(F[0][0],F[0][1]);this.bbox={ll:{x:J.x,y:J.y},ur:{x:J.x,y:J.y}};let K=J;for(let Ce=1,ye=F.length;Ce<ye;Ce++){if(typeof F[Ce][0]!="number"||typeof F[Ce][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let De=H.round(F[Ce][0],F[Ce][1]);De.x===K.x&&De.y===K.y||(this.segments.push(Fe.fromRing(K,De,this)),De.x<this.bbox.ll.x&&(this.bbox.ll.x=De.x),De.y<this.bbox.ll.y&&(this.bbox.ll.y=De.y),De.x>this.bbox.ur.x&&(this.bbox.ur.x=De.x),De.y>this.bbox.ur.y&&(this.bbox.ur.y=De.y),K=De)}(J.x!==K.x||J.y!==K.y)&&this.segments.push(Fe.fromRing(K,J,this))}getSweepEvents(){let F=[];for(let G=0,q=this.segments.length;G<q;G++){let J=this.segments[G];F.push(J.leftSE),F.push(J.rightSE)}return F}};o(Ct,"RingIn");let it=Ct,Nt=class Nt{constructor(F,G){if(!Array.isArray(F))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new it(F[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 q=1,J=F.length;q<J;q++){let K=new it(F[q],this,!1);K.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=K.bbox.ll.x),K.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=K.bbox.ll.y),K.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=K.bbox.ur.x),K.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=K.bbox.ur.y),this.interiorRings.push(K)}this.multiPoly=G}getSweepEvents(){let F=this.exteriorRing.getSweepEvents();for(let G=0,q=this.interiorRings.length;G<q;G++){let J=this.interiorRings[G].getSweepEvents();for(let K=0,Ce=J.length;K<Ce;K++)F.push(J[K])}return F}};o(Nt,"PolyIn");let xt=Nt,Mt=class Mt{constructor(F,G){if(!Array.isArray(F))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof F[0][0][0]=="number"&&(F=[F])}catch(q){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let q=0,J=F.length;q<J;q++){let K=new xt(F[q],this);K.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=K.bbox.ll.x),K.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=K.bbox.ll.y),K.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=K.bbox.ur.x),K.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=K.bbox.ur.y),this.polys.push(K)}this.isSubject=G}getSweepEvents(){let F=[];for(let G=0,q=this.polys.length;G<q;G++){let J=this.polys[G].getSweepEvents();for(let K=0,Ce=J.length;K<Ce;K++)F.push(J[K])}return F}};o(Mt,"MultiPolyIn");let Bt=Mt,Dt=class Dt{static factory(F){let G=[];for(let q=0,J=F.length;q<J;q++){let K=F[q];if(!K.isInResult()||K.ringOut)continue;let Ce=null,ye=K.leftSE,De=K.rightSE,we=[ye],Ze=ye.point,ge=[];for(;Ce=ye,ye=De,we.push(ye),ye.point!==Ze;)for(;;){let Ae=ye.getAvailableLinkedEvents();if(Ae.length===0){let ft=we[0].point,At=we[we.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(ft.x,",")+" ".concat(ft.y,"]. Last matching segment found ends at")+" [".concat(At.x,", ").concat(At.y,"]."))}if(Ae.length===1){De=Ae[0].otherSE;break}let Oe=null;for(let ft=0,At=ge.length;ft<At;ft++)if(ge[ft].point===ye.point){Oe=ft;break}if(Oe!==null){let ft=ge.splice(Oe)[0],At=we.splice(ft.index);At.unshift(At[0].otherSE),G.push(new Dt(At.reverse()));continue}ge.push({index:we.length,point:ye.point});let ht=ye.getLeftmostComparator(Ce);De=Ae.sort(ht)[0].otherSE;break}G.push(new Dt(we))}return G}constructor(F){this.events=F;for(let G=0,q=F.length;G<q;G++)F[G].segment.ringOut=this;this.poly=null}getGeom(){let F=this.events[0].point,G=[F];for(let we=1,Ze=this.events.length-1;we<Ze;we++){let ge=this.events[we].point,Ae=this.events[we+1].point;We(ge,F,Ae)!==0&&(G.push(ge),F=ge)}if(G.length===1)return null;let q=G[0],J=G[1];We(q,F,J)===0&&G.shift(),G.push(G[0]);let K=this.isExteriorRing()?1:-1,Ce=this.isExteriorRing()?0:G.length-1,ye=this.isExteriorRing()?G.length:-1,De=[];for(let we=Ce;we!=ye;we+=K)De.push([G[we].x,G[we].y]);return De}isExteriorRing(){if(this._isExteriorRing===void 0){let F=this.enclosingRing();this._isExteriorRing=F?!F.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let F=this.events[0];for(let J=1,K=this.events.length;J<K;J++){let Ce=this.events[J];be.compare(F,Ce)>0&&(F=Ce)}let G=F.segment.prevInResult(),q=G?G.prevInResult():null;for(;;){if(!G)return null;if(!q)return G.ringOut;if(q.ringOut!==G.ringOut)return q.ringOut.enclosingRing()!==G.ringOut?G.ringOut:G.ringOut.enclosingRing();G=q.prevInResult(),q=G?G.prevInResult():null}}};o(Dt,"RingOut");let pn=Dt,xi=class xi{constructor(F){this.exteriorRing=F,F.poly=this,this.interiorRings=[]}addInterior(F){this.interiorRings.push(F),F.poly=this}getGeom(){let F=[this.exteriorRing.getGeom()];if(F[0]===null)return null;for(let G=0,q=this.interiorRings.length;G<q;G++){let J=this.interiorRings[G].getGeom();J!==null&&F.push(J)}return F}};o(xi,"PolyOut");let Xe=xi,Tn=class Tn{constructor(F){this.rings=F,this.polys=this._composePolys(F)}getGeom(){let F=[];for(let G=0,q=this.polys.length;G<q;G++){let J=this.polys[G].getGeom();J!==null&&F.push(J)}return F}_composePolys(F){let G=[];for(let q=0,J=F.length;q<J;q++){let K=F[q];if(!K.poly)if(K.isExteriorRing())G.push(new Xe(K));else{let Ce=K.enclosingRing();Ce.poly||G.push(new Xe(Ce)),Ce.poly.addInterior(K)}}return G}};o(Tn,"MultiPolyOut");let Gt=Tn,Le=class Le{constructor(F){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fe.compare;this.queue=F,this.tree=new f(G),this.segments=[]}process(F){let G=F.segment,q=[];if(F.consumedBy)return F.isLeft?this.queue.remove(F.otherSE):this.tree.remove(G),q;let J=F.isLeft?this.tree.add(G):this.tree.find(G);if(!J)throw new Error("Unable to find segment #".concat(G.id," ")+"[".concat(G.leftSE.point.x,", ").concat(G.leftSE.point.y,"] -> ")+"[".concat(G.rightSE.point.x,", ").concat(G.rightSE.point.y,"] ")+"in SweepLine tree.");let K=J,Ce=J,ye,De;for(;ye===void 0;)K=this.tree.prev(K),K===null?ye=null:K.key.consumedBy===void 0&&(ye=K.key);for(;De===void 0;)Ce=this.tree.next(Ce),Ce===null?De=null:Ce.key.consumedBy===void 0&&(De=Ce.key);if(F.isLeft){let we=null;if(ye){let ge=ye.getIntersection(G);if(ge!==null&&(G.isAnEndpoint(ge)||(we=ge),!ye.isAnEndpoint(ge))){let Ae=this._splitSafely(ye,ge);for(let Oe=0,ht=Ae.length;Oe<ht;Oe++)q.push(Ae[Oe])}}let Ze=null;if(De){let ge=De.getIntersection(G);if(ge!==null&&(G.isAnEndpoint(ge)||(Ze=ge),!De.isAnEndpoint(ge))){let Ae=this._splitSafely(De,ge);for(let Oe=0,ht=Ae.length;Oe<ht;Oe++)q.push(Ae[Oe])}}if(we!==null||Ze!==null){let ge=null;we===null?ge=Ze:Ze===null?ge=we:ge=be.comparePoints(we,Ze)<=0?we:Ze,this.queue.remove(G.rightSE),q.push(G.rightSE);let Ae=G.split(ge);for(let Oe=0,ht=Ae.length;Oe<ht;Oe++)q.push(Ae[Oe])}q.length>0?(this.tree.remove(G),q.push(F)):(this.segments.push(G),G.prev=ye)}else{if(ye&&De){let we=ye.getIntersection(De);if(we!==null){if(!ye.isAnEndpoint(we)){let Ze=this._splitSafely(ye,we);for(let ge=0,Ae=Ze.length;ge<Ae;ge++)q.push(Ze[ge])}if(!De.isAnEndpoint(we)){let Ze=this._splitSafely(De,we);for(let ge=0,Ae=Ze.length;ge<Ae;ge++)q.push(Ze[ge])}}}this.tree.remove(G)}return q}_splitSafely(F,G){this.tree.remove(F);let q=F.rightSE;this.queue.remove(q);let J=F.split(G);return J.push(q),F.consumedBy===void 0&&this.tree.add(F),J}};o(Le,"SweepLine");let Yi=Le,Gi=typeof S<"u"&&S.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Po=typeof S<"u"&&S.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Q0=class Q0{run(F,G,q){Ge.type=F,H.reset();let J=[new Bt(G,!0)];for(let ge=0,Ae=q.length;ge<Ae;ge++)J.push(new Bt(q[ge],!1));if(Ge.numMultiPolys=J.length,Ge.type==="difference"){let ge=J[0],Ae=1;for(;Ae<J.length;)P(J[Ae].bbox,ge.bbox)!==null?Ae++:J.splice(Ae,1)}if(Ge.type==="intersection")for(let ge=0,Ae=J.length;ge<Ae;ge++){let Oe=J[ge];for(let ht=ge+1,ft=J.length;ht<ft;ht++)if(P(Oe.bbox,J[ht].bbox)===null)return[]}let K=new f(be.compare);for(let ge=0,Ae=J.length;ge<Ae;ge++){let Oe=J[ge].getSweepEvents();for(let ht=0,ft=Oe.length;ht<ft;ht++)if(K.insert(Oe[ht]),K.size>Gi)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let Ce=new Yi(K),ye=K.size,De=K.pop();for(;De;){let ge=De.key;if(K.size===ye){let Oe=ge.segment;throw new Error("Unable to pop() ".concat(ge.isLeft?"left":"right"," SweepEvent ")+"[".concat(ge.point.x,", ").concat(ge.point.y,"] from segment #").concat(Oe.id," ")+"[".concat(Oe.leftSE.point.x,", ").concat(Oe.leftSE.point.y,"] -> ")+"[".concat(Oe.rightSE.point.x,", ").concat(Oe.rightSE.point.y,"] from queue."))}if(K.size>Gi)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(Ce.segments.length>Po)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let Ae=Ce.process(ge);for(let Oe=0,ht=Ae.length;Oe<ht;Oe++){let ft=Ae[Oe];ft.consumedBy===void 0&&K.insert(ft)}ye=K.size,De=K.pop()}H.reset();let we=pn.factory(Ce.segments);return new Gt(we).getGeom()}};o(Q0,"Operation");let Zn=Q0,Ge=new Zn;var Ca={union:o(function(le){for(var F=arguments.length,G=new Array(F>1?F-1:0),q=1;q<F;q++)G[q-1]=arguments[q];return Ge.run("union",le,G)},"union"),intersection:o(function(le){for(var F=arguments.length,G=new Array(F>1?F-1:0),q=1;q<F;q++)G[q-1]=arguments[q];return Ge.run("intersection",le,G)},"intersection"),xor:o(function(le){for(var F=arguments.length,G=new Array(F>1?F-1:0),q=1;q<F;q++)G[q-1]=arguments[q];return Ge.run("xor",le,G)},"xor"),difference:o(function(le){for(var F=arguments.length,G=new Array(F>1?F-1:0),q=1;q<F;q++)G[q-1]=arguments[q];return Ge.run("difference",le,G)},"difference")};return Ca})});var UF=ze((L2,jF)=>{g();(function(e,t){typeof L2=="object"&&typeof jF<"u"?t(L2):typeof define=="function"&&define.amd?define(["exports"],t):t(e.jsts={})})(L2,function(e){"use strict";function t(){}o(t,"e");function r(s){this.message=s||""}o(r,"n");function n(s){this.message=s||""}o(n,"i");function i(s){this.message=s||""}o(i,"r");function a(){}o(a,"o");function u(s){return s===null?we:s.color}o(u,"s");function c(s){return s===null?null:s.parent}o(c,"a");function f(s,l){s!==null&&(s.color=l)}o(f,"u");function m(s){return s===null?null:s.left}o(m,"l");function v(s){return s===null?null:s.right}o(v,"c");function x(){this.root_=null,this.size_=0}o(x,"p");function I(){}o(I,"h");function C(){this.array_=[],arguments[0]instanceof Dt&&this.addAll(arguments[0])}o(C,"f");function T(){}o(T,"g");function O(s){this.message=s||""}o(O,"d");function P(){this.array_=[]}o(P,"y"),"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:o(function(s){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var l=Object(this),p=Math.max(Math.min(l.length,9007199254740991),0)||0,h=1 in arguments&&parseInt(Number(arguments[1]),10)||0;h=h<0?Math.max(p+h,0):Math.min(h,p);var y=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:p;for(y=y<0?Math.max(p+arguments[2],0):Math.min(y,p);h<y;)l[h]=s,++h;return l},"value"),writable:!0}),Number.isFinite=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)},Number.isInteger=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(s){return s!=s},Math.trunc=Math.trunc||function(s){return s<0?Math.ceil(s):Math.floor(s)};var L=o(function(){},"_");L.prototype.interfaces_=function(){return[]},L.prototype.getClass=function(){return L},L.prototype.equalsWithTolerance=function(s,l,p){return Math.abs(s-l)<=p};var A=function(s){function l(p){s.call(this,p),this.name="IllegalArgumentException",this.message=p,this.stack=new s().stack}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l}(Error),M=o(function(){},"v"),N={MAX_VALUE:{configurable:!0}};M.isNaN=function(s){return Number.isNaN(s)},M.doubleToLongBits=function(s){return s},M.longBitsToDouble=function(s){return s},M.isInfinite=function(s){return!Number.isFinite(s)},N.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(M,N);var B=o(function(){},"E"),H=o(function(){},"x"),z=o(function(){},"N"),R=o(function s(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=s.NULL_ORDINATE;else if(arguments.length===1){var l=arguments[0];this.x=l.x,this.y=l.y,this.z=l.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=s.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},"t"),X={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};R.prototype.setOrdinate=function(s,l){switch(s){case R.X:this.x=l;break;case R.Y:this.y=l;break;case R.Z:this.z=l;break;default:throw new A("Invalid ordinate index: "+s)}},R.prototype.equals2D=function(){if(arguments.length===1){var s=arguments[0];return this.x===s.x&&this.y===s.y}if(arguments.length===2){var l=arguments[0],p=arguments[1];return!!L.equalsWithTolerance(this.x,l.x,p)&&!!L.equalsWithTolerance(this.y,l.y,p)}},R.prototype.getOrdinate=function(s){switch(s){case R.X:return this.x;case R.Y:return this.y;case R.Z:return this.z}throw new A("Invalid ordinate index: "+s)},R.prototype.equals3D=function(s){return this.x===s.x&&this.y===s.y&&(this.z===s.z||M.isNaN(this.z))&&M.isNaN(s.z)},R.prototype.equals=function(s){return s instanceof R&&this.equals2D(s)},R.prototype.equalInZ=function(s,l){return L.equalsWithTolerance(this.z,s.z,l)},R.prototype.compareTo=function(s){var l=s;return this.x<l.x?-1:this.x>l.x?1:this.y<l.y?-1:this.y>l.y?1:0},R.prototype.clone=function(){},R.prototype.copy=function(){return new R(this)},R.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},R.prototype.distance3D=function(s){var l=this.x-s.x,p=this.y-s.y,h=this.z-s.z;return Math.sqrt(l*l+p*p+h*h)},R.prototype.distance=function(s){var l=this.x-s.x,p=this.y-s.y;return Math.sqrt(l*l+p*p)},R.prototype.hashCode=function(){var s=17;return s=37*s+R.hashCode(this.x),s=37*s+R.hashCode(this.y)},R.prototype.setCoordinate=function(s){this.x=s.x,this.y=s.y,this.z=s.z},R.prototype.interfaces_=function(){return[B,H,t]},R.prototype.getClass=function(){return R},R.hashCode=function(){if(arguments.length===1){var s=arguments[0],l=M.doubleToLongBits(s);return Math.trunc((l^l)>>>32)}},X.DimensionalComparator.get=function(){return ie},X.serialVersionUID.get=function(){return 6683108902428367e3},X.NULL_ORDINATE.get=function(){return M.NaN},X.X.get=function(){return 0},X.Y.get=function(){return 1},X.Z.get=function(){return 2},Object.defineProperties(R,X);var ie=o(function(s){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var l=arguments[0];if(l!==2&&l!==3)throw new A("only 2 or 3 dimensions may be specified");this._dimensionsToTest=l}}},"L");ie.prototype.compare=function(s,l){var p=s,h=l,y=ie.compare(p.x,h.x);if(y!==0)return y;var _=ie.compare(p.y,h.y);return _!==0?_:this._dimensionsToTest<=2?0:ie.compare(p.z,h.z)},ie.prototype.interfaces_=function(){return[z]},ie.prototype.getClass=function(){return ie},ie.compare=function(s,l){return s<l?-1:s>l?1:M.isNaN(s)?M.isNaN(l)?0:-1:M.isNaN(l)?1:0};var Q=o(function(){},"b");Q.prototype.create=function(){},Q.prototype.interfaces_=function(){return[]},Q.prototype.getClass=function(){return Q};var U=o(function(){},"w"),Te={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.toLocationSymbol=function(s){switch(s){case U.EXTERIOR:return"e";case U.BOUNDARY:return"b";case U.INTERIOR:return"i";case U.NONE:return"-"}throw new A("Unknown location value: "+s)},Te.INTERIOR.get=function(){return 0},Te.BOUNDARY.get=function(){return 1},Te.EXTERIOR.get=function(){return 2},Te.NONE.get=function(){return-1},Object.defineProperties(U,Te);var oe=o(function(s,l){return s.interfaces_&&s.interfaces_().indexOf(l)>-1},"T"),fe=o(function(){},"R"),se={LOG_10:{configurable:!0}};fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe},fe.log10=function(s){var l=Math.log(s);return M.isInfinite(l)||M.isNaN(l)?l:l/fe.LOG_10},fe.min=function(s,l,p,h){var y=s;return l<y&&(y=l),p<y&&(y=p),h<y&&(y=h),y},fe.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var s=arguments[0],l=arguments[1],p=arguments[2];return s<l?l:s>p?p:s}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var h=arguments[0],y=arguments[1],_=arguments[2];return h<y?y:h>_?_:h}},fe.wrap=function(s,l){return s<0?l- -s%l:s%l},fe.max=function(){if(arguments.length===3){var s=arguments[0],l=arguments[1],p=arguments[2],h=s;return l>h&&(h=l),p>h&&(h=p),h}if(arguments.length===4){var y=arguments[0],_=arguments[1],E=arguments[2],k=arguments[3],V=y;return _>V&&(V=_),E>V&&(V=E),k>V&&(V=k),V}},fe.average=function(s,l){return(s+l)/2},se.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(fe,se);var ve=o(function(s){this.str=s},"D");ve.prototype.append=function(s){this.str+=s},ve.prototype.setCharAt=function(s,l){this.str=this.str.substr(0,s)+l+this.str.substr(s+1)},ve.prototype.toString=function(s){return this.str};var ue=o(function(s){this.value=s},"M");ue.prototype.intValue=function(){return this.value},ue.prototype.compareTo=function(s){return this.value<s?-1:this.value>s?1:0},ue.isNaN=function(s){return Number.isNaN(s)};var he=o(function(){},"A");he.isWhitespace=function(s){return s<=32&&s>=0||s===127},he.toUpperCase=function(s){return s.toUpperCase()};var Z=o(function s(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var l=arguments[0];this.init(l)}else if(arguments[0]instanceof s){var p=arguments[0];this.init(p)}else if(typeof arguments[0]=="string"){var h=arguments[0];s.call(this,s.parse(h))}}else if(arguments.length===2){var y=arguments[0],_=arguments[1];this.init(y,_)}},"t"),Ke={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(s){return(this._hi<s._hi||this._hi===s._hi)&&this._lo<=s._lo},Z.prototype.extractSignificantDigits=function(s,l){var p=this.abs(),h=Z.magnitude(p._hi),y=Z.TEN.pow(h);(p=p.divide(y)).gt(Z.TEN)?(p=p.divide(Z.TEN),h+=1):p.lt(Z.ONE)&&(p=p.multiply(Z.TEN),h-=1);for(var _=h+1,E=new ve,k=Z.MAX_PRINT_DIGITS-1,V=0;V<=k;V++){s&&V===_&&E.append(".");var re=Math.trunc(p._hi);if(re<0)break;var de=!1,xe=0;re>9?(de=!0,xe="9"):xe="0"+re,E.append(xe),p=p.subtract(Z.valueOf(re)).multiply(Z.TEN),de&&p.selfAdd(Z.TEN);var Ve=!0,$e=Z.magnitude(p._hi);if($e<0&&Math.abs($e)>=k-V&&(Ve=!1),!Ve)break}return l[0]=h,E.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 s=arguments[0];return this.add(s.negate())}if(typeof arguments[0]=="number"){var l=arguments[0];return this.add(-l)}},Z.prototype.equals=function(){if(arguments.length===1){var s=arguments[0];return this._hi===s._hi&&this._lo===s._lo}},Z.prototype.isZero=function(){return this._hi===0&&this._lo===0},Z.prototype.selfSubtract=function(){if(arguments[0]instanceof Z){var s=arguments[0];return this.isNaN()?this:this.selfAdd(-s._hi,-s._lo)}if(typeof arguments[0]=="number"){var l=arguments[0];return this.isNaN()?this:this.selfAdd(-l,0)}},Z.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Z.prototype.min=function(s){return this.le(s)?this:s},Z.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Z){var s=arguments[0];return this.selfDivide(s._hi,s._lo)}if(typeof arguments[0]=="number"){var l=arguments[0];return this.selfDivide(l,0)}}else if(arguments.length===2){var p=arguments[0],h=arguments[1],y=null,_=null,E=null,k=null,V=null,re=null,de=null,xe=null;return V=this._hi/p,re=Z.SPLIT*V,y=re-V,xe=Z.SPLIT*p,y=re-y,_=V-y,E=xe-p,de=V*p,E=xe-E,k=p-E,xe=y*E-de+y*k+_*E+_*k,re=(this._hi-de-xe+this._lo-V*h)/p,xe=V+re,this._hi=xe,this._lo=V-xe+re,this}},Z.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Z.prototype.divide=function(){if(arguments[0]instanceof Z){var s=arguments[0],l=null,p=null,h=null,y=null,_=null,E=null,k=null,V=null;return p=(_=this._hi/s._hi)-(l=(E=Z.SPLIT*_)-(l=E-_)),V=l*(h=(V=Z.SPLIT*s._hi)-(h=V-s._hi))-(k=_*s._hi)+l*(y=s._hi-h)+p*h+p*y,E=(this._hi-k-V+this._lo-_*s._lo)/s._hi,new Z(V=_+E,_-V+E)}if(typeof arguments[0]=="number"){var re=arguments[0];return M.isNaN(re)?Z.createNaN():Z.copy(this).selfDivide(re,0)}},Z.prototype.ge=function(s){return(this._hi>s._hi||this._hi===s._hi)&&this._lo>=s._lo},Z.prototype.pow=function(s){if(s===0)return Z.valueOf(1);var l=new Z(this),p=Z.valueOf(1),h=Math.abs(s);if(h>1)for(;h>0;)h%2==1&&p.selfMultiply(l),(h/=2)>0&&(l=l.sqr());else p=l;return s<0?p.reciprocal():p},Z.prototype.ceil=function(){if(this.isNaN())return Z.NaN;var s=Math.ceil(this._hi),l=0;return s===this._hi&&(l=Math.ceil(this._lo)),new Z(s,l)},Z.prototype.compareTo=function(s){var l=s;return this._hi<l._hi?-1:this._hi>l._hi?1:this._lo<l._lo?-1:this._lo>l._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 s=arguments[0];return this.init(s),this}if(typeof arguments[0]=="number"){var l=arguments[0];return this.init(l),this}},Z.prototype.max=function(s){return this.ge(s)?this:s},Z.prototype.sqrt=function(){if(this.isZero())return Z.valueOf(0);if(this.isNegative())return Z.NaN;var s=1/Math.sqrt(this._hi),l=this._hi*s,p=Z.valueOf(l),h=this.subtract(p.sqr())._hi*(.5*s);return p.add(h)},Z.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Z){var s=arguments[0];return this.selfAdd(s._hi,s._lo)}if(typeof arguments[0]=="number"){var l=arguments[0],p=null,h=null,y=null,_=null,E=null,k=null;return y=this._hi+l,E=y-this._hi,_=y-E,_=l-E+(this._hi-_),k=_+this._lo,p=y+k,h=k+(y-p),this._hi=p+h,this._lo=h+(p-this._hi),this}}else if(arguments.length===2){var V=arguments[0],re=arguments[1],de=null,xe=null,Ve=null,$e=null,Qe=null,dt=null,$r=null;$e=this._hi+V,xe=this._lo+re,Qe=$e-(dt=$e-this._hi),Ve=xe-($r=xe-this._lo);var fi=(de=$e+(dt=(Qe=V-dt+(this._hi-Qe))+xe))+(dt=(Ve=re-$r+(this._lo-Ve))+(dt+($e-de))),No=dt+(de-fi);return this._hi=fi,this._lo=No,this}},Z.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Z){var s=arguments[0];return this.selfMultiply(s._hi,s._lo)}if(typeof arguments[0]=="number"){var l=arguments[0];return this.selfMultiply(l,0)}}else if(arguments.length===2){var p=arguments[0],h=arguments[1],y=null,_=null,E=null,k=null,V=null,re=null;y=(V=Z.SPLIT*this._hi)-this._hi,re=Z.SPLIT*p,y=V-y,_=this._hi-y,E=re-p;var de=(V=this._hi*p)+(re=y*(E=re-E)-V+y*(k=p-E)+_*E+_*k+(this._hi*h+this._lo*p)),xe=re+(y=V-de);return this._hi=de,this._lo=xe,this}},Z.prototype.selfSqr=function(){return this.selfMultiply(this)},Z.prototype.floor=function(){if(this.isNaN())return Z.NaN;var s=Math.floor(this._hi),l=0;return s===this._hi&&(l=Math.floor(this._lo)),new Z(s,l)},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 s=arguments[0];return s.isNaN()?Z.createNaN():Z.copy(this).selfMultiply(s)}if(typeof arguments[0]=="number"){var l=arguments[0];return M.isNaN(l)?Z.createNaN():Z.copy(this).selfMultiply(l,0)}},Z.prototype.isNaN=function(){return M.isNaN(this._hi)},Z.prototype.intValue=function(){return Math.trunc(this._hi)},Z.prototype.toString=function(){var s=Z.magnitude(this._hi);return s>=-3&&s<=20?this.toStandardNotation():this.toSciNotation()},Z.prototype.toStandardNotation=function(){var s=this.getSpecialNumberString();if(s!==null)return s;var l=new Array(1).fill(null),p=this.extractSignificantDigits(!0,l),h=l[0]+1,y=p;if(p.charAt(0)===".")y="0"+p;else if(h<0)y="0."+Z.stringOfChar("0",-h)+p;else if(p.indexOf(".")===-1){var _=h-p.length;y=p+Z.stringOfChar("0",_)+".0"}return this.isNegative()?"-"+y:y},Z.prototype.reciprocal=function(){var s=null,l=null,p=null,h=null,y=null,_=null,E=null,k=null;l=(y=1/this._hi)-(s=(_=Z.SPLIT*y)-(s=_-y)),p=(k=Z.SPLIT*this._hi)-this._hi;var V=y+(_=(1-(E=y*this._hi)-(k=s*(p=k-p)-E+s*(h=this._hi-p)+l*p+l*h)-y*this._lo)/this._hi);return new Z(V,y-V+_)},Z.prototype.toSciNotation=function(){if(this.isZero())return Z.SCI_NOT_ZERO;var s=this.getSpecialNumberString();if(s!==null)return s;var l=new Array(1).fill(null),p=this.extractSignificantDigits(!1,l),h=Z.SCI_NOT_EXPONENT_CHAR+l[0];if(p.charAt(0)==="0")throw new Error("Found leading zero: "+p);var y="";p.length>1&&(y=p.substring(1));var _=p.charAt(0)+"."+y;return this.isNegative()?"-"+_+h:_+h},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(s){return(this._hi<s._hi||this._hi===s._hi)&&this._lo<s._lo},Z.prototype.add=function(){if(arguments[0]instanceof Z){var s=arguments[0];return Z.copy(this).selfAdd(s)}if(typeof arguments[0]=="number"){var l=arguments[0];return Z.copy(this).selfAdd(l)}},Z.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var s=arguments[0];this._hi=s,this._lo=0}else if(arguments[0]instanceof Z){var l=arguments[0];this._hi=l._hi,this._lo=l._lo}}else if(arguments.length===2){var p=arguments[0],h=arguments[1];this._hi=p,this._lo=h}},Z.prototype.gt=function(s){return(this._hi>s._hi||this._hi===s._hi)&&this._lo>s._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[t,B,H]},Z.prototype.getClass=function(){return Z},Z.sqr=function(s){return Z.valueOf(s).selfMultiply(s)},Z.valueOf=function(){if(typeof arguments[0]=="string"){var s=arguments[0];return Z.parse(s)}if(typeof arguments[0]=="number"){var l=arguments[0];return new Z(l)}},Z.sqrt=function(s){return Z.valueOf(s).sqrt()},Z.parse=function(s){for(var l=0,p=s.length;he.isWhitespace(s.charAt(l));)l++;var h=!1;if(l<p){var y=s.charAt(l);y!=="-"&&y!=="+"||(l++,y==="-"&&(h=!0))}for(var _=new Z,E=0,k=0,V=0;!(l>=p);){var re=s.charAt(l);if(l++,he.isDigit(re)){var de=re-"0";_.selfMultiply(Z.TEN),_.selfAdd(de),E++}else{if(re!=="."){if(re==="e"||re==="E"){var xe=s.substring(l);try{V=ue.parseInt(xe)}catch($r){throw $r instanceof Error?new Error("Invalid exponent "+xe+" in string "+s):$r}break}throw new Error("Unexpected character '"+re+"' at position "+l+" in string "+s)}k=E}}var Ve=_,$e=E-k-V;if($e===0)Ve=_;else if($e>0){var Qe=Z.TEN.pow($e);Ve=_.divide(Qe)}else if($e<0){var dt=Z.TEN.pow(-$e);Ve=_.multiply(dt)}return h?Ve.negate():Ve},Z.createNaN=function(){return new Z(M.NaN,M.NaN)},Z.copy=function(s){return new Z(s)},Z.magnitude=function(s){var l=Math.abs(s),p=Math.log(l)/Math.log(10),h=Math.trunc(Math.floor(p));return 10*Math.pow(10,h)<=l&&(h+=1),h},Z.stringOfChar=function(s,l){for(var p=new ve,h=0;h<l;h++)p.append(s);return p.toString()},Ke.PI.get=function(){return new Z(3.141592653589793,12246467991473532e-32)},Ke.TWO_PI.get=function(){return new Z(6.283185307179586,24492935982947064e-32)},Ke.PI_2.get=function(){return new Z(1.5707963267948966,6123233995736766e-32)},Ke.E.get=function(){return new Z(2.718281828459045,14456468917292502e-32)},Ke.NaN.get=function(){return new Z(M.NaN,M.NaN)},Ke.EPS.get=function(){return 123259516440783e-46},Ke.SPLIT.get=function(){return 134217729},Ke.MAX_PRINT_DIGITS.get=function(){return 32},Ke.TEN.get=function(){return Z.valueOf(10)},Ke.ONE.get=function(){return Z.valueOf(1)},Ke.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Ke.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Z,Ke);var Ue=o(function(){},"q"),rt={DP_SAFE_EPSILON:{configurable:!0}};Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue},Ue.orientationIndex=function(s,l,p){var h=Ue.orientationIndexFilter(s,l,p);if(h<=1)return h;var y=Z.valueOf(l.x).selfAdd(-s.x),_=Z.valueOf(l.y).selfAdd(-s.y),E=Z.valueOf(p.x).selfAdd(-l.x),k=Z.valueOf(p.y).selfAdd(-l.y);return y.selfMultiply(k).selfSubtract(_.selfMultiply(E)).signum()},Ue.signOfDet2x2=function(s,l,p,h){return s.multiply(h).selfSubtract(l.multiply(p)).signum()},Ue.intersection=function(s,l,p,h){var y=Z.valueOf(h.y).selfSubtract(p.y).selfMultiply(Z.valueOf(l.x).selfSubtract(s.x)),_=Z.valueOf(h.x).selfSubtract(p.x).selfMultiply(Z.valueOf(l.y).selfSubtract(s.y)),E=y.subtract(_),k=Z.valueOf(h.x).selfSubtract(p.x).selfMultiply(Z.valueOf(s.y).selfSubtract(p.y)),V=Z.valueOf(h.y).selfSubtract(p.y).selfMultiply(Z.valueOf(s.x).selfSubtract(p.x)),re=k.subtract(V).selfDivide(E).doubleValue(),de=Z.valueOf(s.x).selfAdd(Z.valueOf(l.x).selfSubtract(s.x).selfMultiply(re)).doubleValue(),xe=Z.valueOf(l.x).selfSubtract(s.x).selfMultiply(Z.valueOf(s.y).selfSubtract(p.y)),Ve=Z.valueOf(l.y).selfSubtract(s.y).selfMultiply(Z.valueOf(s.x).selfSubtract(p.x)),$e=xe.subtract(Ve).selfDivide(E).doubleValue(),Qe=Z.valueOf(p.y).selfAdd(Z.valueOf(h.y).selfSubtract(p.y).selfMultiply($e)).doubleValue();return new R(de,Qe)},Ue.orientationIndexFilter=function(s,l,p){var h=null,y=(s.x-p.x)*(l.y-p.y),_=(s.y-p.y)*(l.x-p.x),E=y-_;if(y>0){if(_<=0)return Ue.signum(E);h=y+_}else{if(!(y<0)||_>=0)return Ue.signum(E);h=-y-_}var k=Ue.DP_SAFE_EPSILON*h;return E>=k||-E>=k?Ue.signum(E):2},Ue.signum=function(s){return s>0?1:s<0?-1:0},rt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Ue,rt);var Ee=o(function(){},"V"),We={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};We.X.get=function(){return 0},We.Y.get=function(){return 1},We.Z.get=function(){return 2},We.M.get=function(){return 3},Ee.prototype.setOrdinate=function(s,l,p){},Ee.prototype.size=function(){},Ee.prototype.getOrdinate=function(s,l){},Ee.prototype.getCoordinate=function(){},Ee.prototype.getCoordinateCopy=function(s){},Ee.prototype.getDimension=function(){},Ee.prototype.getX=function(s){},Ee.prototype.clone=function(){},Ee.prototype.expandEnvelope=function(s){},Ee.prototype.copy=function(){},Ee.prototype.getY=function(s){},Ee.prototype.toCoordinateArray=function(){},Ee.prototype.interfaces_=function(){return[H]},Ee.prototype.getClass=function(){return Ee},Object.defineProperties(Ee,We);var St=o(function(){},"z"),yt=function(s){function l(){s.call(this,"Projective point not representable on the Cartesian plane.")}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(St),pt=o(function(){},"Y");pt.arraycopy=function(s,l,p,h,y){for(var _=0,E=l;E<l+y;E++)p[h+_]=s[E],_++},pt.getProperty=function(s){return{"line.separator":"\n"}[s]};var te=o(function s(){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 l=arguments[0];this.x=l.x,this.y=l.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var p=arguments[0],h=arguments[1];this.x=p,this.y=h,this.w=1}else if(arguments[0]instanceof s&&arguments[1]instanceof s){var y=arguments[0],_=arguments[1];this.x=y.y*_.w-_.y*y.w,this.y=_.x*y.w-y.x*_.w,this.w=y.x*_.y-_.x*y.y}else if(arguments[0]instanceof R&&arguments[1]instanceof R){var E=arguments[0],k=arguments[1];this.x=E.y-k.y,this.y=k.x-E.x,this.w=E.x*k.y-k.x*E.y}}else if(arguments.length===3){var V=arguments[0],re=arguments[1],de=arguments[2];this.x=V,this.y=re,this.w=de}else if(arguments.length===4){var xe=arguments[0],Ve=arguments[1],$e=arguments[2],Qe=arguments[3],dt=xe.y-Ve.y,$r=Ve.x-xe.x,fi=xe.x*Ve.y-Ve.x*xe.y,No=$e.y-Qe.y,Yl=Qe.x-$e.x,Xc=$e.x*Qe.y-Qe.x*$e.y;this.x=$r*Xc-Yl*fi,this.y=No*fi-dt*Xc,this.w=dt*Yl-No*$r}},"t");te.prototype.getY=function(){var s=this.y/this.w;if(M.isNaN(s)||M.isInfinite(s))throw new yt;return s},te.prototype.getX=function(){var s=this.x/this.w;if(M.isNaN(s)||M.isInfinite(s))throw new yt;return s},te.prototype.getCoordinate=function(){var s=new R;return s.x=this.getX(),s.y=this.getY(),s},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te},te.intersection=function(s,l,p,h){var y=s.y-l.y,_=l.x-s.x,E=s.x*l.y-l.x*s.y,k=p.y-h.y,V=h.x-p.x,re=p.x*h.y-h.x*p.y,de=y*V-k*_,xe=(_*re-V*E)/de,Ve=(k*E-y*re)/de;if(M.isNaN(xe)||M.isInfinite(xe)||M.isNaN(Ve)||M.isInfinite(Ve))throw new yt;return new R(xe,Ve)};var ce=o(function s(){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 R){var l=arguments[0];this.init(l.x,l.x,l.y,l.y)}else if(arguments[0]instanceof s){var p=arguments[0];this.init(p)}}else if(arguments.length===2){var h=arguments[0],y=arguments[1];this.init(h.x,y.x,h.y,y.y)}else if(arguments.length===4){var _=arguments[0],E=arguments[1],k=arguments[2],V=arguments[3];this.init(_,E,k,V)}},"t"),ee={serialVersionUID:{configurable:!0}};ce.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ce.prototype.equals=function(s){if(!(s instanceof ce))return!1;var l=s;return this.isNull()?l.isNull():this._maxx===l.getMaxX()&&this._maxy===l.getMaxY()&&this._minx===l.getMinX()&&this._miny===l.getMinY()},ce.prototype.intersection=function(s){if(this.isNull()||s.isNull()||!this.intersects(s))return new ce;var l=this._minx>s._minx?this._minx:s._minx,p=this._miny>s._miny?this._miny:s._miny,h=this._maxx<s._maxx?this._maxx:s._maxx,y=this._maxy<s._maxy?this._maxy:s._maxy;return new ce(l,h,p,y)},ce.prototype.isNull=function(){return this._maxx<this._minx},ce.prototype.getMaxX=function(){return this._maxx},ce.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof R){var s=arguments[0];return this.covers(s.x,s.y)}if(arguments[0]instanceof ce){var l=arguments[0];return!this.isNull()&&!l.isNull()&&l.getMinX()>=this._minx&&l.getMaxX()<=this._maxx&&l.getMinY()>=this._miny&&l.getMaxY()<=this._maxy}}else if(arguments.length===2){var p=arguments[0],h=arguments[1];return!this.isNull()&&p>=this._minx&&p<=this._maxx&&h>=this._miny&&h<=this._maxy}},ce.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof ce){var s=arguments[0];return!this.isNull()&&!s.isNull()&&!(s._minx>this._maxx||s._maxx<this._minx||s._miny>this._maxy||s._maxy<this._miny)}if(arguments[0]instanceof R){var l=arguments[0];return this.intersects(l.x,l.y)}}else if(arguments.length===2){var p=arguments[0],h=arguments[1];return!this.isNull()&&!(p>this._maxx||p<this._minx||h>this._maxy||h<this._miny)}},ce.prototype.getMinY=function(){return this._miny},ce.prototype.getMinX=function(){return this._minx},ce.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof R){var s=arguments[0];this.expandToInclude(s.x,s.y)}else if(arguments[0]instanceof ce){var l=arguments[0];if(l.isNull())return null;this.isNull()?(this._minx=l.getMinX(),this._maxx=l.getMaxX(),this._miny=l.getMinY(),this._maxy=l.getMaxY()):(l._minx<this._minx&&(this._minx=l._minx),l._maxx>this._maxx&&(this._maxx=l._maxx),l._miny<this._miny&&(this._miny=l._miny),l._maxy>this._maxy&&(this._maxy=l._maxy))}}else if(arguments.length===2){var p=arguments[0],h=arguments[1];this.isNull()?(this._minx=p,this._maxx=p,this._miny=h,this._maxy=h):(p<this._minx&&(this._minx=p),p>this._maxx&&(this._maxx=p),h<this._miny&&(this._miny=h),h>this._maxy&&(this._maxy=h))}},ce.prototype.minExtent=function(){if(this.isNull())return 0;var s=this.getWidth(),l=this.getHeight();return s<l?s:l},ce.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ce.prototype.compareTo=function(s){var l=s;return this.isNull()?l.isNull()?0:-1:l.isNull()?1:this._minx<l._minx?-1:this._minx>l._minx?1:this._miny<l._miny?-1:this._miny>l._miny?1:this._maxx<l._maxx?-1:this._maxx>l._maxx?1:this._maxy<l._maxy?-1:this._maxy>l._maxy?1:0},ce.prototype.translate=function(s,l){if(this.isNull())return null;this.init(this.getMinX()+s,this.getMaxX()+s,this.getMinY()+l,this.getMaxY()+l)},ce.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ce.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ce.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ce.prototype.maxExtent=function(){if(this.isNull())return 0;var s=this.getWidth(),l=this.getHeight();return s>l?s:l},ce.prototype.expandBy=function(){if(arguments.length===1){var s=arguments[0];this.expandBy(s,s)}else if(arguments.length===2){var l=arguments[0],p=arguments[1];if(this.isNull())return null;this._minx-=l,this._maxx+=l,this._miny-=p,this._maxy+=p,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},ce.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof ce){var s=arguments[0];return this.covers(s)}if(arguments[0]instanceof R){var l=arguments[0];return this.covers(l)}}else if(arguments.length===2){var p=arguments[0],h=arguments[1];return this.covers(p,h)}},ce.prototype.centre=function(){return this.isNull()?null:new R((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ce.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof R){var s=arguments[0];this.init(s.x,s.x,s.y,s.y)}else if(arguments[0]instanceof ce){var l=arguments[0];this._minx=l._minx,this._maxx=l._maxx,this._miny=l._miny,this._maxy=l._maxy}}else if(arguments.length===2){var p=arguments[0],h=arguments[1];this.init(p.x,h.x,p.y,h.y)}else if(arguments.length===4){var y=arguments[0],_=arguments[1],E=arguments[2],k=arguments[3];y<_?(this._minx=y,this._maxx=_):(this._minx=_,this._maxx=y),E<k?(this._miny=E,this._maxy=k):(this._miny=k,this._maxy=E)}},ce.prototype.getMaxY=function(){return this._maxy},ce.prototype.distance=function(s){if(this.intersects(s))return 0;var l=0;this._maxx<s._minx?l=s._minx-this._maxx:this._minx>s._maxx&&(l=this._minx-s._maxx);var p=0;return this._maxy<s._miny?p=s._miny-this._maxy:this._miny>s._maxy&&(p=this._miny-s._maxy),l===0?p:p===0?l:Math.sqrt(l*l+p*p)},ce.prototype.hashCode=function(){var s=17;return s=37*s+R.hashCode(this._minx),s=37*s+R.hashCode(this._maxx),s=37*s+R.hashCode(this._miny),s=37*s+R.hashCode(this._maxy)},ce.prototype.interfaces_=function(){return[B,t]},ce.prototype.getClass=function(){return ce},ce.intersects=function(){if(arguments.length===3){var s=arguments[0],l=arguments[1],p=arguments[2];return p.x>=(s.x<l.x?s.x:l.x)&&p.x<=(s.x>l.x?s.x:l.x)&&p.y>=(s.y<l.y?s.y:l.y)&&p.y<=(s.y>l.y?s.y:l.y)}if(arguments.length===4){var h=arguments[0],y=arguments[1],_=arguments[2],E=arguments[3],k=Math.min(_.x,E.x),V=Math.max(_.x,E.x),re=Math.min(h.x,y.x),de=Math.max(h.x,y.x);return!(re>V)&&!(de<k)&&(k=Math.min(_.y,E.y),V=Math.max(_.y,E.y),re=Math.min(h.y,y.y),de=Math.max(h.y,y.y),!(re>V)&&!(de<k))}},ee.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(ce,ee);var be={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*$/},Me=o(function(s){this.geometryFactory=s||new jt},"K");Me.prototype.read=function(s){var l,p,h;s=s.replace(/[\n\r]/g," ");var y=be.typeStr.exec(s);if(s.search("EMPTY")!==-1&&((y=be.emptyTypeStr.exec(s))[2]=void 0),y&&(p=y[1].toLowerCase(),h=y[2],it[p]&&(l=it[p].apply(this,[h]))),l===void 0)throw new Error("Could not parse WKT "+s);return l},Me.prototype.write=function(s){return this.extractGeometry(s)},Me.prototype.extractGeometry=function(s){var l=s.getGeometryType().toLowerCase();if(!Fe[l])return null;var p=l.toUpperCase();return s.isEmpty()?p+" EMPTY":p+"("+Fe[l].apply(this,[s])+")"};var Fe={coordinate:o(function(s){return s.x+" "+s.y},"coordinate"),point:o(function(s){return Fe.coordinate.call(this,s._coordinates._coordinates[0])},"point"),multipoint:o(function(s){for(var l=[],p=0,h=s._geometries.length;p<h;++p)l.push("("+Fe.point.apply(this,[s._geometries[p]])+")");return l.join(",")},"multipoint"),linestring:o(function(s){for(var l=[],p=0,h=s._points._coordinates.length;p<h;++p)l.push(Fe.coordinate.apply(this,[s._points._coordinates[p]]));return l.join(",")},"linestring"),linearring:o(function(s){for(var l=[],p=0,h=s._points._coordinates.length;p<h;++p)l.push(Fe.coordinate.apply(this,[s._points._coordinates[p]]));return l.join(",")},"linearring"),multilinestring:o(function(s){for(var l=[],p=0,h=s._geometries.length;p<h;++p)l.push("("+Fe.linestring.apply(this,[s._geometries[p]])+")");return l.join(",")},"multilinestring"),polygon:o(function(s){var l=[];l.push("("+Fe.linestring.apply(this,[s._shell])+")");for(var p=0,h=s._holes.length;p<h;++p)l.push("("+Fe.linestring.apply(this,[s._holes[p]])+")");return l.join(",")},"polygon"),multipolygon:o(function(s){for(var l=[],p=0,h=s._geometries.length;p<h;++p)l.push("("+Fe.polygon.apply(this,[s._geometries[p]])+")");return l.join(",")},"multipolygon"),geometrycollection:o(function(s){for(var l=[],p=0,h=s._geometries.length;p<h;++p)l.push(this.extractGeometry(s._geometries[p]));return l.join(",")},"geometrycollection")},it={point:o(function(s){if(s===void 0)return this.geometryFactory.createPoint();var l=s.trim().split(be.spaces);return this.geometryFactory.createPoint(new R(Number.parseFloat(l[0]),Number.parseFloat(l[1])))},"point"),multipoint:o(function(s){if(s===void 0)return this.geometryFactory.createMultiPoint();for(var l,p=s.trim().split(","),h=[],y=0,_=p.length;y<_;++y)l=p[y].replace(be.trimParens,"$1"),h.push(it.point.apply(this,[l]));return this.geometryFactory.createMultiPoint(h)},"multipoint"),linestring:o(function(s){if(s===void 0)return this.geometryFactory.createLineString();for(var l,p=s.trim().split(","),h=[],y=0,_=p.length;y<_;++y)l=p[y].trim().split(be.spaces),h.push(new R(Number.parseFloat(l[0]),Number.parseFloat(l[1])));return this.geometryFactory.createLineString(h)},"linestring"),linearring:o(function(s){if(s===void 0)return this.geometryFactory.createLinearRing();for(var l,p=s.trim().split(","),h=[],y=0,_=p.length;y<_;++y)l=p[y].trim().split(be.spaces),h.push(new R(Number.parseFloat(l[0]),Number.parseFloat(l[1])));return this.geometryFactory.createLinearRing(h)},"linearring"),multilinestring:o(function(s){if(s===void 0)return this.geometryFactory.createMultiLineString();for(var l,p=s.trim().split(be.parenComma),h=[],y=0,_=p.length;y<_;++y)l=p[y].replace(be.trimParens,"$1"),h.push(it.linestring.apply(this,[l]));return this.geometryFactory.createMultiLineString(h)},"multilinestring"),polygon:o(function(s){if(s===void 0)return this.geometryFactory.createPolygon();for(var l,p,h,y,_=s.trim().split(be.parenComma),E=[],k=0,V=_.length;k<V;++k)l=_[k].replace(be.trimParens,"$1"),p=it.linestring.apply(this,[l]),h=this.geometryFactory.createLinearRing(p._points),k===0?y=h:E.push(h);return this.geometryFactory.createPolygon(y,E)},"polygon"),multipolygon:o(function(s){if(s===void 0)return this.geometryFactory.createMultiPolygon();for(var l,p=s.trim().split(be.doubleParenComma),h=[],y=0,_=p.length;y<_;++y)l=p[y].replace(be.trimParens,"$1"),h.push(it.polygon.apply(this,[l]));return this.geometryFactory.createMultiPolygon(h)},"multipolygon"),geometrycollection:o(function(s){if(s===void 0)return this.geometryFactory.createGeometryCollection();for(var l=(s=s.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),p=[],h=0,y=l.length;h<y;++h)p.push(this.read(l[h]));return this.geometryFactory.createGeometryCollection(p)},"geometrycollection")},xt=o(function(s){this.parser=new Me(s)},"Z");xt.prototype.write=function(s){return this.parser.write(s)},xt.toLineString=function(s,l){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+s.x+" "+s.y+", "+l.x+" "+l.y+" )"};var Bt=function(s){function l(p){s.call(this,p),this.name="RuntimeException",this.message=p,this.stack=new s().stack}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l}(Error),pn=function(s){function l(){if(s.call(this),arguments.length===0)s.call(this);else if(arguments.length===1){var p=arguments[0];s.call(this,p)}}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(Bt),Xe=o(function(){},"et");Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe},Xe.shouldNeverReachHere=function(){if(arguments.length===0)Xe.shouldNeverReachHere(null);else if(arguments.length===1){var s=arguments[0];throw new pn("Should never reach here"+(s!==null?": "+s:""))}},Xe.isTrue=function(){var s,l;if(arguments.length===1)s=arguments[0],Xe.isTrue(s,null);else if(arguments.length===2&&(s=arguments[0],l=arguments[1],!s))throw l===null?new pn:new pn(l)},Xe.equals=function(){var s,l,p;if(arguments.length===2)s=arguments[0],l=arguments[1],Xe.equals(s,l,null);else if(arguments.length===3&&(s=arguments[0],l=arguments[1],p=arguments[2],!l.equals(s)))throw new pn("Expected "+s+" but encountered "+l+(p!==null?": "+p:""))};var Gt=o(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 R,this._intPt[1]=new R,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},"nt"),Yi={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Gt.prototype.getIndexAlongSegment=function(s,l){return this.computeIntLineIndex(),this._intLineIndex[s][l]},Gt.prototype.getTopologySummary=function(){var s=new ve;return this.isEndPoint()&&s.append(" endpoint"),this._isProper&&s.append(" proper"),this.isCollinear()&&s.append(" collinear"),s.toString()},Gt.prototype.computeIntersection=function(s,l,p,h){this._inputLines[0][0]=s,this._inputLines[0][1]=l,this._inputLines[1][0]=p,this._inputLines[1][1]=h,this._result=this.computeIntersect(s,l,p,h)},Gt.prototype.getIntersectionNum=function(){return this._result},Gt.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 s=arguments[0];this.getEdgeDistance(s,0)>this.getEdgeDistance(s,1)?(this._intLineIndex[s][0]=0,this._intLineIndex[s][1]=1):(this._intLineIndex[s][0]=1,this._intLineIndex[s][1]=0)}},Gt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Gt.prototype.setPrecisionModel=function(s){this._precisionModel=s},Gt.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var s=arguments[0],l=0;l<this._result;l++)if(!this._intPt[l].equals2D(this._inputLines[s][0])&&!this._intPt[l].equals2D(this._inputLines[s][1]))return!0;return!1}},Gt.prototype.getIntersection=function(s){return this._intPt[s]},Gt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Gt.prototype.hasIntersection=function(){return this._result!==Gt.NO_INTERSECTION},Gt.prototype.getEdgeDistance=function(s,l){return Gt.computeEdgeDistance(this._intPt[l],this._inputLines[s][0],this._inputLines[s][1])},Gt.prototype.isCollinear=function(){return this._result===Gt.COLLINEAR_INTERSECTION},Gt.prototype.toString=function(){return xt.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+xt.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Gt.prototype.getEndpoint=function(s,l){return this._inputLines[s][l]},Gt.prototype.isIntersection=function(s){for(var l=0;l<this._result;l++)if(this._intPt[l].equals2D(s))return!0;return!1},Gt.prototype.getIntersectionAlongSegment=function(s,l){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[s][l]]},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.computeEdgeDistance=function(s,l,p){var h=Math.abs(p.x-l.x),y=Math.abs(p.y-l.y),_=-1;if(s.equals(l))_=0;else if(s.equals(p))_=h>y?h:y;else{var E=Math.abs(s.x-l.x),k=Math.abs(s.y-l.y);(_=h>y?E:k)!==0||s.equals(l)||(_=Math.max(E,k))}return Xe.isTrue(!(_===0&&!s.equals(l)),"Bad distance calculation"),_},Gt.nonRobustComputeEdgeDistance=function(s,l,p){var h=s.x-l.x,y=s.y-l.y,_=Math.sqrt(h*h+y*y);return Xe.isTrue(!(_===0&&!s.equals(l)),"Invalid distance calculation"),_},Yi.DONT_INTERSECT.get=function(){return 0},Yi.DO_INTERSECT.get=function(){return 1},Yi.COLLINEAR.get=function(){return 2},Yi.NO_INTERSECTION.get=function(){return 0},Yi.POINT_INTERSECTION.get=function(){return 1},Yi.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Gt,Yi);var Gi=function(s){function l(){s.apply(this,arguments)}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.isInSegmentEnvelopes=function(p){var h=new ce(this._inputLines[0][0],this._inputLines[0][1]),y=new ce(this._inputLines[1][0],this._inputLines[1][1]);return h.contains(p)&&y.contains(p)},l.prototype.computeIntersection=function(){if(arguments.length!==3)return s.prototype.computeIntersection.apply(this,arguments);var p=arguments[0],h=arguments[1],y=arguments[2];if(this._isProper=!1,ce.intersects(h,y,p)&&Ge.orientationIndex(h,y,p)===0&&Ge.orientationIndex(y,h,p)===0)return this._isProper=!0,(p.equals(h)||p.equals(y))&&(this._isProper=!1),this._result=s.POINT_INTERSECTION,null;this._result=s.NO_INTERSECTION},l.prototype.normalizeToMinimum=function(p,h,y,_,E){E.x=this.smallestInAbsValue(p.x,h.x,y.x,_.x),E.y=this.smallestInAbsValue(p.y,h.y,y.y,_.y),p.x-=E.x,p.y-=E.y,h.x-=E.x,h.y-=E.y,y.x-=E.x,y.y-=E.y,_.x-=E.x,_.y-=E.y},l.prototype.safeHCoordinateIntersection=function(p,h,y,_){var E=null;try{E=te.intersection(p,h,y,_)}catch(k){if(!(k instanceof yt))throw k;E=l.nearestEndpoint(p,h,y,_)}return E},l.prototype.intersection=function(p,h,y,_){var E=this.intersectionWithNormalization(p,h,y,_);return this.isInSegmentEnvelopes(E)||(E=new R(l.nearestEndpoint(p,h,y,_))),this._precisionModel!==null&&this._precisionModel.makePrecise(E),E},l.prototype.smallestInAbsValue=function(p,h,y,_){var E=p,k=Math.abs(E);return Math.abs(h)<k&&(E=h,k=Math.abs(h)),Math.abs(y)<k&&(E=y,k=Math.abs(y)),Math.abs(_)<k&&(E=_),E},l.prototype.checkDD=function(p,h,y,_,E){var k=Ue.intersection(p,h,y,_),V=this.isInSegmentEnvelopes(k);pt.out.println("DD in env = "+V+" --------------------- "+k),E.distance(k)>1e-4&&pt.out.println("Distance = "+E.distance(k))},l.prototype.intersectionWithNormalization=function(p,h,y,_){var E=new R(p),k=new R(h),V=new R(y),re=new R(_),de=new R;this.normalizeToEnvCentre(E,k,V,re,de);var xe=this.safeHCoordinateIntersection(E,k,V,re);return xe.x+=de.x,xe.y+=de.y,xe},l.prototype.computeCollinearIntersection=function(p,h,y,_){var E=ce.intersects(p,h,y),k=ce.intersects(p,h,_),V=ce.intersects(y,_,p),re=ce.intersects(y,_,h);return E&&k?(this._intPt[0]=y,this._intPt[1]=_,s.COLLINEAR_INTERSECTION):V&&re?(this._intPt[0]=p,this._intPt[1]=h,s.COLLINEAR_INTERSECTION):E&&V?(this._intPt[0]=y,this._intPt[1]=p,!y.equals(p)||k||re?s.COLLINEAR_INTERSECTION:s.POINT_INTERSECTION):E&&re?(this._intPt[0]=y,this._intPt[1]=h,!y.equals(h)||k||V?s.COLLINEAR_INTERSECTION:s.POINT_INTERSECTION):k&&V?(this._intPt[0]=_,this._intPt[1]=p,!_.equals(p)||E||re?s.COLLINEAR_INTERSECTION:s.POINT_INTERSECTION):k&&re?(this._intPt[0]=_,this._intPt[1]=h,!_.equals(h)||E||V?s.COLLINEAR_INTERSECTION:s.POINT_INTERSECTION):s.NO_INTERSECTION},l.prototype.normalizeToEnvCentre=function(p,h,y,_,E){var k=p.x<h.x?p.x:h.x,V=p.y<h.y?p.y:h.y,re=p.x>h.x?p.x:h.x,de=p.y>h.y?p.y:h.y,xe=y.x<_.x?y.x:_.x,Ve=y.y<_.y?y.y:_.y,$e=y.x>_.x?y.x:_.x,Qe=y.y>_.y?y.y:_.y,dt=((k>xe?k:xe)+(re<$e?re:$e))/2,$r=((V>Ve?V:Ve)+(de<Qe?de:Qe))/2;E.x=dt,E.y=$r,p.x-=E.x,p.y-=E.y,h.x-=E.x,h.y-=E.y,y.x-=E.x,y.y-=E.y,_.x-=E.x,_.y-=E.y},l.prototype.computeIntersect=function(p,h,y,_){if(this._isProper=!1,!ce.intersects(p,h,y,_))return s.NO_INTERSECTION;var E=Ge.orientationIndex(p,h,y),k=Ge.orientationIndex(p,h,_);if(E>0&&k>0||E<0&&k<0)return s.NO_INTERSECTION;var V=Ge.orientationIndex(y,_,p),re=Ge.orientationIndex(y,_,h);return V>0&&re>0||V<0&&re<0?s.NO_INTERSECTION:E===0&&k===0&&V===0&&re===0?this.computeCollinearIntersection(p,h,y,_):(E===0||k===0||V===0||re===0?(this._isProper=!1,p.equals2D(y)||p.equals2D(_)?this._intPt[0]=p:h.equals2D(y)||h.equals2D(_)?this._intPt[0]=h:E===0?this._intPt[0]=new R(y):k===0?this._intPt[0]=new R(_):V===0?this._intPt[0]=new R(p):re===0&&(this._intPt[0]=new R(h))):(this._isProper=!0,this._intPt[0]=this.intersection(p,h,y,_)),s.POINT_INTERSECTION)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l.nearestEndpoint=function(p,h,y,_){var E=p,k=Ge.distancePointLine(p,y,_),V=Ge.distancePointLine(h,y,_);return V<k&&(k=V,E=h),(V=Ge.distancePointLine(y,p,h))<k&&(k=V,E=y),(V=Ge.distancePointLine(_,p,h))<k&&(k=V,E=_),E},l}(Gt),Po=o(function(){},"ot");Po.prototype.interfaces_=function(){return[]},Po.prototype.getClass=function(){return Po},Po.orientationIndex=function(s,l,p){var h=l.x-s.x,y=l.y-s.y,_=p.x-l.x,E=p.y-l.y;return Po.signOfDet2x2(h,y,_,E)},Po.signOfDet2x2=function(s,l,p,h){var y=null,_=null,E=null;if(y=1,s===0||h===0)return l===0||p===0?0:l>0?p>0?-y:y:p>0?y:-y;if(l===0||p===0)return h>0?s>0?y:-y:s>0?-y:y;if(l>0?h>0?l<=h||(y=-y,_=s,s=p,p=_,_=l,l=h,h=_):l<=-h?(y=-y,p=-p,h=-h):(_=s,s=-p,p=_,_=l,l=-h,h=_):h>0?-l<=h?(y=-y,s=-s,l=-l):(_=-s,s=p,p=_,_=-l,l=h,h=_):l>=h?(s=-s,l=-l,p=-p,h=-h):(y=-y,_=-s,s=-p,p=_,_=-l,l=-h,h=_),s>0){if(!(p>0)||!(s<=p))return y}else{if(p>0||!(s>=p))return-y;y=-y,s=-s,p=-p}for(;;){if(E=Math.floor(p/s),p-=E*s,(h-=E*l)<0)return-y;if(h>l)return y;if(s>p+p){if(l<h+h)return y}else{if(l>h+h)return-y;p=s-p,h=l-h,y=-y}if(h===0)return p===0?0:-y;if(p===0||(E=Math.floor(s/p),s-=E*p,(l-=E*h)<0))return y;if(l>h)return-y;if(p>s+s){if(h<l+l)return-y}else{if(h>l+l)return y;s=p-s,l=h-l,y=-y}if(l===0)return s===0?0:y;if(s===0)return-y}};var Zn=o(function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var s=arguments[0];this._p=s},"st");Zn.prototype.countSegment=function(s,l){if(s.x<this._p.x&&l.x<this._p.x)return null;if(this._p.x===l.x&&this._p.y===l.y)return this._isPointOnSegment=!0,null;if(s.y===this._p.y&&l.y===this._p.y){var p=s.x,h=l.x;return p>h&&(p=l.x,h=s.x),this._p.x>=p&&this._p.x<=h&&(this._isPointOnSegment=!0),null}if(s.y>this._p.y&&l.y<=this._p.y||l.y>this._p.y&&s.y<=this._p.y){var y=s.x-this._p.x,_=s.y-this._p.y,E=l.x-this._p.x,k=l.y-this._p.y,V=Po.signOfDet2x2(y,_,E,k);if(V===0)return this._isPointOnSegment=!0,null;k<_&&(V=-V),V>0&&this._crossingCount++}},Zn.prototype.isPointInPolygon=function(){return this.getLocation()!==U.EXTERIOR},Zn.prototype.getLocation=function(){return this._isPointOnSegment?U.BOUNDARY:this._crossingCount%2==1?U.INTERIOR:U.EXTERIOR},Zn.prototype.isOnSegment=function(){return this._isPointOnSegment},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Zn.locatePointInRing=function(){if(arguments[0]instanceof R&&oe(arguments[1],Ee)){for(var s=arguments[0],l=arguments[1],p=new Zn(s),h=new R,y=new R,_=1;_<l.size();_++)if(l.getCoordinate(_,h),l.getCoordinate(_-1,y),p.countSegment(h,y),p.isOnSegment())return p.getLocation();return p.getLocation()}if(arguments[0]instanceof R&&arguments[1]instanceof Array){for(var E=arguments[0],k=arguments[1],V=new Zn(E),re=1;re<k.length;re++){var de=k[re],xe=k[re-1];if(V.countSegment(de,xe),V.isOnSegment())return V.getLocation()}return V.getLocation()}};var Ge=o(function(){},"at"),aa={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.orientationIndex=function(s,l,p){return Ue.orientationIndex(s,l,p)},Ge.signedArea=function(){if(arguments[0]instanceof Array){var s=arguments[0];if(s.length<3)return 0;for(var l=0,p=s[0].x,h=1;h<s.length-1;h++){var y=s[h].x-p,_=s[h+1].y;l+=y*(s[h-1].y-_)}return l/2}if(oe(arguments[0],Ee)){var E=arguments[0],k=E.size();if(k<3)return 0;var V=new R,re=new R,de=new R;E.getCoordinate(0,re),E.getCoordinate(1,de);var xe=re.x;de.x-=xe;for(var Ve=0,$e=1;$e<k-1;$e++)V.y=re.y,re.x=de.x,re.y=de.y,E.getCoordinate($e+1,de),de.x-=xe,Ve+=re.x*(V.y-de.y);return Ve/2}},Ge.distanceLineLine=function(s,l,p,h){if(s.equals(l))return Ge.distancePointLine(s,p,h);if(p.equals(h))return Ge.distancePointLine(h,s,l);var y=!1;if(ce.intersects(s,l,p,h)){var _=(l.x-s.x)*(h.y-p.y)-(l.y-s.y)*(h.x-p.x);if(_===0)y=!0;else{var E=(s.y-p.y)*(h.x-p.x)-(s.x-p.x)*(h.y-p.y),k=((s.y-p.y)*(l.x-s.x)-(s.x-p.x)*(l.y-s.y))/_,V=E/_;(V<0||V>1||k<0||k>1)&&(y=!0)}}else y=!0;return y?fe.min(Ge.distancePointLine(s,p,h),Ge.distancePointLine(l,p,h),Ge.distancePointLine(p,s,l),Ge.distancePointLine(h,s,l)):0},Ge.isPointInRing=function(s,l){return Ge.locatePointInRing(s,l)!==U.EXTERIOR},Ge.computeLength=function(s){var l=s.size();if(l<=1)return 0;var p=0,h=new R;s.getCoordinate(0,h);for(var y=h.x,_=h.y,E=1;E<l;E++){s.getCoordinate(E,h);var k=h.x,V=h.y,re=k-y,de=V-_;p+=Math.sqrt(re*re+de*de),y=k,_=V}return p},Ge.isCCW=function(s){var l=s.length-1;if(l<3)throw new A("Ring has fewer than 4 points, so orientation cannot be determined");for(var p=s[0],h=0,y=1;y<=l;y++){var _=s[y];_.y>p.y&&(p=_,h=y)}var E=h;do(E-=1)<0&&(E=l);while(s[E].equals2D(p)&&E!==h);var k=h;do k=(k+1)%l;while(s[k].equals2D(p)&&k!==h);var V=s[E],re=s[k];if(V.equals2D(p)||re.equals2D(p)||V.equals2D(re))return!1;var de=Ge.computeOrientation(V,p,re),xe=!1;return xe=de===0?V.x>re.x:de>0,xe},Ge.locatePointInRing=function(s,l){return Zn.locatePointInRing(s,l)},Ge.distancePointLinePerpendicular=function(s,l,p){var h=(p.x-l.x)*(p.x-l.x)+(p.y-l.y)*(p.y-l.y),y=((l.y-s.y)*(p.x-l.x)-(l.x-s.x)*(p.y-l.y))/h;return Math.abs(y)*Math.sqrt(h)},Ge.computeOrientation=function(s,l,p){return Ge.orientationIndex(s,l,p)},Ge.distancePointLine=function(){if(arguments.length===2){var s=arguments[0],l=arguments[1];if(l.length===0)throw new A("Line array must contain at least one vertex");for(var p=s.distance(l[0]),h=0;h<l.length-1;h++){var y=Ge.distancePointLine(s,l[h],l[h+1]);y<p&&(p=y)}return p}if(arguments.length===3){var _=arguments[0],E=arguments[1],k=arguments[2];if(E.x===k.x&&E.y===k.y)return _.distance(E);var V=(k.x-E.x)*(k.x-E.x)+(k.y-E.y)*(k.y-E.y),re=((_.x-E.x)*(k.x-E.x)+(_.y-E.y)*(k.y-E.y))/V;if(re<=0)return _.distance(E);if(re>=1)return _.distance(k);var de=((E.y-_.y)*(k.x-E.x)-(E.x-_.x)*(k.y-E.y))/V;return Math.abs(de)*Math.sqrt(V)}},Ge.isOnLine=function(s,l){for(var p=new Gi,h=1;h<l.length;h++){var y=l[h-1],_=l[h];if(p.computeIntersection(s,y,_),p.hasIntersection())return!0}return!1},aa.CLOCKWISE.get=function(){return-1},aa.RIGHT.get=function(){return Ge.CLOCKWISE},aa.COUNTERCLOCKWISE.get=function(){return 1},aa.LEFT.get=function(){return Ge.COUNTERCLOCKWISE},aa.COLLINEAR.get=function(){return 0},aa.STRAIGHT.get=function(){return Ge.COLLINEAR},Object.defineProperties(Ge,aa);var xs=o(function(){},"lt");xs.prototype.filter=function(s){},xs.prototype.interfaces_=function(){return[]},xs.prototype.getClass=function(){return xs};var ut=o(function(){var s=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=s,this._SRID=s.getSRID()},"ct"),To={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}};ut.prototype.isGeometryCollection=function(){return this.getSortIndex()===ut.SORTINDEX_GEOMETRYCOLLECTION},ut.prototype.getFactory=function(){return this._factory},ut.prototype.getGeometryN=function(s){return this},ut.prototype.getArea=function(){return 0},ut.prototype.isRectangle=function(){return!1},ut.prototype.equals=function(){if(arguments[0]instanceof ut){var s=arguments[0];return s!==null&&this.equalsTopo(s)}if(arguments[0]instanceof Object){var l=arguments[0];if(!(l instanceof ut))return!1;var p=l;return this.equalsExact(p)}},ut.prototype.equalsExact=function(s){return this===s||this.equalsExact(s,0)},ut.prototype.geometryChanged=function(){this.apply(ut.geometryChangedFilter)},ut.prototype.geometryChangedAction=function(){this._envelope=null},ut.prototype.equalsNorm=function(s){return s!==null&&this.norm().equalsExact(s.norm())},ut.prototype.getLength=function(){return 0},ut.prototype.getNumGeometries=function(){return 1},ut.prototype.compareTo=function(){if(arguments.length===1){var s=arguments[0],l=s;return this.getSortIndex()!==l.getSortIndex()?this.getSortIndex()-l.getSortIndex():this.isEmpty()&&l.isEmpty()?0:this.isEmpty()?-1:l.isEmpty()?1:this.compareToSameClass(s)}if(arguments.length===2){var p=arguments[0],h=arguments[1];return this.getSortIndex()!==p.getSortIndex()?this.getSortIndex()-p.getSortIndex():this.isEmpty()&&p.isEmpty()?0:this.isEmpty()?-1:p.isEmpty()?1:this.compareToSameClass(p,h)}},ut.prototype.getUserData=function(){return this._userData},ut.prototype.getSRID=function(){return this._SRID},ut.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ut.prototype.checkNotGeometryCollection=function(s){if(s.getSortIndex()===ut.SORTINDEX_GEOMETRYCOLLECTION)throw new A("This method does not support GeometryCollection arguments")},ut.prototype.equal=function(s,l,p){return p===0?s.equals(l):s.distance(l)<=p},ut.prototype.norm=function(){var s=this.copy();return s.normalize(),s},ut.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ut.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new ce(this._envelope)},ut.prototype.setSRID=function(s){this._SRID=s},ut.prototype.setUserData=function(s){this._userData=s},ut.prototype.compare=function(s,l){for(var p=s.iterator(),h=l.iterator();p.hasNext()&&h.hasNext();){var y=p.next(),_=h.next(),E=y.compareTo(_);if(E!==0)return E}return p.hasNext()?1:h.hasNext()?-1:0},ut.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ut.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ut.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ut.SORTINDEX_MULTIPOINT||this.getSortIndex()===ut.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ut.SORTINDEX_MULTIPOLYGON},ut.prototype.interfaces_=function(){return[H,B,t]},ut.prototype.getClass=function(){return ut},ut.hasNonEmptyElements=function(s){for(var l=0;l<s.length;l++)if(!s[l].isEmpty())return!0;return!1},ut.hasNullElements=function(s){for(var l=0;l<s.length;l++)if(s[l]===null)return!0;return!1},To.serialVersionUID.get=function(){return 8763622679187377e3},To.SORTINDEX_POINT.get=function(){return 0},To.SORTINDEX_MULTIPOINT.get=function(){return 1},To.SORTINDEX_LINESTRING.get=function(){return 2},To.SORTINDEX_LINEARRING.get=function(){return 3},To.SORTINDEX_MULTILINESTRING.get=function(){return 4},To.SORTINDEX_POLYGON.get=function(){return 5},To.SORTINDEX_MULTIPOLYGON.get=function(){return 6},To.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},To.geometryChangedFilter.get=function(){return Ca},Object.defineProperties(ut,To);var Ca=o(function(){},"ht");Ca.interfaces_=function(){return[xs]},Ca.filter=function(s){s.geometryChangedAction()};var Ht=o(function(){},"ft");Ht.prototype.filter=function(s){},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht};var ot=o(function(){},"gt"),qe={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}};ot.prototype.isInBoundary=function(s){},ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},qe.Mod2BoundaryNodeRule.get=function(){return It},qe.EndPointBoundaryNodeRule.get=function(){return Ct},qe.MultiValentEndPointBoundaryNodeRule.get=function(){return Nt},qe.MonoValentEndPointBoundaryNodeRule.get=function(){return Mt},qe.MOD2_BOUNDARY_RULE.get=function(){return new It},qe.ENDPOINT_BOUNDARY_RULE.get=function(){return new Ct},qe.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Nt},qe.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Mt},qe.OGC_SFS_BOUNDARY_RULE.get=function(){return ot.MOD2_BOUNDARY_RULE},Object.defineProperties(ot,qe);var It=o(function(){},"yt");It.prototype.isInBoundary=function(s){return s%2==1},It.prototype.interfaces_=function(){return[ot]},It.prototype.getClass=function(){return It};var Ct=o(function(){},"_t");Ct.prototype.isInBoundary=function(s){return s>0},Ct.prototype.interfaces_=function(){return[ot]},Ct.prototype.getClass=function(){return Ct};var Nt=o(function(){},"mt");Nt.prototype.isInBoundary=function(s){return s>1},Nt.prototype.interfaces_=function(){return[ot]},Nt.prototype.getClass=function(){return Nt};var Mt=o(function(){},"vt");Mt.prototype.isInBoundary=function(s){return s===1},Mt.prototype.interfaces_=function(){return[ot]},Mt.prototype.getClass=function(){return Mt};var Dt=o(function(){},"It");Dt.prototype.add=function(){},Dt.prototype.addAll=function(){},Dt.prototype.isEmpty=function(){},Dt.prototype.iterator=function(){},Dt.prototype.size=function(){},Dt.prototype.toArray=function(){},Dt.prototype.remove=function(){},(r.prototype=new Error).name="IndexOutOfBoundsException";var xi=o(function(){},"Et");xi.prototype.hasNext=function(){},xi.prototype.next=function(){},xi.prototype.remove=function(){};var Tn=function(s){function l(){s.apply(this,arguments)}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.get=function(){},l.prototype.set=function(){},l.prototype.isEmpty=function(){},l}(Dt);(n.prototype=new Error).name="NoSuchElementException";var Le=function(s){function l(){s.call(this),this.array_=[],arguments[0]instanceof Dt&&this.addAll(arguments[0])}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.ensureCapacity=function(){},l.prototype.interfaces_=function(){return[s,Dt]},l.prototype.add=function(p){return arguments.length===1?this.array_.push(p):this.array_.splice(arguments[0],arguments[1]),!0},l.prototype.clear=function(){this.array_=[]},l.prototype.addAll=function(p){for(var h=p.iterator();h.hasNext();)this.add(h.next());return!0},l.prototype.set=function(p,h){var y=this.array_[p];return this.array_[p]=h,y},l.prototype.iterator=function(){return new Q0(this)},l.prototype.get=function(p){if(p<0||p>=this.size())throw new r;return this.array_[p]},l.prototype.isEmpty=function(){return this.array_.length===0},l.prototype.size=function(){return this.array_.length},l.prototype.toArray=function(){for(var p=[],h=0,y=this.array_.length;h<y;h++)p.push(this.array_[h]);return p},l.prototype.remove=function(p){for(var h=!1,y=0,_=this.array_.length;y<_;y++)if(this.array_[y]===p){this.array_.splice(y,1),h=!0;break}return h},l}(Tn),Q0=function(s){function l(p){s.call(this),this.arrayList_=p,this.position_=0}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new n;return this.arrayList_.get(this.position_++)},l.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},l.prototype.set=function(p){return this.arrayList_.set(this.position_-1,p)},l.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},l}(xi),le=function(s){function l(){if(s.call(this),arguments.length!==0){if(arguments.length===1){var h=arguments[0];this.ensureCapacity(h.length),this.add(h,!0)}else if(arguments.length===2){var y=arguments[0],_=arguments[1];this.ensureCapacity(y.length),this.add(y,_)}}}o(l,"e"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={coordArrayType:{configurable:!0}};return p.coordArrayType.get=function(){return new Array(0).fill(null)},l.prototype.getCoordinate=function(h){return this.get(h)},l.prototype.addAll=function(){if(arguments.length===2){for(var h=arguments[0],y=arguments[1],_=!1,E=h.iterator();E.hasNext();)this.add(E.next(),y),_=!0;return _}return s.prototype.addAll.apply(this,arguments)},l.prototype.clone=function(){for(var h=s.prototype.clone.call(this),y=0;y<this.size();y++)h.add(y,this.get(y).copy());return h},l.prototype.toCoordinateArray=function(){return this.toArray(l.coordArrayType)},l.prototype.add=function(){if(arguments.length===1){var h=arguments[0];s.prototype.add.call(this,h)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var y=arguments[0],_=arguments[1];return this.add(y,_,!0),!0}if(arguments[0]instanceof R&&typeof arguments[1]=="boolean"){var E=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(E))return null;s.prototype.add.call(this,E)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var k=arguments[0],V=arguments[1];return this.add(k,V),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var re=arguments[0],de=arguments[1];if(arguments[2])for(var xe=0;xe<re.length;xe++)this.add(re[xe],de);else for(var Ve=re.length-1;Ve>=0;Ve--)this.add(re[Ve],de);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof R){var $e=arguments[0],Qe=arguments[1];if(!arguments[2]){var dt=this.size();if(dt>0&&($e>0&&this.get($e-1).equals2D(Qe)||$e<dt&&this.get($e).equals2D(Qe)))return null}s.prototype.add.call(this,$e,Qe)}}else if(arguments.length===4){var $r=arguments[0],fi=arguments[1],No=arguments[2],Yl=arguments[3],Xc=1;No>Yl&&(Xc=-1);for(var fw=No;fw!==Yl;fw+=Xc)this.add($r[fw],fi);return!0}},l.prototype.closeRing=function(){this.size()>0&&this.add(new R(this.get(0)),!1)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},Object.defineProperties(l,p),l}(Le),F=o(function(){},"Lt"),G={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};G.ForwardComparator.get=function(){return q},G.BidirectionalComparator.get=function(){return J},G.coordArrayType.get=function(){return new Array(0).fill(null)},F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.isRing=function(s){return!(s.length<4)&&!!s[0].equals2D(s[s.length-1])},F.ptNotInList=function(s,l){for(var p=0;p<s.length;p++){var h=s[p];if(F.indexOf(h,l)<0)return h}return null},F.scroll=function(s,l){var p=F.indexOf(l,s);if(p<0)return null;var h=new Array(s.length).fill(null);pt.arraycopy(s,p,h,0,s.length-p),pt.arraycopy(s,0,h,s.length-p,p),pt.arraycopy(h,0,s,0,s.length)},F.equals=function(){if(arguments.length===2){var s=arguments[0],l=arguments[1];if(s===l)return!0;if(s===null||l===null||s.length!==l.length)return!1;for(var p=0;p<s.length;p++)if(!s[p].equals(l[p]))return!1;return!0}if(arguments.length===3){var h=arguments[0],y=arguments[1],_=arguments[2];if(h===y)return!0;if(h===null||y===null||h.length!==y.length)return!1;for(var E=0;E<h.length;E++)if(_.compare(h[E],y[E])!==0)return!1;return!0}},F.intersection=function(s,l){for(var p=new le,h=0;h<s.length;h++)l.intersects(s[h])&&p.add(s[h],!0);return p.toCoordinateArray()},F.hasRepeatedPoints=function(s){for(var l=1;l<s.length;l++)if(s[l-1].equals(s[l]))return!0;return!1},F.removeRepeatedPoints=function(s){return F.hasRepeatedPoints(s)?new le(s,!1).toCoordinateArray():s},F.reverse=function(s){for(var l=s.length-1,p=Math.trunc(l/2),h=0;h<=p;h++){var y=s[h];s[h]=s[l-h],s[l-h]=y}},F.removeNull=function(s){for(var l=0,p=0;p<s.length;p++)s[p]!==null&&l++;var h=new Array(l).fill(null);if(l===0)return h;for(var y=0,_=0;_<s.length;_++)s[_]!==null&&(h[y++]=s[_]);return h},F.copyDeep=function(){if(arguments.length===1){for(var s=arguments[0],l=new Array(s.length).fill(null),p=0;p<s.length;p++)l[p]=new R(s[p]);return l}if(arguments.length===5)for(var h=arguments[0],y=arguments[1],_=arguments[2],E=arguments[3],k=arguments[4],V=0;V<k;V++)_[E+V]=new R(h[y+V])},F.isEqualReversed=function(s,l){for(var p=0;p<s.length;p++){var h=s[p],y=l[s.length-p-1];if(h.compareTo(y)!==0)return!1}return!0},F.envelope=function(s){for(var l=new ce,p=0;p<s.length;p++)l.expandToInclude(s[p]);return l},F.toCoordinateArray=function(s){return s.toArray(F.coordArrayType)},F.atLeastNCoordinatesOrNothing=function(s,l){return l.length>=s?l:[]},F.indexOf=function(s,l){for(var p=0;p<l.length;p++)if(s.equals(l[p]))return p;return-1},F.increasingDirection=function(s){for(var l=0;l<Math.trunc(s.length/2);l++){var p=s.length-1-l,h=s[l].compareTo(s[p]);if(h!==0)return h}return 1},F.compare=function(s,l){for(var p=0;p<s.length&&p<l.length;){var h=s[p].compareTo(l[p]);if(h!==0)return h;p++}return p<l.length?-1:p<s.length?1:0},F.minCoordinate=function(s){for(var l=null,p=0;p<s.length;p++)(l===null||l.compareTo(s[p])>0)&&(l=s[p]);return l},F.extract=function(s,l,p){l=fe.clamp(l,0,s.length);var h=(p=fe.clamp(p,-1,s.length))-l+1;p<0&&(h=0),l>=s.length&&(h=0),p<l&&(h=0);var y=new Array(h).fill(null);if(h===0)return y;for(var _=0,E=l;E<=p;E++)y[_++]=s[E];return y},Object.defineProperties(F,G);var q=o(function(){},"wt");q.prototype.compare=function(s,l){return F.compare(s,l)},q.prototype.interfaces_=function(){return[z]},q.prototype.getClass=function(){return q};var J=o(function(){},"Ot");J.prototype.compare=function(s,l){var p=s,h=l;if(p.length<h.length)return-1;if(p.length>h.length)return 1;if(p.length===0)return 0;var y=F.compare(p,h);return F.isEqualReversed(p,h)?0:y},J.prototype.OLDcompare=function(s,l){var p=s,h=l;if(p.length<h.length)return-1;if(p.length>h.length)return 1;if(p.length===0)return 0;for(var y=F.increasingDirection(p),_=F.increasingDirection(h),E=y>0?0:p.length-1,k=_>0?0:p.length-1,V=0;V<p.length;V++){var re=p[E].compareTo(h[k]);if(re!==0)return re;E+=y,k+=_}return 0},J.prototype.interfaces_=function(){return[z]},J.prototype.getClass=function(){return J};var K=o(function(){},"Tt");K.prototype.get=function(){},K.prototype.put=function(){},K.prototype.size=function(){},K.prototype.values=function(){},K.prototype.entrySet=function(){};var Ce=function(s){function l(){s.apply(this,arguments)}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l}(K);(i.prototype=new Error).name="OperationNotSupported",(a.prototype=new Dt).contains=function(){};var ye=function(s){function l(){s.call(this),this.array_=[],arguments[0]instanceof Dt&&this.addAll(arguments[0])}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.contains=function(p){for(var h=0,y=this.array_.length;h<y;h++)if(this.array_[h]===p)return!0;return!1},l.prototype.add=function(p){return!this.contains(p)&&(this.array_.push(p),!0)},l.prototype.addAll=function(p){for(var h=p.iterator();h.hasNext();)this.add(h.next());return!0},l.prototype.remove=function(p){throw new Error},l.prototype.size=function(){return this.array_.length},l.prototype.isEmpty=function(){return this.array_.length===0},l.prototype.toArray=function(){for(var p=[],h=0,y=this.array_.length;h<y;h++)p.push(this.array_[h]);return p},l.prototype.iterator=function(){return new De(this)},l}(a),De=function(s){function l(p){s.call(this),this.hashSet_=p,this.position_=0}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new n;return this.hashSet_.array_[this.position_++]},l.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},l.prototype.remove=function(){throw new i},l}(xi),we=0;(x.prototype=new Ce).get=function(s){for(var l=this.root_;l!==null;){var p=s.compareTo(l.key);if(p<0)l=l.left;else{if(!(p>0))return l.value;l=l.right}}return null},x.prototype.put=function(s,l){if(this.root_===null)return this.root_={key:s,value:l,left:null,right:null,parent:null,color:we,getValue:o(function(){return this.value},"getValue"),getKey:o(function(){return this.key},"getKey")},this.size_=1,null;var p,h,y=this.root_;do if(p=y,(h=s.compareTo(y.key))<0)y=y.left;else{if(!(h>0)){var _=y.value;return y.value=l,_}y=y.right}while(y!==null);var E={key:s,left:null,right:null,value:l,parent:p,color:we,getValue:o(function(){return this.value},"getValue"),getKey:o(function(){return this.key},"getKey")};return h<0?p.left=E:p.right=E,this.fixAfterInsertion(E),this.size_++,null},x.prototype.fixAfterInsertion=function(s){for(s.color=1;s!=null&&s!==this.root_&&s.parent.color===1;)if(c(s)===m(c(c(s)))){var l=v(c(c(s)));u(l)===1?(f(c(s),we),f(l,we),f(c(c(s)),1),s=c(c(s))):(s===v(c(s))&&(s=c(s),this.rotateLeft(s)),f(c(s),we),f(c(c(s)),1),this.rotateRight(c(c(s))))}else{var p=m(c(c(s)));u(p)===1?(f(c(s),we),f(p,we),f(c(c(s)),1),s=c(c(s))):(s===m(c(s))&&(s=c(s),this.rotateRight(s)),f(c(s),we),f(c(c(s)),1),this.rotateLeft(c(c(s))))}this.root_.color=we},x.prototype.values=function(){var s=new Le,l=this.getFirstEntry();if(l!==null)for(s.add(l.value);(l=x.successor(l))!==null;)s.add(l.value);return s},x.prototype.entrySet=function(){var s=new ye,l=this.getFirstEntry();if(l!==null)for(s.add(l);(l=x.successor(l))!==null;)s.add(l);return s},x.prototype.rotateLeft=function(s){if(s!=null){var l=s.right;s.right=l.left,l.left!=null&&(l.left.parent=s),l.parent=s.parent,s.parent===null?this.root_=l:s.parent.left===s?s.parent.left=l:s.parent.right=l,l.left=s,s.parent=l}},x.prototype.rotateRight=function(s){if(s!=null){var l=s.left;s.left=l.right,l.right!=null&&(l.right.parent=s),l.parent=s.parent,s.parent===null?this.root_=l:s.parent.right===s?s.parent.right=l:s.parent.left=l,l.right=s,s.parent=l}},x.prototype.getFirstEntry=function(){var s=this.root_;if(s!=null)for(;s.left!=null;)s=s.left;return s},x.successor=function(s){if(s===null)return null;if(s.right!==null){for(var l=s.right;l.left!==null;)l=l.left;return l}for(var p=s.parent,h=s;p!==null&&h===p.right;)h=p,p=p.parent;return p},x.prototype.size=function(){return this.size_};var Ze=o(function(){},"At");Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze},I.prototype=new a,(C.prototype=new I).contains=function(s){for(var l=0,p=this.array_.length;l<p;l++)if(this.array_[l].compareTo(s)===0)return!0;return!1},C.prototype.add=function(s){if(this.contains(s))return!1;for(var l=0,p=this.array_.length;l<p;l++)if(this.array_[l].compareTo(s)===1)return this.array_.splice(l,0,s),!0;return this.array_.push(s),!0},C.prototype.addAll=function(s){for(var l=s.iterator();l.hasNext();)this.add(l.next());return!0},C.prototype.remove=function(s){throw new i},C.prototype.size=function(){return this.array_.length},C.prototype.isEmpty=function(){return this.array_.length===0},C.prototype.toArray=function(){for(var s=[],l=0,p=this.array_.length;l<p;l++)s.push(this.array_[l]);return s},C.prototype.iterator=function(){return new ge(this)};var ge=o(function(s){this.treeSet_=s,this.position_=0},"Ft");ge.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new n;return this.treeSet_.array_[this.position_++]},ge.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},ge.prototype.remove=function(){throw new i};var Ae=o(function(){},"Gt");Ae.sort=function(){var s,l,p,h,y=arguments[0];if(arguments.length===1)h=o(function(E,k){return E.compareTo(k)},"i"),y.sort(h);else if(arguments.length===2)p=arguments[1],h=o(function(E,k){return p.compare(E,k)},"i"),y.sort(h);else if(arguments.length===3){(l=y.slice(arguments[1],arguments[2])).sort();var _=y.slice(0,arguments[1]).concat(l,y.slice(arguments[2],y.length));for(y.splice(0,y.length),s=0;s<_.length;s++)y.push(_[s])}else if(arguments.length===4)for(l=y.slice(arguments[1],arguments[2]),p=arguments[3],h=o(function(E,k){return p.compare(E,k)},"i"),l.sort(h),_=y.slice(0,arguments[1]).concat(l,y.slice(arguments[2],y.length)),y.splice(0,y.length),s=0;s<_.length;s++)y.push(_[s])},Ae.asList=function(s){for(var l=new Le,p=0,h=s.length;p<h;p++)l.add(s[p]);return l};var Oe=o(function(){},"qt"),ht={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}};ht.P.get=function(){return 0},ht.L.get=function(){return 1},ht.A.get=function(){return 2},ht.FALSE.get=function(){return-1},ht.TRUE.get=function(){return-2},ht.DONTCARE.get=function(){return-3},ht.SYM_FALSE.get=function(){return"F"},ht.SYM_TRUE.get=function(){return"T"},ht.SYM_DONTCARE.get=function(){return"*"},ht.SYM_P.get=function(){return"0"},ht.SYM_L.get=function(){return"1"},ht.SYM_A.get=function(){return"2"},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.toDimensionSymbol=function(s){switch(s){case Oe.FALSE:return Oe.SYM_FALSE;case Oe.TRUE:return Oe.SYM_TRUE;case Oe.DONTCARE:return Oe.SYM_DONTCARE;case Oe.P:return Oe.SYM_P;case Oe.L:return Oe.SYM_L;case Oe.A:return Oe.SYM_A}throw new A("Unknown dimension value: "+s)},Oe.toDimensionValue=function(s){switch(he.toUpperCase(s)){case Oe.SYM_FALSE:return Oe.FALSE;case Oe.SYM_TRUE:return Oe.TRUE;case Oe.SYM_DONTCARE:return Oe.DONTCARE;case Oe.SYM_P:return Oe.P;case Oe.SYM_L:return Oe.L;case Oe.SYM_A:return Oe.A}throw new A("Unknown dimension symbol: "+s)},Object.defineProperties(Oe,ht);var ft=o(function(){},"Vt");ft.prototype.filter=function(s){},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft};var At=o(function(){},"Ut");At.prototype.filter=function(s,l){},At.prototype.isDone=function(){},At.prototype.isGeometryChanged=function(){},At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At};var mt=function(s){function l(h,y){if(s.call(this,y),this._geometries=h||[],s.hasNullElements(this._geometries))throw new A("geometries must not contain null elements")}o(l,"e"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={serialVersionUID:{configurable:!0}};return l.prototype.computeEnvelopeInternal=function(){for(var h=new ce,y=0;y<this._geometries.length;y++)h.expandToInclude(this._geometries[y].getEnvelopeInternal());return h},l.prototype.getGeometryN=function(h){return this._geometries[h]},l.prototype.getSortIndex=function(){return s.SORTINDEX_GEOMETRYCOLLECTION},l.prototype.getCoordinates=function(){for(var h=new Array(this.getNumPoints()).fill(null),y=-1,_=0;_<this._geometries.length;_++)for(var E=this._geometries[_].getCoordinates(),k=0;k<E.length;k++)h[++y]=E[k];return h},l.prototype.getArea=function(){for(var h=0,y=0;y<this._geometries.length;y++)h+=this._geometries[y].getArea();return h},l.prototype.equalsExact=function(){if(arguments.length===2){var h=arguments[0],y=arguments[1];if(!this.isEquivalentClass(h))return!1;var _=h;if(this._geometries.length!==_._geometries.length)return!1;for(var E=0;E<this._geometries.length;E++)if(!this._geometries[E].equalsExact(_._geometries[E],y))return!1;return!0}return s.prototype.equalsExact.apply(this,arguments)},l.prototype.normalize=function(){for(var h=0;h<this._geometries.length;h++)this._geometries[h].normalize();Ae.sort(this._geometries)},l.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},l.prototype.getBoundaryDimension=function(){for(var h=Oe.FALSE,y=0;y<this._geometries.length;y++)h=Math.max(h,this._geometries[y].getBoundaryDimension());return h},l.prototype.getDimension=function(){for(var h=Oe.FALSE,y=0;y<this._geometries.length;y++)h=Math.max(h,this._geometries[y].getDimension());return h},l.prototype.getLength=function(){for(var h=0,y=0;y<this._geometries.length;y++)h+=this._geometries[y].getLength();return h},l.prototype.getNumPoints=function(){for(var h=0,y=0;y<this._geometries.length;y++)h+=this._geometries[y].getNumPoints();return h},l.prototype.getNumGeometries=function(){return this._geometries.length},l.prototype.reverse=function(){for(var h=this._geometries.length,y=new Array(h).fill(null),_=0;_<this._geometries.length;_++)y[_]=this._geometries[_].reverse();return this.getFactory().createGeometryCollection(y)},l.prototype.compareToSameClass=function(){if(arguments.length===1){var h=arguments[0],y=new C(Ae.asList(this._geometries)),_=new C(Ae.asList(h._geometries));return this.compare(y,_)}if(arguments.length===2){for(var E=arguments[0],k=arguments[1],V=E,re=this.getNumGeometries(),de=V.getNumGeometries(),xe=0;xe<re&&xe<de;){var Ve=this.getGeometryN(xe),$e=V.getGeometryN(xe),Qe=Ve.compareToSameClass($e,k);if(Qe!==0)return Qe;xe++}return xe<re?1:xe<de?-1:0}},l.prototype.apply=function(){if(oe(arguments[0],Ht))for(var h=arguments[0],y=0;y<this._geometries.length;y++)this._geometries[y].apply(h);else if(oe(arguments[0],At)){var _=arguments[0];if(this._geometries.length===0)return null;for(var E=0;E<this._geometries.length&&(this._geometries[E].apply(_),!_.isDone());E++);_.isGeometryChanged()&&this.geometryChanged()}else if(oe(arguments[0],ft)){var k=arguments[0];k.filter(this);for(var V=0;V<this._geometries.length;V++)this._geometries[V].apply(k)}else if(oe(arguments[0],xs)){var re=arguments[0];re.filter(this);for(var de=0;de<this._geometries.length;de++)this._geometries[de].apply(re)}},l.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Xe.shouldNeverReachHere(),null},l.prototype.clone=function(){var h=s.prototype.clone.call(this);h._geometries=new Array(this._geometries.length).fill(null);for(var y=0;y<this._geometries.length;y++)h._geometries[y]=this._geometries[y].clone();return h},l.prototype.getGeometryType=function(){return"GeometryCollection"},l.prototype.copy=function(){for(var h=new Array(this._geometries.length).fill(null),y=0;y<h.length;y++)h[y]=this._geometries[y].copy();return new l(h,this._factory)},l.prototype.isEmpty=function(){for(var h=0;h<this._geometries.length;h++)if(!this._geometries[h].isEmpty())return!1;return!0},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},p.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(l,p),l}(ut),on=function(s){function l(){s.apply(this,arguments)}o(l,"e"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={serialVersionUID:{configurable:!0}};return l.prototype.getSortIndex=function(){return ut.SORTINDEX_MULTILINESTRING},l.prototype.equalsExact=function(){if(arguments.length===2){var h=arguments[0],y=arguments[1];return!!this.isEquivalentClass(h)&&s.prototype.equalsExact.call(this,h,y)}return s.prototype.equalsExact.apply(this,arguments)},l.prototype.getBoundaryDimension=function(){return this.isClosed()?Oe.FALSE:0},l.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var h=0;h<this._geometries.length;h++)if(!this._geometries[h].isClosed())return!1;return!0},l.prototype.getDimension=function(){return 1},l.prototype.reverse=function(){for(var h=this._geometries.length,y=new Array(h).fill(null),_=0;_<this._geometries.length;_++)y[h-1-_]=this._geometries[_].reverse();return this.getFactory().createMultiLineString(y)},l.prototype.getBoundary=function(){return new fn(this).getBoundary()},l.prototype.getGeometryType=function(){return"MultiLineString"},l.prototype.copy=function(){for(var h=new Array(this._geometries.length).fill(null),y=0;y<h.length;y++)h[y]=this._geometries[y].copy();return new l(h,this._factory)},l.prototype.interfaces_=function(){return[Ze]},l.prototype.getClass=function(){return l},p.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(l,p),l}(mt),fn=o(function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var s=arguments[0],l=ot.MOD2_BOUNDARY_RULE;this._geom=s,this._geomFact=s.getFactory(),this._bnRule=l}else if(arguments.length===2){var p=arguments[0],h=arguments[1];this._geom=p,this._geomFact=p.getFactory(),this._bnRule=h}},"Yt");fn.prototype.boundaryMultiLineString=function(s){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var l=this.computeBoundaryCoordinates(s);return l.length===1?this._geomFact.createPoint(l[0]):this._geomFact.createMultiPointFromCoords(l)},fn.prototype.getBoundary=function(){return this._geom instanceof Ut?this.boundaryLineString(this._geom):this._geom instanceof on?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},fn.prototype.boundaryLineString=function(s){return this._geom.isEmpty()?this.getEmptyMultiPoint():s.isClosed()?this._bnRule.isInBoundary(2)?s.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([s.getStartPoint(),s.getEndPoint()])},fn.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},fn.prototype.computeBoundaryCoordinates=function(s){var l=new Le;this._endpointMap=new x;for(var p=0;p<s.getNumGeometries();p++){var h=s.getGeometryN(p);h.getNumPoints()!==0&&(this.addEndpoint(h.getCoordinateN(0)),this.addEndpoint(h.getCoordinateN(h.getNumPoints()-1)))}for(var y=this._endpointMap.entrySet().iterator();y.hasNext();){var _=y.next(),E=_.getValue().count;this._bnRule.isInBoundary(E)&&l.add(_.getKey())}return F.toCoordinateArray(l)},fn.prototype.addEndpoint=function(s){var l=this._endpointMap.get(s);l===null&&(l=new Kn,this._endpointMap.put(s,l)),l.count++},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn},fn.getBoundary=function(){if(arguments.length===1){var s=arguments[0];return new fn(s).getBoundary()}if(arguments.length===2){var l=arguments[0],p=arguments[1];return new fn(l,p).getBoundary()}};var Kn=o(function(){this.count=null},"kt");Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var dn=o(function(){},"jt"),Xi={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn},dn.chars=function(s,l){for(var p=new Array(l).fill(null),h=0;h<l;h++)p[h]=s;return String(p)},dn.getStackTrace=function(){if(arguments.length===1){var s=arguments[0],l=new function(){},p=new function(){}(l);return s.printStackTrace(p),l.toString()}if(arguments.length===2){for(var h=arguments[0],y=arguments[1],_="",E=new function(){}(new function(){}(dn.getStackTrace(h))),k=0;k<y;k++)try{_+=E.readLine()+dn.NEWLINE}catch(V){if(!(V instanceof T))throw V;Xe.shouldNeverReachHere()}return _}},dn.split=function(s,l){for(var p=l.length,h=new Le,y=""+s,_=y.indexOf(l);_>=0;){var E=y.substring(0,_);h.add(E),_=(y=y.substring(_+p)).indexOf(l)}y.length>0&&h.add(y);for(var k=new Array(h.size()).fill(null),V=0;V<k.length;V++)k[V]=h.get(V);return k},dn.toString=function(){if(arguments.length===1){var s=arguments[0];return dn.SIMPLE_ORDINATE_FORMAT.format(s)}},dn.spaces=function(s){return dn.chars(" ",s)},Xi.NEWLINE.get=function(){return pt.getProperty("line.separator")},Xi.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(dn,Xi);var Yt=o(function(){},"Wt");Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.copyCoord=function(s,l,p,h){for(var y=Math.min(s.getDimension(),p.getDimension()),_=0;_<y;_++)p.setOrdinate(h,_,s.getOrdinate(l,_))},Yt.isRing=function(s){var l=s.size();return l===0||!(l<=3)&&s.getOrdinate(0,Ee.X)===s.getOrdinate(l-1,Ee.X)&&s.getOrdinate(0,Ee.Y)===s.getOrdinate(l-1,Ee.Y)},Yt.isEqual=function(s,l){var p=s.size();if(p!==l.size())return!1;for(var h=Math.min(s.getDimension(),l.getDimension()),y=0;y<p;y++)for(var _=0;_<h;_++){var E=s.getOrdinate(y,_),k=l.getOrdinate(y,_);if(s.getOrdinate(y,_)!==l.getOrdinate(y,_)&&(!M.isNaN(E)||!M.isNaN(k)))return!1}return!0},Yt.extend=function(s,l,p){var h=s.create(p,l.getDimension()),y=l.size();if(Yt.copy(l,0,h,0,y),y>0)for(var _=y;_<p;_++)Yt.copy(l,y-1,h,_,1);return h},Yt.reverse=function(s){for(var l=s.size()-1,p=Math.trunc(l/2),h=0;h<=p;h++)Yt.swap(s,h,l-h)},Yt.swap=function(s,l,p){if(l===p)return null;for(var h=0;h<s.getDimension();h++){var y=s.getOrdinate(l,h);s.setOrdinate(l,h,s.getOrdinate(p,h)),s.setOrdinate(p,h,y)}},Yt.copy=function(s,l,p,h,y){for(var _=0;_<y;_++)Yt.copyCoord(s,l+_,p,h+_)},Yt.toString=function(){if(arguments.length===1){var s=arguments[0],l=s.size();if(l===0)return"()";var p=s.getDimension(),h=new ve;h.append("(");for(var y=0;y<l;y++){y>0&&h.append(" ");for(var _=0;_<p;_++)_>0&&h.append(","),h.append(dn.toString(s.getOrdinate(y,_)))}return h.append(")"),h.toString()}},Yt.ensureValidRing=function(s,l){var p=l.size();return p===0?l:p<=3?Yt.createClosedRing(s,l,4):l.getOrdinate(0,Ee.X)===l.getOrdinate(p-1,Ee.X)&&l.getOrdinate(0,Ee.Y)===l.getOrdinate(p-1,Ee.Y)?l:Yt.createClosedRing(s,l,p+1)},Yt.createClosedRing=function(s,l,p){var h=s.create(p,l.getDimension()),y=l.size();Yt.copy(l,0,h,0,y);for(var _=y;_<p;_++)Yt.copy(l,0,h,_,1);return h};var Ut=function(s){function l(h,y){s.call(this,y),this._points=null,this.init(h)}o(l,"e"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={serialVersionUID:{configurable:!0}};return l.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new ce:this._points.expandEnvelope(new ce)},l.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},l.prototype.getSortIndex=function(){return s.SORTINDEX_LINESTRING},l.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},l.prototype.equalsExact=function(){if(arguments.length===2){var h=arguments[0],y=arguments[1];if(!this.isEquivalentClass(h))return!1;var _=h;if(this._points.size()!==_._points.size())return!1;for(var E=0;E<this._points.size();E++)if(!this.equal(this._points.getCoordinate(E),_._points.getCoordinate(E),y))return!1;return!0}return s.prototype.equalsExact.apply(this,arguments)},l.prototype.normalize=function(){for(var h=0;h<Math.trunc(this._points.size()/2);h++){var y=this._points.size()-1-h;if(!this._points.getCoordinate(h).equals(this._points.getCoordinate(y)))return this._points.getCoordinate(h).compareTo(this._points.getCoordinate(y))>0&&Yt.reverse(this._points),null}},l.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},l.prototype.getBoundaryDimension=function(){return this.isClosed()?Oe.FALSE:0},l.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},l.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},l.prototype.getDimension=function(){return 1},l.prototype.getLength=function(){return Ge.computeLength(this._points)},l.prototype.getNumPoints=function(){return this._points.size()},l.prototype.reverse=function(){var h=this._points.copy();return Yt.reverse(h),this.getFactory().createLineString(h)},l.prototype.compareToSameClass=function(){if(arguments.length===1){for(var h=arguments[0],y=0,_=0;y<this._points.size()&&_<h._points.size();){var E=this._points.getCoordinate(y).compareTo(h._points.getCoordinate(_));if(E!==0)return E;y++,_++}return y<this._points.size()?1:_<h._points.size()?-1:0}if(arguments.length===2){var k=arguments[0];return arguments[1].compare(this._points,k._points)}},l.prototype.apply=function(){if(oe(arguments[0],Ht))for(var h=arguments[0],y=0;y<this._points.size();y++)h.filter(this._points.getCoordinate(y));else if(oe(arguments[0],At)){var _=arguments[0];if(this._points.size()===0)return null;for(var E=0;E<this._points.size()&&(_.filter(this._points,E),!_.isDone());E++);_.isGeometryChanged()&&this.geometryChanged()}else oe(arguments[0],ft)?arguments[0].filter(this):oe(arguments[0],xs)&&arguments[0].filter(this)},l.prototype.getBoundary=function(){return new fn(this).getBoundary()},l.prototype.isEquivalentClass=function(h){return h instanceof l},l.prototype.clone=function(){var h=s.prototype.clone.call(this);return h._points=this._points.clone(),h},l.prototype.getCoordinateN=function(h){return this._points.getCoordinate(h)},l.prototype.getGeometryType=function(){return"LineString"},l.prototype.copy=function(){return new l(this._points.copy(),this._factory)},l.prototype.getCoordinateSequence=function(){return this._points},l.prototype.isEmpty=function(){return this._points.size()===0},l.prototype.init=function(h){if(h===null&&(h=this.getFactory().getCoordinateSequenceFactory().create([])),h.size()===1)throw new A("Invalid number of points in LineString (found "+h.size()+" - must be 0 or >= 2)");this._points=h},l.prototype.isCoordinate=function(h){for(var y=0;y<this._points.size();y++)if(this._points.getCoordinate(y).equals(h))return!0;return!1},l.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},l.prototype.getPointN=function(h){return this.getFactory().createPoint(this._points.getCoordinate(h))},l.prototype.interfaces_=function(){return[Ze]},l.prototype.getClass=function(){return l},p.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(l,p),l}(ut),Jo=o(function(){},"Jt");Jo.prototype.interfaces_=function(){return[]},Jo.prototype.getClass=function(){return Jo};var En=function(s){function l(h,y){s.call(this,y),this._coordinates=h||null,this.init(this._coordinates)}o(l,"e"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={serialVersionUID:{configurable:!0}};return l.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new ce;var h=new ce;return h.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),h},l.prototype.getSortIndex=function(){return s.SORTINDEX_POINT},l.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},l.prototype.equalsExact=function(){if(arguments.length===2){var h=arguments[0],y=arguments[1];return!!this.isEquivalentClass(h)&&(!(!this.isEmpty()||!h.isEmpty())||this.isEmpty()===h.isEmpty()&&this.equal(h.getCoordinate(),this.getCoordinate(),y))}return s.prototype.equalsExact.apply(this,arguments)},l.prototype.normalize=function(){},l.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},l.prototype.getBoundaryDimension=function(){return Oe.FALSE},l.prototype.getDimension=function(){return 0},l.prototype.getNumPoints=function(){return this.isEmpty()?0:1},l.prototype.reverse=function(){return this.copy()},l.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},l.prototype.compareToSameClass=function(){if(arguments.length===1){var h=arguments[0];return this.getCoordinate().compareTo(h.getCoordinate())}if(arguments.length===2){var y=arguments[0];return arguments[1].compare(this._coordinates,y._coordinates)}},l.prototype.apply=function(){if(oe(arguments[0],Ht)){var h=arguments[0];if(this.isEmpty())return null;h.filter(this.getCoordinate())}else if(oe(arguments[0],At)){var y=arguments[0];if(this.isEmpty())return null;y.filter(this._coordinates,0),y.isGeometryChanged()&&this.geometryChanged()}else oe(arguments[0],ft)?arguments[0].filter(this):oe(arguments[0],xs)&&arguments[0].filter(this)},l.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},l.prototype.clone=function(){var h=s.prototype.clone.call(this);return h._coordinates=this._coordinates.clone(),h},l.prototype.getGeometryType=function(){return"Point"},l.prototype.copy=function(){return new l(this._coordinates.copy(),this._factory)},l.prototype.getCoordinateSequence=function(){return this._coordinates},l.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},l.prototype.isEmpty=function(){return this._coordinates.size()===0},l.prototype.init=function(h){h===null&&(h=this.getFactory().getCoordinateSequenceFactory().create([])),Xe.isTrue(h.size()<=1),this._coordinates=h},l.prototype.isSimple=function(){return!0},l.prototype.interfaces_=function(){return[Jo]},l.prototype.getClass=function(){return l},p.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(l,p),l}(ut),ji=o(function(){},"Zt");ji.prototype.interfaces_=function(){return[]},ji.prototype.getClass=function(){return ji};var Vr=function(s){function l(h,y,_){if(s.call(this,_),this._shell=null,this._holes=null,h===null&&(h=this.getFactory().createLinearRing()),y===null&&(y=[]),s.hasNullElements(y))throw new A("holes must not contain null elements");if(h.isEmpty()&&s.hasNonEmptyElements(y))throw new A("shell is empty but holes are not");this._shell=h,this._holes=y}o(l,"e"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={serialVersionUID:{configurable:!0}};return l.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},l.prototype.getSortIndex=function(){return s.SORTINDEX_POLYGON},l.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var h=new Array(this.getNumPoints()).fill(null),y=-1,_=this._shell.getCoordinates(),E=0;E<_.length;E++)h[++y]=_[E];for(var k=0;k<this._holes.length;k++)for(var V=this._holes[k].getCoordinates(),re=0;re<V.length;re++)h[++y]=V[re];return h},l.prototype.getArea=function(){var h=0;h+=Math.abs(Ge.signedArea(this._shell.getCoordinateSequence()));for(var y=0;y<this._holes.length;y++)h-=Math.abs(Ge.signedArea(this._holes[y].getCoordinateSequence()));return h},l.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var h=this._shell.getCoordinateSequence(),y=this.getEnvelopeInternal(),_=0;_<5;_++){var E=h.getX(_);if(E!==y.getMinX()&&E!==y.getMaxX())return!1;var k=h.getY(_);if(k!==y.getMinY()&&k!==y.getMaxY())return!1}for(var V=h.getX(0),re=h.getY(0),de=1;de<=4;de++){var xe=h.getX(de),Ve=h.getY(de);if(xe!==V==(Ve!==re))return!1;V=xe,re=Ve}return!0},l.prototype.equalsExact=function(){if(arguments.length===2){var h=arguments[0],y=arguments[1];if(!this.isEquivalentClass(h))return!1;var _=h,E=this._shell,k=_._shell;if(!E.equalsExact(k,y)||this._holes.length!==_._holes.length)return!1;for(var V=0;V<this._holes.length;V++)if(!this._holes[V].equalsExact(_._holes[V],y))return!1;return!0}return s.prototype.equalsExact.apply(this,arguments)},l.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var h=0;h<this._holes.length;h++)this.normalize(this._holes[h],!1);Ae.sort(this._holes)}else if(arguments.length===2){var y=arguments[0],_=arguments[1];if(y.isEmpty())return null;var E=new Array(y.getCoordinates().length-1).fill(null);pt.arraycopy(y.getCoordinates(),0,E,0,E.length);var k=F.minCoordinate(y.getCoordinates());F.scroll(E,k),pt.arraycopy(E,0,y.getCoordinates(),0,E.length),y.getCoordinates()[E.length]=E[0],Ge.isCCW(y.getCoordinates())===_&&F.reverse(y.getCoordinates())}},l.prototype.getCoordinate=function(){return this._shell.getCoordinate()},l.prototype.getNumInteriorRing=function(){return this._holes.length},l.prototype.getBoundaryDimension=function(){return 1},l.prototype.getDimension=function(){return 2},l.prototype.getLength=function(){var h=0;h+=this._shell.getLength();for(var y=0;y<this._holes.length;y++)h+=this._holes[y].getLength();return h},l.prototype.getNumPoints=function(){for(var h=this._shell.getNumPoints(),y=0;y<this._holes.length;y++)h+=this._holes[y].getNumPoints();return h},l.prototype.reverse=function(){var h=this.copy();h._shell=this._shell.copy().reverse(),h._holes=new Array(this._holes.length).fill(null);for(var y=0;y<this._holes.length;y++)h._holes[y]=this._holes[y].copy().reverse();return h},l.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},l.prototype.compareToSameClass=function(){if(arguments.length===1){var h=arguments[0],y=this._shell,_=h._shell;return y.compareToSameClass(_)}if(arguments.length===2){var E=arguments[0],k=arguments[1],V=E,re=this._shell,de=V._shell,xe=re.compareToSameClass(de,k);if(xe!==0)return xe;for(var Ve=this.getNumInteriorRing(),$e=V.getNumInteriorRing(),Qe=0;Qe<Ve&&Qe<$e;){var dt=this.getInteriorRingN(Qe),$r=V.getInteriorRingN(Qe),fi=dt.compareToSameClass($r,k);if(fi!==0)return fi;Qe++}return Qe<Ve?1:Qe<$e?-1:0}},l.prototype.apply=function(h){if(oe(h,Ht)){this._shell.apply(h);for(var y=0;y<this._holes.length;y++)this._holes[y].apply(h)}else if(oe(h,At)){if(this._shell.apply(h),!h.isDone())for(var _=0;_<this._holes.length&&(this._holes[_].apply(h),!h.isDone());_++);h.isGeometryChanged()&&this.geometryChanged()}else if(oe(h,ft))h.filter(this);else if(oe(h,xs)){h.filter(this),this._shell.apply(h);for(var E=0;E<this._holes.length;E++)this._holes[E].apply(h)}},l.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var h=new Array(this._holes.length+1).fill(null);h[0]=this._shell;for(var y=0;y<this._holes.length;y++)h[y+1]=this._holes[y];return h.length<=1?this.getFactory().createLinearRing(h[0].getCoordinateSequence()):this.getFactory().createMultiLineString(h)},l.prototype.clone=function(){var h=s.prototype.clone.call(this);h._shell=this._shell.clone(),h._holes=new Array(this._holes.length).fill(null);for(var y=0;y<this._holes.length;y++)h._holes[y]=this._holes[y].clone();return h},l.prototype.getGeometryType=function(){return"Polygon"},l.prototype.copy=function(){for(var h=this._shell.copy(),y=new Array(this._holes.length).fill(null),_=0;_<y.length;_++)y[_]=this._holes[_].copy();return new l(h,y,this._factory)},l.prototype.getExteriorRing=function(){return this._shell},l.prototype.isEmpty=function(){return this._shell.isEmpty()},l.prototype.getInteriorRingN=function(h){return this._holes[h]},l.prototype.interfaces_=function(){return[ji]},l.prototype.getClass=function(){return l},p.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(l,p),l}(ut),bs=function(s){function l(){s.apply(this,arguments)}o(l,"e"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={serialVersionUID:{configurable:!0}};return l.prototype.getSortIndex=function(){return ut.SORTINDEX_MULTIPOINT},l.prototype.isValid=function(){return!0},l.prototype.equalsExact=function(){if(arguments.length===2){var h=arguments[0],y=arguments[1];return!!this.isEquivalentClass(h)&&s.prototype.equalsExact.call(this,h,y)}return s.prototype.equalsExact.apply(this,arguments)},l.prototype.getCoordinate=function(){if(arguments.length===1){var h=arguments[0];return this._geometries[h].getCoordinate()}return s.prototype.getCoordinate.apply(this,arguments)},l.prototype.getBoundaryDimension=function(){return Oe.FALSE},l.prototype.getDimension=function(){return 0},l.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},l.prototype.getGeometryType=function(){return"MultiPoint"},l.prototype.copy=function(){for(var h=new Array(this._geometries.length).fill(null),y=0;y<h.length;y++)h[y]=this._geometries[y].copy();return new l(h,this._factory)},l.prototype.interfaces_=function(){return[Jo]},l.prototype.getClass=function(){return l},p.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(l,p),l}(mt),Qo=function(s){function l(h,y){h instanceof R&&y instanceof jt&&(h=y.getCoordinateSequenceFactory().create(h)),s.call(this,h,y),this.validateConstruction()}o(l,"e"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return l.prototype.getSortIndex=function(){return ut.SORTINDEX_LINEARRING},l.prototype.getBoundaryDimension=function(){return Oe.FALSE},l.prototype.isClosed=function(){return!!this.isEmpty()||s.prototype.isClosed.call(this)},l.prototype.reverse=function(){var h=this._points.copy();return Yt.reverse(h),this.getFactory().createLinearRing(h)},l.prototype.validateConstruction=function(){if(!this.isEmpty()&&!s.prototype.isClosed.call(this))throw new A("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<l.MINIMUM_VALID_SIZE)throw new A("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},l.prototype.getGeometryType=function(){return"LinearRing"},l.prototype.copy=function(){return new l(this._points.copy(),this._factory)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},p.MINIMUM_VALID_SIZE.get=function(){return 4},p.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(l,p),l}(Ut),wa=function(s){function l(){s.apply(this,arguments)}o(l,"e"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={serialVersionUID:{configurable:!0}};return l.prototype.getSortIndex=function(){return ut.SORTINDEX_MULTIPOLYGON},l.prototype.equalsExact=function(){if(arguments.length===2){var h=arguments[0],y=arguments[1];return!!this.isEquivalentClass(h)&&s.prototype.equalsExact.call(this,h,y)}return s.prototype.equalsExact.apply(this,arguments)},l.prototype.getBoundaryDimension=function(){return 1},l.prototype.getDimension=function(){return 2},l.prototype.reverse=function(){for(var h=this._geometries.length,y=new Array(h).fill(null),_=0;_<this._geometries.length;_++)y[_]=this._geometries[_].reverse();return this.getFactory().createMultiPolygon(y)},l.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var h=new Le,y=0;y<this._geometries.length;y++)for(var _=this._geometries[y].getBoundary(),E=0;E<_.getNumGeometries();E++)h.add(_.getGeometryN(E));var k=new Array(h.size()).fill(null);return this.getFactory().createMultiLineString(h.toArray(k))},l.prototype.getGeometryType=function(){return"MultiPolygon"},l.prototype.copy=function(){for(var h=new Array(this._geometries.length).fill(null),y=0;y<h.length;y++)h[y]=this._geometries[y].copy();return new l(h,this._factory)},l.prototype.interfaces_=function(){return[ji]},l.prototype.getClass=function(){return l},p.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(l,p),l}(mt),Is=o(function(s){this._factory=s||null,this._isUserDataCopied=!1},"ie"),Zm={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Is.prototype.setCopyUserData=function(s){this._isUserDataCopied=s},Is.prototype.edit=function(s,l){if(s===null)return null;var p=this.editInternal(s,l);return this._isUserDataCopied&&p.setUserData(s.getUserData()),p},Is.prototype.editInternal=function(s,l){return this._factory===null&&(this._factory=s.getFactory()),s instanceof mt?this.editGeometryCollection(s,l):s instanceof Vr?this.editPolygon(s,l):s instanceof En?l.edit(s,this._factory):s instanceof Ut?l.edit(s,this._factory):(Xe.shouldNeverReachHere("Unsupported Geometry class: "+s.getClass().getName()),null)},Is.prototype.editGeometryCollection=function(s,l){for(var p=l.edit(s,this._factory),h=new Le,y=0;y<p.getNumGeometries();y++){var _=this.edit(p.getGeometryN(y),l);_===null||_.isEmpty()||h.add(_)}return p.getClass()===bs?this._factory.createMultiPoint(h.toArray([])):p.getClass()===on?this._factory.createMultiLineString(h.toArray([])):p.getClass()===wa?this._factory.createMultiPolygon(h.toArray([])):this._factory.createGeometryCollection(h.toArray([]))},Is.prototype.editPolygon=function(s,l){var p=l.edit(s,this._factory);if(p===null&&(p=this._factory.createPolygon(null)),p.isEmpty())return p;var h=this.edit(p.getExteriorRing(),l);if(h===null||h.isEmpty())return this._factory.createPolygon();for(var y=new Le,_=0;_<p.getNumInteriorRing();_++){var E=this.edit(p.getInteriorRingN(_),l);E===null||E.isEmpty()||y.add(E)}return this._factory.createPolygon(h,y.toArray([]))},Is.prototype.interfaces_=function(){return[]},Is.prototype.getClass=function(){return Is},Is.GeometryEditorOperation=function(){},Zm.NoOpGeometryOperation.get=function(){return e1},Zm.CoordinateOperation.get=function(){return t1},Zm.CoordinateSequenceOperation.get=function(){return r1},Object.defineProperties(Is,Zm);var e1=o(function(){},"oe");e1.prototype.edit=function(s,l){return s},e1.prototype.interfaces_=function(){return[Is.GeometryEditorOperation]},e1.prototype.getClass=function(){return e1};var t1=o(function(){},"se");t1.prototype.edit=function(s,l){var p=this.editCoordinates(s.getCoordinates(),s);return p===null?s:s instanceof Qo?l.createLinearRing(p):s instanceof Ut?l.createLineString(p):s instanceof En?p.length>0?l.createPoint(p[0]):l.createPoint():s},t1.prototype.interfaces_=function(){return[Is.GeometryEditorOperation]},t1.prototype.getClass=function(){return t1};var r1=o(function(){},"ae");r1.prototype.edit=function(s,l){return s instanceof Qo?l.createLinearRing(this.edit(s.getCoordinateSequence(),s)):s instanceof Ut?l.createLineString(this.edit(s.getCoordinateSequence(),s)):s instanceof En?l.createPoint(this.edit(s.getCoordinateSequence(),s)):s},r1.prototype.interfaces_=function(){return[Is.GeometryEditorOperation]},r1.prototype.getClass=function(){return r1};var Jn=o(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 s=arguments[0];this._coordinates=new Array(s).fill(null);for(var l=0;l<s;l++)this._coordinates[l]=new R}else if(oe(arguments[0],Ee)){var p=arguments[0];if(p===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=p.getDimension(),this._coordinates=new Array(p.size()).fill(null);for(var h=0;h<this._coordinates.length;h++)this._coordinates[h]=p.getCoordinateCopy(h)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var y=arguments[0],_=arguments[1];this._coordinates=y,this._dimension=_,y===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var E=arguments[0],k=arguments[1];this._coordinates=new Array(E).fill(null),this._dimension=k;for(var V=0;V<E;V++)this._coordinates[V]=new R}}},"ue"),YL={serialVersionUID:{configurable:!0}};Jn.prototype.setOrdinate=function(s,l,p){switch(l){case Ee.X:this._coordinates[s].x=p;break;case Ee.Y:this._coordinates[s].y=p;break;case Ee.Z:this._coordinates[s].z=p;break;default:throw new A("invalid ordinateIndex")}},Jn.prototype.size=function(){return this._coordinates.length},Jn.prototype.getOrdinate=function(s,l){switch(l){case Ee.X:return this._coordinates[s].x;case Ee.Y:return this._coordinates[s].y;case Ee.Z:return this._coordinates[s].z}return M.NaN},Jn.prototype.getCoordinate=function(){if(arguments.length===1){var s=arguments[0];return this._coordinates[s]}if(arguments.length===2){var l=arguments[0],p=arguments[1];p.x=this._coordinates[l].x,p.y=this._coordinates[l].y,p.z=this._coordinates[l].z}},Jn.prototype.getCoordinateCopy=function(s){return new R(this._coordinates[s])},Jn.prototype.getDimension=function(){return this._dimension},Jn.prototype.getX=function(s){return this._coordinates[s].x},Jn.prototype.clone=function(){for(var s=new Array(this.size()).fill(null),l=0;l<this._coordinates.length;l++)s[l]=this._coordinates[l].clone();return new Jn(s,this._dimension)},Jn.prototype.expandEnvelope=function(s){for(var l=0;l<this._coordinates.length;l++)s.expandToInclude(this._coordinates[l]);return s},Jn.prototype.copy=function(){for(var s=new Array(this.size()).fill(null),l=0;l<this._coordinates.length;l++)s[l]=this._coordinates[l].copy();return new Jn(s,this._dimension)},Jn.prototype.toString=function(){if(this._coordinates.length>0){var s=new ve(17*this._coordinates.length);s.append("("),s.append(this._coordinates[0]);for(var l=1;l<this._coordinates.length;l++)s.append(", "),s.append(this._coordinates[l]);return s.append(")"),s.toString()}return"()"},Jn.prototype.getY=function(s){return this._coordinates[s].y},Jn.prototype.toCoordinateArray=function(){return this._coordinates},Jn.prototype.interfaces_=function(){return[Ee,t]},Jn.prototype.getClass=function(){return Jn},YL.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Jn,YL);var Gl=o(function(){},"ce"),Q3={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Gl.prototype.readResolve=function(){return Gl.instance()},Gl.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var s=arguments[0];return new Jn(s)}if(oe(arguments[0],Ee)){var l=arguments[0];return new Jn(l)}}else if(arguments.length===2){var p=arguments[0],h=arguments[1];return h>3&&(h=3),h<2?new Jn(p):new Jn(p,h)}},Gl.prototype.interfaces_=function(){return[Q,t]},Gl.prototype.getClass=function(){return Gl},Gl.instance=function(){return Gl.instanceObject},Q3.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Q3.instanceObject.get=function(){return new Gl},Object.defineProperties(Gl,Q3);var XL=function(s){function l(){s.call(this),this.map_=new Map}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.get=function(p){return this.map_.get(p)||null},l.prototype.put=function(p,h){return this.map_.set(p,h),h},l.prototype.values=function(){for(var p=new Le,h=this.map_.values(),y=h.next();!y.done;)p.add(y.value),y=h.next();return p},l.prototype.entrySet=function(){var p=new ye;return this.map_.entries().forEach(function(h){return p.add(h)}),p},l.prototype.size=function(){return this.map_.size()},l}(K),_r=o(function s(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=s.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Za){var l=arguments[0];this._modelType=l,l===s.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var p=arguments[0];this._modelType=s.FIXED,this.setScale(p)}else if(arguments[0]instanceof s){var h=arguments[0];this._modelType=h._modelType,this._scale=h._scale}}},"t"),ew={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};_r.prototype.equals=function(s){if(!(s instanceof _r))return!1;var l=s;return this._modelType===l._modelType&&this._scale===l._scale},_r.prototype.compareTo=function(s){var l=s,p=this.getMaximumSignificantDigits(),h=l.getMaximumSignificantDigits();return new ue(p).compareTo(new ue(h))},_r.prototype.getScale=function(){return this._scale},_r.prototype.isFloating=function(){return this._modelType===_r.FLOATING||this._modelType===_r.FLOATING_SINGLE},_r.prototype.getType=function(){return this._modelType},_r.prototype.toString=function(){var s="UNKNOWN";return this._modelType===_r.FLOATING?s="Floating":this._modelType===_r.FLOATING_SINGLE?s="Floating-Single":this._modelType===_r.FIXED&&(s="Fixed (Scale="+this.getScale()+")"),s},_r.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var s=arguments[0];return M.isNaN(s)||this._modelType===_r.FLOATING_SINGLE?s:this._modelType===_r.FIXED?Math.round(s*this._scale)/this._scale:s}if(arguments[0]instanceof R){var l=arguments[0];if(this._modelType===_r.FLOATING)return null;l.x=this.makePrecise(l.x),l.y=this.makePrecise(l.y)}},_r.prototype.getMaximumSignificantDigits=function(){var s=16;return this._modelType===_r.FLOATING?s=16:this._modelType===_r.FLOATING_SINGLE?s=6:this._modelType===_r.FIXED&&(s=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),s},_r.prototype.setScale=function(s){this._scale=Math.abs(s)},_r.prototype.interfaces_=function(){return[t,B]},_r.prototype.getClass=function(){return _r},_r.mostPrecise=function(s,l){return s.compareTo(l)>=0?s:l},ew.serialVersionUID.get=function(){return 7777263578777804e3},ew.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(_r,ew);var Za=o(function s(l){this._name=l||null,s.nameToTypeMap.put(l,this)},"t"),tw={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Za.prototype.readResolve=function(){return Za.nameToTypeMap.get(this._name)},Za.prototype.toString=function(){return this._name},Za.prototype.interfaces_=function(){return[t]},Za.prototype.getClass=function(){return Za},tw.serialVersionUID.get=function(){return-552860263173159e4},tw.nameToTypeMap.get=function(){return new XL},Object.defineProperties(Za,tw),_r.Type=Za,_r.FIXED=new Za("FIXED"),_r.FLOATING=new Za("FLOATING"),_r.FLOATING_SINGLE=new Za("FLOATING SINGLE");var jt=o(function s(){this._precisionModel=new _r,this._SRID=0,this._coordinateSequenceFactory=s.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?oe(arguments[0],Q)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof _r&&(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"),ZL={serialVersionUID:{configurable:!0}};jt.prototype.toGeometry=function(s){return s.isNull()?this.createPoint(null):s.getMinX()===s.getMaxX()&&s.getMinY()===s.getMaxY()?this.createPoint(new R(s.getMinX(),s.getMinY())):s.getMinX()===s.getMaxX()||s.getMinY()===s.getMaxY()?this.createLineString([new R(s.getMinX(),s.getMinY()),new R(s.getMaxX(),s.getMaxY())]):this.createPolygon(this.createLinearRing([new R(s.getMinX(),s.getMinY()),new R(s.getMinX(),s.getMaxY()),new R(s.getMaxX(),s.getMaxY()),new R(s.getMaxX(),s.getMinY()),new R(s.getMinX(),s.getMinY())]),null)},jt.prototype.createLineString=function(s){return s?s instanceof Array?new Ut(this.getCoordinateSequenceFactory().create(s),this):oe(s,Ee)?new Ut(s,this):void 0:new Ut(this.getCoordinateSequenceFactory().create([]),this)},jt.prototype.createMultiLineString=function(){if(arguments.length===0)return new on(null,this);if(arguments.length===1){var s=arguments[0];return new on(s,this)}},jt.prototype.buildGeometry=function(s){for(var l=null,p=!1,h=!1,y=s.iterator();y.hasNext();){var _=y.next(),E=_.getClass();l===null&&(l=E),E!==l&&(p=!0),_.isGeometryCollectionOrDerived()&&(h=!0)}if(l===null)return this.createGeometryCollection();if(p||h)return this.createGeometryCollection(jt.toGeometryArray(s));var k=s.iterator().next();if(s.size()>1){if(k instanceof Vr)return this.createMultiPolygon(jt.toPolygonArray(s));if(k instanceof Ut)return this.createMultiLineString(jt.toLineStringArray(s));if(k instanceof En)return this.createMultiPoint(jt.toPointArray(s));Xe.shouldNeverReachHere("Unhandled class: "+k.getClass().getName())}return k},jt.prototype.createMultiPointFromCoords=function(s){return this.createMultiPoint(s!==null?this.getCoordinateSequenceFactory().create(s):null)},jt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof R){var s=arguments[0];return this.createPoint(s!==null?this.getCoordinateSequenceFactory().create([s]):null)}if(oe(arguments[0],Ee)){var l=arguments[0];return new En(l,this)}}},jt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},jt.prototype.createPolygon=function(){if(arguments.length===0)return new Vr(null,null,this);if(arguments.length===1){if(oe(arguments[0],Ee)){var s=arguments[0];return this.createPolygon(this.createLinearRing(s))}if(arguments[0]instanceof Array){var l=arguments[0];return this.createPolygon(this.createLinearRing(l))}if(arguments[0]instanceof Qo){var p=arguments[0];return this.createPolygon(p,null)}}else if(arguments.length===2){var h=arguments[0],y=arguments[1];return new Vr(h,y,this)}},jt.prototype.getSRID=function(){return this._SRID},jt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new mt(null,this);if(arguments.length===1){var s=arguments[0];return new mt(s,this)}},jt.prototype.createGeometry=function(s){return new Is(this).edit(s,{edit:o(function(){if(arguments.length===2){var l=arguments[0];return this._coordinateSequenceFactory.create(l)}},"edit")})},jt.prototype.getPrecisionModel=function(){return this._precisionModel},jt.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var s=arguments[0];return this.createLinearRing(s!==null?this.getCoordinateSequenceFactory().create(s):null)}if(oe(arguments[0],Ee)){var l=arguments[0];return new Qo(l,this)}}},jt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new wa(null,this);if(arguments.length===1){var s=arguments[0];return new wa(s,this)}},jt.prototype.createMultiPoint=function(){if(arguments.length===0)return new bs(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var s=arguments[0];return new bs(s,this)}if(arguments[0]instanceof Array){var l=arguments[0];return this.createMultiPoint(l!==null?this.getCoordinateSequenceFactory().create(l):null)}if(oe(arguments[0],Ee)){var p=arguments[0];if(p===null)return this.createMultiPoint(new Array(0).fill(null));for(var h=new Array(p.size()).fill(null),y=0;y<p.size();y++){var _=this.getCoordinateSequenceFactory().create(1,p.getDimension());Yt.copy(p,y,_,0,1),h[y]=this.createPoint(_)}return this.createMultiPoint(h)}}},jt.prototype.interfaces_=function(){return[t]},jt.prototype.getClass=function(){return jt},jt.toMultiPolygonArray=function(s){var l=new Array(s.size()).fill(null);return s.toArray(l)},jt.toGeometryArray=function(s){if(s===null)return null;var l=new Array(s.size()).fill(null);return s.toArray(l)},jt.getDefaultCoordinateSequenceFactory=function(){return Gl.instance()},jt.toMultiLineStringArray=function(s){var l=new Array(s.size()).fill(null);return s.toArray(l)},jt.toLineStringArray=function(s){var l=new Array(s.size()).fill(null);return s.toArray(l)},jt.toMultiPointArray=function(s){var l=new Array(s.size()).fill(null);return s.toArray(l)},jt.toLinearRingArray=function(s){var l=new Array(s.size()).fill(null);return s.toArray(l)},jt.toPointArray=function(s){var l=new Array(s.size()).fill(null);return s.toArray(l)},jt.toPolygonArray=function(s){var l=new Array(s.size()).fill(null);return s.toArray(l)},jt.createPointFromInternalCoord=function(s,l){return l.getPrecisionModel().makePrecise(s),l.getFactory().createPoint(s)},ZL.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(jt,ZL);var iq=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],uI=o(function(s){this.geometryFactory=s||new jt},"Ie");uI.prototype.read=function(s){var l,p=(l=typeof s=="string"?JSON.parse(s):s).type;if(!Ka[p])throw new Error("Unknown GeoJSON type: "+l.type);return iq.indexOf(p)!==-1?Ka[p].apply(this,[l.coordinates]):p==="GeometryCollection"?Ka[p].apply(this,[l.geometries]):Ka[p].apply(this,[l])},uI.prototype.write=function(s){var l=s.getGeometryType();if(!Au[l])throw new Error("Geometry is not supported");return Au[l].apply(this,[s])};var Ka={Feature:o(function(s){var l={};for(var p in s)l[p]=s[p];if(s.geometry){var h=s.geometry.type;if(!Ka[h])throw new Error("Unknown GeoJSON type: "+s.type);l.geometry=this.read(s.geometry)}return s.bbox&&(l.bbox=Ka.bbox.apply(this,[s.bbox])),l},"Feature"),FeatureCollection:o(function(s){var l={};if(s.features){l.features=[];for(var p=0;p<s.features.length;++p)l.features.push(this.read(s.features[p]))}return s.bbox&&(l.bbox=this.parse.bbox.apply(this,[s.bbox])),l},"FeatureCollection"),coordinates:o(function(s){for(var l=[],p=0;p<s.length;++p){var h=s[p];l.push(new R(h[0],h[1]))}return l},"coordinates"),bbox:o(function(s){return this.geometryFactory.createLinearRing([new R(s[0],s[1]),new R(s[2],s[1]),new R(s[2],s[3]),new R(s[0],s[3]),new R(s[0],s[1])])},"bbox"),Point:o(function(s){var l=new R(s[0],s[1]);return this.geometryFactory.createPoint(l)},"Point"),MultiPoint:o(function(s){for(var l=[],p=0;p<s.length;++p)l.push(Ka.Point.apply(this,[s[p]]));return this.geometryFactory.createMultiPoint(l)},"MultiPoint"),LineString:o(function(s){var l=Ka.coordinates.apply(this,[s]);return this.geometryFactory.createLineString(l)},"LineString"),MultiLineString:o(function(s){for(var l=[],p=0;p<s.length;++p)l.push(Ka.LineString.apply(this,[s[p]]));return this.geometryFactory.createMultiLineString(l)},"MultiLineString"),Polygon:o(function(s){for(var l=Ka.coordinates.apply(this,[s[0]]),p=this.geometryFactory.createLinearRing(l),h=[],y=1;y<s.length;++y){var _=s[y],E=Ka.coordinates.apply(this,[_]),k=this.geometryFactory.createLinearRing(E);h.push(k)}return this.geometryFactory.createPolygon(p,h)},"Polygon"),MultiPolygon:o(function(s){for(var l=[],p=0;p<s.length;++p){var h=s[p];l.push(Ka.Polygon.apply(this,[h]))}return this.geometryFactory.createMultiPolygon(l)},"MultiPolygon"),GeometryCollection:o(function(s){for(var l=[],p=0;p<s.length;++p){var h=s[p];l.push(this.read(h))}return this.geometryFactory.createGeometryCollection(l)},"GeometryCollection")},Au={coordinate:o(function(s){return[s.x,s.y]},"coordinate"),Point:o(function(s){return{type:"Point",coordinates:Au.coordinate.apply(this,[s.getCoordinate()])}},"Point"),MultiPoint:o(function(s){for(var l=[],p=0;p<s._geometries.length;++p){var h=s._geometries[p],y=Au.Point.apply(this,[h]);l.push(y.coordinates)}return{type:"MultiPoint",coordinates:l}},"MultiPoint"),LineString:o(function(s){for(var l=[],p=s.getCoordinates(),h=0;h<p.length;++h){var y=p[h];l.push(Au.coordinate.apply(this,[y]))}return{type:"LineString",coordinates:l}},"LineString"),MultiLineString:o(function(s){for(var l=[],p=0;p<s._geometries.length;++p){var h=s._geometries[p],y=Au.LineString.apply(this,[h]);l.push(y.coordinates)}return{type:"MultiLineString",coordinates:l}},"MultiLineString"),Polygon:o(function(s){var l=[],p=Au.LineString.apply(this,[s._shell]);l.push(p.coordinates);for(var h=0;h<s._holes.length;++h){var y=s._holes[h],_=Au.LineString.apply(this,[y]);l.push(_.coordinates)}return{type:"Polygon",coordinates:l}},"Polygon"),MultiPolygon:o(function(s){for(var l=[],p=0;p<s._geometries.length;++p){var h=s._geometries[p],y=Au.Polygon.apply(this,[h]);l.push(y.coordinates)}return{type:"MultiPolygon",coordinates:l}},"MultiPolygon"),GeometryCollection:o(function(s){for(var l=[],p=0;p<s._geometries.length;++p){var h=s._geometries[p],y=h.getGeometryType();l.push(Au[y].apply(this,[h]))}return{type:"GeometryCollection",geometries:l}},"GeometryCollection")},rw=o(function(s){this.geometryFactory=s||new jt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new uI(this.geometryFactory)},"Ne");rw.prototype.read=function(s){var l=this.parser.read(s);return this.precisionModel.getType()===_r.FIXED&&this.reducePrecision(l),l},rw.prototype.reducePrecision=function(s){var l,p;if(s.coordinate)this.precisionModel.makePrecise(s.coordinate);else if(s.points)for(l=0,p=s.points.length;l<p;l++)this.precisionModel.makePrecise(s.points[l]);else if(s.geometries)for(l=0,p=s.geometries.length;l<p;l++)this.reducePrecision(s.geometries[l])};var KL=o(function(){this.parser=new uI(this.geometryFactory)},"Ce");KL.prototype.write=function(s){return this.parser.write(s)};var je=o(function(){},"Se"),cI={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je},je.opposite=function(s){return s===je.LEFT?je.RIGHT:s===je.RIGHT?je.LEFT:s},cI.ON.get=function(){return 0},cI.LEFT.get=function(){return 1},cI.RIGHT.get=function(){return 2},Object.defineProperties(je,cI),(O.prototype=new Error).name="EmptyStackException",(P.prototype=new Tn).add=function(s){return this.array_.push(s),!0},P.prototype.get=function(s){if(s<0||s>=this.size())throw new Error;return this.array_[s]},P.prototype.push=function(s){return this.array_.push(s),s},P.prototype.pop=function(s){if(this.array_.length===0)throw new O;return this.array_.pop()},P.prototype.peek=function(){if(this.array_.length===0)throw new O;return this.array_[this.array_.length-1]},P.prototype.empty=function(){return this.array_.length===0},P.prototype.isEmpty=function(){return this.empty()},P.prototype.search=function(s){return this.array_.indexOf(s)},P.prototype.size=function(){return this.array_.length},P.prototype.toArray=function(){for(var s=[],l=0,p=this.array_.length;l<p;l++)s.push(this.array_[l]);return s};var Ja=o(function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null},"be");Ja.prototype.getCoordinate=function(){return this._minCoord},Ja.prototype.getRightmostSide=function(s,l){var p=this.getRightmostSideOfSegment(s,l);return p<0&&(p=this.getRightmostSideOfSegment(s,l-1)),p<0&&(this._minCoord=null,this.checkForRightmostCoordinate(s)),p},Ja.prototype.findRightmostEdgeAtVertex=function(){var s=this._minDe.getEdge().getCoordinates();Xe.isTrue(this._minIndex>0&&this._minIndex<s.length,"rightmost point expected to be interior vertex of edge");var l=s[this._minIndex-1],p=s[this._minIndex+1],h=Ge.computeOrientation(this._minCoord,p,l),y=!1;(l.y<this._minCoord.y&&p.y<this._minCoord.y&&h===Ge.COUNTERCLOCKWISE||l.y>this._minCoord.y&&p.y>this._minCoord.y&&h===Ge.CLOCKWISE)&&(y=!0),y&&(this._minIndex=this._minIndex-1)},Ja.prototype.getRightmostSideOfSegment=function(s,l){var p=s.getEdge().getCoordinates();if(l<0||l+1>=p.length||p[l].y===p[l+1].y)return-1;var h=je.LEFT;return p[l].y<p[l+1].y&&(h=je.RIGHT),h},Ja.prototype.getEdge=function(){return this._orientedDe},Ja.prototype.checkForRightmostCoordinate=function(s){for(var l=s.getEdge().getCoordinates(),p=0;p<l.length-1;p++)(this._minCoord===null||l[p].x>this._minCoord.x)&&(this._minDe=s,this._minIndex=p,this._minCoord=l[p])},Ja.prototype.findRightmostEdgeAtNode=function(){var s=this._minDe.getNode().getEdges();this._minDe=s.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Ja.prototype.findEdge=function(s){for(var l=s.iterator();l.hasNext();){var p=l.next();p.isForward()&&this.checkForRightmostCoordinate(p)}Xe.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)===je.LEFT&&(this._orientedDe=this._minDe.getSym())},Ja.prototype.interfaces_=function(){return[]},Ja.prototype.getClass=function(){return Ja};var Fu=function(s){function l(p,h){s.call(this,l.msgWithCoord(p,h)),this.pt=h?new R(h):null,this.name="TopologyException"}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.getCoordinate=function(){return this.pt},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l.msgWithCoord=function(p,h){return h?p:p+" [ "+h+" ]"},l}(Bt),pI=o(function(){this.array_=[]},"Oe");pI.prototype.addLast=function(s){this.array_.push(s)},pI.prototype.removeFirst=function(){return this.array_.shift()},pI.prototype.isEmpty=function(){return this.array_.length===0};var Eo=o(function(){this._finder=null,this._dirEdgeList=new Le,this._nodes=new Le,this._rightMostCoord=null,this._env=null,this._finder=new Ja},"Te");Eo.prototype.clearVisitedEdges=function(){for(var s=this._dirEdgeList.iterator();s.hasNext();)s.next().setVisited(!1)},Eo.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Eo.prototype.computeNodeDepth=function(s){for(var l=null,p=s.getEdges().iterator();p.hasNext();){var h=p.next();if(h.isVisited()||h.getSym().isVisited()){l=h;break}}if(l===null)throw new Fu("unable to find edge to compute depths at "+s.getCoordinate());s.getEdges().computeDepths(l);for(var y=s.getEdges().iterator();y.hasNext();){var _=y.next();_.setVisited(!0),this.copySymDepths(_)}},Eo.prototype.computeDepth=function(s){this.clearVisitedEdges();var l=this._finder.getEdge();l.setEdgeDepths(je.RIGHT,s),this.copySymDepths(l),this.computeDepths(l)},Eo.prototype.create=function(s){this.addReachable(s),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Eo.prototype.findResultEdges=function(){for(var s=this._dirEdgeList.iterator();s.hasNext();){var l=s.next();l.getDepth(je.RIGHT)>=1&&l.getDepth(je.LEFT)<=0&&!l.isInteriorAreaEdge()&&l.setInResult(!0)}},Eo.prototype.computeDepths=function(s){var l=new ye,p=new pI,h=s.getNode();for(p.addLast(h),l.add(h),s.setVisited(!0);!p.isEmpty();){var y=p.removeFirst();l.add(y),this.computeNodeDepth(y);for(var _=y.getEdges().iterator();_.hasNext();){var E=_.next().getSym();if(!E.isVisited()){var k=E.getNode();l.contains(k)||(p.addLast(k),l.add(k))}}}},Eo.prototype.compareTo=function(s){var l=s;return this._rightMostCoord.x<l._rightMostCoord.x?-1:this._rightMostCoord.x>l._rightMostCoord.x?1:0},Eo.prototype.getEnvelope=function(){if(this._env===null){for(var s=new ce,l=this._dirEdgeList.iterator();l.hasNext();)for(var p=l.next().getEdge().getCoordinates(),h=0;h<p.length-1;h++)s.expandToInclude(p[h]);this._env=s}return this._env},Eo.prototype.addReachable=function(s){var l=new P;for(l.add(s);!l.empty();){var p=l.pop();this.add(p,l)}},Eo.prototype.copySymDepths=function(s){var l=s.getSym();l.setDepth(je.LEFT,s.getDepth(je.RIGHT)),l.setDepth(je.RIGHT,s.getDepth(je.LEFT))},Eo.prototype.add=function(s,l){s.setVisited(!0),this._nodes.add(s);for(var p=s.getEdges().iterator();p.hasNext();){var h=p.next();this._dirEdgeList.add(h);var y=h.getSym().getNode();y.isVisited()||l.push(y)}},Eo.prototype.getNodes=function(){return this._nodes},Eo.prototype.getDirectedEdges=function(){return this._dirEdgeList},Eo.prototype.interfaces_=function(){return[B]},Eo.prototype.getClass=function(){return Eo};var hn=o(function s(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var l=arguments[0];this.init(l.length)}else if(Number.isInteger(arguments[0])){var p=arguments[0];this.init(1),this.location[je.ON]=p}else if(arguments[0]instanceof s){var h=arguments[0];if(this.init(h.location.length),h!==null)for(var y=0;y<this.location.length;y++)this.location[y]=h.location[y]}}else if(arguments.length===3){var _=arguments[0],E=arguments[1],k=arguments[2];this.init(3),this.location[je.ON]=_,this.location[je.LEFT]=E,this.location[je.RIGHT]=k}},"t");hn.prototype.setAllLocations=function(s){for(var l=0;l<this.location.length;l++)this.location[l]=s},hn.prototype.isNull=function(){for(var s=0;s<this.location.length;s++)if(this.location[s]!==U.NONE)return!1;return!0},hn.prototype.setAllLocationsIfNull=function(s){for(var l=0;l<this.location.length;l++)this.location[l]===U.NONE&&(this.location[l]=s)},hn.prototype.isLine=function(){return this.location.length===1},hn.prototype.merge=function(s){if(s.location.length>this.location.length){var l=new Array(3).fill(null);l[je.ON]=this.location[je.ON],l[je.LEFT]=U.NONE,l[je.RIGHT]=U.NONE,this.location=l}for(var p=0;p<this.location.length;p++)this.location[p]===U.NONE&&p<s.location.length&&(this.location[p]=s.location[p])},hn.prototype.getLocations=function(){return this.location},hn.prototype.flip=function(){if(this.location.length<=1)return null;var s=this.location[je.LEFT];this.location[je.LEFT]=this.location[je.RIGHT],this.location[je.RIGHT]=s},hn.prototype.toString=function(){var s=new ve;return this.location.length>1&&s.append(U.toLocationSymbol(this.location[je.LEFT])),s.append(U.toLocationSymbol(this.location[je.ON])),this.location.length>1&&s.append(U.toLocationSymbol(this.location[je.RIGHT])),s.toString()},hn.prototype.setLocations=function(s,l,p){this.location[je.ON]=s,this.location[je.LEFT]=l,this.location[je.RIGHT]=p},hn.prototype.get=function(s){return s<this.location.length?this.location[s]:U.NONE},hn.prototype.isArea=function(){return this.location.length>1},hn.prototype.isAnyNull=function(){for(var s=0;s<this.location.length;s++)if(this.location[s]===U.NONE)return!0;return!1},hn.prototype.setLocation=function(){if(arguments.length===1){var s=arguments[0];this.setLocation(je.ON,s)}else if(arguments.length===2){var l=arguments[0],p=arguments[1];this.location[l]=p}},hn.prototype.init=function(s){this.location=new Array(s).fill(null),this.setAllLocations(U.NONE)},hn.prototype.isEqualOnSide=function(s,l){return this.location[l]===s.location[l]},hn.prototype.allPositionsEqual=function(s){for(var l=0;l<this.location.length;l++)if(this.location[l]!==s)return!1;return!0},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var zr=o(function s(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var l=arguments[0];this.elt[0]=new hn(l),this.elt[1]=new hn(l)}else if(arguments[0]instanceof s){var p=arguments[0];this.elt[0]=new hn(p.elt[0]),this.elt[1]=new hn(p.elt[1])}}else if(arguments.length===2){var h=arguments[0],y=arguments[1];this.elt[0]=new hn(U.NONE),this.elt[1]=new hn(U.NONE),this.elt[h].setLocation(y)}else if(arguments.length===3){var _=arguments[0],E=arguments[1],k=arguments[2];this.elt[0]=new hn(_,E,k),this.elt[1]=new hn(_,E,k)}else if(arguments.length===4){var V=arguments[0],re=arguments[1],de=arguments[2],xe=arguments[3];this.elt[0]=new hn(U.NONE,U.NONE,U.NONE),this.elt[1]=new hn(U.NONE,U.NONE,U.NONE),this.elt[V].setLocations(re,de,xe)}},"t");zr.prototype.getGeometryCount=function(){var s=0;return this.elt[0].isNull()||s++,this.elt[1].isNull()||s++,s},zr.prototype.setAllLocations=function(s,l){this.elt[s].setAllLocations(l)},zr.prototype.isNull=function(s){return this.elt[s].isNull()},zr.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var s=arguments[0];this.setAllLocationsIfNull(0,s),this.setAllLocationsIfNull(1,s)}else if(arguments.length===2){var l=arguments[0],p=arguments[1];this.elt[l].setAllLocationsIfNull(p)}},zr.prototype.isLine=function(s){return this.elt[s].isLine()},zr.prototype.merge=function(s){for(var l=0;l<2;l++)this.elt[l]===null&&s.elt[l]!==null?this.elt[l]=new hn(s.elt[l]):this.elt[l].merge(s.elt[l])},zr.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},zr.prototype.getLocation=function(){if(arguments.length===1){var s=arguments[0];return this.elt[s].get(je.ON)}if(arguments.length===2){var l=arguments[0],p=arguments[1];return this.elt[l].get(p)}},zr.prototype.toString=function(){var s=new ve;return this.elt[0]!==null&&(s.append("A:"),s.append(this.elt[0].toString())),this.elt[1]!==null&&(s.append(" B:"),s.append(this.elt[1].toString())),s.toString()},zr.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var s=arguments[0];return this.elt[s].isArea()}},zr.prototype.isAnyNull=function(s){return this.elt[s].isAnyNull()},zr.prototype.setLocation=function(){if(arguments.length===2){var s=arguments[0],l=arguments[1];this.elt[s].setLocation(je.ON,l)}else if(arguments.length===3){var p=arguments[0],h=arguments[1],y=arguments[2];this.elt[p].setLocation(h,y)}},zr.prototype.isEqualOnSide=function(s,l){return this.elt[0].isEqualOnSide(s.elt[0],l)&&this.elt[1].isEqualOnSide(s.elt[1],l)},zr.prototype.allPositionsEqual=function(s,l){return this.elt[s].allPositionsEqual(l)},zr.prototype.toLine=function(s){this.elt[s].isArea()&&(this.elt[s]=new hn(this.elt[s].location[0]))},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.toLineLabel=function(s){for(var l=new zr(U.NONE),p=0;p<2;p++)l.setLocation(p,s.getLocation(p));return l};var ui=o(function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Le,this._pts=new Le,this._label=new zr(U.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Le,this._geometryFactory=null;var s=arguments[0],l=arguments[1];this._geometryFactory=l,this.computePoints(s),this.computeRing()},"De");ui.prototype.computeRing=function(){if(this._ring!==null)return null;for(var s=new Array(this._pts.size()).fill(null),l=0;l<this._pts.size();l++)s[l]=this._pts.get(l);this._ring=this._geometryFactory.createLinearRing(s),this._isHole=Ge.isCCW(this._ring.getCoordinates())},ui.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},ui.prototype.computePoints=function(s){this._startDe=s;var l=s,p=!0;do{if(l===null)throw new Fu("Found null DirectedEdge");if(l.getEdgeRing()===this)throw new Fu("Directed Edge visited twice during ring-building at "+l.getCoordinate());this._edges.add(l);var h=l.getLabel();Xe.isTrue(h.isArea()),this.mergeLabel(h),this.addPoints(l.getEdge(),l.isForward(),p),p=!1,this.setEdgeRing(l,this),l=this.getNext(l)}while(l!==this._startDe)},ui.prototype.getLinearRing=function(){return this._ring},ui.prototype.getCoordinate=function(s){return this._pts.get(s)},ui.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var s=this._startDe;do{var l=s.getNode().getEdges().getOutgoingDegree(this);l>this._maxNodeDegree&&(this._maxNodeDegree=l),s=this.getNext(s)}while(s!==this._startDe);this._maxNodeDegree*=2},ui.prototype.addPoints=function(s,l,p){var h=s.getCoordinates();if(l){var y=1;p&&(y=0);for(var _=y;_<h.length;_++)this._pts.add(h[_])}else{var E=h.length-2;p&&(E=h.length-1);for(var k=E;k>=0;k--)this._pts.add(h[k])}},ui.prototype.isHole=function(){return this._isHole},ui.prototype.setInResult=function(){var s=this._startDe;do s.getEdge().setInResult(!0),s=s.getNext();while(s!==this._startDe)},ui.prototype.containsPoint=function(s){var l=this.getLinearRing();if(!l.getEnvelopeInternal().contains(s)||!Ge.isPointInRing(s,l.getCoordinates()))return!1;for(var p=this._holes.iterator();p.hasNext();)if(p.next().containsPoint(s))return!1;return!0},ui.prototype.addHole=function(s){this._holes.add(s)},ui.prototype.isShell=function(){return this._shell===null},ui.prototype.getLabel=function(){return this._label},ui.prototype.getEdges=function(){return this._edges},ui.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},ui.prototype.getShell=function(){return this._shell},ui.prototype.mergeLabel=function(){if(arguments.length===1){var s=arguments[0];this.mergeLabel(s,0),this.mergeLabel(s,1)}else if(arguments.length===2){var l=arguments[0],p=arguments[1],h=l.getLocation(p,je.RIGHT);if(h===U.NONE)return null;if(this._label.getLocation(p)===U.NONE)return this._label.setLocation(p,h),null}},ui.prototype.setShell=function(s){this._shell=s,s!==null&&s.addHole(this)},ui.prototype.toPolygon=function(s){for(var l=new Array(this._holes.size()).fill(null),p=0;p<this._holes.size();p++)l[p]=this._holes.get(p).getLinearRing();return s.createPolygon(this.getLinearRing(),l)},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui};var oq=function(s){function l(){var p=arguments[0],h=arguments[1];s.call(this,p,h)}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.setEdgeRing=function(p,h){p.setMinEdgeRing(h)},l.prototype.getNext=function(p){return p.getNextMin()},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(ui),sq=function(s){function l(){var p=arguments[0],h=arguments[1];s.call(this,p,h)}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.buildMinimalRings=function(){var p=new Le,h=this._startDe;do{if(h.getMinEdgeRing()===null){var y=new oq(h,this._geometryFactory);p.add(y)}h=h.getNext()}while(h!==this._startDe);return p},l.prototype.setEdgeRing=function(p,h){p.setEdgeRing(h)},l.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var p=this._startDe;do p.getNode().getEdges().linkMinimalDirectedEdges(this),p=p.getNext();while(p!==this._startDe)},l.prototype.getNext=function(p){return p.getNext()},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(ui),ks=o(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 s=arguments[0];this._label=s}}},"Fe");ks.prototype.setVisited=function(s){this._isVisited=s},ks.prototype.setInResult=function(s){this._isInResult=s},ks.prototype.isCovered=function(){return this._isCovered},ks.prototype.isCoveredSet=function(){return this._isCoveredSet},ks.prototype.setLabel=function(s){this._label=s},ks.prototype.getLabel=function(){return this._label},ks.prototype.setCovered=function(s){this._isCovered=s,this._isCoveredSet=!0},ks.prototype.updateIM=function(s){Xe.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(s)},ks.prototype.isInResult=function(){return this._isInResult},ks.prototype.isVisited=function(){return this._isVisited},ks.prototype.interfaces_=function(){return[]},ks.prototype.getClass=function(){return ks};var fI=function(s){function l(){s.call(this),this._coord=null,this._edges=null;var p=arguments[0],h=arguments[1];this._coord=p,this._edges=h,this._label=new zr(0,U.NONE)}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.isIncidentEdgeInResult=function(){for(var p=this.getEdges().getEdges().iterator();p.hasNext();)if(p.next().getEdge().isInResult())return!0;return!1},l.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},l.prototype.getCoordinate=function(){return this._coord},l.prototype.print=function(p){p.println("node "+this._coord+" lbl: "+this._label)},l.prototype.computeIM=function(p){},l.prototype.computeMergedLocation=function(p,h){var y=U.NONE;if(y=this._label.getLocation(h),!p.isNull(h)){var _=p.getLocation(h);y!==U.BOUNDARY&&(y=_)}return y},l.prototype.setLabel=function(){if(arguments.length!==2)return s.prototype.setLabel.apply(this,arguments);var p=arguments[0],h=arguments[1];this._label===null?this._label=new zr(p,h):this._label.setLocation(p,h)},l.prototype.getEdges=function(){return this._edges},l.prototype.mergeLabel=function(){if(arguments[0]instanceof l){var p=arguments[0];this.mergeLabel(p._label)}else if(arguments[0]instanceof zr)for(var h=arguments[0],y=0;y<2;y++){var _=this.computeMergedLocation(h,y);this._label.getLocation(y)===U.NONE&&this._label.setLocation(y,_)}},l.prototype.add=function(p){this._edges.insert(p),p.setNode(this)},l.prototype.setLabelBoundary=function(p){if(this._label===null)return null;var h=U.NONE;this._label!==null&&(h=this._label.getLocation(p));var y=null;switch(h){case U.BOUNDARY:y=U.INTERIOR;break;case U.INTERIOR:default:y=U.BOUNDARY}this._label.setLocation(p,y)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(ks),Qa=o(function(){this.nodeMap=new x,this.nodeFact=null;var s=arguments[0];this.nodeFact=s},"qe");Qa.prototype.find=function(s){return this.nodeMap.get(s)},Qa.prototype.addNode=function(){if(arguments[0]instanceof R){var s=arguments[0],l=this.nodeMap.get(s);return l===null&&(l=this.nodeFact.createNode(s),this.nodeMap.put(s,l)),l}if(arguments[0]instanceof fI){var p=arguments[0],h=this.nodeMap.get(p.getCoordinate());return h===null?(this.nodeMap.put(p.getCoordinate(),p),p):(h.mergeLabel(p),h)}},Qa.prototype.print=function(s){for(var l=this.iterator();l.hasNext();)l.next().print(s)},Qa.prototype.iterator=function(){return this.nodeMap.values().iterator()},Qa.prototype.values=function(){return this.nodeMap.values()},Qa.prototype.getBoundaryNodes=function(s){for(var l=new Le,p=this.iterator();p.hasNext();){var h=p.next();h.getLabel().getLocation(s)===U.BOUNDARY&&l.add(h)}return l},Qa.prototype.add=function(s){var l=s.getCoordinate();this.addNode(l).add(s)},Qa.prototype.interfaces_=function(){return[]},Qa.prototype.getClass=function(){return Qa};var sn=o(function(){},"Be"),n1={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},sn.isNorthern=function(s){return s===sn.NE||s===sn.NW},sn.isOpposite=function(s,l){return s===l?!1:(s-l+4)%4===2},sn.commonHalfPlane=function(s,l){if(s===l)return s;if((s-l+4)%4===2)return-1;var p=s<l?s:l;return p===0&&(s>l?s:l)===3?3:p},sn.isInHalfPlane=function(s,l){return l===sn.SE?s===sn.SE||s===sn.SW:s===l||s===l+1},sn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var s=arguments[0],l=arguments[1];if(s===0&&l===0)throw new A("Cannot compute the quadrant for point ( "+s+", "+l+" )");return s>=0?l>=0?sn.NE:sn.SE:l>=0?sn.NW:sn.SW}if(arguments[0]instanceof R&&arguments[1]instanceof R){var p=arguments[0],h=arguments[1];if(h.x===p.x&&h.y===p.y)throw new A("Cannot compute the quadrant for two identical points "+p);return h.x>=p.x?h.y>=p.y?sn.NE:sn.SE:h.y>=p.y?sn.NW:sn.SW}},n1.NE.get=function(){return 0},n1.NW.get=function(){return 1},n1.SW.get=function(){return 2},n1.SE.get=function(){return 3},Object.defineProperties(sn,n1);var lo=o(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 s=arguments[0];this._edge=s}else if(arguments.length===3){var l=arguments[0],p=arguments[1],h=arguments[2];this._edge=l,this.init(p,h),this._label=null}else if(arguments.length===4){var y=arguments[0],_=arguments[1],E=arguments[2],k=arguments[3];this._edge=y,this.init(_,E),this._label=k}},"Ue");lo.prototype.compareDirection=function(s){return this._dx===s._dx&&this._dy===s._dy?0:this._quadrant>s._quadrant?1:this._quadrant<s._quadrant?-1:Ge.computeOrientation(s._p0,s._p1,this._p1)},lo.prototype.getDy=function(){return this._dy},lo.prototype.getCoordinate=function(){return this._p0},lo.prototype.setNode=function(s){this._node=s},lo.prototype.print=function(s){var l=Math.atan2(this._dy,this._dx),p=this.getClass().getName(),h=p.lastIndexOf("."),y=p.substring(h+1);s.print(" "+y+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+l+" "+this._label)},lo.prototype.compareTo=function(s){var l=s;return this.compareDirection(l)},lo.prototype.getDirectedCoordinate=function(){return this._p1},lo.prototype.getDx=function(){return this._dx},lo.prototype.getLabel=function(){return this._label},lo.prototype.getEdge=function(){return this._edge},lo.prototype.getQuadrant=function(){return this._quadrant},lo.prototype.getNode=function(){return this._node},lo.prototype.toString=function(){var s=Math.atan2(this._dy,this._dx),l=this.getClass().getName(),p=l.lastIndexOf(".");return" "+l.substring(p+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+s+" "+this._label},lo.prototype.computeLabel=function(s){},lo.prototype.init=function(s,l){this._p0=s,this._p1=l,this._dx=l.x-s.x,this._dy=l.y-s.y,this._quadrant=sn.quadrant(this._dx,this._dy),Xe.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},lo.prototype.interfaces_=function(){return[B]},lo.prototype.getClass=function(){return lo};var nw=function(s){function l(){var p=arguments[0],h=arguments[1];if(s.call(this,p),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=h,h)this.init(p.getCoordinate(0),p.getCoordinate(1));else{var y=p.getNumPoints()-1;this.init(p.getCoordinate(y),p.getCoordinate(y-1))}this.computeDirectedLabel()}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.getNextMin=function(){return this._nextMin},l.prototype.getDepth=function(p){return this._depth[p]},l.prototype.setVisited=function(p){this._isVisited=p},l.prototype.computeDirectedLabel=function(){this._label=new zr(this._edge.getLabel()),this._isForward||this._label.flip()},l.prototype.getNext=function(){return this._next},l.prototype.setDepth=function(p,h){if(this._depth[p]!==-999&&this._depth[p]!==h)throw new Fu("assigned depths do not match",this.getCoordinate());this._depth[p]=h},l.prototype.isInteriorAreaEdge=function(){for(var p=!0,h=0;h<2;h++)this._label.isArea(h)&&this._label.getLocation(h,je.LEFT)===U.INTERIOR&&this._label.getLocation(h,je.RIGHT)===U.INTERIOR||(p=!1);return p},l.prototype.setNextMin=function(p){this._nextMin=p},l.prototype.print=function(p){s.prototype.print.call(this,p),p.print(" "+this._depth[je.LEFT]+"/"+this._depth[je.RIGHT]),p.print(" ("+this.getDepthDelta()+")"),this._isInResult&&p.print(" inResult")},l.prototype.setMinEdgeRing=function(p){this._minEdgeRing=p},l.prototype.isLineEdge=function(){var p=this._label.isLine(0)||this._label.isLine(1),h=!this._label.isArea(0)||this._label.allPositionsEqual(0,U.EXTERIOR),y=!this._label.isArea(1)||this._label.allPositionsEqual(1,U.EXTERIOR);return p&&h&&y},l.prototype.setEdgeRing=function(p){this._edgeRing=p},l.prototype.getMinEdgeRing=function(){return this._minEdgeRing},l.prototype.getDepthDelta=function(){var p=this._edge.getDepthDelta();return this._isForward||(p=-p),p},l.prototype.setInResult=function(p){this._isInResult=p},l.prototype.getSym=function(){return this._sym},l.prototype.isForward=function(){return this._isForward},l.prototype.getEdge=function(){return this._edge},l.prototype.printEdge=function(p){this.print(p),p.print(" "),this._isForward?this._edge.print(p):this._edge.printReverse(p)},l.prototype.setSym=function(p){this._sym=p},l.prototype.setVisitedEdge=function(p){this.setVisited(p),this._sym.setVisited(p)},l.prototype.setEdgeDepths=function(p,h){var y=this.getEdge().getDepthDelta();this._isForward||(y=-y);var _=1;p===je.LEFT&&(_=-1);var E=je.opposite(p),k=h+y*_;this.setDepth(p,h),this.setDepth(E,k)},l.prototype.getEdgeRing=function(){return this._edgeRing},l.prototype.isInResult=function(){return this._isInResult},l.prototype.setNext=function(p){this._next=p},l.prototype.isVisited=function(){return this._isVisited},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l.depthFactor=function(p,h){return p===U.EXTERIOR&&h===U.INTERIOR?1:p===U.INTERIOR&&h===U.EXTERIOR?-1:0},l}(lo),Km=o(function(){},"Xe");Km.prototype.createNode=function(s){return new fI(s,null)},Km.prototype.interfaces_=function(){return[]},Km.prototype.getClass=function(){return Km};var kn=o(function(){if(this._edges=new Le,this._nodes=null,this._edgeEndList=new Le,arguments.length===0)this._nodes=new Qa(new Km);else if(arguments.length===1){var s=arguments[0];this._nodes=new Qa(s)}},"Ye");kn.prototype.printEdges=function(s){s.println("Edges:");for(var l=0;l<this._edges.size();l++){s.println("edge "+l+":");var p=this._edges.get(l);p.print(s),p.eiList.print(s)}},kn.prototype.find=function(s){return this._nodes.find(s)},kn.prototype.addNode=function(){if(arguments[0]instanceof fI){var s=arguments[0];return this._nodes.addNode(s)}if(arguments[0]instanceof R){var l=arguments[0];return this._nodes.addNode(l)}},kn.prototype.getNodeIterator=function(){return this._nodes.iterator()},kn.prototype.linkResultDirectedEdges=function(){for(var s=this._nodes.iterator();s.hasNext();)s.next().getEdges().linkResultDirectedEdges()},kn.prototype.debugPrintln=function(s){pt.out.println(s)},kn.prototype.isBoundaryNode=function(s,l){var p=this._nodes.find(l);if(p===null)return!1;var h=p.getLabel();return h!==null&&h.getLocation(s)===U.BOUNDARY},kn.prototype.linkAllDirectedEdges=function(){for(var s=this._nodes.iterator();s.hasNext();)s.next().getEdges().linkAllDirectedEdges()},kn.prototype.matchInSameDirection=function(s,l,p,h){return!!s.equals(p)&&Ge.computeOrientation(s,l,h)===Ge.COLLINEAR&&sn.quadrant(s,l)===sn.quadrant(p,h)},kn.prototype.getEdgeEnds=function(){return this._edgeEndList},kn.prototype.debugPrint=function(s){pt.out.print(s)},kn.prototype.getEdgeIterator=function(){return this._edges.iterator()},kn.prototype.findEdgeInSameDirection=function(s,l){for(var p=0;p<this._edges.size();p++){var h=this._edges.get(p),y=h.getCoordinates();if(this.matchInSameDirection(s,l,y[0],y[1])||this.matchInSameDirection(s,l,y[y.length-1],y[y.length-2]))return h}return null},kn.prototype.insertEdge=function(s){this._edges.add(s)},kn.prototype.findEdgeEnd=function(s){for(var l=this.getEdgeEnds().iterator();l.hasNext();){var p=l.next();if(p.getEdge()===s)return p}return null},kn.prototype.addEdges=function(s){for(var l=s.iterator();l.hasNext();){var p=l.next();this._edges.add(p);var h=new nw(p,!0),y=new nw(p,!1);h.setSym(y),y.setSym(h),this.add(h),this.add(y)}},kn.prototype.add=function(s){this._nodes.add(s),this._edgeEndList.add(s)},kn.prototype.getNodes=function(){return this._nodes.values()},kn.prototype.findEdge=function(s,l){for(var p=0;p<this._edges.size();p++){var h=this._edges.get(p),y=h.getCoordinates();if(s.equals(y[0])&&l.equals(y[1]))return h}return null},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},kn.linkResultDirectedEdges=function(s){for(var l=s.iterator();l.hasNext();)l.next().getEdges().linkResultDirectedEdges()};var Ss=o(function(){this._geometryFactory=null,this._shellList=new Le;var s=arguments[0];this._geometryFactory=s},"ke");Ss.prototype.sortShellsAndHoles=function(s,l,p){for(var h=s.iterator();h.hasNext();){var y=h.next();y.isHole()?p.add(y):l.add(y)}},Ss.prototype.computePolygons=function(s){for(var l=new Le,p=s.iterator();p.hasNext();){var h=p.next().toPolygon(this._geometryFactory);l.add(h)}return l},Ss.prototype.placeFreeHoles=function(s,l){for(var p=l.iterator();p.hasNext();){var h=p.next();if(h.getShell()===null){var y=this.findEdgeRingContaining(h,s);if(y===null)throw new Fu("unable to assign hole to a shell",h.getCoordinate(0));h.setShell(y)}}},Ss.prototype.buildMinimalEdgeRings=function(s,l,p){for(var h=new Le,y=s.iterator();y.hasNext();){var _=y.next();if(_.getMaxNodeDegree()>2){_.linkDirectedEdgesForMinimalEdgeRings();var E=_.buildMinimalRings(),k=this.findShell(E);k!==null?(this.placePolygonHoles(k,E),l.add(k)):p.addAll(E)}else h.add(_)}return h},Ss.prototype.containsPoint=function(s){for(var l=this._shellList.iterator();l.hasNext();)if(l.next().containsPoint(s))return!0;return!1},Ss.prototype.buildMaximalEdgeRings=function(s){for(var l=new Le,p=s.iterator();p.hasNext();){var h=p.next();if(h.isInResult()&&h.getLabel().isArea()&&h.getEdgeRing()===null){var y=new sq(h,this._geometryFactory);l.add(y),y.setInResult()}}return l},Ss.prototype.placePolygonHoles=function(s,l){for(var p=l.iterator();p.hasNext();){var h=p.next();h.isHole()&&h.setShell(s)}},Ss.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ss.prototype.findEdgeRingContaining=function(s,l){for(var p=s.getLinearRing(),h=p.getEnvelopeInternal(),y=p.getCoordinateN(0),_=null,E=null,k=l.iterator();k.hasNext();){var V=k.next(),re=V.getLinearRing(),de=re.getEnvelopeInternal();_!==null&&(E=_.getLinearRing().getEnvelopeInternal());var xe=!1;de.contains(h)&&Ge.isPointInRing(y,re.getCoordinates())&&(xe=!0),xe&&(_===null||E.contains(de))&&(_=V)}return _},Ss.prototype.findShell=function(s){for(var l=0,p=null,h=s.iterator();h.hasNext();){var y=h.next();y.isHole()||(p=y,l++)}return Xe.isTrue(l<=1,"found two shells in MinimalEdgeRing list"),p},Ss.prototype.add=function(){if(arguments.length===1){var s=arguments[0];this.add(s.getEdgeEnds(),s.getNodes())}else if(arguments.length===2){var l=arguments[0],p=arguments[1];kn.linkResultDirectedEdges(p);var h=this.buildMaximalEdgeRings(l),y=new Le,_=this.buildMinimalEdgeRings(h,this._shellList,y);this.sortShellsAndHoles(_,this._shellList,y),this.placeFreeHoles(this._shellList,y)}},Ss.prototype.interfaces_=function(){return[]},Ss.prototype.getClass=function(){return Ss};var Jm=o(function(){},"je");Jm.prototype.getBounds=function(){},Jm.prototype.interfaces_=function(){return[]},Jm.prototype.getClass=function(){return Jm};var Pa=o(function(){this._bounds=null,this._item=null;var s=arguments[0],l=arguments[1];this._bounds=s,this._item=l},"He");Pa.prototype.getItem=function(){return this._item},Pa.prototype.getBounds=function(){return this._bounds},Pa.prototype.interfaces_=function(){return[Jm,t]},Pa.prototype.getClass=function(){return Pa};var Nu=o(function(){this._size=null,this._items=null,this._size=0,this._items=new Le,this._items.add(null)},"We");Nu.prototype.poll=function(){if(this.isEmpty())return null;var s=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),s},Nu.prototype.size=function(){return this._size},Nu.prototype.reorder=function(s){for(var l=null,p=this._items.get(s);2*s<=this._size&&((l=2*s)!==this._size&&this._items.get(l+1).compareTo(this._items.get(l))<0&&l++,this._items.get(l).compareTo(p)<0);s=l)this._items.set(s,this._items.get(l));this._items.set(s,p)},Nu.prototype.clear=function(){this._size=0,this._items.clear()},Nu.prototype.isEmpty=function(){return this._size===0},Nu.prototype.add=function(s){this._items.add(null),this._size+=1;var l=this._size;for(this._items.set(0,s);s.compareTo(this._items.get(Math.trunc(l/2)))<0;l/=2)this._items.set(l,this._items.get(Math.trunc(l/2)));this._items.set(l,s)},Nu.prototype.interfaces_=function(){return[]},Nu.prototype.getClass=function(){return Nu};var Gc=o(function(){},"Ke");Gc.prototype.visitItem=function(s){},Gc.prototype.interfaces_=function(){return[]},Gc.prototype.getClass=function(){return Gc};var wd=o(function(){},"Je");wd.prototype.insert=function(s,l){},wd.prototype.remove=function(s,l){},wd.prototype.query=function(){},wd.prototype.interfaces_=function(){return[]},wd.prototype.getClass=function(){return wd};var bi=o(function(){if(this._childBoundables=new Le,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var s=arguments[0];this._level=s}}},"Qe"),JL={serialVersionUID:{configurable:!0}};bi.prototype.getLevel=function(){return this._level},bi.prototype.size=function(){return this._childBoundables.size()},bi.prototype.getChildBoundables=function(){return this._childBoundables},bi.prototype.addChildBoundable=function(s){Xe.isTrue(this._bounds===null),this._childBoundables.add(s)},bi.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},bi.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},bi.prototype.interfaces_=function(){return[Jm,t]},bi.prototype.getClass=function(){return bi},JL.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(bi,JL);var Ta=o(function(){},"$e");Ta.reverseOrder=function(){return{compare:o(function(s,l){return l.compareTo(s)},"compare")}},Ta.min=function(s){return Ta.sort(s),s.get(0)},Ta.sort=function(s,l){var p=s.toArray();l?Ae.sort(p,l):Ae.sort(p);for(var h=s.iterator(),y=0,_=p.length;y<_;y++)h.next(),h.set(p[y])},Ta.singletonList=function(s){var l=new Le;return l.add(s),l};var ci=o(function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var s=arguments[0],l=arguments[1],p=arguments[2];this._boundable1=s,this._boundable2=l,this._itemDistance=p,this._distance=this.distance()},"tn");ci.prototype.expandToQueue=function(s,l){var p=ci.isComposite(this._boundable1),h=ci.isComposite(this._boundable2);if(p&&h)return ci.area(this._boundable1)>ci.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,s,l),null):(this.expand(this._boundable2,this._boundable1,s,l),null);if(p)return this.expand(this._boundable1,this._boundable2,s,l),null;if(h)return this.expand(this._boundable2,this._boundable1,s,l),null;throw new A("neither boundable is composite")},ci.prototype.isLeaves=function(){return!(ci.isComposite(this._boundable1)||ci.isComposite(this._boundable2))},ci.prototype.compareTo=function(s){var l=s;return this._distance<l._distance?-1:this._distance>l._distance?1:0},ci.prototype.expand=function(s,l,p,h){for(var y=s.getChildBoundables().iterator();y.hasNext();){var _=y.next(),E=new ci(_,l,this._itemDistance);E.getDistance()<h&&p.add(E)}},ci.prototype.getBoundable=function(s){return s===0?this._boundable1:this._boundable2},ci.prototype.getDistance=function(){return this._distance},ci.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},ci.prototype.interfaces_=function(){return[B]},ci.prototype.getClass=function(){return ci},ci.area=function(s){return s.getBounds().getArea()},ci.isComposite=function(s){return s instanceof bi};var Ui=o(function s(){if(this._root=null,this._built=!1,this._itemBoundables=new Le,this._nodeCapacity=null,arguments.length===0){var l=s.DEFAULT_NODE_CAPACITY;this._nodeCapacity=l}else if(arguments.length===1){var p=arguments[0];Xe.isTrue(p>1,"Node capacity must be greater than 1"),this._nodeCapacity=p}},"t"),dI={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Ui.prototype.getNodeCapacity=function(){return this._nodeCapacity},Ui.prototype.lastNode=function(s){return s.get(s.size()-1)},Ui.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var s=0,l=arguments[0].getChildBoundables().iterator();l.hasNext();){var p=l.next();p instanceof bi?s+=this.size(p):p instanceof Pa&&(s+=1)}return s}},Ui.prototype.removeItem=function(s,l){for(var p=null,h=s.getChildBoundables().iterator();h.hasNext();){var y=h.next();y instanceof Pa&&y.getItem()===l&&(p=y)}return p!==null&&(s.getChildBoundables().remove(p),!0)},Ui.prototype.itemsTree=function(){if(arguments.length===0){this.build();var s=this.itemsTree(this._root);return s===null?new Le:s}if(arguments.length===1){for(var l=arguments[0],p=new Le,h=l.getChildBoundables().iterator();h.hasNext();){var y=h.next();if(y instanceof bi){var _=this.itemsTree(y);_!==null&&p.add(_)}else y instanceof Pa?p.add(y.getItem()):Xe.shouldNeverReachHere()}return p.size()<=0?null:p}},Ui.prototype.insert=function(s,l){Xe.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Pa(s,l))},Ui.prototype.boundablesAtLevel=function(){if(arguments.length===1){var s=arguments[0],l=new Le;return this.boundablesAtLevel(s,this._root,l),l}if(arguments.length===3){var p=arguments[0],h=arguments[1],y=arguments[2];if(Xe.isTrue(p>-2),h.getLevel()===p)return y.add(h),null;for(var _=h.getChildBoundables().iterator();_.hasNext();){var E=_.next();E instanceof bi?this.boundablesAtLevel(p,E,y):(Xe.isTrue(E instanceof Pa),p===-1&&y.add(E))}return null}},Ui.prototype.query=function(){if(arguments.length===1){var s=arguments[0];this.build();var l=new Le;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),s)&&this.query(s,this._root,l),l}if(arguments.length===2){var p=arguments[0],h=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),p)&&this.query(p,this._root,h)}else if(arguments.length===3){if(oe(arguments[2],Gc)&&arguments[0]instanceof Object&&arguments[1]instanceof bi)for(var y=arguments[0],_=arguments[1],E=arguments[2],k=_.getChildBoundables(),V=0;V<k.size();V++){var re=k.get(V);this.getIntersectsOp().intersects(re.getBounds(),y)&&(re instanceof bi?this.query(y,re,E):re instanceof Pa?E.visitItem(re.getItem()):Xe.shouldNeverReachHere())}else if(oe(arguments[2],Tn)&&arguments[0]instanceof Object&&arguments[1]instanceof bi)for(var de=arguments[0],xe=arguments[1],Ve=arguments[2],$e=xe.getChildBoundables(),Qe=0;Qe<$e.size();Qe++){var dt=$e.get(Qe);this.getIntersectsOp().intersects(dt.getBounds(),de)&&(dt instanceof bi?this.query(de,dt,Ve):dt instanceof Pa?Ve.add(dt.getItem()):Xe.shouldNeverReachHere())}}},Ui.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},Ui.prototype.getRoot=function(){return this.build(),this._root},Ui.prototype.remove=function(){if(arguments.length===2){var s=arguments[0],l=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),s)&&this.remove(s,this._root,l)}if(arguments.length===3){var p=arguments[0],h=arguments[1],y=arguments[2],_=this.removeItem(h,y);if(_)return!0;for(var E=null,k=h.getChildBoundables().iterator();k.hasNext();){var V=k.next();if(this.getIntersectsOp().intersects(V.getBounds(),p)&&V instanceof bi&&(_=this.remove(p,V,y))){E=V;break}}return E!==null&&E.getChildBoundables().isEmpty()&&h.getChildBoundables().remove(E),_}},Ui.prototype.createHigherLevels=function(s,l){Xe.isTrue(!s.isEmpty());var p=this.createParentBoundables(s,l+1);return p.size()===1?p.get(0):this.createHigherLevels(p,l+1)},Ui.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var s=0,l=arguments[0].getChildBoundables().iterator();l.hasNext();){var p=l.next();if(p instanceof bi){var h=this.depth(p);h>s&&(s=h)}}return s+1}},Ui.prototype.createParentBoundables=function(s,l){Xe.isTrue(!s.isEmpty());var p=new Le;p.add(this.createNode(l));var h=new Le(s);Ta.sort(h,this.getComparator());for(var y=h.iterator();y.hasNext();){var _=y.next();this.lastNode(p).getChildBoundables().size()===this.getNodeCapacity()&&p.add(this.createNode(l)),this.lastNode(p).addChildBoundable(_)}return p},Ui.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Ui.prototype.interfaces_=function(){return[t]},Ui.prototype.getClass=function(){return Ui},Ui.compareDoubles=function(s,l){return s>l?1:s<l?-1:0},dI.IntersectsOp.get=function(){return aq},dI.serialVersionUID.get=function(){return-3886435814360241e3},dI.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Ui,dI);var aq=o(function(){},"rn"),Qm=o(function(){},"on");Qm.prototype.distance=function(s,l){},Qm.prototype.interfaces_=function(){return[]},Qm.prototype.getClass=function(){return Qm};var QL=function(s){function l(h){h=h||l.DEFAULT_NODE_CAPACITY,s.call(this,h)}o(l,"n"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return l.prototype.createParentBoundablesFromVerticalSlices=function(h,y){Xe.isTrue(h.length>0);for(var _=new Le,E=0;E<h.length;E++)_.addAll(this.createParentBoundablesFromVerticalSlice(h[E],y));return _},l.prototype.createNode=function(h){return new e7(h)},l.prototype.size=function(){return arguments.length===0?s.prototype.size.call(this):s.prototype.size.apply(this,arguments)},l.prototype.insert=function(){if(arguments.length!==2)return s.prototype.insert.apply(this,arguments);var h=arguments[0],y=arguments[1];if(h.isNull())return null;s.prototype.insert.call(this,h,y)},l.prototype.getIntersectsOp=function(){return l.intersectsOp},l.prototype.verticalSlices=function(h,y){for(var _=Math.trunc(Math.ceil(h.size()/y)),E=new Array(y).fill(null),k=h.iterator(),V=0;V<y;V++){E[V]=new Le;for(var re=0;k.hasNext()&&re<_;){var de=k.next();E[V].add(de),re++}}return E},l.prototype.query=function(){if(arguments.length===1){var h=arguments[0];return s.prototype.query.call(this,h)}if(arguments.length===2){var y=arguments[0],_=arguments[1];s.prototype.query.call(this,y,_)}else if(arguments.length===3){if(oe(arguments[2],Gc)&&arguments[0]instanceof Object&&arguments[1]instanceof bi){var E=arguments[0],k=arguments[1],V=arguments[2];s.prototype.query.call(this,E,k,V)}else if(oe(arguments[2],Tn)&&arguments[0]instanceof Object&&arguments[1]instanceof bi){var re=arguments[0],de=arguments[1],xe=arguments[2];s.prototype.query.call(this,re,de,xe)}}},l.prototype.getComparator=function(){return l.yComparator},l.prototype.createParentBoundablesFromVerticalSlice=function(h,y){return s.prototype.createParentBoundables.call(this,h,y)},l.prototype.remove=function(){if(arguments.length===2){var h=arguments[0],y=arguments[1];return s.prototype.remove.call(this,h,y)}return s.prototype.remove.apply(this,arguments)},l.prototype.depth=function(){return arguments.length===0?s.prototype.depth.call(this):s.prototype.depth.apply(this,arguments)},l.prototype.createParentBoundables=function(h,y){Xe.isTrue(!h.isEmpty());var _=Math.trunc(Math.ceil(h.size()/this.getNodeCapacity())),E=new Le(h);Ta.sort(E,l.xComparator);var k=this.verticalSlices(E,Math.trunc(Math.ceil(Math.sqrt(_))));return this.createParentBoundablesFromVerticalSlices(k,y)},l.prototype.nearestNeighbour=function(){if(arguments.length===1){if(oe(arguments[0],Qm)){var h=arguments[0],y=new ci(this.getRoot(),this.getRoot(),h);return this.nearestNeighbour(y)}if(arguments[0]instanceof ci){var _=arguments[0];return this.nearestNeighbour(_,M.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof l&&oe(arguments[1],Qm)){var E=arguments[0],k=arguments[1],V=new ci(this.getRoot(),E.getRoot(),k);return this.nearestNeighbour(V)}if(arguments[0]instanceof ci&&typeof arguments[1]=="number"){var re=arguments[0],de=arguments[1],xe=null,Ve=new Nu;for(Ve.add(re);!Ve.isEmpty()&&de>0;){var $e=Ve.poll(),Qe=$e.getDistance();if(Qe>=de)break;$e.isLeaves()?(de=Qe,xe=$e):$e.expandToQueue(Ve,de)}return[xe.getBoundable(0).getItem(),xe.getBoundable(1).getItem()]}}else if(arguments.length===3){var dt=arguments[0],$r=arguments[1],fi=arguments[2],No=new Pa(dt,$r),Yl=new ci(this.getRoot(),No,fi);return this.nearestNeighbour(Yl)[0]}},l.prototype.interfaces_=function(){return[wd,t]},l.prototype.getClass=function(){return l},l.centreX=function(h){return l.avg(h.getMinX(),h.getMaxX())},l.avg=function(h,y){return(h+y)/2},l.centreY=function(h){return l.avg(h.getMinY(),h.getMaxY())},p.STRtreeNode.get=function(){return e7},p.serialVersionUID.get=function(){return 0x39920f7d5f261e0},p.xComparator.get=function(){return{interfaces_:o(function(){return[z]},"interfaces_"),compare:o(function(h,y){return s.compareDoubles(l.centreX(h.getBounds()),l.centreX(y.getBounds()))},"compare")}},p.yComparator.get=function(){return{interfaces_:o(function(){return[z]},"interfaces_"),compare:o(function(h,y){return s.compareDoubles(l.centreY(h.getBounds()),l.centreY(y.getBounds()))},"compare")}},p.intersectsOp.get=function(){return{interfaces_:o(function(){return[s.IntersectsOp]},"interfaces_"),intersects:o(function(h,y){return h.intersects(y)},"intersects")}},p.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(l,p),l}(Ui),e7=function(s){function l(){var p=arguments[0];s.call(this,p)}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.computeBounds=function(){for(var p=null,h=this.getChildBoundables().iterator();h.hasNext();){var y=h.next();p===null?p=new ce(y.getBounds()):p.expandToInclude(y.getBounds())}return p},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(bi),es=o(function(){},"un");es.prototype.interfaces_=function(){return[]},es.prototype.getClass=function(){return es},es.relativeSign=function(s,l){return s<l?-1:s>l?1:0},es.compare=function(s,l,p){if(l.equals2D(p))return 0;var h=es.relativeSign(l.x,p.x),y=es.relativeSign(l.y,p.y);switch(s){case 0:return es.compareValue(h,y);case 1:return es.compareValue(y,h);case 2:return es.compareValue(y,-h);case 3:return es.compareValue(-h,y);case 4:return es.compareValue(-h,-y);case 5:return es.compareValue(-y,-h);case 6:return es.compareValue(-y,h);case 7:return es.compareValue(h,-y)}return Xe.shouldNeverReachHere("invalid octant value"),0},es.compareValue=function(s,l){return s<0?-1:s>0?1:l<0?-1:l>0?1:0};var jc=o(function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var s=arguments[0],l=arguments[1],p=arguments[2],h=arguments[3];this._segString=s,this.coord=new R(l),this.segmentIndex=p,this._segmentOctant=h,this._isInterior=!l.equals2D(s.getCoordinate(p))},"ln");jc.prototype.getCoordinate=function(){return this.coord},jc.prototype.print=function(s){s.print(this.coord),s.print(" seg # = "+this.segmentIndex)},jc.prototype.compareTo=function(s){var l=s;return this.segmentIndex<l.segmentIndex?-1:this.segmentIndex>l.segmentIndex?1:this.coord.equals2D(l.coord)?0:es.compare(this._segmentOctant,this.coord,l.coord)},jc.prototype.isEndPoint=function(s){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===s},jc.prototype.isInterior=function(){return this._isInterior},jc.prototype.interfaces_=function(){return[B]},jc.prototype.getClass=function(){return jc};var Mo=o(function(){this._nodeMap=new x,this._edge=null;var s=arguments[0];this._edge=s},"cn");Mo.prototype.getSplitCoordinates=function(){var s=new le;this.addEndpoints();for(var l=this.iterator(),p=l.next();l.hasNext();){var h=l.next();this.addEdgeCoordinates(p,h,s),p=h}return s.toCoordinateArray()},Mo.prototype.addCollapsedNodes=function(){var s=new Le;this.findCollapsesFromInsertedNodes(s),this.findCollapsesFromExistingVertices(s);for(var l=s.iterator();l.hasNext();){var p=l.next().intValue();this.add(this._edge.getCoordinate(p),p)}},Mo.prototype.print=function(s){s.println("Intersections:");for(var l=this.iterator();l.hasNext();)l.next().print(s)},Mo.prototype.findCollapsesFromExistingVertices=function(s){for(var l=0;l<this._edge.size()-2;l++){var p=this._edge.getCoordinate(l),h=this._edge.getCoordinate(l+2);p.equals2D(h)&&s.add(new ue(l+1))}},Mo.prototype.addEdgeCoordinates=function(s,l,p){var h=this._edge.getCoordinate(l.segmentIndex),y=l.isInterior()||!l.coord.equals2D(h);p.add(new R(s.coord),!1);for(var _=s.segmentIndex+1;_<=l.segmentIndex;_++)p.add(this._edge.getCoordinate(_));y&&p.add(new R(l.coord))},Mo.prototype.iterator=function(){return this._nodeMap.values().iterator()},Mo.prototype.addSplitEdges=function(s){this.addEndpoints(),this.addCollapsedNodes();for(var l=this.iterator(),p=l.next();l.hasNext();){var h=l.next(),y=this.createSplitEdge(p,h);s.add(y),p=h}},Mo.prototype.findCollapseIndex=function(s,l,p){if(!s.coord.equals2D(l.coord))return!1;var h=l.segmentIndex-s.segmentIndex;return l.isInterior()||h--,h===1&&(p[0]=s.segmentIndex+1,!0)},Mo.prototype.findCollapsesFromInsertedNodes=function(s){for(var l=new Array(1).fill(null),p=this.iterator(),h=p.next();p.hasNext();){var y=p.next();this.findCollapseIndex(h,y,l)&&s.add(new ue(l[0])),h=y}},Mo.prototype.getEdge=function(){return this._edge},Mo.prototype.addEndpoints=function(){var s=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(s),s)},Mo.prototype.createSplitEdge=function(s,l){var p=l.segmentIndex-s.segmentIndex+2,h=this._edge.getCoordinate(l.segmentIndex),y=l.isInterior()||!l.coord.equals2D(h);y||p--;var _=new Array(p).fill(null),E=0;_[E++]=new R(s.coord);for(var k=s.segmentIndex+1;k<=l.segmentIndex;k++)_[E++]=this._edge.getCoordinate(k);return y&&(_[E]=new R(l.coord)),new Qn(_,this._edge.getData())},Mo.prototype.add=function(s,l){var p=new jc(this._edge,s,l,this._edge.getSegmentOctant(l)),h=this._nodeMap.get(p);return h!==null?(Xe.isTrue(h.coord.equals2D(s),"Found equal nodes with different coordinates"),h):(this._nodeMap.put(p,p),p)},Mo.prototype.checkSplitEdgesCorrectness=function(s){var l=this._edge.getCoordinates(),p=s.get(0).getCoordinate(0);if(!p.equals2D(l[0]))throw new Bt("bad split edge start point at "+p);var h=s.get(s.size()-1).getCoordinates(),y=h[h.length-1];if(!y.equals2D(l[l.length-1]))throw new Bt("bad split edge end point at "+y)},Mo.prototype.interfaces_=function(){return[]},Mo.prototype.getClass=function(){return Mo};var Pd=o(function(){},"pn");Pd.prototype.interfaces_=function(){return[]},Pd.prototype.getClass=function(){return Pd},Pd.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var s=arguments[0],l=arguments[1];if(s===0&&l===0)throw new A("Cannot compute the octant for point ( "+s+", "+l+" )");var p=Math.abs(s),h=Math.abs(l);return s>=0?l>=0?p>=h?0:1:p>=h?7:6:l>=0?p>=h?3:2:p>=h?4:5}if(arguments[0]instanceof R&&arguments[1]instanceof R){var y=arguments[0],_=arguments[1],E=_.x-y.x,k=_.y-y.y;if(E===0&&k===0)throw new A("Cannot compute the octant for two identical points "+y);return Pd.octant(E,k)}};var jl=o(function(){},"hn");jl.prototype.getCoordinates=function(){},jl.prototype.size=function(){},jl.prototype.getCoordinate=function(s){},jl.prototype.isClosed=function(){},jl.prototype.setData=function(s){},jl.prototype.getData=function(){},jl.prototype.interfaces_=function(){return[]},jl.prototype.getClass=function(){return jl};var i1=o(function(){},"fn");i1.prototype.addIntersection=function(s,l){},i1.prototype.interfaces_=function(){return[jl]},i1.prototype.getClass=function(){return i1};var Qn=o(function(){this._nodeList=new Mo(this),this._pts=null,this._data=null;var s=arguments[0],l=arguments[1];this._pts=s,this._data=l},"gn");Qn.prototype.getCoordinates=function(){return this._pts},Qn.prototype.size=function(){return this._pts.length},Qn.prototype.getCoordinate=function(s){return this._pts[s]},Qn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Qn.prototype.getSegmentOctant=function(s){return s===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(s),this.getCoordinate(s+1))},Qn.prototype.setData=function(s){this._data=s},Qn.prototype.safeOctant=function(s,l){return s.equals2D(l)?0:Pd.octant(s,l)},Qn.prototype.getData=function(){return this._data},Qn.prototype.addIntersection=function(){if(arguments.length===2){var s=arguments[0],l=arguments[1];this.addIntersectionNode(s,l)}else if(arguments.length===4){var p=arguments[0],h=arguments[1],y=arguments[3],_=new R(p.getIntersection(y));this.addIntersection(_,h)}},Qn.prototype.toString=function(){return xt.toLineString(new Jn(this._pts))},Qn.prototype.getNodeList=function(){return this._nodeList},Qn.prototype.addIntersectionNode=function(s,l){var p=l,h=p+1;if(h<this._pts.length){var y=this._pts[h];s.equals2D(y)&&(p=h)}return this._nodeList.add(s,p)},Qn.prototype.addIntersections=function(s,l,p){for(var h=0;h<s.getIntersectionNum();h++)this.addIntersection(s,l,p,h)},Qn.prototype.interfaces_=function(){return[i1]},Qn.prototype.getClass=function(){return Qn},Qn.getNodedSubstrings=function(){if(arguments.length===1){var s=arguments[0],l=new Le;return Qn.getNodedSubstrings(s,l),l}if(arguments.length===2)for(var p=arguments[0],h=arguments[1],y=p.iterator();y.hasNext();)y.next().getNodeList().addSplitEdges(h)};var st=o(function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new R,this.p1=new R;else if(arguments.length===1){var s=arguments[0];this.p0=new R(s.p0),this.p1=new R(s.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var l=arguments[0],p=arguments[1],h=arguments[2],y=arguments[3];this.p0=new R(l,p),this.p1=new R(h,y)}},"dn"),t7={serialVersionUID:{configurable:!0}};st.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},st.prototype.orientationIndex=function(){if(arguments[0]instanceof st){var s=arguments[0],l=Ge.orientationIndex(this.p0,this.p1,s.p0),p=Ge.orientationIndex(this.p0,this.p1,s.p1);return l>=0&&p>=0||l<=0&&p<=0?Math.max(l,p):0}if(arguments[0]instanceof R){var h=arguments[0];return Ge.orientationIndex(this.p0,this.p1,h)}},st.prototype.toGeometry=function(s){return s.createLineString([this.p0,this.p1])},st.prototype.isVertical=function(){return this.p0.x===this.p1.x},st.prototype.equals=function(s){if(!(s instanceof st))return!1;var l=s;return this.p0.equals(l.p0)&&this.p1.equals(l.p1)},st.prototype.intersection=function(s){var l=new Gi;return l.computeIntersection(this.p0,this.p1,s.p0,s.p1),l.hasIntersection()?l.getIntersection(0):null},st.prototype.project=function(){if(arguments[0]instanceof R){var s=arguments[0];if(s.equals(this.p0)||s.equals(this.p1))return new R(s);var l=this.projectionFactor(s),p=new R;return p.x=this.p0.x+l*(this.p1.x-this.p0.x),p.y=this.p0.y+l*(this.p1.y-this.p0.y),p}if(arguments[0]instanceof st){var h=arguments[0],y=this.projectionFactor(h.p0),_=this.projectionFactor(h.p1);if(y>=1&&_>=1||y<=0&&_<=0)return null;var E=this.project(h.p0);y<0&&(E=this.p0),y>1&&(E=this.p1);var k=this.project(h.p1);return _<0&&(k=this.p0),_>1&&(k=this.p1),new st(E,k)}},st.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},st.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},st.prototype.getCoordinate=function(s){return s===0?this.p0:this.p1},st.prototype.distancePerpendicular=function(s){return Ge.distancePointLinePerpendicular(s,this.p0,this.p1)},st.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},st.prototype.midPoint=function(){return st.midPoint(this.p0,this.p1)},st.prototype.projectionFactor=function(s){if(s.equals(this.p0))return 0;if(s.equals(this.p1))return 1;var l=this.p1.x-this.p0.x,p=this.p1.y-this.p0.y,h=l*l+p*p;return h<=0?M.NaN:((s.x-this.p0.x)*l+(s.y-this.p0.y)*p)/h},st.prototype.closestPoints=function(s){var l=this.intersection(s);if(l!==null)return[l,l];var p=new Array(2).fill(null),h=M.MAX_VALUE,y=null,_=this.closestPoint(s.p0);h=_.distance(s.p0),p[0]=_,p[1]=s.p0;var E=this.closestPoint(s.p1);(y=E.distance(s.p1))<h&&(h=y,p[0]=E,p[1]=s.p1);var k=s.closestPoint(this.p0);(y=k.distance(this.p0))<h&&(h=y,p[0]=this.p0,p[1]=k);var V=s.closestPoint(this.p1);return(y=V.distance(this.p1))<h&&(h=y,p[0]=this.p1,p[1]=V),p},st.prototype.closestPoint=function(s){var l=this.projectionFactor(s);return l>0&&l<1?this.project(s):this.p0.distance(s)<this.p1.distance(s)?this.p0:this.p1},st.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},st.prototype.getLength=function(){return this.p0.distance(this.p1)},st.prototype.compareTo=function(s){var l=s,p=this.p0.compareTo(l.p0);return p!==0?p:this.p1.compareTo(l.p1)},st.prototype.reverse=function(){var s=this.p0;this.p0=this.p1,this.p1=s},st.prototype.equalsTopo=function(s){return this.p0.equals(s.p0)&&(this.p1.equals(s.p1)||this.p0.equals(s.p1))&&this.p1.equals(s.p0)},st.prototype.lineIntersection=function(s){try{return te.intersection(this.p0,this.p1,s.p0,s.p1)}catch(l){if(!(l instanceof yt))throw l}return null},st.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},st.prototype.pointAlongOffset=function(s,l){var p=this.p0.x+s*(this.p1.x-this.p0.x),h=this.p0.y+s*(this.p1.y-this.p0.y),y=this.p1.x-this.p0.x,_=this.p1.y-this.p0.y,E=Math.sqrt(y*y+_*_),k=0,V=0;if(l!==0){if(E<=0)throw new Error("Cannot compute offset from zero-length line segment");k=l*y/E,V=l*_/E}return new R(p-V,h+k)},st.prototype.setCoordinates=function(){if(arguments.length===1){var s=arguments[0];this.setCoordinates(s.p0,s.p1)}else if(arguments.length===2){var l=arguments[0],p=arguments[1];this.p0.x=l.x,this.p0.y=l.y,this.p1.x=p.x,this.p1.y=p.y}},st.prototype.segmentFraction=function(s){var l=this.projectionFactor(s);return l<0?l=0:(l>1||M.isNaN(l))&&(l=1),l},st.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},st.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},st.prototype.distance=function(){if(arguments[0]instanceof st){var s=arguments[0];return Ge.distanceLineLine(this.p0,this.p1,s.p0,s.p1)}if(arguments[0]instanceof R){var l=arguments[0];return Ge.distancePointLine(l,this.p0,this.p1)}},st.prototype.pointAlong=function(s){var l=new R;return l.x=this.p0.x+s*(this.p1.x-this.p0.x),l.y=this.p0.y+s*(this.p1.y-this.p0.y),l},st.prototype.hashCode=function(){var s=M.doubleToLongBits(this.p0.x);s^=31*M.doubleToLongBits(this.p0.y);var l=Math.trunc(s)^Math.trunc(s>>32),p=M.doubleToLongBits(this.p1.x);return p^=31*M.doubleToLongBits(this.p1.y),l^(Math.trunc(p)^Math.trunc(p>>32))},st.prototype.interfaces_=function(){return[B,t]},st.prototype.getClass=function(){return st},st.midPoint=function(s,l){return new R((s.x+l.x)/2,(s.y+l.y)/2)},t7.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(st,t7);var o1=o(function(){this.tempEnv1=new ce,this.tempEnv2=new ce,this._overlapSeg1=new st,this._overlapSeg2=new st},"_n");o1.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var s=arguments[0],l=arguments[1],p=arguments[2],h=arguments[3];s.getLineSegment(l,this._overlapSeg1),p.getLineSegment(h,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},o1.prototype.interfaces_=function(){return[]},o1.prototype.getClass=function(){return o1};var _s=o(function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var s=arguments[0],l=arguments[1],p=arguments[2],h=arguments[3];this._pts=s,this._start=l,this._end=p,this._context=h},"mn");_s.prototype.getLineSegment=function(s,l){l.p0=this._pts[s],l.p1=this._pts[s+1]},_s.prototype.computeSelect=function(s,l,p,h){var y=this._pts[l],_=this._pts[p];if(h.tempEnv1.init(y,_),p-l==1)return h.select(this,l),null;if(!s.intersects(h.tempEnv1))return null;var E=Math.trunc((l+p)/2);l<E&&this.computeSelect(s,l,E,h),E<p&&this.computeSelect(s,E,p,h)},_s.prototype.getCoordinates=function(){for(var s=new Array(this._end-this._start+1).fill(null),l=0,p=this._start;p<=this._end;p++)s[l++]=this._pts[p];return s},_s.prototype.computeOverlaps=function(s,l){this.computeOverlapsInternal(this._start,this._end,s,s._start,s._end,l)},_s.prototype.setId=function(s){this._id=s},_s.prototype.select=function(s,l){this.computeSelect(s,this._start,this._end,l)},_s.prototype.getEnvelope=function(){if(this._env===null){var s=this._pts[this._start],l=this._pts[this._end];this._env=new ce(s,l)}return this._env},_s.prototype.getEndIndex=function(){return this._end},_s.prototype.getStartIndex=function(){return this._start},_s.prototype.getContext=function(){return this._context},_s.prototype.getId=function(){return this._id},_s.prototype.computeOverlapsInternal=function(s,l,p,h,y,_){var E=this._pts[s],k=this._pts[l],V=p._pts[h],re=p._pts[y];if(l-s==1&&y-h==1)return _.overlap(this,s,p,h),null;if(_.tempEnv1.init(E,k),_.tempEnv2.init(V,re),!_.tempEnv1.intersects(_.tempEnv2))return null;var de=Math.trunc((s+l)/2),xe=Math.trunc((h+y)/2);s<de&&(h<xe&&this.computeOverlapsInternal(s,de,p,h,xe,_),xe<y&&this.computeOverlapsInternal(s,de,p,xe,y,_)),de<l&&(h<xe&&this.computeOverlapsInternal(de,l,p,h,xe,_),xe<y&&this.computeOverlapsInternal(de,l,p,xe,y,_))},_s.prototype.interfaces_=function(){return[]},_s.prototype.getClass=function(){return _s};var el=o(function(){},"vn");el.prototype.interfaces_=function(){return[]},el.prototype.getClass=function(){return el},el.getChainStartIndices=function(s){var l=0,p=new Le;p.add(new ue(l));do{var h=el.findChainEnd(s,l);p.add(new ue(h)),l=h}while(l<s.length-1);return el.toIntArray(p)},el.findChainEnd=function(s,l){for(var p=l;p<s.length-1&&s[p].equals2D(s[p+1]);)p++;if(p>=s.length-1)return s.length-1;for(var h=sn.quadrant(s[p],s[p+1]),y=l+1;y<s.length&&!(!s[y-1].equals2D(s[y])&&sn.quadrant(s[y-1],s[y])!==h);)y++;return y-1},el.getChains=function(){if(arguments.length===1){var s=arguments[0];return el.getChains(s,null)}if(arguments.length===2){for(var l=arguments[0],p=arguments[1],h=new Le,y=el.getChainStartIndices(l),_=0;_<y.length-1;_++){var E=new _s(l,y[_],y[_+1],p);h.add(E)}return h}},el.toIntArray=function(s){for(var l=new Array(s.size()).fill(null),p=0;p<l.length;p++)l[p]=s.get(p).intValue();return l};var pf=o(function(){},"In");pf.prototype.computeNodes=function(s){},pf.prototype.getNodedSubstrings=function(){},pf.prototype.interfaces_=function(){return[]},pf.prototype.getClass=function(){return pf};var s1=o(function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var s=arguments[0];this.setSegmentIntersector(s)}}},"En");s1.prototype.setSegmentIntersector=function(s){this._segInt=s},s1.prototype.interfaces_=function(){return[pf]},s1.prototype.getClass=function(){return s1};var iw=function(s){function l(h){h?s.call(this,h):s.call(this),this._monoChains=new Le,this._index=new QL,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}o(l,"e"),s&&(l.__proto__=s),(l.prototype=Object.create(s&&s.prototype)).constructor=l;var p={SegmentOverlapAction:{configurable:!0}};return l.prototype.getMonotoneChains=function(){return this._monoChains},l.prototype.getNodedSubstrings=function(){return Qn.getNodedSubstrings(this._nodedSegStrings)},l.prototype.getIndex=function(){return this._index},l.prototype.add=function(h){for(var y=el.getChains(h.getCoordinates(),h).iterator();y.hasNext();){var _=y.next();_.setId(this._idCounter++),this._index.insert(_.getEnvelope(),_),this._monoChains.add(_)}},l.prototype.computeNodes=function(h){this._nodedSegStrings=h;for(var y=h.iterator();y.hasNext();)this.add(y.next());this.intersectChains()},l.prototype.intersectChains=function(){for(var h=new r7(this._segInt),y=this._monoChains.iterator();y.hasNext();)for(var _=y.next(),E=this._index.query(_.getEnvelope()).iterator();E.hasNext();){var k=E.next();if(k.getId()>_.getId()&&(_.computeOverlaps(k,h),this._nOverlaps++),this._segInt.isDone())return null}},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},p.SegmentOverlapAction.get=function(){return r7},Object.defineProperties(l,p),l}(s1),r7=function(s){function l(){s.call(this),this._si=null;var p=arguments[0];this._si=p}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.overlap=function(){if(arguments.length!==4)return s.prototype.overlap.apply(this,arguments);var p=arguments[0],h=arguments[1],y=arguments[2],_=arguments[3],E=p.getContext(),k=y.getContext();this._si.processIntersections(E,h,k,_)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(o1),Cr=o(function s(){if(this._quadrantSegments=s.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=s.CAP_ROUND,this._joinStyle=s.JOIN_ROUND,this._mitreLimit=s.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=s.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var l=arguments[0];this.setQuadrantSegments(l)}else if(arguments.length===2){var p=arguments[0],h=arguments[1];this.setQuadrantSegments(p),this.setEndCapStyle(h)}else if(arguments.length===4){var y=arguments[0],_=arguments[1],E=arguments[2],k=arguments[3];this.setQuadrantSegments(y),this.setEndCapStyle(_),this.setJoinStyle(E),this.setMitreLimit(k)}}},"t"),Ru={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}};Cr.prototype.getEndCapStyle=function(){return this._endCapStyle},Cr.prototype.isSingleSided=function(){return this._isSingleSided},Cr.prototype.setQuadrantSegments=function(s){this._quadrantSegments=s,this._quadrantSegments===0&&(this._joinStyle=Cr.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Cr.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),s<=0&&(this._quadrantSegments=1),this._joinStyle!==Cr.JOIN_ROUND&&(this._quadrantSegments=Cr.DEFAULT_QUADRANT_SEGMENTS)},Cr.prototype.getJoinStyle=function(){return this._joinStyle},Cr.prototype.setJoinStyle=function(s){this._joinStyle=s},Cr.prototype.setSimplifyFactor=function(s){this._simplifyFactor=s<0?0:s},Cr.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Cr.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Cr.prototype.setEndCapStyle=function(s){this._endCapStyle=s},Cr.prototype.getMitreLimit=function(){return this._mitreLimit},Cr.prototype.setMitreLimit=function(s){this._mitreLimit=s},Cr.prototype.setSingleSided=function(s){this._isSingleSided=s},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Cr.bufferDistanceError=function(s){var l=Math.PI/2/s;return 1-Math.cos(l/2)},Ru.CAP_ROUND.get=function(){return 1},Ru.CAP_FLAT.get=function(){return 2},Ru.CAP_SQUARE.get=function(){return 3},Ru.JOIN_ROUND.get=function(){return 1},Ru.JOIN_MITRE.get=function(){return 2},Ru.JOIN_BEVEL.get=function(){return 3},Ru.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Ru.DEFAULT_MITRE_LIMIT.get=function(){return 5},Ru.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Cr,Ru);var $n=o(function(s){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Ge.COUNTERCLOCKWISE,this._inputLine=s||null},"Ln"),a1={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};$n.prototype.isDeletable=function(s,l,p,h){var y=this._inputLine[s],_=this._inputLine[l],E=this._inputLine[p];return!!this.isConcave(y,_,E)&&!!this.isShallow(y,_,E,h)&&this.isShallowSampled(y,_,s,p,h)},$n.prototype.deleteShallowConcavities=function(){for(var s=1,l=this.findNextNonDeletedIndex(s),p=this.findNextNonDeletedIndex(l),h=!1;p<this._inputLine.length;){var y=!1;this.isDeletable(s,l,p,this._distanceTol)&&(this._isDeleted[l]=$n.DELETE,y=!0,h=!0),s=y?p:l,l=this.findNextNonDeletedIndex(s),p=this.findNextNonDeletedIndex(l)}return h},$n.prototype.isShallowConcavity=function(s,l,p,h){return Ge.computeOrientation(s,l,p)!==this._angleOrientation?!1:Ge.distancePointLine(l,s,p)<h},$n.prototype.isShallowSampled=function(s,l,p,h,y){var _=Math.trunc((h-p)/$n.NUM_PTS_TO_CHECK);_<=0&&(_=1);for(var E=p;E<h;E+=_)if(!this.isShallow(s,l,this._inputLine[E],y))return!1;return!0},$n.prototype.isConcave=function(s,l,p){var h=Ge.computeOrientation(s,l,p)===this._angleOrientation;return h},$n.prototype.simplify=function(s){this._distanceTol=Math.abs(s),s<0&&(this._angleOrientation=Ge.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var l=!1;do l=this.deleteShallowConcavities();while(l);return this.collapseLine()},$n.prototype.findNextNonDeletedIndex=function(s){for(var l=s+1;l<this._inputLine.length&&this._isDeleted[l]===$n.DELETE;)l++;return l},$n.prototype.isShallow=function(s,l,p,h){return Ge.distancePointLine(l,s,p)<h},$n.prototype.collapseLine=function(){for(var s=new le,l=0;l<this._inputLine.length;l++)this._isDeleted[l]!==$n.DELETE&&s.add(this._inputLine[l]);return s.toCoordinateArray()},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.simplify=function(s,l){return new $n(s).simplify(l)},a1.INIT.get=function(){return 0},a1.DELETE.get=function(){return 1},a1.KEEP.get=function(){return 1},a1.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties($n,a1);var Bs=o(function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Le},"wn"),n7={COORDINATE_ARRAY_TYPE:{configurable:!0}};Bs.prototype.getCoordinates=function(){return this._ptList.toArray(Bs.COORDINATE_ARRAY_TYPE)},Bs.prototype.setPrecisionModel=function(s){this._precisionModel=s},Bs.prototype.addPt=function(s){var l=new R(s);if(this._precisionModel.makePrecise(l),this.isRedundant(l))return null;this._ptList.add(l)},Bs.prototype.revere=function(){},Bs.prototype.addPts=function(s,l){if(l)for(var p=0;p<s.length;p++)this.addPt(s[p]);else for(var h=s.length-1;h>=0;h--)this.addPt(s[h])},Bs.prototype.isRedundant=function(s){if(this._ptList.size()<1)return!1;var l=this._ptList.get(this._ptList.size()-1);return s.distance(l)<this._minimimVertexDistance},Bs.prototype.toString=function(){return new jt().createLineString(this.getCoordinates()).toString()},Bs.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var s=new R(this._ptList.get(0)),l=this._ptList.get(this._ptList.size()-1);if(s.equals(l))return null;this._ptList.add(s)},Bs.prototype.setMinimumVertexDistance=function(s){this._minimimVertexDistance=s},Bs.prototype.interfaces_=function(){return[]},Bs.prototype.getClass=function(){return Bs},n7.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Bs,n7);var $t=o(function(){},"Tn"),Td={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t},$t.toDegrees=function(s){return 180*s/Math.PI},$t.normalize=function(s){for(;s>Math.PI;)s-=$t.PI_TIMES_2;for(;s<=-Math.PI;)s+=$t.PI_TIMES_2;return s},$t.angle=function(){if(arguments.length===1){var s=arguments[0];return Math.atan2(s.y,s.x)}if(arguments.length===2){var l=arguments[0],p=arguments[1],h=p.x-l.x,y=p.y-l.y;return Math.atan2(y,h)}},$t.isAcute=function(s,l,p){var h=s.x-l.x,y=s.y-l.y;return h*(p.x-l.x)+y*(p.y-l.y)>0},$t.isObtuse=function(s,l,p){var h=s.x-l.x,y=s.y-l.y;return h*(p.x-l.x)+y*(p.y-l.y)<0},$t.interiorAngle=function(s,l,p){var h=$t.angle(l,s),y=$t.angle(l,p);return Math.abs(y-h)},$t.normalizePositive=function(s){if(s<0){for(;s<0;)s+=$t.PI_TIMES_2;s>=$t.PI_TIMES_2&&(s=0)}else{for(;s>=$t.PI_TIMES_2;)s-=$t.PI_TIMES_2;s<0&&(s=0)}return s},$t.angleBetween=function(s,l,p){var h=$t.angle(l,s),y=$t.angle(l,p);return $t.diff(h,y)},$t.diff=function(s,l){var p=null;return(p=s<l?l-s:s-l)>Math.PI&&(p=2*Math.PI-p),p},$t.toRadians=function(s){return s*Math.PI/180},$t.getTurn=function(s,l){var p=Math.sin(l-s);return p>0?$t.COUNTERCLOCKWISE:p<0?$t.CLOCKWISE:$t.NONE},$t.angleBetweenOriented=function(s,l,p){var h=$t.angle(l,s),y=$t.angle(l,p)-h;return y<=-Math.PI?y+$t.PI_TIMES_2:y>Math.PI?y-$t.PI_TIMES_2:y},Td.PI_TIMES_2.get=function(){return 2*Math.PI},Td.PI_OVER_2.get=function(){return Math.PI/2},Td.PI_OVER_4.get=function(){return Math.PI/4},Td.COUNTERCLOCKWISE.get=function(){return Ge.COUNTERCLOCKWISE},Td.CLOCKWISE.get=function(){return Ge.CLOCKWISE},Td.NONE.get=function(){return Ge.COLLINEAR},Object.defineProperties($t,Td);var xn=o(function s(){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 st,this._seg1=new st,this._offset0=new st,this._offset1=new st,this._side=0,this._hasNarrowConcaveAngle=!1;var l=arguments[0],p=arguments[1],h=arguments[2];this._precisionModel=l,this._bufParams=p,this._li=new Gi,this._filletAngleQuantum=Math.PI/2/p.getQuadrantSegments(),p.getQuadrantSegments()>=8&&p.getJoinStyle()===Cr.JOIN_ROUND&&(this._closingSegLengthFactor=s.MAX_CLOSING_SEG_LEN_FACTOR),this.init(h)},"t"),l1={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}};xn.prototype.addNextSegment=function(s,l){if(this._s0=this._s1,this._s1=this._s2,this._s2=s,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 p=Ge.computeOrientation(this._s0,this._s1,this._s2),h=p===Ge.CLOCKWISE&&this._side===je.LEFT||p===Ge.COUNTERCLOCKWISE&&this._side===je.RIGHT;p===0?this.addCollinear(l):h?this.addOutsideTurn(p,l):this.addInsideTurn(p,l)},xn.prototype.addLineEndCap=function(s,l){var p=new st(s,l),h=new st;this.computeOffsetSegment(p,je.LEFT,this._distance,h);var y=new st;this.computeOffsetSegment(p,je.RIGHT,this._distance,y);var _=l.x-s.x,E=l.y-s.y,k=Math.atan2(E,_);switch(this._bufParams.getEndCapStyle()){case Cr.CAP_ROUND:this._segList.addPt(h.p1),this.addFilletArc(l,k+Math.PI/2,k-Math.PI/2,Ge.CLOCKWISE,this._distance),this._segList.addPt(y.p1);break;case Cr.CAP_FLAT:this._segList.addPt(h.p1),this._segList.addPt(y.p1);break;case Cr.CAP_SQUARE:var V=new R;V.x=Math.abs(this._distance)*Math.cos(k),V.y=Math.abs(this._distance)*Math.sin(k);var re=new R(h.p1.x+V.x,h.p1.y+V.y),de=new R(y.p1.x+V.x,y.p1.y+V.y);this._segList.addPt(re),this._segList.addPt(de)}},xn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},xn.prototype.addMitreJoin=function(s,l,p,h){var y=!0,_=null;try{_=te.intersection(l.p0,l.p1,p.p0,p.p1),(h<=0?1:_.distance(s)/Math.abs(h))>this._bufParams.getMitreLimit()&&(y=!1)}catch(E){if(!(E instanceof yt))throw E;_=new R(0,0),y=!1}y?this._segList.addPt(_):this.addLimitedMitreJoin(l,p,h,this._bufParams.getMitreLimit())},xn.prototype.addFilletCorner=function(s,l,p,h,y){var _=l.x-s.x,E=l.y-s.y,k=Math.atan2(E,_),V=p.x-s.x,re=p.y-s.y,de=Math.atan2(re,V);h===Ge.CLOCKWISE?k<=de&&(k+=2*Math.PI):k>=de&&(k-=2*Math.PI),this._segList.addPt(l),this.addFilletArc(s,k,de,h,y),this._segList.addPt(p)},xn.prototype.addOutsideTurn=function(s,l){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*xn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Cr.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Cr.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(l&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,s,this._distance),this._segList.addPt(this._offset1.p0))},xn.prototype.createSquare=function(s){this._segList.addPt(new R(s.x+this._distance,s.y+this._distance)),this._segList.addPt(new R(s.x+this._distance,s.y-this._distance)),this._segList.addPt(new R(s.x-this._distance,s.y-this._distance)),this._segList.addPt(new R(s.x-this._distance,s.y+this._distance)),this._segList.closeRing()},xn.prototype.addSegments=function(s,l){this._segList.addPts(s,l)},xn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},xn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},xn.prototype.initSideSegments=function(s,l,p){this._s1=s,this._s2=l,this._side=p,this._seg1.setCoordinates(s,l),this.computeOffsetSegment(this._seg1,p,this._distance,this._offset1)},xn.prototype.addLimitedMitreJoin=function(s,l,p,h){var y=this._seg0.p1,_=$t.angle(y,this._seg0.p0),E=$t.angleBetweenOriented(this._seg0.p0,y,this._seg1.p1)/2,k=$t.normalize(_+E),V=$t.normalize(k+Math.PI),re=h*p,de=p-re*Math.abs(Math.sin(E)),xe=y.x+re*Math.cos(V),Ve=y.y+re*Math.sin(V),$e=new R(xe,Ve),Qe=new st(y,$e),dt=Qe.pointAlongOffset(1,de),$r=Qe.pointAlongOffset(1,-de);this._side===je.LEFT?(this._segList.addPt(dt),this._segList.addPt($r)):(this._segList.addPt($r),this._segList.addPt(dt))},xn.prototype.computeOffsetSegment=function(s,l,p,h){var y=l===je.LEFT?1:-1,_=s.p1.x-s.p0.x,E=s.p1.y-s.p0.y,k=Math.sqrt(_*_+E*E),V=y*p*_/k,re=y*p*E/k;h.p0.x=s.p0.x-re,h.p0.y=s.p0.y+V,h.p1.x=s.p1.x-re,h.p1.y=s.p1.y+V},xn.prototype.addFilletArc=function(s,l,p,h,y){var _=h===Ge.CLOCKWISE?-1:1,E=Math.abs(l-p),k=Math.trunc(E/this._filletAngleQuantum+.5);if(k<1)return null;for(var V=E/k,re=0,de=new R;re<E;){var xe=l+_*re;de.x=s.x+y*Math.cos(xe),de.y=s.y+y*Math.sin(xe),this._segList.addPt(de),re+=V}},xn.prototype.addInsideTurn=function(s,l){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*xn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var p=new R((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(p);var h=new R((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(h)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},xn.prototype.createCircle=function(s){var l=new R(s.x+this._distance,s.y);this._segList.addPt(l),this.addFilletArc(s,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},xn.prototype.addBevelJoin=function(s,l){this._segList.addPt(s.p1),this._segList.addPt(l.p0)},xn.prototype.init=function(s){this._distance=s,this._maxCurveSegmentError=s*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Bs,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(s*xn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},xn.prototype.addCollinear=function(s){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Cr.JOIN_BEVEL||this._bufParams.getJoinStyle()===Cr.JOIN_MITRE?(s&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,Ge.CLOCKWISE,this._distance))},xn.prototype.closeRing=function(){this._segList.closeRing()},xn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},l1.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},l1.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},l1.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},l1.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(xn,l1);var ts=o(function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var s=arguments[0],l=arguments[1];this._precisionModel=s,this._bufParams=l},"Mn");ts.prototype.getOffsetCurve=function(s,l){if(this._distance=l,l===0)return null;var p=l<0,h=Math.abs(l),y=this.getSegGen(h);s.length<=1?this.computePointCurve(s[0],y):this.computeOffsetCurve(s,p,y);var _=y.getCoordinates();return p&&F.reverse(_),_},ts.prototype.computeSingleSidedBufferCurve=function(s,l,p){var h=this.simplifyTolerance(this._distance);if(l){p.addSegments(s,!0);var y=$n.simplify(s,-h),_=y.length-1;p.initSideSegments(y[_],y[_-1],je.LEFT),p.addFirstSegment();for(var E=_-2;E>=0;E--)p.addNextSegment(y[E],!0)}else{p.addSegments(s,!1);var k=$n.simplify(s,h),V=k.length-1;p.initSideSegments(k[0],k[1],je.LEFT),p.addFirstSegment();for(var re=2;re<=V;re++)p.addNextSegment(k[re],!0)}p.addLastSegment(),p.closeRing()},ts.prototype.computeRingBufferCurve=function(s,l,p){var h=this.simplifyTolerance(this._distance);l===je.RIGHT&&(h=-h);var y=$n.simplify(s,h),_=y.length-1;p.initSideSegments(y[_-1],y[0],l);for(var E=1;E<=_;E++){var k=E!==1;p.addNextSegment(y[E],k)}p.closeRing()},ts.prototype.computeLineBufferCurve=function(s,l){var p=this.simplifyTolerance(this._distance),h=$n.simplify(s,p),y=h.length-1;l.initSideSegments(h[0],h[1],je.LEFT);for(var _=2;_<=y;_++)l.addNextSegment(h[_],!0);l.addLastSegment(),l.addLineEndCap(h[y-1],h[y]);var E=$n.simplify(s,-p),k=E.length-1;l.initSideSegments(E[k],E[k-1],je.LEFT);for(var V=k-2;V>=0;V--)l.addNextSegment(E[V],!0);l.addLastSegment(),l.addLineEndCap(E[1],E[0]),l.closeRing()},ts.prototype.computePointCurve=function(s,l){switch(this._bufParams.getEndCapStyle()){case Cr.CAP_ROUND:l.createCircle(s);break;case Cr.CAP_SQUARE:l.createSquare(s)}},ts.prototype.getLineCurve=function(s,l){if(this._distance=l,l<0&&!this._bufParams.isSingleSided()||l===0)return null;var p=Math.abs(l),h=this.getSegGen(p);if(s.length<=1)this.computePointCurve(s[0],h);else if(this._bufParams.isSingleSided()){var y=l<0;this.computeSingleSidedBufferCurve(s,y,h)}else this.computeLineBufferCurve(s,h);return h.getCoordinates()},ts.prototype.getBufferParameters=function(){return this._bufParams},ts.prototype.simplifyTolerance=function(s){return s*this._bufParams.getSimplifyFactor()},ts.prototype.getRingCurve=function(s,l,p){if(this._distance=p,s.length<=2)return this.getLineCurve(s,p);if(p===0)return ts.copyCoordinates(s);var h=this.getSegGen(p);return this.computeRingBufferCurve(s,l,h),h.getCoordinates()},ts.prototype.computeOffsetCurve=function(s,l,p){var h=this.simplifyTolerance(this._distance);if(l){var y=$n.simplify(s,-h),_=y.length-1;p.initSideSegments(y[_],y[_-1],je.LEFT),p.addFirstSegment();for(var E=_-2;E>=0;E--)p.addNextSegment(y[E],!0)}else{var k=$n.simplify(s,h),V=k.length-1;p.initSideSegments(k[0],k[1],je.LEFT),p.addFirstSegment();for(var re=2;re<=V;re++)p.addNextSegment(k[re],!0)}p.addLastSegment()},ts.prototype.getSegGen=function(s){return new xn(this._precisionModel,this._bufParams,s)},ts.prototype.interfaces_=function(){return[]},ts.prototype.getClass=function(){return ts},ts.copyCoordinates=function(s){for(var l=new Array(s.length).fill(null),p=0;p<l.length;p++)l[p]=new R(s[p]);return l};var Ed=o(function(){this._subgraphs=null,this._seg=new st,this._cga=new Ge;var s=arguments[0];this._subgraphs=s},"An"),i7={DepthSegment:{configurable:!0}};Ed.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var s=arguments[0],l=new Le,p=this._subgraphs.iterator();p.hasNext();){var h=p.next(),y=h.getEnvelope();s.y<y.getMinY()||s.y>y.getMaxY()||this.findStabbedSegments(s,h.getDirectedEdges(),l)}return l}if(arguments.length===3){if(oe(arguments[2],Tn)&&arguments[0]instanceof R&&arguments[1]instanceof nw){for(var _=arguments[0],E=arguments[1],k=arguments[2],V=E.getEdge().getCoordinates(),re=0;re<V.length-1;re++)if(this._seg.p0=V[re],this._seg.p1=V[re+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||Ge.computeOrientation(this._seg.p0,this._seg.p1,_)===Ge.RIGHT)){var de=E.getDepth(je.LEFT);this._seg.p0.equals(V[re])||(de=E.getDepth(je.RIGHT));var xe=new ff(this._seg,de);k.add(xe)}}else if(oe(arguments[2],Tn)&&arguments[0]instanceof R&&oe(arguments[1],Tn))for(var Ve=arguments[0],$e=arguments[1],Qe=arguments[2],dt=$e.iterator();dt.hasNext();){var $r=dt.next();$r.isForward()&&this.findStabbedSegments(Ve,$r,Qe)}}},Ed.prototype.getDepth=function(s){var l=this.findStabbedSegments(s);return l.size()===0?0:Ta.min(l)._leftDepth},Ed.prototype.interfaces_=function(){return[]},Ed.prototype.getClass=function(){return Ed},i7.DepthSegment.get=function(){return ff},Object.defineProperties(Ed,i7);var ff=o(function(){this._upwardSeg=null,this._leftDepth=null;var s=arguments[0],l=arguments[1];this._upwardSeg=new st(s),this._leftDepth=l},"Gn");ff.prototype.compareTo=function(s){var l=s;if(this._upwardSeg.minX()>=l._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=l._upwardSeg.minX())return-1;var p=this._upwardSeg.orientationIndex(l._upwardSeg);return p!==0||(p=-1*l._upwardSeg.orientationIndex(this._upwardSeg))!=0?p:this._upwardSeg.compareTo(l._upwardSeg)},ff.prototype.compareX=function(s,l){var p=s.p0.compareTo(l.p0);return p!==0?p:s.p1.compareTo(l.p1)},ff.prototype.toString=function(){return this._upwardSeg.toString()},ff.prototype.interfaces_=function(){return[B]},ff.prototype.getClass=function(){return ff};var wr=o(function(s,l,p){this.p0=s||null,this.p1=l||null,this.p2=p||null},"qn");wr.prototype.area=function(){return wr.area(this.p0,this.p1,this.p2)},wr.prototype.signedArea=function(){return wr.signedArea(this.p0,this.p1,this.p2)},wr.prototype.interpolateZ=function(s){if(s===null)throw new A("Supplied point is null.");return wr.interpolateZ(s,this.p0,this.p1,this.p2)},wr.prototype.longestSideLength=function(){return wr.longestSideLength(this.p0,this.p1,this.p2)},wr.prototype.isAcute=function(){return wr.isAcute(this.p0,this.p1,this.p2)},wr.prototype.circumcentre=function(){return wr.circumcentre(this.p0,this.p1,this.p2)},wr.prototype.area3D=function(){return wr.area3D(this.p0,this.p1,this.p2)},wr.prototype.centroid=function(){return wr.centroid(this.p0,this.p1,this.p2)},wr.prototype.inCentre=function(){return wr.inCentre(this.p0,this.p1,this.p2)},wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},wr.area=function(s,l,p){return Math.abs(((p.x-s.x)*(l.y-s.y)-(l.x-s.x)*(p.y-s.y))/2)},wr.signedArea=function(s,l,p){return((p.x-s.x)*(l.y-s.y)-(l.x-s.x)*(p.y-s.y))/2},wr.det=function(s,l,p,h){return s*h-l*p},wr.interpolateZ=function(s,l,p,h){var y=l.x,_=l.y,E=p.x-y,k=h.x-y,V=p.y-_,re=h.y-_,de=E*re-k*V,xe=s.x-y,Ve=s.y-_,$e=(re*xe-k*Ve)/de,Qe=(-V*xe+E*Ve)/de;return l.z+$e*(p.z-l.z)+Qe*(h.z-l.z)},wr.longestSideLength=function(s,l,p){var h=s.distance(l),y=l.distance(p),_=p.distance(s),E=h;return y>E&&(E=y),_>E&&(E=_),E},wr.isAcute=function(s,l,p){return!!$t.isAcute(s,l,p)&&!!$t.isAcute(l,p,s)&&!!$t.isAcute(p,s,l)},wr.circumcentre=function(s,l,p){var h=p.x,y=p.y,_=s.x-h,E=s.y-y,k=l.x-h,V=l.y-y,re=2*wr.det(_,E,k,V),de=wr.det(E,_*_+E*E,V,k*k+V*V),xe=wr.det(_,_*_+E*E,k,k*k+V*V);return new R(h-de/re,y+xe/re)},wr.perpendicularBisector=function(s,l){var p=l.x-s.x,h=l.y-s.y,y=new te(s.x+p/2,s.y+h/2,1),_=new te(s.x-h+p/2,s.y+p+h/2,1);return new te(y,_)},wr.angleBisector=function(s,l,p){var h=l.distance(s),y=h/(h+l.distance(p)),_=p.x-s.x,E=p.y-s.y;return new R(s.x+y*_,s.y+y*E)},wr.area3D=function(s,l,p){var h=l.x-s.x,y=l.y-s.y,_=l.z-s.z,E=p.x-s.x,k=p.y-s.y,V=p.z-s.z,re=y*V-_*k,de=_*E-h*V,xe=h*k-y*E,Ve=re*re+de*de+xe*xe,$e=Math.sqrt(Ve)/2;return $e},wr.centroid=function(s,l,p){var h=(s.x+l.x+p.x)/3,y=(s.y+l.y+p.y)/3;return new R(h,y)},wr.inCentre=function(s,l,p){var h=l.distance(p),y=s.distance(p),_=s.distance(l),E=h+y+_,k=(h*s.x+y*l.x+_*p.x)/E,V=(h*s.y+y*l.y+_*p.y)/E;return new R(k,V)};var la=o(function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Le;var s=arguments[0],l=arguments[1],p=arguments[2];this._inputGeom=s,this._distance=l,this._curveBuilder=p},"Bn");la.prototype.addPoint=function(s){if(this._distance<=0)return null;var l=s.getCoordinates(),p=this._curveBuilder.getLineCurve(l,this._distance);this.addCurve(p,U.EXTERIOR,U.INTERIOR)},la.prototype.addPolygon=function(s){var l=this._distance,p=je.LEFT;this._distance<0&&(l=-this._distance,p=je.RIGHT);var h=s.getExteriorRing(),y=F.removeRepeatedPoints(h.getCoordinates());if(this._distance<0&&this.isErodedCompletely(h,this._distance)||this._distance<=0&&y.length<3)return null;this.addPolygonRing(y,l,p,U.EXTERIOR,U.INTERIOR);for(var _=0;_<s.getNumInteriorRing();_++){var E=s.getInteriorRingN(_),k=F.removeRepeatedPoints(E.getCoordinates());this._distance>0&&this.isErodedCompletely(E,-this._distance)||this.addPolygonRing(k,l,je.opposite(p),U.INTERIOR,U.EXTERIOR)}},la.prototype.isTriangleErodedCompletely=function(s,l){var p=new wr(s[0],s[1],s[2]),h=p.inCentre();return Ge.distancePointLine(h,p.p0,p.p1)<Math.abs(l)},la.prototype.addLineString=function(s){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var l=F.removeRepeatedPoints(s.getCoordinates()),p=this._curveBuilder.getLineCurve(l,this._distance);this.addCurve(p,U.EXTERIOR,U.INTERIOR)},la.prototype.addCurve=function(s,l,p){if(s===null||s.length<2)return null;var h=new Qn(s,new zr(0,U.BOUNDARY,l,p));this._curveList.add(h)},la.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},la.prototype.addPolygonRing=function(s,l,p,h,y){if(l===0&&s.length<Qo.MINIMUM_VALID_SIZE)return null;var _=h,E=y;s.length>=Qo.MINIMUM_VALID_SIZE&&Ge.isCCW(s)&&(_=y,E=h,p=je.opposite(p));var k=this._curveBuilder.getRingCurve(s,p,l);this.addCurve(k,_,E)},la.prototype.add=function(s){if(s.isEmpty())return null;s instanceof Vr?this.addPolygon(s):s instanceof Ut?this.addLineString(s):s instanceof En?this.addPoint(s):s instanceof bs?this.addCollection(s):s instanceof on?this.addCollection(s):s instanceof wa?this.addCollection(s):s instanceof mt&&this.addCollection(s)},la.prototype.isErodedCompletely=function(s,l){var p=s.getCoordinates();if(p.length<4)return l<0;if(p.length===4)return this.isTriangleErodedCompletely(p,l);var h=s.getEnvelopeInternal(),y=Math.min(h.getHeight(),h.getWidth());return l<0&&2*Math.abs(l)>y},la.prototype.addCollection=function(s){for(var l=0;l<s.getNumGeometries();l++){var p=s.getGeometryN(l);this.add(p)}},la.prototype.interfaces_=function(){return[]},la.prototype.getClass=function(){return la};var eg=o(function(){},"Vn");eg.prototype.locate=function(s){},eg.prototype.interfaces_=function(){return[]},eg.prototype.getClass=function(){return eg};var Ul=o(function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var s=arguments[0];this._parent=s,this._atStart=!0,this._index=0,this._max=s.getNumGeometries()},"Un");Ul.prototype.next=function(){if(this._atStart)return this._atStart=!1,Ul.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 s=this._parent.getGeometryN(this._index++);return s instanceof mt?(this._subcollectionIterator=new Ul(s),this._subcollectionIterator.next()):s},Ul.prototype.remove=function(){throw new Error(this.getClass().getName())},Ul.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)},Ul.prototype.interfaces_=function(){return[xi]},Ul.prototype.getClass=function(){return Ul},Ul.isAtomic=function(s){return!(s instanceof mt)};var Gs=o(function(){this._geom=null;var s=arguments[0];this._geom=s},"zn");Gs.prototype.locate=function(s){return Gs.locate(s,this._geom)},Gs.prototype.interfaces_=function(){return[eg]},Gs.prototype.getClass=function(){return Gs},Gs.isPointInRing=function(s,l){return!!l.getEnvelopeInternal().intersects(s)&&Ge.isPointInRing(s,l.getCoordinates())},Gs.containsPointInPolygon=function(s,l){if(l.isEmpty())return!1;var p=l.getExteriorRing();if(!Gs.isPointInRing(s,p))return!1;for(var h=0;h<l.getNumInteriorRing();h++){var y=l.getInteriorRingN(h);if(Gs.isPointInRing(s,y))return!1}return!0},Gs.containsPoint=function(s,l){if(l instanceof Vr)return Gs.containsPointInPolygon(s,l);if(l instanceof mt)for(var p=new Ul(l);p.hasNext();){var h=p.next();if(h!==l&&Gs.containsPoint(s,h))return!0}return!1},Gs.locate=function(s,l){return l.isEmpty()?U.EXTERIOR:Gs.containsPoint(s,l)?U.INTERIOR:U.EXTERIOR};var uo=o(function(){this._edgeMap=new x,this._edgeList=null,this._ptInAreaLocation=[U.NONE,U.NONE]},"Xn");uo.prototype.getNextCW=function(s){this.getEdges();var l=this._edgeList.indexOf(s),p=l-1;return l===0&&(p=this._edgeList.size()-1),this._edgeList.get(p)},uo.prototype.propagateSideLabels=function(s){for(var l=U.NONE,p=this.iterator();p.hasNext();){var h=p.next().getLabel();h.isArea(s)&&h.getLocation(s,je.LEFT)!==U.NONE&&(l=h.getLocation(s,je.LEFT))}if(l===U.NONE)return null;for(var y=l,_=this.iterator();_.hasNext();){var E=_.next(),k=E.getLabel();if(k.getLocation(s,je.ON)===U.NONE&&k.setLocation(s,je.ON,y),k.isArea(s)){var V=k.getLocation(s,je.LEFT),re=k.getLocation(s,je.RIGHT);if(re!==U.NONE){if(re!==y)throw new Fu("side location conflict",E.getCoordinate());V===U.NONE&&Xe.shouldNeverReachHere("found single null side (at "+E.getCoordinate()+")"),y=V}else Xe.isTrue(k.getLocation(s,je.LEFT)===U.NONE,"found single null side"),k.setLocation(s,je.RIGHT,y),k.setLocation(s,je.LEFT,y)}}},uo.prototype.getCoordinate=function(){var s=this.iterator();return s.hasNext()?s.next().getCoordinate():null},uo.prototype.print=function(s){pt.out.println("EdgeEndStar: "+this.getCoordinate());for(var l=this.iterator();l.hasNext();)l.next().print(s)},uo.prototype.isAreaLabelsConsistent=function(s){return this.computeEdgeEndLabels(s.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},uo.prototype.checkAreaLabelsConsistent=function(s){var l=this.getEdges();if(l.size()<=0)return!0;var p=l.size()-1,h=l.get(p).getLabel().getLocation(s,je.LEFT);Xe.isTrue(h!==U.NONE,"Found unlabelled area edge");for(var y=h,_=this.iterator();_.hasNext();){var E=_.next().getLabel();Xe.isTrue(E.isArea(s),"Found non-area edge");var k=E.getLocation(s,je.LEFT),V=E.getLocation(s,je.RIGHT);if(k===V||V!==y)return!1;y=k}return!0},uo.prototype.findIndex=function(s){this.iterator();for(var l=0;l<this._edgeList.size();l++)if(this._edgeList.get(l)===s)return l;return-1},uo.prototype.iterator=function(){return this.getEdges().iterator()},uo.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new Le(this._edgeMap.values())),this._edgeList},uo.prototype.getLocation=function(s,l,p){return this._ptInAreaLocation[s]===U.NONE&&(this._ptInAreaLocation[s]=Gs.locate(l,p[s].getGeometry())),this._ptInAreaLocation[s]},uo.prototype.toString=function(){var s=new ve;s.append("EdgeEndStar: "+this.getCoordinate()),s.append("\n");for(var l=this.iterator();l.hasNext();){var p=l.next();s.append(p),s.append("\n")}return s.toString()},uo.prototype.computeEdgeEndLabels=function(s){for(var l=this.iterator();l.hasNext();)l.next().computeLabel(s)},uo.prototype.computeLabelling=function(s){this.computeEdgeEndLabels(s[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var l=[!1,!1],p=this.iterator();p.hasNext();)for(var h=p.next().getLabel(),y=0;y<2;y++)h.isLine(y)&&h.getLocation(y)===U.BOUNDARY&&(l[y]=!0);for(var _=this.iterator();_.hasNext();)for(var E=_.next(),k=E.getLabel(),V=0;V<2;V++)if(k.isAnyNull(V)){var re=U.NONE;if(l[V])re=U.EXTERIOR;else{var de=E.getCoordinate();re=this.getLocation(V,de,s)}k.setAllLocationsIfNull(V,re)}},uo.prototype.getDegree=function(){return this._edgeMap.size()},uo.prototype.insertEdgeEnd=function(s,l){this._edgeMap.put(s,l),this._edgeList=null},uo.prototype.interfaces_=function(){return[]},uo.prototype.getClass=function(){return uo};var lq=function(s){function l(){s.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var p=null,h=null,y=this._SCANNING_FOR_INCOMING,_=0;_<this._resultAreaEdgeList.size();_++){var E=this._resultAreaEdgeList.get(_),k=E.getSym();if(E.getLabel().isArea())switch(p===null&&E.isInResult()&&(p=E),y){case this._SCANNING_FOR_INCOMING:if(!k.isInResult())continue;h=k,y=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!E.isInResult())continue;h.setNext(E),y=this._SCANNING_FOR_INCOMING}}if(y===this._LINKING_TO_OUTGOING){if(p===null)throw new Fu("no outgoing dirEdge found",this.getCoordinate());Xe.isTrue(p.isInResult(),"unable to link last incoming dirEdge"),h.setNext(p)}},l.prototype.insert=function(p){var h=p;this.insertEdgeEnd(h,h)},l.prototype.getRightmostEdge=function(){var p=this.getEdges(),h=p.size();if(h<1)return null;var y=p.get(0);if(h===1)return y;var _=p.get(h-1),E=y.getQuadrant(),k=_.getQuadrant();return sn.isNorthern(E)&&sn.isNorthern(k)?y:sn.isNorthern(E)||sn.isNorthern(k)?y.getDy()!==0?y:_.getDy()!==0?_:(Xe.shouldNeverReachHere("found two horizontal edges incident on node"),null):_},l.prototype.print=function(p){pt.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var h=this.iterator();h.hasNext();){var y=h.next();p.print("out "),y.print(p),p.println(),p.print("in "),y.getSym().print(p),p.println()}},l.prototype.getResultAreaEdges=function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Le;for(var p=this.iterator();p.hasNext();){var h=p.next();(h.isInResult()||h.getSym().isInResult())&&this._resultAreaEdgeList.add(h)}return this._resultAreaEdgeList},l.prototype.updateLabelling=function(p){for(var h=this.iterator();h.hasNext();){var y=h.next().getLabel();y.setAllLocationsIfNull(0,p.getLocation(0)),y.setAllLocationsIfNull(1,p.getLocation(1))}},l.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var p=null,h=null,y=this._edgeList.size()-1;y>=0;y--){var _=this._edgeList.get(y),E=_.getSym();h===null&&(h=E),p!==null&&E.setNext(p),p=_}h.setNext(p)},l.prototype.computeDepths=function(){if(arguments.length===1){var p=arguments[0],h=this.findIndex(p),y=p.getDepth(je.LEFT),_=p.getDepth(je.RIGHT),E=this.computeDepths(h+1,this._edgeList.size(),y);if(this.computeDepths(0,h,E)!==_)throw new Fu("depth mismatch at "+p.getCoordinate())}else if(arguments.length===3){for(var k=arguments[0],V=arguments[1],re=arguments[2],de=k;de<V;de++){var xe=this._edgeList.get(de);xe.setEdgeDepths(je.RIGHT,re),re=xe.getDepth(je.LEFT)}return re}},l.prototype.mergeSymLabels=function(){for(var p=this.iterator();p.hasNext();){var h=p.next();h.getLabel().merge(h.getSym().getLabel())}},l.prototype.linkMinimalDirectedEdges=function(p){for(var h=null,y=null,_=this._SCANNING_FOR_INCOMING,E=this._resultAreaEdgeList.size()-1;E>=0;E--){var k=this._resultAreaEdgeList.get(E),V=k.getSym();switch(h===null&&k.getEdgeRing()===p&&(h=k),_){case this._SCANNING_FOR_INCOMING:if(V.getEdgeRing()!==p)continue;y=V,_=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(k.getEdgeRing()!==p)continue;y.setNextMin(k),_=this._SCANNING_FOR_INCOMING}}_===this._LINKING_TO_OUTGOING&&(Xe.isTrue(h!==null,"found null for first outgoing dirEdge"),Xe.isTrue(h.getEdgeRing()===p,"unable to link last incoming dirEdge"),y.setNextMin(h))},l.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var p=0,h=this.iterator();h.hasNext();)h.next().isInResult()&&p++;return p}if(arguments.length===1){for(var y=arguments[0],_=0,E=this.iterator();E.hasNext();)E.next().getEdgeRing()===y&&_++;return _}},l.prototype.getLabel=function(){return this._label},l.prototype.findCoveredLineEdges=function(){for(var p=U.NONE,h=this.iterator();h.hasNext();){var y=h.next(),_=y.getSym();if(!y.isLineEdge()){if(y.isInResult()){p=U.INTERIOR;break}if(_.isInResult()){p=U.EXTERIOR;break}}}if(p===U.NONE)return null;for(var E=p,k=this.iterator();k.hasNext();){var V=k.next(),re=V.getSym();V.isLineEdge()?V.getEdge().setCovered(E===U.INTERIOR):(V.isInResult()&&(E=U.EXTERIOR),re.isInResult()&&(E=U.INTERIOR))}},l.prototype.computeLabelling=function(p){s.prototype.computeLabelling.call(this,p),this._label=new zr(U.NONE);for(var h=this.iterator();h.hasNext();)for(var y=h.next().getEdge().getLabel(),_=0;_<2;_++){var E=y.getLocation(_);E!==U.INTERIOR&&E!==U.BOUNDARY||this._label.setLocation(_,U.INTERIOR)}},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(uo),o7=function(s){function l(){s.apply(this,arguments)}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.createNode=function(p){return new fI(p,new lq)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(Km),Uc=o(function s(){this._pts=null,this._orientation=null;var l=arguments[0];this._pts=l,this._orientation=s.orientation(l)},"t");Uc.prototype.compareTo=function(s){var l=s;return Uc.compareOriented(this._pts,this._orientation,l._pts,l._orientation)},Uc.prototype.interfaces_=function(){return[B]},Uc.prototype.getClass=function(){return Uc},Uc.orientation=function(s){return F.increasingDirection(s)===1},Uc.compareOriented=function(s,l,p,h){for(var y=l?1:-1,_=h?1:-1,E=l?s.length:-1,k=h?p.length:-1,V=l?0:s.length-1,re=h?0:p.length-1;;){var de=s[V].compareTo(p[re]);if(de!==0)return de;var xe=(V+=y)===E,Ve=(re+=_)===k;if(xe&&!Ve)return-1;if(!xe&&Ve)return 1;if(xe&&Ve)return 0}};var Ea=o(function(){this._edges=new Le,this._ocaMap=new x},"Hn");Ea.prototype.print=function(s){s.print("MULTILINESTRING ( ");for(var l=0;l<this._edges.size();l++){var p=this._edges.get(l);l>0&&s.print(","),s.print("(");for(var h=p.getCoordinates(),y=0;y<h.length;y++)y>0&&s.print(","),s.print(h[y].x+" "+h[y].y);s.println(")")}s.print(") ")},Ea.prototype.addAll=function(s){for(var l=s.iterator();l.hasNext();)this.add(l.next())},Ea.prototype.findEdgeIndex=function(s){for(var l=0;l<this._edges.size();l++)if(this._edges.get(l).equals(s))return l;return-1},Ea.prototype.iterator=function(){return this._edges.iterator()},Ea.prototype.getEdges=function(){return this._edges},Ea.prototype.get=function(s){return this._edges.get(s)},Ea.prototype.findEqualEdge=function(s){var l=new Uc(s.getCoordinates());return this._ocaMap.get(l)},Ea.prototype.add=function(s){this._edges.add(s);var l=new Uc(s.getCoordinates());this._ocaMap.put(l,s)},Ea.prototype.interfaces_=function(){return[]},Ea.prototype.getClass=function(){return Ea};var df=o(function(){},"Wn");df.prototype.processIntersections=function(s,l,p,h){},df.prototype.isDone=function(){},df.prototype.interfaces_=function(){return[]},df.prototype.getClass=function(){return df};var js=o(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 s=arguments[0];this._li=s},"Kn");js.prototype.isTrivialIntersection=function(s,l,p,h){if(s===p&&this._li.getIntersectionNum()===1){if(js.isAdjacentSegments(l,h))return!0;if(s.isClosed()){var y=s.size()-1;if(l===0&&h===y||h===0&&l===y)return!0}}return!1},js.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},js.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},js.prototype.getLineIntersector=function(){return this._li},js.prototype.hasProperIntersection=function(){return this._hasProper},js.prototype.processIntersections=function(s,l,p,h){if(s===p&&l===h)return null;this.numTests++;var y=s.getCoordinates()[l],_=s.getCoordinates()[l+1],E=p.getCoordinates()[h],k=p.getCoordinates()[h+1];this._li.computeIntersection(y,_,E,k),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(s,l,p,h)||(this._hasIntersection=!0,s.addIntersections(this._li,l,0),p.addIntersections(this._li,h,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},js.prototype.hasIntersection=function(){return this._hasIntersection},js.prototype.isDone=function(){return!1},js.prototype.hasInteriorIntersection=function(){return this._hasInterior},js.prototype.interfaces_=function(){return[df]},js.prototype.getClass=function(){return js},js.isAdjacentSegments=function(s,l){return Math.abs(s-l)===1};var tl=o(function(){this.coord=null,this.segmentIndex=null,this.dist=null;var s=arguments[0],l=arguments[1],p=arguments[2];this.coord=new R(s),this.segmentIndex=l,this.dist=p},"Jn");tl.prototype.getSegmentIndex=function(){return this.segmentIndex},tl.prototype.getCoordinate=function(){return this.coord},tl.prototype.print=function(s){s.print(this.coord),s.print(" seg # = "+this.segmentIndex),s.println(" dist = "+this.dist)},tl.prototype.compareTo=function(s){var l=s;return this.compare(l.segmentIndex,l.dist)},tl.prototype.isEndPoint=function(s){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===s},tl.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},tl.prototype.getDistance=function(){return this.dist},tl.prototype.compare=function(s,l){return this.segmentIndex<s?-1:this.segmentIndex>s?1:this.dist<l?-1:this.dist>l?1:0},tl.prototype.interfaces_=function(){return[B]},tl.prototype.getClass=function(){return tl};var Vl=o(function(){this._nodeMap=new x,this.edge=null;var s=arguments[0];this.edge=s},"Qn");Vl.prototype.print=function(s){s.println("Intersections:");for(var l=this.iterator();l.hasNext();)l.next().print(s)},Vl.prototype.iterator=function(){return this._nodeMap.values().iterator()},Vl.prototype.addSplitEdges=function(s){this.addEndpoints();for(var l=this.iterator(),p=l.next();l.hasNext();){var h=l.next(),y=this.createSplitEdge(p,h);s.add(y),p=h}},Vl.prototype.addEndpoints=function(){var s=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[s],s,0)},Vl.prototype.createSplitEdge=function(s,l){var p=l.segmentIndex-s.segmentIndex+2,h=this.edge.pts[l.segmentIndex],y=l.dist>0||!l.coord.equals2D(h);y||p--;var _=new Array(p).fill(null),E=0;_[E++]=new R(s.coord);for(var k=s.segmentIndex+1;k<=l.segmentIndex;k++)_[E++]=this.edge.pts[k];return y&&(_[E]=l.coord),new hI(_,new zr(this.edge._label))},Vl.prototype.add=function(s,l,p){var h=new tl(s,l,p),y=this._nodeMap.get(h);return y!==null?y:(this._nodeMap.put(h,h),h)},Vl.prototype.isIntersection=function(s){for(var l=this.iterator();l.hasNext();)if(l.next().coord.equals(s))return!0;return!1},Vl.prototype.interfaces_=function(){return[]},Vl.prototype.getClass=function(){return Vl};var hf=o(function(){},"Zn");hf.prototype.getChainStartIndices=function(s){var l=0,p=new Le;p.add(new ue(l));do{var h=this.findChainEnd(s,l);p.add(new ue(h)),l=h}while(l<s.length-1);return hf.toIntArray(p)},hf.prototype.findChainEnd=function(s,l){for(var p=sn.quadrant(s[l],s[l+1]),h=l+1;h<s.length&&sn.quadrant(s[h-1],s[h])===p;)h++;return h-1},hf.prototype.interfaces_=function(){return[]},hf.prototype.getClass=function(){return hf},hf.toIntArray=function(s){for(var l=new Array(s.size()).fill(null),p=0;p<l.length;p++)l[p]=s.get(p).intValue();return l};var ku=o(function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new ce,this.env2=new ce;var s=arguments[0];this.e=s,this.pts=s.getCoordinates();var l=new hf;this.startIndex=l.getChainStartIndices(this.pts)},"$n");ku.prototype.getCoordinates=function(){return this.pts},ku.prototype.getMaxX=function(s){var l=this.pts[this.startIndex[s]].x,p=this.pts[this.startIndex[s+1]].x;return l>p?l:p},ku.prototype.getMinX=function(s){var l=this.pts[this.startIndex[s]].x,p=this.pts[this.startIndex[s+1]].x;return l<p?l:p},ku.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var s=arguments[0],l=arguments[1],p=arguments[2],h=arguments[3];this.computeIntersectsForChain(this.startIndex[s],this.startIndex[s+1],l,l.startIndex[p],l.startIndex[p+1],h)}else if(arguments.length===6){var y=arguments[0],_=arguments[1],E=arguments[2],k=arguments[3],V=arguments[4],re=arguments[5],de=this.pts[y],xe=this.pts[_],Ve=E.pts[k],$e=E.pts[V];if(_-y==1&&V-k==1)return re.addIntersections(this.e,y,E.e,k),null;if(this.env1.init(de,xe),this.env2.init(Ve,$e),!this.env1.intersects(this.env2))return null;var Qe=Math.trunc((y+_)/2),dt=Math.trunc((k+V)/2);y<Qe&&(k<dt&&this.computeIntersectsForChain(y,Qe,E,k,dt,re),dt<V&&this.computeIntersectsForChain(y,Qe,E,dt,V,re)),Qe<_&&(k<dt&&this.computeIntersectsForChain(Qe,_,E,k,dt,re),dt<V&&this.computeIntersectsForChain(Qe,_,E,dt,V,re))}},ku.prototype.getStartIndexes=function(){return this.startIndex},ku.prototype.computeIntersects=function(s,l){for(var p=0;p<this.startIndex.length-1;p++)for(var h=0;h<s.startIndex.length-1;h++)this.computeIntersectsForChain(p,s,h,l)},ku.prototype.interfaces_=function(){return[]},ku.prototype.getClass=function(){return ku};var Zi=o(function s(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var l=0;l<2;l++)for(var p=0;p<3;p++)this._depth[l][p]=s.NULL_VALUE},"t"),s7={NULL_VALUE:{configurable:!0}};Zi.prototype.getDepth=function(s,l){return this._depth[s][l]},Zi.prototype.setDepth=function(s,l,p){this._depth[s][l]=p},Zi.prototype.isNull=function(){if(arguments.length===0){for(var s=0;s<2;s++)for(var l=0;l<3;l++)if(this._depth[s][l]!==Zi.NULL_VALUE)return!1;return!0}if(arguments.length===1){var p=arguments[0];return this._depth[p][1]===Zi.NULL_VALUE}if(arguments.length===2){var h=arguments[0],y=arguments[1];return this._depth[h][y]===Zi.NULL_VALUE}},Zi.prototype.normalize=function(){for(var s=0;s<2;s++)if(!this.isNull(s)){var l=this._depth[s][1];this._depth[s][2]<l&&(l=this._depth[s][2]),l<0&&(l=0);for(var p=1;p<3;p++){var h=0;this._depth[s][p]>l&&(h=1),this._depth[s][p]=h}}},Zi.prototype.getDelta=function(s){return this._depth[s][je.RIGHT]-this._depth[s][je.LEFT]},Zi.prototype.getLocation=function(s,l){return this._depth[s][l]<=0?U.EXTERIOR:U.INTERIOR},Zi.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Zi.prototype.add=function(){if(arguments.length===1)for(var s=arguments[0],l=0;l<2;l++)for(var p=1;p<3;p++){var h=s.getLocation(l,p);h!==U.EXTERIOR&&h!==U.INTERIOR||(this.isNull(l,p)?this._depth[l][p]=Zi.depthAtLocation(h):this._depth[l][p]+=Zi.depthAtLocation(h))}else if(arguments.length===3){var y=arguments[0],_=arguments[1];arguments[2]===U.INTERIOR&&this._depth[y][_]++}},Zi.prototype.interfaces_=function(){return[]},Zi.prototype.getClass=function(){return Zi},Zi.depthAtLocation=function(s){return s===U.EXTERIOR?0:s===U.INTERIOR?1:Zi.NULL_VALUE},s7.NULL_VALUE.get=function(){return-1},Object.defineProperties(Zi,s7);var hI=function(s){function l(){if(s.call(this),this.pts=null,this._env=null,this.eiList=new Vl(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Zi,this._depthDelta=0,arguments.length===1){var p=arguments[0];l.call(this,p,null)}else if(arguments.length===2){var h=arguments[0],y=arguments[1];this.pts=h,this._label=y}}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.getDepth=function(){return this._depth},l.prototype.getCollapsedEdge=function(){var p=new Array(2).fill(null);return p[0]=this.pts[0],p[1]=this.pts[1],new l(p,zr.toLineLabel(this._label))},l.prototype.isIsolated=function(){return this._isIsolated},l.prototype.getCoordinates=function(){return this.pts},l.prototype.setIsolated=function(p){this._isIsolated=p},l.prototype.setName=function(p){this._name=p},l.prototype.equals=function(p){if(!(p instanceof l))return!1;var h=p;if(this.pts.length!==h.pts.length)return!1;for(var y=!0,_=!0,E=this.pts.length,k=0;k<this.pts.length;k++)if(this.pts[k].equals2D(h.pts[k])||(y=!1),this.pts[k].equals2D(h.pts[--E])||(_=!1),!y&&!_)return!1;return!0},l.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var p=arguments[0];return this.pts[p]}},l.prototype.print=function(p){p.print("edge "+this._name+": "),p.print("LINESTRING (");for(var h=0;h<this.pts.length;h++)h>0&&p.print(","),p.print(this.pts[h].x+" "+this.pts[h].y);p.print(") "+this._label+" "+this._depthDelta)},l.prototype.computeIM=function(p){l.updateIM(this._label,p)},l.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},l.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},l.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},l.prototype.getDepthDelta=function(){return this._depthDelta},l.prototype.getNumPoints=function(){return this.pts.length},l.prototype.printReverse=function(p){p.print("edge "+this._name+": ");for(var h=this.pts.length-1;h>=0;h--)p.print(this.pts[h]+" ");p.println("")},l.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new ku(this)),this._mce},l.prototype.getEnvelope=function(){if(this._env===null){this._env=new ce;for(var p=0;p<this.pts.length;p++)this._env.expandToInclude(this.pts[p])}return this._env},l.prototype.addIntersection=function(p,h,y,_){var E=new R(p.getIntersection(_)),k=h,V=p.getEdgeDistance(y,_),re=k+1;if(re<this.pts.length){var de=this.pts[re];E.equals2D(de)&&(k=re,V=0)}this.eiList.add(E,k,V)},l.prototype.toString=function(){var p=new ve;p.append("edge "+this._name+": "),p.append("LINESTRING (");for(var h=0;h<this.pts.length;h++)h>0&&p.append(","),p.append(this.pts[h].x+" "+this.pts[h].y);return p.append(") "+this._label+" "+this._depthDelta),p.toString()},l.prototype.isPointwiseEqual=function(p){if(this.pts.length!==p.pts.length)return!1;for(var h=0;h<this.pts.length;h++)if(!this.pts[h].equals2D(p.pts[h]))return!1;return!0},l.prototype.setDepthDelta=function(p){this._depthDelta=p},l.prototype.getEdgeIntersectionList=function(){return this.eiList},l.prototype.addIntersections=function(p,h,y){for(var _=0;_<p.getIntersectionNum();_++)this.addIntersection(p,h,y,_)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l.updateIM=function(){if(arguments.length!==2)return s.prototype.updateIM.apply(this,arguments);var p=arguments[0],h=arguments[1];h.setAtLeastIfValid(p.getLocation(0,je.ON),p.getLocation(1,je.ON),1),p.isArea()&&(h.setAtLeastIfValid(p.getLocation(0,je.LEFT),p.getLocation(1,je.LEFT),2),h.setAtLeastIfValid(p.getLocation(0,je.RIGHT),p.getLocation(1,je.RIGHT),2))},l}(ks),Oo=o(function(s){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Ea,this._bufParams=s||null},"ii");Oo.prototype.setWorkingPrecisionModel=function(s){this._workingPrecisionModel=s},Oo.prototype.insertUniqueEdge=function(s){var l=this._edgeList.findEqualEdge(s);if(l!==null){var p=l.getLabel(),h=s.getLabel();l.isPointwiseEqual(s)||(h=new zr(s.getLabel())).flip(),p.merge(h);var y=Oo.depthDelta(h),_=l.getDepthDelta()+y;l.setDepthDelta(_)}else this._edgeList.add(s),s.setDepthDelta(Oo.depthDelta(s.getLabel()))},Oo.prototype.buildSubgraphs=function(s,l){for(var p=new Le,h=s.iterator();h.hasNext();){var y=h.next(),_=y.getRightmostCoordinate(),E=new Ed(p).getDepth(_);y.computeDepth(E),y.findResultEdges(),p.add(y),l.add(y.getDirectedEdges(),y.getNodes())}},Oo.prototype.createSubgraphs=function(s){for(var l=new Le,p=s.getNodes().iterator();p.hasNext();){var h=p.next();if(!h.isVisited()){var y=new Eo;y.create(h),l.add(y)}}return Ta.sort(l,Ta.reverseOrder()),l},Oo.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},Oo.prototype.getNoder=function(s){if(this._workingNoder!==null)return this._workingNoder;var l=new iw,p=new Gi;return p.setPrecisionModel(s),l.setSegmentIntersector(new js(p)),l},Oo.prototype.buffer=function(s,l){var p=this._workingPrecisionModel;p===null&&(p=s.getPrecisionModel()),this._geomFact=s.getFactory();var h=new ts(p,this._bufParams),y=new la(s,l,h).getCurves();if(y.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(y,p),this._graph=new kn(new o7),this._graph.addEdges(this._edgeList.getEdges());var _=this.createSubgraphs(this._graph),E=new Ss(this._geomFact);this.buildSubgraphs(_,E);var k=E.getPolygons();return k.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(k)},Oo.prototype.computeNodedEdges=function(s,l){var p=this.getNoder(l);p.computeNodes(s);for(var h=p.getNodedSubstrings().iterator();h.hasNext();){var y=h.next(),_=y.getCoordinates();if(_.length!==2||!_[0].equals2D(_[1])){var E=y.getData(),k=new hI(y.getCoordinates(),new zr(E));this.insertUniqueEdge(k)}}},Oo.prototype.setNoder=function(s){this._workingNoder=s},Oo.prototype.interfaces_=function(){return[]},Oo.prototype.getClass=function(){return Oo},Oo.depthDelta=function(s){var l=s.getLocation(0,je.LEFT),p=s.getLocation(0,je.RIGHT);return l===U.INTERIOR&&p===U.EXTERIOR?1:l===U.EXTERIOR&&p===U.INTERIOR?-1:0},Oo.convertSegStrings=function(s){for(var l=new jt,p=new Le;s.hasNext();){var h=s.next(),y=l.createLineString(h.getCoordinates());p.add(y)}return l.buildGeometry(p)};var Vc=o(function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var s=arguments[0],l=arguments[1];this._noder=s,this._scaleFactor=l,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var p=arguments[0],h=arguments[1],y=arguments[2],_=arguments[3];this._noder=p,this._scaleFactor=h,this._offsetX=y,this._offsetY=_,this._isScaled=!this.isIntegerPrecision()}},"ri");Vc.prototype.rescale=function(){if(oe(arguments[0],Dt))for(var s=arguments[0].iterator();s.hasNext();){var l=s.next();this.rescale(l.getCoordinates())}else if(arguments[0]instanceof Array){for(var p=arguments[0],h=0;h<p.length;h++)p[h].x=p[h].x/this._scaleFactor+this._offsetX,p[h].y=p[h].y/this._scaleFactor+this._offsetY;p.length===2&&p[0].equals2D(p[1])&&pt.out.println(p)}},Vc.prototype.scale=function(){if(oe(arguments[0],Dt)){for(var s=arguments[0],l=new Le,p=s.iterator();p.hasNext();){var h=p.next();l.add(new Qn(this.scale(h.getCoordinates()),h.getData()))}return l}if(arguments[0]instanceof Array){for(var y=arguments[0],_=new Array(y.length).fill(null),E=0;E<y.length;E++)_[E]=new R(Math.round((y[E].x-this._offsetX)*this._scaleFactor),Math.round((y[E].y-this._offsetY)*this._scaleFactor),y[E].z);return F.removeRepeatedPoints(_)}},Vc.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},Vc.prototype.getNodedSubstrings=function(){var s=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(s),s},Vc.prototype.computeNodes=function(s){var l=s;this._isScaled&&(l=this.scale(s)),this._noder.computeNodes(l)},Vc.prototype.interfaces_=function(){return[pf]},Vc.prototype.getClass=function(){return Vc};var rl=o(function(){this._li=new Gi,this._segStrings=null;var s=arguments[0];this._segStrings=s},"oi"),a7={fact:{configurable:!0}};rl.prototype.checkEndPtVertexIntersections=function(){if(arguments.length===0)for(var s=this._segStrings.iterator();s.hasNext();){var l=s.next().getCoordinates();this.checkEndPtVertexIntersections(l[0],this._segStrings),this.checkEndPtVertexIntersections(l[l.length-1],this._segStrings)}else if(arguments.length===2){for(var p=arguments[0],h=arguments[1].iterator();h.hasNext();)for(var y=h.next().getCoordinates(),_=1;_<y.length-1;_++)if(y[_].equals(p))throw new Bt("found endpt/interior pt intersection at index "+_+" :pt "+p)}},rl.prototype.checkInteriorIntersections=function(){if(arguments.length===0)for(var s=this._segStrings.iterator();s.hasNext();)for(var l=s.next(),p=this._segStrings.iterator();p.hasNext();){var h=p.next();this.checkInteriorIntersections(l,h)}else if(arguments.length===2)for(var y=arguments[0],_=arguments[1],E=y.getCoordinates(),k=_.getCoordinates(),V=0;V<E.length-1;V++)for(var re=0;re<k.length-1;re++)this.checkInteriorIntersections(y,V,_,re);else if(arguments.length===4){var de=arguments[0],xe=arguments[1],Ve=arguments[2],$e=arguments[3];if(de===Ve&&xe===$e)return null;var Qe=de.getCoordinates()[xe],dt=de.getCoordinates()[xe+1],$r=Ve.getCoordinates()[$e],fi=Ve.getCoordinates()[$e+1];if(this._li.computeIntersection(Qe,dt,$r,fi),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,Qe,dt)||this.hasInteriorIntersection(this._li,$r,fi)))throw new Bt("found non-noded intersection at "+Qe+"-"+dt+" and "+$r+"-"+fi)}},rl.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},rl.prototype.checkCollapses=function(){if(arguments.length===0)for(var s=this._segStrings.iterator();s.hasNext();){var l=s.next();this.checkCollapses(l)}else if(arguments.length===1)for(var p=arguments[0].getCoordinates(),h=0;h<p.length-2;h++)this.checkCollapse(p[h],p[h+1],p[h+2])},rl.prototype.hasInteriorIntersection=function(s,l,p){for(var h=0;h<s.getIntersectionNum();h++){var y=s.getIntersection(h);if(!y.equals(l)&&!y.equals(p))return!0}return!1},rl.prototype.checkCollapse=function(s,l,p){if(s.equals(p))throw new Bt("found non-noded collapse at "+rl.fact.createLineString([s,l,p]))},rl.prototype.interfaces_=function(){return[]},rl.prototype.getClass=function(){return rl},a7.fact.get=function(){return new jt},Object.defineProperties(rl,a7);var rs=o(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 s=arguments[0],l=arguments[1],p=arguments[2];if(this._originalPt=s,this._pt=s,this._scaleFactor=l,this._li=p,l<=0)throw new A("Scale factor must be non-zero");l!==1&&(this._pt=new R(this.scale(s.x),this.scale(s.y)),this._p0Scaled=new R,this._p1Scaled=new R),this.initCorners(this._pt)},"ai"),l7={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};rs.prototype.intersectsScaled=function(s,l){var p=Math.min(s.x,l.x),h=Math.max(s.x,l.x),y=Math.min(s.y,l.y),_=Math.max(s.y,l.y),E=this._maxx<p||this._minx>h||this._maxy<y||this._miny>_;if(E)return!1;var k=this.intersectsToleranceSquare(s,l);return Xe.isTrue(!(E&&k),"Found bad envelope test"),k},rs.prototype.initCorners=function(s){this._minx=s.x-.5,this._maxx=s.x+.5,this._miny=s.y-.5,this._maxy=s.y+.5,this._corner[0]=new R(this._maxx,this._maxy),this._corner[1]=new R(this._minx,this._maxy),this._corner[2]=new R(this._minx,this._miny),this._corner[3]=new R(this._maxx,this._miny)},rs.prototype.intersects=function(s,l){return this._scaleFactor===1?this.intersectsScaled(s,l):(this.copyScaled(s,this._p0Scaled),this.copyScaled(l,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},rs.prototype.scale=function(s){return Math.round(s*this._scaleFactor)},rs.prototype.getCoordinate=function(){return this._originalPt},rs.prototype.copyScaled=function(s,l){l.x=this.scale(s.x),l.y=this.scale(s.y)},rs.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var s=rs.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new ce(this._originalPt.x-s,this._originalPt.x+s,this._originalPt.y-s,this._originalPt.y+s)}return this._safeEnv},rs.prototype.intersectsPixelClosure=function(s,l){return this._li.computeIntersection(s,l,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(s,l,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(s,l,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(s,l,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},rs.prototype.intersectsToleranceSquare=function(s,l){var p=!1,h=!1;return this._li.computeIntersection(s,l,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(s,l,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(p=!0),this._li.computeIntersection(s,l,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(h=!0),this._li.computeIntersection(s,l,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!p||!h)||!!s.equals(this._pt)||!!l.equals(this._pt))))},rs.prototype.addSnappedNode=function(s,l){var p=s.getCoordinate(l),h=s.getCoordinate(l+1);return!!this.intersects(p,h)&&(s.addIntersection(this.getCoordinate(),l),!0)},rs.prototype.interfaces_=function(){return[]},rs.prototype.getClass=function(){return rs},l7.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(rs,l7);var u1=o(function(){this.tempEnv1=new ce,this.selectedSegment=new st},"li");u1.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var s=arguments[0],l=arguments[1];s.getLineSegment(l,this.selectedSegment),this.select(this.selectedSegment)}}},u1.prototype.interfaces_=function(){return[]},u1.prototype.getClass=function(){return u1};var tg=o(function(){this._index=null;var s=arguments[0];this._index=s},"ci"),u7={HotPixelSnapAction:{configurable:!0}};tg.prototype.snap=function(){if(arguments.length===1){var s=arguments[0];return this.snap(s,null,-1)}if(arguments.length===3){var l=arguments[0],p=arguments[1],h=arguments[2],y=l.getSafeEnvelope(),_=new c7(l,p,h);return this._index.query(y,{interfaces_:o(function(){return[Gc]},"interfaces_"),visitItem:o(function(E){E.select(y,_)},"visitItem")}),_.isNodeAdded()}},tg.prototype.interfaces_=function(){return[]},tg.prototype.getClass=function(){return tg},u7.HotPixelSnapAction.get=function(){return c7},Object.defineProperties(tg,u7);var c7=function(s){function l(){s.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var p=arguments[0],h=arguments[1],y=arguments[2];this._hotPixel=p,this._parentEdge=h,this._hotPixelVertexIndex=y}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.isNodeAdded=function(){return this._isNodeAdded},l.prototype.select=function(){if(arguments.length!==2)return s.prototype.select.apply(this,arguments);var p=arguments[0],h=arguments[1],y=p.getContext();if(this._parentEdge!==null&&y===this._parentEdge&&h===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(y,h)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(u1),Md=o(function(){this._li=null,this._interiorIntersections=null;var s=arguments[0];this._li=s,this._interiorIntersections=new Le},"fi");Md.prototype.processIntersections=function(s,l,p,h){if(s===p&&l===h)return null;var y=s.getCoordinates()[l],_=s.getCoordinates()[l+1],E=p.getCoordinates()[h],k=p.getCoordinates()[h+1];if(this._li.computeIntersection(y,_,E,k),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var V=0;V<this._li.getIntersectionNum();V++)this._interiorIntersections.add(this._li.getIntersection(V));s.addIntersections(this._li,l,0),p.addIntersections(this._li,h,1)}},Md.prototype.isDone=function(){return!1},Md.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Md.prototype.interfaces_=function(){return[df]},Md.prototype.getClass=function(){return Md};var zl=o(function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var s=arguments[0];this._pm=s,this._li=new Gi,this._li.setPrecisionModel(s),this._scaleFactor=s.getScale()},"gi");zl.prototype.checkCorrectness=function(s){var l=Qn.getNodedSubstrings(s),p=new rl(l);try{p.checkValid()}catch(h){if(!(h instanceof St))throw h;h.printStackTrace()}},zl.prototype.getNodedSubstrings=function(){return Qn.getNodedSubstrings(this._nodedSegStrings)},zl.prototype.snapRound=function(s,l){var p=this.findInteriorIntersections(s,l);this.computeIntersectionSnaps(p),this.computeVertexSnaps(s)},zl.prototype.findInteriorIntersections=function(s,l){var p=new Md(l);return this._noder.setSegmentIntersector(p),this._noder.computeNodes(s),p.getInteriorIntersections()},zl.prototype.computeVertexSnaps=function(){if(oe(arguments[0],Dt))for(var s=arguments[0].iterator();s.hasNext();){var l=s.next();this.computeVertexSnaps(l)}else if(arguments[0]instanceof Qn)for(var p=arguments[0],h=p.getCoordinates(),y=0;y<h.length;y++){var _=new rs(h[y],this._scaleFactor,this._li);this._pointSnapper.snap(_,p,y)&&p.addIntersection(h[y],y)}},zl.prototype.computeNodes=function(s){this._nodedSegStrings=s,this._noder=new iw,this._pointSnapper=new tg(this._noder.getIndex()),this.snapRound(s,this._li)},zl.prototype.computeIntersectionSnaps=function(s){for(var l=s.iterator();l.hasNext();){var p=l.next(),h=new rs(p,this._scaleFactor,this._li);this._pointSnapper.snap(h)}},zl.prototype.interfaces_=function(){return[pf]},zl.prototype.getClass=function(){return zl};var Ki=o(function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Cr,this._resultGeometry=null,this._saveException=null,arguments.length===1){var s=arguments[0];this._argGeom=s}else if(arguments.length===2){var l=arguments[0],p=arguments[1];this._argGeom=l,this._bufParams=p}},"di"),rg={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Ki.prototype.bufferFixedPrecision=function(s){var l=new Vc(new zl(new _r(1)),s.getScale()),p=new Oo(this._bufParams);p.setWorkingPrecisionModel(s),p.setNoder(l),this._resultGeometry=p.buffer(this._argGeom,this._distance)},Ki.prototype.bufferReducedPrecision=function(){var s=this;if(arguments.length===0){for(var l=Ki.MAX_PRECISION_DIGITS;l>=0;l--){try{s.bufferReducedPrecision(l)}catch(_){if(!(_ instanceof Fu))throw _;s._saveException=_}if(s._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var p=arguments[0],h=Ki.precisionScaleFactor(this._argGeom,this._distance,p),y=new _r(h);this.bufferFixedPrecision(y)}},Ki.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var s=this._argGeom.getFactory().getPrecisionModel();s.getType()===_r.FIXED?this.bufferFixedPrecision(s):this.bufferReducedPrecision()},Ki.prototype.setQuadrantSegments=function(s){this._bufParams.setQuadrantSegments(s)},Ki.prototype.bufferOriginalPrecision=function(){try{var s=new Oo(this._bufParams);this._resultGeometry=s.buffer(this._argGeom,this._distance)}catch(l){if(!(l instanceof Bt))throw l;this._saveException=l}},Ki.prototype.getResultGeometry=function(s){return this._distance=s,this.computeGeometry(),this._resultGeometry},Ki.prototype.setEndCapStyle=function(s){this._bufParams.setEndCapStyle(s)},Ki.prototype.interfaces_=function(){return[]},Ki.prototype.getClass=function(){return Ki},Ki.bufferOp=function(){if(arguments.length===2){var s=arguments[0],l=arguments[1];return new Ki(s).getResultGeometry(l)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ut&&typeof arguments[1]=="number"){var p=arguments[0],h=arguments[1],y=arguments[2],_=new Ki(p);return _.setQuadrantSegments(y),_.getResultGeometry(h)}if(arguments[2]instanceof Cr&&arguments[0]instanceof ut&&typeof arguments[1]=="number"){var E=arguments[0],k=arguments[1],V=arguments[2];return new Ki(E,V).getResultGeometry(k)}}else if(arguments.length===4){var re=arguments[0],de=arguments[1],xe=arguments[2],Ve=arguments[3],$e=new Ki(re);return $e.setQuadrantSegments(xe),$e.setEndCapStyle(Ve),$e.getResultGeometry(de)}},Ki.precisionScaleFactor=function(s,l,p){var h=s.getEnvelopeInternal(),y=fe.max(Math.abs(h.getMaxX()),Math.abs(h.getMaxY()),Math.abs(h.getMinX()),Math.abs(h.getMinY()))+2*(l>0?l:0),_=p-Math.trunc(Math.log(y)/Math.log(10)+1);return Math.pow(10,_)},rg.CAP_ROUND.get=function(){return Cr.CAP_ROUND},rg.CAP_BUTT.get=function(){return Cr.CAP_FLAT},rg.CAP_FLAT.get=function(){return Cr.CAP_FLAT},rg.CAP_SQUARE.get=function(){return Cr.CAP_SQUARE},rg.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Ki,rg);var Lo=o(function(){this._pt=[new R,new R],this._distance=M.NaN,this._isNull=!0},"_i");Lo.prototype.getCoordinates=function(){return this._pt},Lo.prototype.getCoordinate=function(s){return this._pt[s]},Lo.prototype.setMinimum=function(){if(arguments.length===1){var s=arguments[0];this.setMinimum(s._pt[0],s._pt[1])}else if(arguments.length===2){var l=arguments[0],p=arguments[1];if(this._isNull)return this.initialize(l,p),null;var h=l.distance(p);h<this._distance&&this.initialize(l,p,h)}},Lo.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var s=arguments[0],l=arguments[1];this._pt[0].setCoordinate(s),this._pt[1].setCoordinate(l),this._distance=s.distance(l),this._isNull=!1}else if(arguments.length===3){var p=arguments[0],h=arguments[1],y=arguments[2];this._pt[0].setCoordinate(p),this._pt[1].setCoordinate(h),this._distance=y,this._isNull=!1}},Lo.prototype.getDistance=function(){return this._distance},Lo.prototype.setMaximum=function(){if(arguments.length===1){var s=arguments[0];this.setMaximum(s._pt[0],s._pt[1])}else if(arguments.length===2){var l=arguments[0],p=arguments[1];if(this._isNull)return this.initialize(l,p),null;var h=l.distance(p);h>this._distance&&this.initialize(l,p,h)}},Lo.prototype.interfaces_=function(){return[]},Lo.prototype.getClass=function(){return Lo};var $l=o(function(){},"mi");$l.prototype.interfaces_=function(){return[]},$l.prototype.getClass=function(){return $l},$l.computeDistance=function(){if(arguments[2]instanceof Lo&&arguments[0]instanceof Ut&&arguments[1]instanceof R)for(var s=arguments[0],l=arguments[1],p=arguments[2],h=s.getCoordinates(),y=new st,_=0;_<h.length-1;_++){y.setCoordinates(h[_],h[_+1]);var E=y.closestPoint(l);p.setMinimum(E,l)}else if(arguments[2]instanceof Lo&&arguments[0]instanceof Vr&&arguments[1]instanceof R){var k=arguments[0],V=arguments[1],re=arguments[2];$l.computeDistance(k.getExteriorRing(),V,re);for(var de=0;de<k.getNumInteriorRing();de++)$l.computeDistance(k.getInteriorRingN(de),V,re)}else if(arguments[2]instanceof Lo&&arguments[0]instanceof ut&&arguments[1]instanceof R){var xe=arguments[0],Ve=arguments[1],$e=arguments[2];if(xe instanceof Ut)$l.computeDistance(xe,Ve,$e);else if(xe instanceof Vr)$l.computeDistance(xe,Ve,$e);else if(xe instanceof mt)for(var Qe=xe,dt=0;dt<Qe.getNumGeometries();dt++){var $r=Qe.getGeometryN(dt);$l.computeDistance($r,Ve,$e)}else $e.setMinimum(xe.getCoordinate(),Ve)}else if(arguments[2]instanceof Lo&&arguments[0]instanceof st&&arguments[1]instanceof R){var fi=arguments[0],No=arguments[1],Yl=arguments[2],Xc=fi.closestPoint(No);Yl.setMinimum(Xc,No)}};var mf=o(function(s){this._maxPtDist=new Lo,this._inputGeom=s||null},"vi"),ow={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};mf.prototype.computeMaxMidpointDistance=function(s){var l=new zc(this._inputGeom);s.apply(l),this._maxPtDist.setMaximum(l.getMaxPointDistance())},mf.prototype.computeMaxVertexDistance=function(s){var l=new Od(this._inputGeom);s.apply(l),this._maxPtDist.setMaximum(l.getMaxPointDistance())},mf.prototype.findDistance=function(s){return this.computeMaxVertexDistance(s),this.computeMaxMidpointDistance(s),this._maxPtDist.getDistance()},mf.prototype.getDistancePoints=function(){return this._maxPtDist},mf.prototype.interfaces_=function(){return[]},mf.prototype.getClass=function(){return mf},ow.MaxPointDistanceFilter.get=function(){return Od},ow.MaxMidpointDistanceFilter.get=function(){return zc},Object.defineProperties(mf,ow);var Od=o(function(s){this._maxPtDist=new Lo,this._minPtDist=new Lo,this._geom=s||null},"Ei");Od.prototype.filter=function(s){this._minPtDist.initialize(),$l.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Od.prototype.getMaxPointDistance=function(){return this._maxPtDist},Od.prototype.interfaces_=function(){return[Ht]},Od.prototype.getClass=function(){return Od};var zc=o(function(s){this._maxPtDist=new Lo,this._minPtDist=new Lo,this._geom=s||null},"xi");zc.prototype.filter=function(s,l){if(l===0)return null;var p=s.getCoordinate(l-1),h=s.getCoordinate(l),y=new R((p.x+h.x)/2,(p.y+h.y)/2);this._minPtDist.initialize(),$l.computeDistance(this._geom,y,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},zc.prototype.isDone=function(){return!1},zc.prototype.isGeometryChanged=function(){return!1},zc.prototype.getMaxPointDistance=function(){return this._maxPtDist},zc.prototype.interfaces_=function(){return[At]},zc.prototype.getClass=function(){return zc};var Bu=o(function(s){this._comps=s||null},"Ni");Bu.prototype.filter=function(s){s instanceof Vr&&this._comps.add(s)},Bu.prototype.interfaces_=function(){return[ft]},Bu.prototype.getClass=function(){return Bu},Bu.getPolygons=function(){if(arguments.length===1){var s=arguments[0];return Bu.getPolygons(s,new Le)}if(arguments.length===2){var l=arguments[0],p=arguments[1];return l instanceof Vr?p.add(l):l instanceof mt&&l.apply(new Bu(p)),p}};var Ji=o(function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var s=arguments[0];this._lines=s}else if(arguments.length===2){var l=arguments[0],p=arguments[1];this._lines=l,this._isForcedToLineString=p}},"Ci");Ji.prototype.filter=function(s){if(this._isForcedToLineString&&s instanceof Qo){var l=s.getFactory().createLineString(s.getCoordinateSequence());return this._lines.add(l),null}s instanceof Ut&&this._lines.add(s)},Ji.prototype.setForceToLineString=function(s){this._isForcedToLineString=s},Ji.prototype.interfaces_=function(){return[xs]},Ji.prototype.getClass=function(){return Ji},Ji.getGeometry=function(){if(arguments.length===1){var s=arguments[0];return s.getFactory().buildGeometry(Ji.getLines(s))}if(arguments.length===2){var l=arguments[0],p=arguments[1];return l.getFactory().buildGeometry(Ji.getLines(l,p))}},Ji.getLines=function(){if(arguments.length===1){var s=arguments[0];return Ji.getLines(s,!1)}if(arguments.length===2){if(oe(arguments[0],Dt)&&oe(arguments[1],Dt)){for(var l=arguments[0],p=arguments[1],h=l.iterator();h.hasNext();){var y=h.next();Ji.getLines(y,p)}return p}if(arguments[0]instanceof ut&&typeof arguments[1]=="boolean"){var _=arguments[0],E=arguments[1],k=new Le;return _.apply(new Ji(k,E)),k}if(arguments[0]instanceof ut&&oe(arguments[1],Dt)){var V=arguments[0],re=arguments[1];return V instanceof Ut?re.add(V):V.apply(new Ji(re)),re}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&oe(arguments[0],Dt)&&oe(arguments[1],Dt)){for(var de=arguments[0],xe=arguments[1],Ve=arguments[2],$e=de.iterator();$e.hasNext();){var Qe=$e.next();Ji.getLines(Qe,xe,Ve)}return xe}if(typeof arguments[2]=="boolean"&&arguments[0]instanceof ut&&oe(arguments[1],Dt)){var dt=arguments[0],$r=arguments[1],fi=arguments[2];return dt.apply(new Ji($r,fi)),$r}}};var Ma=o(function(){if(this._boundaryRule=ot.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var s=arguments[0];if(s===null)throw new A("Rule must be non-null");this._boundaryRule=s}}},"Si");Ma.prototype.locateInternal=function(){if(arguments[0]instanceof R&&arguments[1]instanceof Vr){var s=arguments[0],l=arguments[1];if(l.isEmpty())return U.EXTERIOR;var p=l.getExteriorRing(),h=this.locateInPolygonRing(s,p);if(h===U.EXTERIOR)return U.EXTERIOR;if(h===U.BOUNDARY)return U.BOUNDARY;for(var y=0;y<l.getNumInteriorRing();y++){var _=l.getInteriorRingN(y),E=this.locateInPolygonRing(s,_);if(E===U.INTERIOR)return U.EXTERIOR;if(E===U.BOUNDARY)return U.BOUNDARY}return U.INTERIOR}if(arguments[0]instanceof R&&arguments[1]instanceof Ut){var k=arguments[0],V=arguments[1];if(!V.getEnvelopeInternal().intersects(k))return U.EXTERIOR;var re=V.getCoordinates();return V.isClosed()||!k.equals(re[0])&&!k.equals(re[re.length-1])?Ge.isOnLine(k,re)?U.INTERIOR:U.EXTERIOR:U.BOUNDARY}if(arguments[0]instanceof R&&arguments[1]instanceof En){var de=arguments[0];return arguments[1].getCoordinate().equals2D(de)?U.INTERIOR:U.EXTERIOR}},Ma.prototype.locateInPolygonRing=function(s,l){return l.getEnvelopeInternal().intersects(s)?Ge.locatePointInRing(s,l.getCoordinates()):U.EXTERIOR},Ma.prototype.intersects=function(s,l){return this.locate(s,l)!==U.EXTERIOR},Ma.prototype.updateLocationInfo=function(s){s===U.INTERIOR&&(this._isIn=!0),s===U.BOUNDARY&&this._numBoundaries++},Ma.prototype.computeLocation=function(s,l){if(l instanceof En&&this.updateLocationInfo(this.locateInternal(s,l)),l instanceof Ut)this.updateLocationInfo(this.locateInternal(s,l));else if(l instanceof Vr)this.updateLocationInfo(this.locateInternal(s,l));else if(l instanceof on)for(var p=l,h=0;h<p.getNumGeometries();h++){var y=p.getGeometryN(h);this.updateLocationInfo(this.locateInternal(s,y))}else if(l instanceof wa)for(var _=l,E=0;E<_.getNumGeometries();E++){var k=_.getGeometryN(E);this.updateLocationInfo(this.locateInternal(s,k))}else if(l instanceof mt)for(var V=new Ul(l);V.hasNext();){var re=V.next();re!==l&&this.computeLocation(s,re)}},Ma.prototype.locate=function(s,l){return l.isEmpty()?U.EXTERIOR:l instanceof Ut?this.locateInternal(s,l):l instanceof Vr?this.locateInternal(s,l):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(s,l),this._boundaryRule.isInBoundary(this._numBoundaries)?U.BOUNDARY:this._numBoundaries>0||this._isIn?U.INTERIOR:U.EXTERIOR)},Ma.prototype.interfaces_=function(){return[]},Ma.prototype.getClass=function(){return Ma};var Do=o(function s(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var l=arguments[0],p=arguments[1];s.call(this,l,s.INSIDE_AREA,p)}else if(arguments.length===3){var h=arguments[0],y=arguments[1],_=arguments[2];this._component=h,this._segIndex=y,this._pt=_}},"t"),p7={INSIDE_AREA:{configurable:!0}};Do.prototype.isInsideArea=function(){return this._segIndex===Do.INSIDE_AREA},Do.prototype.getCoordinate=function(){return this._pt},Do.prototype.getGeometryComponent=function(){return this._component},Do.prototype.getSegmentIndex=function(){return this._segIndex},Do.prototype.interfaces_=function(){return[]},Do.prototype.getClass=function(){return Do},p7.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Do,p7);var $c=o(function(s){this._pts=s||null},"wi");$c.prototype.filter=function(s){s instanceof En&&this._pts.add(s)},$c.prototype.interfaces_=function(){return[ft]},$c.prototype.getClass=function(){return $c},$c.getPoints=function(){if(arguments.length===1){var s=arguments[0];return s instanceof En?Ta.singletonList(s):$c.getPoints(s,new Le)}if(arguments.length===2){var l=arguments[0],p=arguments[1];return l instanceof En?p.add(l):l instanceof mt&&l.apply(new $c(p)),p}};var Ld=o(function(){this._locations=null;var s=arguments[0];this._locations=s},"Oi");Ld.prototype.filter=function(s){(s instanceof En||s instanceof Ut||s instanceof Vr)&&this._locations.add(new Do(s,0,s.getCoordinate()))},Ld.prototype.interfaces_=function(){return[ft]},Ld.prototype.getClass=function(){return Ld},Ld.getLocations=function(s){var l=new Le;return s.apply(new Ld(l)),l};var Qi=o(function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ma,this._minDistanceLocation=null,this._minDistance=M.MAX_VALUE,arguments.length===2){var s=arguments[0],l=arguments[1];this._geom=[s,l],this._terminateDistance=0}else if(arguments.length===3){var p=arguments[0],h=arguments[1],y=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=p,this._geom[1]=h,this._terminateDistance=y}},"Ti");Qi.prototype.computeContainmentDistance=function(){if(arguments.length===0){var s=new Array(2).fill(null);if(this.computeContainmentDistance(0,s),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,s)}else if(arguments.length===2){var l=arguments[0],p=arguments[1],h=1-l,y=Bu.getPolygons(this._geom[l]);if(y.size()>0){var _=Ld.getLocations(this._geom[h]);if(this.computeContainmentDistance(_,y,p),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[h]=p[0],this._minDistanceLocation[l]=p[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&oe(arguments[0],Tn)&&oe(arguments[1],Tn)){for(var E=arguments[0],k=arguments[1],V=arguments[2],re=0;re<E.size();re++)for(var de=E.get(re),xe=0;xe<k.size();xe++)if(this.computeContainmentDistance(de,k.get(xe),V),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Do&&arguments[1]instanceof Vr){var Ve=arguments[0],$e=arguments[1],Qe=arguments[2],dt=Ve.getCoordinate();if(U.EXTERIOR!==this._ptLocator.locate(dt,$e))return this._minDistance=0,Qe[0]=Ve,Qe[1]=new Do($e,dt),null}}},Qi.prototype.computeMinDistanceLinesPoints=function(s,l,p){for(var h=0;h<s.size();h++)for(var y=s.get(h),_=0;_<l.size();_++){var E=l.get(_);if(this.computeMinDistance(y,E,p),this._minDistance<=this._terminateDistance)return null}},Qi.prototype.computeFacetDistance=function(){var s=new Array(2).fill(null),l=Ji.getLines(this._geom[0]),p=Ji.getLines(this._geom[1]),h=$c.getPoints(this._geom[0]),y=$c.getPoints(this._geom[1]);return this.computeMinDistanceLines(l,p,s),this.updateMinDistance(s,!1),this._minDistance<=this._terminateDistance?null:(s[0]=null,s[1]=null,this.computeMinDistanceLinesPoints(l,y,s),this.updateMinDistance(s,!1),this._minDistance<=this._terminateDistance?null:(s[0]=null,s[1]=null,this.computeMinDistanceLinesPoints(p,h,s),this.updateMinDistance(s,!0),this._minDistance<=this._terminateDistance?null:(s[0]=null,s[1]=null,this.computeMinDistancePoints(h,y,s),void this.updateMinDistance(s,!1))))},Qi.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Qi.prototype.updateMinDistance=function(s,l){if(s[0]===null)return null;l?(this._minDistanceLocation[0]=s[1],this._minDistanceLocation[1]=s[0]):(this._minDistanceLocation[0]=s[0],this._minDistanceLocation[1]=s[1])},Qi.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Qi.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 Ut&&arguments[1]instanceof En){var s=arguments[0],l=arguments[1],p=arguments[2];if(s.getEnvelopeInternal().distance(l.getEnvelopeInternal())>this._minDistance)return null;for(var h=s.getCoordinates(),y=l.getCoordinate(),_=0;_<h.length-1;_++){var E=Ge.distancePointLine(y,h[_],h[_+1]);if(E<this._minDistance){this._minDistance=E;var k=new st(h[_],h[_+1]).closestPoint(y);p[0]=new Do(s,_,k),p[1]=new Do(l,0,y)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ut&&arguments[1]instanceof Ut){var V=arguments[0],re=arguments[1],de=arguments[2];if(V.getEnvelopeInternal().distance(re.getEnvelopeInternal())>this._minDistance)return null;for(var xe=V.getCoordinates(),Ve=re.getCoordinates(),$e=0;$e<xe.length-1;$e++)for(var Qe=0;Qe<Ve.length-1;Qe++){var dt=Ge.distanceLineLine(xe[$e],xe[$e+1],Ve[Qe],Ve[Qe+1]);if(dt<this._minDistance){this._minDistance=dt;var $r=new st(xe[$e],xe[$e+1]),fi=new st(Ve[Qe],Ve[Qe+1]),No=$r.closestPoints(fi);de[0]=new Do(V,$e,No[0]),de[1]=new Do(re,Qe,No[1])}if(this._minDistance<=this._terminateDistance)return null}}}},Qi.prototype.computeMinDistancePoints=function(s,l,p){for(var h=0;h<s.size();h++)for(var y=s.get(h),_=0;_<l.size();_++){var E=l.get(_),k=y.getCoordinate().distance(E.getCoordinate());if(k<this._minDistance&&(this._minDistance=k,p[0]=new Do(y,0,y.getCoordinate()),p[1]=new Do(E,0,E.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Qi.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new A("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Qi.prototype.computeMinDistanceLines=function(s,l,p){for(var h=0;h<s.size();h++)for(var y=s.get(h),_=0;_<l.size();_++){var E=l.get(_);if(this.computeMinDistance(y,E,p),this._minDistance<=this._terminateDistance)return null}},Qi.prototype.interfaces_=function(){return[]},Qi.prototype.getClass=function(){return Qi},Qi.distance=function(s,l){return new Qi(s,l).distance()},Qi.isWithinDistance=function(s,l,p){return new Qi(s,l,p).distance()<=p},Qi.nearestPoints=function(s,l){return new Qi(s,l).nearestPoints()};var co=o(function(){this._pt=[new R,new R],this._distance=M.NaN,this._isNull=!0},"Ri");co.prototype.getCoordinates=function(){return this._pt},co.prototype.getCoordinate=function(s){return this._pt[s]},co.prototype.setMinimum=function(){if(arguments.length===1){var s=arguments[0];this.setMinimum(s._pt[0],s._pt[1])}else if(arguments.length===2){var l=arguments[0],p=arguments[1];if(this._isNull)return this.initialize(l,p),null;var h=l.distance(p);h<this._distance&&this.initialize(l,p,h)}},co.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var s=arguments[0],l=arguments[1];this._pt[0].setCoordinate(s),this._pt[1].setCoordinate(l),this._distance=s.distance(l),this._isNull=!1}else if(arguments.length===3){var p=arguments[0],h=arguments[1],y=arguments[2];this._pt[0].setCoordinate(p),this._pt[1].setCoordinate(h),this._distance=y,this._isNull=!1}},co.prototype.toString=function(){return xt.toLineString(this._pt[0],this._pt[1])},co.prototype.getDistance=function(){return this._distance},co.prototype.setMaximum=function(){if(arguments.length===1){var s=arguments[0];this.setMaximum(s._pt[0],s._pt[1])}else if(arguments.length===2){var l=arguments[0],p=arguments[1];if(this._isNull)return this.initialize(l,p),null;var h=l.distance(p);h>this._distance&&this.initialize(l,p,h)}},co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co};var nl=o(function(){},"Pi");nl.prototype.interfaces_=function(){return[]},nl.prototype.getClass=function(){return nl},nl.computeDistance=function(){if(arguments[2]instanceof co&&arguments[0]instanceof Ut&&arguments[1]instanceof R)for(var s=arguments[0],l=arguments[1],p=arguments[2],h=new st,y=s.getCoordinates(),_=0;_<y.length-1;_++){h.setCoordinates(y[_],y[_+1]);var E=h.closestPoint(l);p.setMinimum(E,l)}else if(arguments[2]instanceof co&&arguments[0]instanceof Vr&&arguments[1]instanceof R){var k=arguments[0],V=arguments[1],re=arguments[2];nl.computeDistance(k.getExteriorRing(),V,re);for(var de=0;de<k.getNumInteriorRing();de++)nl.computeDistance(k.getInteriorRingN(de),V,re)}else if(arguments[2]instanceof co&&arguments[0]instanceof ut&&arguments[1]instanceof R){var xe=arguments[0],Ve=arguments[1],$e=arguments[2];if(xe instanceof Ut)nl.computeDistance(xe,Ve,$e);else if(xe instanceof Vr)nl.computeDistance(xe,Ve,$e);else if(xe instanceof mt)for(var Qe=xe,dt=0;dt<Qe.getNumGeometries();dt++){var $r=Qe.getGeometryN(dt);nl.computeDistance($r,Ve,$e)}else $e.setMinimum(xe.getCoordinate(),Ve)}else if(arguments[2]instanceof co&&arguments[0]instanceof st&&arguments[1]instanceof R){var fi=arguments[0],No=arguments[1],Yl=arguments[2],Xc=fi.closestPoint(No);Yl.setMinimum(Xc,No)}};var ua=o(function(){this._g0=null,this._g1=null,this._ptDist=new co,this._densifyFrac=0;var s=arguments[0],l=arguments[1];this._g0=s,this._g1=l},"Di"),sw={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};ua.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},ua.prototype.setDensifyFraction=function(s){if(s>1||s<=0)throw new A("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=s},ua.prototype.compute=function(s,l){this.computeOrientedDistance(s,l,this._ptDist),this.computeOrientedDistance(l,s,this._ptDist)},ua.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},ua.prototype.computeOrientedDistance=function(s,l,p){var h=new Dd(l);if(s.apply(h),p.setMaximum(h.getMaxPointDistance()),this._densifyFrac>0){var y=new Hc(l,this._densifyFrac);s.apply(y),p.setMaximum(y.getMaxPointDistance())}},ua.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},ua.prototype.interfaces_=function(){return[]},ua.prototype.getClass=function(){return ua},ua.distance=function(){if(arguments.length===2){var s=arguments[0],l=arguments[1];return new ua(s,l).distance()}if(arguments.length===3){var p=arguments[0],h=arguments[1],y=arguments[2],_=new ua(p,h);return _.setDensifyFraction(y),_.distance()}},sw.MaxPointDistanceFilter.get=function(){return Dd},sw.MaxDensifiedByFractionDistanceFilter.get=function(){return Hc},Object.defineProperties(ua,sw);var Dd=o(function(){this._maxPtDist=new co,this._minPtDist=new co,this._euclideanDist=new nl,this._geom=null;var s=arguments[0];this._geom=s},"Ai");Dd.prototype.filter=function(s){this._minPtDist.initialize(),nl.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Dd.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dd.prototype.interfaces_=function(){return[Ht]},Dd.prototype.getClass=function(){return Dd};var Hc=o(function(){this._maxPtDist=new co,this._minPtDist=new co,this._geom=null,this._numSubSegs=0;var s=arguments[0],l=arguments[1];this._geom=s,this._numSubSegs=Math.trunc(Math.round(1/l))},"Fi");Hc.prototype.filter=function(s,l){if(l===0)return null;for(var p=s.getCoordinate(l-1),h=s.getCoordinate(l),y=(h.x-p.x)/this._numSubSegs,_=(h.y-p.y)/this._numSubSegs,E=0;E<this._numSubSegs;E++){var k=p.x+E*y,V=p.y+E*_,re=new R(k,V);this._minPtDist.initialize(),nl.computeDistance(this._geom,re,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Hc.prototype.isDone=function(){return!1},Hc.prototype.isGeometryChanged=function(){return!1},Hc.prototype.getMaxPointDistance=function(){return this._maxPtDist},Hc.prototype.interfaces_=function(){return[At]},Hc.prototype.getClass=function(){return Hc};var Cs=o(function(s,l,p){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=s||null,this._bufDistance=l||null,this._result=p||null},"Gi"),aw={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Cs.prototype.checkMaximumDistance=function(s,l,p){var h=new ua(l,s);if(h.setDensifyFraction(.25),this._maxDistanceFound=h.orientedDistance(),this._maxDistanceFound>p){this._isValid=!1;var y=h.getCoordinates();this._errorLocation=y[1],this._errorIndicator=s.getFactory().createLineString(y),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+xt.toLineString(y[0],y[1])+")"}},Cs.prototype.isValid=function(){var s=Math.abs(this._bufDistance),l=Cs.MAX_DISTANCE_DIFF_FRAC*s;return this._minValidDistance=s-l,this._maxValidDistance=s+l,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Cs.VERBOSE&&pt.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Cs.prototype.checkNegativeValid=function(){if(!(this._input instanceof Vr||this._input instanceof wa||this._input instanceof mt))return null;var s=this.getPolygonLines(this._input);if(this.checkMinimumDistance(s,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(s,this._result,this._maxValidDistance)},Cs.prototype.getErrorIndicator=function(){return this._errorIndicator},Cs.prototype.checkMinimumDistance=function(s,l,p){var h=new Qi(s,l,p);if(this._minDistanceFound=h.distance(),this._minDistanceFound<p){this._isValid=!1;var y=h.nearestPoints();this._errorLocation=h.nearestPoints()[1],this._errorIndicator=s.getFactory().createLineString(y),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+xt.toLineString(y[0],y[1])+" )"}},Cs.prototype.checkPositiveValid=function(){var s=this._result.getBoundary();if(this.checkMinimumDistance(this._input,s,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,s,this._maxValidDistance)},Cs.prototype.getErrorLocation=function(){return this._errorLocation},Cs.prototype.getPolygonLines=function(s){for(var l=new Le,p=new Ji(l),h=Bu.getPolygons(s).iterator();h.hasNext();)h.next().apply(p);return s.getFactory().buildGeometry(l)},Cs.prototype.getErrorMessage=function(){return this._errMsg},Cs.prototype.interfaces_=function(){return[]},Cs.prototype.getClass=function(){return Cs},aw.VERBOSE.get=function(){return!1},aw.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Cs,aw);var eo=o(function(s,l,p){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=s||null,this._distance=l||null,this._result=p||null},"Bi"),lw={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};eo.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},eo.prototype.checkEnvelope=function(){if(this._distance<0)return null;var s=this._distance*eo.MAX_ENV_DIFF_FRAC;s===0&&(s=.001);var l=new ce(this._input.getEnvelopeInternal());l.expandBy(this._distance);var p=new ce(this._result.getEnvelopeInternal());p.expandBy(s),p.contains(l)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(p)),this.report("Envelope")},eo.prototype.checkDistance=function(){var s=new Cs(this._input,this._distance,this._result);s.isValid()||(this._isValid=!1,this._errorMsg=s.getErrorMessage(),this._errorLocation=s.getErrorLocation(),this._errorIndicator=s.getErrorIndicator()),this.report("Distance")},eo.prototype.checkArea=function(){var s=this._input.getArea(),l=this._result.getArea();this._distance>0&&s>l&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&s<l&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},eo.prototype.checkPolygonal=function(){this._result instanceof Vr||this._result instanceof wa||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},eo.prototype.getErrorIndicator=function(){return this._errorIndicator},eo.prototype.getErrorLocation=function(){return this._errorLocation},eo.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"))},eo.prototype.report=function(s){if(!eo.VERBOSE)return null;pt.out.println("Check "+s+": "+(this._isValid?"passed":"FAILED"))},eo.prototype.getErrorMessage=function(){return this._errorMsg},eo.prototype.interfaces_=function(){return[]},eo.prototype.getClass=function(){return eo},eo.isValidMsg=function(s,l,p){var h=new eo(s,l,p);return h.isValid()?null:h.getErrorMessage()},eo.isValid=function(s,l,p){return!!new eo(s,l,p).isValid()},lw.VERBOSE.get=function(){return!1},lw.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(eo,lw);var il=o(function(){this._pts=null,this._data=null;var s=arguments[0],l=arguments[1];this._pts=s,this._data=l},"Ui");il.prototype.getCoordinates=function(){return this._pts},il.prototype.size=function(){return this._pts.length},il.prototype.getCoordinate=function(s){return this._pts[s]},il.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},il.prototype.getSegmentOctant=function(s){return s===this._pts.length-1?-1:Pd.octant(this.getCoordinate(s),this.getCoordinate(s+1))},il.prototype.setData=function(s){this._data=s},il.prototype.getData=function(){return this._data},il.prototype.toString=function(){return xt.toLineString(new Jn(this._pts))},il.prototype.interfaces_=function(){return[jl]},il.prototype.getClass=function(){return il};var Vi=o(function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Le,this._intersectionCount=0,this._keepIntersections=!0;var s=arguments[0];this._li=s,this._interiorIntersection=null},"zi");Vi.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Vi.prototype.setCheckEndSegmentsOnly=function(s){this._isCheckEndSegmentsOnly=s},Vi.prototype.getIntersectionSegments=function(){return this._intSegments},Vi.prototype.count=function(){return this._intersectionCount},Vi.prototype.getIntersections=function(){return this._intersections},Vi.prototype.setFindAllIntersections=function(s){this._findAllIntersections=s},Vi.prototype.setKeepIntersections=function(s){this._keepIntersections=s},Vi.prototype.processIntersections=function(s,l,p,h){if(!this._findAllIntersections&&this.hasIntersection()||s===p&&l===h||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(s,l)||this.isEndSegment(p,h)))return null;var y=s.getCoordinates()[l],_=s.getCoordinates()[l+1],E=p.getCoordinates()[h],k=p.getCoordinates()[h+1];this._li.computeIntersection(y,_,E,k),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=y,this._intSegments[1]=_,this._intSegments[2]=E,this._intSegments[3]=k,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Vi.prototype.isEndSegment=function(s,l){return l===0||l>=s.size()-2},Vi.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Vi.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},Vi.prototype.interfaces_=function(){return[df]},Vi.prototype.getClass=function(){return Vi},Vi.createAllIntersectionsFinder=function(s){var l=new Vi(s);return l.setFindAllIntersections(!0),l},Vi.createAnyIntersectionFinder=function(s){return new Vi(s)},Vi.createIntersectionCounter=function(s){var l=new Vi(s);return l.setFindAllIntersections(!0),l.setKeepIntersections(!1),l};var Oa=o(function(){this._li=new Gi,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var s=arguments[0];this._segStrings=s},"Xi");Oa.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Oa.prototype.getIntersections=function(){return this._segInt.getIntersections()},Oa.prototype.isValid=function(){return this.execute(),this._isValid},Oa.prototype.setFindAllIntersections=function(s){this._findAllIntersections=s},Oa.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Vi(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var s=new iw;if(s.setSegmentIntersector(this._segInt),s.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Oa.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Fu(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Oa.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var s=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+xt.toLineString(s[0],s[1])+" and "+xt.toLineString(s[2],s[3])},Oa.prototype.interfaces_=function(){return[]},Oa.prototype.getClass=function(){return Oa},Oa.computeIntersections=function(s){var l=new Oa(s);return l.setFindAllIntersections(!0),l.isValid(),l.getIntersections()};var gf=o(function s(){this._nv=null;var l=arguments[0];this._nv=new Oa(s.toSegmentStrings(l))},"t");gf.prototype.checkValid=function(){this._nv.checkValid()},gf.prototype.interfaces_=function(){return[]},gf.prototype.getClass=function(){return gf},gf.toSegmentStrings=function(s){for(var l=new Le,p=s.iterator();p.hasNext();){var h=p.next();l.add(new il(h.getCoordinates(),h))}return l},gf.checkValid=function(s){new gf(s).checkValid()};var Ad=o(function(s){this._mapOp=s},"ki");Ad.prototype.map=function(s){for(var l=new Le,p=0;p<s.getNumGeometries();p++){var h=this._mapOp.map(s.getGeometryN(p));h.isEmpty()||l.add(h)}return s.getFactory().createGeometryCollection(jt.toGeometryArray(l))},Ad.prototype.interfaces_=function(){return[]},Ad.prototype.getClass=function(){return Ad},Ad.map=function(s,l){return new Ad(l).map(s)};var ol=o(function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Le,this._resultLineList=new Le;var s=arguments[0],l=arguments[1],p=arguments[2];this._op=s,this._geometryFactory=l,this._ptLocator=p},"ji");ol.prototype.collectLines=function(s){for(var l=this._op.getGraph().getEdgeEnds().iterator();l.hasNext();){var p=l.next();this.collectLineEdge(p,s,this._lineEdgesList),this.collectBoundaryTouchEdge(p,s,this._lineEdgesList)}},ol.prototype.labelIsolatedLine=function(s,l){var p=this._ptLocator.locate(s.getCoordinate(),this._op.getArgGeometry(l));s.getLabel().setLocation(l,p)},ol.prototype.build=function(s){return this.findCoveredLineEdges(),this.collectLines(s),this.buildLines(s),this._resultLineList},ol.prototype.collectLineEdge=function(s,l,p){var h=s.getLabel(),y=s.getEdge();s.isLineEdge()&&(s.isVisited()||!wt.isResultOfOp(h,l)||y.isCovered()||(p.add(y),s.setVisitedEdge(!0)))},ol.prototype.findCoveredLineEdges=function(){for(var s=this._op.getGraph().getNodes().iterator();s.hasNext();)s.next().getEdges().findCoveredLineEdges();for(var l=this._op.getGraph().getEdgeEnds().iterator();l.hasNext();){var p=l.next(),h=p.getEdge();if(p.isLineEdge()&&!h.isCoveredSet()){var y=this._op.isCoveredByA(p.getCoordinate());h.setCovered(y)}}},ol.prototype.labelIsolatedLines=function(s){for(var l=s.iterator();l.hasNext();){var p=l.next(),h=p.getLabel();p.isIsolated()&&(h.isNull(0)?this.labelIsolatedLine(p,0):this.labelIsolatedLine(p,1))}},ol.prototype.buildLines=function(s){for(var l=this._lineEdgesList.iterator();l.hasNext();){var p=l.next(),h=this._geometryFactory.createLineString(p.getCoordinates());this._resultLineList.add(h),p.setInResult(!0)}},ol.prototype.collectBoundaryTouchEdge=function(s,l,p){var h=s.getLabel();return s.isLineEdge()||s.isVisited()||s.isInteriorAreaEdge()||s.getEdge().isInResult()?null:(Xe.isTrue(!(s.isInResult()||s.getSym().isInResult())||!s.getEdge().isInResult()),void(wt.isResultOfOp(h,l)&&l===wt.INTERSECTION&&(p.add(s.getEdge()),s.setVisitedEdge(!0))))},ol.prototype.interfaces_=function(){return[]},ol.prototype.getClass=function(){return ol};var Fd=o(function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Le;var s=arguments[0],l=arguments[1];this._op=s,this._geometryFactory=l},"Hi");Fd.prototype.filterCoveredNodeToPoint=function(s){var l=s.getCoordinate();if(!this._op.isCoveredByLA(l)){var p=this._geometryFactory.createPoint(l);this._resultPointList.add(p)}},Fd.prototype.extractNonCoveredResultNodes=function(s){for(var l=this._op.getGraph().getNodes().iterator();l.hasNext();){var p=l.next();if(!p.isInResult()&&!p.isIncidentEdgeInResult()&&(p.getEdges().getDegree()===0||s===wt.INTERSECTION)){var h=p.getLabel();wt.isResultOfOp(h,s)&&this.filterCoveredNodeToPoint(p)}}},Fd.prototype.build=function(s){return this.extractNonCoveredResultNodes(s),this._resultPointList},Fd.prototype.interfaces_=function(){return[]},Fd.prototype.getClass=function(){return Fd};var ns=o(function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1},"Wi");ns.prototype.transformPoint=function(s,l){return this._factory.createPoint(this.transformCoordinates(s.getCoordinateSequence(),s))},ns.prototype.transformPolygon=function(s,l){var p=!0,h=this.transformLinearRing(s.getExteriorRing(),s);h!==null&&h instanceof Qo&&!h.isEmpty()||(p=!1);for(var y=new Le,_=0;_<s.getNumInteriorRing();_++){var E=this.transformLinearRing(s.getInteriorRingN(_),s);E===null||E.isEmpty()||(E instanceof Qo||(p=!1),y.add(E))}if(p)return this._factory.createPolygon(h,y.toArray([]));var k=new Le;return h!==null&&k.add(h),k.addAll(y),this._factory.buildGeometry(k)},ns.prototype.createCoordinateSequence=function(s){return this._factory.getCoordinateSequenceFactory().create(s)},ns.prototype.getInputGeometry=function(){return this._inputGeom},ns.prototype.transformMultiLineString=function(s,l){for(var p=new Le,h=0;h<s.getNumGeometries();h++){var y=this.transformLineString(s.getGeometryN(h),s);y!==null&&(y.isEmpty()||p.add(y))}return this._factory.buildGeometry(p)},ns.prototype.transformCoordinates=function(s,l){return this.copy(s)},ns.prototype.transformLineString=function(s,l){return this._factory.createLineString(this.transformCoordinates(s.getCoordinateSequence(),s))},ns.prototype.transformMultiPoint=function(s,l){for(var p=new Le,h=0;h<s.getNumGeometries();h++){var y=this.transformPoint(s.getGeometryN(h),s);y!==null&&(y.isEmpty()||p.add(y))}return this._factory.buildGeometry(p)},ns.prototype.transformMultiPolygon=function(s,l){for(var p=new Le,h=0;h<s.getNumGeometries();h++){var y=this.transformPolygon(s.getGeometryN(h),s);y!==null&&(y.isEmpty()||p.add(y))}return this._factory.buildGeometry(p)},ns.prototype.copy=function(s){return s.copy()},ns.prototype.transformGeometryCollection=function(s,l){for(var p=new Le,h=0;h<s.getNumGeometries();h++){var y=this.transform(s.getGeometryN(h));y!==null&&(this._pruneEmptyGeometry&&y.isEmpty()||p.add(y))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(jt.toGeometryArray(p)):this._factory.buildGeometry(p)},ns.prototype.transform=function(s){if(this._inputGeom=s,this._factory=s.getFactory(),s instanceof En)return this.transformPoint(s,null);if(s instanceof bs)return this.transformMultiPoint(s,null);if(s instanceof Qo)return this.transformLinearRing(s,null);if(s instanceof Ut)return this.transformLineString(s,null);if(s instanceof on)return this.transformMultiLineString(s,null);if(s instanceof Vr)return this.transformPolygon(s,null);if(s instanceof wa)return this.transformMultiPolygon(s,null);if(s instanceof mt)return this.transformGeometryCollection(s,null);throw new A("Unknown Geometry subtype: "+s.getClass().getName())},ns.prototype.transformLinearRing=function(s,l){var p=this.transformCoordinates(s.getCoordinateSequence(),s);if(p===null)return this._factory.createLinearRing(null);var h=p.size();return h>0&&h<4&&!this._preserveType?this._factory.createLineString(p):this._factory.createLinearRing(p)},ns.prototype.interfaces_=function(){return[]},ns.prototype.getClass=function(){return ns};var Hl=o(function s(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new st,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Ut&&typeof arguments[1]=="number"){var l=arguments[0],p=arguments[1];s.call(this,l.getCoordinates(),p)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var h=arguments[0],y=arguments[1];this._srcPts=h,this._isClosed=s.isClosed(h),this._snapTolerance=y}},"t");Hl.prototype.snapVertices=function(s,l){for(var p=this._isClosed?s.size()-1:s.size(),h=0;h<p;h++){var y=s.get(h),_=this.findSnapForVertex(y,l);_!==null&&(s.set(h,new R(_)),h===0&&this._isClosed&&s.set(s.size()-1,new R(_)))}},Hl.prototype.findSnapForVertex=function(s,l){for(var p=0;p<l.length;p++){if(s.equals2D(l[p]))return null;if(s.distance(l[p])<this._snapTolerance)return l[p]}return null},Hl.prototype.snapTo=function(s){var l=new le(this._srcPts);return this.snapVertices(l,s),this.snapSegments(l,s),l.toCoordinateArray()},Hl.prototype.snapSegments=function(s,l){if(l.length===0)return null;var p=l.length;l[0].equals2D(l[l.length-1])&&(p=l.length-1);for(var h=0;h<p;h++){var y=l[h],_=this.findSegmentIndexToSnap(y,s);_>=0&&s.add(_+1,new R(y),!1)}},Hl.prototype.findSegmentIndexToSnap=function(s,l){for(var p=M.MAX_VALUE,h=-1,y=0;y<l.size()-1;y++){if(this._seg.p0=l.get(y),this._seg.p1=l.get(y+1),this._seg.p0.equals2D(s)||this._seg.p1.equals2D(s)){if(this._allowSnappingToSourceVertices)continue;return-1}var _=this._seg.distance(s);_<this._snapTolerance&&_<p&&(p=_,h=y)}return h},Hl.prototype.setAllowSnappingToSourceVertices=function(s){this._allowSnappingToSourceVertices=s},Hl.prototype.interfaces_=function(){return[]},Hl.prototype.getClass=function(){return Hl},Hl.isClosed=function(s){return!(s.length<=1)&&s[0].equals2D(s[s.length-1])};var ei=o(function(s){this._srcGeom=s||null},"Ji"),f7={SNAP_PRECISION_FACTOR:{configurable:!0}};ei.prototype.snapTo=function(s,l){var p=this.extractTargetCoordinates(s);return new d7(l,p).transform(this._srcGeom)},ei.prototype.snapToSelf=function(s,l){var p=this.extractTargetCoordinates(this._srcGeom),h=new d7(s,p,!0).transform(this._srcGeom),y=h;return l&&oe(y,ji)&&(y=h.buffer(0)),y},ei.prototype.computeSnapTolerance=function(s){return this.computeMinimumSegmentLength(s)/10},ei.prototype.extractTargetCoordinates=function(s){for(var l=new C,p=s.getCoordinates(),h=0;h<p.length;h++)l.add(p[h]);return l.toArray(new Array(0).fill(null))},ei.prototype.computeMinimumSegmentLength=function(s){for(var l=M.MAX_VALUE,p=0;p<s.length-1;p++){var h=s[p].distance(s[p+1]);h<l&&(l=h)}return l},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ei.snap=function(s,l,p){var h=new Array(2).fill(null),y=new ei(s);h[0]=y.snapTo(l,p);var _=new ei(l);return h[1]=_.snapTo(h[0],p),h},ei.computeOverlaySnapTolerance=function(){if(arguments.length===1){var s=arguments[0],l=ei.computeSizeBasedSnapTolerance(s),p=s.getPrecisionModel();if(p.getType()===_r.FIXED){var h=1/p.getScale()*2/1.415;h>l&&(l=h)}return l}if(arguments.length===2){var y=arguments[0],_=arguments[1];return Math.min(ei.computeOverlaySnapTolerance(y),ei.computeOverlaySnapTolerance(_))}},ei.computeSizeBasedSnapTolerance=function(s){var l=s.getEnvelopeInternal();return Math.min(l.getHeight(),l.getWidth())*ei.SNAP_PRECISION_FACTOR},ei.snapToSelf=function(s,l,p){return new ei(s).snapToSelf(l,p)},f7.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(ei,f7);var d7=function(s){function l(p,h,y){s.call(this),this._snapTolerance=p||null,this._snapPts=h||null,this._isSelfSnap=y!==void 0&&y}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.snapLine=function(p,h){var y=new Hl(p,this._snapTolerance);return y.setAllowSnappingToSourceVertices(this._isSelfSnap),y.snapTo(h)},l.prototype.transformCoordinates=function(p,h){var y=p.toCoordinateArray(),_=this.snapLine(y,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(_)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(ns),Ao=o(function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},"$i");Ao.prototype.getCommon=function(){return M.longBitsToDouble(this._commonBits)},Ao.prototype.add=function(s){var l=M.doubleToLongBits(s);if(this._isFirst)return this._commonBits=l,this._commonSignExp=Ao.signExpBits(this._commonBits),this._isFirst=!1,null;if(Ao.signExpBits(l)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Ao.numCommonMostSigMantissaBits(this._commonBits,l),this._commonBits=Ao.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Ao.prototype.toString=function(){if(arguments.length===1){var s=arguments[0],l=M.longBitsToDouble(s),p="0000000000000000000000000000000000000000000000000000000000000000"+M.toBinaryString(s),h=p.substring(p.length-64);return h.substring(0,1)+" "+h.substring(1,12)+"(exp) "+h.substring(12)+" [ "+l+" ]"}},Ao.prototype.interfaces_=function(){return[]},Ao.prototype.getClass=function(){return Ao},Ao.getBit=function(s,l){return(s&1<<l)!=0?1:0},Ao.signExpBits=function(s){return s>>52},Ao.zeroLowerBits=function(s,l){return s&~((1<<l)-1)},Ao.numCommonMostSigMantissaBits=function(s,l){for(var p=0,h=52;h>=0;h--){if(Ao.getBit(s,h)!==Ao.getBit(l,h))return p;p++}return 52};var Wc=o(function(){this._commonCoord=null,this._ccFilter=new Nd},"tr"),uw={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Wc.prototype.addCommonBits=function(s){var l=new qc(this._commonCoord);s.apply(l),s.geometryChanged()},Wc.prototype.removeCommonBits=function(s){if(this._commonCoord.x===0&&this._commonCoord.y===0)return s;var l=new R(this._commonCoord);l.x=-l.x,l.y=-l.y;var p=new qc(l);return s.apply(p),s.geometryChanged(),s},Wc.prototype.getCommonCoordinate=function(){return this._commonCoord},Wc.prototype.add=function(s){s.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Wc.prototype.interfaces_=function(){return[]},Wc.prototype.getClass=function(){return Wc},uw.CommonCoordinateFilter.get=function(){return Nd},uw.Translater.get=function(){return qc},Object.defineProperties(Wc,uw);var Nd=o(function(){this._commonBitsX=new Ao,this._commonBitsY=new Ao},"nr");Nd.prototype.filter=function(s){this._commonBitsX.add(s.x),this._commonBitsY.add(s.y)},Nd.prototype.getCommonCoordinate=function(){return new R(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Nd.prototype.interfaces_=function(){return[Ht]},Nd.prototype.getClass=function(){return Nd};var qc=o(function(){this.trans=null;var s=arguments[0];this.trans=s},"ir");qc.prototype.filter=function(s,l){var p=s.getOrdinate(l,0)+this.trans.x,h=s.getOrdinate(l,1)+this.trans.y;s.setOrdinate(l,0,p),s.setOrdinate(l,1,h)},qc.prototype.isDone=function(){return!1},qc.prototype.isGeometryChanged=function(){return!0},qc.prototype.interfaces_=function(){return[At]},qc.prototype.getClass=function(){return qc};var zi=o(function(s,l){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=s,this._geom[1]=l,this.computeSnapTolerance()},"rr");zi.prototype.selfSnap=function(s){return new ei(s).snapTo(s,this._snapTolerance)},zi.prototype.removeCommonBits=function(s){this._cbr=new Wc,this._cbr.add(s[0]),this._cbr.add(s[1]);var l=new Array(2).fill(null);return l[0]=this._cbr.removeCommonBits(s[0].copy()),l[1]=this._cbr.removeCommonBits(s[1].copy()),l},zi.prototype.prepareResult=function(s){return this._cbr.addCommonBits(s),s},zi.prototype.getResultGeometry=function(s){var l=this.snap(this._geom),p=wt.overlayOp(l[0],l[1],s);return this.prepareResult(p)},zi.prototype.checkValid=function(s){s.isValid()||pt.out.println("Snapped geometry is invalid")},zi.prototype.computeSnapTolerance=function(){this._snapTolerance=ei.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},zi.prototype.snap=function(s){var l=this.removeCommonBits(s);return ei.snap(l[0],l[1],this._snapTolerance)},zi.prototype.interfaces_=function(){return[]},zi.prototype.getClass=function(){return zi},zi.overlayOp=function(s,l,p){return new zi(s,l).getResultGeometry(p)},zi.union=function(s,l){return zi.overlayOp(s,l,wt.UNION)},zi.intersection=function(s,l){return zi.overlayOp(s,l,wt.INTERSECTION)},zi.symDifference=function(s,l){return zi.overlayOp(s,l,wt.SYMDIFFERENCE)},zi.difference=function(s,l){return zi.overlayOp(s,l,wt.DIFFERENCE)};var Fo=o(function(s,l){this._geom=new Array(2).fill(null),this._geom[0]=s,this._geom[1]=l},"or");Fo.prototype.getResultGeometry=function(s){var l=null,p=!1,h=null;try{l=wt.overlayOp(this._geom[0],this._geom[1],s),p=!0}catch(y){if(!(y instanceof Bt))throw y;h=y}if(!p)try{l=zi.overlayOp(this._geom[0],this._geom[1],s)}catch(y){throw y instanceof Bt?h:y}return l},Fo.prototype.interfaces_=function(){return[]},Fo.prototype.getClass=function(){return Fo},Fo.overlayOp=function(s,l,p){return new Fo(s,l).getResultGeometry(p)},Fo.union=function(s,l){return Fo.overlayOp(s,l,wt.UNION)},Fo.intersection=function(s,l){return Fo.overlayOp(s,l,wt.INTERSECTION)},Fo.symDifference=function(s,l){return Fo.overlayOp(s,l,wt.SYMDIFFERENCE)},Fo.difference=function(s,l){return Fo.overlayOp(s,l,wt.DIFFERENCE)};var c1=o(function(){this.mce=null,this.chainIndex=null;var s=arguments[0],l=arguments[1];this.mce=s,this.chainIndex=l},"sr");c1.prototype.computeIntersections=function(s,l){this.mce.computeIntersectsForChain(this.chainIndex,s.mce,s.chainIndex,l)},c1.prototype.interfaces_=function(){return[]},c1.prototype.getClass=function(){return c1};var ws=o(function s(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var l=arguments[0],p=arguments[1];this._eventType=s.DELETE,this._xValue=l,this._insertEvent=p}else if(arguments.length===3){var h=arguments[0],y=arguments[1],_=arguments[2];this._eventType=s.INSERT,this._label=h,this._xValue=y,this._obj=_}},"t"),cw={INSERT:{configurable:!0},DELETE:{configurable:!0}};ws.prototype.isDelete=function(){return this._eventType===ws.DELETE},ws.prototype.setDeleteEventIndex=function(s){this._deleteEventIndex=s},ws.prototype.getObject=function(){return this._obj},ws.prototype.compareTo=function(s){var l=s;return this._xValue<l._xValue?-1:this._xValue>l._xValue?1:this._eventType<l._eventType?-1:this._eventType>l._eventType?1:0},ws.prototype.getInsertEvent=function(){return this._insertEvent},ws.prototype.isInsert=function(){return this._eventType===ws.INSERT},ws.prototype.isSameLabel=function(s){return this._label!==null&&this._label===s._label},ws.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ws.prototype.interfaces_=function(){return[B]},ws.prototype.getClass=function(){return ws},cw.INSERT.get=function(){return 1},cw.DELETE.get=function(){return 2},Object.defineProperties(ws,cw);var mI=o(function(){},"lr");mI.prototype.interfaces_=function(){return[]},mI.prototype.getClass=function(){return mI};var to=o(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 s=arguments[0],l=arguments[1],p=arguments[2];this._li=s,this._includeProper=l,this._recordIsolated=p},"cr");to.prototype.isTrivialIntersection=function(s,l,p,h){if(s===p&&this._li.getIntersectionNum()===1){if(to.isAdjacentSegments(l,h))return!0;if(s.isClosed()){var y=s.getNumPoints()-1;if(l===0&&h===y||h===0&&l===y)return!0}}return!1},to.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},to.prototype.setIsDoneIfProperInt=function(s){this._isDoneWhenProperInt=s},to.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},to.prototype.isBoundaryPointInternal=function(s,l){for(var p=l.iterator();p.hasNext();){var h=p.next().getCoordinate();if(s.isIntersection(h))return!0}return!1},to.prototype.hasProperIntersection=function(){return this._hasProper},to.prototype.hasIntersection=function(){return this._hasIntersection},to.prototype.isDone=function(){return this._isDone},to.prototype.isBoundaryPoint=function(s,l){return l!==null&&(!!this.isBoundaryPointInternal(s,l[0])||!!this.isBoundaryPointInternal(s,l[1]))},to.prototype.setBoundaryNodes=function(s,l){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=s,this._bdyNodes[1]=l},to.prototype.addIntersections=function(s,l,p,h){if(s===p&&l===h)return null;this.numTests++;var y=s.getCoordinates()[l],_=s.getCoordinates()[l+1],E=p.getCoordinates()[h],k=p.getCoordinates()[h+1];this._li.computeIntersection(y,_,E,k),this._li.hasIntersection()&&(this._recordIsolated&&(s.setIsolated(!1),p.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(s,l,p,h)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(s.addIntersections(this._li,l,0),p.addIntersections(this._li,h,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))))},to.prototype.interfaces_=function(){return[]},to.prototype.getClass=function(){return to},to.isAdjacentSegments=function(s,l){return Math.abs(s-l)===1};var uq=function(s){function l(){s.call(this),this.events=new Le,this.nOverlaps=null}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.prepareEvents=function(){Ta.sort(this.events);for(var p=0;p<this.events.size();p++){var h=this.events.get(p);h.isDelete()&&h.getInsertEvent().setDeleteEventIndex(p)}},l.prototype.computeIntersections=function(){if(arguments.length===1){var p=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var h=0;h<this.events.size();h++){var y=this.events.get(h);if(y.isInsert()&&this.processOverlaps(h,y.getDeleteEventIndex(),y,p),p.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof to&&oe(arguments[0],Tn)&&oe(arguments[1],Tn)){var _=arguments[0],E=arguments[1],k=arguments[2];this.addEdges(_,_),this.addEdges(E,E),this.computeIntersections(k)}else if(typeof arguments[2]=="boolean"&&oe(arguments[0],Tn)&&arguments[1]instanceof to){var V=arguments[0],re=arguments[1];arguments[2]?this.addEdges(V,null):this.addEdges(V),this.computeIntersections(re)}}},l.prototype.addEdge=function(p,h){for(var y=p.getMonotoneChainEdge(),_=y.getStartIndexes(),E=0;E<_.length-1;E++){var k=new c1(y,E),V=new ws(h,y.getMinX(E),k);this.events.add(V),this.events.add(new ws(y.getMaxX(E),V))}},l.prototype.processOverlaps=function(p,h,y,_){for(var E=y.getObject(),k=p;k<h;k++){var V=this.events.get(k);if(V.isInsert()){var re=V.getObject();y.isSameLabel(V)||(E.computeIntersections(re,_),this.nOverlaps++)}}},l.prototype.addEdges=function(){if(arguments.length===1)for(var p=arguments[0].iterator();p.hasNext();){var h=p.next();this.addEdge(h,h)}else if(arguments.length===2)for(var y=arguments[0],_=arguments[1],E=y.iterator();E.hasNext();){var k=E.next();this.addEdge(k,_)}},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(mI),Wl=o(function(){this._min=M.POSITIVE_INFINITY,this._max=M.NEGATIVE_INFINITY},"hr"),h7={NodeComparator:{configurable:!0}};Wl.prototype.getMin=function(){return this._min},Wl.prototype.intersects=function(s,l){return!(this._min>l||this._max<s)},Wl.prototype.getMax=function(){return this._max},Wl.prototype.toString=function(){return xt.toLineString(new R(this._min,0),new R(this._max,0))},Wl.prototype.interfaces_=function(){return[]},Wl.prototype.getClass=function(){return Wl},h7.NodeComparator.get=function(){return p1},Object.defineProperties(Wl,h7);var p1=o(function(){},"gr");p1.prototype.compare=function(s,l){var p=s,h=l,y=(p._min+p._max)/2,_=(h._min+h._max)/2;return y<_?-1:y>_?1:0},p1.prototype.interfaces_=function(){return[z]},p1.prototype.getClass=function(){return p1};var cq=function(s){function l(){s.call(this),this._item=null;var p=arguments[0],h=arguments[1],y=arguments[2];this._min=p,this._max=h,this._item=y}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.query=function(p,h,y){if(!this.intersects(p,h))return null;y.visitItem(this._item)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(Wl),pq=function(s){function l(){s.call(this),this._node1=null,this._node2=null;var p=arguments[0],h=arguments[1];this._node1=p,this._node2=h,this.buildExtent(this._node1,this._node2)}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.buildExtent=function(p,h){this._min=Math.min(p._min,h._min),this._max=Math.max(p._max,h._max)},l.prototype.query=function(p,h,y){if(!this.intersects(p,h))return null;this._node1!==null&&this._node1.query(p,h,y),this._node2!==null&&this._node2.query(p,h,y)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(Wl),ql=o(function(){this._leaves=new Le,this._root=null,this._level=0},"_r");ql.prototype.buildTree=function(){Ta.sort(this._leaves,new Wl.NodeComparator);for(var s=this._leaves,l=null,p=new Le;;){if(this.buildLevel(s,p),p.size()===1)return p.get(0);l=s,s=p,p=l}},ql.prototype.insert=function(s,l,p){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new cq(s,l,p))},ql.prototype.query=function(s,l,p){this.init(),this._root.query(s,l,p)},ql.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},ql.prototype.printNode=function(s){pt.out.println(xt.toLineString(new R(s._min,this._level),new R(s._max,this._level)))},ql.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},ql.prototype.buildLevel=function(s,l){this._level++,l.clear();for(var p=0;p<s.size();p+=2){var h=s.get(p);if((p+1<s.size()?s.get(p):null)===null)l.add(h);else{var y=new pq(s.get(p),s.get(p+1));l.add(y)}}},ql.prototype.interfaces_=function(){return[]},ql.prototype.getClass=function(){return ql};var ng=o(function(){this._items=new Le},"mr");ng.prototype.visitItem=function(s){this._items.add(s)},ng.prototype.getItems=function(){return this._items},ng.prototype.interfaces_=function(){return[Gc]},ng.prototype.getClass=function(){return ng};var ig=o(function(){this._index=null;var s=arguments[0];if(!oe(s,ji))throw new A("Argument must be Polygonal");this._index=new yf(s)},"vr"),pw={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};ig.prototype.locate=function(s){var l=new Zn(s),p=new og(l);return this._index.query(s.y,s.y,p),l.getLocation()},ig.prototype.interfaces_=function(){return[eg]},ig.prototype.getClass=function(){return ig},pw.SegmentVisitor.get=function(){return og},pw.IntervalIndexedGeometry.get=function(){return yf},Object.defineProperties(ig,pw);var og=o(function(){this._counter=null;var s=arguments[0];this._counter=s},"Er");og.prototype.visitItem=function(s){var l=s;this._counter.countSegment(l.getCoordinate(0),l.getCoordinate(1))},og.prototype.interfaces_=function(){return[Gc]},og.prototype.getClass=function(){return og};var yf=o(function(){this._index=new ql;var s=arguments[0];this.init(s)},"xr");yf.prototype.init=function(s){for(var l=Ji.getLines(s).iterator();l.hasNext();){var p=l.next().getCoordinates();this.addLine(p)}},yf.prototype.addLine=function(s){for(var l=1;l<s.length;l++){var p=new st(s[l-1],s[l]),h=Math.min(p.p0.y,p.p1.y),y=Math.max(p.p0.y,p.p1.y);this._index.insert(h,y,p)}},yf.prototype.query=function(){if(arguments.length===2){var s=arguments[0],l=arguments[1],p=new ng;return this._index.query(s,l,p),p.getItems()}if(arguments.length===3){var h=arguments[0],y=arguments[1],_=arguments[2];this._index.query(h,y,_)}},yf.prototype.interfaces_=function(){return[]},yf.prototype.getClass=function(){return yf};var f1=function(s){function l(){if(s.call(this),this._parentGeom=null,this._lineEdgeMap=new XL,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Ma,arguments.length===2){var p=arguments[0],h=arguments[1],y=ot.OGC_SFS_BOUNDARY_RULE;this._argIndex=p,this._parentGeom=h,this._boundaryNodeRule=y,h!==null&&this.add(h)}else if(arguments.length===3){var _=arguments[0],E=arguments[1],k=arguments[2];this._argIndex=_,this._parentGeom=E,this._boundaryNodeRule=k,E!==null&&this.add(E)}}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.insertBoundaryPoint=function(p,h){var y=this._nodes.addNode(h).getLabel(),_=1;U.NONE,y.getLocation(p,je.ON)===U.BOUNDARY&&_++;var E=l.determineBoundary(this._boundaryNodeRule,_);y.setLocation(p,E)},l.prototype.computeSelfNodes=function(){if(arguments.length===2){var p=arguments[0],h=arguments[1];return this.computeSelfNodes(p,h,!1)}if(arguments.length===3){var y=arguments[0],_=arguments[1],E=arguments[2],k=new to(y,!0,!1);k.setIsDoneIfProperInt(E);var V=this.createEdgeSetIntersector(),re=this._parentGeom instanceof Qo||this._parentGeom instanceof Vr||this._parentGeom instanceof wa,de=_||!re;return V.computeIntersections(this._edges,k,de),this.addSelfIntersectionNodes(this._argIndex),k}},l.prototype.computeSplitEdges=function(p){for(var h=this._edges.iterator();h.hasNext();)h.next().eiList.addSplitEdges(p)},l.prototype.computeEdgeIntersections=function(p,h,y){var _=new to(h,y,!0);return _.setBoundaryNodes(this.getBoundaryNodes(),p.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,p._edges,_),_},l.prototype.getGeometry=function(){return this._parentGeom},l.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},l.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},l.prototype.addPoint=function(){if(arguments[0]instanceof En){var p=arguments[0].getCoordinate();this.insertPoint(this._argIndex,p,U.INTERIOR)}else if(arguments[0]instanceof R){var h=arguments[0];this.insertPoint(this._argIndex,h,U.INTERIOR)}},l.prototype.addPolygon=function(p){this.addPolygonRing(p.getExteriorRing(),U.EXTERIOR,U.INTERIOR);for(var h=0;h<p.getNumInteriorRing();h++){var y=p.getInteriorRingN(h);this.addPolygonRing(y,U.INTERIOR,U.EXTERIOR)}},l.prototype.addEdge=function(p){this.insertEdge(p);var h=p.getCoordinates();this.insertPoint(this._argIndex,h[0],U.BOUNDARY),this.insertPoint(this._argIndex,h[h.length-1],U.BOUNDARY)},l.prototype.addLineString=function(p){var h=F.removeRepeatedPoints(p.getCoordinates());if(h.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=h[0],null;var y=new hI(h,new zr(this._argIndex,U.INTERIOR));this._lineEdgeMap.put(p,y),this.insertEdge(y),Xe.isTrue(h.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,h[0]),this.insertBoundaryPoint(this._argIndex,h[h.length-1])},l.prototype.getInvalidPoint=function(){return this._invalidPoint},l.prototype.getBoundaryPoints=function(){for(var p=this.getBoundaryNodes(),h=new Array(p.size()).fill(null),y=0,_=p.iterator();_.hasNext();){var E=_.next();h[y++]=E.getCoordinate().copy()}return h},l.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},l.prototype.addSelfIntersectionNode=function(p,h,y){if(this.isBoundaryNode(p,h))return null;y===U.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(p,h):this.insertPoint(p,h,y)},l.prototype.addPolygonRing=function(p,h,y){if(p.isEmpty())return null;var _=F.removeRepeatedPoints(p.getCoordinates());if(_.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=_[0],null;var E=h,k=y;Ge.isCCW(_)&&(E=y,k=h);var V=new hI(_,new zr(this._argIndex,U.BOUNDARY,E,k));this._lineEdgeMap.put(p,V),this.insertEdge(V),this.insertPoint(this._argIndex,_[0],U.BOUNDARY)},l.prototype.insertPoint=function(p,h,y){var _=this._nodes.addNode(h),E=_.getLabel();E===null?_._label=new zr(p,y):E.setLocation(p,y)},l.prototype.createEdgeSetIntersector=function(){return new uq},l.prototype.addSelfIntersectionNodes=function(p){for(var h=this._edges.iterator();h.hasNext();)for(var y=h.next(),_=y.getLabel().getLocation(p),E=y.eiList.iterator();E.hasNext();){var k=E.next();this.addSelfIntersectionNode(p,k.coord,_)}},l.prototype.add=function(){if(arguments.length!==1)return s.prototype.add.apply(this,arguments);var p=arguments[0];if(p.isEmpty())return null;if(p instanceof wa&&(this._useBoundaryDeterminationRule=!1),p instanceof Vr)this.addPolygon(p);else if(p instanceof Ut)this.addLineString(p);else if(p instanceof En)this.addPoint(p);else if(p instanceof bs)this.addCollection(p);else if(p instanceof on)this.addCollection(p);else if(p instanceof wa)this.addCollection(p);else{if(!(p instanceof mt))throw new Error(p.getClass().getName());this.addCollection(p)}},l.prototype.addCollection=function(p){for(var h=0;h<p.getNumGeometries();h++){var y=p.getGeometryN(h);this.add(y)}},l.prototype.locate=function(p){return oe(this._parentGeom,ji)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new ig(this._parentGeom)),this._areaPtLocator.locate(p)):this._ptLocator.locate(p,this._parentGeom)},l.prototype.findEdge=function(){if(arguments.length===1){var p=arguments[0];return this._lineEdgeMap.get(p)}return s.prototype.findEdge.apply(this,arguments)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l.determineBoundary=function(p,h){return p.isInBoundary(h)?U.BOUNDARY:U.INTERIOR},l}(kn),sg=o(function(){if(this._li=new Gi,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var s=arguments[0];this.setComputationPrecision(s.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new f1(0,s)}else if(arguments.length===2){var l=arguments[0],p=arguments[1],h=ot.OGC_SFS_BOUNDARY_RULE;l.getPrecisionModel().compareTo(p.getPrecisionModel())>=0?this.setComputationPrecision(l.getPrecisionModel()):this.setComputationPrecision(p.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new f1(0,l,h),this._arg[1]=new f1(1,p,h)}else if(arguments.length===3){var y=arguments[0],_=arguments[1],E=arguments[2];y.getPrecisionModel().compareTo(_.getPrecisionModel())>=0?this.setComputationPrecision(y.getPrecisionModel()):this.setComputationPrecision(_.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new f1(0,y,E),this._arg[1]=new f1(1,_,E)}},"Cr");sg.prototype.getArgGeometry=function(s){return this._arg[s].getGeometry()},sg.prototype.setComputationPrecision=function(s){this._resultPrecisionModel=s,this._li.setPrecisionModel(this._resultPrecisionModel)},sg.prototype.interfaces_=function(){return[]},sg.prototype.getClass=function(){return sg};var vf=o(function(){},"Sr");vf.prototype.interfaces_=function(){return[]},vf.prototype.getClass=function(){return vf},vf.map=function(){if(arguments[0]instanceof ut&&oe(arguments[1],vf.MapOp)){for(var s=arguments[0],l=arguments[1],p=new Le,h=0;h<s.getNumGeometries();h++){var y=l.map(s.getGeometryN(h));y!==null&&p.add(y)}return s.getFactory().buildGeometry(p)}if(oe(arguments[0],Dt)&&oe(arguments[1],vf.MapOp)){for(var _=arguments[0],E=arguments[1],k=new Le,V=_.iterator();V.hasNext();){var re=V.next(),de=E.map(re);de!==null&&k.add(de)}return k}},vf.MapOp=function(){};var wt=function(s){function l(){var p=arguments[0],h=arguments[1];s.call(this,p,h),this._ptLocator=new Ma,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Ea,this._resultPolyList=new Le,this._resultLineList=new Le,this._resultPointList=new Le,this._graph=new kn(new o7),this._geomFact=p.getFactory()}return o(l,"e"),s&&(l.__proto__=s),l.prototype=Object.create(s&&s.prototype),l.prototype.constructor=l,l.prototype.insertUniqueEdge=function(p){var h=this._edgeList.findEqualEdge(p);if(h!==null){var y=h.getLabel(),_=p.getLabel();h.isPointwiseEqual(p)||(_=new zr(p.getLabel())).flip();var E=h.getDepth();E.isNull()&&E.add(y),E.add(_),y.merge(_)}else this._edgeList.add(p)},l.prototype.getGraph=function(){return this._graph},l.prototype.cancelDuplicateResultEdges=function(){for(var p=this._graph.getEdgeEnds().iterator();p.hasNext();){var h=p.next(),y=h.getSym();h.isInResult()&&y.isInResult()&&(h.setInResult(!1),y.setInResult(!1))}},l.prototype.isCoveredByLA=function(p){return!!this.isCovered(p,this._resultLineList)||!!this.isCovered(p,this._resultPolyList)},l.prototype.computeGeometry=function(p,h,y,_){var E=new Le;return E.addAll(p),E.addAll(h),E.addAll(y),E.isEmpty()?l.createEmptyResult(_,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(E)},l.prototype.mergeSymLabels=function(){for(var p=this._graph.getNodes().iterator();p.hasNext();)p.next().getEdges().mergeSymLabels()},l.prototype.isCovered=function(p,h){for(var y=h.iterator();y.hasNext();){var _=y.next();if(this._ptLocator.locate(p,_)!==U.EXTERIOR)return!0}return!1},l.prototype.replaceCollapsedEdges=function(){for(var p=new Le,h=this._edgeList.iterator();h.hasNext();){var y=h.next();y.isCollapsed()&&(h.remove(),p.add(y.getCollapsedEdge()))}this._edgeList.addAll(p)},l.prototype.updateNodeLabelling=function(){for(var p=this._graph.getNodes().iterator();p.hasNext();){var h=p.next(),y=h.getEdges().getLabel();h.getLabel().merge(y)}},l.prototype.getResultGeometry=function(p){return this.computeOverlay(p),this._resultGeom},l.prototype.insertUniqueEdges=function(p){for(var h=p.iterator();h.hasNext();){var y=h.next();this.insertUniqueEdge(y)}},l.prototype.computeOverlay=function(p){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 h=new Le;this._arg[0].computeSplitEdges(h),this._arg[1].computeSplitEdges(h),this.insertUniqueEdges(h),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),gf.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(p),this.cancelDuplicateResultEdges();var y=new Ss(this._geomFact);y.add(this._graph),this._resultPolyList=y.getPolygons();var _=new ol(this,this._geomFact,this._ptLocator);this._resultLineList=_.build(p);var E=new Fd(this,this._geomFact,this._ptLocator);this._resultPointList=E.build(p),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,p)},l.prototype.labelIncompleteNode=function(p,h){var y=this._ptLocator.locate(p.getCoordinate(),this._arg[h].getGeometry());p.getLabel().setLocation(h,y)},l.prototype.copyPoints=function(p){for(var h=this._arg[p].getNodeIterator();h.hasNext();){var y=h.next();this._graph.addNode(y.getCoordinate()).setLabel(p,y.getLabel().getLocation(p))}},l.prototype.findResultAreaEdges=function(p){for(var h=this._graph.getEdgeEnds().iterator();h.hasNext();){var y=h.next(),_=y.getLabel();_.isArea()&&!y.isInteriorAreaEdge()&&l.isResultOfOp(_.getLocation(0,je.RIGHT),_.getLocation(1,je.RIGHT),p)&&y.setInResult(!0)}},l.prototype.computeLabelsFromDepths=function(){for(var p=this._edgeList.iterator();p.hasNext();){var h=p.next(),y=h.getLabel(),_=h.getDepth();if(!_.isNull()){_.normalize();for(var E=0;E<2;E++)y.isNull(E)||!y.isArea()||_.isNull(E)||(_.getDelta(E)===0?y.toLine(E):(Xe.isTrue(!_.isNull(E,je.LEFT),"depth of LEFT side has not been initialized"),y.setLocation(E,je.LEFT,_.getLocation(E,je.LEFT)),Xe.isTrue(!_.isNull(E,je.RIGHT),"depth of RIGHT side has not been initialized"),y.setLocation(E,je.RIGHT,_.getLocation(E,je.RIGHT))))}}},l.prototype.computeLabelling=function(){for(var p=this._graph.getNodes().iterator();p.hasNext();)p.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},l.prototype.labelIncompleteNodes=function(){for(var p=this._graph.getNodes().iterator();p.hasNext();){var h=p.next(),y=h.getLabel();h.isIsolated()&&(y.isNull(0)?this.labelIncompleteNode(h,0):this.labelIncompleteNode(h,1)),h.getEdges().updateLabelling(y)}},l.prototype.isCoveredByA=function(p){return!!this.isCovered(p,this._resultPolyList)},l.prototype.interfaces_=function(){return[]},l.prototype.getClass=function(){return l},l}(sg);wt.overlayOp=function(s,l,p){return new wt(s,l).getResultGeometry(p)},wt.intersection=function(s,l){if(s.isEmpty()||l.isEmpty())return wt.createEmptyResult(wt.INTERSECTION,s,l,s.getFactory());if(s.isGeometryCollection()){var p=l;return Ad.map(s,{interfaces_:o(function(){return[vf.MapOp]},"interfaces_"),map:o(function(h){return h.intersection(p)},"map")})}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(l),Fo.overlayOp(s,l,wt.INTERSECTION)},wt.symDifference=function(s,l){if(s.isEmpty()||l.isEmpty()){if(s.isEmpty()&&l.isEmpty())return wt.createEmptyResult(wt.SYMDIFFERENCE,s,l,s.getFactory());if(s.isEmpty())return l.copy();if(l.isEmpty())return s.copy()}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(l),Fo.overlayOp(s,l,wt.SYMDIFFERENCE)},wt.resultDimension=function(s,l,p){var h=l.getDimension(),y=p.getDimension(),_=-1;switch(s){case wt.INTERSECTION:_=Math.min(h,y);break;case wt.UNION:_=Math.max(h,y);break;case wt.DIFFERENCE:_=h;break;case wt.SYMDIFFERENCE:_=Math.max(h,y)}return _},wt.createEmptyResult=function(s,l,p,h){var y=null;switch(wt.resultDimension(s,l,p)){case-1:y=h.createGeometryCollection(new Array(0).fill(null));break;case 0:y=h.createPoint();break;case 1:y=h.createLineString();break;case 2:y=h.createPolygon()}return y},wt.difference=function(s,l){return s.isEmpty()?wt.createEmptyResult(wt.DIFFERENCE,s,l,s.getFactory()):l.isEmpty()?s.copy():(s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(l),Fo.overlayOp(s,l,wt.DIFFERENCE))},wt.isResultOfOp=function(){if(arguments.length===2){var s=arguments[0],l=arguments[1],p=s.getLocation(0),h=s.getLocation(1);return wt.isResultOfOp(p,h,l)}if(arguments.length===3){var y=arguments[0],_=arguments[1],E=arguments[2];switch(y===U.BOUNDARY&&(y=U.INTERIOR),_===U.BOUNDARY&&(_=U.INTERIOR),E){case wt.INTERSECTION:return y===U.INTERIOR&&_===U.INTERIOR;case wt.UNION:return y===U.INTERIOR||_===U.INTERIOR;case wt.DIFFERENCE:return y===U.INTERIOR&&_!==U.INTERIOR;case wt.SYMDIFFERENCE:return y===U.INTERIOR&&_!==U.INTERIOR||y!==U.INTERIOR&&_===U.INTERIOR}return!1}},wt.INTERSECTION=1,wt.UNION=2,wt.DIFFERENCE=3,wt.SYMDIFFERENCE=4;var Yc=o(function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Ma,this._seg=new st;var s=arguments[0],l=arguments[1];this._g=s,this._boundaryDistanceTolerance=l,this._linework=this.extractLinework(s)},"br");Yc.prototype.isWithinToleranceOfBoundary=function(s){for(var l=0;l<this._linework.getNumGeometries();l++)for(var p=this._linework.getGeometryN(l).getCoordinateSequence(),h=0;h<p.size()-1;h++)if(p.getCoordinate(h,this._seg.p0),p.getCoordinate(h+1,this._seg.p1),this._seg.distance(s)<=this._boundaryDistanceTolerance)return!0;return!1},Yc.prototype.getLocation=function(s){return this.isWithinToleranceOfBoundary(s)?U.BOUNDARY:this._ptLocator.locate(s,this._g)},Yc.prototype.extractLinework=function(s){var l=new ag;s.apply(l);var p=l.getLinework(),h=jt.toLineStringArray(p);return s.getFactory().createMultiLineString(h)},Yc.prototype.interfaces_=function(){return[]},Yc.prototype.getClass=function(){return Yc};var ag=o(function(){this._linework=null,this._linework=new Le},"wr");ag.prototype.getLinework=function(){return this._linework},ag.prototype.filter=function(s){if(s instanceof Vr){var l=s;this._linework.add(l.getExteriorRing());for(var p=0;p<l.getNumInteriorRing();p++)this._linework.add(l.getInteriorRingN(p))}},ag.prototype.interfaces_=function(){return[ft]},ag.prototype.getClass=function(){return ag};var xf=o(function(){this._g=null,this._doLeft=!0,this._doRight=!0;var s=arguments[0];this._g=s},"Or");xf.prototype.extractPoints=function(s,l,p){for(var h=s.getCoordinates(),y=0;y<h.length-1;y++)this.computeOffsetPoints(h[y],h[y+1],l,p)},xf.prototype.setSidesToGenerate=function(s,l){this._doLeft=s,this._doRight=l},xf.prototype.getPoints=function(s){for(var l=new Le,p=Ji.getLines(this._g).iterator();p.hasNext();){var h=p.next();this.extractPoints(h,s,l)}return l},xf.prototype.computeOffsetPoints=function(s,l,p,h){var y=l.x-s.x,_=l.y-s.y,E=Math.sqrt(y*y+_*_),k=p*y/E,V=p*_/E,re=(l.x+s.x)/2,de=(l.y+s.y)/2;if(this._doLeft){var xe=new R(re-V,de+k);h.add(xe)}if(this._doRight){var Ve=new R(re+V,de-k);h.add(Ve)}},xf.prototype.interfaces_=function(){return[]},xf.prototype.getClass=function(){return xf};var Us=o(function s(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=s.TOLERANCE,this._testCoords=new Le;var l=arguments[0],p=arguments[1],h=arguments[2];this._boundaryDistanceTolerance=s.computeBoundaryDistanceTolerance(l,p),this._geom=[l,p,h],this._locFinder=[new Yc(this._geom[0],this._boundaryDistanceTolerance),new Yc(this._geom[1],this._boundaryDistanceTolerance),new Yc(this._geom[2],this._boundaryDistanceTolerance)]},"t"),m7={TOLERANCE:{configurable:!0}};Us.prototype.reportResult=function(s,l,p){pt.out.println("Overlay result invalid - A:"+U.toLocationSymbol(l[0])+" B:"+U.toLocationSymbol(l[1])+" expected:"+(p?"i":"e")+" actual:"+U.toLocationSymbol(l[2]))},Us.prototype.isValid=function(s){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var l=this.checkValid(s);return l},Us.prototype.checkValid=function(){if(arguments.length===1){for(var s=arguments[0],l=0;l<this._testCoords.size();l++){var p=this._testCoords.get(l);if(!this.checkValid(s,p))return this._invalidLocation=p,!1}return!0}if(arguments.length===2){var h=arguments[0],y=arguments[1];return this._location[0]=this._locFinder[0].getLocation(y),this._location[1]=this._locFinder[1].getLocation(y),this._location[2]=this._locFinder[2].getLocation(y),!!Us.hasLocation(this._location,U.BOUNDARY)||this.isValidResult(h,this._location)}},Us.prototype.addTestPts=function(s){var l=new xf(s);this._testCoords.addAll(l.getPoints(5*this._boundaryDistanceTolerance))},Us.prototype.isValidResult=function(s,l){var p=wt.isResultOfOp(l[0],l[1],s),h=!(p^l[2]===U.INTERIOR);return h||this.reportResult(s,l,p),h},Us.prototype.getInvalidLocation=function(){return this._invalidLocation},Us.prototype.interfaces_=function(){return[]},Us.prototype.getClass=function(){return Us},Us.hasLocation=function(s,l){for(var p=0;p<3;p++)if(s[p]===l)return!0;return!1},Us.computeBoundaryDistanceTolerance=function(s,l){return Math.min(ei.computeSizeBasedSnapTolerance(s),ei.computeSizeBasedSnapTolerance(l))},Us.isValid=function(s,l,p,h){return new Us(s,l,h).isValid(p)},m7.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Us,m7);var Vs=o(function s(l){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=s.extractFactory(l),this._inputGeoms=l},"t");Vs.prototype.extractElements=function(s,l){if(s===null)return null;for(var p=0;p<s.getNumGeometries();p++){var h=s.getGeometryN(p);this._skipEmpty&&h.isEmpty()||l.add(h)}},Vs.prototype.combine=function(){for(var s=new Le,l=this._inputGeoms.iterator();l.hasNext();){var p=l.next();this.extractElements(p,s)}return s.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(s)},Vs.prototype.interfaces_=function(){return[]},Vs.prototype.getClass=function(){return Vs},Vs.combine=function(){if(arguments.length===1){var s=arguments[0];return new Vs(s).combine()}if(arguments.length===2){var l=arguments[0],p=arguments[1];return new Vs(Vs.createList(l,p)).combine()}if(arguments.length===3){var h=arguments[0],y=arguments[1],_=arguments[2];return new Vs(Vs.createList(h,y,_)).combine()}},Vs.extractFactory=function(s){return s.isEmpty()?null:s.iterator().next().getFactory()},Vs.createList=function(){if(arguments.length===2){var s=arguments[0],l=arguments[1],p=new Le;return p.add(s),p.add(l),p}if(arguments.length===3){var h=arguments[0],y=arguments[1],_=arguments[2],E=new Le;return E.add(h),E.add(y),E.add(_),E}};var pi=o(function(){this._inputPolys=null,this._geomFactory=null;var s=arguments[0];this._inputPolys=s,this._inputPolys===null&&(this._inputPolys=new Le)},"Dr"),g7={STRTREE_NODE_CAPACITY:{configurable:!0}};pi.prototype.reduceToGeometries=function(s){for(var l=new Le,p=s.iterator();p.hasNext();){var h=p.next(),y=null;oe(h,Tn)?y=this.unionTree(h):h instanceof ut&&(y=h),l.add(y)}return l},pi.prototype.extractByEnvelope=function(s,l,p){for(var h=new Le,y=0;y<l.getNumGeometries();y++){var _=l.getGeometryN(y);_.getEnvelopeInternal().intersects(s)?h.add(_):p.add(_)}return this._geomFactory.buildGeometry(h)},pi.prototype.unionOptimized=function(s,l){var p=s.getEnvelopeInternal(),h=l.getEnvelopeInternal();if(!p.intersects(h))return Vs.combine(s,l);if(s.getNumGeometries()<=1&&l.getNumGeometries()<=1)return this.unionActual(s,l);var y=p.intersection(h);return this.unionUsingEnvelopeIntersection(s,l,y)},pi.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 s=new QL(pi.STRTREE_NODE_CAPACITY),l=this._inputPolys.iterator();l.hasNext();){var p=l.next();s.insert(p.getEnvelopeInternal(),p)}this._inputPolys=null;var h=s.itemsTree();return this.unionTree(h)},pi.prototype.binaryUnion=function(){if(arguments.length===1){var s=arguments[0];return this.binaryUnion(s,0,s.size())}if(arguments.length===3){var l=arguments[0],p=arguments[1],h=arguments[2];if(h-p<=1){var y=pi.getGeometry(l,p);return this.unionSafe(y,null)}if(h-p==2)return this.unionSafe(pi.getGeometry(l,p),pi.getGeometry(l,p+1));var _=Math.trunc((h+p)/2),E=this.binaryUnion(l,p,_),k=this.binaryUnion(l,_,h);return this.unionSafe(E,k)}},pi.prototype.repeatedUnion=function(s){for(var l=null,p=s.iterator();p.hasNext();){var h=p.next();l=l===null?h.copy():l.union(h)}return l},pi.prototype.unionSafe=function(s,l){return s===null&&l===null?null:s===null?l.copy():l===null?s.copy():this.unionOptimized(s,l)},pi.prototype.unionActual=function(s,l){return pi.restrictToPolygons(s.union(l))},pi.prototype.unionTree=function(s){var l=this.reduceToGeometries(s);return this.binaryUnion(l)},pi.prototype.unionUsingEnvelopeIntersection=function(s,l,p){var h=new Le,y=this.extractByEnvelope(p,s,h),_=this.extractByEnvelope(p,l,h),E=this.unionActual(y,_);return h.add(E),Vs.combine(h)},pi.prototype.bufferUnion=function(){if(arguments.length===1){var s=arguments[0];return s.get(0).getFactory().buildGeometry(s).buffer(0)}if(arguments.length===2){var l=arguments[0],p=arguments[1];return l.getFactory().createGeometryCollection([l,p]).buffer(0)}},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi},pi.restrictToPolygons=function(s){if(oe(s,ji))return s;var l=Bu.getPolygons(s);return l.size()===1?l.get(0):s.getFactory().createMultiPolygon(jt.toPolygonArray(l))},pi.getGeometry=function(s,l){return l>=s.size()?null:s.get(l)},pi.union=function(s){return new pi(s).union()},g7.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(pi,g7);var d1=o(function(){},"Ar");d1.prototype.interfaces_=function(){return[]},d1.prototype.getClass=function(){return d1},d1.union=function(s,l){if(s.isEmpty()||l.isEmpty()){if(s.isEmpty()&&l.isEmpty())return wt.createEmptyResult(wt.UNION,s,l,s.getFactory());if(s.isEmpty())return l.copy();if(l.isEmpty())return s.copy()}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(l),Fo.overlayOp(s,l,wt.UNION)},e.GeoJSONReader=rw,e.GeoJSONWriter=KL,e.OverlayOp=wt,e.UnionOp=d1,e.BufferOp=Ki,Object.defineProperty(e,"__esModule",{value:!0})})});var SU=ze((MIt,k4)=>{"use strict";g();var N_=Aw();N_.default&&(N_=N_.default);k4.exports=IU;k4.exports.default=IU;function IU(e,t,r){t=t||1;for(var n,i,a,u,c=0;c<e[0].length;c++){var f=e[0][c];(!c||f[0]<n)&&(n=f[0]),(!c||f[1]<i)&&(i=f[1]),(!c||f[0]>a)&&(a=f[0]),(!c||f[1]>u)&&(u=f[1])}var m=a-n,v=u-i,x=Math.min(m,v),I=x/2;if(x===0){var C=[n,i];return C.distance=0,C}for(var T=new N_(void 0,Rce),O=n;O<a;O+=x)for(var P=i;P<u;P+=x)T.push(new ed(O+I,P+I,I,e));var L=Bce(e),A=new ed(n+m/2,i+v/2,0,e);A.d>L.d&&(L=A);for(var M=T.length;T.length;){var N=T.pop();N.d>L.d&&(L=N,r&&console.log("found best %d after %d probes",Math.round(1e4*N.d)/1e4,M)),!(N.max-L.d<=t)&&(I=N.h/2,T.push(new ed(N.x-I,N.y-I,I,e)),T.push(new ed(N.x+I,N.y-I,I,e)),T.push(new ed(N.x-I,N.y+I,I,e)),T.push(new ed(N.x+I,N.y+I,I,e)),M+=4)}r&&(console.log("num probes: "+M),console.log("best distance: "+L.d));var B=[L.x,L.y];return B.distance=L.d,B}o(IU,"polylabel");function Rce(e,t){return t.max-e.max}o(Rce,"compareMax");function ed(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=kce(e,t,n),this.max=this.d+this.h*Math.SQRT2}o(ed,"Cell");function kce(e,t,r){for(var n=!1,i=1/0,a=0;a<r.length;a++)for(var u=r[a],c=0,f=u.length,m=f-1;c<f;m=c++){var v=u[c],x=u[m];v[1]>t!=x[1]>t&&e<(x[0]-v[0])*(t-v[1])/(x[1]-v[1])+v[0]&&(n=!n),i=Math.min(i,Gce(e,t,v,x))}return i===0?0:(n?1:-1)*Math.sqrt(i)}o(kce,"pointToPolygonDist");function Bce(e){for(var t=0,r=0,n=0,i=e[0],a=0,u=i.length,c=u-1;a<u;c=a++){var f=i[a],m=i[c],v=f[0]*m[1]-m[0]*f[1];r+=(f[0]+m[0])*v,n+=(f[1]+m[1])*v,t+=v*3}return t===0?new ed(i[0][0],i[0][1],0,e):new ed(r/t,n/t,0,e)}o(Bce,"getCentroidCell");function Gce(e,t,r,n){var i=r[0],a=r[1],u=n[0]-i,c=n[1]-a;if(u!==0||c!==0){var f=((e-i)*u+(t-a)*c)/(u*u+c*c);f>1?(i=n[0],a=n[1]):f>0&&(i+=u*f,a+=c*f)}return u=e-i,c=t-a,u*u+c*c}o(Gce,"getSegDistSq")});var I5=ze((tx,Ky)=>{g();var Ope=200,dV="__lodash_hash_undefined__",Lpe=800,Dpe=16,hV=9007199254740991,mV="[object Arguments]",Ape="[object Array]",Fpe="[object AsyncFunction]",Npe="[object Boolean]",Rpe="[object Date]",kpe="[object Error]",gV="[object Function]",Bpe="[object GeneratorFunction]",Gpe="[object Map]",jpe="[object Number]",Upe="[object Null]",yV="[object Object]",Vpe="[object Proxy]",zpe="[object RegExp]",$pe="[object Set]",Hpe="[object String]",Wpe="[object Undefined]",qpe="[object WeakMap]",Ype="[object ArrayBuffer]",Xpe="[object DataView]",Zpe="[object Float32Array]",Kpe="[object Float64Array]",Jpe="[object Int8Array]",Qpe="[object Int16Array]",efe="[object Int32Array]",tfe="[object Uint8Array]",rfe="[object Uint8ClampedArray]",nfe="[object Uint16Array]",ife="[object Uint32Array]",ofe=/[\\^$.*+?()[\]{}|]/g,sfe=/^\[object .+?Constructor\]$/,afe=/^(?:0|[1-9]\d*)$/,si={};si[Zpe]=si[Kpe]=si[Jpe]=si[Qpe]=si[efe]=si[tfe]=si[rfe]=si[nfe]=si[ife]=!0;si[mV]=si[Ape]=si[Ype]=si[Npe]=si[Xpe]=si[Rpe]=si[kpe]=si[gV]=si[Gpe]=si[jpe]=si[yV]=si[zpe]=si[$pe]=si[Hpe]=si[qpe]=!1;var vV=typeof global=="object"&&global&&global.Object===Object&&global,lfe=typeof self=="object"&&self&&self.Object===Object&&self,ix=vV||lfe||Function("return this")(),xV=typeof tx=="object"&&tx&&!tx.nodeType&&tx,rx=xV&&typeof Ky=="object"&&Ky&&!Ky.nodeType&&Ky,bV=rx&&rx.exports===xV,p5=bV&&vV.process,iV=function(){try{var e=rx&&rx.require&&rx.require("util").types;return e||p5&&p5.binding&&p5.binding("util")}catch(t){}}(),oV=iV&&iV.isTypedArray;function ufe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}o(ufe,"apply");function cfe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}o(cfe,"baseTimes");function pfe(e){return function(t){return e(t)}}o(pfe,"baseUnary");function ffe(e,t){return e==null?void 0:e[t]}o(ffe,"getValue");function dfe(e,t){return function(r){return e(t(r))}}o(dfe,"overArg");var hfe=Array.prototype,mfe=Function.prototype,q_=Object.prototype,f5=ix["__core-js_shared__"],Y_=mfe.toString,Lp=q_.hasOwnProperty,sV=function(){var e=/[^.]+$/.exec(f5&&f5.keys&&f5.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),IV=q_.toString,gfe=Y_.call(Object),yfe=RegExp("^"+Y_.call(Lp).replace(ofe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H_=bV?ix.Buffer:void 0,aV=ix.Symbol,lV=ix.Uint8Array,uV=H_?H_.allocUnsafe:void 0,SV=dfe(Object.getPrototypeOf,Object),cV=Object.create,vfe=q_.propertyIsEnumerable,xfe=hfe.splice,tm=aV?aV.toStringTag:void 0,W_=function(){try{var e=v5(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),bfe=H_?H_.isBuffer:void 0,pV=Math.max,Ife=Date.now,_V=v5(ix,"Map"),nx=v5(Object,"create"),Sfe=function(){function e(){}return o(e,"object"),function(t){if(!nm(t))return{};if(cV)return cV(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function rm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(rm,"Hash");function _fe(){this.__data__=nx?nx(null):{},this.size=0}o(_fe,"hashClear");function Cfe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}o(Cfe,"hashDelete");function wfe(e){var t=this.__data__;if(nx){var r=t[e];return r===dV?void 0:r}return Lp.call(t,e)?t[e]:void 0}o(wfe,"hashGet");function Pfe(e){var t=this.__data__;return nx?t[e]!==void 0:Lp.call(t,e)}o(Pfe,"hashHas");function Tfe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nx&&t===void 0?dV:t,this}o(Tfe,"hashSet");rm.prototype.clear=_fe;rm.prototype.delete=Cfe;rm.prototype.get=wfe;rm.prototype.has=Pfe;rm.prototype.set=Tfe;function Dp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(Dp,"ListCache");function Efe(){this.__data__=[],this.size=0}o(Efe,"listCacheClear");function Mfe(e){var t=this.__data__,r=X_(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():xfe.call(t,r,1),--this.size,!0}o(Mfe,"listCacheDelete");function Ofe(e){var t=this.__data__,r=X_(t,e);return r<0?void 0:t[r][1]}o(Ofe,"listCacheGet");function Lfe(e){return X_(this.__data__,e)>-1}o(Lfe,"listCacheHas");function Dfe(e,t){var r=this.__data__,n=X_(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}o(Dfe,"listCacheSet");Dp.prototype.clear=Efe;Dp.prototype.delete=Mfe;Dp.prototype.get=Ofe;Dp.prototype.has=Lfe;Dp.prototype.set=Dfe;function Jy(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(Jy,"MapCache");function Afe(){this.size=0,this.__data__={hash:new rm,map:new(_V||Dp),string:new rm}}o(Afe,"mapCacheClear");function Ffe(e){var t=K_(this,e).delete(e);return this.size-=t?1:0,t}o(Ffe,"mapCacheDelete");function Nfe(e){return K_(this,e).get(e)}o(Nfe,"mapCacheGet");function Rfe(e){return K_(this,e).has(e)}o(Rfe,"mapCacheHas");function kfe(e,t){var r=K_(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}o(kfe,"mapCacheSet");Jy.prototype.clear=Afe;Jy.prototype.delete=Ffe;Jy.prototype.get=Nfe;Jy.prototype.has=Rfe;Jy.prototype.set=kfe;function Qy(e){var t=this.__data__=new Dp(e);this.size=t.size}o(Qy,"Stack");function Bfe(){this.__data__=new Dp,this.size=0}o(Bfe,"stackClear");function Gfe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}o(Gfe,"stackDelete");function jfe(e){return this.__data__.get(e)}o(jfe,"stackGet");function Ufe(e){return this.__data__.has(e)}o(Ufe,"stackHas");function Vfe(e,t){var r=this.__data__;if(r instanceof Dp){var n=r.__data__;if(!_V||n.length<Ope-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Jy(n)}return r.set(e,t),this.size=r.size,this}o(Vfe,"stackSet");Qy.prototype.clear=Bfe;Qy.prototype.delete=Gfe;Qy.prototype.get=jfe;Qy.prototype.has=Ufe;Qy.prototype.set=Vfe;function zfe(e,t){var r=g5(e),n=!r&&m5(e),i=!r&&!n&&TV(e),a=!r&&!n&&!i&&MV(e),u=r||n||i||a,c=u?cfe(e.length,String):[],f=c.length;for(var m in e)(t||Lp.call(e,m))&&!(u&&(m=="length"||i&&(m=="offset"||m=="parent")||a&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||wV(m,f)))&&c.push(m);return c}o(zfe,"arrayLikeKeys");function d5(e,t,r){(r!==void 0&&!J_(e[t],r)||r===void 0&&!(t in e))&&y5(e,t,r)}o(d5,"assignMergeValue");function $fe(e,t,r){var n=e[t];(!(Lp.call(e,t)&&J_(n,r))||r===void 0&&!(t in e))&&y5(e,t,r)}o($fe,"assignValue");function X_(e,t){for(var r=e.length;r--;)if(J_(e[r][0],t))return r;return-1}o(X_,"assocIndexOf");function y5(e,t,r){t=="__proto__"&&W_?W_(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}o(y5,"baseAssignValue");var Hfe=ide();function Z_(e){return e==null?e===void 0?Wpe:Upe:tm&&tm in Object(e)?ode(e):pde(e)}o(Z_,"baseGetTag");function fV(e){return ox(e)&&Z_(e)==mV}o(fV,"baseIsArguments");function Wfe(e){if(!nm(e)||ude(e))return!1;var t=b5(e)?yfe:sfe;return t.test(mde(e))}o(Wfe,"baseIsNative");function qfe(e){return ox(e)&&EV(e.length)&&!!si[Z_(e)]}o(qfe,"baseIsTypedArray");function Yfe(e){if(!nm(e))return cde(e);var t=PV(e),r=[];for(var n in e)n=="constructor"&&(t||!Lp.call(e,n))||r.push(n);return r}o(Yfe,"baseKeysIn");function CV(e,t,r,n,i){e!==t&&Hfe(t,function(a,u){if(i||(i=new Qy),nm(a))Xfe(e,t,u,r,CV,n,i);else{var c=n?n(h5(e,u),a,u+"",e,t,i):void 0;c===void 0&&(c=a),d5(e,u,c)}},OV)}o(CV,"baseMerge");function Xfe(e,t,r,n,i,a,u){var c=h5(e,r),f=h5(t,r),m=u.get(f);if(m){d5(e,r,m);return}var v=a?a(c,f,r+"",e,t,u):void 0,x=v===void 0;if(x){var I=g5(f),C=!I&&TV(f),T=!I&&!C&&MV(f);v=f,I||C||T?g5(c)?v=c:gde(c)?v=tde(c):C?(x=!1,v=Jfe(f,!0)):T?(x=!1,v=ede(f,!0)):v=[]:yde(f)||m5(f)?(v=c,m5(c)?v=vde(c):(!nm(c)||b5(c))&&(v=sde(f))):x=!1}x&&(u.set(f,v),i(v,f,n,a,u),u.delete(f)),d5(e,r,v)}o(Xfe,"baseMergeDeep");function Zfe(e,t){return dde(fde(e,t,LV),e+"")}o(Zfe,"baseRest");var Kfe=W_?function(e,t){return W_(e,"toString",{configurable:!0,enumerable:!1,value:bde(t),writable:!0})}:LV;function Jfe(e,t){if(t)return e.slice();var r=e.length,n=uV?uV(r):new e.constructor(r);return e.copy(n),n}o(Jfe,"cloneBuffer");function Qfe(e){var t=new e.constructor(e.byteLength);return new lV(t).set(new lV(e)),t}o(Qfe,"cloneArrayBuffer");function ede(e,t){var r=t?Qfe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}o(ede,"cloneTypedArray");function tde(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}o(tde,"copyArray");function rde(e,t,r,n){var i=!r;r||(r={});for(var a=-1,u=t.length;++a<u;){var c=t[a],f=n?n(r[c],e[c],c,r,e):void 0;f===void 0&&(f=e[c]),i?y5(r,c,f):$fe(r,c,f)}return r}o(rde,"copyObject");function nde(e){return Zfe(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,u=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,u&&ade(r[0],r[1],u)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,a)}return t})}o(nde,"createAssigner");function ide(e){return function(t,r,n){for(var i=-1,a=Object(t),u=n(t),c=u.length;c--;){var f=u[e?c:++i];if(r(a[f],f,a)===!1)break}return t}}o(ide,"createBaseFor");function K_(e,t){var r=e.__data__;return lde(t)?r[typeof t=="string"?"string":"hash"]:r.map}o(K_,"getMapData");function v5(e,t){var r=ffe(e,t);return Wfe(r)?r:void 0}o(v5,"getNative");function ode(e){var t=Lp.call(e,tm),r=e[tm];try{e[tm]=void 0;var n=!0}catch(a){}var i=IV.call(e);return n&&(t?e[tm]=r:delete e[tm]),i}o(ode,"getRawTag");function sde(e){return typeof e.constructor=="function"&&!PV(e)?Sfe(SV(e)):{}}o(sde,"initCloneObject");function wV(e,t){var r=typeof e;return t=t==null?hV:t,!!t&&(r=="number"||r!="symbol"&&afe.test(e))&&e>-1&&e%1==0&&e<t}o(wV,"isIndex");function ade(e,t,r){if(!nm(r))return!1;var n=typeof t;return(n=="number"?x5(r)&&wV(t,r.length):n=="string"&&t in r)?J_(r[t],e):!1}o(ade,"isIterateeCall");function lde(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}o(lde,"isKeyable");function ude(e){return!!sV&&sV in e}o(ude,"isMasked");function PV(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||q_;return e===r}o(PV,"isPrototype");function cde(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}o(cde,"nativeKeysIn");function pde(e){return IV.call(e)}o(pde,"objectToString");function fde(e,t,r){return t=pV(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=pV(n.length-t,0),u=Array(a);++i<a;)u[i]=n[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=n[i];return c[t]=r(u),ufe(e,this,c)}}o(fde,"overRest");function h5(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}o(h5,"safeGet");var dde=hde(Kfe);function hde(e){var t=0,r=0;return function(){var n=Ife(),i=Dpe-(n-r);if(r=n,i>0){if(++t>=Lpe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}o(hde,"shortOut");function mde(e){if(e!=null){try{return Y_.call(e)}catch(t){}try{return e+""}catch(t){}}return""}o(mde,"toSource");function J_(e,t){return e===t||e!==e&&t!==t}o(J_,"eq");var m5=fV(function(){return arguments}())?fV:function(e){return ox(e)&&Lp.call(e,"callee")&&!vfe.call(e,"callee")},g5=Array.isArray;function x5(e){return e!=null&&EV(e.length)&&!b5(e)}o(x5,"isArrayLike");function gde(e){return ox(e)&&x5(e)}o(gde,"isArrayLikeObject");var TV=bfe||Ide;function b5(e){if(!nm(e))return!1;var t=Z_(e);return t==gV||t==Bpe||t==Fpe||t==Vpe}o(b5,"isFunction");function EV(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=hV}o(EV,"isLength");function nm(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}o(nm,"isObject");function ox(e){return e!=null&&typeof e=="object"}o(ox,"isObjectLike");function yde(e){if(!ox(e)||Z_(e)!=yV)return!1;var t=SV(e);if(t===null)return!0;var r=Lp.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Y_.call(r)==gfe}o(yde,"isPlainObject");var MV=oV?pfe(oV):qfe;function vde(e){return rde(e,OV(e))}o(vde,"toPlainObject");function OV(e){return x5(e)?zfe(e,!0):Yfe(e)}o(OV,"keysIn");var xde=nde(function(e,t,r){CV(e,t,r)});function bde(e){return function(){return e}}o(bde,"constant");function LV(e){return e}o(LV,"identity");function Ide(){return!1}o(Ide,"stubFalse");Ky.exports=xde});var N5=ze((ax,t0)=>{g();var wde=200,$V="__lodash_hash_undefined__",Pde=800,Tde=16,HV=9007199254740991,WV="[object Arguments]",Ede="[object Array]",Mde="[object AsyncFunction]",Ode="[object Boolean]",Lde="[object Date]",Dde="[object Error]",qV="[object Function]",Ade="[object GeneratorFunction]",Fde="[object Map]",Nde="[object Number]",Rde="[object Null]",YV="[object Object]",kde="[object Proxy]",Bde="[object RegExp]",Gde="[object Set]",jde="[object String]",Ude="[object Undefined]",Vde="[object WeakMap]",zde="[object ArrayBuffer]",$de="[object DataView]",Hde="[object Float32Array]",Wde="[object Float64Array]",qde="[object Int8Array]",Yde="[object Int16Array]",Xde="[object Int32Array]",Zde="[object Uint8Array]",Kde="[object Uint8ClampedArray]",Jde="[object Uint16Array]",Qde="[object Uint32Array]",ehe=/[\\^$.*+?()[\]{}|]/g,the=/^\[object .+?Constructor\]$/,rhe=/^(?:0|[1-9]\d*)$/,ai={};ai[Hde]=ai[Wde]=ai[qde]=ai[Yde]=ai[Xde]=ai[Zde]=ai[Kde]=ai[Jde]=ai[Qde]=!0;ai[WV]=ai[Ede]=ai[zde]=ai[Ode]=ai[$de]=ai[Lde]=ai[Dde]=ai[qV]=ai[Fde]=ai[Nde]=ai[YV]=ai[Bde]=ai[Gde]=ai[jde]=ai[Vde]=!1;var XV=typeof global=="object"&&global&&global.Object===Object&&global,nhe=typeof self=="object"&&self&&self.Object===Object&&self,cx=XV||nhe||Function("return this")(),ZV=typeof ax=="object"&&ax&&!ax.nodeType&&ax,lx=ZV&&typeof t0=="object"&&t0&&!t0.nodeType&&t0,KV=lx&&lx.exports===ZV,C5=KV&&XV.process,NV=function(){try{var e=lx&&lx.require&&lx.require("util").types;return e||C5&&C5.binding&&C5.binding("util")}catch(t){}}(),RV=NV&&NV.isTypedArray;function JV(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}o(JV,"apply");function ihe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}o(ihe,"baseTimes");function ohe(e){return function(t){return e(t)}}o(ohe,"baseUnary");function she(e,t){return e==null?void 0:e[t]}o(she,"getValue");function ahe(e,t){return function(r){return e(t(r))}}o(ahe,"overArg");var lhe=Array.prototype,uhe=Function.prototype,tC=Object.prototype,w5=cx["__core-js_shared__"],rC=uhe.toString,Fp=tC.hasOwnProperty,kV=function(){var e=/[^.]+$/.exec(w5&&w5.keys&&w5.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),QV=tC.toString,che=rC.call(Object),phe=RegExp("^"+rC.call(Fp).replace(ehe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Q_=KV?cx.Buffer:void 0,BV=cx.Symbol,GV=cx.Uint8Array,jV=Q_?Q_.allocUnsafe:void 0,ez=ahe(Object.getPrototypeOf,Object),UV=Object.create,fhe=tC.propertyIsEnumerable,dhe=lhe.splice,om=BV?BV.toStringTag:void 0,eC=function(){try{var e=D5(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),hhe=Q_?Q_.isBuffer:void 0,VV=Math.max,mhe=Date.now,tz=D5(cx,"Map"),ux=D5(Object,"create"),ghe=function(){function e(){}return o(e,"object"),function(t){if(!Ap(t))return{};if(UV)return UV(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function sm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(sm,"Hash");function yhe(){this.__data__=ux?ux(null):{},this.size=0}o(yhe,"hashClear");function vhe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}o(vhe,"hashDelete");function xhe(e){var t=this.__data__;if(ux){var r=t[e];return r===$V?void 0:r}return Fp.call(t,e)?t[e]:void 0}o(xhe,"hashGet");function bhe(e){var t=this.__data__;return ux?t[e]!==void 0:Fp.call(t,e)}o(bhe,"hashHas");function Ihe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ux&&t===void 0?$V:t,this}o(Ihe,"hashSet");sm.prototype.clear=yhe;sm.prototype.delete=vhe;sm.prototype.get=xhe;sm.prototype.has=bhe;sm.prototype.set=Ihe;function Np(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(Np,"ListCache");function She(){this.__data__=[],this.size=0}o(She,"listCacheClear");function _he(e){var t=this.__data__,r=nC(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():dhe.call(t,r,1),--this.size,!0}o(_he,"listCacheDelete");function Che(e){var t=this.__data__,r=nC(t,e);return r<0?void 0:t[r][1]}o(Che,"listCacheGet");function whe(e){return nC(this.__data__,e)>-1}o(whe,"listCacheHas");function Phe(e,t){var r=this.__data__,n=nC(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}o(Phe,"listCacheSet");Np.prototype.clear=She;Np.prototype.delete=_he;Np.prototype.get=Che;Np.prototype.has=whe;Np.prototype.set=Phe;function r0(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(r0,"MapCache");function The(){this.size=0,this.__data__={hash:new sm,map:new(tz||Np),string:new sm}}o(The,"mapCacheClear");function Ehe(e){var t=oC(this,e).delete(e);return this.size-=t?1:0,t}o(Ehe,"mapCacheDelete");function Mhe(e){return oC(this,e).get(e)}o(Mhe,"mapCacheGet");function Ohe(e){return oC(this,e).has(e)}o(Ohe,"mapCacheHas");function Lhe(e,t){var r=oC(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}o(Lhe,"mapCacheSet");r0.prototype.clear=The;r0.prototype.delete=Ehe;r0.prototype.get=Mhe;r0.prototype.has=Ohe;r0.prototype.set=Lhe;function n0(e){var t=this.__data__=new Np(e);this.size=t.size}o(n0,"Stack");function Dhe(){this.__data__=new Np,this.size=0}o(Dhe,"stackClear");function Ahe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}o(Ahe,"stackDelete");function Fhe(e){return this.__data__.get(e)}o(Fhe,"stackGet");function Nhe(e){return this.__data__.has(e)}o(Nhe,"stackHas");function Rhe(e,t){var r=this.__data__;if(r instanceof Np){var n=r.__data__;if(!tz||n.length<wde-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new r0(n)}return r.set(e,t),this.size=r.size,this}o(Rhe,"stackSet");n0.prototype.clear=Dhe;n0.prototype.delete=Ahe;n0.prototype.get=Fhe;n0.prototype.has=Nhe;n0.prototype.set=Rhe;function khe(e,t){var r=M5(e),n=!r&&E5(e),i=!r&&!n&&sz(e),a=!r&&!n&&!i&&lz(e),u=r||n||i||a,c=u?ihe(e.length,String):[],f=c.length;for(var m in e)(t||Fp.call(e,m))&&!(u&&(m=="length"||i&&(m=="offset"||m=="parent")||a&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||iz(m,f)))&&c.push(m);return c}o(khe,"arrayLikeKeys");function P5(e,t,r){(r!==void 0&&!sC(e[t],r)||r===void 0&&!(t in e))&&O5(e,t,r)}o(P5,"assignMergeValue");function Bhe(e,t,r){var n=e[t];(!(Fp.call(e,t)&&sC(n,r))||r===void 0&&!(t in e))&&O5(e,t,r)}o(Bhe,"assignValue");function nC(e,t){for(var r=e.length;r--;)if(sC(e[r][0],t))return r;return-1}o(nC,"assocIndexOf");function O5(e,t,r){t=="__proto__"&&eC?eC(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}o(O5,"baseAssignValue");var Ghe=Khe();function iC(e){return e==null?e===void 0?Ude:Rde:om&&om in Object(e)?Jhe(e):ime(e)}o(iC,"baseGetTag");function zV(e){return px(e)&&iC(e)==WV}o(zV,"baseIsArguments");function jhe(e){if(!Ap(e)||rme(e))return!1;var t=F5(e)?phe:the;return t.test(lme(e))}o(jhe,"baseIsNative");function Uhe(e){return px(e)&&az(e.length)&&!!ai[iC(e)]}o(Uhe,"baseIsTypedArray");function Vhe(e){if(!Ap(e))return nme(e);var t=oz(e),r=[];for(var n in e)n=="constructor"&&(t||!Fp.call(e,n))||r.push(n);return r}o(Vhe,"baseKeysIn");function L5(e,t,r,n,i){e!==t&&Ghe(t,function(a,u){if(i||(i=new n0),Ap(a))zhe(e,t,u,r,L5,n,i);else{var c=n?n(T5(e,u),a,u+"",e,t,i):void 0;c===void 0&&(c=a),P5(e,u,c)}},uz)}o(L5,"baseMerge");function zhe(e,t,r,n,i,a,u){var c=T5(e,r),f=T5(t,r),m=u.get(f);if(m){P5(e,r,m);return}var v=a?a(c,f,r+"",e,t,u):void 0,x=v===void 0;if(x){var I=M5(f),C=!I&&sz(f),T=!I&&!C&&lz(f);v=f,I||C||T?M5(c)?v=c:ume(c)?v=Yhe(c):C?(x=!1,v=Hhe(f,!0)):T?(x=!1,v=qhe(f,!0)):v=[]:cme(f)||E5(f)?(v=c,E5(c)?v=pme(c):(!Ap(c)||F5(c))&&(v=Qhe(f))):x=!1}x&&(u.set(f,v),i(v,f,n,a,u),u.delete(f)),P5(e,r,v)}o(zhe,"baseMergeDeep");function rz(e,t){return sme(ome(e,t,cz),e+"")}o(rz,"baseRest");var $he=eC?function(e,t){return eC(e,"toString",{configurable:!0,enumerable:!1,value:hme(t),writable:!0})}:cz;function Hhe(e,t){if(t)return e.slice();var r=e.length,n=jV?jV(r):new e.constructor(r);return e.copy(n),n}o(Hhe,"cloneBuffer");function Whe(e){var t=new e.constructor(e.byteLength);return new GV(t).set(new GV(e)),t}o(Whe,"cloneArrayBuffer");function qhe(e,t){var r=t?Whe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}o(qhe,"cloneTypedArray");function Yhe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}o(Yhe,"copyArray");function Xhe(e,t,r,n){var i=!r;r||(r={});for(var a=-1,u=t.length;++a<u;){var c=t[a],f=n?n(r[c],e[c],c,r,e):void 0;f===void 0&&(f=e[c]),i?O5(r,c,f):Bhe(r,c,f)}return r}o(Xhe,"copyObject");function Zhe(e){return rz(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,u=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,u&&eme(r[0],r[1],u)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,a)}return t})}o(Zhe,"createAssigner");function Khe(e){return function(t,r,n){for(var i=-1,a=Object(t),u=n(t),c=u.length;c--;){var f=u[e?c:++i];if(r(a[f],f,a)===!1)break}return t}}o(Khe,"createBaseFor");function nz(e,t,r,n,i,a){return Ap(e)&&Ap(t)&&(a.set(t,e),L5(e,t,void 0,nz,a),a.delete(t)),e}o(nz,"customDefaultsMerge");function oC(e,t){var r=e.__data__;return tme(t)?r[typeof t=="string"?"string":"hash"]:r.map}o(oC,"getMapData");function D5(e,t){var r=she(e,t);return jhe(r)?r:void 0}o(D5,"getNative");function Jhe(e){var t=Fp.call(e,om),r=e[om];try{e[om]=void 0;var n=!0}catch(a){}var i=QV.call(e);return n&&(t?e[om]=r:delete e[om]),i}o(Jhe,"getRawTag");function Qhe(e){return typeof e.constructor=="function"&&!oz(e)?ghe(ez(e)):{}}o(Qhe,"initCloneObject");function iz(e,t){var r=typeof e;return t=t==null?HV:t,!!t&&(r=="number"||r!="symbol"&&rhe.test(e))&&e>-1&&e%1==0&&e<t}o(iz,"isIndex");function eme(e,t,r){if(!Ap(r))return!1;var n=typeof t;return(n=="number"?A5(r)&&iz(t,r.length):n=="string"&&t in r)?sC(r[t],e):!1}o(eme,"isIterateeCall");function tme(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}o(tme,"isKeyable");function rme(e){return!!kV&&kV in e}o(rme,"isMasked");function oz(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||tC;return e===r}o(oz,"isPrototype");function nme(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}o(nme,"nativeKeysIn");function ime(e){return QV.call(e)}o(ime,"objectToString");function ome(e,t,r){return t=VV(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=VV(n.length-t,0),u=Array(a);++i<a;)u[i]=n[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=n[i];return c[t]=r(u),JV(e,this,c)}}o(ome,"overRest");function T5(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}o(T5,"safeGet");var sme=ame($he);function ame(e){var t=0,r=0;return function(){var n=mhe(),i=Tde-(n-r);if(r=n,i>0){if(++t>=Pde)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}o(ame,"shortOut");function lme(e){if(e!=null){try{return rC.call(e)}catch(t){}try{return e+""}catch(t){}}return""}o(lme,"toSource");function sC(e,t){return e===t||e!==e&&t!==t}o(sC,"eq");var E5=zV(function(){return arguments}())?zV:function(e){return px(e)&&Fp.call(e,"callee")&&!fhe.call(e,"callee")},M5=Array.isArray;function A5(e){return e!=null&&az(e.length)&&!F5(e)}o(A5,"isArrayLike");function ume(e){return px(e)&&A5(e)}o(ume,"isArrayLikeObject");var sz=hhe||mme;function F5(e){if(!Ap(e))return!1;var t=iC(e);return t==qV||t==Ade||t==Mde||t==kde}o(F5,"isFunction");function az(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=HV}o(az,"isLength");function Ap(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}o(Ap,"isObject");function px(e){return e!=null&&typeof e=="object"}o(px,"isObjectLike");function cme(e){if(!px(e)||iC(e)!=YV)return!1;var t=ez(e);if(t===null)return!0;var r=Fp.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&rC.call(r)==che}o(cme,"isPlainObject");var lz=RV?ohe(RV):Uhe;function pme(e){return Xhe(e,uz(e))}o(pme,"toPlainObject");var fme=rz(function(e){return e.push(void 0,nz),JV(dme,void 0,e)});function uz(e){return A5(e)?khe(e,!0):Vhe(e)}o(uz,"keysIn");var dme=Zhe(function(e,t,r,n){L5(e,t,r,n)});function hme(e){return function(){return e}}o(hme,"constant");function cz(e){return e}o(cz,"identity");function mme(){return!1}o(mme,"stubFalse");t0.exports=fme});var p$=ze((PPt,Sx)=>{"use strict";g();var oge=!1,cm=!1,i$=!0,o$=!1,w={},s$=!1;typeof Sx<"u"&&Sx.exports?(Sx.exports=w,s$=!0):typeof document<"u"?window.ClipperLib=w:self.ClipperLib=w;var CC;s$?(Io="chrome",CC="Netscape"):(Io=navigator.userAgent.toString().toLowerCase(),CC=navigator.appName);var Io,kr={};Io.indexOf("chrome")!=-1&&Io.indexOf("chromium")==-1?kr.chrome=1:kr.chrome=0;Io.indexOf("chromium")!=-1?kr.chromium=1:kr.chromium=0;Io.indexOf("safari")!=-1&&Io.indexOf("chrome")==-1&&Io.indexOf("chromium")==-1?kr.safari=1:kr.safari=0;Io.indexOf("firefox")!=-1?kr.firefox=1:kr.firefox=0;Io.indexOf("firefox/17")!=-1?kr.firefox17=1:kr.firefox17=0;Io.indexOf("firefox/15")!=-1?kr.firefox15=1:kr.firefox15=0;Io.indexOf("firefox/3")!=-1?kr.firefox3=1:kr.firefox3=0;Io.indexOf("opera")!=-1?kr.opera=1:kr.opera=0;Io.indexOf("msie 10")!=-1?kr.msie10=1:kr.msie10=0;Io.indexOf("msie 9")!=-1?kr.msie9=1:kr.msie9=0;Io.indexOf("msie 8")!=-1?kr.msie8=1:kr.msie8=0;Io.indexOf("msie 7")!=-1?kr.msie7=1:kr.msie7=0;Io.indexOf("msie ")!=-1?kr.msie=1:kr.msie=0;w.biginteger_used=null;var od,sge=0xdeadbeefcafe,r$=(sge&16777215)==15715070;function Be(e,t,r){w.biginteger_used=1,e!=null&&(typeof e=="number"&&typeof t>"u"?this.fromInt(e):typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}o(Be,"BigInteger");function Kr(){return new Be(null)}o(Kr,"nbi");function age(e,t,r,n,i,a){for(;--a>=0;){var u=t*this[e++]+r[n]+i;i=Math.floor(u/67108864),r[n++]=u&67108863}return i}o(age,"am1");function lge(e,t,r,n,i,a){for(var u=t&32767,c=t>>15;--a>=0;){var f=this[e]&32767,m=this[e++]>>15,v=c*f+m*u;f=u*f+((v&32767)<<15)+r[n]+(i&1073741823),i=(f>>>30)+(v>>>15)+c*m+(i>>>30),r[n++]=f&1073741823}return i}o(lge,"am2");function uge(e,t,r,n,i,a){for(var u=t&16383,c=t>>14;--a>=0;){var f=this[e]&16383,m=this[e++]>>14,v=c*f+m*u;f=u*f+((v&16383)<<14)+r[n]+i,i=(f>>28)+(v>>14)+c*m,r[n++]=f&268435455}return i}o(uge,"am3");r$&&CC=="Microsoft Internet Explorer"?(Be.prototype.am=lge,od=30):r$&&CC!="Netscape"?(Be.prototype.am=age,od=26):(Be.prototype.am=uge,od=28);Be.prototype.DB=od;Be.prototype.DM=(1<<od)-1;Be.prototype.DV=1<<od;var nO=52;Be.prototype.FV=Math.pow(2,nO);Be.prototype.F1=nO-od;Be.prototype.F2=2*od-nO;var cge="0123456789abcdefghijklmnopqrstuvwxyz",PC=new Array,a0,Ol;a0=48;for(Ol=0;Ol<=9;++Ol)PC[a0++]=Ol;a0=97;for(Ol=10;Ol<36;++Ol)PC[a0++]=Ol;a0=65;for(Ol=10;Ol<36;++Ol)PC[a0++]=Ol;function n$(e){return cge.charAt(e)}o(n$,"int2char");function a$(e,t){var r=PC[e.charCodeAt(t)];return r==null?-1:r}o(a$,"intAt");function pge(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}o(pge,"bnpCopyTo");function fge(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}o(fge,"bnpFromInt");function id(e){var t=Kr();return t.fromInt(e),t}o(id,"nbv");function dge(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var u=r==8?e[n]&255:a$(e,n);if(u<0){e.charAt(n)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=u:a+r>this.DB?(this[this.t-1]|=(u&(1<<this.DB-a)-1)<<a,this[this.t++]=u>>this.DB-a):this[this.t-1]|=u<<a,a+=r,a>=this.DB&&(a-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&Be.ZERO.subTo(this,this)}o(dge,"bnpFromString");function hge(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}o(hge,"bnpClamp");function mge(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,i=!1,a="",u=this.t,c=this.DB-u*this.DB%t;if(u-- >0)for(c<this.DB&&(n=this[u]>>c)>0&&(i=!0,a=n$(n));u>=0;)c<t?(n=(this[u]&(1<<c)-1)<<t-c,n|=this[--u]>>(c+=this.DB-t)):(n=this[u]>>(c-=t)&r,c<=0&&(c+=this.DB,--u)),n>0&&(i=!0),i&&(a+=n$(n));return i?a:"0"}o(mge,"bnToString");function gge(){var e=Kr();return Be.ZERO.subTo(this,e),e}o(gge,"bnNegate");function yge(){return this.s<0?this.negate():this}o(yge,"bnAbs");function vge(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-e[r])!=0)return t;return 0}o(vge,"bnCompareTo");function TC(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}o(TC,"nbits");function xge(){return this.t<=0?0:this.DB*(this.t-1)+TC(this[this.t-1]^this.s&this.DM)}o(xge,"bnBitLength");function bge(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}o(bge,"bnpDLShiftTo");function Ige(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}o(Ige,"bnpDRShiftTo");function Sge(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(e/this.DB),u=this.s<<r&this.DM,c;for(c=this.t-1;c>=0;--c)t[c+a+1]=this[c]>>n|u,u=(this[c]&i)<<r;for(c=a-1;c>=0;--c)t[c]=0;t[a]=u,t.t=this.t+a+1,t.s=this.s,t.clamp()}o(Sge,"bnpLShiftTo");function _ge(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t[0]=this[r]>>n;for(var u=r+1;u<this.t;++u)t[u-r-1]|=(this[u]&a)<<i,t[u-r]=this[u]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}o(_ge,"bnpRShiftTo");function Cge(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()}o(Cge,"bnpSubTo");function wge(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&Be.ZERO.subTo(t,t)}o(wge,"bnpMultiplyTo");function Pge(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}o(Pge,"bnpSquareTo");function Tge(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){t!=null&&t.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=Kr());var a=Kr(),u=this.s,c=e.s,f=this.DB-TC(n[n.t-1]);f>0?(n.lShiftTo(f,a),i.lShiftTo(f,r)):(n.copyTo(a),i.copyTo(r));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),I=this.FV/x,C=(1<<this.F1)/x,T=1<<this.F2,O=r.t,P=O-m,L=t==null?Kr():t;for(a.dlShiftTo(P,L),r.compareTo(L)>=0&&(r[r.t++]=1,r.subTo(L,r)),Be.ONE.dlShiftTo(m,L),L.subTo(a,a);a.t<m;)a[a.t++]=0;for(;--P>=0;){var A=r[--O]==v?this.DM:Math.floor(r[O]*I+(r[O-1]+T)*C);if((r[O]+=a.am(0,A,r,P,0,m))<A)for(a.dlShiftTo(P,L),r.subTo(L,r);r[O]<--A;)r.subTo(L,r)}t!=null&&(r.drShiftTo(m,t),u!=c&&Be.ZERO.subTo(t,t)),r.t=m,r.clamp(),f>0&&r.rShiftTo(f,r),u<0&&Be.ZERO.subTo(r,r)}}}o(Tge,"bnpDivRemTo");function Ege(e){var t=Kr();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Be.ZERO)>0&&e.subTo(t,t),t}o(Ege,"bnMod");function pm(e){this.m=e}o(pm,"Classic");function Mge(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}o(Mge,"cConvert");function Oge(e){return e}o(Oge,"cRevert");function Lge(e){e.divRemTo(this.m,null,e)}o(Lge,"cReduce");function Dge(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(Dge,"cMulTo");function Age(e,t){e.squareTo(t),this.reduce(t)}o(Age,"cSqrTo");pm.prototype.convert=Mge;pm.prototype.revert=Oge;pm.prototype.reduce=Lge;pm.prototype.mulTo=Dge;pm.prototype.sqrTo=Age;function Fge(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}o(Fge,"bnpInvDigit");function fm(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}o(fm,"Montgomery");function Nge(e){var t=Kr();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(Be.ZERO)>0&&this.m.subTo(t,t),t}o(Nge,"montConvert");function Rge(e){var t=Kr();return e.copyTo(t),this.reduce(t),t}o(Rge,"montRevert");function kge(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e[t]&32767,n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}o(kge,"montReduce");function Bge(e,t){e.squareTo(t),this.reduce(t)}o(Bge,"montSqrTo");function Gge(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(Gge,"montMulTo");fm.prototype.convert=Nge;fm.prototype.revert=Rge;fm.prototype.reduce=kge;fm.prototype.mulTo=Gge;fm.prototype.sqrTo=Bge;function jge(){return(this.t>0?this[0]&1:this.s)==0}o(jge,"bnpIsEven");function Uge(e,t){if(e>4294967295||e<1)return Be.ONE;var r=Kr(),n=Kr(),i=t.convert(this),a=TC(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)}o(Uge,"bnpExp");function Vge(e,t){var r;return e<256||t.isEven()?r=new pm(t):r=new fm(t),this.exp(e,r)}o(Vge,"bnModPowInt");Be.prototype.copyTo=pge;Be.prototype.fromInt=fge;Be.prototype.fromString=dge;Be.prototype.clamp=hge;Be.prototype.dlShiftTo=bge;Be.prototype.drShiftTo=Ige;Be.prototype.lShiftTo=Sge;Be.prototype.rShiftTo=_ge;Be.prototype.subTo=Cge;Be.prototype.multiplyTo=wge;Be.prototype.squareTo=Pge;Be.prototype.divRemTo=Tge;Be.prototype.invDigit=Fge;Be.prototype.isEven=jge;Be.prototype.exp=Uge;Be.prototype.toString=mge;Be.prototype.negate=gge;Be.prototype.abs=yge;Be.prototype.compareTo=vge;Be.prototype.bitLength=xge;Be.prototype.mod=Ege;Be.prototype.modPowInt=Vge;Be.ZERO=id(0);Be.ONE=id(1);function zge(){var e=Kr();return this.copyTo(e),e}o(zge,"bnClone");function $ge(){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]}o($ge,"bnIntValue");function Hge(){return this.t==0?this.s:this[0]<<24>>24}o(Hge,"bnByteValue");function Wge(){return this.t==0?this.s:this[0]<<16>>16}o(Wge,"bnShortValue");function qge(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}o(qge,"bnpChunkSize");function Yge(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}o(Yge,"bnSigNum");function Xge(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=id(r),i=Kr(),a=Kr(),u="";for(this.divRemTo(n,i,a);i.signum()>0;)u=(r+a.intValue()).toString(e).substr(1)+u,i.divRemTo(n,i,a);return a.intValue().toString(e)+u}o(Xge,"bnpToRadix");function Zge(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,u=0,c=0;c<e.length;++c){var f=a$(e,c);if(f<0){e.charAt(c)=="-"&&this.signum()==0&&(i=!0);continue}u=t*u+f,++a>=r&&(this.dMultiply(n),this.dAddOffset(u,0),a=0,u=0)}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(u,0)),i&&Be.ZERO.subTo(this,this)}o(Zge,"bnpFromRadix");function Kge(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(Be.ONE.shiftLeft(e-1),iO,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(Be.ONE.shiftLeft(e-1),this);else{var n=new Array,i=e&7;n.length=(e>>3)+1,t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}o(Kge,"bnpFromNumber");function Jge(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),(n&128)!=0&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}o(Jge,"bnToByteArray");function Qge(e){return this.compareTo(e)==0}o(Qge,"bnEquals");function eye(e){return this.compareTo(e)<0?this:e}o(eye,"bnMin");function tye(e){return this.compareTo(e)>0?this:e}o(tye,"bnMax");function rye(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}o(rye,"bnpBitwiseTo");function nye(e,t){return e&t}o(nye,"op_and");function iye(e){var t=Kr();return this.bitwiseTo(e,nye,t),t}o(iye,"bnAnd");function iO(e,t){return e|t}o(iO,"op_or");function oye(e){var t=Kr();return this.bitwiseTo(e,iO,t),t}o(oye,"bnOr");function l$(e,t){return e^t}o(l$,"op_xor");function sye(e){var t=Kr();return this.bitwiseTo(e,l$,t),t}o(sye,"bnXor");function u$(e,t){return e&~t}o(u$,"op_andnot");function aye(e){var t=Kr();return this.bitwiseTo(e,u$,t),t}o(aye,"bnAndNot");function lye(){for(var e=Kr(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}o(lye,"bnNot");function uye(e){var t=Kr();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}o(uye,"bnShiftLeft");function cye(e){var t=Kr();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}o(cye,"bnShiftRight");function pye(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}o(pye,"lbit");function fye(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+pye(this[e]);return this.s<0?this.t*this.DB:-1}o(fye,"bnGetLowestSetBit");function dye(e){for(var t=0;e!=0;)e&=e-1,++t;return t}o(dye,"cbit");function hye(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=dye(this[r]^t);return e}o(hye,"bnBitCount");function mye(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}o(mye,"bnTestBit");function gye(e,t){var r=Be.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}o(gye,"bnpChangeBit");function yye(e){return this.changeBit(e,iO)}o(yye,"bnSetBit");function vye(e){return this.changeBit(e,u$)}o(vye,"bnClearBit");function xye(e){return this.changeBit(e,l$)}o(xye,"bnFlipBit");function bye(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()}o(bye,"bnpAddTo");function Iye(e){var t=Kr();return this.addTo(e,t),t}o(Iye,"bnAdd");function Sye(e){var t=Kr();return this.subTo(e,t),t}o(Sye,"bnSubtract");function _ye(e){var t=Kr();return this.multiplyTo(e,t),t}o(_ye,"bnMultiply");function Cye(){var e=Kr();return this.squareTo(e),e}o(Cye,"bnSquare");function wye(e){var t=Kr();return this.divRemTo(e,t,null),t}o(wye,"bnDivide");function Pye(e){var t=Kr();return this.divRemTo(e,null,t),t}o(Pye,"bnRemainder");function Tye(e){var t=Kr(),r=Kr();return this.divRemTo(e,t,r),new Array(t,r)}o(Tye,"bnDivideAndRemainder");function Eye(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}o(Eye,"bnpDMultiply");function Mye(e,t){if(e!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}o(Mye,"bnpDAddOffset");function _x(){}o(_x,"NullExp");function c$(e){return e}o(c$,"nNop");function Oye(e,t,r){e.multiplyTo(t,r)}o(Oye,"nMulTo");function Lye(e,t){e.squareTo(t)}o(Lye,"nSqrTo");_x.prototype.convert=c$;_x.prototype.revert=c$;_x.prototype.mulTo=Oye;_x.prototype.sqrTo=Lye;function Dye(e){return this.exp(e,new _x)}o(Dye,"bnPow");function Aye(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()}o(Aye,"bnpMultiplyLowerTo");function Fye(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}o(Fye,"bnpMultiplyUpperTo");function l0(e){this.r2=Kr(),this.q3=Kr(),Be.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}o(l0,"Barrett");function Nye(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=Kr();return e.copyTo(t),this.reduce(t),t}o(Nye,"barrettConvert");function Rye(e){return e}o(Rye,"barrettRevert");function kye(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}o(kye,"barrettReduce");function Bye(e,t){e.squareTo(t),this.reduce(t)}o(Bye,"barrettSqrTo");function Gye(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(Gye,"barrettMulTo");l0.prototype.convert=Nye;l0.prototype.revert=Rye;l0.prototype.reduce=kye;l0.prototype.mulTo=Gye;l0.prototype.sqrTo=Bye;function jye(e,t){var r=e.bitLength(),n,i=id(1),a;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?a=new pm(t):t.isEven()?a=new l0(t):a=new fm(t);var u=new Array,c=3,f=n-1,m=(1<<n)-1;if(u[1]=a.convert(this),n>1){var v=Kr();for(a.sqrTo(u[1],v);c<=m;)u[c]=Kr(),a.mulTo(v,u[c-2],u[c]),c+=2}var x=e.t-1,I,C=!0,T=Kr(),O;for(r=TC(e[x])-1;x>=0;){for(r>=f?I=e[x]>>r-f&m:(I=(e[x]&(1<<r+1)-1)<<f-r,x>0&&(I|=e[x-1]>>this.DB+r-f)),c=n;(I&1)==0;)I>>=1,--c;if((r-=c)<0&&(r+=this.DB,--x),C)u[I].copyTo(i),C=!1;else{for(;c>1;)a.sqrTo(i,T),a.sqrTo(T,i),c-=2;c>0?a.sqrTo(i,T):(O=i,i=T,T=O),a.mulTo(T,u[I],i)}for(;x>=0&&(e[x]&1<<r)==0;)a.sqrTo(i,T),O=i,i=T,T=O,--r<0&&(r=this.DB-1,--x)}return a.revert(i)}o(jye,"bnModPow");function Uye(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r}o(Uye,"bnGCD");function Vye(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r}o(Vye,"bnpModInt");function zye(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return Be.ZERO;for(var r=e.clone(),n=this.clone(),i=id(1),a=id(0),u=id(0),c=id(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?((!u.isEven()||!c.isEven())&&(u.addTo(this,u),c.subTo(e,c)),u.rShiftTo(1,u)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(u,i),a.subTo(c,a)):(n.subTo(r,n),t&&u.subTo(i,u),c.subTo(a,c))}if(n.compareTo(Be.ONE)!=0)return Be.ZERO;if(c.compareTo(e)>=0)return c.subtract(e);if(c.signum()<0)c.addTo(e,c);else return c;return c.signum()<0?c.add(e):c}o(zye,"bnModInverse");var Qs=[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],$ye=(1<<26)/Qs[Qs.length-1];function Hye(e){var t,r=this.abs();if(r.t==1&&r[0]<=Qs[Qs.length-1]){for(t=0;t<Qs.length;++t)if(r[0]==Qs[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Qs.length;){for(var n=Qs[t],i=t+1;i<Qs.length&&n<$ye;)n*=Qs[i++];for(n=r.modInt(n);t<i;)if(n%Qs[t++]==0)return!1}return r.millerRabin(e)}o(Hye,"bnIsProbablePrime");function Wye(e){var t=this.subtract(Be.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>Qs.length&&(e=Qs.length);for(var i=Kr(),a=0;a<e;++a){i.fromInt(Qs[Math.floor(Math.random()*Qs.length)]);var u=i.modPow(n,this);if(u.compareTo(Be.ONE)!=0&&u.compareTo(t)!=0){for(var c=1;c++<r&&u.compareTo(t)!=0;)if(u=u.modPowInt(2,this),u.compareTo(Be.ONE)==0)return!1;if(u.compareTo(t)!=0)return!1}}return!0}o(Wye,"bnpMillerRabin");Be.prototype.chunkSize=qge;Be.prototype.toRadix=Xge;Be.prototype.fromRadix=Zge;Be.prototype.fromNumber=Kge;Be.prototype.bitwiseTo=rye;Be.prototype.changeBit=gye;Be.prototype.addTo=bye;Be.prototype.dMultiply=Eye;Be.prototype.dAddOffset=Mye;Be.prototype.multiplyLowerTo=Aye;Be.prototype.multiplyUpperTo=Fye;Be.prototype.modInt=Vye;Be.prototype.millerRabin=Wye;Be.prototype.clone=zge;Be.prototype.intValue=$ge;Be.prototype.byteValue=Hge;Be.prototype.shortValue=Wge;Be.prototype.signum=Yge;Be.prototype.toByteArray=Jge;Be.prototype.equals=Qge;Be.prototype.min=eye;Be.prototype.max=tye;Be.prototype.and=iye;Be.prototype.or=oye;Be.prototype.xor=sye;Be.prototype.andNot=aye;Be.prototype.not=lye;Be.prototype.shiftLeft=uye;Be.prototype.shiftRight=cye;Be.prototype.getLowestSetBit=fye;Be.prototype.bitCount=hye;Be.prototype.testBit=mye;Be.prototype.setBit=yye;Be.prototype.clearBit=vye;Be.prototype.flipBit=xye;Be.prototype.add=Iye;Be.prototype.subtract=Sye;Be.prototype.multiply=_ye;Be.prototype.divide=wye;Be.prototype.remainder=Pye;Be.prototype.divideAndRemainder=Tye;Be.prototype.modPow=jye;Be.prototype.modInverse=zye;Be.prototype.pow=Dye;Be.prototype.gcd=Uye;Be.prototype.isProbablePrime=Hye;Be.prototype.square=Cye;var Ir=Be;Ir.prototype.IsNegative=function(){return this.compareTo(Ir.ZERO)==-1};Ir.op_Equality=function(e,t){return e.compareTo(t)==0};Ir.op_Inequality=function(e,t){return e.compareTo(t)!=0};Ir.op_GreaterThan=function(e,t){return e.compareTo(t)>0};Ir.op_LessThan=function(e,t){return e.compareTo(t)<0};Ir.op_Addition=function(e,t){return new Ir(e).add(new Ir(t))};Ir.op_Subtraction=function(e,t){return new Ir(e).subtract(new Ir(t))};Ir.Int128Mul=function(e,t){return new Ir(e).multiply(new Ir(t))};Ir.op_Division=function(e,t){return e.divide(t)};Ir.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof wC>"u"&&(wC=o(function(e,t){var r;if(typeof Object.getOwnPropertyNames>"u"){for(r in t.prototype)(typeof e.prototype[r]>"u"||e.prototype[r]==Object.prototype[r])&&(e.prototype[r]=t.prototype[r]);for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}else{for(var n=Object.getOwnPropertyNames(t.prototype),i=0;i<n.length;i++)typeof Object.getOwnPropertyDescriptor(e.prototype,n[i])>"u"&&Object.defineProperty(e.prototype,n[i],Object.getOwnPropertyDescriptor(t.prototype,n[i]));for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}},"Inherit"));var wC;w.Path=function(){return[]};w.Paths=function(){return[]};w.DoublePoint=function(){var e=arguments;this.X=0,this.Y=0,e.length==1?(this.X=e[0].X,this.Y=e[0].Y):e.length==2&&(this.X=e[0],this.Y=e[1])};w.DoublePoint0=function(){this.X=0,this.Y=0};w.DoublePoint1=function(e){this.X=e.X,this.Y=e.Y};w.DoublePoint2=function(e,t){this.X=e,this.Y=t};w.PolyNode=function(){this.m_Parent=null,this.m_polygon=new w.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};w.PolyNode.prototype.IsHoleNode=function(){for(var e=!0,t=this.m_Parent;t!==null;)e=!e,t=t.m_Parent;return e};w.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};w.PolyNode.prototype.Contour=function(){return this.m_polygon};w.PolyNode.prototype.AddChild=function(e){var t=this.m_Childs.length;this.m_Childs.push(e),e.m_Parent=this,e.m_Index=t};w.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};w.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]};w.PolyNode.prototype.Childs=function(){return this.m_Childs};w.PolyNode.prototype.Parent=function(){return this.m_Parent};w.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};w.PolyTree=function(){this.m_AllPolys=[],w.PolyNode.call(this)};w.PolyTree.prototype.Clear=function(){for(var e=0,t=this.m_AllPolys.length;e<t;e++)this.m_AllPolys[e]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};w.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};w.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};wC(w.PolyTree,w.PolyNode);w.Math_Abs_Int64=w.Math_Abs_Int32=w.Math_Abs_Double=function(e){return Math.abs(e)};w.Math_Max_Int32_Int32=function(e,t){return Math.max(e,t)};kr.msie||kr.opera||kr.safari?w.Cast_Int32=function(e){return e|0}:w.Cast_Int32=function(e){return~~e};kr.chrome?w.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:kr.firefox&&typeof Number.toInteger=="function"?w.Cast_Int64=function(e){return Number.toInteger(e)}:kr.msie7||kr.msie8?w.Cast_Int64=function(e){return parseInt(e,10)}:kr.msie?w.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):e|0}:w.Cast_Int64=function(e){return e<0?Math.ceil(e):Math.floor(e)};w.Clear=function(e){e.length=0};w.PI=3.141592653589793;w.PI2=2*3.141592653589793;w.IntPoint=function(){var e=arguments,t=e.length;if(this.X=0,this.Y=0,cm)if(this.Z=0,t==3)this.X=e[0],this.Y=e[1],this.Z=e[2];else if(t==2)this.X=e[0],this.Y=e[1],this.Z=0;else if(t==1)if(e[0]instanceof w.DoublePoint){var r=e[0];this.X=w.Clipper.Round(r.X),this.Y=w.Clipper.Round(r.Y),this.Z=0}else{var n=e[0];typeof n.Z>"u"&&(n.Z=0),this.X=n.X,this.Y=n.Y,this.Z=n.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=e[0],this.Y=e[1];else if(t==1)if(e[0]instanceof w.DoublePoint){var r=e[0];this.X=w.Clipper.Round(r.X),this.Y=w.Clipper.Round(r.Y)}else{var n=e[0];this.X=n.X,this.Y=n.Y}else this.X=0,this.Y=0};w.IntPoint.op_Equality=function(e,t){return e.X==t.X&&e.Y==t.Y};w.IntPoint.op_Inequality=function(e,t){return e.X!=t.X||e.Y!=t.Y};cm?(w.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},w.IntPoint1=function(e){this.X=e.X,this.Y=e.Y,this.Z=e.Z},w.IntPoint1dp=function(e){this.X=w.Clipper.Round(e.X),this.Y=w.Clipper.Round(e.Y),this.Z=0},w.IntPoint2=function(e,t){this.X=e,this.Y=t,this.Z=0},w.IntPoint3=function(e,t,r){this.X=e,this.Y=t,this.Z=r}):(w.IntPoint0=function(){this.X=0,this.Y=0},w.IntPoint1=function(e){this.X=e.X,this.Y=e.Y},w.IntPoint1dp=function(e){this.X=w.Clipper.Round(e.X),this.Y=w.Clipper.Round(e.Y)},w.IntPoint2=function(e,t){this.X=e,this.Y=t});w.IntRect=function(){var e=arguments,t=e.length;t==4?(this.left=e[0],this.top=e[1],this.right=e[2],this.bottom=e[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};w.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};w.IntRect1=function(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom};w.IntRect4=function(e,t,r,n){this.left=e,this.top=t,this.right=r,this.bottom=n};w.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};w.PolyType={ptSubject:0,ptClip:1};w.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};w.JoinType={jtSquare:0,jtRound:1,jtMiter:2};w.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};o$&&(w.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});w.EdgeSide={esLeft:0,esRight:1};w.Direction={dRightToLeft:0,dLeftToRight:1};w.TEdge=function(){this.Bot=new w.IntPoint,this.Curr=new w.IntPoint,this.Top=new w.IntPoint,this.Delta=new w.IntPoint,this.Dx=0,this.PolyTyp=w.PolyType.ptSubject,this.Side=w.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};w.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new w.IntPoint};w.MyIntersectNodeSort=function(){};w.MyIntersectNodeSort.Compare=function(e,t){return t.Pt.Y-e.Pt.Y};w.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};w.Scanbeam=function(){this.Y=0,this.Next=null};w.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};w.OutPt=function(){this.Idx=0,this.Pt=new w.IntPoint,this.Next=null,this.Prev=null};w.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new w.IntPoint};w.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};w.ClipperBase.horizontal=-9007199254740992;w.ClipperBase.Skip=-2;w.ClipperBase.Unassigned=-1;w.ClipperBase.tolerance=1e-20;oge?(w.ClipperBase.loRange=46340,w.ClipperBase.hiRange=46340):(w.ClipperBase.loRange=47453132,w.ClipperBase.hiRange=0xfffffffffffff);w.ClipperBase.near_zero=function(e){return e>-w.ClipperBase.tolerance&&e<w.ClipperBase.tolerance};w.ClipperBase.IsHorizontal=function(e){return e.Delta.Y===0};w.ClipperBase.prototype.PointIsVertex=function(e,t){var r=t;do{if(w.IntPoint.op_Equality(r.Pt,e))return!0;r=r.Next}while(r!=t);return!1};w.ClipperBase.prototype.PointOnLineSegment=function(e,t,r,n){return n?e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&Ir.op_Equality(Ir.Int128Mul(e.X-t.X,r.Y-t.Y),Ir.Int128Mul(r.X-t.X,e.Y-t.Y)):e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&(e.X-t.X)*(r.Y-t.Y)==(r.X-t.X)*(e.Y-t.Y)};w.ClipperBase.prototype.PointOnPolygon=function(e,t,r){for(var n=t;;){if(this.PointOnLineSegment(e,n.Pt,n.Next.Pt,r))return!0;if(n=n.Next,n==t)break}return!1};w.ClipperBase.prototype.SlopesEqual=w.ClipperBase.SlopesEqual=function(){var e=arguments,t=e.length,r,n,i,a,u,c,f;return t==3?(r=e[0],n=e[1],f=e[2],f?Ir.op_Equality(Ir.Int128Mul(r.Delta.Y,n.Delta.X),Ir.Int128Mul(r.Delta.X,n.Delta.Y)):w.Cast_Int64(r.Delta.Y*n.Delta.X)==w.Cast_Int64(r.Delta.X*n.Delta.Y)):t==4?(i=e[0],a=e[1],u=e[2],f=e[3],f?Ir.op_Equality(Ir.Int128Mul(i.Y-a.Y,a.X-u.X),Ir.Int128Mul(i.X-a.X,a.Y-u.Y)):w.Cast_Int64((i.Y-a.Y)*(a.X-u.X))-w.Cast_Int64((i.X-a.X)*(a.Y-u.Y))===0):(i=e[0],a=e[1],u=e[2],c=e[3],f=e[4],f?Ir.op_Equality(Ir.Int128Mul(i.Y-a.Y,u.X-c.X),Ir.Int128Mul(i.X-a.X,u.Y-c.Y)):w.Cast_Int64((i.Y-a.Y)*(u.X-c.X))-w.Cast_Int64((i.X-a.X)*(u.Y-c.Y))===0)};w.ClipperBase.SlopesEqual3=function(e,t,r){return r?Ir.op_Equality(Ir.Int128Mul(e.Delta.Y,t.Delta.X),Ir.Int128Mul(e.Delta.X,t.Delta.Y)):w.Cast_Int64(e.Delta.Y*t.Delta.X)==w.Cast_Int64(e.Delta.X*t.Delta.Y)};w.ClipperBase.SlopesEqual4=function(e,t,r,n){return n?Ir.op_Equality(Ir.Int128Mul(e.Y-t.Y,t.X-r.X),Ir.Int128Mul(e.X-t.X,t.Y-r.Y)):w.Cast_Int64((e.Y-t.Y)*(t.X-r.X))-w.Cast_Int64((e.X-t.X)*(t.Y-r.Y))===0};w.ClipperBase.SlopesEqual5=function(e,t,r,n,i){return i?Ir.op_Equality(Ir.Int128Mul(e.Y-t.Y,r.X-n.X),Ir.Int128Mul(e.X-t.X,r.Y-n.Y)):w.Cast_Int64((e.Y-t.Y)*(r.X-n.X))-w.Cast_Int64((e.X-t.X)*(r.Y-n.Y))===0};w.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var e=0,t=this.m_edges.length;e<t;++e){for(var r=0,n=this.m_edges[e].length;r<n;++r)this.m_edges[e][r]=null;w.Clear(this.m_edges[e])}w.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};w.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var e=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=e}this.m_CurrentLM=null};w.ClipperBase.prototype.RangeTest=function(e,t){t.Value?(e.X>w.ClipperBase.hiRange||e.Y>w.ClipperBase.hiRange||-e.X>w.ClipperBase.hiRange||-e.Y>w.ClipperBase.hiRange)&&w.Error("Coordinate outside allowed range in RangeTest()."):(e.X>w.ClipperBase.loRange||e.Y>w.ClipperBase.loRange||-e.X>w.ClipperBase.loRange||-e.Y>w.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(e,t))};w.ClipperBase.prototype.InitEdge=function(e,t,r,n){e.Next=t,e.Prev=r,e.Curr.X=n.X,e.Curr.Y=n.Y,e.OutIdx=-1};w.ClipperBase.prototype.InitEdge2=function(e,t){e.Curr.Y>=e.Next.Curr.Y?(e.Bot.X=e.Curr.X,e.Bot.Y=e.Curr.Y,e.Top.X=e.Next.Curr.X,e.Top.Y=e.Next.Curr.Y):(e.Top.X=e.Curr.X,e.Top.Y=e.Curr.Y,e.Bot.X=e.Next.Curr.X,e.Bot.Y=e.Next.Curr.Y),this.SetDx(e),e.PolyTyp=t};w.ClipperBase.prototype.FindNextLocMin=function(e){for(var t;;){for(;w.IntPoint.op_Inequality(e.Bot,e.Prev.Bot)||w.IntPoint.op_Equality(e.Curr,e.Top);)e=e.Next;if(e.Dx!=w.ClipperBase.horizontal&&e.Prev.Dx!=w.ClipperBase.horizontal)break;for(;e.Prev.Dx==w.ClipperBase.horizontal;)e=e.Prev;for(t=e;e.Dx==w.ClipperBase.horizontal;)e=e.Next;if(e.Top.Y!=e.Prev.Bot.Y){t.Prev.Bot.X<e.Bot.X&&(e=t);break}}return e};w.ClipperBase.prototype.ProcessBound=function(e,t){var r=e,n=e,i,a;if(e.Dx==w.ClipperBase.horizontal&&(t?a=e.Prev.Bot.X:a=e.Next.Bot.X,e.Bot.X!=a&&this.ReverseHorizontal(e)),n.OutIdx!=w.ClipperBase.Skip)if(t){for(;n.Top.Y==n.Next.Bot.Y&&n.Next.OutIdx!=w.ClipperBase.Skip;)n=n.Next;if(n.Dx==w.ClipperBase.horizontal&&n.Next.OutIdx!=w.ClipperBase.Skip){for(i=n;i.Prev.Dx==w.ClipperBase.horizontal;)i=i.Prev;i.Prev.Top.X==n.Next.Top.X?t||(n=i.Prev):i.Prev.Top.X>n.Next.Top.X&&(n=i.Prev)}for(;e!=n;)e.NextInLML=e.Next,e.Dx==w.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),e=e.Next;e.Dx==w.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),n=n.Next}else{for(;n.Top.Y==n.Prev.Bot.Y&&n.Prev.OutIdx!=w.ClipperBase.Skip;)n=n.Prev;if(n.Dx==w.ClipperBase.horizontal&&n.Prev.OutIdx!=w.ClipperBase.Skip){for(i=n;i.Next.Dx==w.ClipperBase.horizontal;)i=i.Next;i.Next.Top.X==n.Prev.Top.X?t||(n=i.Next):i.Next.Top.X>n.Prev.Top.X&&(n=i.Next)}for(;e!=n;)e.NextInLML=e.Prev,e.Dx==w.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),e=e.Prev;e.Dx==w.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),n=n.Prev}if(n.OutIdx==w.ClipperBase.Skip){if(e=n,t){for(;e.Top.Y==e.Next.Bot.Y;)e=e.Next;for(;e!=n&&e.Dx==w.ClipperBase.horizontal;)e=e.Prev}else{for(;e.Top.Y==e.Prev.Bot.Y;)e=e.Prev;for(;e!=n&&e.Dx==w.ClipperBase.horizontal;)e=e.Next}if(e==n)t?n=e.Next:n=e.Prev;else{t?e=n.Next:e=n.Prev;var u=new w.LocalMinima;u.Next=null,u.Y=e.Bot.Y,u.LeftBound=null,u.RightBound=e,u.RightBound.WindDelta=0,n=this.ProcessBound(u.RightBound,t),this.InsertLocalMinima(u)}}return n};w.ClipperBase.prototype.AddPath=function(e,t,r){i$?!r&&t==w.PolyType.ptClip&&w.Error("AddPath: Open paths must be subject."):r||w.Error("AddPath: Open paths have been disabled.");var n=e.length-1;if(r)for(;n>0&&w.IntPoint.op_Equality(e[n],e[0]);)--n;for(;n>0&&w.IntPoint.op_Equality(e[n],e[n-1]);)--n;if(r&&n<2||!r&&n<1)return!1;for(var i=new Array,a=0;a<=n;a++)i.push(new w.TEdge);var u=!0;i[1].Curr.X=e[1].X,i[1].Curr.Y=e[1].Y;var c={Value:this.m_UseFullRange};this.RangeTest(e[0],c),this.m_UseFullRange=c.Value,c.Value=this.m_UseFullRange,this.RangeTest(e[n],c),this.m_UseFullRange=c.Value,this.InitEdge(i[0],i[1],i[n],e[0]),this.InitEdge(i[n],i[0],i[n-1],e[n]);for(var a=n-1;a>=1;--a)c.Value=this.m_UseFullRange,this.RangeTest(e[a],c),this.m_UseFullRange=c.Value,this.InitEdge(i[a],i[a+1],i[a-1],e[a]);for(var f=i[0],m=f,v=f;;){if(w.IntPoint.op_Equality(m.Curr,m.Next.Curr)){if(m==m.Next)break;m==f&&(f=m.Next),m=this.RemoveEdge(m),v=m;continue}if(m.Prev==m.Next)break;if(r&&w.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==f&&(f=m.Next),m=this.RemoveEdge(m),m=m.Prev,v=m;continue}if(m=m.Next,m==v)break}if(!r&&m==m.Next||r&&m.Prev==m.Next)return!1;r||(this.m_HasOpenPaths=!0,f.Prev.OutIdx=w.ClipperBase.Skip);var x=f;m=f;do this.InitEdge2(m,t),m=m.Next,u&&m.Curr.Y!=f.Curr.Y&&(u=!1);while(m!=f);if(u){if(r)return!1;m.Prev.OutIdx=w.ClipperBase.Skip,m.Prev.Bot.X<m.Prev.Top.X&&this.ReverseHorizontal(m.Prev);var I=new w.LocalMinima;for(I.Next=null,I.Y=m.Bot.Y,I.LeftBound=null,I.RightBound=m,I.RightBound.Side=w.EdgeSide.esRight,I.RightBound.WindDelta=0;m.Next.OutIdx!=w.ClipperBase.Skip;)m.NextInLML=m.Next,m.Bot.X!=m.Prev.Top.X&&this.ReverseHorizontal(m),m=m.Next;return this.InsertLocalMinima(I),this.m_edges.push(i),!0}this.m_edges.push(i);for(var C,T=null;m=this.FindNextLocMin(m),m!=T;){T==null&&(T=m);var I=new w.LocalMinima;I.Next=null,I.Y=m.Bot.Y,m.Dx<m.Prev.Dx?(I.LeftBound=m.Prev,I.RightBound=m,C=!1):(I.LeftBound=m,I.RightBound=m.Prev,C=!0),I.LeftBound.Side=w.EdgeSide.esLeft,I.RightBound.Side=w.EdgeSide.esRight,r?I.LeftBound.Next==I.RightBound?I.LeftBound.WindDelta=-1:I.LeftBound.WindDelta=1:I.LeftBound.WindDelta=0,I.RightBound.WindDelta=-I.LeftBound.WindDelta,m=this.ProcessBound(I.LeftBound,C);var O=this.ProcessBound(I.RightBound,!C);I.LeftBound.OutIdx==w.ClipperBase.Skip?I.LeftBound=null:I.RightBound.OutIdx==w.ClipperBase.Skip&&(I.RightBound=null),this.InsertLocalMinima(I),C||(m=O)}return!0};w.ClipperBase.prototype.AddPaths=function(e,t,r){for(var n=!1,i=0,a=e.length;i<a;++i)this.AddPath(e[i],t,r)&&(n=!0);return n};w.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(e,t,r){return w.IntPoint.op_Equality(e,r)||w.IntPoint.op_Equality(e,t)||w.IntPoint.op_Equality(r,t)?!1:e.X!=r.X?t.X>e.X==t.X<r.X:t.Y>e.Y==t.Y<r.Y};w.ClipperBase.prototype.RemoveEdge=function(e){e.Prev.Next=e.Next,e.Next.Prev=e.Prev;var t=e.Next;return e.Prev=null,t};w.ClipperBase.prototype.SetDx=function(e){e.Delta.X=e.Top.X-e.Bot.X,e.Delta.Y=e.Top.Y-e.Bot.Y,e.Delta.Y===0?e.Dx=w.ClipperBase.horizontal:e.Dx=e.Delta.X/e.Delta.Y};w.ClipperBase.prototype.InsertLocalMinima=function(e){if(this.m_MinimaList===null)this.m_MinimaList=e;else if(e.Y>=this.m_MinimaList.Y)e.Next=this.m_MinimaList,this.m_MinimaList=e;else{for(var t=this.m_MinimaList;t.Next!==null&&e.Y<t.Next.Y;)t=t.Next;e.Next=t.Next,t.Next=e}};w.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};w.ClipperBase.prototype.ReverseHorizontal=function(e){var t=e.Top.X;e.Top.X=e.Bot.X,e.Bot.X=t,cm&&(t=e.Top.Z,e.Top.Z=e.Bot.Z,e.Bot.Z=t)};w.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var e=this.m_MinimaList;e!=null;){var t=e.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=w.EdgeSide.esLeft,t.OutIdx=w.ClipperBase.Unassigned),t=e.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=w.EdgeSide.esRight,t.OutIdx=w.ClipperBase.Unassigned),e=e.Next}};w.Clipper=function(e){typeof e>"u"&&(e=0),this.m_PolyOuts=null,this.m_ClipType=w.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=w.PolyFillType.pftEvenOdd,this.m_SubjFillType=w.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,w.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=w.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&e)!==0,this.StrictlySimple=(2&e)!==0,this.PreserveCollinear=(4&e)!==0,cm&&(this.ZFillFunction=null)};w.Clipper.ioReverseSolution=1;w.Clipper.ioStrictlySimple=2;w.Clipper.ioPreserveCollinear=4;w.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),w.ClipperBase.prototype.Clear.call(this))};w.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var e=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=e}};w.Clipper.prototype.Reset=function(){w.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var e=this.m_MinimaList;e!==null;)this.InsertScanbeam(e.Y),e=e.Next};w.Clipper.prototype.InsertScanbeam=function(e){if(this.m_Scanbeam===null)this.m_Scanbeam=new w.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=e;else if(e>this.m_Scanbeam.Y){var t=new w.Scanbeam;t.Y=e,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var r=this.m_Scanbeam;r.Next!==null&&e<=r.Next.Y;)r=r.Next;if(e==r.Y)return;var t=new w.Scanbeam;t.Y=e,t.Next=r.Next,r.Next=t}};w.Clipper.prototype.Execute=function(){var e=arguments,t=e.length,r=e[1]instanceof w.PolyTree;if(t==4&&!r){var n=e[0],i=e[1],a=e[2],u=e[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&w.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,w.Clear(i),this.m_SubjFillType=a,this.m_ClipFillType=u,this.m_ClipType=n,this.m_UsingPolyTree=!1;try{var c=this.ExecuteInternal();c&&this.BuildResult(i)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==4&&r){var n=e[0],f=e[1],a=e[2],u=e[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=a,this.m_ClipFillType=u,this.m_ClipType=n,this.m_UsingPolyTree=!0;try{var c=this.ExecuteInternal();c&&this.BuildResult2(f)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==2&&!r){var n=e[0],i=e[1];return this.Execute(n,i,w.PolyFillType.pftEvenOdd,w.PolyFillType.pftEvenOdd)}else if(t==2&&r){var n=e[0],f=e[1];return this.Execute(n,f,w.PolyFillType.pftEvenOdd,w.PolyFillType.pftEvenOdd)}};w.Clipper.prototype.FixHoleLinkage=function(e){if(!(e.FirstLeft===null||e.IsHole!=e.FirstLeft.IsHole&&e.FirstLeft.Pts!==null)){for(var t=e.FirstLeft;t!==null&&(t.IsHole==e.IsHole||t.Pts===null);)t=t.FirstLeft;e.FirstLeft=t}};w.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var e=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(e),w.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(e,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),e=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts===null||i.IsOpen||(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)}this.JoinCommonEdges();for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts!==null&&!i.IsOpen&&this.FixupOutPolygon(i)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{w.Clear(this.m_Joins),w.Clear(this.m_GhostJoins)}};w.Clipper.prototype.PopScanbeam=function(){var e=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,e};w.Clipper.prototype.DisposeAllPolyPts=function(){for(var e=0,t=this.m_PolyOuts.length;e<t;++e)this.DisposeOutRec(e);w.Clear(this.m_PolyOuts)};w.Clipper.prototype.DisposeOutRec=function(e){var t=this.m_PolyOuts[e];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[e]=null};w.Clipper.prototype.DisposeOutPts=function(e){if(e!==null){var t=null;for(e.Prev.Next=null;e!==null;)t=e,e=e.Next,t=null}};w.Clipper.prototype.AddJoin=function(e,t,r){var n=new w.Join;n.OutPt1=e,n.OutPt2=t,n.OffPt.X=r.X,n.OffPt.Y=r.Y,this.m_Joins.push(n)};w.Clipper.prototype.AddGhostJoin=function(e,t){var r=new w.Join;r.OutPt1=e,r.OffPt.X=t.X,r.OffPt.Y=t.Y,this.m_GhostJoins.push(r)};cm&&(w.Clipper.prototype.SetZ=function(e,t){e.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,e):this.ZFillFunction(t.Top,t.Bot,e))});w.Clipper.prototype.InsertLocalMinimaIntoAEL=function(e){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==e;){var t=this.m_CurrentLM.LeftBound,r=this.m_CurrentLM.RightBound;this.PopLocalMinima();var n=null;if(t===null?(this.InsertEdgeIntoAEL(r,null),this.SetWindingCount(r),this.IsContributing(r)&&(n=this.AddOutPt(r,r.Bot))):r==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(n=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(r,t),this.SetWindingCount(t),r.WindCnt=t.WindCnt,r.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(n=this.AddLocalMinPoly(t,r,t.Bot)),this.InsertScanbeam(t.Top.Y)),r!=null&&(w.ClipperBase.IsHorizontal(r)?this.AddEdgeToSEL(r):this.InsertScanbeam(r.Top.Y)),!(t==null||r==null)){if(n!==null&&w.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var i=0,a=this.m_GhostJoins.length;i<a;i++){var u=this.m_GhostJoins[i];this.HorzSegmentsOverlap(u.OutPt1.Pt,u.OffPt,r.Bot,r.Top)&&this.AddJoin(u.OutPt1,n,u.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&w.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(n,c,t.Top)}if(t.NextInAEL!=r){if(r.OutIdx>=0&&r.PrevInAEL.OutIdx>=0&&w.ClipperBase.SlopesEqual(r.PrevInAEL,r,this.m_UseFullRange)&&r.WindDelta!==0&&r.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(n,c,r.Top)}var f=t.NextInAEL;if(f!==null)for(;f!=r;)this.IntersectEdges(r,f,t.Curr,!1),f=f.NextInAEL}}}};w.Clipper.prototype.InsertEdgeIntoAEL=function(e,t){if(this.m_ActiveEdges===null)e.PrevInAEL=null,e.NextInAEL=null,this.m_ActiveEdges=e;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,e))e.PrevInAEL=null,e.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=e,this.m_ActiveEdges=e;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,e);)t=t.NextInAEL;e.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=e),e.PrevInAEL=t,t.NextInAEL=e}};w.Clipper.prototype.E2InsertsBeforeE1=function(e,t){return t.Curr.X==e.Curr.X?t.Top.Y>e.Top.Y?t.Top.X<w.Clipper.TopX(e,t.Top.Y):e.Top.X>w.Clipper.TopX(t,e.Top.Y):t.Curr.X<e.Curr.X};w.Clipper.prototype.IsEvenOddFillType=function(e){return e.PolyTyp==w.PolyType.ptSubject?this.m_SubjFillType==w.PolyFillType.pftEvenOdd:this.m_ClipFillType==w.PolyFillType.pftEvenOdd};w.Clipper.prototype.IsEvenOddAltFillType=function(e){return e.PolyTyp==w.PolyType.ptSubject?this.m_ClipFillType==w.PolyFillType.pftEvenOdd:this.m_SubjFillType==w.PolyFillType.pftEvenOdd};w.Clipper.prototype.IsContributing=function(e){var t,r;switch(e.PolyTyp==w.PolyType.ptSubject?(t=this.m_SubjFillType,r=this.m_ClipFillType):(t=this.m_ClipFillType,r=this.m_SubjFillType),t){case w.PolyFillType.pftEvenOdd:if(e.WindDelta===0&&e.WindCnt!=1)return!1;break;case w.PolyFillType.pftNonZero:if(Math.abs(e.WindCnt)!=1)return!1;break;case w.PolyFillType.pftPositive:if(e.WindCnt!=1)return!1;break;default:if(e.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case w.ClipType.ctIntersection:switch(r){case w.PolyFillType.pftEvenOdd:case w.PolyFillType.pftNonZero:return e.WindCnt2!==0;case w.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case w.ClipType.ctUnion:switch(r){case w.PolyFillType.pftEvenOdd:case w.PolyFillType.pftNonZero:return e.WindCnt2===0;case w.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}case w.ClipType.ctDifference:if(e.PolyTyp==w.PolyType.ptSubject)switch(r){case w.PolyFillType.pftEvenOdd:case w.PolyFillType.pftNonZero:return e.WindCnt2===0;case w.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else switch(r){case w.PolyFillType.pftEvenOdd:case w.PolyFillType.pftNonZero:return e.WindCnt2!==0;case w.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case w.ClipType.ctXor:if(e.WindDelta===0)switch(r){case w.PolyFillType.pftEvenOdd:case w.PolyFillType.pftNonZero:return e.WindCnt2===0;case w.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else return!0}return!0};w.Clipper.prototype.SetWindingCount=function(e){for(var t=e.PrevInAEL;t!==null&&(t.PolyTyp!=e.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)e.WindCnt=e.WindDelta===0?1:e.WindDelta,e.WindCnt2=0,t=this.m_ActiveEdges;else if(e.WindDelta===0&&this.m_ClipType!=w.ClipType.ctUnion)e.WindCnt=1,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(e)){if(e.WindDelta===0){for(var r=!0,n=t.PrevInAEL;n!==null;)n.PolyTyp==t.PolyTyp&&n.WindDelta!==0&&(r=!r),n=n.PrevInAEL;e.WindCnt=r?0:1}else e.WindCnt=e.WindDelta;e.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta:e.WindCnt=e.WindDelta===0?1:e.WindDelta:e.WindDelta===0?e.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(e))for(;t!=e;)t.WindDelta!==0&&(e.WindCnt2=e.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=e;)e.WindCnt2+=t.WindDelta,t=t.NextInAEL};w.Clipper.prototype.AddEdgeToSEL=function(e){this.m_SortedEdges===null?(this.m_SortedEdges=e,e.PrevInSEL=null,e.NextInSEL=null):(e.NextInSEL=this.m_SortedEdges,e.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=e,this.m_SortedEdges=e)};w.Clipper.prototype.CopyAELToSEL=function(){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e=e.NextInAEL};w.Clipper.prototype.SwapPositionsInAEL=function(e,t){if(!(e.NextInAEL==e.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(e.NextInAEL==t){var r=t.NextInAEL;r!==null&&(r.PrevInAEL=e);var n=e.PrevInAEL;n!==null&&(n.NextInAEL=t),t.PrevInAEL=n,t.NextInAEL=e,e.PrevInAEL=t,e.NextInAEL=r}else if(t.NextInAEL==e){var r=e.NextInAEL;r!==null&&(r.PrevInAEL=t);var n=t.PrevInAEL;n!==null&&(n.NextInAEL=e),e.PrevInAEL=n,e.NextInAEL=t,t.PrevInAEL=e,t.NextInAEL=r}else{var r=e.NextInAEL,n=e.PrevInAEL;e.NextInAEL=t.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=t.PrevInAEL,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e),t.NextInAEL=r,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=n,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}e.PrevInAEL===null?this.m_ActiveEdges=e:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};w.Clipper.prototype.SwapPositionsInSEL=function(e,t){if(!(e.NextInSEL===null&&e.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(e.NextInSEL==t){var r=t.NextInSEL;r!==null&&(r.PrevInSEL=e);var n=e.PrevInSEL;n!==null&&(n.NextInSEL=t),t.PrevInSEL=n,t.NextInSEL=e,e.PrevInSEL=t,e.NextInSEL=r}else if(t.NextInSEL==e){var r=e.NextInSEL;r!==null&&(r.PrevInSEL=t);var n=t.PrevInSEL;n!==null&&(n.NextInSEL=e),e.PrevInSEL=n,e.NextInSEL=t,t.PrevInSEL=e,t.NextInSEL=r}else{var r=e.NextInSEL,n=e.PrevInSEL;e.NextInSEL=t.NextInSEL,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=t.PrevInSEL,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e),t.NextInSEL=r,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=n,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}e.PrevInSEL===null?this.m_SortedEdges=e:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};w.Clipper.prototype.AddLocalMaxPoly=function(e,t,r){this.AddOutPt(e,r),t.WindDelta==0&&this.AddOutPt(t,r),e.OutIdx==t.OutIdx?(e.OutIdx=-1,t.OutIdx=-1):e.OutIdx<t.OutIdx?this.AppendPolygon(e,t):this.AppendPolygon(t,e)};w.Clipper.prototype.AddLocalMinPoly=function(e,t,r){var n,i,a;if(w.ClipperBase.IsHorizontal(t)||e.Dx>t.Dx?(n=this.AddOutPt(e,r),t.OutIdx=e.OutIdx,e.Side=w.EdgeSide.esLeft,t.Side=w.EdgeSide.esRight,i=e,i.PrevInAEL==t?a=t.PrevInAEL:a=i.PrevInAEL):(n=this.AddOutPt(t,r),e.OutIdx=t.OutIdx,e.Side=w.EdgeSide.esRight,t.Side=w.EdgeSide.esLeft,i=t,i.PrevInAEL==e?a=e.PrevInAEL:a=i.PrevInAEL),a!==null&&a.OutIdx>=0&&w.Clipper.TopX(a,r.Y)==w.Clipper.TopX(i,r.Y)&&w.ClipperBase.SlopesEqual(i,a,this.m_UseFullRange)&&i.WindDelta!==0&&a.WindDelta!==0){var u=this.AddOutPt(a,r);this.AddJoin(n,u,i.Top)}return n};w.Clipper.prototype.CreateOutRec=function(){var e=new w.OutRec;return e.Idx=-1,e.IsHole=!1,e.IsOpen=!1,e.FirstLeft=null,e.Pts=null,e.BottomPt=null,e.PolyNode=null,this.m_PolyOuts.push(e),e.Idx=this.m_PolyOuts.length-1,e};w.Clipper.prototype.AddOutPt=function(e,t){var r=e.Side==w.EdgeSide.esLeft;if(e.OutIdx<0){var n=this.CreateOutRec();n.IsOpen=e.WindDelta===0;var i=new w.OutPt;return n.Pts=i,i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=i,i.Prev=i,n.IsOpen||this.SetHoleState(e,n),cm&&(w.IntPoint.op_Equality(t,e.Bot)?(i.Pt.X=e.Bot.X,i.Pt.Y=e.Bot.Y,i.Pt.Z=e.Bot.Z):w.IntPoint.op_Equality(t,e.Top)?(i.Pt.X=e.Top.X,i.Pt.Y=e.Top.Y,i.Pt.Z=e.Top.Z):this.SetZ(i.Pt,e)),e.OutIdx=n.Idx,i}else{var n=this.m_PolyOuts[e.OutIdx],a=n.Pts;if(r&&w.IntPoint.op_Equality(t,a.Pt))return a;if(!r&&w.IntPoint.op_Equality(t,a.Prev.Pt))return a.Prev;var i=new w.OutPt;return i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=a,i.Prev=a.Prev,i.Prev.Next=i,a.Prev=i,r&&(n.Pts=i),cm&&(w.IntPoint.op_Equality(t,e.Bot)?(i.Pt.X=e.Bot.X,i.Pt.Y=e.Bot.Y,i.Pt.Z=e.Bot.Z):w.IntPoint.op_Equality(t,e.Top)?(i.Pt.X=e.Top.X,i.Pt.Y=e.Top.Y,i.Pt.Z=e.Top.Z):this.SetZ(i.Pt,e)),i}};w.Clipper.prototype.SwapPoints=function(e,t){var r=new w.IntPoint(e.Value);e.Value.X=t.Value.X,e.Value.Y=t.Value.Y,t.Value.X=r.X,t.Value.Y=r.Y};w.Clipper.prototype.HorzSegmentsOverlap=function(e,t,r,n){return e.X>r.X==e.X<n.X||t.X>r.X==t.X<n.X||r.X>e.X==r.X<t.X||n.X>e.X==n.X<t.X||e.X==r.X&&t.X==n.X?!0:e.X==n.X&&t.X==r.X};w.Clipper.prototype.InsertPolyPtBetween=function(e,t,r){var n=new w.OutPt;return n.Pt.X=r.X,n.Pt.Y=r.Y,t==e.Next?(e.Next=n,t.Prev=n,n.Next=t,n.Prev=e):(t.Next=n,e.Prev=n,n.Next=e,n.Prev=t),n};w.Clipper.prototype.SetHoleState=function(e,t){for(var r=!1,n=e.PrevInAEL;n!==null;)n.OutIdx>=0&&n.WindDelta!=0&&(r=!r,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[n.OutIdx])),n=n.PrevInAEL;r&&(t.IsHole=!0)};w.Clipper.prototype.GetDx=function(e,t){return e.Y==t.Y?w.ClipperBase.horizontal:(t.X-e.X)/(t.Y-e.Y)};w.Clipper.prototype.FirstIsBottomPt=function(e,t){for(var r=e.Prev;w.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Prev;var n=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=e.Next;w.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Next;var i=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=t.Prev;w.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Prev;var a=Math.abs(this.GetDx(t.Pt,r.Pt));for(r=t.Next;w.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Next;var u=Math.abs(this.GetDx(t.Pt,r.Pt));return n>=a&&n>=u||i>=a&&i>=u};w.Clipper.prototype.GetBottomPt=function(e){for(var t=null,r=e.Next;r!=e;)r.Pt.Y>e.Pt.Y?(e=r,t=null):r.Pt.Y==e.Pt.Y&&r.Pt.X<=e.Pt.X&&(r.Pt.X<e.Pt.X?(t=null,e=r):r.Next!=e&&r.Prev!=e&&(t=r)),r=r.Next;if(t!==null)for(;t!=r;)for(this.FirstIsBottomPt(r,t)||(e=t),t=t.Next;w.IntPoint.op_Inequality(t.Pt,e.Pt);)t=t.Next;return e};w.Clipper.prototype.GetLowermostRec=function(e,t){e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var r=e.BottomPt,n=t.BottomPt;return r.Pt.Y>n.Pt.Y?e:r.Pt.Y<n.Pt.Y?t:r.Pt.X<n.Pt.X?e:r.Pt.X>n.Pt.X||r.Next==r?t:n.Next==n||this.FirstIsBottomPt(r,n)?e:t};w.Clipper.prototype.Param1RightOfParam2=function(e,t){do if(e=e.FirstLeft,e==t)return!0;while(e!==null);return!1};w.Clipper.prototype.GetOutRec=function(e){for(var t=this.m_PolyOuts[e];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};w.Clipper.prototype.AppendPolygon=function(e,t){var r=this.m_PolyOuts[e.OutIdx],n=this.m_PolyOuts[t.OutIdx],i;this.Param1RightOfParam2(r,n)?i=n:this.Param1RightOfParam2(n,r)?i=r:i=this.GetLowermostRec(r,n);var a=r.Pts,u=a.Prev,c=n.Pts,f=c.Prev,m;e.Side==w.EdgeSide.esLeft?(t.Side==w.EdgeSide.esLeft?(this.ReversePolyPtLinks(c),c.Next=a,a.Prev=c,u.Next=f,f.Prev=u,r.Pts=f):(f.Next=a,a.Prev=f,c.Prev=u,u.Next=c,r.Pts=c),m=w.EdgeSide.esLeft):(t.Side==w.EdgeSide.esRight?(this.ReversePolyPtLinks(c),u.Next=f,f.Prev=u,c.Next=a,a.Prev=c):(u.Next=c,c.Prev=u,a.Prev=f,f.Next=a),m=w.EdgeSide.esRight),r.BottomPt=null,i==n&&(n.FirstLeft!=r&&(r.FirstLeft=n.FirstLeft),r.IsHole=n.IsHole),n.Pts=null,n.BottomPt=null,n.FirstLeft=r;var v=e.OutIdx,x=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var I=this.m_ActiveEdges;I!==null;){if(I.OutIdx==x){I.OutIdx=v,I.Side=m;break}I=I.NextInAEL}n.Idx=r.Idx};w.Clipper.prototype.ReversePolyPtLinks=function(e){if(e!==null){var t,r;t=e;do r=t.Next,t.Next=t.Prev,t.Prev=r,t=r;while(t!=e)}};w.Clipper.SwapSides=function(e,t){var r=e.Side;e.Side=t.Side,t.Side=r};w.Clipper.SwapPolyIndexes=function(e,t){var r=e.OutIdx;e.OutIdx=t.OutIdx,t.OutIdx=r};w.Clipper.prototype.IntersectEdges=function(e,t,r,n){var i=!n&&e.NextInLML===null&&e.Top.X==r.X&&e.Top.Y==r.Y,a=!n&&t.NextInLML===null&&t.Top.X==r.X&&t.Top.Y==r.Y,u=e.OutIdx>=0,c=t.OutIdx>=0;if(i$&&(e.WindDelta===0||t.WindDelta===0)){e.WindDelta===0&&t.WindDelta===0?(i||a)&&u&&c&&this.AddLocalMaxPoly(e,t,r):e.PolyTyp==t.PolyTyp&&e.WindDelta!=t.WindDelta&&this.m_ClipType==w.ClipType.ctUnion?e.WindDelta===0?c&&(this.AddOutPt(e,r),u&&(e.OutIdx=-1)):u&&(this.AddOutPt(t,r),c&&(t.OutIdx=-1)):e.PolyTyp!=t.PolyTyp&&(e.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=w.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(e,r),u&&(e.OutIdx=-1)):t.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=w.ClipType.ctUnion||e.WindCnt2===0)&&(this.AddOutPt(t,r),c&&(t.OutIdx=-1))),i&&(e.OutIdx<0?this.DeleteFromAEL(e):w.Error("Error intersecting polylines")),a&&(t.OutIdx<0?this.DeleteFromAEL(t):w.Error("Error intersecting polylines"));return}if(e.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(e)){var f=e.WindCnt;e.WindCnt=t.WindCnt,t.WindCnt=f}else e.WindCnt+t.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt+=t.WindDelta,t.WindCnt-e.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=e.WindDelta;else this.IsEvenOddFillType(t)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(e)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=e.WindDelta;var m,v,x,I;e.PolyTyp==w.PolyType.ptSubject?(m=this.m_SubjFillType,x=this.m_ClipFillType):(m=this.m_ClipFillType,x=this.m_SubjFillType),t.PolyTyp==w.PolyType.ptSubject?(v=this.m_SubjFillType,I=this.m_ClipFillType):(v=this.m_ClipFillType,I=this.m_SubjFillType);var C,T;switch(m){case w.PolyFillType.pftPositive:C=e.WindCnt;break;case w.PolyFillType.pftNegative:C=-e.WindCnt;break;default:C=Math.abs(e.WindCnt);break}switch(v){case w.PolyFillType.pftPositive:T=t.WindCnt;break;case w.PolyFillType.pftNegative:T=-t.WindCnt;break;default:T=Math.abs(t.WindCnt);break}if(u&&c)i||a||C!==0&&C!=1||T!==0&&T!=1||e.PolyTyp!=t.PolyTyp&&this.m_ClipType!=w.ClipType.ctXor?this.AddLocalMaxPoly(e,t,r):(this.AddOutPt(e,r),this.AddOutPt(t,r),w.Clipper.SwapSides(e,t),w.Clipper.SwapPolyIndexes(e,t));else if(u)(T===0||T==1)&&(this.AddOutPt(e,r),w.Clipper.SwapSides(e,t),w.Clipper.SwapPolyIndexes(e,t));else if(c)(C===0||C==1)&&(this.AddOutPt(t,r),w.Clipper.SwapSides(e,t),w.Clipper.SwapPolyIndexes(e,t));else if((C===0||C==1)&&(T===0||T==1)&&!i&&!a){var O,P;switch(x){case w.PolyFillType.pftPositive:O=e.WindCnt2;break;case w.PolyFillType.pftNegative:O=-e.WindCnt2;break;default:O=Math.abs(e.WindCnt2);break}switch(I){case w.PolyFillType.pftPositive:P=t.WindCnt2;break;case w.PolyFillType.pftNegative:P=-t.WindCnt2;break;default:P=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(C==1&&T==1)switch(this.m_ClipType){case w.ClipType.ctIntersection:O>0&&P>0&&this.AddLocalMinPoly(e,t,r);break;case w.ClipType.ctUnion:O<=0&&P<=0&&this.AddLocalMinPoly(e,t,r);break;case w.ClipType.ctDifference:(e.PolyTyp==w.PolyType.ptClip&&O>0&&P>0||e.PolyTyp==w.PolyType.ptSubject&&O<=0&&P<=0)&&this.AddLocalMinPoly(e,t,r);break;case w.ClipType.ctXor:this.AddLocalMinPoly(e,t,r);break}else w.Clipper.SwapSides(e,t)}i!=a&&(i&&e.OutIdx>=0||a&&t.OutIdx>=0)&&(w.Clipper.SwapSides(e,t),w.Clipper.SwapPolyIndexes(e,t)),i&&this.DeleteFromAEL(e),a&&this.DeleteFromAEL(t)};w.Clipper.prototype.DeleteFromAEL=function(e){var t=e.PrevInAEL,r=e.NextInAEL;t===null&&r===null&&e!=this.m_ActiveEdges||(t!==null?t.NextInAEL=r:this.m_ActiveEdges=r,r!==null&&(r.PrevInAEL=t),e.NextInAEL=null,e.PrevInAEL=null)};w.Clipper.prototype.DeleteFromSEL=function(e){var t=e.PrevInSEL,r=e.NextInSEL;t===null&&r===null&&e!=this.m_SortedEdges||(t!==null?t.NextInSEL=r:this.m_SortedEdges=r,r!==null&&(r.PrevInSEL=t),e.NextInSEL=null,e.PrevInSEL=null)};w.Clipper.prototype.UpdateEdgeIntoAEL=function(e){e.NextInLML===null&&w.Error("UpdateEdgeIntoAEL: invalid call");var t=e.PrevInAEL,r=e.NextInAEL;return e.NextInLML.OutIdx=e.OutIdx,t!==null?t.NextInAEL=e.NextInLML:this.m_ActiveEdges=e.NextInLML,r!==null&&(r.PrevInAEL=e.NextInLML),e.NextInLML.Side=e.Side,e.NextInLML.WindDelta=e.WindDelta,e.NextInLML.WindCnt=e.WindCnt,e.NextInLML.WindCnt2=e.WindCnt2,e=e.NextInLML,e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.PrevInAEL=t,e.NextInAEL=r,w.ClipperBase.IsHorizontal(e)||this.InsertScanbeam(e.Top.Y),e};w.Clipper.prototype.ProcessHorizontals=function(e){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,e),t=this.m_SortedEdges};w.Clipper.prototype.GetHorzDirection=function(e,t){e.Bot.X<e.Top.X?(t.Left=e.Bot.X,t.Right=e.Top.X,t.Dir=w.Direction.dLeftToRight):(t.Left=e.Top.X,t.Right=e.Bot.X,t.Dir=w.Direction.dRightToLeft)};w.Clipper.prototype.PrepareHorzJoins=function(e,t){var r=this.m_PolyOuts[e.OutIdx].Pts;e.Side!=w.EdgeSide.esLeft&&(r=r.Prev),t&&(w.IntPoint.op_Equality(r.Pt,e.Top)?this.AddGhostJoin(r,e.Bot):this.AddGhostJoin(r,e.Top))};w.Clipper.prototype.ProcessHorizontal=function(e,t){var r={Dir:null,Left:null,Right:null};this.GetHorzDirection(e,r);for(var n=r.Dir,i=r.Left,a=r.Right,u=e,c=null;u.NextInLML!==null&&w.ClipperBase.IsHorizontal(u.NextInLML);)u=u.NextInLML;for(u.NextInLML===null&&(c=this.GetMaximaPair(u));;){for(var f=e==u,m=this.GetNextInAEL(e,n);m!==null&&!(m.Curr.X==e.Top.X&&e.NextInLML!==null&&m.Dx<e.NextInLML.Dx);){var v=this.GetNextInAEL(m,n);if(n==w.Direction.dLeftToRight&&m.Curr.X<=a||n==w.Direction.dRightToLeft&&m.Curr.X>=i){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),m==c&&f){n==w.Direction.dLeftToRight?this.IntersectEdges(e,m,m.Top,!1):this.IntersectEdges(m,e,m.Top,!1),c.OutIdx>=0&&w.Error("ProcessHorizontal error");return}else if(n==w.Direction.dLeftToRight){var x=new w.IntPoint(m.Curr.X,e.Curr.Y);this.IntersectEdges(e,m,x,!0)}else{var x=new w.IntPoint(m.Curr.X,e.Curr.Y);this.IntersectEdges(m,e,x,!0)}this.SwapPositionsInAEL(e,m)}else if(n==w.Direction.dLeftToRight&&m.Curr.X>=a||n==w.Direction.dRightToLeft&&m.Curr.X<=i)break;m=v}if(e.OutIdx>=0&&e.WindDelta!==0&&this.PrepareHorzJoins(e,t),e.NextInLML!==null&&w.ClipperBase.IsHorizontal(e.NextInLML)){e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot);var r={Dir:n,Left:i,Right:a};this.GetHorzDirection(e,r),n=r.Dir,i=r.Left,a=r.Right}else break}if(e.NextInLML!==null)if(e.OutIdx>=0){var I=this.AddOutPt(e,e.Top);if(e=this.UpdateEdgeIntoAEL(e),e.WindDelta===0)return;var C=e.PrevInAEL,v=e.NextInAEL;if(C!==null&&C.Curr.X==e.Bot.X&&C.Curr.Y==e.Bot.Y&&C.WindDelta!==0&&C.OutIdx>=0&&C.Curr.Y>C.Top.Y&&w.ClipperBase.SlopesEqual(e,C,this.m_UseFullRange)){var T=this.AddOutPt(C,e.Bot);this.AddJoin(I,T,e.Top)}else if(v!==null&&v.Curr.X==e.Bot.X&&v.Curr.Y==e.Bot.Y&&v.WindDelta!==0&&v.OutIdx>=0&&v.Curr.Y>v.Top.Y&&w.ClipperBase.SlopesEqual(e,v,this.m_UseFullRange)){var T=this.AddOutPt(v,e.Bot);this.AddJoin(I,T,e.Top)}}else e=this.UpdateEdgeIntoAEL(e);else c!==null?c.OutIdx>=0?(n==w.Direction.dLeftToRight?this.IntersectEdges(e,c,e.Top,!1):this.IntersectEdges(c,e,e.Top,!1),c.OutIdx>=0&&w.Error("ProcessHorizontal error")):(this.DeleteFromAEL(e),this.DeleteFromAEL(c)):(e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e))};w.Clipper.prototype.GetNextInAEL=function(e,t){return t==w.Direction.dLeftToRight?e.NextInAEL:e.PrevInAEL};w.Clipper.prototype.IsMinima=function(e){return e!==null&&e.Prev.NextInLML!=e&&e.Next.NextInLML!=e};w.Clipper.prototype.IsMaxima=function(e,t){return e!==null&&e.Top.Y==t&&e.NextInLML===null};w.Clipper.prototype.IsIntermediate=function(e,t){return e.Top.Y==t&&e.NextInLML!==null};w.Clipper.prototype.GetMaximaPair=function(e){var t=null;return w.IntPoint.op_Equality(e.Next.Top,e.Top)&&e.Next.NextInLML===null?t=e.Next:w.IntPoint.op_Equality(e.Prev.Top,e.Top)&&e.Prev.NextInLML===null&&(t=e.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!w.ClipperBase.IsHorizontal(t))?null:t};w.Clipper.prototype.ProcessIntersections=function(e,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(e,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch(r){this.m_SortedEdges=null,this.m_IntersectList.length=0,w.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};w.Clipper.prototype.BuildIntersectList=function(e,t){if(this.m_ActiveEdges!==null){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r.Curr.X=w.Clipper.TopX(r,t),r=r.NextInAEL;for(var n=!0;n&&this.m_SortedEdges!==null;){for(n=!1,r=this.m_SortedEdges;r.NextInSEL!==null;){var i=r.NextInSEL,a=new w.IntPoint;if(r.Curr.X>i.Curr.X){!this.IntersectPoint(r,i,a)&&r.Curr.X>i.Curr.X+1&&w.Error("Intersection error"),a.Y>e&&(a.Y=e,Math.abs(r.Dx)>Math.abs(i.Dx)?a.X=w.Clipper.TopX(i,e):a.X=w.Clipper.TopX(r,e));var u=new w.IntersectNode;u.Edge1=r,u.Edge2=i,u.Pt.X=a.X,u.Pt.Y=a.Y,this.m_IntersectList.push(u),this.SwapPositionsInSEL(r,i),n=!0}else r=i}if(r.PrevInSEL!==null)r.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};w.Clipper.prototype.EdgesAdjacent=function(e){return e.Edge1.NextInSEL==e.Edge2||e.Edge1.PrevInSEL==e.Edge2};w.Clipper.IntersectNodeSort=function(e,t){return t.Pt.Y-e.Pt.Y};w.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var e=this.m_IntersectList.length,t=0;t<e;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var r=t+1;r<e&&!this.EdgesAdjacent(this.m_IntersectList[r]);)r++;if(r==e)return!1;var n=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[r],this.m_IntersectList[r]=n}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};w.Clipper.prototype.ProcessIntersectList=function(){for(var e=0,t=this.m_IntersectList.length;e<t;e++){var r=this.m_IntersectList[e];this.IntersectEdges(r.Edge1,r.Edge2,r.Pt,!0),this.SwapPositionsInAEL(r.Edge1,r.Edge2)}this.m_IntersectList.length=0};var qye=o(function(e){return e<0?Math.ceil(e-.5):Math.round(e)},"R1"),Yye=o(function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},"R2"),Xye=o(function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},"R3"),Zye=o(function(e){return e<0?(e-=.5,e<-2147483648?Math.ceil(e):e|0):(e+=.5,e>2147483647?Math.floor(e):e|0)},"R4");kr.msie?w.Clipper.Round=qye:kr.chromium?w.Clipper.Round=Xye:kr.safari?w.Clipper.Round=Zye:w.Clipper.Round=Yye;w.Clipper.TopX=function(e,t){return t==e.Top.Y?e.Top.X:e.Bot.X+w.Clipper.Round(e.Dx*(t-e.Bot.Y))};w.Clipper.prototype.IntersectPoint=function(e,t,r){r.X=0,r.Y=0;var n,i;if(w.ClipperBase.SlopesEqual(e,t,this.m_UseFullRange)||e.Dx==t.Dx)return t.Bot.Y>e.Bot.Y?(r.X=t.Bot.X,r.Y=t.Bot.Y):(r.X=e.Bot.X,r.Y=e.Bot.Y),!1;if(e.Delta.X===0)r.X=e.Bot.X,w.ClipperBase.IsHorizontal(t)?r.Y=t.Bot.Y:(i=t.Bot.Y-t.Bot.X/t.Dx,r.Y=w.Clipper.Round(r.X/t.Dx+i));else if(t.Delta.X===0)r.X=t.Bot.X,w.ClipperBase.IsHorizontal(e)?r.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,r.Y=w.Clipper.Round(r.X/e.Dx+n));else{n=e.Bot.X-e.Bot.Y*e.Dx,i=t.Bot.X-t.Bot.Y*t.Dx;var a=(i-n)/(e.Dx-t.Dx);r.Y=w.Clipper.Round(a),Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=w.Clipper.Round(e.Dx*a+n):r.X=w.Clipper.Round(t.Dx*a+i)}if(r.Y<e.Top.Y||r.Y<t.Top.Y){if(e.Top.Y>t.Top.Y)return r.Y=e.Top.Y,r.X=w.Clipper.TopX(t,e.Top.Y),r.X<e.Top.X;r.Y=t.Top.Y,Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=w.Clipper.TopX(e,r.Y):r.X=w.Clipper.TopX(t,r.Y)}return!0};w.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(e){for(var t=this.m_ActiveEdges;t!==null;){var r=this.IsMaxima(t,e);if(r){var n=this.GetMaximaPair(t);r=n===null||!w.ClipperBase.IsHorizontal(n)}if(r){var i=t.PrevInAEL;this.DoMaxima(t),i===null?t=this.m_ActiveEdges:t=i.NextInAEL}else{if(this.IsIntermediate(t,e)&&w.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=w.Clipper.TopX(t,e),t.Curr.Y=e),this.StrictlySimple){var i=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&i!==null&&i.OutIdx>=0&&i.Curr.X==t.Curr.X&&i.WindDelta!==0){var a=this.AddOutPt(i,t.Curr),u=this.AddOutPt(t,t.Curr);this.AddJoin(a,u,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,e)){var a=null;t.OutIdx>=0&&(a=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var i=t.PrevInAEL,c=t.NextInAEL;if(i!==null&&i.Curr.X==t.Bot.X&&i.Curr.Y==t.Bot.Y&&a!==null&&i.OutIdx>=0&&i.Curr.Y>i.Top.Y&&w.ClipperBase.SlopesEqual(t,i,this.m_UseFullRange)&&t.WindDelta!==0&&i.WindDelta!==0){var u=this.AddOutPt(i,t.Bot);this.AddJoin(a,u,t.Top)}else if(c!==null&&c.Curr.X==t.Bot.X&&c.Curr.Y==t.Bot.Y&&a!==null&&c.OutIdx>=0&&c.Curr.Y>c.Top.Y&&w.ClipperBase.SlopesEqual(t,c,this.m_UseFullRange)&&t.WindDelta!==0&&c.WindDelta!==0){var u=this.AddOutPt(c,t.Bot);this.AddJoin(a,u,t.Top)}}t=t.NextInAEL}};w.Clipper.prototype.DoMaxima=function(e){var t=this.GetMaximaPair(e);if(t===null){e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e);return}for(var r=e.NextInAEL,n=!0;r!==null&&r!=t;)this.IntersectEdges(e,r,e.Top,!0),this.SwapPositionsInAEL(e,r),r=e.NextInAEL;e.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(e),this.DeleteFromAEL(t)):e.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(e,t,e.Top,!1):n&&e.WindDelta===0?(e.OutIdx>=0&&(this.AddOutPt(e,e.Top),e.OutIdx=-1),this.DeleteFromAEL(e),t.OutIdx>=0&&(this.AddOutPt(t,e.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):w.Error("DoMaxima error")};w.Clipper.ReversePaths=function(e){for(var t=0,r=e.length;t<r;t++)e[t].reverse()};w.Clipper.Orientation=function(e){return w.Clipper.Area(e)>=0};w.Clipper.prototype.PointCount=function(e){if(e===null)return 0;var t=0,r=e;do t++,r=r.Next;while(r!=e);return t};w.Clipper.prototype.BuildResult=function(e){w.Clear(e);for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];if(n.Pts!==null){var i=n.Pts.Prev,a=this.PointCount(i);if(!(a<2)){for(var u=new Array(a),c=0;c<a;c++)u[c]=i.Pt,i=i.Prev;e.push(u)}}}};w.Clipper.prototype.BuildResult2=function(e){e.Clear();for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t],i=this.PointCount(n.Pts);if(!(n.IsOpen&&i<2||!n.IsOpen&&i<3)){this.FixHoleLinkage(n);var a=new w.PolyNode;e.m_AllPolys.push(a),n.PolyNode=a,a.m_polygon.length=i;for(var u=n.Pts.Prev,c=0;c<i;c++)a.m_polygon[c]=u.Pt,u=u.Prev}}for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];n.PolyNode!==null&&(n.IsOpen?(n.PolyNode.IsOpen=!0,e.AddChild(n.PolyNode)):n.FirstLeft!==null&&n.FirstLeft.PolyNode!=null?n.FirstLeft.PolyNode.AddChild(n.PolyNode):e.AddChild(n.PolyNode))}};w.Clipper.prototype.FixupOutPolygon=function(e){var t=null;e.BottomPt=null;for(var r=e.Pts;;){if(r.Prev==r||r.Prev==r.Next){this.DisposeOutPts(r),e.Pts=null;return}if(w.IntPoint.op_Equality(r.Pt,r.Next.Pt)||w.IntPoint.op_Equality(r.Pt,r.Prev.Pt)||w.ClipperBase.SlopesEqual(r.Prev.Pt,r.Pt,r.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(r.Prev.Pt,r.Pt,r.Next.Pt))){t=null;var n=r;r.Prev.Next=r.Next,r.Next.Prev=r.Prev,r=r.Prev,n=null}else{if(r==t)break;t===null&&(t=r),r=r.Next}}e.Pts=r};w.Clipper.prototype.DupOutPt=function(e,t){var r=new w.OutPt;return r.Pt.X=e.Pt.X,r.Pt.Y=e.Pt.Y,r.Idx=e.Idx,t?(r.Next=e.Next,r.Prev=e,e.Next.Prev=r,e.Next=r):(r.Prev=e.Prev,r.Next=e,e.Prev.Next=r,e.Prev=r),r};w.Clipper.prototype.GetOverlap=function(e,t,r,n,i){return e<t?r<n?(i.Left=Math.max(e,r),i.Right=Math.min(t,n)):(i.Left=Math.max(e,n),i.Right=Math.min(t,r)):r<n?(i.Left=Math.max(t,r),i.Right=Math.min(e,n)):(i.Left=Math.max(t,n),i.Right=Math.min(e,r)),i.Left<i.Right};w.Clipper.prototype.JoinHorz=function(e,t,r,n,i,a){var u=e.Pt.X>t.Pt.X?w.Direction.dRightToLeft:w.Direction.dLeftToRight,c=r.Pt.X>n.Pt.X?w.Direction.dRightToLeft:w.Direction.dLeftToRight;if(u==c)return!1;if(u==w.Direction.dLeftToRight){for(;e.Next.Pt.X<=i.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;a&&e.Pt.X!=i.X&&(e=e.Next),t=this.DupOutPt(e,!a),w.IntPoint.op_Inequality(t.Pt,i)&&(e=t,e.Pt.X=i.X,e.Pt.Y=i.Y,t=this.DupOutPt(e,!a))}else{for(;e.Next.Pt.X>=i.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;!a&&e.Pt.X!=i.X&&(e=e.Next),t=this.DupOutPt(e,a),w.IntPoint.op_Inequality(t.Pt,i)&&(e=t,e.Pt.X=i.X,e.Pt.Y=i.Y,t=this.DupOutPt(e,a))}if(c==w.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),n=this.DupOutPt(r,!a),w.IntPoint.op_Inequality(n.Pt,i)&&(r=n,r.Pt.X=i.X,r.Pt.Y=i.Y,n=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),n=this.DupOutPt(r,a),w.IntPoint.op_Inequality(n.Pt,i)&&(r=n,r.Pt.X=i.X,r.Pt.Y=i.Y,n=this.DupOutPt(r,a))}return u==w.Direction.dLeftToRight==a?(e.Prev=r,r.Next=e,t.Next=n,n.Prev=t):(e.Next=r,r.Prev=e,t.Prev=n,n.Next=t),!0};w.Clipper.prototype.JoinPoints=function(e,t,r){var n=e.OutPt1,i=new w.OutPt,a=e.OutPt2,u=new w.OutPt,c=e.OutPt1.Pt.Y==e.OffPt.Y;if(c&&w.IntPoint.op_Equality(e.OffPt,e.OutPt1.Pt)&&w.IntPoint.op_Equality(e.OffPt,e.OutPt2.Pt)){for(i=e.OutPt1.Next;i!=n&&w.IntPoint.op_Equality(i.Pt,e.OffPt);)i=i.Next;var f=i.Pt.Y>e.OffPt.Y;for(u=e.OutPt2.Next;u!=a&&w.IntPoint.op_Equality(u.Pt,e.OffPt);)u=u.Next;var m=u.Pt.Y>e.OffPt.Y;return f==m?!1:f?(i=this.DupOutPt(n,!1),u=this.DupOutPt(a,!0),n.Prev=a,a.Next=n,i.Next=u,u.Prev=i,e.OutPt1=n,e.OutPt2=i,!0):(i=this.DupOutPt(n,!0),u=this.DupOutPt(a,!1),n.Next=a,a.Prev=n,i.Prev=u,u.Next=i,e.OutPt1=n,e.OutPt2=i,!0)}else if(c){for(i=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=i&&n.Prev!=a;)n=n.Prev;for(;i.Next.Pt.Y==i.Pt.Y&&i.Next!=n&&i.Next!=a;)i=i.Next;if(i.Next==n||i.Next==a)return!1;for(u=a;a.Prev.Pt.Y==a.Pt.Y&&a.Prev!=u&&a.Prev!=i;)a=a.Prev;for(;u.Next.Pt.Y==u.Pt.Y&&u.Next!=a&&u.Next!=n;)u=u.Next;if(u.Next==a||u.Next==n)return!1;var v={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,i.Pt.X,a.Pt.X,u.Pt.X,v))return!1;var x=v.Left,I=v.Right,C=new w.IntPoint,T;return n.Pt.X>=x&&n.Pt.X<=I?(C.X=n.Pt.X,C.Y=n.Pt.Y,T=n.Pt.X>i.Pt.X):a.Pt.X>=x&&a.Pt.X<=I?(C.X=a.Pt.X,C.Y=a.Pt.Y,T=a.Pt.X>u.Pt.X):i.Pt.X>=x&&i.Pt.X<=I?(C.X=i.Pt.X,C.Y=i.Pt.Y,T=i.Pt.X>n.Pt.X):(C.X=u.Pt.X,C.Y=u.Pt.Y,T=u.Pt.X>a.Pt.X),e.OutPt1=n,e.OutPt2=a,this.JoinHorz(n,i,a,u,C,T)}else{for(i=n.Next;w.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Next;var O=i.Pt.Y>n.Pt.Y||!w.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange);if(O){for(i=n.Prev;w.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Prev;if(i.Pt.Y>n.Pt.Y||!w.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange))return!1}for(u=a.Next;w.IntPoint.op_Equality(u.Pt,a.Pt)&&u!=a;)u=u.Next;var P=u.Pt.Y>a.Pt.Y||!w.ClipperBase.SlopesEqual(a.Pt,u.Pt,e.OffPt,this.m_UseFullRange);if(P){for(u=a.Prev;w.IntPoint.op_Equality(u.Pt,a.Pt)&&u!=a;)u=u.Prev;if(u.Pt.Y>a.Pt.Y||!w.ClipperBase.SlopesEqual(a.Pt,u.Pt,e.OffPt,this.m_UseFullRange))return!1}return i==n||u==a||i==u||t==r&&O==P?!1:O?(i=this.DupOutPt(n,!1),u=this.DupOutPt(a,!0),n.Prev=a,a.Next=n,i.Next=u,u.Prev=i,e.OutPt1=n,e.OutPt2=i,!0):(i=this.DupOutPt(n,!0),u=this.DupOutPt(a,!1),n.Next=a,a.Prev=n,i.Prev=u,u.Next=i,e.OutPt1=n,e.OutPt2=i,!0)}};w.Clipper.GetBounds=function(e){for(var t=0,r=e.length;t<r&&e[t].length==0;)t++;if(t==r)return new w.IntRect(0,0,0,0);var n=new w.IntRect;for(n.left=e[t][0].X,n.right=n.left,n.top=e[t][0].Y,n.bottom=n.top;t<r;t++)for(var i=0,a=e[t].length;i<a;i++)e[t][i].X<n.left?n.left=e[t][i].X:e[t][i].X>n.right&&(n.right=e[t][i].X),e[t][i].Y<n.top?n.top=e[t][i].Y:e[t][i].Y>n.bottom&&(n.bottom=e[t][i].Y);return n};w.Clipper.prototype.GetBounds2=function(e){var t=e,r=new w.IntRect;for(r.left=e.Pt.X,r.right=e.Pt.X,r.top=e.Pt.Y,r.bottom=e.Pt.Y,e=e.Next;e!=t;)e.Pt.X<r.left&&(r.left=e.Pt.X),e.Pt.X>r.right&&(r.right=e.Pt.X),e.Pt.Y<r.top&&(r.top=e.Pt.Y),e.Pt.Y>r.bottom&&(r.bottom=e.Pt.Y),e=e.Next;return r};w.Clipper.PointInPolygon=function(e,t){var r=0,n=t.length;if(n<3)return 0;for(var i=t[0],a=1;a<=n;++a){var u=a==n?t[0]:t[a];if(u.Y==e.Y&&(u.X==e.X||i.Y==e.Y&&u.X>e.X==i.X<e.X))return-1;if(i.Y<e.Y!=u.Y<e.Y){if(i.X>=e.X)if(u.X>e.X)r=1-r;else{var c=(i.X-e.X)*(u.Y-e.Y)-(u.X-e.X)*(i.Y-e.Y);if(c==0)return-1;c>0==u.Y>i.Y&&(r=1-r)}else if(u.X>e.X){var c=(i.X-e.X)*(u.Y-e.Y)-(u.X-e.X)*(i.Y-e.Y);if(c==0)return-1;c>0==u.Y>i.Y&&(r=1-r)}}i=u}return r};w.Clipper.prototype.PointInPolygon=function(e,t){for(var r=0,n=t;;){var i=t.Pt.X,a=t.Pt.Y,u=t.Next.Pt.X,c=t.Next.Pt.Y;if(c==e.Y&&(u==e.X||a==e.Y&&u>e.X==i<e.X))return-1;if(a<e.Y!=c<e.Y){if(i>=e.X)if(u>e.X)r=1-r;else{var f=(i-e.X)*(c-e.Y)-(u-e.X)*(a-e.Y);if(f==0)return-1;f>0==c>a&&(r=1-r)}else if(u>e.X){var f=(i-e.X)*(c-e.Y)-(u-e.X)*(a-e.Y);if(f==0)return-1;f>0==c>a&&(r=1-r)}}if(t=t.Next,n==t)break}return r};w.Clipper.prototype.Poly2ContainsPoly1=function(e,t){var r=e;do{var n=this.PointInPolygon(r.Pt,t);if(n>=0)return n!=0;r=r.Next}while(r!=e);return!0};w.Clipper.prototype.FixupFirstLefts1=function(e,t){for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts!==null&&i.FirstLeft==e&&this.Poly2ContainsPoly1(i.Pts,t.Pts)&&(i.FirstLeft=t)}};w.Clipper.prototype.FixupFirstLefts2=function(e,t){for(var r=0,n=this.m_PolyOuts,i=n.length,a=n[r];r<i;r++,a=n[r])a.FirstLeft==e&&(a.FirstLeft=t)};w.Clipper.ParseFirstLeft=function(e){for(;e!=null&&e.Pts==null;)e=e.FirstLeft;return e};w.Clipper.prototype.JoinCommonEdges=function(){for(var e=0,t=this.m_Joins.length;e<t;e++){var r=this.m_Joins[e],n=this.GetOutRec(r.OutPt1.Idx),i=this.GetOutRec(r.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(r,n,i))if(n==i){if(n.Pts=r.OutPt1,n.BottomPt=null,i=this.CreateOutRec(),i.Pts=r.OutPt2,this.UpdateOutPtIdxs(i),this.m_UsingPolyTree)for(var u=0,c=this.m_PolyOuts.length;u<c-1;u++){var f=this.m_PolyOuts[u];f.Pts==null||w.Clipper.ParseFirstLeft(f.FirstLeft)!=n||f.IsHole==n.IsHole||this.Poly2ContainsPoly1(f.Pts,r.OutPt2)&&(f.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)}}};w.Clipper.prototype.UpdateOutPtIdxs=function(e){var t=e.Pts;do t.Idx=e.Idx,t=t.Prev;while(t!=e.Pts)};w.Clipper.prototype.DoSimplePolygons=function(){for(var e=0;e<this.m_PolyOuts.length;){var t=this.m_PolyOuts[e++],r=t.Pts;if(r!==null)do{for(var n=r.Next;n!=t.Pts;){if(w.IntPoint.op_Equality(r.Pt,n.Pt)&&n.Next!=r&&n.Prev!=r){var i=r.Prev,a=n.Prev;r.Prev=a,a.Next=r,n.Prev=i,i.Next=n,t.Pts=r;var u=this.CreateOutRec();u.Pts=n,this.UpdateOutPtIdxs(u),this.Poly2ContainsPoly1(u.Pts,t.Pts)?(u.IsHole=!t.IsHole,u.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,u.Pts)?(u.IsHole=t.IsHole,t.IsHole=!u.IsHole,u.FirstLeft=t.FirstLeft,t.FirstLeft=u):(u.IsHole=t.IsHole,u.FirstLeft=t.FirstLeft),n=r}n=n.Next}r=r.Next}while(r!=t.Pts)}};w.Clipper.Area=function(e){var t=e.length;if(t<3)return 0;for(var r=0,n=0,i=t-1;n<t;++n)r+=(e[i].X+e[n].X)*(e[i].Y-e[n].Y),i=n;return-r*.5};w.Clipper.prototype.Area=function(e){var t=e.Pts;if(t==null)return 0;var r=0;do r=r+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=e.Pts);return r*.5};o$&&(w.Clipper.OffsetPaths=function(e,t,r,n,i){var a=new w.Paths,u=new w.ClipperOffset(i,i);return u.AddPaths(e,r,n),u.Execute(a,t),a});w.Clipper.SimplifyPolygon=function(e,t){var r=new Array,n=new w.Clipper(0);return n.StrictlySimple=!0,n.AddPath(e,w.PolyType.ptSubject,!0),n.Execute(w.ClipType.ctUnion,r,t,t),r};w.Clipper.SimplifyPolygons=function(e,t){typeof t>"u"&&(t=w.PolyFillType.pftEvenOdd);var r=new Array,n=new w.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(e,w.PolyType.ptSubject,!0),n.Execute(w.ClipType.ctUnion,r,t,t),r};w.Clipper.DistanceSqrd=function(e,t){var r=e.X-t.X,n=e.Y-t.Y;return r*r+n*n};w.Clipper.DistanceFromLineSqrd=function(e,t,r){var n=t.Y-r.Y,i=r.X-t.X,a=n*t.X+i*t.Y;return a=n*e.X+i*e.Y-a,a*a/(n*n+i*i)};w.Clipper.SlopesNearCollinear=function(e,t,r,n){return w.Clipper.DistanceFromLineSqrd(t,e,r)<n};w.Clipper.PointsAreClose=function(e,t,r){var n=e.X-t.X,i=e.Y-t.Y;return n*n+i*i<=r};w.Clipper.ExcludeOp=function(e){var t=e.Prev;return t.Next=e.Next,e.Next.Prev=t,t.Idx=0,t};w.Clipper.CleanPolygon=function(e,t){typeof t>"u"&&(t=1.415);var r=e.length;if(r==0)return new Array;for(var n=new Array(r),i=0;i<r;++i)n[i]=new w.OutPt;for(var i=0;i<r;++i)n[i].Pt=e[i],n[i].Next=n[(i+1)%r],n[i].Next.Prev=n[i],n[i].Idx=0;for(var a=t*t,u=n[0];u.Idx==0&&u.Next!=u.Prev;)w.Clipper.PointsAreClose(u.Pt,u.Prev.Pt,a)?(u=w.Clipper.ExcludeOp(u),r--):w.Clipper.PointsAreClose(u.Prev.Pt,u.Next.Pt,a)?(w.Clipper.ExcludeOp(u.Next),u=w.Clipper.ExcludeOp(u),r-=2):w.Clipper.SlopesNearCollinear(u.Prev.Pt,u.Pt,u.Next.Pt,a)?(u=w.Clipper.ExcludeOp(u),r--):(u.Idx=1,u=u.Next);r<3&&(r=0);for(var c=new Array(r),i=0;i<r;++i)c[i]=new w.IntPoint(u.Pt),u=u.Next;return n=null,c};w.Clipper.CleanPolygons=function(e,t){for(var r=new Array(e.length),n=0,i=e.length;n<i;n++)r[n]=w.Clipper.CleanPolygon(e[n],t);return r};w.Clipper.Minkowski=function(e,t,r,n){var i=n?1:0,a=e.length,u=t.length,c=new Array;if(r)for(var f=0;f<u;f++){for(var m=new Array(a),v=0,x=e.length,I=e[v];v<x;v++,I=e[v])m[v]=new w.IntPoint(t[f].X+I.X,t[f].Y+I.Y);c.push(m)}else for(var f=0;f<u;f++){for(var m=new Array(a),v=0,x=e.length,I=e[v];v<x;v++,I=e[v])m[v]=new w.IntPoint(t[f].X-I.X,t[f].Y-I.Y);c.push(m)}for(var C=new Array,f=0;f<u-1+i;f++)for(var v=0;v<a;v++){var T=new Array;T.push(c[f%u][v%a]),T.push(c[(f+1)%u][v%a]),T.push(c[(f+1)%u][(v+1)%a]),T.push(c[f%u][(v+1)%a]),w.Clipper.Orientation(T)||T.reverse(),C.push(T)}var O=new w.Clipper(0);return O.AddPaths(C,w.PolyType.ptSubject,!0),O.Execute(w.ClipType.ctUnion,c,w.PolyFillType.pftNonZero,w.PolyFillType.pftNonZero),c};w.Clipper.MinkowskiSum=function(){var e=arguments,t=e.length;if(t==3){var r=e[0],n=e[1],i=e[2];return w.Clipper.Minkowski(r,n,!0,i)}else if(t==4){for(var r=e[0],a=e[1],u=e[2],i=e[3],c=new w.Clipper,f,m=0,v=a.length;m<v;++m){var f=w.Clipper.Minkowski(r,a[m],!0,i);c.AddPaths(f,w.PolyType.ptSubject,!0)}i&&c.AddPaths(a,w.PolyType.ptClip,!0);var x=new w.Paths;return c.Execute(w.ClipType.ctUnion,x,u,u),x}};w.Clipper.MinkowskiDiff=function(e,t,r){return w.Clipper.Minkowski(e,t,!1,r)};w.Clipper.PolyTreeToPaths=function(e){var t=new Array;return w.Clipper.AddPolyNodeToPaths(e,w.Clipper.NodeType.ntAny,t),t};w.Clipper.AddPolyNodeToPaths=function(e,t,r){var n=!0;switch(t){case w.Clipper.NodeType.ntOpen:return;case w.Clipper.NodeType.ntClosed:n=!e.IsOpen;break;default:break}e.m_polygon.length>0&&n&&r.push(e.m_polygon);for(var i=0,a=e.Childs(),u=a.length,c=a[i];i<u;i++,c=a[i])w.Clipper.AddPolyNodeToPaths(c,t,r)};w.Clipper.OpenPathsFromPolyTree=function(e){for(var t=new w.Paths,r=0,n=e.ChildCount();r<n;r++)e.Childs()[r].IsOpen&&t.push(e.Childs()[r].m_polygon);return t};w.Clipper.ClosedPathsFromPolyTree=function(e){var t=new w.Paths;return w.Clipper.AddPolyNodeToPaths(e,w.Clipper.NodeType.ntClosed,t),t};wC(w.Clipper,w.ClipperBase);w.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};w.ClipperOffset=function(e,t){typeof e>"u"&&(e=2),typeof t>"u"&&(t=w.ClipperOffset.def_arc_tolerance),this.m_destPolys=new w.Paths,this.m_srcPoly=new w.Path,this.m_destPoly=new w.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 w.IntPoint,this.m_polyNodes=new w.PolyNode,this.MiterLimit=e,this.ArcTolerance=t,this.m_lowest.X=-1};w.ClipperOffset.two_pi=6.28318530717959;w.ClipperOffset.def_arc_tolerance=.25;w.ClipperOffset.prototype.Clear=function(){w.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};w.ClipperOffset.Round=w.Clipper.Round;w.ClipperOffset.prototype.AddPath=function(e,t,r){var n=e.length-1;if(!(n<0)){var i=new w.PolyNode;if(i.m_jointype=t,i.m_endtype=r,r==w.EndType.etClosedLine||r==w.EndType.etClosedPolygon)for(;n>0&&w.IntPoint.op_Equality(e[0],e[n]);)n--;i.m_polygon.push(e[0]);for(var a=0,u=0,c=1;c<=n;c++)w.IntPoint.op_Inequality(i.m_polygon[a],e[c])&&(a++,i.m_polygon.push(e[c]),(e[c].Y>i.m_polygon[u].Y||e[c].Y==i.m_polygon[u].Y&&e[c].X<i.m_polygon[u].X)&&(u=a));if(!(r==w.EndType.etClosedPolygon&&a<2||r!=w.EndType.etClosedPolygon&&a<0)&&(this.m_polyNodes.AddChild(i),r==w.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new w.IntPoint(0,u);else{var f=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(i.m_polygon[u].Y>f.Y||i.m_polygon[u].Y==f.Y&&i.m_polygon[u].X<f.X)&&(this.m_lowest=new w.IntPoint(this.m_polyNodes.ChildCount()-1,u))}}};w.ClipperOffset.prototype.AddPaths=function(e,t,r){for(var n=0,i=e.length;n<i;n++)this.AddPath(e[n],t,r)};w.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!w.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];(t.m_endtype==w.EndType.etClosedPolygon||t.m_endtype==w.EndType.etClosedLine&&w.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==w.EndType.etClosedLine&&!w.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};w.ClipperOffset.GetUnitNormal=function(e,t){var r=t.X-e.X,n=t.Y-e.Y;if(r==0&&n==0)return new w.DoublePoint(0,0);var i=1/Math.sqrt(r*r+n*n);return r*=i,n*=i,new w.DoublePoint(n,-r)};w.ClipperOffset.prototype.DoOffset=function(e){if(this.m_destPolys=new Array,this.m_delta=e,w.ClipperBase.near_zero(e)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];r.m_endtype==w.EndType.etClosedPolygon&&this.m_destPolys.push(r.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var n;this.ArcTolerance<=0?n=w.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(e)*w.ClipperOffset.def_arc_tolerance?n=Math.abs(e)*w.ClipperOffset.def_arc_tolerance:n=this.ArcTolerance;var i=3.14159265358979/Math.acos(1-n/Math.abs(e));this.m_sin=Math.sin(w.ClipperOffset.two_pi/i),this.m_cos=Math.cos(w.ClipperOffset.two_pi/i),this.m_StepsPerRad=i/w.ClipperOffset.two_pi,e<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];this.m_srcPoly=r.m_polygon;var a=this.m_srcPoly.length;if(!(a==0||e<=0&&(a<3||r.m_endtype!=w.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,a==1){if(r.m_jointype==w.JoinType.jtRound)for(var u=1,c=0,f=1;f<=i;f++){this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[0].X+u*e),w.ClipperOffset.Round(this.m_srcPoly[0].Y+c*e)));var m=u;u=u*this.m_cos-this.m_sin*c,c=m*this.m_sin+c*this.m_cos}else for(var u=-1,c=-1,f=0;f<4;++f)this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[0].X+u*e),w.ClipperOffset.Round(this.m_srcPoly[0].Y+c*e))),u<0?u=1:c<0?c=1:u=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var f=0;f<a-1;f++)this.m_normals.push(w.ClipperOffset.GetUnitNormal(this.m_srcPoly[f],this.m_srcPoly[f+1]));if(r.m_endtype==w.EndType.etClosedLine||r.m_endtype==w.EndType.etClosedPolygon?this.m_normals.push(w.ClipperOffset.GetUnitNormal(this.m_srcPoly[a-1],this.m_srcPoly[0])):this.m_normals.push(new w.DoublePoint(this.m_normals[a-2])),r.m_endtype==w.EndType.etClosedPolygon){for(var v=a-1,f=0;f<a;f++)v=this.OffsetPoint(f,v,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==w.EndType.etClosedLine){for(var v=a-1,f=0;f<a;f++)v=this.OffsetPoint(f,v,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var x=this.m_normals[a-1],f=a-1;f>0;f--)this.m_normals[f]=new w.DoublePoint(-this.m_normals[f-1].X,-this.m_normals[f-1].Y);this.m_normals[0]=new w.DoublePoint(-x.X,-x.Y),v=0;for(var f=a-1;f>=0;f--)v=this.OffsetPoint(f,v,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var v=0,f=1;f<a-1;++f)v=this.OffsetPoint(f,v,r.m_jointype);var I;if(r.m_endtype==w.EndType.etOpenButt){var f=a-1;I=new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[f].X+this.m_normals[f].X*e),w.ClipperOffset.Round(this.m_srcPoly[f].Y+this.m_normals[f].Y*e)),this.m_destPoly.push(I),I=new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[f].X-this.m_normals[f].X*e),w.ClipperOffset.Round(this.m_srcPoly[f].Y-this.m_normals[f].Y*e)),this.m_destPoly.push(I)}else{var f=a-1;v=a-2,this.m_sinA=0,this.m_normals[f]=new w.DoublePoint(-this.m_normals[f].X,-this.m_normals[f].Y),r.m_endtype==w.EndType.etOpenSquare?this.DoSquare(f,v):this.DoRound(f,v)}for(var f=a-1;f>0;f--)this.m_normals[f]=new w.DoublePoint(-this.m_normals[f-1].X,-this.m_normals[f-1].Y);this.m_normals[0]=new w.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),v=a-1;for(var f=v-1;f>0;--f)v=this.OffsetPoint(f,v,r.m_jointype);r.m_endtype==w.EndType.etOpenButt?(I=new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*e),w.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*e)),this.m_destPoly.push(I),I=new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*e),w.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*e)),this.m_destPoly.push(I)):(v=1,this.m_sinA=0,r.m_endtype==w.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};w.ClipperOffset.prototype.Execute=function(){var e=arguments,t=e[0]instanceof w.PolyTree;if(t){var r=e[0],n=e[1];r.Clear(),this.FixOrientations(),this.DoOffset(n);var i=new w.Clipper(0);if(i.AddPaths(this.m_destPolys,w.PolyType.ptSubject,!0),n>0)i.Execute(w.ClipType.ctUnion,r,w.PolyFillType.pftPositive,w.PolyFillType.pftPositive);else{var a=w.Clipper.GetBounds(this.m_destPolys),u=new w.Path;if(u.push(new w.IntPoint(a.left-10,a.bottom+10)),u.push(new w.IntPoint(a.right+10,a.bottom+10)),u.push(new w.IntPoint(a.right+10,a.top-10)),u.push(new w.IntPoint(a.left-10,a.top-10)),i.AddPath(u,w.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(w.ClipType.ctUnion,r,w.PolyFillType.pftNegative,w.PolyFillType.pftNegative),r.ChildCount()==1&&r.Childs()[0].ChildCount()>0){var c=r.Childs()[0];r.Childs()[0]=c.Childs()[0];for(var f=1;f<c.ChildCount();f++)r.AddChild(c.Childs()[f])}else r.Clear()}}else{var r=e[0],n=e[1];w.Clear(r),this.FixOrientations(),this.DoOffset(n);var i=new w.Clipper(0);if(i.AddPaths(this.m_destPolys,w.PolyType.ptSubject,!0),n>0)i.Execute(w.ClipType.ctUnion,r,w.PolyFillType.pftPositive,w.PolyFillType.pftPositive);else{var a=w.Clipper.GetBounds(this.m_destPolys),u=new w.Path;u.push(new w.IntPoint(a.left-10,a.bottom+10)),u.push(new w.IntPoint(a.right+10,a.bottom+10)),u.push(new w.IntPoint(a.right+10,a.top-10)),u.push(new w.IntPoint(a.left-10,a.top-10)),i.AddPath(u,w.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(w.ClipType.ctUnion,r,w.PolyFillType.pftNegative,w.PolyFillType.pftNegative),r.length>0&&r.splice(0,1)}}};w.ClipperOffset.prototype.OffsetPoint=function(e,t,r){if(this.m_sinA=this.m_normals[t].X*this.m_normals[e].Y-this.m_normals[e].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[t].X*this.m_delta),w.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new w.IntPoint(this.m_srcPoly[e])),this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),w.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)));else switch(r){case w.JoinType.jtMiter:{var n=1+(this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y);n>=this.m_miterLim?this.DoMiter(e,t,n):this.DoSquare(e,t);break}case w.JoinType.jtSquare:this.DoSquare(e,t);break;case w.JoinType.jtRound:this.DoRound(e,t);break}return t=e,t};w.ClipperOffset.prototype.DoSquare=function(e,t){var r=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y)/4);this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*r)),w.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*r)))),this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[e].X+this.m_normals[e].Y*r)),w.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[e].Y-this.m_normals[e].X*r))))};w.ClipperOffset.prototype.DoMiter=function(e,t,r){var n=this.m_delta/r;this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+(this.m_normals[t].X+this.m_normals[e].X)*n),w.ClipperOffset.Round(this.m_srcPoly[e].Y+(this.m_normals[t].Y+this.m_normals[e].Y)*n)))};w.ClipperOffset.prototype.DoRound=function(e,t){for(var r=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y),n=w.Cast_Int32(w.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),i=this.m_normals[t].X,a=this.m_normals[t].Y,u,c=0;c<n;++c)this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+i*this.m_delta),w.ClipperOffset.Round(this.m_srcPoly[e].Y+a*this.m_delta))),u=i,i=i*this.m_cos-this.m_sin*a,a=u*this.m_sin+a*this.m_cos;this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),w.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)))};w.Error=function(e){try{throw new Error(e)}catch(t){alert(t.message)}};w.JS={};w.JS.AreaOfPolygon=function(e,t){return t||(t=1),w.Clipper.Area(e)/(t*t)};w.JS.AreaOfPolygons=function(e,t){t||(t=1);for(var r=0,n=0;n<e.length;n++)r+=w.Clipper.Area(e[n]);return r/(t*t)};w.JS.BoundsOfPath=function(e,t){return w.JS.BoundsOfPaths([e],t)};w.JS.BoundsOfPaths=function(e,t){t||(t=1);var r=w.Clipper.GetBounds(e);return r.left/=t,r.bottom/=t,r.right/=t,r.top/=t,r};w.JS.Clean=function(n,t){if(!(n instanceof Array))return[];var r=n[0]instanceof Array,n=w.JS.Clone(n);if(typeof t!="number"||t===null)return w.Error("Delta is not a number in Clean()."),n;if(n.length===0||n.length==1&&n[0].length===0||t<0)return n;r||(n=[n]);for(var i=n.length,a,u,c,f,m,v,x,I=[],C=0;C<i;C++)if(u=n[C],a=u.length,a!==0){if(a<3){c=u,I.push(c);continue}for(c=u,f=t*t,m=u[0],v=1,x=1;x<a;x++)(u[x].X-m.X)*(u[x].X-m.X)+(u[x].Y-m.Y)*(u[x].Y-m.Y)<=f||(c[v]=u[x],m=u[x],v++);m=u[v-1],(u[0].X-m.X)*(u[0].X-m.X)+(u[0].Y-m.Y)*(u[0].Y-m.Y)<=f&&v--,v<a&&c.splice(v,a-v),c.length&&I.push(c)}return!r&&I.length?I=I[0]:!r&&I.length===0?I=[]:r&&I.length===0&&(I=[[]]),I};w.JS.Clone=function(e){if(!(e instanceof Array))return[];if(e.length===0)return[];if(e.length==1&&e[0].length===0)return[[]];var t=e[0]instanceof Array;t||(e=[e]);var r=e.length,n,i,a,u,c=new Array(r);for(i=0;i<r;i++){for(n=e[i].length,u=new Array(n),a=0;a<n;a++)u[a]={X:e[i][a].X,Y:e[i][a].Y};c[i]=u}return t||(c=c[0]),c};w.JS.Lighten=function(e,t){if(!(e instanceof Array))return[];if(typeof t!="number"||t===null)return w.Error("Tolerance is not a number in Lighten()."),w.JS.Clone(e);if(e.length===0||e.length==1&&e[0].length===0||t<0)return w.JS.Clone(e);e[0]instanceof Array||(e=[e]);var r,n,i,a,u,c,f,m,v,x,I,C,T,O,P,L,A,M=e.length,N=t*t,B=[];for(r=0;r<M;r++)if(i=e[r],c=i.length,c!=0){for(a=0;a<1e6;a++){for(u=[],c=i.length,i[c-1].X!=i[0].X||i[c-1].Y!=i[0].Y?(C=1,i.push({X:i[0].X,Y:i[0].Y}),c=i.length):C=0,I=[],n=0;n<c-2;n++)f=i[n],v=i[n+1],m=i[n+2],L=f.X,A=f.Y,T=m.X-L,O=m.Y-A,(T!==0||O!==0)&&(P=((v.X-L)*T+(v.Y-A)*O)/(T*T+O*O),P>1?(L=m.X,A=m.Y):P>0&&(L+=T*P,A+=O*P)),T=v.X-L,O=v.Y-A,x=T*T+O*O,x<=N&&(I[n+1]=1,n++);for(u.push({X:i[0].X,Y:i[0].Y}),n=1;n<c-1;n++)I[n]||u.push({X:i[n].X,Y:i[n].Y});if(u.push({X:i[c-1].X,Y:i[c-1].Y}),C&&i.pop(),I.length)i=u;else break}c=u.length,u[c-1].X==u[0].X&&u[c-1].Y==u[0].Y&&u.pop(),u.length>2&&B.push(u)}return!e[0]instanceof Array&&(B=B[0]),typeof B>"u"&&(B=[[]]),B};w.JS.PerimeterOfPath=function(e,t,r){if(typeof e>"u")return 0;var n=Math.sqrt,i=0,a,u,c=0,f=0,m=0,v=0,x=e.length;if(x<2)return 0;for(t&&(e[x]=e[0],x++);--x;)a=e[x],c=a.X,f=a.Y,u=e[x-1],m=u.X,v=u.Y,i+=n((c-m)*(c-m)+(f-v)*(f-v));return t&&e.pop(),i/r};w.JS.PerimeterOfPaths=function(e,t,r){r||(r=1);for(var n=0,i=0;i<e.length;i++)n+=w.JS.PerimeterOfPath(e[i],t,r);return n};w.JS.ScaleDownPath=function(e,t){var r,n;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=n.X/t,n.Y=n.Y/t};w.JS.ScaleDownPaths=function(e,t){var r,n,i,a=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)i=e[r][n],i.X=i.X/t,i.Y=i.Y/t};w.JS.ScaleUpPath=function(e,t){var r,n,i=Math.round;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=i(n.X*t),n.Y=i(n.Y*t)};w.JS.ScaleUpPaths=function(e,t){var r,n,i,a=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)i=e[r][n],i.X=a(i.X*t),i.Y=a(i.Y*t)};w.ExPolygons=function(){return[]};w.ExPolygon=function(){this.outer=null,this.holes=null};w.JS.AddOuterPolyNodeToExPolygons=function(e,t){var r=new w.ExPolygon;r.outer=e.Contour();var n=e.Childs(),i=n.length;r.holes=new Array(i);var a,u,c,f,m,v;for(c=0;c<i;c++)for(a=n[c],r.holes[c]=a.Contour(),f=0,m=a.Childs(),v=m.length;f<v;f++)u=m[f],w.JS.AddOuterPolyNodeToExPolygons(u,t);t.push(r)};w.JS.ExPolygonsToPaths=function(e){var t,r,n,i,a=new w.Paths;for(t=0,n=e.length;t<n;t++)for(a.push(e[t].outer),r=0,i=e[t].holes.length;r<i;r++)a.push(e[t].holes[r]);return a};w.JS.PolyTreeToExPolygons=function(e){var t=new w.ExPolygons,r,n,i,a;for(n=0,i=e.Childs(),a=i.length;n<a;n++)r=i[n],w.JS.AddOuterPolyNodeToExPolygons(r,t);return t};Sx.exports=w});var GH=ze((M8t,F3)=>{g();(function(){"use strict";function e(u,c){var f=u.x-c.x,m=u.y-c.y;return f*f+m*m}o(e,"getSqDist");function t(u,c,f){var m=c.x,v=c.y,x=f.x-m,I=f.y-v;if(x!==0||I!==0){var C=((u.x-m)*x+(u.y-v)*I)/(x*x+I*I);C>1?(m=f.x,v=f.y):C>0&&(m+=x*C,v+=I*C)}return x=u.x-m,I=u.y-v,x*x+I*I}o(t,"getSqSegDist");function r(u,c){for(var f=u[0],m=[f],v,x=1,I=u.length;x<I;x++)v=u[x],e(v,f)>c&&(m.push(v),f=v);return f!==v&&m.push(v),m}o(r,"simplifyRadialDist");function n(u,c,f,m,v){for(var x=m,I,C=c+1;C<f;C++){var T=t(u[C],u[c],u[f]);T>x&&(I=C,x=T)}x>m&&(I-c>1&&n(u,c,I,m,v),v.push(u[I]),f-I>1&&n(u,I,f,m,v))}o(n,"simplifyDPStep");function i(u,c){var f=u.length-1,m=[u[0]];return n(u,0,f,c,m),m.push(u[f]),m}o(i,"simplifyDouglasPeucker");function a(u,c,f){if(u.length<=2)return u;var m=c!==void 0?c*c:1;return u=f?u:r(u,m),u=i(u,m),u}o(a,"simplify"),typeof define=="function"&&define.amd?define(function(){return a}):typeof F3<"u"?(F3.exports=a,F3.exports.default=a):typeof self<"u"?self.simplify=a:window.simplify=a})()});g();g();var ww=class ww{constructor(t){b(this,"id");this.id=t}};o(ww,"BaseMetaData");var ho=ww;g();g();var zd=class zd{constructor(t,r,n){b(this,"__type",zd.__type);b(this,"id",an());b(this,"latitude");b(this,"longitude");b(this,"floorId");b(this,"verticalOffset");var i;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(i=t.verticalOffset)!=null?i:0;else{if(r==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=r,this.floorId=n,this.verticalOffset=0}}static is(t){return t.__type===zd.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{__type:zd.__type,latitude:this.latitude,longitude:this.longitude,floorId:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};o(zd,"Coordinate"),b(zd,"__type","coordinate");var Pw=zd,bt=Pw;g();g();g();function Si(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return e.geometry.coordinates;if(e.type==="Point")return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}o(Si,"getCoord");function Ln(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}o(Ln,"getCoords");function Tw(e,t,r){if(!e)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!e||e.type!=="Feature"||!e.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!e.geometry||e.geometry.type!==t)throw new Error("Invalid input to "+r+": must be a "+t+", given "+e.geometry.type)}o(Tw,"featureOf");function io(e){return e.type==="Feature"?e.geometry:e}o(io,"getGeom");function Da(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}o(Da,"getType");var yq=Mn(UI(),1);g();var Tq=Mn(MD(),1);g();g();function ti(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=Si(e),i=io(t),a=i.type,u=t.bbox,c=i.coordinates;if(u&&Eq(n,u)===!1)return!1;a==="Polygon"&&(c=[c]);for(var f=!1,m=0;m<c.length&&!f;m++)if(OD(n,c[m][0],r.ignoreBoundary)){for(var v=!1,x=1;x<c[m].length&&!v;)OD(n,c[m][x],!r.ignoreBoundary)&&(v=!0),x++;v||(f=!0)}return f}o(ti,"booleanPointInPolygon");function OD(e,t,r){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var i=0,a=t.length-1;i<t.length;a=i++){var u=t[i][0],c=t[i][1],f=t[a][0],m=t[a][1],v=e[1]*(u-f)+c*(f-e[0])+m*(e[0]-u)===0&&(u-e[0])*(f-e[0])<=0&&(c-e[1])*(m-e[1])<=0;if(v)return!r;var x=c>e[1]!=m>e[1]&&e[0]<(f-u)*(e[1]-c)/(m-c)+u;x&&(n=!n)}return n}o(OD,"inRing");function Eq(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}o(Eq,"inBBox");g();g();function Mq(e,t,r){r===void 0&&(r={});var n=Si(e),i=Si(t),a=ko(i[1]-n[1]),u=ko(i[0]-n[0]),c=ko(n[1]),f=ko(i[1]),m=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(u/2),2)*Math.cos(c)*Math.cos(f);return LI(2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m)),r.units)}o(Mq,"distance");var di=Mq;g();var xxe=function(){function e(t,r,n){this.a=t,this.b=r,this.c=n;var i=r.x-t.x,a=r.y-t.y,u=n.x-t.x,c=n.y-t.y,f=i*(t.x+r.x)+a*(t.y+r.y),m=u*(t.x+n.x)+c*(t.y+n.y),v=2*(i*(n.y-r.y)-a*(n.x-r.x)),x,I;this.x=(c*f-a*m)/v,this.y=(i*m-u*f)/v,x=this.x-t.x,I=this.y-t.y,this.r=x*x+I*I}return o(e,"Triangle"),e}();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();var DD=new ArrayBuffer(16),aIe=new Float64Array(DD),lIe=new Uint32Array(DD);g();g();g();g();g();g();var $q=Mn($w(),1);g();g();g();g();g();var ySe=function(){function e(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var r=0;r<this.length;r++)this.points[r].z=this.points[r].z||0;for(var r=0;r<this.length-1;r++){var n=this.points[r],i=this.points[r+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 r=0;r<this.centers.length-1;r++){var a=this.points[r+1].x-(this.centers[r].x+this.centers[r+1].x)/2,u=this.points[r+1].y-(this.centers[r].y+this.centers[r+1].y)/2,c=this.points[r+1].z-(this.centers[r].y+this.centers[r+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r].x+a),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r].y+u),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r].z+c)},{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r+1].x+a),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r+1].y+u),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r+1].z+c)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return o(e,"Spline"),e.prototype.cacheSteps=function(t){var r=[],n=this.pos(0);r.push(0);for(var i=0;i<this.duration;i+=10){var a=this.pos(i),u=Math.sqrt((a.x-n.x)*(a.x-n.x)+(a.y-n.y)*(a.y-n.y)+(a.z-n.z)*(a.z-n.z));u>t&&(r.push(i),n=a)}return r},e.prototype.vector=function(t){var r=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(r.y-n.y,r.x-n.x)/3.14,speed:Math.sqrt((n.x-r.x)*(n.x-r.x)+(n.y-r.y)*(n.y-r.y)+(n.z-r.z)*(n.z-r.z))}},e.prototype.pos=function(t){var r=t-this.delay;r<0&&(r=0),r>this.duration&&(r=this.duration-1);var n=r/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 Hq(a,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},e}();function Hq(e,t,r,n,i){var a=Wq(e),u={x:i.x*a[0]+n.x*a[1]+r.x*a[2]+t.x*a[3],y:i.y*a[0]+n.y*a[1]+r.y*a[2]+t.y*a[3],z:i.z*a[0]+n.z*a[1]+r.z*a[2]+t.z*a[3]};return u}o(Hq,"bezier");function Wq(e){var t=e*e,r=t*e;return[r,3*t*(1-e),3*e*(1-e)*(1-e),(1-e)*(1-e)*(1-e)]}o(Wq,"B");g();g();g();g();function S1(e,t){t===void 0&&(t={});var r=Number(e[0]),n=Number(e[1]),i=Number(e[2]),a=Number(e[3]);if(e.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var u=[r,n],c=[r,a],f=[i,a],m=[i,n];return On([[u,m,f,c,u]],t.properties,{bbox:e,id:t.id})}o(S1,"bboxPolygon");function qq(e){return S1(no(e))}o(qq,"envelope");var Hw=qq;g();g();g();function Aa(e,t,r,n){n===void 0&&(n={});var i=Si(e),a=ko(i[0]),u=ko(i[1]),c=ko(r),f=DI(t,n.units),m=Math.asin(Math.sin(u)*Math.cos(f)+Math.cos(u)*Math.sin(f)*Math.cos(c)),v=a+Math.atan2(Math.sin(c)*Math.sin(f)*Math.cos(u),Math.cos(f)-Math.sin(u)*Math.sin(m)),x=Ud(v),I=Ud(m);return yn([x,I],n.properties)}o(Aa,"destination");g();g();function Jc(e,t,r){if(r===void 0&&(r={}),r.final===!0)return Yq(e,t);var n=Si(e),i=Si(t),a=ko(n[0]),u=ko(i[0]),c=ko(n[1]),f=ko(i[1]),m=Math.sin(u-a)*Math.cos(f),v=Math.cos(c)*Math.sin(f)-Math.sin(c)*Math.cos(f)*Math.cos(u-a);return Ud(Math.atan2(m,v))}o(Jc,"bearing");function Yq(e,t){var r=Jc(t,e);return r=(r+180)%360,r}o(Yq,"calculateFinalBearing");g();function Xq(e,t){t===void 0&&(t={});var r=no(e),n=(r[0]+r[2])/2,i=(r[1]+r[3])/2;return yn([n,i],t.properties,t)}o(Xq,"center");var qu=Xq;g();g();g();g();g();var fY=Mn(VD(),1);g();g();g();g();function dY(e){if(!e)throw new Error("geojson is required");var t=[];return fo(e,function(r){hY(r,t)}),Xt(t)}o(dY,"lineSegment");function hY(e,t){var r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=Ln(n);break;case"LineString":r=[Ln(n)]}r.forEach(function(i){var a=mY(i,e.properties);a.forEach(function(u){u.id=t.length,t.push(u)})})}}o(hY,"lineSegmentFeature");function mY(e,t){var r=[];return e.reduce(function(n,i){var a=Li([n,i],t);return a.bbox=gY(n,i),r.push(a),i}),r}o(mY,"createSegments");function gY(e,t){var r=e[0],n=e[1],i=t[0],a=t[1],u=r<i?r:i,c=n<a?n:a,f=r>i?r:i,m=n>a?n:a;return[u,c,f,m]}o(gY,"bbox");var Wd=dY;var iA=Mn(n2(),1);function zY(e,t){var r={},n=[];if(e.type==="LineString"&&(e=Hu(e)),t.type==="LineString"&&(t=Hu(t)),e.type==="Feature"&&t.type==="Feature"&&e.geometry!==null&&t.geometry!==null&&e.geometry.type==="LineString"&&t.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var i=nA(e,t);return i&&n.push(i),Xt(n)}var a=(0,iA.default)();return a.load(Wd(t)),Wn(Wd(e),function(u){Wn(a.search(u),function(c){var f=nA(u,c);if(f){var m=Ln(f).join(",");r[m]||(r[m]=!0,n.push(f))}})}),Xt(n)}o(zY,"lineIntersect");function nA(e,t){var r=Ln(e),n=Ln(t);if(r.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=r[0][0],a=r[0][1],u=r[1][0],c=r[1][1],f=n[0][0],m=n[0][1],v=n[1][0],x=n[1][1],I=(x-m)*(u-i)-(v-f)*(c-a),C=(v-f)*(a-m)-(x-m)*(i-f),T=(u-i)*(a-m)-(c-a)*(i-f);if(I===0)return null;var O=C/I,P=T/I;if(O>=0&&O<=1&&P>=0&&P<=1){var L=i+O*(u-i),A=a+O*(c-a);return yn([L,A])}return null}o(nA,"intersects");var Xu=zY;function $Y(e,t,r){r===void 0&&(r={});var n=yn([1/0,1/0],{dist:1/0}),i=0;return fo(e,function(a){for(var u=Ln(a),c=0;c<u.length-1;c++){var f=yn(u[c]);f.properties.dist=di(t,f,r);var m=yn(u[c+1]);m.properties.dist=di(t,m,r);var v=di(f,m,r),x=Math.max(f.properties.dist,m.properties.dist),I=Jc(f,m),C=Aa(t,x,I+90,r),T=Aa(t,x,I-90,r),O=Xu(Li([C.geometry.coordinates,T.geometry.coordinates]),Li([f.geometry.coordinates,m.geometry.coordinates])),P=null;O.features.length>0&&(P=O.features[0],P.properties.dist=di(t,P,r),P.properties.location=i+di(f,P,r)),f.properties.dist<n.properties.dist&&(n=f,n.properties.index=c,n.properties.location=i),m.properties.dist<n.properties.dist&&(n=m,n.properties.index=c+1,n.properties.location=i+v),P&&P.properties.dist<n.properties.dist&&(n=P,n.properties.index=c),i+=v}}),n}o($Y,"nearestPointOnLine");var Qc=$Y;g();g();g();var WY=Mn(UI(),1);g();g();g();g();g();g();function qd(e,t){return t===void 0&&(t={}),Y7(e,function(r,n){var i=n.geometry.coordinates;return r+di(i[0],i[1],t)},0)}o(qd,"length");g();function qY(e,t,r){var n=Ln(r);if(Da(r)!=="LineString")throw new Error("line must be a LineString");var i=Qc(r,e),a=Qc(r,t),u;i.properties.index<=a.properties.index?u=[i,a]:u=[a,i];for(var c=[u[0].geometry.coordinates],f=u[0].properties.index+1;f<u[1].properties.index+1;f++)c.push(n[f]);return c.push(u[1].geometry.coordinates),Li(c,r.properties)}o(qY,"lineSlice");var o2=qY;g();g();g();g();function YY(e,t,r){r===void 0&&(r={});for(var n=Si(e),i=Ln(t),a=0;a<i.length-1;a++){var u=!1;if(r.ignoreEndVertices&&(a===0&&(u="start"),a===i.length-2&&(u="end"),a===0&&a+1===i.length-1&&(u="both")),XY(i[a],i[a+1],n,u,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}o(YY,"booleanPointOnLine");function XY(e,t,r,n,i){var a=r[0],u=r[1],c=e[0],f=e[1],m=t[0],v=t[1],x=r[0]-c,I=r[1]-f,C=m-c,T=v-f,O=x*T-I*C;if(i!==null){if(Math.abs(O)>i)return!1}else if(O!==0)return!1;if(n){if(n==="start")return Math.abs(C)>=Math.abs(T)?C>0?c<a&&a<=m:m<=a&&a<c:T>0?f<u&&u<=v:v<=u&&u<f;if(n==="end")return Math.abs(C)>=Math.abs(T)?C>0?c<=a&&a<m:m<a&&a<=c:T>0?f<=u&&u<v:v<u&&u<=f;if(n==="both")return Math.abs(C)>=Math.abs(T)?C>0?c<a&&a<m:m<a&&a<c:T>0?f<u&&u<v:v<u&&u<f}else return Math.abs(C)>=Math.abs(T)?C>0?c<=a&&a<=m:m<=a&&a<=c:T>0?f<=u&&u<=v:v<=u&&u<=f;return!1}o(XY,"isPointOnLineSegment");var wg=YY;g();g();g();g();var JY=Mn($w(),1);g();var lA=Math.PI/180,uA=180/Math.PI,T1=o(function(e,t){this.lon=e,this.lat=t,this.x=lA*e,this.y=lA*t},"Coord");T1.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};T1.prototype.antipode=function(){var e=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new T1(t,e)};var cA=o(function(){this.coords=[],this.length=0},"LineString");cA.prototype.move_to=function(e){this.length++,this.coords.push(e)};var uP=o(function(e){this.properties=e||{},this.geometries=[]},"Arc");uP.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 e=[],t=0;t<this.geometries.length;t++)e.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:e},type:"Feature",properties:this.properties}};uP.prototype.wkt=function(){for(var e="",t="LINESTRING(",r=o(function(a){t+=a[0]+" "+a[1]+","},"collect"),n=0;n<this.geometries.length;n++){if(this.geometries[n].coords.length===0)return"LINESTRING(empty)";var i=this.geometries[n].coords;i.forEach(r),e+=t.substring(0,t.length-1)+")"}return e};var pA=o(function(e,t,r){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");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new T1(e.x,e.y),this.end=new T1(t.x,t.y),this.properties=r||{};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 "+e.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+e+" and "+t)},"GreatCircle");pA.prototype.interpolate=function(e){var t=Math.sin((1-e)*this.g)/Math.sin(this.g),r=Math.sin(e*this.g)/Math.sin(this.g),n=t*Math.cos(this.start.y)*Math.cos(this.start.x)+r*Math.cos(this.end.y)*Math.cos(this.end.x),i=t*Math.cos(this.start.y)*Math.sin(this.start.x)+r*Math.cos(this.end.y)*Math.sin(this.end.x),a=t*Math.sin(this.start.y)+r*Math.sin(this.end.y),u=uA*Math.atan2(a,Math.sqrt(Math.pow(n,2)+Math.pow(i,2))),c=uA*Math.atan2(i,n);return[c,u]};pA.prototype.Arc=function(e,t){var r=[];if(!e||e<=2)r.push([this.start.lon,this.start.lat]),r.push([this.end.lon,this.end.lat]);else for(var n=1/(e-1),i=0;i<e;++i){var a=n*i,u=this.interpolate(a);r.push(u)}for(var c=!1,f=0,m=t&&t.offset?t.offset:10,v=180-m,x=-180+m,I=360-m,C=1;C<r.length;++C){var T=r[C-1][0],O=r[C][0],P=Math.abs(O-T);P>I&&(O>v&&T<x||T>v&&O<x)?c=!0:P>f&&(f=P)}var L=[];if(c&&f<m){var A=[];L.push(A);for(var M=0;M<r.length;++M){var N=parseFloat(r[M][0]);if(M>0&&Math.abs(N-r[M-1][0])>I){var B=parseFloat(r[M-1][0]),H=parseFloat(r[M-1][1]),z=parseFloat(r[M][0]),R=parseFloat(r[M][1]);if(B>-180&&B<x&&z===180&&M+1<r.length&&r[M-1][0]>-180&&r[M-1][0]<x){A.push([-180,r[M][1]]),M++,A.push([r[M][0],r[M][1]]);continue}else if(B>v&&B<180&&z===-180&&M+1<r.length&&r[M-1][0]>v&&r[M-1][0]<180){A.push([180,r[M][1]]),M++,A.push([r[M][0],r[M][1]]);continue}if(B<x&&z>v){var X=B;B=z,z=X;var ie=H;H=R,R=ie}if(B>v&&z<x&&(z+=360),B<=180&&z>=180&&B<z){var Q=(180-B)/(z-B),U=Q*R+(1-Q)*H;A.push([r[M-1][0]>v?180:-180,U]),A=[],A.push([r[M-1][0]>v?-180:180,U]),L.push(A)}else A=[],L.push(A);A.push([N,r[M][1]])}else A.push([r[M][0],r[M][1]])}}else{var Te=[];L.push(Te);for(var oe=0;oe<r.length;++oe)Te.push([r[oe][0],r[oe][1]])}for(var fe=new uP(this.properties),se=0;se<L.length;++se){var ve=new cA;fe.geometries.push(ve);for(var ue=L[se],he=0;he<ue.length;++he)ve.move_to(ue[he])}return fe};g();var tX=Mn(n2(),1);g();g();function Yd(e,t){t===void 0&&(t={});var r=io(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return dA(r,t);case"MultiPolygon":return rX(r,t);default:throw new Error("invalid poly")}}o(Yd,"default");function dA(e,t){t===void 0&&(t={});var r=io(e),n=r.coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{};return hA(n,i)}o(dA,"polygonToLine");function rX(e,t){t===void 0&&(t={});var r=io(e),n=r.coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{},a=[];return n.forEach(function(u){a.push(hA(u,i))}),Xt(a)}o(rX,"multiPolygonToLine");function hA(e,t){return e.length>1?pg(e,t):Li(e[0],t)}o(hA,"coordsToLine");g();g();g();g();var tK=Mn(n2(),1);var rK=Mn(kP(),1);g();g();g();g();g();g();g();var oK=Mn(UI(),1);var Zt=[],Kt=[],Jt=[],Qt=[],er=[],tr=[],rr=[],nr=[],or=[],sr=[],ar=[],lr=[],ur=[],cr=[],pr=[],fr=[],dr=[],hr=[],mr=[],gr=[],yr=[],vr=[],xr=[],br=[];rr[85]=sr[85]=-1;nr[85]=ar[85]=0;or[85]=lr[85]=1;mr[85]=vr[85]=1;gr[85]=xr[85]=0;yr[85]=br[85]=1;Zt[85]=Qt[85]=0;Kt[85]=er[85]=-1;Jt[85]=pr[85]=0;fr[85]=ur[85]=0;dr[85]=cr[85]=1;tr[85]=hr[85]=1;vr[1]=vr[169]=0;xr[1]=xr[169]=-1;br[1]=br[169]=0;ur[1]=ur[169]=-1;cr[1]=cr[169]=0;pr[1]=pr[169]=0;sr[4]=sr[166]=0;ar[4]=ar[166]=-1;lr[4]=lr[166]=1;fr[4]=fr[166]=1;dr[4]=dr[166]=0;hr[4]=hr[166]=0;rr[16]=rr[154]=0;nr[16]=nr[154]=1;or[16]=or[154]=1;Qt[16]=Qt[154]=1;er[16]=er[154]=0;tr[16]=tr[154]=1;mr[64]=mr[106]=0;gr[64]=gr[106]=1;yr[64]=yr[106]=0;Zt[64]=Zt[106]=-1;Kt[64]=Kt[106]=0;Jt[64]=Jt[106]=1;mr[2]=mr[168]=0;gr[2]=gr[168]=-1;yr[2]=yr[168]=1;vr[2]=vr[168]=0;xr[2]=xr[168]=-1;br[2]=br[168]=0;ur[2]=ur[168]=-1;cr[2]=cr[168]=0;pr[2]=pr[168]=0;fr[2]=fr[168]=-1;dr[2]=dr[168]=0;hr[2]=hr[168]=1;rr[8]=rr[162]=0;nr[8]=nr[162]=-1;or[8]=or[162]=0;sr[8]=sr[162]=0;ar[8]=ar[162]=-1;lr[8]=lr[162]=1;ur[8]=ur[162]=1;cr[8]=cr[162]=0;pr[8]=pr[162]=1;fr[8]=fr[162]=1;dr[8]=dr[162]=0;hr[8]=hr[162]=0;rr[32]=rr[138]=0;nr[32]=nr[138]=1;or[32]=or[138]=1;sr[32]=sr[138]=0;ar[32]=ar[138]=1;lr[32]=lr[138]=0;Zt[32]=Zt[138]=1;Kt[32]=Kt[138]=0;Jt[32]=Jt[138]=0;Qt[32]=Qt[138]=1;er[32]=er[138]=0;tr[32]=tr[138]=1;vr[128]=vr[42]=0;xr[128]=xr[42]=1;br[128]=br[42]=1;mr[128]=mr[42]=0;gr[128]=gr[42]=1;yr[128]=yr[42]=0;Zt[128]=Zt[42]=-1;Kt[128]=Kt[42]=0;Jt[128]=Jt[42]=1;Qt[128]=Qt[42]=-1;er[128]=er[42]=0;tr[128]=tr[42]=0;sr[5]=sr[165]=-1;ar[5]=ar[165]=0;lr[5]=lr[165]=0;vr[5]=vr[165]=1;xr[5]=xr[165]=0;br[5]=br[165]=0;fr[20]=fr[150]=0;dr[20]=dr[150]=1;hr[20]=hr[150]=1;Qt[20]=Qt[150]=0;er[20]=er[150]=-1;tr[20]=tr[150]=1;rr[80]=rr[90]=-1;nr[80]=nr[90]=0;or[80]=or[90]=1;mr[80]=mr[90]=1;gr[80]=gr[90]=0;yr[80]=yr[90]=1;ur[65]=ur[105]=0;cr[65]=cr[105]=1;pr[65]=pr[105]=0;Zt[65]=Zt[105]=0;Kt[65]=Kt[105]=-1;Jt[65]=Jt[105]=0;rr[160]=rr[10]=-1;nr[160]=nr[10]=0;or[160]=or[10]=1;sr[160]=sr[10]=-1;ar[160]=ar[10]=0;lr[160]=lr[10]=0;vr[160]=vr[10]=1;xr[160]=xr[10]=0;br[160]=br[10]=0;mr[160]=mr[10]=1;gr[160]=gr[10]=0;yr[160]=yr[10]=1;fr[130]=fr[40]=0;dr[130]=dr[40]=1;hr[130]=hr[40]=1;ur[130]=ur[40]=0;cr[130]=cr[40]=1;pr[130]=pr[40]=0;Zt[130]=Zt[40]=0;Kt[130]=Kt[40]=-1;Jt[130]=Jt[40]=0;Qt[130]=Qt[40]=0;er[130]=er[40]=-1;tr[130]=tr[40]=1;sr[37]=sr[133]=0;ar[37]=ar[133]=1;lr[37]=lr[133]=1;vr[37]=vr[133]=0;xr[37]=xr[133]=1;br[37]=br[133]=0;Zt[37]=Zt[133]=-1;Kt[37]=Kt[133]=0;Jt[37]=Jt[133]=0;Qt[37]=Qt[133]=1;er[37]=er[133]=0;tr[37]=tr[133]=0;fr[148]=fr[22]=-1;dr[148]=dr[22]=0;hr[148]=hr[22]=0;vr[148]=vr[22]=0;xr[148]=xr[22]=-1;br[148]=br[22]=1;mr[148]=mr[22]=0;gr[148]=gr[22]=1;yr[148]=yr[22]=1;Qt[148]=Qt[22]=-1;er[148]=er[22]=0;tr[148]=tr[22]=1;rr[82]=rr[88]=0;nr[82]=nr[88]=-1;or[82]=or[88]=1;fr[82]=fr[88]=1;dr[82]=dr[88]=0;hr[82]=hr[88]=1;ur[82]=ur[88]=-1;cr[82]=cr[88]=0;pr[82]=pr[88]=1;mr[82]=mr[88]=0;gr[82]=gr[88]=-1;yr[82]=yr[88]=0;rr[73]=rr[97]=0;nr[73]=nr[97]=1;or[73]=or[97]=0;sr[73]=sr[97]=0;ar[73]=ar[97]=-1;lr[73]=lr[97]=0;ur[73]=ur[97]=1;cr[73]=cr[97]=0;pr[73]=pr[97]=0;Zt[73]=Zt[97]=1;Kt[73]=Kt[97]=0;Jt[73]=Jt[97]=1;rr[145]=rr[25]=0;nr[145]=nr[25]=-1;or[145]=or[25]=0;ur[145]=ur[25]=1;cr[145]=cr[25]=0;pr[145]=pr[25]=1;vr[145]=vr[25]=0;xr[145]=xr[25]=1;br[145]=br[25]=1;Qt[145]=Qt[25]=-1;er[145]=er[25]=0;tr[145]=tr[25]=0;sr[70]=sr[100]=0;ar[70]=ar[100]=1;lr[70]=lr[100]=0;fr[70]=fr[100]=-1;dr[70]=dr[100]=0;hr[70]=hr[100]=1;mr[70]=mr[100]=0;gr[70]=gr[100]=-1;yr[70]=yr[100]=1;Zt[70]=Zt[100]=1;Kt[70]=Kt[100]=0;Jt[70]=Jt[100]=0;sr[101]=sr[69]=0;ar[101]=ar[69]=1;lr[101]=lr[69]=0;Zt[101]=Zt[69]=1;Kt[101]=Kt[69]=0;Jt[101]=Jt[69]=0;vr[149]=vr[21]=0;xr[149]=xr[21]=1;br[149]=br[21]=1;Qt[149]=Qt[21]=-1;er[149]=er[21]=0;tr[149]=tr[21]=0;fr[86]=fr[84]=-1;dr[86]=dr[84]=0;hr[86]=hr[84]=1;mr[86]=mr[84]=0;gr[86]=gr[84]=-1;yr[86]=yr[84]=1;rr[89]=rr[81]=0;nr[89]=nr[81]=-1;or[89]=or[81]=0;ur[89]=ur[81]=1;cr[89]=cr[81]=0;pr[89]=pr[81]=1;rr[96]=rr[74]=0;nr[96]=nr[74]=1;or[96]=or[74]=0;sr[96]=sr[74]=-1;ar[96]=ar[74]=0;lr[96]=lr[74]=1;mr[96]=mr[74]=1;gr[96]=gr[74]=0;yr[96]=yr[74]=0;Zt[96]=Zt[74]=1;Kt[96]=Kt[74]=0;Jt[96]=Jt[74]=1;rr[24]=rr[146]=0;nr[24]=nr[146]=-1;or[24]=or[146]=1;fr[24]=fr[146]=1;dr[24]=dr[146]=0;hr[24]=hr[146]=1;ur[24]=ur[146]=0;cr[24]=cr[146]=1;pr[24]=pr[146]=1;Qt[24]=Qt[146]=0;er[24]=er[146]=-1;tr[24]=tr[146]=0;sr[6]=sr[164]=-1;ar[6]=ar[164]=0;lr[6]=lr[164]=1;fr[6]=fr[164]=-1;dr[6]=dr[164]=0;hr[6]=hr[164]=0;vr[6]=vr[164]=0;xr[6]=xr[164]=-1;br[6]=br[164]=1;mr[6]=mr[164]=1;gr[6]=gr[164]=0;yr[6]=yr[164]=0;ur[129]=ur[41]=0;cr[129]=cr[41]=1;pr[129]=pr[41]=1;vr[129]=vr[41]=0;xr[129]=xr[41]=1;br[129]=br[41]=0;Zt[129]=Zt[41]=-1;Kt[129]=Kt[41]=0;Jt[129]=Jt[41]=0;Qt[129]=Qt[41]=0;er[129]=er[41]=-1;tr[129]=tr[41]=0;fr[66]=fr[104]=0;dr[66]=dr[104]=1;hr[66]=hr[104]=0;ur[66]=ur[104]=-1;cr[66]=cr[104]=0;pr[66]=pr[104]=1;mr[66]=mr[104]=0;gr[66]=gr[104]=-1;yr[66]=yr[104]=0;Zt[66]=Zt[104]=0;Kt[66]=Kt[104]=-1;Jt[66]=Jt[104]=1;rr[144]=rr[26]=-1;nr[144]=nr[26]=0;or[144]=or[26]=0;vr[144]=vr[26]=1;xr[144]=xr[26]=0;br[144]=br[26]=1;mr[144]=mr[26]=0;gr[144]=gr[26]=1;yr[144]=yr[26]=1;Qt[144]=Qt[26]=-1;er[144]=er[26]=0;tr[144]=tr[26]=1;sr[36]=sr[134]=0;ar[36]=ar[134]=1;lr[36]=lr[134]=1;fr[36]=fr[134]=0;dr[36]=dr[134]=1;hr[36]=hr[134]=0;Zt[36]=Zt[134]=0;Kt[36]=Kt[134]=-1;Jt[36]=Jt[134]=1;Qt[36]=Qt[134]=1;er[36]=er[134]=0;tr[36]=tr[134]=0;rr[9]=rr[161]=-1;nr[9]=nr[161]=0;or[9]=or[161]=0;sr[9]=sr[161]=0;ar[9]=ar[161]=-1;lr[9]=lr[161]=0;ur[9]=ur[161]=1;cr[9]=cr[161]=0;pr[9]=pr[161]=0;vr[9]=vr[161]=1;xr[9]=xr[161]=0;br[9]=br[161]=1;rr[136]=0;nr[136]=1;or[136]=1;sr[136]=0;ar[136]=1;lr[136]=0;fr[136]=-1;dr[136]=0;hr[136]=1;ur[136]=-1;cr[136]=0;pr[136]=0;vr[136]=0;xr[136]=-1;br[136]=0;mr[136]=0;gr[136]=-1;yr[136]=1;Zt[136]=1;Kt[136]=0;Jt[136]=0;Qt[136]=1;er[136]=0;tr[136]=1;rr[34]=0;nr[34]=-1;or[34]=0;sr[34]=0;ar[34]=-1;lr[34]=1;fr[34]=1;dr[34]=0;hr[34]=0;ur[34]=1;cr[34]=0;pr[34]=1;vr[34]=0;xr[34]=1;br[34]=1;mr[34]=0;gr[34]=1;yr[34]=0;Zt[34]=-1;Kt[34]=0;Jt[34]=1;Qt[34]=-1;er[34]=0;tr[34]=0;rr[35]=0;nr[35]=1;or[35]=1;sr[35]=0;ar[35]=-1;lr[35]=1;fr[35]=1;dr[35]=0;hr[35]=0;ur[35]=-1;cr[35]=0;pr[35]=0;vr[35]=0;xr[35]=-1;br[35]=0;mr[35]=0;gr[35]=1;yr[35]=0;Zt[35]=-1;Kt[35]=0;Jt[35]=1;Qt[35]=1;er[35]=0;tr[35]=1;rr[153]=0;nr[153]=1;or[153]=1;ur[153]=-1;cr[153]=0;pr[153]=0;vr[153]=0;xr[153]=-1;br[153]=0;Qt[153]=1;er[153]=0;tr[153]=1;sr[102]=0;ar[102]=-1;lr[102]=1;fr[102]=1;dr[102]=0;hr[102]=0;mr[102]=0;gr[102]=1;yr[102]=0;Zt[102]=-1;Kt[102]=0;Jt[102]=1;rr[155]=0;nr[155]=-1;or[155]=0;ur[155]=1;cr[155]=0;pr[155]=1;vr[155]=0;xr[155]=1;br[155]=1;Qt[155]=-1;er[155]=0;tr[155]=0;sr[103]=0;ar[103]=1;lr[103]=0;fr[103]=-1;dr[103]=0;hr[103]=1;mr[103]=0;gr[103]=-1;yr[103]=1;Zt[103]=1;Kt[103]=0;Jt[103]=0;rr[152]=0;nr[152]=1;or[152]=1;fr[152]=-1;dr[152]=0;hr[152]=1;ur[152]=-1;cr[152]=0;pr[152]=0;vr[152]=0;xr[152]=-1;br[152]=0;mr[152]=0;gr[152]=-1;yr[152]=1;Qt[152]=1;er[152]=0;tr[152]=1;rr[156]=0;nr[156]=-1;or[156]=1;fr[156]=1;dr[156]=0;hr[156]=1;ur[156]=-1;cr[156]=0;pr[156]=0;vr[156]=0;xr[156]=-1;br[156]=0;mr[156]=0;gr[156]=1;yr[156]=1;Qt[156]=-1;er[156]=0;tr[156]=1;rr[137]=0;nr[137]=1;or[137]=1;sr[137]=0;ar[137]=1;lr[137]=0;ur[137]=-1;cr[137]=0;pr[137]=0;vr[137]=0;xr[137]=-1;br[137]=0;Zt[137]=1;Kt[137]=0;Jt[137]=0;Qt[137]=1;er[137]=0;tr[137]=1;rr[139]=0;nr[139]=1;or[139]=1;sr[139]=0;ar[139]=-1;lr[139]=0;ur[139]=1;cr[139]=0;pr[139]=0;vr[139]=0;xr[139]=1;br[139]=0;Zt[139]=-1;Kt[139]=0;Jt[139]=0;Qt[139]=1;er[139]=0;tr[139]=1;rr[98]=0;nr[98]=-1;or[98]=0;sr[98]=0;ar[98]=-1;lr[98]=1;fr[98]=1;dr[98]=0;hr[98]=0;ur[98]=1;cr[98]=0;pr[98]=1;mr[98]=0;gr[98]=1;yr[98]=0;Zt[98]=-1;Kt[98]=0;Jt[98]=1;rr[99]=0;nr[99]=1;or[99]=0;sr[99]=0;ar[99]=-1;lr[99]=1;fr[99]=1;dr[99]=0;hr[99]=0;ur[99]=-1;cr[99]=0;pr[99]=1;mr[99]=0;gr[99]=-1;yr[99]=0;Zt[99]=1;Kt[99]=0;Jt[99]=1;sr[38]=0;ar[38]=-1;lr[38]=1;fr[38]=1;dr[38]=0;hr[38]=0;vr[38]=0;xr[38]=1;br[38]=1;mr[38]=0;gr[38]=1;yr[38]=0;Zt[38]=-1;Kt[38]=0;Jt[38]=1;Qt[38]=-1;er[38]=0;tr[38]=0;sr[39]=0;ar[39]=1;lr[39]=1;fr[39]=-1;dr[39]=0;hr[39]=0;vr[39]=0;xr[39]=-1;br[39]=1;mr[39]=0;gr[39]=1;yr[39]=0;Zt[39]=-1;Kt[39]=0;Jt[39]=1;Qt[39]=1;er[39]=0;tr[39]=0;var BP=o(function(e){return[[e.bottomleft,0],[0,0],[0,e.leftbottom]]},"p00"),GP=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0]]},"p01"),jP=o(function(e){return[[e.topright,1],[1,1],[1,e.righttop]]},"p02"),UP=o(function(e){return[[0,e.lefttop],[0,1],[e.topleft,1]]},"p03"),VP=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop]]},"p04"),zP=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[1,e.righttop],[1,e.rightbottom]]},"p05"),$P=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.topleft,1],[e.topright,1]]},"p06"),HP=o(function(e){return[[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},"p07"),sK=o(function(e){return[[0,0],[0,e.leftbottom],[1,e.rightbottom],[1,0]]},"p08"),aK=o(function(e){return[[1,0],[e.bottomright,0],[e.topright,1],[1,1]]},"p09"),lK=o(function(e){return[[1,1],[1,e.righttop],[0,e.lefttop],[0,1]]},"p10"),uK=o(function(e){return[[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},"p11"),cK=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.leftbottom],[0,e.lefttop]]},"p12"),pK=o(function(e){return[[e.topleft,1],[e.topright,1],[e.bottomright,0],[e.bottomleft,0]]},"p13"),fK=o(function(){return[[0,0],[0,1],[1,1],[1,0]]},"p14"),dK=o(function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,1],[e.topleft,1]]},"p15"),hK=o(function(e){return[[e.topright,1],[1,1],[1,0],[0,0],[0,e.leftbottom]]},"p16"),mK=o(function(e){return[[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[1,1]]},"p17"),gK=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,1]]},"p18"),yK=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.lefttop],[0,1],[e.topleft,1]]},"p19"),vK=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[e.topright,1]]},"p20"),xK=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop]]},"p21"),bK=o(function(e){return[[e.topright,1],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1]]},"p22"),IK=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p23"),SK=o(function(e){return[[1,1],[1,e.righttop],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p24"),_K=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[e.topleft,1],[e.topright,1]]},"p25"),CK=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom]]},"p26"),wK=o(function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},"p27"),PK=o(function(e){return[[1,1],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p28"),TK=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1]]},"p29"),EK=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},"p30"),MK=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},"p31"),OK=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p32"),LK=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},"p33"),DK=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},"p34"),AK=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p35"),FK=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p36"),NK=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},"p37"),RK=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p38"),kK=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},"p39"),Tr=[],Er=[],Mr=[],Or=[],Lr=[],Dr=[],Ar=[],Fr=[];Or[1]=Lr[1]=18;Or[169]=Lr[169]=18;Mr[4]=Er[4]=12;Mr[166]=Er[166]=12;Tr[16]=Fr[16]=4;Tr[154]=Fr[154]=4;Dr[64]=Ar[64]=22;Dr[106]=Ar[106]=22;Mr[2]=Dr[2]=17;Or[2]=Lr[2]=18;Mr[168]=Dr[168]=17;Or[168]=Lr[168]=18;Tr[8]=Or[8]=9;Er[8]=Mr[8]=12;Tr[162]=Or[162]=9;Er[162]=Mr[162]=12;Tr[32]=Fr[32]=4;Er[32]=Ar[32]=1;Tr[138]=Fr[138]=4;Er[138]=Ar[138]=1;Lr[128]=Fr[128]=21;Dr[128]=Ar[128]=22;Lr[42]=Fr[42]=21;Dr[42]=Ar[42]=22;Er[5]=Lr[5]=14;Er[165]=Lr[165]=14;Mr[20]=Fr[20]=6;Mr[150]=Fr[150]=6;Tr[80]=Dr[80]=11;Tr[90]=Dr[90]=11;Or[65]=Ar[65]=3;Or[105]=Ar[105]=3;Tr[160]=Dr[160]=11;Er[160]=Lr[160]=14;Tr[10]=Dr[10]=11;Er[10]=Lr[10]=14;Mr[130]=Fr[130]=6;Or[130]=Ar[130]=3;Mr[40]=Fr[40]=6;Or[40]=Ar[40]=3;Er[101]=Ar[101]=1;Er[69]=Ar[69]=1;Lr[149]=Fr[149]=21;Lr[21]=Fr[21]=21;Mr[86]=Dr[86]=17;Mr[84]=Dr[84]=17;Tr[89]=Or[89]=9;Tr[81]=Or[81]=9;Tr[96]=Ar[96]=0;Er[96]=Dr[96]=15;Tr[74]=Ar[74]=0;Er[74]=Dr[74]=15;Tr[24]=Mr[24]=8;Or[24]=Fr[24]=7;Tr[146]=Mr[146]=8;Or[146]=Fr[146]=7;Er[6]=Dr[6]=15;Mr[6]=Lr[6]=16;Er[164]=Dr[164]=15;Mr[164]=Lr[164]=16;Or[129]=Fr[129]=7;Lr[129]=Ar[129]=20;Or[41]=Fr[41]=7;Lr[41]=Ar[41]=20;Mr[66]=Ar[66]=2;Or[66]=Dr[66]=19;Mr[104]=Ar[104]=2;Or[104]=Dr[104]=19;Tr[144]=Lr[144]=10;Dr[144]=Fr[144]=23;Tr[26]=Lr[26]=10;Dr[26]=Fr[26]=23;Er[36]=Fr[36]=5;Mr[36]=Ar[36]=2;Er[134]=Fr[134]=5;Mr[134]=Ar[134]=2;Tr[9]=Lr[9]=10;Er[9]=Or[9]=13;Tr[161]=Lr[161]=10;Er[161]=Or[161]=13;Er[37]=Fr[37]=5;Lr[37]=Ar[37]=20;Er[133]=Fr[133]=5;Lr[133]=Ar[133]=20;Mr[148]=Lr[148]=16;Dr[148]=Fr[148]=23;Mr[22]=Lr[22]=16;Dr[22]=Fr[22]=23;Tr[82]=Mr[82]=8;Or[82]=Dr[82]=19;Tr[88]=Mr[88]=8;Or[88]=Dr[88]=19;Tr[73]=Ar[73]=0;Er[73]=Or[73]=13;Tr[97]=Ar[97]=0;Er[97]=Or[97]=13;Tr[145]=Or[145]=9;Lr[145]=Fr[145]=21;Tr[25]=Or[25]=9;Lr[25]=Fr[25]=21;Er[70]=Ar[70]=1;Mr[70]=Dr[70]=17;Er[100]=Ar[100]=1;Mr[100]=Dr[100]=17;Tr[34]=Or[34]=9;Er[34]=Mr[34]=12;Lr[34]=Fr[34]=21;Dr[34]=Ar[34]=22;Tr[136]=Fr[136]=4;Er[136]=Ar[136]=1;Mr[136]=Dr[136]=17;Or[136]=Lr[136]=18;Tr[35]=Fr[35]=4;Er[35]=Mr[35]=12;Or[35]=Lr[35]=18;Dr[35]=Ar[35]=22;Tr[153]=Fr[153]=4;Or[153]=Lr[153]=18;Er[102]=Mr[102]=12;Dr[102]=Ar[102]=22;Tr[155]=Or[155]=9;Lr[155]=Fr[155]=23;Er[103]=Ar[103]=1;Mr[103]=Dr[103]=17;Tr[152]=Fr[152]=4;Mr[152]=Dr[152]=17;Or[152]=Lr[152]=18;Tr[156]=Mr[156]=8;Or[156]=Lr[156]=18;Dr[156]=Fr[156]=23;Tr[137]=Fr[137]=4;Er[137]=Ar[137]=1;Or[137]=Lr[137]=18;Tr[139]=Fr[139]=4;Er[139]=Or[139]=13;Lr[139]=Ar[139]=20;Tr[98]=Or[98]=9;Er[98]=Mr[98]=12;Dr[98]=Ar[98]=22;Tr[99]=Ar[99]=0;Er[99]=Mr[99]=12;Or[99]=Dr[99]=19;Er[38]=Mr[38]=12;Lr[38]=Fr[38]=21;Dr[38]=Ar[38]=22;Er[39]=Fr[39]=5;Mr[39]=Lr[39]=16;Dr[39]=Ar[39]=22;var Ye=[];Ye[1]=Ye[169]=BP;Ye[4]=Ye[166]=GP;Ye[16]=Ye[154]=jP;Ye[64]=Ye[106]=UP;Ye[168]=Ye[2]=VP;Ye[162]=Ye[8]=zP;Ye[138]=Ye[32]=$P;Ye[42]=Ye[128]=HP;Ye[5]=Ye[165]=sK;Ye[20]=Ye[150]=aK;Ye[80]=Ye[90]=lK;Ye[65]=Ye[105]=uK;Ye[160]=Ye[10]=cK;Ye[130]=Ye[40]=pK;Ye[85]=fK;Ye[101]=Ye[69]=dK;Ye[149]=Ye[21]=hK;Ye[86]=Ye[84]=mK;Ye[89]=Ye[81]=gK;Ye[96]=Ye[74]=yK;Ye[24]=Ye[146]=vK;Ye[6]=Ye[164]=xK;Ye[129]=Ye[41]=bK;Ye[66]=Ye[104]=IK;Ye[144]=Ye[26]=SK;Ye[36]=Ye[134]=_K;Ye[9]=Ye[161]=CK;Ye[37]=Ye[133]=wK;Ye[148]=Ye[22]=PK;Ye[82]=Ye[88]=TK;Ye[73]=Ye[97]=EK;Ye[145]=Ye[25]=MK;Ye[70]=Ye[100]=OK;Ye[34]=function(e){return[HP(e),zP(e)]};Ye[35]=LK;Ye[136]=function(e){return[$P(e),VP(e)]};Ye[153]=function(e){return[jP(e),BP(e)]};Ye[102]=function(e){return[GP(e),UP(e)]};Ye[155]=DK;Ye[103]=AK;Ye[152]=function(e){return[jP(e),VP(e)]};Ye[156]=FK;Ye[137]=function(e){return[$P(e),BP(e)]};Ye[139]=NK;Ye[98]=function(e){return[zP(e),UP(e)]};Ye[99]=RK;Ye[38]=function(e){return[GP(e),HP(e)]};Ye[39]=kK;g();g();g();g();g();g();g();g();function GK(e){return(e>0)-(e<0)||+e}o(GK,"mathSign");function Ag(e,t,r){var n=t[0]-e[0],i=t[1]-e[1],a=r[0]-t[0],u=r[1]-t[1];return GK(n*u-a*i)}o(Ag,"orientationIndex");function eF(e,t){var r=e.geometry.coordinates[0].map(function(u){return u[0]}),n=e.geometry.coordinates[0].map(function(u){return u[1]}),i=t.geometry.coordinates[0].map(function(u){return u[0]}),a=t.geometry.coordinates[0].map(function(u){return u[1]});return Math.max.apply(null,r)===Math.max.apply(null,i)&&Math.max.apply(null,n)===Math.max.apply(null,a)&&Math.min.apply(null,r)===Math.min.apply(null,i)&&Math.min.apply(null,n)===Math.min.apply(null,a)}o(eF,"envelopeIsEqual");function WP(e,t){return t.geometry.coordinates[0].every(function(r){return ti(yn(r),e)})}o(WP,"envelopeContains");function tF(e,t){return e[0]===t[0]&&e[1]===t[1]}o(tF,"coordinatesEqual");var jK=function(){function e(t){this.id=e.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return o(e,"Node"),e.buildId=function(t){return t.join(",")},e.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(r){return r.from.id!==t.from.id})},e.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(r){return r.to.id!==t.to.id})},e.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},e.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(r,n){var i=r.to,a=n.to;if(i.coordinates[0]-t.coordinates[0]>=0&&a.coordinates[0]-t.coordinates[0]<0)return 1;if(i.coordinates[0]-t.coordinates[0]<0&&a.coordinates[0]-t.coordinates[0]>=0)return-1;if(i.coordinates[0]-t.coordinates[0]===0&&a.coordinates[0]-t.coordinates[0]===0)return i.coordinates[1]-t.coordinates[1]>=0||a.coordinates[1]-t.coordinates[1]>=0?i.coordinates[1]-a.coordinates[1]:a.coordinates[1]-i.coordinates[1];var u=Ag(t.coordinates,i.coordinates,a.coordinates);if(u<0)return 1;if(u>0)return-1;var c=Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2),f=Math.pow(a.coordinates[0]-t.coordinates[0],2)+Math.pow(a.coordinates[1]-t.coordinates[1],2);return c-f}),this.outerEdgesSorted=!0)},e.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},e.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},e.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},e}(),qP=jK;g();var UK=function(){function e(t,r){this.from=t,this.to=r,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 o(e,"Edge"),e.prototype.getSymetric=function(){return this.symetric||(this.symetric=new e(this.to,this.from),this.symetric.symetric=this),this.symetric},e.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},e.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},e.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},e.prototype.toLineString=function(){return Li([this.from.coordinates,this.to.coordinates])},e.prototype.compareTo=function(t){return Ag(t.from.coordinates,t.to.coordinates,this.to.coordinates)},e}(),rF=UK;g();var VK=function(){function e(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return o(e,"EdgeRing"),e.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},e.prototype.get=function(t){return this.edges[t]},Object.defineProperty(e.prototype,"length",{get:o(function(){return this.edges.length},"get"),enumerable:!0,configurable:!0}),e.prototype.forEach=function(t){this.edges.forEach(t)},e.prototype.map=function(t){return this.edges.map(t)},e.prototype.some=function(t){return this.edges.some(t)},e.prototype.isValid=function(){return!0},e.prototype.isHole=function(){var t=this,r=this.edges.reduce(function(u,c,f){return c.from.coordinates[1]>t.edges[u].from.coordinates[1]&&(u=f),u},0),n=(r===0?this.length:r)-1,i=(r+1)%this.length,a=Ag(this.edges[n].from.coordinates,this.edges[r].from.coordinates,this.edges[i].from.coordinates);return a===0?this.edges[n].from.coordinates[0]>this.edges[i].from.coordinates[0]:a>0},e.prototype.toMultiPoint=function(){return xw(this.edges.map(function(t){return t.from.coordinates}))},e.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(r){return r.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=On([t])},e.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=Hw(this.toPolygon())},e.findEdgeRingContaining=function(t,r){var n=t.getEnvelope(),i,a;return r.forEach(function(u){var c=u.getEnvelope();if(a&&(i=a.getEnvelope()),!eF(c,n)&&WP(c,n)){for(var f=t.map(function(T){return T.from.coordinates}),m=void 0,v=o(function(T){u.some(function(O){return tF(T,O.from.coordinates)})||(m=T)},"_loop_1"),x=0,I=f;x<I.length;x++){var C=I[x];v(C)}m&&u.inside(yn(m))&&(!a||WP(i,c))&&(a=u)}}),a},e.prototype.inside=function(t){return ti(t,this.toPolygon())},e}(),YP=VK;function zK(e){if(!e)throw new Error("No geojson passed");if(e.type!=="FeatureCollection"&&e.type!=="GeometryCollection"&&e.type!=="MultiLineString"&&e.type!=="LineString"&&e.type!=="Feature")throw new Error("Invalid input type '"+e.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}o(zK,"validateGeoJson");var A5e=function(){function e(){this.edges=[],this.nodes={}}return o(e,"Graph"),e.fromGeoJson=function(t){zK(t);var r=new e;return fo(t,function(n){Tw(n,"LineString","Graph::fromGeoJson"),q7(n,function(i,a){if(i){var u=r.getNode(i),c=r.getNode(a);r.addEdge(u,c)}return a})}),r},e.prototype.getNode=function(t){var r=qP.buildId(t),n=this.nodes[r];return n||(n=this.nodes[r]=new qP(t)),n},e.prototype.addEdge=function(t,r){var n=new rF(t,r),i=n.getSymetric();this.edges.push(n),this.edges.push(i)},e.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(r){return t.nodes[r]}).forEach(function(r){return t._removeIfDangle(r)})},e.prototype._removeIfDangle=function(t){var r=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(i){return i.to});this.removeNode(t),n.forEach(function(i){return r._removeIfDangle(i)})}},e.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(r){r.label===r.symetric.label&&(t.removeEdge(r.symetric),t.removeEdge(r))})},e.prototype._computeNextCWEdges=function(t){var r=this;typeof t>"u"?Object.keys(this.nodes).forEach(function(n){return r._computeNextCWEdges(r.nodes[n])}):t.getOuterEdges().forEach(function(n,i){t.getOuterEdge((i===0?t.getOuterEdges().length:i)-1).symetric.next=n})},e.prototype._computeNextCCWEdges=function(t,r){for(var n=t.getOuterEdges(),i,a,u=n.length-1;u>=0;--u){var c=n[u],f=c.symetric,m=void 0,v=void 0;c.label===r&&(m=c),f.label===r&&(v=f),!(!m||!v)&&(v&&(a=v),m&&(a&&(a.next=m,a=void 0),i||(i=m)))}a&&(a.next=i)},e.prototype._findLabeledEdgeRings=function(){var t=[],r=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var i=n;do i.label=r,i=i.next;while(!n.isEqual(i));r++}}),t},e.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(n){n.label=void 0}),this._findLabeledEdgeRings().forEach(function(n){t._findIntersectionNodes(n).forEach(function(i){t._computeNextCCWEdges(i,n.label)})});var r=[];return this.edges.forEach(function(n){n.ring||r.push(t._findEdgeRing(n))}),r},e.prototype._findIntersectionNodes=function(t){var r=[],n=t,i=o(function(){var a=0;n.from.getOuterEdges().forEach(function(u){u.label===t.label&&++a}),a>1&&r.push(n.from),n=n.next},"_loop_1");do i();while(!t.isEqual(n));return r},e.prototype._findEdgeRing=function(t){var r=t,n=new YP;do n.push(r),r.ring=n,r=r.next;while(!t.isEqual(r));return n},e.prototype.removeNode=function(t){var r=this;t.getOuterEdges().forEach(function(n){return r.removeEdge(n)}),t.innerEdges.forEach(function(n){return r.removeEdge(n)}),delete this.nodes[t.id]},e.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(r){return!r.isEqual(t)}),t.deleteEdge()},e}();g();function $K(e,t){var r=!0;return fo(e,function(n){fo(t,function(i){if(r===!1)return!1;r=HK(n.geometry,i.geometry)})}),r}o($K,"booleanDisjoint");function HK(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return!XK(e.coordinates,t.coordinates);case"LineString":return!nF(t,e);case"Polygon":return!ti(e,t)}break;case"LineString":switch(t.type){case"Point":return!nF(e,t);case"LineString":return!WK(e,t);case"Polygon":return!iF(t,e)}break;case"Polygon":switch(t.type){case"Point":return!ti(t,e);case"LineString":return!iF(e,t);case"Polygon":return!qK(t,e)}}return!1}o(HK,"disjoint");function nF(e,t){for(var r=0;r<e.coordinates.length-1;r++)if(YK(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}o(nF,"isPointOnLine");function WK(e,t){var r=Xu(e,t);return r.features.length>0}o(WK,"isLineOnLine");function iF(e,t){for(var r=0,n=t.coordinates;r<n.length;r++){var i=n[r];if(ti(i,e))return!0}var a=Xu(t,Yd(e));return a.features.length>0}o(iF,"isLineInPoly");function qK(e,t){for(var r=0,n=e.coordinates[0];r<n.length;r++){var i=n[r];if(ti(i,t))return!0}for(var a=0,u=t.coordinates[0];a<u.length;a++){var c=u[a];if(ti(c,e))return!0}var f=Xu(Yd(e),Yd(t));return f.features.length>0}o(qK,"isPolyInPoly");function YK(e,t,r){var n=r[0]-e[0],i=r[1]-e[1],a=t[0]-e[0],u=t[1]-e[1],c=n*u-i*a;return c!==0?!1:Math.abs(a)>=Math.abs(u)?a>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:u>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}o(YK,"isPointOnLineSegment");function XK(e,t){return e[0]===t[0]&&e[1]===t[1]}o(XK,"compareCoords");var XP=$K;g();g();g();var QK=Mn(ZP(),1);g();var eJ=Mn(ZP(),1);g();function R1(e,t){var r=!1;return fo(e,function(n){fo(t,function(i){if(r===!0)return!0;r=!XP(n.geometry,i.geometry)})}),r}o(R1,"booleanIntersects");g();var tJ=Mn(fF(),1);g();var lJ=Mn(SF(),1);g();g();function CF(e){for(var t=e,r=[];t.parent;)r.unshift(t),t=t.parent;return r}o(CF,"pathTo");function cJ(){return new wF(function(e){return e.f})}o(cJ,"getHeap");var eT={search:o(function(e,t,r,n){e.cleanDirty(),n=n||{};var i=n.heuristic||eT.heuristics.manhattan,a=n.closest||!1,u=cJ(),c=t;for(t.h=i(t,r),u.push(t);u.size()>0;){var f=u.pop();if(f===r)return CF(f);f.closed=!0;for(var m=e.neighbors(f),v=0,x=m.length;v<x;++v){var I=m[v];if(!(I.closed||I.isWall())){var C=f.g+I.getCost(f),T=I.visited;(!T||C<I.g)&&(I.visited=!0,I.parent=f,I.h=I.h||i(I,r),I.g=C,I.f=I.g+I.h,e.markDirty(I),a&&(I.h<c.h||I.h===c.h&&I.g<c.g)&&(c=I),T?u.rescoreElement(I):u.push(I))}}}return a?CF(c):[]},"search"),heuristics:{manhattan:o(function(e,t){var r=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y);return r+n},"manhattan"),diagonal:o(function(e,t){var r=1,n=Math.sqrt(2),i=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);return r*(i+a)+(n-2*r)*Math.min(i,a)},"diagonal")},cleanNode:o(function(e){e.f=0,e.g=0,e.h=0,e.visited=!1,e.closed=!1,e.parent=null},"cleanNode")};function k1(e,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var r=0;r<e.length;r++){this.grid[r]=[];for(var n=0,i=e[r];n<i.length;n++){var a=new E2(r,n,i[n]);this.grid[r][n]=a,this.nodes.push(a)}}this.init()}o(k1,"Graph");k1.prototype.init=function(){this.dirtyNodes=[];for(var e=0;e<this.nodes.length;e++)eT.cleanNode(this.nodes[e])};k1.prototype.cleanDirty=function(){for(var e=0;e<this.dirtyNodes.length;e++)eT.cleanNode(this.dirtyNodes[e]);this.dirtyNodes=[]};k1.prototype.markDirty=function(e){this.dirtyNodes.push(e)};k1.prototype.neighbors=function(e){var t=[],r=e.x,n=e.y,i=this.grid;return i[r-1]&&i[r-1][n]&&t.push(i[r-1][n]),i[r+1]&&i[r+1][n]&&t.push(i[r+1][n]),i[r]&&i[r][n-1]&&t.push(i[r][n-1]),i[r]&&i[r][n+1]&&t.push(i[r][n+1]),this.diagonal&&(i[r-1]&&i[r-1][n-1]&&t.push(i[r-1][n-1]),i[r+1]&&i[r+1][n-1]&&t.push(i[r+1][n-1]),i[r-1]&&i[r-1][n+1]&&t.push(i[r-1][n+1]),i[r+1]&&i[r+1][n+1]&&t.push(i[r+1][n+1])),t};k1.prototype.toString=function(){for(var e=[],t=this.grid,r,n,i,a,u=0,c=t.length;u<c;u++){for(r=[],n=t[u],i=0,a=n.length;i<a;i++)r.push(n[i].weight);e.push(r.join(" "))}return e.join("\n")};function E2(e,t,r){this.x=e,this.y=t,this.weight=r}o(E2,"GridNode");E2.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};E2.prototype.getCost=function(e){return e&&e.x!==this.x&&e.y!==this.y?this.weight*1.41421:this.weight};E2.prototype.isWall=function(){return this.weight===0};function wF(e){this.content=[],this.scoreFunction=e}o(wF,"BinaryHeap");wF.prototype={push:o(function(e){this.content.push(e),this.sinkDown(this.content.length-1)},"push"),pop:o(function(){var e=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),e},"pop"),remove:o(function(e){var t=this.content.indexOf(e),r=this.content.pop();t!==this.content.length-1&&(this.content[t]=r,this.scoreFunction(r)<this.scoreFunction(e)?this.sinkDown(t):this.bubbleUp(t))},"remove"),size:o(function(){return this.content.length},"size"),rescoreElement:o(function(e){this.sinkDown(this.content.indexOf(e))},"rescoreElement"),sinkDown:o(function(e){for(var t=this.content[e];e>0;){var r=(e+1>>1)-1,n=this.content[r];if(this.scoreFunction(t)<this.scoreFunction(n))this.content[r]=t,this.content[e]=n,e=r;else break}},"sinkDown"),bubbleUp:o(function(e){for(var t=this.content.length,r=this.content[e],n=this.scoreFunction(r);;){var i=e+1<<1,a=i-1,u=null,c;if(a<t){var f=this.content[a];c=this.scoreFunction(f),c<n&&(u=a)}if(i<t){var m=this.content[i],v=this.scoreFunction(m);v<(u===null?n:c)&&(u=i)}if(u!==null)this.content[e]=this.content[u],this.content[u]=r,e=u;else break}},"bubbleUp")};g();g();g();g();g();g();g();g();function tT(){this._=null}o(tT,"RedBlackTree");function Ng(e){e.U=e.C=e.L=e.R=e.P=e.N=null}o(Ng,"RedBlackNode");tT.prototype={constructor:tT,insert:o(function(e,t){var r,n,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;r=e}else this._?(e=PF(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)n=r.U,r===n.L?(i=n.R,i&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.R&&(B1(this,r),e=r,r=e.U),r.C=!1,n.C=!0,G1(this,n))):(i=n.L,i&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.L&&(G1(this,r),e=r,r=e.U),r.C=!1,n.C=!0,B1(this,n))),r=e.U;this._.C=!1},"insert"),remove:o(function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t=e.U,r,n=e.L,i=e.R,a,u;if(n?i?a=PF(i):a=n:a=i,t?t.L===e?t.L=a:t.R=a:this._=a,n&&i?(u=a.C,a.C=e.C,a.L=n,n.U=a,a!==i?(t=a.U,a.U=e.U,e=a.R,t.L=e,a.R=i,i.U=a):(a.U=t,t=a,e=a.R)):(u=e.C,e=a),e&&(e.U=t),!u){if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===t.L){if(r=t.R,r.C&&(r.C=!1,t.C=!0,B1(this,t),r=t.R),r.L&&r.L.C||r.R&&r.R.C){(!r.R||!r.R.C)&&(r.L.C=!1,r.C=!0,G1(this,r),r=t.R),r.C=t.C,t.C=r.R.C=!1,B1(this,t),e=this._;break}}else if(r=t.L,r.C&&(r.C=!1,t.C=!0,G1(this,t),r=t.L),r.L&&r.L.C||r.R&&r.R.C){(!r.L||!r.L.C)&&(r.R.C=!1,r.C=!0,B1(this,r),r=t.L),r.C=t.C,t.C=r.L.C=!1,G1(this,t),e=this._;break}r.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}},"remove")};function B1(e,t){var r=t,n=t.R,i=r.U;i?i.L===r?i.L=n:i.R=n:e._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}o(B1,"RedBlackRotateLeft");function G1(e,t){var r=t,n=t.L,i=r.U;i?i.L===r?i.L=n:i.R=n:e._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}o(G1,"RedBlackRotateRight");function PF(e){for(;e.L;)e=e.L;return e}o(PF,"RedBlackFirst");var rT=tT;g();g();function Rg(e,t,r,n){var i=[null,null],a=Go.push(i)-1;return i.left=e,i.right=t,r&&j1(i,e,t,r),n&&j1(i,t,e,n),$s[e.index].halfedges.push(a),$s[t.index].halfedges.push(a),i}o(Rg,"createEdge");function kg(e,t,r){var n=[t,r];return n.left=e,n}o(kg,"createBorderEdge");function j1(e,t,r,n){!e[0]&&!e[1]?(e[0]=n,e.left=t,e.right=r):e.left===r?e[1]=n:e[0]=n}o(j1,"setEdgeEnd");function pJ(e,t,r,n,i){var a=e[0],u=e[1],c=a[0],f=a[1],m=u[0],v=u[1],x=0,I=1,C=m-c,T=v-f,O;if(O=t-c,!(!C&&O>0)){if(O/=C,C<0){if(O<x)return;O<I&&(I=O)}else if(C>0){if(O>I)return;O>x&&(x=O)}if(O=n-c,!(!C&&O<0)){if(O/=C,C<0){if(O>I)return;O>x&&(x=O)}else if(C>0){if(O<x)return;O<I&&(I=O)}if(O=r-f,!(!T&&O>0)){if(O/=T,T<0){if(O<x)return;O<I&&(I=O)}else if(T>0){if(O>I)return;O>x&&(x=O)}if(O=i-f,!(!T&&O<0)){if(O/=T,T<0){if(O>I)return;O>x&&(x=O)}else if(T>0){if(O<x)return;O<I&&(I=O)}return!(x>0)&&!(I<1)||(x>0&&(e[0]=[c+x*C,f+x*T]),I<1&&(e[1]=[c+I*C,f+I*T])),!0}}}}}o(pJ,"clipEdge");function fJ(e,t,r,n,i){var a=e[1];if(a)return!0;var u=e[0],c=e.left,f=e.right,m=c[0],v=c[1],x=f[0],I=f[1],C=(m+x)/2,T=(v+I)/2,O,P;if(I===v){if(C<t||C>=n)return;if(m>x){if(!u)u=[C,r];else if(u[1]>=i)return;a=[C,i]}else{if(!u)u=[C,i];else if(u[1]<r)return;a=[C,r]}}else if(O=(m-x)/(I-v),P=T-O*C,O<-1||O>1)if(m>x){if(!u)u=[(r-P)/O,r];else if(u[1]>=i)return;a=[(i-P)/O,i]}else{if(!u)u=[(i-P)/O,i];else if(u[1]<r)return;a=[(r-P)/O,r]}else if(v<I){if(!u)u=[t,O*t+P];else if(u[0]>=n)return;a=[n,O*n+P]}else{if(!u)u=[n,O*n+P];else if(u[0]<t)return;a=[t,O*t+P]}return e[0]=u,e[1]=a,!0}o(fJ,"connectEdge");function TF(e,t,r,n){for(var i=Go.length,a;i--;)(!fJ(a=Go[i],e,t,r,n)||!pJ(a,e,t,r,n)||!(Math.abs(a[0][0]-a[1][0])>Dn||Math.abs(a[0][1]-a[1][1])>Dn))&&delete Go[i]}o(TF,"clipEdges");function EF(e){return $s[e.index]={site:e,halfedges:[]}}o(EF,"createCell");function dJ(e,t){var r=e.site,n=t.left,i=t.right;return r===i&&(i=n,n=r),i?Math.atan2(i[1]-n[1],i[0]-n[0]):(r===n?(n=t[1],i=t[0]):(n=t[0],i=t[1]),Math.atan2(n[0]-i[0],i[1]-n[1]))}o(dJ,"cellHalfedgeAngle");function nT(e,t){return t[+(t.left!==e.site)]}o(nT,"cellHalfedgeStart");function hJ(e,t){return t[+(t.left===e.site)]}o(hJ,"cellHalfedgeEnd");function MF(){for(var e=0,t=$s.length,r,n,i,a;e<t;++e)if((r=$s[e])&&(a=(n=r.halfedges).length)){var u=new Array(a),c=new Array(a);for(i=0;i<a;++i)u[i]=i,c[i]=dJ(r,Go[n[i]]);for(u.sort(function(f,m){return c[m]-c[f]}),i=0;i<a;++i)c[i]=n[u[i]];for(i=0;i<a;++i)n[i]=c[i]}}o(MF,"sortCellHalfedges");function OF(e,t,r,n){var i=$s.length,a,u,c,f,m,v,x,I,C,T,O,P,L=!0;for(a=0;a<i;++a)if(u=$s[a]){for(c=u.site,m=u.halfedges,f=m.length;f--;)Go[m[f]]||m.splice(f,1);for(f=0,v=m.length;f<v;)T=hJ(u,Go[m[f]]),O=T[0],P=T[1],x=nT(u,Go[m[++f%v]]),I=x[0],C=x[1],(Math.abs(O-I)>Dn||Math.abs(P-C)>Dn)&&(m.splice(f,0,Go.push(kg(c,T,Math.abs(O-e)<Dn&&n-P>Dn?[e,Math.abs(I-e)<Dn?C:n]:Math.abs(P-n)<Dn&&r-O>Dn?[Math.abs(C-n)<Dn?I:r,n]:Math.abs(O-r)<Dn&&P-t>Dn?[r,Math.abs(I-r)<Dn?C:t]:Math.abs(P-t)<Dn&&O-e>Dn?[Math.abs(C-t)<Dn?I:e,t]:null))-1),++v);v&&(L=!1)}if(L){var A,M,N,B=1/0;for(a=0,L=null;a<i;++a)(u=$s[a])&&(c=u.site,A=c[0]-e,M=c[1]-t,N=A*A+M*M,N<B&&(B=N,L=u));if(L){var H=[e,t],z=[e,n],R=[r,n],X=[r,t];L.halfedges.push(Go.push(kg(c=L.site,H,z))-1,Go.push(kg(c,z,R))-1,Go.push(kg(c,R,X))-1,Go.push(kg(c,X,H))-1)}}for(a=0;a<i;++a)(u=$s[a])&&(u.halfedges.length||delete $s[a])}o(OF,"clipCells");g();var LF=[],M2;function mJ(){Ng(this),this.x=this.y=this.arc=this.site=this.cy=null}o(mJ,"Circle");function Jd(e){var t=e.P,r=e.N;if(!(!t||!r)){var n=t.site,i=e.site,a=r.site;if(n!==a){var u=i[0],c=i[1],f=n[0]-u,m=n[1]-c,v=a[0]-u,x=a[1]-c,I=2*(f*x-m*v);if(!(I>=-DF)){var C=f*f+m*m,T=v*v+x*x,O=(x*C-m*T)/I,P=(f*T-v*C)/I,L=LF.pop()||new mJ;L.arc=e,L.site=i,L.x=O+u,L.y=(L.cy=P+c)+Math.sqrt(O*O+P*P),e.circle=L;for(var A=null,M=Bg._;M;)if(L.y<M.y||L.y===M.y&&L.x<=M.x)if(M.L)M=M.L;else{A=M.P;break}else if(M.R)M=M.R;else{A=M;break}Bg.insert(A,L),A||(M2=L)}}}}o(Jd,"attachCircle");function Qd(e){var t=e.circle;t&&(t.P||(M2=t.N),Bg.remove(t),LF.push(t),Ng(t),e.circle=null)}o(Qd,"detachCircle");var FF=[];function gJ(){Ng(this),this.edge=this.site=this.circle=null}o(gJ,"Beach");function AF(e){var t=FF.pop()||new gJ;return t.site=e,t}o(AF,"createBeach");function iT(e){Qd(e),eh.remove(e),FF.push(e),Ng(e)}o(iT,"detachBeach");function NF(e){var t=e.circle,r=t.x,n=t.cy,i=[r,n],a=e.P,u=e.N,c=[e];iT(e);for(var f=a;f.circle&&Math.abs(r-f.circle.x)<Dn&&Math.abs(n-f.circle.cy)<Dn;)a=f.P,c.unshift(f),iT(f),f=a;c.unshift(f),Qd(f);for(var m=u;m.circle&&Math.abs(r-m.circle.x)<Dn&&Math.abs(n-m.circle.cy)<Dn;)u=m.N,c.push(m),iT(m),m=u;c.push(m),Qd(m);var v=c.length,x;for(x=1;x<v;++x)m=c[x],f=c[x-1],j1(m.edge,f.site,m.site,i);f=c[0],m=c[v-1],m.edge=Rg(f.site,m.site,null,i),Jd(f),Jd(m)}o(NF,"removeBeach");function RF(e){for(var t=e[0],r=e[1],n,i,a,u,c=eh._;c;)if(a=kF(c,r)-t,a>Dn)c=c.L;else if(u=t-yJ(c,r),u>Dn){if(!c.R){n=c;break}c=c.R}else{a>-Dn?(n=c.P,i=c):u>-Dn?(n=c,i=c.N):n=i=c;break}EF(e);var f=AF(e);if(eh.insert(n,f),!(!n&&!i)){if(n===i){Qd(n),i=AF(n.site),eh.insert(f,i),f.edge=i.edge=Rg(n.site,f.site),Jd(n),Jd(i);return}if(!i){f.edge=Rg(n.site,f.site);return}Qd(n),Qd(i);var m=n.site,v=m[0],x=m[1],I=e[0]-v,C=e[1]-x,T=i.site,O=T[0]-v,P=T[1]-x,L=2*(I*P-C*O),A=I*I+C*C,M=O*O+P*P,N=[(P*A-C*M)/L+v,(I*M-O*A)/L+x];j1(i.edge,m,T,N),f.edge=Rg(m,e,null,N),i.edge=Rg(e,T,null,N),Jd(n),Jd(i)}}o(RF,"addBeach");function kF(e,t){var r=e.site,n=r[0],i=r[1],a=i-t;if(!a)return n;var u=e.P;if(!u)return-1/0;r=u.site;var c=r[0],f=r[1],m=f-t;if(!m)return c;var v=c-n,x=1/a-1/m,I=v/m;return x?(-I+Math.sqrt(I*I-2*x*(v*v/(-2*m)-f+m/2+i-a/2)))/x+n:(n+c)/2}o(kF,"leftBreakPoint");function yJ(e,t){var r=e.N;if(r)return kF(r,t);var n=e.site;return n[1]===t?n[0]:1/0}o(yJ,"rightBreakPoint");var Dn=1e-6,DF=1e-12,eh,$s,Bg,Go;function vJ(e,t,r){return(e[0]-r[0])*(t[1]-e[1])-(e[0]-t[0])*(r[1]-e[1])}o(vJ,"triangleArea");function xJ(e,t){return t[1]-e[1]||t[0]-e[0]}o(xJ,"lexicographic");function O2(e,t){var r=e.sort(xJ).pop(),n,i,a;for(Go=[],$s=new Array(e.length),eh=new rT,Bg=new rT;;)if(a=M2,r&&(!a||r[1]<a.y||r[1]===a.y&&r[0]<a.x))(r[0]!==n||r[1]!==i)&&(RF(r),n=r[0],i=r[1]),r=e.pop();else if(a)NF(a.arc);else break;if(MF(),t){var u=+t[0][0],c=+t[0][1],f=+t[1][0],m=+t[1][1];TF(u,c,f,m),OF(u,c,f,m)}this.edges=Go,this.cells=$s,eh=Bg=Go=$s=null}o(O2,"Diagram");O2.prototype={constructor:O2,polygons:o(function(){var e=this.edges;return this.cells.map(function(t){var r=t.halfedges.map(function(n){return nT(t,e[n])});return r.data=t.site.data,r})},"polygons"),triangles:o(function(){var e=[],t=this.edges;return this.cells.forEach(function(r,n){if(c=(a=r.halfedges).length)for(var i=r.site,a,u=-1,c,f,m=t[a[c-1]],v=m.left===i?m.right:m.left;++u<c;)f=v,m=t[a[u]],v=m.left===i?m.right:m.left,f&&v&&n<f.index&&n<v.index&&vJ(i,f,v)<0&&e.push([i.data,f.data,v.data])}),e},"triangles"),links:o(function(){return this.edges.filter(function(e){return e.right}).map(function(e){return{source:e.left.data,target:e.right.data}})},"links"),find:o(function(e,t,r){for(var n=this,i,a=n._found||0,u=n.cells.length,c;!(c=n.cells[a]);)if(++a>=u)return null;var f=e-c.site[0],m=t-c.site[1],v=f*f+m*m;do c=n.cells[i=a],a=null,c.halfedges.forEach(function(x){var I=n.edges[x],C=I.left;if(!((C===c.site||!C)&&!(C=I.right))){var T=e-C[0],O=t-C[1],P=T*T+O*O;P<v&&(v=P,a=C.index)}});while(a!==null);return n._found=i,r==null||v<=r*r?c.site:null},"find")};g();g();g();g();g();g();g();g();g();g();g();g();var TJ=Mn(Gg(),1);g();var dT=Mn(UF(),1);g();g();g();function Hs(){return new A2}o(Hs,"default");function A2(){this.reset()}o(A2,"Adder");A2.prototype={constructor:A2,reset:o(function(){this.s=this.t=0},"reset"),add:o(function(e){VF(D2,e,this.t),VF(this,D2.s,this.s),this.s?this.t+=D2.t:this.s=D2.t},"add"),valueOf:o(function(){return this.s},"valueOf")};var D2=new A2;function VF(e,t,r){var n=e.s=t+r,i=n-t,a=n-i;e.t=t-a+(r-i)}o(VF,"add");g();var ln=1e-6;var bn=Math.PI,go=bn/2,F2=bn/4,Ju=bn*2,th=180/bn,ca=bn/180,Ai=Math.abs,tu=Math.atan,pa=Math.atan2,Gr=Math.cos;var N2=Math.exp;var U1=Math.log;var Wt=Math.sin;var ss=Math.sqrt,V1=Math.tan;function aT(e){return e>1?0:e<-1?bn:Math.acos(e)}o(aT,"acos");function Ws(e){return e>1?go:e<-1?-go:Math.asin(e)}o(Ws,"asin");g();function ru(){}o(ru,"noop");g();var EJ=Hs(),gDe=Hs();g();g();function rh(e){var t=e[0],r=e[1],n=Gr(r);return[n*Gr(t),n*Wt(t),Wt(r)]}o(rh,"cartesian");function z1(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}o(z1,"cartesianCross");function $1(e){var t=ss(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}o($1,"cartesianNormalizeInPlace");var ODe=Hs();g();g();g();g();g();function $F(e,t){return[e>bn?e-Ju:e<-bn?e+Ju:e,t]}o($F,"rotationIdentity");$F.invert=$F;g();g();function R2(){var e=[],t;return{point:o(function(r,n){t.push([r,n])},"point"),lineStart:o(function(){e.push(t=[])},"lineStart"),lineEnd:ru,rejoin:o(function(){e.length>1&&e.push(e.pop().concat(e.shift()))},"rejoin"),result:o(function(){var r=e;return e=[],t=null,r},"result")}}o(R2,"default");g();g();g();function k2(e,t){return Ai(e[0]-t[0])<ln&&Ai(e[1]-t[1])<ln}o(k2,"default");function B2(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}o(B2,"Intersection");function G2(e,t,r,n,i){var a=[],u=[],c,f;if(e.forEach(function(T){if(!((O=T.length-1)<=0)){var O,P=T[0],L=T[O],A;if(k2(P,L)){for(i.lineStart(),c=0;c<O;++c)i.point((P=T[c])[0],P[1]);i.lineEnd();return}a.push(A=new B2(P,T,null,!0)),u.push(A.o=new B2(P,null,A,!1)),a.push(A=new B2(L,T,null,!1)),u.push(A.o=new B2(L,null,A,!0))}}),!!a.length){for(u.sort(t),HF(a),HF(u),c=0,f=u.length;c<f;++c)u[c].e=r=!r;for(var m=a[0],v,x;;){for(var I=m,C=!0;I.v;)if((I=I.n)===m)return;v=I.z,i.lineStart();do{if(I.v=I.o.v=!0,I.e){if(C)for(c=0,f=v.length;c<f;++c)i.point((x=v[c])[0],x[1]);else n(I.x,I.n.x,1,i);I=I.n}else{if(C)for(v=I.p.z,c=v.length-1;c>=0;--c)i.point((x=v[c])[0],x[1]);else n(I.x,I.p.x,-1,i);I=I.p}I=I.o,v=I.z,C=!C}while(!I.v);i.lineEnd()}}}o(G2,"default");function HF(e){if(t=e.length){for(var t,r=0,n=e[0],i;++r<t;)n.n=i=e[r],i.p=n,n=i;n.n=i=e[0],i.p=n}}o(HF,"link");g();g();g();function tp(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(tp,"default");g();function j2(e){return e.length===1&&(e=LJ(e)),{left:o(function(t,r,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)<0?n=a+1:i=a}return n},"left"),right:o(function(t,r,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)>0?i=a:n=a+1}return n},"right")}}o(j2,"default");function LJ(e){return function(t,r){return tp(e(t),r)}}o(LJ,"ascendingComparator");var WF=j2(tp),DJ=WF.right,AJ=WF.left;g();g();g();g();g();g();g();g();g();var qF=Array.prototype,NJ=qF.slice,RJ=qF.map;g();g();g();g();var h8e=Math.sqrt(50),m8e=Math.sqrt(10),g8e=Math.sqrt(2);g();g();g();g();g();g();g();g();function H1(e){for(var t=e.length,r,n=-1,i=0,a,u;++n<t;)i+=e[n].length;for(a=new Array(i);--t>=0;)for(u=e[t],r=u.length;--r>=0;)a[--i]=u[r];return a}o(H1,"default");g();g();g();g();g();g();g();var $J=1e9,FFe=-$J;g();g();var lT=Hs();function V2(e,t){var r=t[0],n=t[1],i=[Wt(r),-Gr(r),0],a=0,u=0;lT.reset();for(var c=0,f=e.length;c<f;++c)if(v=(m=e[c]).length)for(var m,v,x=m[v-1],I=x[0],C=x[1]/2+F2,T=Wt(C),O=Gr(C),P=0;P<v;++P,I=A,T=N,O=B,x=L){var L=m[P],A=L[0],M=L[1]/2+F2,N=Wt(M),B=Gr(M),H=A-I,z=H>=0?1:-1,R=z*H,X=R>bn,ie=T*N;if(lT.add(pa(ie*z*Wt(R),O*B+ie*Gr(R))),a+=X?H+z*Ju:H,X^I>=r^A>=r){var Q=z1(rh(x),rh(L));$1(Q);var U=z1(i,Q);$1(U);var Te=(X^H>=0?-1:1)*Ws(U[2]);(n>Te||n===Te&&(Q[0]||Q[1]))&&(u+=X^H>=0?1:-1)}}return(a<-ln||a<ln&&lT<-ln)^u&1}o(V2,"default");g();g();var YFe=Hs();g();g();g();g();g();var wNe=Hs(),PNe=Hs();g();var qJ=1/0;var LNe=-qJ;g();g();function uT(e){this._context=e}o(uT,"PathContext");uT.prototype={_radius:4.5,pointRadius:o(function(e){return this._radius=e,this},"pointRadius"),polygonStart:o(function(){this._line=0},"polygonStart"),polygonEnd:o(function(){this._line=NaN},"polygonEnd"),lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){this._line===0&&this._context.closePath(),this._point=NaN},"lineEnd"),point:o(function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Ju);break}}},"point"),result:ru};g();var qNe=Hs();g();function cT(){this._string=[]}o(cT,"PathString");cT.prototype={_radius:4.5,_circle:ZF(4.5),pointRadius:o(function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},"pointRadius"),polygonStart:o(function(){this._line=0},"polygonStart"),polygonEnd:o(function(){this._line=NaN},"polygonEnd"),lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){this._line===0&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:o(function(e,t){switch(this._point){case 0:{this._string.push("M",e,",",t),this._point=1;break}case 1:{this._string.push("L",e,",",t);break}default:{this._circle==null&&(this._circle=ZF(this._radius)),this._string.push("M",e,",",t,this._circle);break}}},"point"),result:o(function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}else return null},"result")};function ZF(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}o(ZF,"circle");g();g();g();g();g();g();function z2(e,t,r,n){return function(i,a){var u=t(a),c=i.invert(n[0],n[1]),f=R2(),m=t(f),v=!1,x,I,C,T={point:O,lineStart:L,lineEnd:A,polygonStart:o(function(){T.point=M,T.lineStart=N,T.lineEnd=B,I=[],x=[]},"polygonStart"),polygonEnd:o(function(){T.point=O,T.lineStart=L,T.lineEnd=A,I=H1(I);var H=V2(x,c);I.length?(v||(a.polygonStart(),v=!0),G2(I,ZJ,H,r,a)):H&&(v||(a.polygonStart(),v=!0),a.lineStart(),r(null,null,1,a),a.lineEnd()),v&&(a.polygonEnd(),v=!1),I=x=null},"polygonEnd"),sphere:o(function(){a.polygonStart(),a.lineStart(),r(null,null,1,a),a.lineEnd(),a.polygonEnd()},"sphere")};function O(H,z){var R=i(H,z);e(H=R[0],z=R[1])&&a.point(H,z)}o(O,"point");function P(H,z){var R=i(H,z);u.point(R[0],R[1])}o(P,"pointLine");function L(){T.point=P,u.lineStart()}o(L,"lineStart");function A(){T.point=O,u.lineEnd()}o(A,"lineEnd");function M(H,z){C.push([H,z]);var R=i(H,z);m.point(R[0],R[1])}o(M,"pointRing");function N(){m.lineStart(),C=[]}o(N,"ringStart");function B(){M(C[0][0],C[0][1]),m.lineEnd();var H=m.clean(),z=f.result(),R,X=z.length,ie,Q,U;if(C.pop(),x.push(C),C=null,!!X){if(H&1){if(Q=z[0],(ie=Q.length-1)>0){for(v||(a.polygonStart(),v=!0),a.lineStart(),R=0;R<ie;++R)a.point((U=Q[R])[0],U[1]);a.lineEnd()}return}X>1&&H&2&&z.push(z.pop().concat(z.shift())),I.push(z.filter(XJ))}}return o(B,"ringEnd"),T}}o(z2,"default");function XJ(e){return e.length>1}o(XJ,"validSegment");function ZJ(e,t){return((e=e.x)[0]<0?e[1]-go-ln:go-e[1])-((t=t.x)[0]<0?t[1]-go-ln:go-t[1])}o(ZJ,"compareIntersection");var KJ=z2(function(){return!0},JJ,eQ,[-bn,-go]);function JJ(e){var t=NaN,r=NaN,n=NaN,i;return{lineStart:o(function(){e.lineStart(),i=1},"lineStart"),point:o(function(a,u){var c=a>0?bn:-bn,f=Ai(a-t);Ai(f-bn)<ln?(e.point(t,r=(r+u)/2>0?go:-go),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(c,r),e.point(a,r),i=0):n!==c&&f>=bn&&(Ai(t-n)<ln&&(t-=n*ln),Ai(a-c)<ln&&(a-=c*ln),r=QJ(t,r,a,u),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(c,r),i=0),e.point(t=a,r=u),n=c},"point"),lineEnd:o(function(){e.lineEnd(),t=r=NaN},"lineEnd"),clean:o(function(){return 2-i},"clean")}}o(JJ,"clipAntimeridianLine");function QJ(e,t,r,n){var i,a,u=Wt(e-r);return Ai(u)>ln?tu((Wt(t)*(a=Gr(n))*Wt(r)-Wt(n)*(i=Gr(t))*Wt(e))/(i*a*u)):(t+n)/2}o(QJ,"clipAntimeridianIntersect");function eQ(e,t,r,n){var i;if(e==null)i=r*go,n.point(-bn,i),n.point(0,i),n.point(bn,i),n.point(bn,0),n.point(bn,-i),n.point(0,-i),n.point(-bn,-i),n.point(-bn,0),n.point(-bn,i);else if(Ai(e[0]-t[0])>ln){var a=e[0]<t[0]?bn:-bn;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(t[0],t[1])}o(eQ,"clipAntimeridianInterpolate");g();g();function $2(e){return function(t){var r=new pT;for(var n in e)r[n]=e[n];return r.stream=t,r}}o($2,"transformer");function pT(){}o(pT,"TransformStream");pT.prototype={constructor:pT,point:o(function(e,t){this.stream.point(e,t)},"point"),sphere:o(function(){this.stream.sphere()},"sphere"),lineStart:o(function(){this.stream.lineStart()},"lineStart"),lineEnd:o(function(){this.stream.lineEnd()},"lineEnd"),polygonStart:o(function(){this.stream.polygonStart()},"polygonStart"),polygonEnd:o(function(){this.stream.polygonEnd()},"polygonEnd")};g();g();var ZRe=Gr(30*ca);var fke=$2({point:o(function(e,t){this.stream.point(e*ca,t*ca)},"point")});g();g();g();g();function H2(e){return function(t,r){var n=Gr(t),i=Gr(r),a=e(n*i);return[a*i*Wt(t),a*Wt(r)]}}o(H2,"azimuthalRaw");function Qu(e){return function(t,r){var n=ss(t*t+r*r),i=e(n),a=Wt(i),u=Gr(i);return[pa(t*a,n*u),Ws(n&&r*a/n)]}}o(Qu,"azimuthalInvert");var nN=H2(function(e){return ss(2/(1+e))});nN.invert=Qu(function(e){return 2*Ws(e/2)});g();var iN=H2(function(e){return(e=aT(e))&&e/Wt(e)});iN.invert=Qu(function(e){return e});g();g();function fT(e,t){return[e,U1(V1((go+t)/2))]}o(fT,"mercatorRaw");fT.invert=function(e,t){return[e,2*tu(N2(t))-go]};g();g();function W2(e,t){return[e,t]}o(W2,"equirectangularRaw");W2.invert=W2;g();function oN(e,t){var r=Gr(t),n=Gr(e)*r;return[r*Wt(e)/n,Wt(t)/n]}o(oN,"gnomonicRaw");oN.invert=Qu(tu);g();g();function sN(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),t*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}o(sN,"naturalEarth1Raw");sN.invert=function(e,t){var r=t,n=25,i;do{var a=r*r,u=a*a;r-=i=(r*(1.007226+a*(.015085+u*(-.044475+.028874*a-.005916*u)))-t)/(1.007226+a*(.015085*3+u*(-.044475*7+.028874*9*a-.005916*11*u)))}while(Ai(i)>ln&&--n>0);return[e/(.8707+(a=r*r)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),r]};g();function aN(e,t){return[Gr(t)*Wt(e),Wt(t)]}o(aN,"orthographicRaw");aN.invert=Qu(Ws);g();function lN(e,t){var r=Gr(t),n=1+Gr(e)*r;return[r*Wt(e)/n,Wt(t)/n]}o(lN,"stereographicRaw");lN.invert=Qu(function(e){return 2*tu(e)});g();function uN(e,t){return[U1(V1((go+t)/2)),-e]}o(uN,"transverseMercatorRaw");uN.invert=function(e,t){return[-t,2*tu(N2(e))-go]};g();var sQ=Mn(Gg(),1);g();var aQ=Mn(Gg(),1);g();var uQ=Mn(Gg(),1);g();g();var cQ=Mn(Gg(),1);g();g();g();g();function hT(e){var i,a,u,c,f,m;let t=((a=(i=e.enterprise)==null?void 0:i.locations)==null?void 0:a.reduce((v,x)=>(v[x.id]=x,v),{}))||{};for(let v of((u=e.enterprise)==null?void 0:u.locationInstances)||[])t[v.id]=v;let r={};for(let v of e["floorstack.json"]||[])r[v.id]=v;let n={};for(let v of((c=e["floor.geojson"])==null?void 0:c.features)||[])v.properties&&v.properties.id&&(n[v.properties.id]=v.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":t,"enterprise-category":((m=(f=e.enterprise)==null?void 0:f.categories)==null?void 0:m.reduce((v,x)=>(v[x.id]=x,v),{}))||{},"floor-stack":r,floor:n}}}o(hT,"parseLocalePackToLanguagePack");function pN(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}o(pN,"isMappedinCdnUrl");function fN(e){let t=e.split("?")[1];return!!(t!=null&&t.includes("sv="))}o(fN,"hasSasToken");function jo(e,t){var n;let r=((n=e==null?void 0:e.properties)==null?void 0:n.id)||"unknown";if(e.geometry==null)return ae.error('Cannot get the center coordinate for "'.concat(r,'" because it has no geometry.')),new bt({latitude:0,longitude:0,floorId:t});try{if(e.geometry.type==="LineString"){let[[i,a],[u,c]]=e.geometry.coordinates,f=(i+u)/2,m=(a+c)/2;return new bt({latitude:m,longitude:f,floorId:t})}else if(e.geometry.type==="Point"){let[i,a]=e.geometry.coordinates;return new bt({latitude:a,longitude:i,floorId:t})}else if(e.geometry.type==="Polygon"){let i=e;if(i.properties.center!=null){let[a,u]=i.properties.center;return new bt({latitude:u,longitude:a,floorId:t})}}}catch(i){}try{let[i,a]=qu(e).geometry.coordinates;return new bt({latitude:a,longitude:i,floorId:t})}catch(i){return ae.error('Failed to get center coordinate for "'.concat(r,'" ').concat(i instanceof Error?i.stack:"")),new bt({latitude:0,longitude:0,floorId:t})}}o(jo,"getCenterCoordinate");function dN(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}o(dN,"hasFlag");var nu,Uo,ih,rp,nh=class nh extends ho{constructor(r,n){super(n.mvfData.properties.id);b(this,"__type",nh.__type);j(this,nu);j(this,Uo,{});j(this,ih);j(this,rp);$(this,nu,r),$(this,ih,n.floorId),$(this,rp,n.mvfData)}static is(r){return r.__type===nh.__type}get locations(){return d(this,Uo).locations?d(this,Uo).locations:(d(this,Uo).locations=(d(this,nu).locationIdsByNodeId[this.id]||[]).map(r=>d(this,nu).getById("enterprise-location",r)).filter(Boolean),d(this,Uo).locations)}get space(){var r;return d(this,nu).getById("space",(r=d(this,nu).spaceIdsByNodeId[this.id])==null?void 0:r[0])}get floor(){let r=d(this,nu).getById("floor",d(this,ih));if(r==null)throw new Error("Floor ".concat(d(this,ih)," not found!"));return r}get coordinate(){return d(this,Uo).coordinate==null&&(d(this,Uo).coordinate=jo(d(this,rp),d(this,ih))),d(this,Uo).coordinate}get externalId(){var r;return(r=d(this,rp).properties.externalId)!=null?r:""}get neighbors(){if(d(this,Uo).neighbors==null){let r=d(this,rp).properties.neighbors.map(n=>{let i=d(this,nu).getById("node",n.id);if(i==null)throw new Error("Node ".concat(n.id," not found!"));return i});d(this,Uo).neighbors=r}return d(this,Uo).neighbors}get navigationFlags(){if(d(this,Uo).navigationFlags==null){let r=[],n=d(this,rp).properties.flags;if(n!=null&&n.length>0)for(let[i,a]of Object.entries(d(this,nu).navigationFlags))n.length>a.index&&n[a.index]!=null&&dN({flags:n},a)&&r.push(i);d(this,Uo).navigationFlags=Object.freeze(r)}return d(this,Uo).navigationFlags}get geoJSON(){return Ie(Y({},d(this,rp)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:nh.__type,id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(r=>r.id)}}destroy(){for(let r of Object.keys(d(this,Uo)))delete d(this,Uo)[r]}};nu=new WeakMap,Uo=new WeakMap,ih=new WeakMap,rp=new WeakMap,o(nh,"Node"),b(nh,"__type","node");var mT=nh,Mf=mT;g();g();var oh,gT=class gT{constructor(t,r){b(this,"id");j(this,oh);this.id=t}get geoJSONBoundingBox(){return d(this,oh)?d(this,oh):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:($(this,oh,no(this.geoJSON)),d(this,oh))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};oh=new WeakMap,o(gT,"BaseMapData");var iu=gT;var Of,ul,ou,Ug,W1,vT,sh=class sh extends iu{constructor(r,n){super(n.mvfData.id,r);j(this,W1);b(this,"__type",sh.__type);j(this,Of);j(this,ul,{});j(this,ou);j(this,Ug);$(this,Of,r),$(this,ou,n.mvfData),$(this,Ug,n.facadeId)}static is(r){return r.__type===sh.__type}get type(){return d(this,ou).type}get name(){var r;return(r=Re(this,W1,vT).call(this,"name"))!=null?r:""}get shortName(){var r;return(r=Re(this,W1,vT).call(this,"shortName"))!=null?r:""}get externalId(){var r;return(r=d(this,ou).externalId)!=null?r:""}get floors(){var r,n;if(d(this,ul).floors==null){let i=((n=(r=d(this,ou).floors)!=null?r:d(this,ou).maps)!=null?n:[]).reduce((a,u)=>{let c=d(this,Of).floorsById[u];return c&&a.push(c),a},[]);i.length===0&&ae.error("Floor stack ".concat(this.id," has no floors")),d(this,ul).floors=i.sort((a,u)=>a.elevation-u.elevation)}return d(this,ul).floors}get defaultFloor(){if(d(this,ul).defaultFloor!=null)return d(this,ul).defaultFloor;let r=d(this,ou).defaultFloor?d(this,Of).getById("floor",d(this,ou).defaultFloor):void 0;return d(this,ul).defaultFloor=r||this.floors.reduce((n,i)=>Math.abs(i.elevation)<Math.abs(n.elevation)?i:n),d(this,ul).defaultFloor}get facade(){return d(this,Ug)?d(this,Of).facadesById[d(this,Ug)]:void 0}toJSON(){return{__type:sh.__type,id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(d(this,ul)))delete d(this,ul)[r]}};Of=new WeakMap,ul=new WeakMap,ou=new WeakMap,Ug=new WeakMap,W1=new WeakSet,vT=o(function(r){return d(this,Of).getPropTranslation(this.__type,r,this.id,d(this,ou)[r])},"#translate"),o(sh,"FloorStack"),b(sh,"__type","floor-stack");var yT=sh,q2=yT;g();g();g();g();g();g();var q1,np,ah=class ah extends ho{constructor(r){super(String(an()));b(this,"__type",ah.__type);j(this,q1,{});j(this,np);$(this,np,r.mvfData)}static is(r){return r.__type===ah.__type}get url(){return d(this,np).url}get name(){if("displayName"in d(this,np))return d(this,np).displayName;if("label"in d(this,np))return d(this,np).label}toJSON(){return{__type:ah.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(d(this,q1)))delete d(this,q1)[r]}};q1=new WeakMap,np=new WeakMap,o(ah,"Hyperlink"),b(ah,"__type","hyperlink");var xT=ah,lh=xT;g();g();function Y1(e){return typeof e=="string"?e:e.id}o(Y1,"getId");function IT(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}o(IT,"isPosition");var bT=8,ec=o(e=>typeof e=="number"?e.toFixed(bT):IT(e)?e[1].toFixed(bT)+"-"+e[0].toFixed(bT):e.map(t=>ec(t)).join("-"),"serializeCoords"),vQ=o(e=>{let t=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,r=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return t.test(e)||r.test(e)},"isPrivateCdnAsset"),Y2=o(e=>{if(!vQ(e))return null;let t="";e.startsWith("https://")?(t="https://",e=e.slice(8)):e.startsWith("http://")&&(t="http://",e=e.slice(7));let[r,n,i]=e.split("/");return{origin:t+r,mapId:n,fileName:i}},"parseCdnAssetUrl");var X1,Lf,ch,uh=class uh extends ho{constructor(r){super(String(an()));b(this,"__type",uh.__type);j(this,X1,{});j(this,Lf);j(this,ch);$(this,Lf,r.mvfData),$(this,ch,r.mapData)}static is(r){return r.__type===uh.__type}get url(){let r=d(this,Lf).url;if(d(this,ch).tokenManager==null)return r;let n=Y2(d(this,Lf).url);if(n==null)return r;let i=n.mapId;try{if(d(this,ch).tokenManager.isEnterpriseMode())return r;let a=d(this,ch).tokenManager.getSasToken(i).token;if(a==null||a==="")throw new Error("SAS token empty!");return"".concat(r,"?").concat(a)}catch(a){return ae.error("Error getting SAS token for image",{error:a,url:r}),r}}get name(){return d(this,Lf).altText}get altText(){return d(this,Lf).altText}toJSON(){return{__type:uh.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(d(this,X1)))delete d(this,X1)[r]}};X1=new WeakMap,Lf=new WeakMap,ch=new WeakMap,o(uh,"ImageMetaData"),b(uh,"__type","image");var ST=uh,ph=ST;var Vg,ip,op,_T=class _T extends iu{constructor(r,n){super(n.properties.id,r);j(this,Vg);j(this,ip);j(this,op,{});$(this,Vg,r),$(this,ip,n)}get externalId(){var r;return(r=d(this,ip).properties.externalId)!=null?r:""}get name(){var n,i,a,u;let r=(i=(n=d(this,ip).properties.details)==null?void 0:n.name)!=null?i:"";return r===""&&(r=(u=(a=this.locationProfiles.find(c=>c.name&&c.name.length>0))==null?void 0:a.name)!=null?u:""),r}get description(){var n,i,a,u;let r=(i=(n=d(this,ip).properties.details)==null?void 0:n.description)!=null?i:"";return r===""&&(r=(u=(a=this.locationProfiles.find(c=>c.description&&c.description.length>0))==null?void 0:a.description)!=null?u:""),r}get images(){var n,i,a,u,c;if(d(this,op).images!=null)return d(this,op).images;let r=(a=(i=(n=d(this,ip).properties.details)==null?void 0:n.images)==null?void 0:i.map(f=>new ph({mvfData:f,mapData:d(this,Vg)})))!=null?a:[];return(r==null||r.length===0)&&(r=(c=(u=this.locationProfiles.find(f=>f.images.length>0))==null?void 0:u.images)!=null?c:[]),d(this,op).images=r,r}get links(){var n,i,a,u,c;if(d(this,op).links!=null)return d(this,op).links;let r=(a=(i=(n=d(this,ip).properties.details)==null?void 0:n.links)==null?void 0:i.map(f=>new lh({mvfData:f})))!=null?a:[];return(r==null||r.length===0)&&(r=(c=(u=this.locationProfiles.find(f=>f.links.length>0))==null?void 0:u.links)!=null?c:[]),d(this,op).links=r,r}get locationProfiles(){var r;return(r=d(this,Vg).locationProfilesByAttachedFeatureId[this.id])!=null?r:[]}};Vg=new WeakMap,ip=new WeakMap,op=new WeakMap,o(_T,"DetailedMapData");var as=_T;var Z1,dh,zg,$g,fh=class fh extends as{constructor(r,n){super(r,n.mvfData);b(this,"__type",fh.__type);j(this,Z1);j(this,dh);j(this,zg,{});j(this,$g);$(this,Z1,r),$(this,dh,n.floorId),$(this,$g,n.mvfData)}static is(r){return r.__type===fh.__type}get center(){return d(this,zg).center==null&&(d(this,zg).center=jo(d(this,$g),d(this,dh))),d(this,zg).center}get floor(){let r=d(this,Z1).getById("floor",d(this,dh));if(r==null)throw new Error("Floor ".concat(d(this,dh)," not found!"));return r}get geoJSON(){return Ie(Y({},d(this,$g)),{properties:null})}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{__type:fh.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Z1=new WeakMap,dh=new WeakMap,zg=new WeakMap,$g=new WeakMap,o(fh,"Area"),b(fh,"__type","area");var CT=fh,Df=CT;g();var mh,sp,gh,Hg,hh=class hh extends as{constructor(r,n){super(r,n.mvfData);b(this,"__type",hh.__type);j(this,mh);j(this,sp);j(this,gh);j(this,Hg);$(this,sp,{}),$(this,Hg,n.mvfData),$(this,mh,r),$(this,gh,n.floorId)}static is(r){return r.__type===hh.__type}get floor(){let r=d(this,mh).getById("floor",d(this,gh));if(r==null)throw new Error("Floor ".concat(d(this,gh)," not found!"));return r}get center(){return d(this,sp).center==null&&(d(this,sp).center=jo(d(this,Hg),d(this,gh))),d(this,sp).center}get isExterior(){var i;let r=d(this,mh).obstructionIdByEntranceId[this.id],n=d(this,mh).getMVFFeatureById("obstruction",r);return(i=n==null?void 0:n.properties.footprintComponent)!=null?i:!1}get geoJSON(){return Ie(Y({},d(this,Hg)),{properties:null})}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{__type:hh.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(d(this,sp)))delete d(this,sp)[r]}};mh=new WeakMap,sp=new WeakMap,gh=new WeakMap,Hg=new WeakMap,o(hh,"Door"),b(hh,"__type","door");var wT=hh,tc=wT;g();var Af,vh,Fa,ap,yh=class yh extends as{constructor(r,n){super(r,n.mvfData);b(this,"__type",yh.__type);j(this,Af);j(this,vh);j(this,Fa,{});j(this,ap);$(this,Af,r),$(this,vh,n.floorId),$(this,ap,n.mvfData)}static is(r){return r.__type===yh.__type}get type(){return bQ(d(this,ap).properties.kind)}get locations(){if(d(this,Fa).locations)return d(this,Fa).locations;d(this,Fa).locations=[];let r=d(this,Af).mvfLocationsBySpaceId[d(this,ap).properties.id];if((r==null?void 0:r.length)>0)for(let n of r){let i=d(this,Af).getById("enterprise-location",n.id);i&&d(this,Fa).locations.push(i)}return d(this,Fa).locations}get floor(){let r=d(this,Af).getById("floor",d(this,vh));if(r==null)throw new Error("Floor ".concat(d(this,vh)," not found!"));return r}get doors(){return d(this,ap).properties.destinationNodes.reduce((r,n)=>{let i=d(this,Af).doorsByNodeId[n];return i&&r.push(i),r},[])}get center(){return d(this,Fa).center==null&&(d(this,Fa).center=jo(d(this,ap),d(this,vh))),d(this,Fa).center}get geoJSON(){return Ie(Y({},d(this,ap)),{properties:null})}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{__type:yh.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(d(this,Fa)))delete d(this,Fa)[r]}};Af=new WeakMap,vh=new WeakMap,Fa=new WeakMap,ap=new WeakMap,o(yh,"Space"),b(yh,"__type","space");var PT=yh,xQ=["room","hallway","exterior","void","gate"];function bQ(e){if(e==null||e==="default")return"room";let t=e.toLowerCase();return xQ.includes(t)?t:"room"}o(bQ,"validateSpaceType");var Vo=PT;g();var cl,In,Na,Wg,X2,xh=class xh extends iu{constructor(r,n){super(n.mvfData.properties.id,r);j(this,Wg);b(this,"__type",xh.__type);j(this,cl);j(this,In,{});j(this,Na);$(this,cl,r),$(this,Na,n.mvfData)}static is(r){return r.__type===xh.__type}get focusTarget(){return this}get name(){var r,n;return"name"in d(this,Na).properties?(n=Re(this,Wg,X2).call(this,"name"))!=null?n:"":(r=d(this,Na).properties.externalId)!=null?r:""}get shortName(){var r,n;return"shortName"in d(this,Na).properties?(n=Re(this,Wg,X2).call(this,"shortName"))!=null?n:"":(r=d(this,Na).properties.externalId)!=null?r:""}get subtitle(){var r;return(r=Re(this,Wg,X2).call(this,"subtitle"))!=null?r:""}get externalId(){var r;return(r=d(this,Na).properties.externalId)!=null?r:""}get elevation(){return d(this,Na).properties.elevation}get spaces(){if(d(this,In).spaces==null){let r=d(this,cl).spaces.filter(n=>n.floor.id===this.id);d(this,In).spaces=r}return d(this,In).spaces}get geoJSON(){var r;return{type:"Feature",properties:null,geometry:(r=d(this,Na).geometry)!=null?r:{type:"Polygon",coordinates:[]}}}get objects(){if(d(this,In).objects==null){let r=d(this,cl).objects.filter(n=>n.floor.id===this.id);d(this,In).objects=r}return d(this,In).objects}get connections(){if(d(this,In).connections==null){let r=d(this,cl).connections.filter(n=>n.floors.includes(this));d(this,In).connections=r}return d(this,In).connections}get doors(){if(d(this,In).doors==null){let r=d(this,cl).doors.filter(n=>n.floor.id===this.id);d(this,In).doors=r}return d(this,In).doors}get annotations(){if(d(this,In).annotations==null){let r=d(this,cl).annotations.filter(n=>n.floor.id===this.id);d(this,In).annotations=r}return d(this,In).annotations}get pois(){if(d(this,In).pois==null){let r=d(this,cl).pointsOfInterest.filter(n=>n.floor.id===this.id);d(this,In).pois=r}return d(this,In).pois}get floorStack(){if(d(this,In).floorStack==null){let r=d(this,cl).floorStacks.find(n=>n.floors.includes(this));d(this,In).floorStack=r}return d(this,In).floorStack}get center(){return d(this,In).center==null&&(d(this,In).center=jo(d(this,Na),this.id)),d(this,In).center}toJSON(){return{__type:xh.__type,id:this.id,name:this.name,shortName:this.shortName,subtitle:this.subtitle,elevation:this.elevation,spaces:this.spaces.map(r=>r.id),objects:this.objects.map(r=>r.id),connections:this.connections.map(r=>r.id),doors:this.doors.map(r=>r.id),annotations:this.annotations.map(r=>r.id),pois:this.pois.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(d(this,In)))delete d(this,In)[r]}};cl=new WeakMap,In=new WeakMap,Na=new WeakMap,Wg=new WeakSet,X2=o(function(r){let n=d(this,Na).properties[r];return d(this,cl).getPropTranslation(this.__type,r,this.id,n)},"#translate"),o(xh,"Floor"),b(xh,"__type","floor");var TT=xh,fa=TT;g();g();g();var K1=o(e=>e!=null,"notNull");g();function J1(e){let t;if(Vo.is(e)||tc.is(e)||Ra.is(e)||Df.is(e)||su.is(e))t=e.center;else if(Ff.is(e)||Nf.is(e))t=e.coordinate;else if(bt.is(e))t=e;else if(Mf.is(e))t=e.coordinate;else if(lp.is(e))t=e.coordinates[0];else return;return t}o(J1,"getCoordinateFromStuffs");g();g();var Q1={debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!0,floorGap:10}},rc="ExteriorWalls",Rf="Walls",hN=0,qg="InteriorDoors",Yg="ExteriorDoors",Fi="GeometryLayer",nc="LabelsLayer",au="MarkersLayer",Xg="FootprintLayer",kf="OcclusionLayer",Zg="ImagesLayer",bh="FacadesLayer",ic="PathsLayer";var mN=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"];var IQ=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors"]),SQ=new Set(["style","enabled","layersHiddenByGeometry","lowDpi"]);function ET(e){var t,r;(t=e.outdoorView)!=null&&t.enabled&&!((r=e.outdoorView)!=null&&r.token)&&ae.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}o(ET,"validateOptions");function MT(e,t){var i,a,u,c,f,m;let r=((i=e==null?void 0:e.outdoorView)==null?void 0:i.token)||t.outdoorViewToken,n=Ie(Y(Y({},Q1),e),{outdoorView:Y({enabled:((a=e==null?void 0:e.outdoorView)==null?void 0:a.enabled)===void 0?!!r:(u=e==null?void 0:e.outdoorView)==null?void 0:u.enabled,layersHiddenByGeometry:(c=Q1.outdoorView)==null?void 0:c.layersHiddenByGeometry},e==null?void 0:e.outdoorView),bearing:(m=(f=e==null?void 0:e.bearing)!=null?f:t.naturalBearing)!=null?m:0,imagePlacementOptions:Y(Y({},Q1.imagePlacementOptions),e==null?void 0:e.imagePlacementOptions),multiFloorView:Y(Y({},Q1.multiFloorView),e==null?void 0:e.multiFloorView)});return r&&n.outdoorView&&(n.outdoorView.token=r),n}o(MT,"handleShow3DMapOptionDefault");function gN(e){let t={remove_watermark:!1};if(e)try{let r=TI(e);Object.assign(t,r.capabilities)}catch(r){ae.error("Error decoding capabilities from token",r)}return t}o(gN,"handleTokenCapabilities");function yN(e){let t=Object.fromEntries(Object.entries(e).filter(([r])=>IQ.has(r)));return t.outdoorView&&(t.outdoorView=Object.fromEntries(Object.entries(t.outdoorView).filter(([r])=>SQ.has(r)))),t}o(yN,"getPublicOptions");var Bf,pl,up,Ih=class Ih extends as{constructor(r,n){let i=Object.values(n.mvfDataByFloorId)[0];super(r,i);b(this,"__type",Ih.__type);j(this,Bf);j(this,pl);j(this,up);$(this,pl,{}),$(this,Bf,r),$(this,up,n.mvfDataByFloorId)}static is(r){return r.__type===Ih.__type}get accessible(){var r;return(r=Object.values(d(this,up))[0].properties.accessible)!=null?r:!1}get type(){var r,n;return(n=(r=Object.values(d(this,up))[0].properties.kind)==null?void 0:r.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(d(this,up))[0].properties.extra}get coordinates(){return d(this,pl).coordinates==null&&(d(this,pl).coordinates=Object.entries(d(this,up)).map(([r,n])=>jo(n,r))),d(this,pl).coordinates}get nodes(){return Object.values(d(this,up))[0].properties.nodes.map(r=>d(this,Bf).getById("node",r))}get floors(){return this.coordinates.map(r=>r.floorId?d(this,Bf).getById("floor",r.floorId):void 0).filter(K1)}get locationProfiles(){var n,i,a,u,c;if(d(this,pl).locationProfiles!=null)return d(this,pl).locationProfiles;let r=super.locationProfiles;if(r==null||r.length===0){let f=[(i=(n=this.coordinates[0])==null?void 0:n.longitude)!=null?i:0,(u=(a=this.coordinates[0])==null?void 0:a.latitude)!=null?u:0],m=ec(f),v=(c=d(this,Bf).mvfConnectionIdsByLatLon[m])!=null?c:[];for(let x of v){let I=d(this,Bf).locationProfilesByAttachedFeatureId[x];if(I!=null){r=I;break}}}return d(this,pl).locationProfiles=r!=null?r:[],r}get focusTarget(){return this.coordinates}toJSON(){return{__type:Ih.__type,id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(r=>r.toJSON()),floors:this.floors.map(r=>r.id),extra:this.extra}}destroy(){for(let r of Object.keys(d(this,pl)))delete d(this,pl)[r]}};Bf=new WeakMap,pl=new WeakMap,up=new WeakMap,o(Ih,"Connection"),b(Ih,"__type","connection");var OT=Ih,Sh=OT;g();var ev,Ch,Gf,wh,_h=class _h extends as{constructor(r,n){super(r,n.mvfData);b(this,"__type",_h.__type);j(this,ev);j(this,Ch);j(this,Gf,{});j(this,wh);$(this,ev,r),$(this,Ch,n.floorId),$(this,wh,n.mvfData)}static is(r){return r.__type===_h.__type}get type(){let r=d(this,wh).properties.kind;return r==null&&(r="object"),r==="Desks"&&(r="desk"),r.toLowerCase()}get floor(){let r=d(this,ev).getById("floor",d(this,Ch));if(r==null)throw new Error("Floor ".concat(d(this,Ch)," not found!"));return r}get center(){return d(this,Gf).center==null&&(d(this,Gf).center=jo(d(this,wh),d(this,Ch))),d(this,Gf).center}get geoJSON(){return Ie(Y({},d(this,wh)),{properties:null})}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{__type:_h.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of globalThis.Object.keys(d(this,Gf)))d(this,Gf)[r]=null}};ev=new WeakMap,Ch=new WeakMap,Gf=new WeakMap,wh=new WeakMap,o(_h,"MapObject"),b(_h,"__type","object");var LT=_h,Ra=LT;g();var tv,Th,jf,Kg,Ph=class Ph extends as{constructor(r,n){super(r,n.mvfData);b(this,"__type",Ph.__type);j(this,tv);j(this,Th);j(this,jf,{});j(this,Kg);$(this,tv,r),$(this,Kg,n.mvfData),$(this,Th,n.floorId)}static is(r){return r.__type===Ph.__type}get floor(){let r=d(this,tv).getById("floor",d(this,Th));if(r==null)throw new Error("Floor ".concat(d(this,Th)," not found!"));return r}get coordinate(){return d(this,jf).coordinate==null&&(d(this,jf).coordinate=jo(d(this,Kg),d(this,Th))),d(this,jf).coordinate}get geoJSON(){return Ie(Y({},d(this,Kg)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Ph.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let r in d(this,jf))d(this,jf)[r]=null}};tv=new WeakMap,Th=new WeakMap,jf=new WeakMap,Kg=new WeakMap,o(Ph,"PointOfInterest"),b(Ph,"__type","point-of-interest");var DT=Ph,Ff=DT;g();var rv,Mh,Uf,Oh,nv,FT,Eh=class Eh extends as{constructor(r,n){super(r,n.mvfData);j(this,nv);b(this,"__type",Eh.__type);j(this,rv);j(this,Mh);j(this,Uf,{});j(this,Oh);$(this,rv,r),$(this,Mh,n.floorId),$(this,Oh,n.mvfData)}static is(r){return r.__type===Eh.__type}get group(){return Re(this,nv,FT).call(this).group}get type(){return Re(this,nv,FT).call(this).type}get coordinate(){return d(this,Uf).coordinate==null&&(d(this,Uf).coordinate=jo(d(this,Oh),d(this,Mh))),d(this,Uf).coordinate}get floor(){let r=d(this,rv).getById("floor",d(this,Mh));if(r==null)throw new Error("Floor ".concat(d(this,Mh)," not found!"));return r}get geoJSON(){return Ie(Y({},d(this,Oh)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Eh.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let r of Object.keys(d(this,Uf)))delete d(this,Uf)[r]}};rv=new WeakMap,Mh=new WeakMap,Uf=new WeakMap,Oh=new WeakMap,nv=new WeakSet,FT=o(function(){let[r,n]=d(this,Oh).properties.symbolId.split("--");return{group:r,type:n}},"#getGroupAndTypeFromSymbolId"),o(Eh,"Annotation"),b(Eh,"__type","annotation");var AT=Eh,Nf=AT;g();var _Q=new Set(["wall","area"]),CQ=new Set(["void","desk-entrance"]),wQ=o((e,t)=>{var f,m,v,x,I,C,T,O,P,L,A;let r={},n={},i={},a={},u={},c={};for(let M of e["location.json"]||[]){let N=new Jg(t,{mvfData:M});if(r[M.id]=N,M.externalId&&(a[M.externalId]==null&&(a[M.externalId]=[]),a[M.externalId].push(N)),M.categories)for(let H of M.categories)u[H]==null&&(u[H]=[]),u[H].push(N);let B=[...(m=(f=M.obstructions)==null?void 0:f.map(H=>H.id))!=null?m:[],...(x=(v=M.spaces)==null?void 0:v.map(H=>H.id))!=null?x:[],...(C=(I=M.annotations)==null?void 0:I.map(H=>H.id))!=null?C:[],...(T=M.connections)!=null?T:[],...(P=(O=M.entrances)==null?void 0:O.map(H=>H.id))!=null?P:[],...(A=(L=M.areas)==null?void 0:L.map(H=>H.id))!=null?A:[]];for(let H of B)H&&(c[H]==null&&(c[H]=[]),c[H].push(N))}for(let M of e["category.json"]||[]){let N=new K2(t,{mvfData:M});n[M.id]=N,M.parent&&(i[M.parent]==null&&(i[M.parent]=[]),i[M.parent].push(N))}return{locationCategoriesByParentId:i,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:a,locationProfilesByCategoryId:u,locationProfilesByAttachedFeatureId:c}},"processMVFLocationProfilesAndCategories"),PQ=o((e,t,r)=>{var O,P;let n={},i={},a={},u={},c={},f={},m={},v={},x={},I={},C={},T=globalThis.Object.keys(e.space);for(let L of T){let A=e.space[L];if(A!=null){for(let M of A.features)if(C[M.properties.id]=L,f[M.properties.id]=M,M.properties.kind==="desk-entrance"&&(c[M.properties.externalId]==null&&(c[M.properties.externalId]=[]),c[M.properties.externalId].push(...M.properties.destinationNodes)),!CQ.has((O=M.properties.kind)!=null?O:"")){if((P=M.properties.kind)!=null&&P.includes("connection")){let N=ec(M.geometry.coordinates);x[N]==null&&(x[N]=[]),x[N].push(M.properties.id);continue}if(M.properties.kind==="poi"){let N=new Ff(r,{floorId:L,mvfData:M});a[M.properties.id]=N,v[L]||(v[L]=[]),v[L].push(M),M.properties.externalId&&(u[M.properties.externalId]==null&&(u[M.properties.externalId]=[]),u[M.properties.externalId].push(N))}else{let N=new Vo(r,{floorId:L,mvfData:M});n[M.properties.id]=N,M.properties.externalId&&(i[M.properties.externalId]==null&&(i[M.properties.externalId]=[]),i[M.properties.externalId].push(N)),m[L]||(m[L]=[]),m[L].push(M)}}}}for(let L in x){let A=x[L],M={};for(let B of A){let H=C[B],z=f[B],R=t==null?void 0:t["n_"+z.properties.id.split("s_")[1]];M[H]=Ie(Y({},z),{properties:Ie(Y({},z.properties),{accessible:(R==null?void 0:R.accessible)===!0})})}let N=new Sh(r,{mvfDataByFloorId:M});I[N.id]=N}return{spacesById:n,spacesByExternalId:i,poisById:a,poisByExternalId:u,connectionsById:I,objectEntranceNodeIdsByObstructionId:c,mvfSpacesById:f,connectionIdsByLatLon:x,mvfSpacesByFloorId:m,mvfPoisByFloorId:v}},"processMVFSpaces"),TQ=o((e,t)=>{var u,c;let r={},n={},i={},a={};for(let f of e["node.geojson"].features){i[f.properties.id]=f;let m=new Mf(t,{mvfData:f,floorId:(u=f.properties.floor)!=null?u:f.properties.map});r[f.properties.id]=m,f.properties.externalId&&(n[f.properties.externalId]==null&&(n[f.properties.externalId]=[]),n[f.properties.externalId].push(m));let v=(c=f.properties.floor)!=null?c:f.properties.map;a[v]||(a[v]=[]),a[v].push(f)}return{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:a}},"processMVFNodes"),EQ=o((e,t)=>{var c,f;let r={},n={},i={},a={},u=globalThis.Object.keys(e.obstruction);for(let m of u){let v=e.obstruction[m];if(v!=null)for(let x of v.features){i[x.properties.id]=x;for(let C of x.properties.entrances)a[C]=x.properties.id;if(_Q.has((f=(c=x.properties.kind)==null?void 0:c.toLowerCase())!=null?f:""))continue;let I=new Ra(t,{floorId:m,mvfData:x});r[x.properties.id]=I,x.properties.externalId&&(n[x.properties.externalId]==null&&(n[x.properties.externalId]=[]),n[x.properties.externalId].push(I))}}return{objectsById:r,objectsByExternalId:n,mvfObstructionById:i,obstructionIdByEntranceId:a}},"processMVFObstructions"),MQ=o((e,t)=>{let r={},n={},i={};if("floor.geojson"in e&&e["floor.geojson"]!=null)for(let a of e["floor.geojson"].features){i[a.properties.id]=a.properties;let u=new fa(t,{mvfData:a});r[a.properties.id]=u,a.properties.externalId&&(n[a.properties.externalId]==null&&(n[a.properties.externalId]=[]),n[a.properties.externalId].push(u))}else for(let a of e["map.geojson"]){i[a.id]=a;let u=new fa(t,{mvfData:{properties:a}});r[a.id]=u}return{floorsById:r,floorsByExternalId:n,mvfFloorsById:i}},"processMVFFloors"),OQ=o((e,t)=>{var f;let r={},n={},i={},a={},u={},c=e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"];if(c!=null)for(let m of c){let v=(f=e.facade)==null?void 0:f[m.id],x=new q2(t,{mvfData:m,facadeId:v==null?void 0:v.id});if(r[m.id]=x,m.externalId&&(n[m.externalId]==null&&(n[m.externalId]=[]),n[m.externalId].push(x)),i[m.id]=m,v){let I=new su(t,{mvfData:v,floorStackId:m.id});a[v.id]=I;for(let C of v.spaces)u[C.spaceId]=I}}return{floorStacksById:r,floorStacksByExternalId:n,mvfFloorStacksById:i,facadesById:a,facadesBySpaceId:u}},"processMVFFloorStacks"),LQ=o((e,t)=>{let r={},n={},i=e["connection.json"].reduce((a,u)=>{u.nodes.forEach(f=>a[f]=u),r[u.id]=u;let c=t==null?void 0:t[u.nodes[0]];if(c!=null){let f=ec(c.geometry.coordinates);n[f]==null&&(n[f]=[]),n[f].push(u.id)}return a},{});return{mvfConnectionsById:r,mvfConnectionsByNodeId:i,mvfConnectionIdsByLatLon:n}},"processMVFConnections"),DQ=o((e,t)=>{let r={},n={},i={},a={},u={},c=globalThis.Object.keys(e.entrance);for(let f of c){let m=e.entrance[f];if(m!=null)for(let v of m.features){a[v.properties.id]=v;let x=new tc(t,{floorId:f,mvfData:v});v.properties.node&&(i[v.properties.node]=x),r[v.properties.id]=x,v.properties.externalId&&(n[v.properties.externalId]==null&&(n[v.properties.externalId]=[]),n[v.properties.externalId].push(x)),u[f]||(u[f]=[]),u[f].push(v)}}return{doorsById:r,doorsByExternalId:n,doorsByNodeId:i,mvfEntrancesById:a,mvfEntrancesByFloorId:u}},"processMVFEntrances"),AQ=o((e,t,r)=>{var n;if(e.textAreas!=null)for(let i in e.textAreas){let a=(n=e.textAreas[i])==null?void 0:n.features;if(a!=null){for(let u of a)if("anchorId"in u.properties){let c=u==null?void 0:u.properties,f=t[c.anchorId]||r[c.anchorId];if(f!=null&&c!=null){let m=f.properties;m.textArea=c,m.textArea&&(m.textArea.position=u.geometry.coordinates)}}}}},"processMVFTextAreas"),FQ=o((e,t,r)=>{var n;if(e.floorImages!=null)for(let i in e.floorImages){let a=(n=e.floorImages[i])==null?void 0:n.features;if(a!=null){for(let u of a)if("anchorId"in u.properties){let c=u==null?void 0:u.properties,f=t[c.anchorId]||r[c.anchorId];if(f!=null&&c!=null){let m=f.properties;m.image=c,m.image&&(m.image.position=u.geometry.coordinates)}}}}},"processMVFPolygonImages"),NQ=o((e,t)=>{var n,i;if(((n=e.enterprise)==null?void 0:n.enterpriseStyles)==null)return;let r=(i=e.enterprise)==null?void 0:i.enterpriseStyles;for(let a in r){let u=r[a];u.geometryAnchors.forEach(c=>{let f=t[c.geometryId];if(f!=null){let m=f.properties;m.style={styleId:a,edgeOffset:u.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),RQ=o((e,t,r)=>{if(!(e.enterprise==null||e.enterprise.textures==null))for(let n of e.enterprise.textures)for(let i of n.geometryAnchors){let a=t[i.geometryId]||r[i.geometryId];if(a!=null){let u=a.properties;u.textures==null&&(u.textures=[]),u.textures.push(n)}}},"processMVFEnterpriseTextures"),kQ=o((e,t)=>{let r={},n={},i={};if(e.annotation==null)return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i};let a=globalThis.Object.keys(e.annotation);for(let u of a){let c=e.annotation[u];if(c!=null)for(let f of c.features){n[f.properties.id]=f;let m=new Nf(t,{floorId:u,mvfData:f});r[f.properties.id]=m,i[u]||(i[u]=[]),i[u].push(f)}}return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i}},"processMVFAnnotations"),BQ=o((e,t)=>{let r={},n={},i={};if(e.area==null)return{areasById:r,areasByExternalId:n,mvfAreasById:i};let a=globalThis.Object.keys(e.area);for(let u of a){let c=e.area[u];if(c!=null)for(let f of c.features){i[f.properties.id]=f;let m=new Df(t,{floorId:u,mvfData:f});r[f.properties.id]=m,f.properties.externalId&&(n[f.properties.externalId]==null&&(n[f.properties.externalId]=[]),n[f.properties.externalId].push(m))}}return{areasById:r,areasByExternalId:n,mvfAreasById:i}},"processMVFAreas"),vN=o((e,t)=>{var A,M,N,B,H,z,R,X,ie,Q,U,Te,oe;let r={},n={},i={},a={},u=((M=(A=e.enterprise)==null?void 0:A.locations)!=null?M:[]).reduce((fe,se)=>(fe[se.id]=se,fe),{}),c={},f={},m={},v={},x={},I={},C=((N=e.enterprise)==null?void 0:N.venue)||{},T={},O={},P={};for(let fe of(H=(B=e.enterprise)==null?void 0:B.categories)!=null?H:[]){let se=new Z2(t,{mvfData:fe});c[fe.id]=se,fe.externalId&&(f[fe.externalId]==null&&(f[fe.externalId]=[]),f[fe.externalId].push(se)),m[fe.id]=fe,fe.locations.forEach(ve=>{x[ve]==null&&(x[ve]=[]),x[ve].push(fe.id)})}let L={};for(let fe of(R=(z=e.enterprise)==null?void 0:z.locationInstances)!=null?R:[]){let se=u[fe.parent],ve=Object.keys(se),ue={};for(let Z of ve)ue[Z]=void 0;let he=Y(Ie(Y({},ue),{polygons:[],nodes:[]}),fe);L[he.parent]==null&&(L[he.parent]=[]),L[he.parent].push(new lp(t,{mvfData:he,categoryIds:((ie=(X=e.enterprise)==null?void 0:X.categoryPriorities)==null?void 0:ie[he.id])||x[he.id],parentId:fe.parent})),T[he.id]=fe}for(let fe in e.space){let se=e.space[fe];if(se!=null)for(let ve of se.features){for(let ue of ve.properties.destinationNodes)O[ue]==null&&(O[ue]=[]),O[ue].push(ve.properties.id);P[ve.properties.id]=ve.properties.destinationNodes}}for(let fe of(U=(Q=e.enterprise)==null?void 0:Q.locations)!=null?U:[]){let se=new lp(t,{mvfData:fe,categoryIds:((oe=(Te=e.enterprise)==null?void 0:Te.categoryPriorities)==null?void 0:oe[fe.id])||x[fe.id],locationInstances:L[fe.id]});i[fe.id]=se,fe.externalId&&(a[fe.externalId]==null&&(a[fe.externalId]=[]),a[fe.externalId].push(se)),fe.nodes.forEach(ve=>{I[ve.id]==null&&(I[ve.id]=[]),I[ve.id].push(fe.id)});for(let ve of fe.polygons)v[ve.id]==null&&(v[ve.id]=[]),v[ve.id].push(fe)}if(t.enterpriseMode===!0){for(let fe in t.mvfConnectionsById){let se={},ve=t.mvfConnectionsById[fe];for(let ue of t.mvfConnectionsById[fe].nodes){let he=t.nodesById[ue];he!=null&&(se[he.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[he.coordinate.longitude,he.coordinate.latitude]},properties:{id:fe,externalId:ve.externalId,kind:"enterprise."+ve.type,destinationNodes:[],flags:"",type:ve.type,nodes:ve.nodes,accessible:ve.accessible,extra:ve.extra,details:ve.details}})}Object.keys(se).length>0&&(r[fe]=new Sh(t,{mvfDataByFloorId:se}),ve.externalId&&(n[ve.externalId]==null&&(n[ve.externalId]=[]),n[ve.externalId].push(r[fe])))}t.connectionsById=r}return{spaceIdsByNodeId:O,connectionsByExternalId:n,locationIdsByNodeId:I,mvfLocationsBySpaceId:v,mvfLocationsById:u,mvfCategoriesById:m,locationsById:i,locationsByExternalId:a,locationInstancesById:T,categoriesById:c,categoriesByExternalId:f,destinationNodesIdsBySpaceId:P,venue:C}},"createEnterpriseDataFromMVF"),xN=o((e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:a}=TQ(e,t),{mvfConnectionsById:u,mvfConnectionsByNodeId:c,mvfConnectionIdsByLatLon:f}=LQ(e,i),{spacesById:m,spacesByExternalId:v,poisById:x,poisByExternalId:I,mvfSpacesById:C,objectEntranceNodeIdsByObstructionId:T,connectionsById:O,connectionIdsByLatLon:P,mvfSpacesByFloorId:L,mvfPoisByFloorId:A}=PQ(e,c,t),{objectsById:M,objectsByExternalId:N,mvfObstructionById:B,obstructionIdByEntranceId:H}=EQ(e,t),{floorsById:z,floorsByExternalId:R,mvfFloorsById:X}=MQ(e,t),{floorStacksById:ie,floorStacksByExternalId:Q,mvfFloorStacksById:U,facadesById:Te,facadesBySpaceId:oe}=OQ(e,t),{doorsById:fe,doorsByExternalId:se,doorsByNodeId:ve,mvfEntrancesById:ue,mvfEntrancesByFloorId:he}=DQ(e,t),{annotationsById:Z,mvfAnnotationsById:Ke,mvfAnnotationsByFloorId:Ue}=kQ(e,t),{areasById:rt,areasByExternalId:Ee,mvfAreasById:We}=BQ(e,t);FQ(e,C,B),AQ(e,C,B),NQ(e,C),RQ(e,C,B);let{locationCategoriesByParentId:St,locationProfilesById:yt,locationCategoriesById:pt,locationProfilesByExternalId:te,locationProfilesByCategoryId:ce,locationProfilesByAttachedFeatureId:ee}=wQ(e,t);return{spacesById:m,spacesByExternalId:v,nodesById:r,nodesByExternalId:n,objectsById:M,objectsByExternalId:N,floorsById:z,floorsByExternalId:R,floorStacksById:ie,floorStacksByExternalId:Q,facadesById:Te,facadesBySpaceId:oe,connectionsById:O,doorsById:fe,doorsByExternalId:se,doorsByNodeId:ve,poisById:x,poisByExternalId:I,annotationsById:Z,areasById:rt,areasByExternalId:Ee,objectEntranceNodeIdsByObstructionId:T,obstructionIdByEntranceId:H,connectionIdsByLatLon:P,locationProfilesById:yt,locationCategoriesById:pt,locationProfilesByExternalId:te,locationProfilesByCategoryId:ce,locationCategoriesByParentId:St,mvfSpacesById:C,mvfNodesById:i,mvfObstructionById:B,mvfFloorsById:X,mvfFloorStacksById:U,mvfConnectionsById:u,mvfConnectionsByNodeId:c,mvfEntrancesById:ue,mvfAnnotationsById:Ke,mvfNodesByFloorId:a,mvfSpacesByFloorId:L,mvfPoisByFloorId:A,mvfAreasById:We,mvfEntrancesByFloorId:he,mvfAnnotationsByFloorId:Ue,locationProfilesByAttachedFeatureId:ee,mvfConnectionIdsByLatLon:f}},"createDataFromMVF");g();g();g();var GQ=o(function(){let t=globalThis.fetch;return{fetch(...r){if(!K1(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...r)},setFetch(r){t=r}}},"createFetchControl")(),bN=GQ.fetch;var wN=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],IN=wN[0],PN="https://api-gateway.mappedin.com/track-analytics/a/",TN="deny-watchposition",EN="load-mapview",MN="load-mapdata",ON="change-language",LN="query-directions";var oc,fl,cp,RT,J2,kT=class kT{constructor(){j(this,cp);j(this,oc,Object.freeze({}));j(this,fl);b(this,"oneTimeEventsSent",new Set);b(this,"sendGetDirectionsEvent",yw((t,r)=>this.sendAnalyticEvent(LN,{start:t,end:r,type:"location_to_location"}),2500));$(this,fl,Re(this,cp,J2).call(this,d(this,oc)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){$(this,oc,{}),$(this,fl,Re(this,cp,J2).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return $(this,oc,Object.freeze(Object.assign({},d(this,oc),t))),$(this,fl,Re(this,cp,J2).call(this,t)),Re(this,cp,RT).call(this,d(this,fl)),d(this,fl)}updateState(t){let r=Y({},t);r.mapId&&(r.analyticsBaseUrl=NT(Ie(Y({},d(this,fl)),{mapId:r.mapId}))),r.context&&(r.context=CN(r.context)),r.baseUri&&(r.analyticsBaseUrl=NT({baseUri:r.baseUri,mapId:d(this,fl).mapId})),Object.assign(d(this,fl),r),this.handleStateUpdate(t),Re(this,cp,RT).call(this,r)}handleStateUpdate(t){var r;(r=t.userPosition)!=null&&r.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:r,accessToken:n}=this.getState();return!!(t&&r)||!!n}getState(){return d(this,fl)}getContext(){return this.getState().context||d(this,oc).context||IN}getSessionId(){return this.getState().sessionId||d(this,oc).sessionId||_N()}getDeviceId(){return this.getState().deviceId||d(this,oc).deviceId||SN()}sendAnalyticEvent(t,r={}){let n=this.getState(),i=jQ(n.analyticsBaseUrl,t),a={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(n.logEvents&&ae.log("Analytics.track",i,a),!n.sendEvents)return Promise.resolve();if(!this.authReady)return ae.warn("Auth needs to be ready to send analytics.");let u=Ie(Y({},r),{g:n.geolocationMode,sdk_version:n.version});return n.userPosition&&Object.assign(u,n.userPosition),a["Content-Type"]="application/json",n.accessToken?a.Authorization="Bearer ".concat(n.accessToken):n.noAuth||n.secret&&n.key&&(a["x-mappedin-key"]=btoa(n.key),a["x-mappedin-secret"]=btoa(n.secret)),bN(i,{method:"POST",mode:"cors",headers:a,body:JSON.stringify(u)})}capture(t,r){if(VQ.includes(t))return ae.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=UQ.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,r)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(MN,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(ON,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(TN)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:r,collisionWorkerDisabled:n,outdoorsWorkerDisabled:i}){return this.sendAnalyticEvent(EN,{type:"3d",firstRenderDuration:t,width:r.width,height:r.height,devicePixelRatio:globalThis.devicePixelRatio||1,collisionWorkerDisabled:n,outdoorsWorkerDisabled:i})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};oc=new WeakMap,fl=new WeakMap,cp=new WeakSet,RT=o(function(t){t.sessionId&&Kc.getInstance().saveSessionData("id",t.sessionId),t.deviceId&&Kc.getInstance().saveLocalData("deviceId",t.deviceId)},"#saveStateToStorage"),J2=o(function(t){var n,i,a,u;let r=(n=t.baseUri)!=null?n:PN;return{baseUri:r,analyticsBaseUrl:NT(Ie(Y({},t),{baseUri:r})),version:((i=S==null?void 0:S.env)==null?void 0:i.npm_package_version)||"v6",deviceId:t.deviceId||SN(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||_N(),platformString:t.platformString||"",context:CN(t.context)||IN,geolocationMode:!1,sendEvents:(a=t.sendEvents)!=null?a:!0,logEvents:(u=t.logEvents)!=null?u:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),o(kT,"AnalyticsInternal");var Qg=kT;function NT({mapId:e,baseUri:t=PN}){return"".concat(t).concat(e,"/")}o(NT,"getBaseUrl");function SN(){return Kc.getInstance().loadLocalData("deviceId")}o(SN,"getDeviceIDFromStorage");function _N(){return Kc.getInstance().loadSessionData("id")}o(_N,"getSessionIDFromStorage");function jQ(e,t){return e+t}o(jQ,"buildUrl");function CN(e){return wN.find(t=>t===e)}o(CN,"getValidContext");var UQ=["$select-location","$select-category","$query-suggest","$query-search"],VQ=[EN,MN,LN,TN,ON],MWe=new Qg,dl,BT=class BT{constructor(t){j(this,dl);b(this,"capture");b(this,"updateState");$(this,dl,t),this.capture=d(this,dl).capture.bind(d(this,dl)),this.updateState=d(this,dl).updateState.bind(d(this,dl))}getState(){let i=d(this,dl).getState(),{sessionId:t,deviceId:r}=i;return is(i,["sessionId","deviceId"])}getContext(){return d(this,dl).getContext()}getSessionId(){return d(this,dl).getSessionId()}getDeviceId(){return d(this,dl).getDeviceId()}};dl=new WeakMap,o(BT,"Analytics");var iv=BT;g();var zQ=new Set(["polygons"]),lu,hi,da,ov,Lh=class Lh extends ho{constructor(r,n){super(n.mvfData.externalId);b(this,"__type",Lh.__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);j(this,lu);j(this,hi,{});j(this,da);j(this,ov);$(this,lu,r),$(this,da,n.mvfData),$(this,ov,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let i in n.mvfData)!zQ.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{enumerable:!0,get(){if(n.parentId){let a=d(this,lu).locationsById[n.parentId];return d(this,da)[i]!=null?d(this,lu).getPropTranslation(this.__type,i,d(this,da).id,d(this,da)[i]):d(this,lu).getPropTranslation(this.__type,i,d(this,da).id,a[i])}return d(this,lu).getPropTranslation(this.__type,i,d(this,da).id,d(this,da)[i])}})}static is(r){return r.__type===Lh.__type}get focusTarget(){return this.spaces}get categories(){return d(this,hi).categories?d(this,hi).categories:(d(this,hi).categories=(d(this,ov).map(r=>d(this,lu).getById("enterprise-category",r))||[]).filter(Boolean),d(this,hi).categories)}get coordinates(){if(d(this,hi).coordinates)return d(this,hi).coordinates;d(this,hi).coordinates=[];for(let r=0;r<this.nodes.length;r++)d(this,hi).coordinates.push(this.nodes[r].coordinate);return d(this,hi).coordinates}get nodes(){if(d(this,hi).nodes)return d(this,hi).nodes;d(this,hi).nodes=[];for(let r=0;r<d(this,da).nodes.length;r++){let n=d(this,lu).getById("node",d(this,da).nodes[r].id);n&&d(this,hi).nodes.push(n)}return d(this,hi).nodes}get spaces(){if(d(this,hi).spaces)return d(this,hi).spaces;d(this,hi).spaces=[];for(let r=0;r<d(this,da).polygons.length;r++){let n=d(this,lu).getById("space",d(this,da).polygons[r].id);n&&d(this,hi).spaces.push(n)}return d(this,hi).spaces}toJSON(){return{__type:Lh.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,hi)))delete d(this,hi)[r]}};lu=new WeakMap,hi=new WeakMap,da=new WeakMap,ov=new WeakMap,o(Lh,"EnterpriseLocation"),b(Lh,"__type","enterprise-location");var GT=Lh,lp=GT;g();var $Q=new Set,Ah,qs,sc,Dh=class Dh extends ho{constructor(r,n){super(n.mvfData.externalId);b(this,"__type",Dh.__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");j(this,Ah);j(this,qs,{});j(this,sc);$(this,Ah,r),$(this,sc,n.mvfData);for(let i in n.mvfData)!$Q.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{get(){return d(this,Ah).getPropTranslation(this.__type,i,d(this,sc).id,d(this,sc)[i])}})}static is(r){return r.__type===Dh.__type}get children(){if(d(this,qs).children)return d(this,qs).children;d(this,qs).children=[];for(let r=0;r<d(this,sc).children.length;r++){let n=d(this,Ah).getById("enterprise-category",d(this,sc).children[r]);n&&d(this,qs).children.push(n)}return d(this,qs).children}get locations(){if(d(this,qs).locations)return d(this,qs).locations;d(this,qs).locations=[];for(let r=0;r<d(this,sc).locations.length;r++){let n=d(this,Ah).getById("enterprise-location",d(this,sc).locations[r]);n&&d(this,qs).locations.push(n)}return d(this,qs).locations}toJSON(){return{__type:Dh.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,qs)))delete d(this,qs)[r]}};Ah=new WeakMap,qs=new WeakMap,sc=new WeakMap,o(Dh,"EnterpriseCategory"),b(Dh,"__type","enterprise-category");var jT=Dh,Z2=jT;g();var HQ=new Set,sv,av,Fh=class Fh extends ho{constructor(r,n){super(n.mvfData.externalId);b(this,"__type",Fh.__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");j(this,sv,{});j(this,av);$(this,av,n.mvfData);for(let i in n.mvfData)!HQ.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&(this[i]=n.mvfData[i])}static is(r){return r.__type===Fh.__type}get name(){var r;return(r=d(this,av).name)!=null?r:""}toJSON(){return{__type:Fh.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,sv)))delete d(this,sv)[r]}};sv=new WeakMap,av=new WeakMap,o(Fh,"EnterpriseVenue"),b(Fh,"__type","enterprise-venue");var UT=Fh,VT=UT;g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();var Wr={};bf(Wr,{HasPropertyKey:()=>WQ,IsArray:()=>Es,IsAsyncIterator:()=>zT,IsBigInt:()=>lv,IsBoolean:()=>Vf,IsDate:()=>Nh,IsFunction:()=>$T,IsIterator:()=>HT,IsNull:()=>WT,IsNumber:()=>uu,IsObject:()=>An,IsRegExp:()=>uv,IsString:()=>qn,IsSymbol:()=>qT,IsUint8Array:()=>pp,IsUndefined:()=>Ci});g();function WQ(e,t){return t in e}o(WQ,"HasPropertyKey");function zT(e){return An(e)&&!Es(e)&&!pp(e)&&Symbol.asyncIterator in e}o(zT,"IsAsyncIterator");function Es(e){return Array.isArray(e)}o(Es,"IsArray");function lv(e){return typeof e=="bigint"}o(lv,"IsBigInt");function Vf(e){return typeof e=="boolean"}o(Vf,"IsBoolean");function Nh(e){return e instanceof globalThis.Date}o(Nh,"IsDate");function $T(e){return typeof e=="function"}o($T,"IsFunction");function HT(e){return An(e)&&!Es(e)&&!pp(e)&&Symbol.iterator in e}o(HT,"IsIterator");function WT(e){return e===null}o(WT,"IsNull");function uu(e){return typeof e=="number"}o(uu,"IsNumber");function An(e){return typeof e=="object"&&e!==null}o(An,"IsObject");function uv(e){return e instanceof globalThis.RegExp}o(uv,"IsRegExp");function qn(e){return typeof e=="string"}o(qn,"IsString");function qT(e){return typeof e=="symbol"}o(qT,"IsSymbol");function pp(e){return e instanceof globalThis.Uint8Array}o(pp,"IsUint8Array");function Ci(e){return e===void 0}o(Ci,"IsUndefined");function qQ(e){return e.map(t=>Q2(t))}o(qQ,"ArrayType");function YQ(e){return new Date(e.getTime())}o(YQ,"DateType");function XQ(e){return new Uint8Array(e)}o(XQ,"Uint8ArrayType");function ZQ(e){return new RegExp(e.source,e.flags)}o(ZQ,"RegExpType");function KQ(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Q2(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Q2(e[r]);return t}o(KQ,"ObjectType");function Q2(e){return Es(e)?qQ(e):Nh(e)?YQ(e):pp(e)?XQ(e):uv(e)?ZQ(e):An(e)?KQ(e):e}o(Q2,"Visit");function ri(e){return Q2(e)}o(ri,"Clone");function DN(e){return e.map(t=>cv(t))}o(DN,"CloneRest");function cv(e,t){return t===void 0?ri(e):ri(Y(Y({},t),e))}o(cv,"CloneType");g();g();g();function eS(e){return zt(e)&&Symbol.asyncIterator in e}o(eS,"IsAsyncIterator");function tS(e){return zt(e)&&Symbol.iterator in e}o(tS,"IsIterator");function YT(e){return zt(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}o(YT,"IsStandardObject");function rS(e){return e instanceof Promise}o(rS,"IsPromise");function Ys(e){return e instanceof Date&&Number.isFinite(e.getTime())}o(Ys,"IsDate");function AN(e){return e instanceof globalThis.Map}o(AN,"IsMap");function FN(e){return e instanceof globalThis.Set}o(FN,"IsSet");function hl(e){return ArrayBuffer.isView(e)}o(hl,"IsTypedArray");function ey(e){return e instanceof globalThis.Uint8Array}o(ey,"IsUint8Array");function Et(e,t){return t in e}o(Et,"HasPropertyKey");function zt(e){return e!==null&&typeof e=="object"}o(zt,"IsObject");function kt(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}o(kt,"IsArray");function wi(e){return e===void 0}o(wi,"IsUndefined");function fp(e){return e===null}o(fp,"IsNull");function ac(e){return typeof e=="boolean"}o(ac,"IsBoolean");function vt(e){return typeof e=="number"}o(vt,"IsNumber");function nS(e){return Number.isInteger(e)}o(nS,"IsInteger");function ls(e){return typeof e=="bigint"}o(ls,"IsBigInt");function qr(e){return typeof e=="string"}o(qr,"IsString");function zf(e){return typeof e=="function"}o(zf,"IsFunction");function dp(e){return typeof e=="symbol"}o(dp,"IsSymbol");function us(e){return ls(e)||ac(e)||fp(e)||vt(e)||qr(e)||dp(e)||wi(e)}o(us,"IsValueType");var vn;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(u,c){return e.ExactOptionalPropertyTypes?c in u:u[c]!==void 0}o(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(u){let c=zt(u);return e.AllowArrayObject?c:c&&!kt(u)}o(r,"IsObjectLike"),e.IsObjectLike=r;function n(u){return r(u)&&!(u instanceof Date)&&!(u instanceof Uint8Array)}o(n,"IsRecordLike"),e.IsRecordLike=n;function i(u){return e.AllowNaN?vt(u):Number.isFinite(u)}o(i,"IsNumberLike"),e.IsNumberLike=i;function a(u){let c=wi(u);return e.AllowNullVoid?c||u===null:c}o(a,"IsVoidLike"),e.IsVoidLike=a})(vn||(vn={}));g();function JQ(e){return globalThis.Object.freeze(e).map(t=>pv(t))}o(JQ,"ImmutableArray");function QQ(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=pv(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=pv(e[r]);return globalThis.Object.freeze(t)}o(QQ,"ImmutableObject");function pv(e){return Es(e)?JQ(e):Nh(e)?e:pp(e)?e:uv(e)?e:An(e)?QQ(e):e}o(pv,"Immutable");function Ne(e,t){let r=t!==void 0?Y(Y({},t),e):e;switch(vn.InstanceMode){case"freeze":return pv(r);case"clone":return ri(r);default:return r}}o(Ne,"CreateType");g();var XT=class XT extends Error{constructor(t){super(t)}};o(XT,"TypeBoxError");var Tt=XT;g();g();g();var ni=Symbol.for("TypeBox.Transform"),hp=Symbol.for("TypeBox.Readonly"),Xs=Symbol.for("TypeBox.Optional"),ml=Symbol.for("TypeBox.Hint"),Se=Symbol.for("TypeBox.Kind");function NN(e){return An(e)&&e[hp]==="Readonly"}o(NN,"IsReadonly");function lc(e){return An(e)&&e[Xs]==="Optional"}o(lc,"IsOptional");function ZT(e){return Jr(e,"Any")}o(ZT,"IsAny");function mp(e){return Jr(e,"Array")}o(mp,"IsArray");function fv(e){return Jr(e,"AsyncIterator")}o(fv,"IsAsyncIterator");function KT(e){return Jr(e,"BigInt")}o(KT,"IsBigInt");function JT(e){return Jr(e,"Boolean")}o(JT,"IsBoolean");function dv(e){return Jr(e,"Constructor")}o(dv,"IsConstructor");function eee(e){return Jr(e,"Date")}o(eee,"IsDate");function hv(e){return Jr(e,"Function")}o(hv,"IsFunction");function Rh(e){return Jr(e,"Integer")}o(Rh,"IsInteger");function $i(e){return Jr(e,"Intersect")}o($i,"IsIntersect");function mv(e){return Jr(e,"Iterator")}o(mv,"IsIterator");function Jr(e,t){return An(e)&&Se in e&&e[Se]===t}o(Jr,"IsKindOf");function gp(e){return Jr(e,"Literal")}o(gp,"IsLiteral");function ka(e){return Jr(e,"MappedKey")}o(ka,"IsMappedKey");function ii(e){return Jr(e,"MappedResult")}o(ii,"IsMappedResult");function $f(e){return Jr(e,"Never")}o($f,"IsNever");function tee(e){return Jr(e,"Not")}o(tee,"IsNot");function ree(e){return Jr(e,"Null")}o(ree,"IsNull");function kh(e){return Jr(e,"Number")}o(kh,"IsNumber");function yo(e){return Jr(e,"Object")}o(yo,"IsObject");function Bh(e){return Jr(e,"Promise")}o(Bh,"IsPromise");function QT(e){return Jr(e,"Record")}o(QT,"IsRecord");function eE(e){return Jr(e,"Ref")}o(eE,"IsRef");function tE(e){return Jr(e,"RegExp")}o(tE,"IsRegExp");function gv(e){return Jr(e,"String")}o(gv,"IsString");function nee(e){return Jr(e,"Symbol")}o(nee,"IsSymbol");function Ba(e){return Jr(e,"TemplateLiteral")}o(Ba,"IsTemplateLiteral");function iee(e){return Jr(e,"This")}o(iee,"IsThis");function ty(e){return An(e)&&ni in e}o(ty,"IsTransform");function cu(e){return Jr(e,"Tuple")}o(cu,"IsTuple");function oee(e){return Jr(e,"Undefined")}o(oee,"IsUndefined");function un(e){return Jr(e,"Union")}o(un,"IsUnion");function see(e){return Jr(e,"Uint8Array")}o(see,"IsUint8Array");function aee(e){return Jr(e,"Unknown")}o(aee,"IsUnknown");function lee(e){return Jr(e,"Unsafe")}o(lee,"IsUnsafe");function uee(e){return Jr(e,"Void")}o(uee,"IsVoid");function Hf(e){return An(e)&&Se in e&&qn(e[Se])}o(Hf,"IsKind");function pu(e){return ZT(e)||mp(e)||JT(e)||KT(e)||fv(e)||dv(e)||eee(e)||hv(e)||Rh(e)||$i(e)||mv(e)||gp(e)||ka(e)||ii(e)||$f(e)||tee(e)||ree(e)||kh(e)||yo(e)||Bh(e)||QT(e)||eE(e)||tE(e)||gv(e)||nee(e)||Ba(e)||iee(e)||cu(e)||oee(e)||un(e)||see(e)||aee(e)||lee(e)||uee(e)||Hf(e)}o(pu,"IsSchema");var ne={};bf(ne,{IsAny:()=>GN,IsArray:()=>jN,IsAsyncIterator:()=>UN,IsBigInt:()=>VN,IsBoolean:()=>zN,IsConstructor:()=>$N,IsDate:()=>HN,IsFunction:()=>WN,IsInteger:()=>qN,IsIntersect:()=>YN,IsIterator:()=>XN,IsKind:()=>xR,IsKindOf:()=>Xr,IsLiteral:()=>vv,IsLiteralBoolean:()=>mee,IsLiteralNumber:()=>KN,IsLiteralString:()=>ZN,IsLiteralValue:()=>JN,IsMappedKey:()=>QN,IsMappedResult:()=>eR,IsNever:()=>tR,IsNot:()=>rR,IsNull:()=>nR,IsNumber:()=>iR,IsObject:()=>oR,IsOptional:()=>hee,IsPromise:()=>sR,IsProperties:()=>oE,IsReadonly:()=>dee,IsRecord:()=>aR,IsRecursive:()=>gee,IsRef:()=>lR,IsRegExp:()=>uR,IsSchema:()=>Yr,IsString:()=>cR,IsSymbol:()=>pR,IsTemplateLiteral:()=>fR,IsThis:()=>dR,IsTransform:()=>Yn,IsTuple:()=>hR,IsUint8Array:()=>mR,IsUndefined:()=>ry,IsUnion:()=>sE,IsUnionLiteral:()=>yee,IsUnknown:()=>gR,IsUnsafe:()=>yR,IsVoid:()=>vR,TypeGuardUnknownTypeError:()=>rE});g();var aE=class aE extends Tt{};o(aE,"TypeGuardUnknownTypeError");var rE=aE,cee=["Any","Array","AsyncIterator","BigInt","Boolean","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function RN(e){try{return new RegExp(e),!0}catch(t){return!1}}o(RN,"IsPattern");function nE(e){if(!qn(e))return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}o(nE,"IsControlCharacterFree");function kN(e){return iE(e)||Yr(e)}o(kN,"IsAdditionalProperties");function yv(e){return Ci(e)||lv(e)}o(yv,"IsOptionalBigInt");function Gn(e){return Ci(e)||uu(e)}o(Gn,"IsOptionalNumber");function iE(e){return Ci(e)||Vf(e)}o(iE,"IsOptionalBoolean");function Sn(e){return Ci(e)||qn(e)}o(Sn,"IsOptionalString");function pee(e){return Ci(e)||qn(e)&&nE(e)&&RN(e)}o(pee,"IsOptionalPattern");function fee(e){return Ci(e)||qn(e)&&nE(e)}o(fee,"IsOptionalFormat");function BN(e){return Ci(e)||Yr(e)}o(BN,"IsOptionalSchema");function dee(e){return An(e)&&e[hp]==="Readonly"}o(dee,"IsReadonly");function hee(e){return An(e)&&e[Xs]==="Optional"}o(hee,"IsOptional");function GN(e){return Xr(e,"Any")&&Sn(e.$id)}o(GN,"IsAny");function jN(e){return Xr(e,"Array")&&e.type==="array"&&Sn(e.$id)&&Yr(e.items)&&Gn(e.minItems)&&Gn(e.maxItems)&&iE(e.uniqueItems)&&BN(e.contains)&&Gn(e.minContains)&&Gn(e.maxContains)}o(jN,"IsArray");function UN(e){return Xr(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Sn(e.$id)&&Yr(e.items)}o(UN,"IsAsyncIterator");function VN(e){return Xr(e,"BigInt")&&e.type==="bigint"&&Sn(e.$id)&&yv(e.exclusiveMaximum)&&yv(e.exclusiveMinimum)&&yv(e.maximum)&&yv(e.minimum)&&yv(e.multipleOf)}o(VN,"IsBigInt");function zN(e){return Xr(e,"Boolean")&&e.type==="boolean"&&Sn(e.$id)}o(zN,"IsBoolean");function $N(e){return Xr(e,"Constructor")&&e.type==="Constructor"&&Sn(e.$id)&&Es(e.parameters)&&e.parameters.every(t=>Yr(t))&&Yr(e.returns)}o($N,"IsConstructor");function HN(e){return Xr(e,"Date")&&e.type==="Date"&&Sn(e.$id)&&Gn(e.exclusiveMaximumTimestamp)&&Gn(e.exclusiveMinimumTimestamp)&&Gn(e.maximumTimestamp)&&Gn(e.minimumTimestamp)&&Gn(e.multipleOfTimestamp)}o(HN,"IsDate");function WN(e){return Xr(e,"Function")&&e.type==="Function"&&Sn(e.$id)&&Es(e.parameters)&&e.parameters.every(t=>Yr(t))&&Yr(e.returns)}o(WN,"IsFunction");function qN(e){return Xr(e,"Integer")&&e.type==="integer"&&Sn(e.$id)&&Gn(e.exclusiveMaximum)&&Gn(e.exclusiveMinimum)&&Gn(e.maximum)&&Gn(e.minimum)&&Gn(e.multipleOf)}o(qN,"IsInteger");function oE(e){return An(e)&&Object.entries(e).every(([t,r])=>nE(t)&&Yr(r))}o(oE,"IsProperties");function YN(e){return Xr(e,"Intersect")&&!(qn(e.type)&&e.type!=="object")&&Es(e.allOf)&&e.allOf.every(t=>Yr(t)&&!Yn(t))&&Sn(e.type)&&(iE(e.unevaluatedProperties)||BN(e.unevaluatedProperties))&&Sn(e.$id)}o(YN,"IsIntersect");function XN(e){return Xr(e,"Iterator")&&e.type==="Iterator"&&Sn(e.$id)&&Yr(e.items)}o(XN,"IsIterator");function Xr(e,t){return An(e)&&Se in e&&e[Se]===t}o(Xr,"IsKindOf");function ZN(e){return vv(e)&&qn(e.const)}o(ZN,"IsLiteralString");function KN(e){return vv(e)&&uu(e.const)}o(KN,"IsLiteralNumber");function mee(e){return vv(e)&&Vf(e.const)}o(mee,"IsLiteralBoolean");function vv(e){return Xr(e,"Literal")&&Sn(e.$id)&&JN(e.const)}o(vv,"IsLiteral");function JN(e){return Vf(e)||uu(e)||qn(e)}o(JN,"IsLiteralValue");function QN(e){return Xr(e,"MappedKey")&&Es(e.keys)&&e.keys.every(t=>uu(t)||qn(t))}o(QN,"IsMappedKey");function eR(e){return Xr(e,"MappedResult")&&oE(e.properties)}o(eR,"IsMappedResult");function tR(e){return Xr(e,"Never")&&An(e.not)&&Object.getOwnPropertyNames(e.not).length===0}o(tR,"IsNever");function rR(e){return Xr(e,"Not")&&Yr(e.not)}o(rR,"IsNot");function nR(e){return Xr(e,"Null")&&e.type==="null"&&Sn(e.$id)}o(nR,"IsNull");function iR(e){return Xr(e,"Number")&&e.type==="number"&&Sn(e.$id)&&Gn(e.exclusiveMaximum)&&Gn(e.exclusiveMinimum)&&Gn(e.maximum)&&Gn(e.minimum)&&Gn(e.multipleOf)}o(iR,"IsNumber");function oR(e){return Xr(e,"Object")&&e.type==="object"&&Sn(e.$id)&&oE(e.properties)&&kN(e.additionalProperties)&&Gn(e.minProperties)&&Gn(e.maxProperties)}o(oR,"IsObject");function sR(e){return Xr(e,"Promise")&&e.type==="Promise"&&Sn(e.$id)&&Yr(e.item)}o(sR,"IsPromise");function aR(e){return Xr(e,"Record")&&e.type==="object"&&Sn(e.$id)&&kN(e.additionalProperties)&&An(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&RN(r[0])&&An(t.patternProperties)&&Yr(t.patternProperties[r[0]])})(e)}o(aR,"IsRecord");function gee(e){return An(e)&&ml in e&&e[ml]==="Recursive"}o(gee,"IsRecursive");function lR(e){return Xr(e,"Ref")&&Sn(e.$id)&&qn(e.$ref)}o(lR,"IsRef");function uR(e){return Xr(e,"RegExp")&&Sn(e.$id)&&qn(e.source)&&qn(e.flags)&&Gn(e.maxLength)&&Gn(e.minLength)}o(uR,"IsRegExp");function cR(e){return Xr(e,"String")&&e.type==="string"&&Sn(e.$id)&&Gn(e.minLength)&&Gn(e.maxLength)&&pee(e.pattern)&&fee(e.format)}o(cR,"IsString");function pR(e){return Xr(e,"Symbol")&&e.type==="symbol"&&Sn(e.$id)}o(pR,"IsSymbol");function fR(e){return Xr(e,"TemplateLiteral")&&e.type==="string"&&qn(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}o(fR,"IsTemplateLiteral");function dR(e){return Xr(e,"This")&&Sn(e.$id)&&qn(e.$ref)}o(dR,"IsThis");function Yn(e){return An(e)&&ni in e}o(Yn,"IsTransform");function hR(e){return Xr(e,"Tuple")&&e.type==="array"&&Sn(e.$id)&&uu(e.minItems)&&uu(e.maxItems)&&e.minItems===e.maxItems&&(Ci(e.items)&&Ci(e.additionalItems)&&e.minItems===0||Es(e.items)&&e.items.every(t=>Yr(t)))}o(hR,"IsTuple");function ry(e){return Xr(e,"Undefined")&&e.type==="undefined"&&Sn(e.$id)}o(ry,"IsUndefined");function yee(e){return sE(e)&&e.anyOf.every(t=>ZN(t)||KN(t))}o(yee,"IsUnionLiteral");function sE(e){return Xr(e,"Union")&&Sn(e.$id)&&An(e)&&Es(e.anyOf)&&e.anyOf.every(t=>Yr(t))}o(sE,"IsUnion");function mR(e){return Xr(e,"Uint8Array")&&e.type==="Uint8Array"&&Sn(e.$id)&&Gn(e.minByteLength)&&Gn(e.maxByteLength)}o(mR,"IsUint8Array");function gR(e){return Xr(e,"Unknown")&&Sn(e.$id)}o(gR,"IsUnknown");function yR(e){return Xr(e,"Unsafe")}o(yR,"IsUnsafe");function vR(e){return Xr(e,"Void")&&e.type==="void"&&Sn(e.$id)}o(vR,"IsVoid");function xR(e){return An(e)&&Se in e&&qn(e[Se])&&!cee.includes(e[Se])}o(xR,"IsKind");function Yr(e){return An(e)&&(GN(e)||jN(e)||zN(e)||VN(e)||UN(e)||$N(e)||HN(e)||WN(e)||qN(e)||YN(e)||XN(e)||vv(e)||QN(e)||eR(e)||tR(e)||rR(e)||nR(e)||iR(e)||oR(e)||sR(e)||aR(e)||lR(e)||uR(e)||cR(e)||pR(e)||fR(e)||dR(e)||hR(e)||ry(e)||sE(e)||mR(e)||gR(e)||yR(e)||vR(e)||xR(e))}o(Yr,"IsSchema");g();var lE="(true|false)",xv="(0|[1-9][0-9]*)",uE="(.*)",vee="(?!.*)",gYe="^".concat(lE,"$"),yp="^".concat(xv,"$"),vp="^".concat(uE,"$"),bR="^".concat(vee,"$");g();var Zs={};bf(Zs,{Clear:()=>bee,Delete:()=>Iee,Entries:()=>xee,Get:()=>Cee,Has:()=>See,Set:()=>_ee});g();var ny=new Map;function xee(){return new Map(ny)}o(xee,"Entries");function bee(){return ny.clear()}o(bee,"Clear");function Iee(e){return ny.delete(e)}o(Iee,"Delete");function See(e){return ny.has(e)}o(See,"Has");function _ee(e,t){ny.set(e,t)}o(_ee,"Set");function Cee(e){return ny.get(e)}o(Cee,"Get");var vo={};bf(vo,{Clear:()=>Pee,Delete:()=>Tee,Entries:()=>wee,Get:()=>Oee,Has:()=>Eee,Set:()=>Mee});g();var iy=new Map;function wee(){return new Map(iy)}o(wee,"Entries");function Pee(){return iy.clear()}o(Pee,"Clear");function Tee(e){return iy.delete(e)}o(Tee,"Delete");function Eee(e){return iy.has(e)}o(Eee,"Has");function Mee(e,t){iy.set(e,t)}o(Mee,"Set");function Oee(e){return iy.get(e)}o(Oee,"Get");g();function IR(e,t){return e.includes(t)}o(IR,"SetIncludes");function SR(e){return[...new Set(e)]}o(SR,"SetDistinct");function Lee(e,t){return e.filter(r=>t.includes(r))}o(Lee,"SetIntersect");function Dee(e,t){return e.reduce((r,n)=>Lee(r,n),t)}o(Dee,"SetIntersectManyResolve");function _R(e){return e.length===1?e[0]:e.length>1?Dee(e.slice(1),e[0]):[]}o(_R,"SetIntersectMany");function CR(e){let t=[];for(let r of e)t.push(...r);return t}o(CR,"SetUnionMany");g();function Wf(e){return Ne({[Se]:"Any"},e)}o(Wf,"Any");g();function iS(e,t){return Ne({[Se]:"Array",type:"array",items:e},t)}o(iS,"Array");g();function oS(e,t){return Ne({[Se]:"AsyncIterator",type:"AsyncIterator",items:e},t)}o(oS,"AsyncIterator");g();g();g();function Aee(e,t){let i=e,{[t]:r}=i;return is(i,[gI(t)])}o(Aee,"DiscardKey");function Ni(e,t){return t.reduce((r,n)=>Aee(r,n),e)}o(Ni,"Discard");g();function _n(e){return Ne({[Se]:"Never",not:{}},e)}o(_n,"Never");g();g();function Qr(e){return Ne({[Se]:"MappedResult",properties:e})}o(Qr,"MappedResult");g();g();function sS(e,t,r){return Ne({[Se]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}o(sS,"Constructor");g();function qf(e,t,r){return Ne({[Se]:"Function",type:"Function",parameters:e,returns:t},r)}o(qf,"Function");g();g();g();g();function bv(e,t){return Ne({[Se]:"Union",anyOf:e},t)}o(bv,"UnionCreate");function Fee(e){return e.some(t=>lc(t))}o(Fee,"IsUnionOptional");function wR(e){return e.map(t=>lc(t)?Nee(t):t)}o(wR,"RemoveOptionalFromRest");function Nee(e){return Ni(e,[Xs])}o(Nee,"RemoveOptionalFromType");function Ree(e,t){return Fee(e)?ha(bv(wR(e),t)):bv(wR(e),t)}o(Ree,"ResolveUnion");function uc(e,t){return e.length===0?_n(t):e.length===1?Ne(e[0],t):Ree(e,t)}o(uc,"UnionEvaluated");g();function Cn(e,t){return e.length===0?_n(t):e.length===1?Ne(e[0],t):bv(e,t)}o(Cn,"Union");g();g();g();var pE=class pE extends Tt{};o(pE,"TemplateLiteralParserError");var aS=pE;function kee(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}o(kee,"Unescape");function cE(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}o(cE,"IsNonEscaped");function xp(e,t){return cE(e,t,"(")}o(xp,"IsOpenParen");function Iv(e,t){return cE(e,t,")")}o(Iv,"IsCloseParen");function PR(e,t){return cE(e,t,"|")}o(PR,"IsSeparator");function Bee(e){if(!(xp(e,0)&&Iv(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(xp(e,r)&&(t+=1),Iv(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}o(Bee,"IsGroup");function Gee(e){return e.slice(1,e.length-1)}o(Gee,"InGroup");function jee(e){let t=0;for(let r=0;r<e.length;r++)if(xp(e,r)&&(t+=1),Iv(e,r)&&(t-=1),PR(e,r)&&t===0)return!0;return!1}o(jee,"IsPrecedenceOr");function Uee(e){for(let t=0;t<e.length;t++)if(xp(e,t))return!0;return!1}o(Uee,"IsPrecedenceAnd");function Vee(e){let[t,r]=[0,0],n=[];for(let a=0;a<e.length;a++)if(xp(e,a)&&(t+=1),Iv(e,a)&&(t-=1),PR(e,a)&&t===0){let u=e.slice(r,a);u.length>0&&n.push(oy(u)),r=a+1}let i=e.slice(r);return i.length>0&&n.push(oy(i)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}o(Vee,"Or");function zee(e){function t(i,a){if(!xp(i,a))throw new aS("TemplateLiteralParser: Index must point to open parens");let u=0;for(let c=a;c<i.length;c++)if(xp(i,c)&&(u+=1),Iv(i,c)&&(u-=1),u===0)return[a,c];throw new aS("TemplateLiteralParser: Unclosed group parens in expression")}o(t,"Group");function r(i,a){for(let u=a;u<i.length;u++)if(xp(i,u))return[a,u];return[a,i.length]}o(r,"Range");let n=[];for(let i=0;i<e.length;i++)if(xp(e,i)){let[a,u]=t(e,i),c=e.slice(a,u+1);n.push(oy(c)),i=u}else{let[a,u]=r(e,i),c=e.slice(a,u);c.length>0&&n.push(oy(c)),i=u-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}o(zee,"And");function oy(e){return Bee(e)?oy(Gee(e)):jee(e)?Vee(e):Uee(e)?zee(e):{type:"const",const:kee(e)}}o(oy,"TemplateLiteralParse");function sy(e){return oy(e.slice(1,e.length-1))}o(sy,"TemplateLiteralParseExact");var dE=class dE extends Tt{};o(dE,"TemplateLiteralFiniteError");var fE=dE;function $ee(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}o($ee,"IsNumberExpression");function Hee(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}o(Hee,"IsBooleanExpression");function Wee(e){return e.type==="const"&&e.const===".*"}o(Wee,"IsStringExpression");function Gh(e){return $ee(e)||Wee(e)?!1:Hee(e)?!0:e.type==="and"?e.expr.every(t=>Gh(t)):e.type==="or"?e.expr.every(t=>Gh(t)):e.type==="const"?!0:(()=>{throw new fE("Unknown expression type")})()}o(Gh,"IsTemplateLiteralExpressionFinite");function lS(e){let t=sy(e.pattern);return Gh(t)}o(lS,"IsTemplateLiteralFinite");g();var mE=class mE extends Tt{};o(mE,"TemplateLiteralGenerateError");var hE=mE;function*TR(e){if(e.length===1)return yield*ke(e[0]);for(let t of e[0])for(let r of TR(e.slice(1)))yield"".concat(t).concat(r)}o(TR,"GenerateReduce");function*qee(e){return yield*ke(TR(e.expr.map(t=>[...Sv(t)])))}o(qee,"GenerateAnd");function*Yee(e){for(let t of e.expr)yield*ke(Sv(t))}o(Yee,"GenerateOr");function*Xee(e){return yield e.const}o(Xee,"GenerateConst");function*Sv(e){return e.type==="and"?yield*ke(qee(e)):e.type==="or"?yield*ke(Yee(e)):e.type==="const"?yield*ke(Xee(e)):(()=>{throw new hE("Unknown expression")})()}o(Sv,"TemplateLiteralExpressionGenerate");function ay(e){let t=sy(e.pattern);return Gh(t)?[...Sv(t)]:[]}o(ay,"TemplateLiteralGenerate");g();g();function cn(e,t){return Ne({[Se]:"Literal",const:e,type:typeof e},t)}o(cn,"Literal");g();function uS(e){return Ne({[Se]:"Boolean",type:"boolean"},e)}o(uS,"Boolean");g();function ly(e){return Ne({[Se]:"BigInt",type:"bigint"},e)}o(ly,"BigInt");g();function cc(e){return Ne({[Se]:"Number",type:"number"},e)}o(cc,"Number");g();function gl(e){return Ne({[Se]:"String",type:"string"},e)}o(gl,"String");function*Zee(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield uS():t==="number"?yield cc():t==="bigint"?yield ly():t==="string"?yield gl():yield(()=>{let r=t.split("|").map(n=>cn(n.trim()));return r.length===0?_n():r.length===1?r[0]:uc(r)})()}o(Zee,"FromUnion");function*Kee(e){if(e[1]!=="{"){let t=cn("$"),r=gE(e.slice(1));return yield*ke([t,...r])}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=Zee(e.slice(2,t)),n=gE(e.slice(t+1));return yield*ke([...r,...n])}yield cn(e)}o(Kee,"FromTerminal");function*gE(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=cn(e.slice(0,t)),n=Kee(e.slice(t));return yield*ke([r,...n])}yield cn(e)}o(gE,"FromSyntax");function ER(e){return[...gE(e)]}o(ER,"TemplateLiteralSyntax");g();var xE=class xE extends Tt{};o(xE,"TemplateLiteralPatternError");var yE=xE;function Jee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Jee,"Escape");function MR(e,t){return Ba(e)?e.pattern.slice(1,e.pattern.length-1):un(e)?"(".concat(e.anyOf.map(r=>MR(r,t)).join("|"),")"):kh(e)?"".concat(t).concat(xv):Rh(e)?"".concat(t).concat(xv):KT(e)?"".concat(t).concat(xv):gv(e)?"".concat(t).concat(uE):gp(e)?"".concat(t).concat(Jee(e.const.toString())):JT(e)?"".concat(t).concat(lE):(()=>{throw new yE("Unexpected Kind '".concat(e[Se],"'"))})()}o(MR,"Visit");function vE(e){return"^".concat(e.map(t=>MR(t,"")).join(""),"$")}o(vE,"TemplateLiteralPattern");g();function jh(e){let r=ay(e).map(n=>cn(n));return uc(r)}o(jh,"TemplateLiteralToUnion");g();function cS(e,t){let r=qn(e)?vE(ER(e)):vE(e);return Ne({[Se]:"TemplateLiteral",type:"string",pattern:r},t)}o(cS,"TemplateLiteral");function Qee(e){return ay(e).map(r=>r.toString())}o(Qee,"FromTemplateLiteral");function ete(e){let t=[];for(let r of e)t.push(...ma(r));return t}o(ete,"FromUnion");function tte(e){return[e.toString()]}o(tte,"FromLiteral");function ma(e){return[...new Set(Ba(e)?Qee(e):un(e)?ete(e.anyOf):gp(e)?tte(e.const):kh(e)?["[number]"]:Rh(e)?["[number]"]:[])]}o(ma,"IndexPropertyKeys");g();function rte(e,t,r){let n={};for(let i of Object.getOwnPropertyNames(t))n[i]=uy(e,ma(t[i]),r);return n}o(rte,"FromProperties");function nte(e,t,r){return rte(e,t.properties,r)}o(nte,"FromMappedResult");function OR(e,t,r){let n=nte(e,t,r);return Qr(n)}o(OR,"IndexFromMappedResult");function DR(e,t){return e.map(r=>AR(r,t))}o(DR,"FromRest");function ite(e){return e.filter(t=>!$f(t))}o(ite,"FromIntersectRest");function ote(e,t){return pS(ite(DR(e,t)))}o(ote,"FromIntersect");function ste(e){return e.some(t=>$f(t))?[]:e}o(ste,"FromUnionRest");function ate(e,t){return uc(ste(DR(e,t)))}o(ate,"FromUnion");function lte(e,t){return t in e?e[t]:t==="[number]"?uc(e):_n()}o(lte,"FromTuple");function ute(e,t){return t==="[number]"?e:_n()}o(ute,"FromArray");function cte(e,t){return t in e?e[t]:_n()}o(cte,"FromProperty");function AR(e,t){var r;return $i(e)?ote(e.allOf,t):un(e)?ate(e.anyOf,t):cu(e)?lte((r=e.items)!=null?r:[],t):mp(e)?ute(e.items,t):yo(e)?cte(e.properties,t):_n()}o(AR,"IndexFromPropertyKey");function _v(e,t){return t.map(r=>AR(e,r))}o(_v,"IndexFromPropertyKeys");function LR(e,t){return uc(_v(e,t))}o(LR,"FromSchema");function uy(e,t,r){return ii(t)?OR(e,t,r):ka(t)?FR(e,t,r):Ne(pu(t)?LR(e,ma(t)):LR(e,t),r)}o(uy,"Index");function pte(e,t,r){return{[t]:uy(e,[t],ri(r))}}o(pte,"MappedIndexPropertyKey");function fte(e,t,r){return t.reduce((n,i)=>Y(Y({},n),pte(e,i,r)),{})}o(fte,"MappedIndexPropertyKeys");function dte(e,t,r){return fte(e,t.keys,r)}o(dte,"MappedIndexProperties");function FR(e,t,r){let n=dte(e,t,r);return Qr(n)}o(FR,"IndexFromMappedKey");g();function fS(e,t){return Ne({[Se]:"Iterator",type:"Iterator",items:e},t)}o(fS,"Iterator");g();function hte(e){let t=[];for(let r in e)lc(e[r])||t.push(r);return t}o(hte,"RequiredKeys");function mte(e,t){let r=hte(e),n=r.length>0?{[Se]:"Object",type:"object",properties:e,required:r}:{[Se]:"Object",type:"object",properties:e};return Ne(n,t)}o(mte,"_Object");var Fn=mte;g();function dS(e,t){return Ne({[Se]:"Promise",type:"Promise",item:e},t)}o(dS,"Promise");g();g();function gte(e){return Ne(Ni(e,[hp]))}o(gte,"RemoveReadonly");function yte(e){return Ne(Ie(Y({},e),{[hp]:"Readonly"}))}o(yte,"AddReadonly");function vte(e,t){return t===!1?gte(e):yte(e)}o(vte,"ReadonlyWithFlag");function yl(e,t){let r=t!=null?t:!0;return ii(e)?NR(e,r):vte(e,r)}o(yl,"Readonly");function xte(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=yl(e[n],t);return r}o(xte,"FromProperties");function bte(e,t){return xte(e.properties,t)}o(bte,"FromMappedResult");function NR(e,t){let r=bte(e,t);return Qr(r)}o(NR,"ReadonlyFromMappedResult");g();function pc(e,t){return Ne(e.length>0?{[Se]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[Se]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}o(pc,"Tuple");function RR(e,t){return e in t?vl(e,t[e]):Qr(t)}o(RR,"FromMappedResult");function Ite(e){return{[e]:cn(e)}}o(Ite,"MappedKeyToKnownMappedResultProperties");function Ste(e){let t={};for(let r of e)t[r]=cn(r);return t}o(Ste,"MappedKeyToUnknownMappedResultProperties");function _te(e,t){return IR(t,e)?Ite(e):Ste(t)}o(_te,"MappedKeyToMappedResultProperties");function Cte(e,t){let r=_te(e,t);return RR(e,r)}o(Cte,"FromMappedKey");function Cv(e,t){return t.map(r=>vl(e,r))}o(Cv,"FromRest");function wte(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=vl(e,t[n]);return r}o(wte,"FromProperties");function vl(e,t){var n;let r=Y({},t);return lc(t)?ha(vl(e,Ni(t,[Xs]))):NN(t)?yl(vl(e,Ni(t,[hp]))):ii(t)?RR(e,t.properties):ka(t)?Cte(e,t.keys):dv(t)?sS(Cv(e,t.parameters),vl(e,t.returns),r):hv(t)?qf(Cv(e,t.parameters),vl(e,t.returns),r):fv(t)?oS(vl(e,t.items),r):mv(t)?fS(vl(e,t.items),r):$i(t)?ga(Cv(e,t.allOf),r):un(t)?Cn(Cv(e,t.anyOf),r):cu(t)?pc(Cv(e,(n=t.items)!=null?n:[]),r):yo(t)?Fn(wte(e,t.properties),r):mp(t)?iS(vl(e,t.items),r):Bh(t)?dS(vl(e,t.item),r):t}o(vl,"FromSchemaType");function Pte(e,t){let r={};for(let n of e)r[n]=vl(n,t);return r}o(Pte,"MappedFunctionReturnType");function kR(e,t,r){let n=pu(e)?ma(e):e,i=t({[Se]:"MappedKey",keys:n}),a=Pte(n,i);return Fn(a,r)}o(kR,"Mapped");g();function Tte(e){return Ne(Ni(e,[Xs]))}o(Tte,"RemoveOptional");function Ete(e){return Ne(Ie(Y({},e),{[Xs]:"Optional"}))}o(Ete,"AddOptional");function Mte(e,t){return t===!1?Tte(e):Ete(e)}o(Mte,"OptionalWithFlag");function ha(e,t){let r=t!=null?t:!0;return ii(e)?BR(e,r):Mte(e,r)}o(ha,"Optional");function Ote(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ha(e[n],t);return r}o(Ote,"FromProperties");function Lte(e,t){return Ote(e.properties,t)}o(Lte,"FromMappedResult");function BR(e,t){let r=Lte(e,t);return Qr(r)}o(BR,"OptionalFromMappedResult");g();function wv(e,t={}){let r=e.every(i=>yo(i)),n=pu(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return Ne(t.unevaluatedProperties===!1||pu(t.unevaluatedProperties)||r?Ie(Y({},n),{[Se]:"Intersect",type:"object",allOf:e}):Ie(Y({},n),{[Se]:"Intersect",allOf:e}),t)}o(wv,"IntersectCreate");function Dte(e){return e.every(t=>lc(t))}o(Dte,"IsIntersectOptional");function Ate(e){return Ni(e,[Xs])}o(Ate,"RemoveOptionalFromType");function GR(e){return e.map(t=>lc(t)?Ate(t):t)}o(GR,"RemoveOptionalFromRest");function Fte(e,t){return Dte(e)?ha(wv(GR(e),t)):wv(GR(e),t)}o(Fte,"ResolveIntersect");function pS(e,t={}){if(e.length===0)return _n(t);if(e.length===1)return Ne(e[0],t);if(e.some(r=>ty(r)))throw new Error("Cannot intersect transform types");return Fte(e,t)}o(pS,"IntersectEvaluated");g();function ga(e,t){if(e.length===0)return _n(t);if(e.length===1)return Ne(e[0],t);if(e.some(r=>ty(r)))throw new Error("Cannot intersect transform types");return wv(e,t)}o(ga,"Intersect");function jR(e){return e.map(t=>bE(t))}o(jR,"FromRest");function Nte(e){return ga(jR(e))}o(Nte,"FromIntersect");function Rte(e){return Cn(jR(e))}o(Rte,"FromUnion");function kte(e){return bE(e)}o(kte,"FromPromise");function bE(e){return $i(e)?Nte(e.allOf):un(e)?Rte(e.anyOf):Bh(e)?kte(e.item):e}o(bE,"AwaitedResolve");function UR(e,t){return Ne(bE(e),t)}o(UR,"Awaited");g();g();g();g();function VR(e){let t=[];for(let r of e)t.push(zo(r));return t}o(VR,"FromRest");function Bte(e){let t=VR(e);return CR(t)}o(Bte,"FromIntersect");function Gte(e){let t=VR(e);return _R(t)}o(Gte,"FromUnion");function jte(e){return e.map((t,r)=>r.toString())}o(jte,"FromTuple");function Ute(e){return["[number]"]}o(Ute,"FromArray");function Vte(e){return globalThis.Object.getOwnPropertyNames(e)}o(Vte,"FromProperties");function zte(e){return IE?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}o(zte,"FromPatternProperties");function zo(e){var t;return $i(e)?Bte(e.allOf):un(e)?Gte(e.anyOf):cu(e)?jte((t=e.items)!=null?t:[]):mp(e)?Ute(e.items):yo(e)?Vte(e.properties):QT(e)?zte(e.patternProperties):[]}o(zo,"KeyOfPropertyKeys");var IE=!1;function bp(e){IE=!0;let t=zo(e);IE=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}o(bp,"KeyOfPattern");function $te(e){return e.map(t=>t==="[number]"?cc():cn(t))}o($te,"KeyOfPropertyKeysToRest");function hS(e,t){if(ii(e))return zR(e,t);{let r=zo(e),n=$te(r),i=uc(n);return Ne(i,t)}}o(hS,"KeyOf");function Hte(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=hS(e[n],ri(t));return r}o(Hte,"FromProperties");function Wte(e,t){return Hte(e.properties,t)}o(Wte,"FromMappedResult");function zR(e,t){let r=Wte(e,t);return Qr(r)}o(zR,"KeyOfFromMappedResult");g();function Yf(e){let t=zo(e),r=_v(e,t);return t.map((n,i)=>[t[i],r[i]])}o(Yf,"KeyOfPropertyEntries");function qte(e){let t=[];for(let r of e)t.push(...zo(r));return SR(t)}o(qte,"CompositeKeys");function Yte(e){return e.filter(t=>!$f(t))}o(Yte,"FilterNever");function Xte(e,t){let r=[];for(let n of e)r.push(..._v(n,[t]));return Yte(r)}o(Xte,"CompositeProperty");function Zte(e,t){let r={};for(let n of t)r[n]=pS(Xte(e,n));return r}o(Zte,"CompositeProperties");function $R(e,t){let r=qte(e),n=Zte(e,r);return Fn(n,t)}o($R,"Composite");g();g();function mS(e){return Ne({[Se]:"Date",type:"Date"},e)}o(mS,"Date");g();function gS(e){return Ne({[Se]:"Null",type:"null"},e)}o(gS,"Null");g();function yS(e){return Ne({[Se]:"Symbol",type:"symbol"},e)}o(yS,"Symbol");g();function vS(e){return Ne({[Se]:"Undefined",type:"undefined"},e)}o(vS,"Undefined");g();function xS(e){return Ne({[Se]:"Uint8Array",type:"Uint8Array"},e)}o(xS,"Uint8Array");g();function Ip(e){return Ne({[Se]:"Unknown"},e)}o(Ip,"Unknown");function Kte(e){return e.map(t=>SE(t,!1))}o(Kte,"FromArray");function Jte(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=yl(SE(e[r],!1));return t}o(Jte,"FromProperties");function bS(e,t){return t===!0?e:yl(e)}o(bS,"ConditionalReadonly");function SE(e,t){return zT(e)?bS(Wf(),t):HT(e)?bS(Wf(),t):Es(e)?yl(pc(Kte(e))):pp(e)?xS():Nh(e)?mS():An(e)?bS(Fn(Jte(e)),t):$T(e)?bS(qf([],Ip()),t):Ci(e)?vS():WT(e)?gS():qT(e)?yS():lv(e)?ly():uu(e)?cn(e):Vf(e)?cn(e):qn(e)?cn(e):Fn({})}o(SE,"FromValue");function HR(e,t){return Ne(SE(e,!0),t)}o(HR,"Const");g();function WR(e,t){return pc(e.parameters,t)}o(WR,"ConstructorParameters");g();function Pv(e,t){return e.map(r=>fu(r,t))}o(Pv,"FromRest");function Qte(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=fu(e[n],t);return r}o(Qte,"FromProperties");function ere(e,t){return e.parameters=Pv(e.parameters,t),e.returns=fu(e.returns,t),e}o(ere,"FromConstructor");function tre(e,t){return e.parameters=Pv(e.parameters,t),e.returns=fu(e.returns,t),e}o(tre,"FromFunction");function rre(e,t){return e.allOf=Pv(e.allOf,t),e}o(rre,"FromIntersect");function nre(e,t){return e.anyOf=Pv(e.anyOf,t),e}o(nre,"FromUnion");function ire(e,t){return Ci(e.items)||(e.items=Pv(e.items,t)),e}o(ire,"FromTuple");function ore(e,t){return e.items=fu(e.items,t),e}o(ore,"FromArray");function sre(e,t){return e.properties=Qte(e.properties,t),e}o(sre,"FromObject");function are(e,t){return e.item=fu(e.item,t),e}o(are,"FromPromise");function lre(e,t){return e.items=fu(e.items,t),e}o(lre,"FromAsyncIterator");function ure(e,t){return e.items=fu(e.items,t),e}o(ure,"FromIterator");function cre(e,t){let r=t.find(i=>i.$id===e.$ref);if(r===void 0)throw Error("Unable to dereference schema with $id ".concat(e.$ref));let n=Ni(r,["$id"]);return fu(n,t)}o(cre,"FromRef");function pre(e,t){return dv(e)?ere(e,t):hv(e)?tre(e,t):$i(e)?rre(e,t):un(e)?nre(e,t):cu(e)?ire(e,t):mp(e)?ore(e,t):yo(e)?sre(e,t):Bh(e)?are(e,t):fv(e)?lre(e,t):mv(e)?ure(e,t):eE(e)?cre(e,t):e}o(pre,"DerefResolve");function fu(e,t){return pre(cv(e),DN(t))}o(fu,"Deref");g();function qR(e,t){if(Ci(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(a=>isNaN(a)).map(a=>e[a]),i=[...new Set(r)].map(a=>cn(a));return Cn(i,Ie(Y({},t),{[ml]:"Enum"}))}o(qR,"Enum");g();g();g();var ME=class ME extends Tt{};o(ME,"ExtendsResolverError");var CE=ME,Pe;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(Pe||(Pe={}));function xl(e){return e===Pe.False?e:Pe.True}o(xl,"IntoBooleanResult");function cy(e){throw new CE(e)}o(cy,"Throw");function oo(e){return ne.IsNever(e)||ne.IsIntersect(e)||ne.IsUnion(e)||ne.IsUnknown(e)||ne.IsAny(e)}o(oo,"IsStructuralRight");function so(e,t){return ne.IsNever(t)?ek(e,t):ne.IsIntersect(t)?IS(e,t):ne.IsUnion(t)?EE(e,t):ne.IsUnknown(t)?ik(e,t):ne.IsAny(t)?TE(e,t):cy("StructuralRight")}o(so,"StructuralRight");function TE(e,t){return Pe.True}o(TE,"FromAnyRight");function fre(e,t){return ne.IsIntersect(t)?IS(e,t):ne.IsUnion(t)&&t.anyOf.some(r=>ne.IsAny(r)||ne.IsUnknown(r))?Pe.True:ne.IsUnion(t)?Pe.Union:ne.IsUnknown(t)||ne.IsAny(t)?Pe.True:Pe.Union}o(fre,"FromAny");function dre(e,t){return ne.IsUnknown(e)?Pe.False:ne.IsAny(e)?Pe.Union:ne.IsNever(e)?Pe.True:Pe.False}o(dre,"FromArrayRight");function hre(e,t){return ne.IsObject(t)&&SS(t)?Pe.True:oo(t)?so(e,t):ne.IsArray(t)?xl(wn(e.items,t.items)):Pe.False}o(hre,"FromArray");function mre(e,t){return oo(t)?so(e,t):ne.IsAsyncIterator(t)?xl(wn(e.items,t.items)):Pe.False}o(mre,"FromAsyncIterator");function gre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):ne.IsBigInt(t)?Pe.True:Pe.False}o(gre,"FromBigInt");function JR(e,t){return ne.IsLiteralBoolean(e)||ne.IsBoolean(e)?Pe.True:Pe.False}o(JR,"FromBooleanRight");function yre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):ne.IsBoolean(t)?Pe.True:Pe.False}o(yre,"FromBoolean");function vre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsConstructor(t)?e.parameters.length>t.parameters.length?Pe.False:e.parameters.every((r,n)=>xl(wn(t.parameters[n],r))===Pe.True)?xl(wn(e.returns,t.returns)):Pe.False:Pe.False}o(vre,"FromConstructor");function xre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):ne.IsDate(t)?Pe.True:Pe.False}o(xre,"FromDate");function bre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsFunction(t)?e.parameters.length>t.parameters.length?Pe.False:e.parameters.every((r,n)=>xl(wn(t.parameters[n],r))===Pe.True)?xl(wn(e.returns,t.returns)):Pe.False:Pe.False}o(bre,"FromFunction");function QR(e,t){return ne.IsLiteral(e)&&Wr.IsNumber(e.const)||ne.IsNumber(e)||ne.IsInteger(e)?Pe.True:Pe.False}o(QR,"FromIntegerRight");function Ire(e,t){return ne.IsInteger(t)||ne.IsNumber(t)?Pe.True:oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):Pe.False}o(Ire,"FromInteger");function IS(e,t){return t.allOf.every(r=>wn(e,r)===Pe.True)?Pe.True:Pe.False}o(IS,"FromIntersectRight");function Sre(e,t){return e.allOf.some(r=>wn(r,t)===Pe.True)?Pe.True:Pe.False}o(Sre,"FromIntersect");function _re(e,t){return oo(t)?so(e,t):ne.IsIterator(t)?xl(wn(e.items,t.items)):Pe.False}o(_re,"FromIterator");function Cre(e,t){return ne.IsLiteral(t)&&t.const===e.const?Pe.True:oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):ne.IsString(t)?nk(e,t):ne.IsNumber(t)?tk(e,t):ne.IsInteger(t)?QR(e,t):ne.IsBoolean(t)?JR(e,t):Pe.False}o(Cre,"FromLiteral");function ek(e,t){return Pe.False}o(ek,"FromNeverRight");function wre(e,t){return Pe.True}o(wre,"FromNever");function YR(e){let[t,r]=[e,0];for(;ne.IsNot(t);)t=t.not,r+=1;return r%2===0?t:Ip()}o(YR,"UnwrapTNot");function Pre(e,t){return ne.IsNot(e)?wn(YR(e),t):ne.IsNot(t)?wn(e,YR(t)):cy("Invalid fallthrough for Not")}o(Pre,"FromNot");function Tre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):ne.IsNull(t)?Pe.True:Pe.False}o(Tre,"FromNull");function tk(e,t){return ne.IsLiteralNumber(e)||ne.IsNumber(e)||ne.IsInteger(e)?Pe.True:Pe.False}o(tk,"FromNumberRight");function Ere(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):ne.IsInteger(t)||ne.IsNumber(t)?Pe.True:Pe.False}o(Ere,"FromNumber");function ya(e,t){return Object.getOwnPropertyNames(e.properties).length===t}o(ya,"IsObjectPropertyCount");function XR(e){return SS(e)}o(XR,"IsObjectStringLike");function ZR(e){return ya(e,0)||ya(e,1)&&"description"in e.properties&&ne.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(ne.IsString(e.properties.description.anyOf[0])&&ne.IsUndefined(e.properties.description.anyOf[1])||ne.IsString(e.properties.description.anyOf[1])&&ne.IsUndefined(e.properties.description.anyOf[0]))}o(ZR,"IsObjectSymbolLike");function _E(e){return ya(e,0)}o(_E,"IsObjectNumberLike");function KR(e){return ya(e,0)}o(KR,"IsObjectBooleanLike");function Mre(e){return ya(e,0)}o(Mre,"IsObjectBigIntLike");function Ore(e){return ya(e,0)}o(Ore,"IsObjectDateLike");function Lre(e){return SS(e)}o(Lre,"IsObjectUint8ArrayLike");function Dre(e){let t=cc();return ya(e,0)||ya(e,1)&&"length"in e.properties&&xl(wn(e.properties.length,t))===Pe.True}o(Dre,"IsObjectFunctionLike");function Are(e){return ya(e,0)}o(Are,"IsObjectConstructorLike");function SS(e){let t=cc();return ya(e,0)||ya(e,1)&&"length"in e.properties&&xl(wn(e.properties.length,t))===Pe.True}o(SS,"IsObjectArrayLike");function Fre(e){let t=qf([Wf()],Wf());return ya(e,0)||ya(e,1)&&"then"in e.properties&&xl(wn(e.properties.then,t))===Pe.True}o(Fre,"IsObjectPromiseLike");function rk(e,t){return wn(e,t)===Pe.False||ne.IsOptional(e)&&!ne.IsOptional(t)?Pe.False:Pe.True}o(rk,"Property");function Ms(e,t){return ne.IsUnknown(e)?Pe.False:ne.IsAny(e)?Pe.Union:ne.IsNever(e)||ne.IsLiteralString(e)&&XR(t)||ne.IsLiteralNumber(e)&&_E(t)||ne.IsLiteralBoolean(e)&&KR(t)||ne.IsSymbol(e)&&ZR(t)||ne.IsBigInt(e)&&Mre(t)||ne.IsString(e)&&XR(t)||ne.IsSymbol(e)&&ZR(t)||ne.IsNumber(e)&&_E(t)||ne.IsInteger(e)&&_E(t)||ne.IsBoolean(e)&&KR(t)||ne.IsUint8Array(e)&&Lre(t)||ne.IsDate(e)&&Ore(t)||ne.IsConstructor(e)&&Are(t)||ne.IsFunction(e)&&Dre(t)?Pe.True:ne.IsRecord(e)&&ne.IsString(wE(e))?t[ml]==="Record"?Pe.True:Pe.False:ne.IsRecord(e)&&ne.IsNumber(wE(e))?ya(t,0)?Pe.True:Pe.False:Pe.False}o(Ms,"FromObjectRight");function Nre(e,t){return oo(t)?so(e,t):ne.IsRecord(t)?bl(e,t):ne.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!ne.IsOptional(t.properties[r]))return Pe.False;if(ne.IsOptional(t.properties[r]))return Pe.True;if(rk(e.properties[r],t.properties[r])===Pe.False)return Pe.False}return Pe.True})():Pe.False}o(Nre,"FromObject");function Rre(e,t){return oo(t)?so(e,t):ne.IsObject(t)&&Fre(t)?Pe.True:ne.IsPromise(t)?xl(wn(e.item,t.item)):Pe.False}o(Rre,"FromPromise");function wE(e){return yp in e.patternProperties?cc():vp in e.patternProperties?gl():cy("Unknown record key pattern")}o(wE,"RecordKey");function PE(e){return yp in e.patternProperties?e.patternProperties[yp]:vp in e.patternProperties?e.patternProperties[vp]:cy("Unable to get record value schema")}o(PE,"RecordValue");function bl(e,t){let[r,n]=[wE(t),PE(t)];return ne.IsLiteralString(e)&&ne.IsNumber(r)&&xl(wn(e,n))===Pe.True?Pe.True:ne.IsUint8Array(e)&&ne.IsNumber(r)||ne.IsString(e)&&ne.IsNumber(r)||ne.IsArray(e)&&ne.IsNumber(r)?wn(e,n):ne.IsObject(e)?(()=>{for(let i of Object.getOwnPropertyNames(e.properties))if(rk(n,e.properties[i])===Pe.False)return Pe.False;return Pe.True})():Pe.False}o(bl,"FromRecordRight");function kre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?wn(PE(e),PE(t)):Pe.False}o(kre,"FromRecord");function Bre(e,t){let r=ne.IsRegExp(e)?gl():e,n=ne.IsRegExp(t)?gl():t;return wn(r,n)}o(Bre,"FromRegExp");function nk(e,t){return ne.IsLiteral(e)&&Wr.IsString(e.const)||ne.IsString(e)?Pe.True:Pe.False}o(nk,"FromStringRight");function Gre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):ne.IsString(t)?Pe.True:Pe.False}o(Gre,"FromString");function jre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):ne.IsSymbol(t)?Pe.True:Pe.False}o(jre,"FromSymbol");function Ure(e,t){return ne.IsTemplateLiteral(e)?wn(jh(e),t):ne.IsTemplateLiteral(t)?wn(e,jh(t)):cy("Invalid fallthrough for TemplateLiteral")}o(Ure,"FromTemplateLiteral");function Vre(e,t){return ne.IsArray(t)&&e.items!==void 0&&e.items.every(r=>wn(r,t.items)===Pe.True)}o(Vre,"IsArrayOfTuple");function zre(e,t){return ne.IsNever(e)?Pe.True:ne.IsUnknown(e)?Pe.False:ne.IsAny(e)?Pe.Union:Pe.False}o(zre,"FromTupleRight");function $re(e,t){return oo(t)?so(e,t):ne.IsObject(t)&&SS(t)||ne.IsArray(t)&&Vre(e,t)?Pe.True:ne.IsTuple(t)?Wr.IsUndefined(e.items)&&!Wr.IsUndefined(t.items)||!Wr.IsUndefined(e.items)&&Wr.IsUndefined(t.items)?Pe.False:Wr.IsUndefined(e.items)&&!Wr.IsUndefined(t.items)||e.items.every((r,n)=>wn(r,t.items[n])===Pe.True)?Pe.True:Pe.False:Pe.False}o($re,"FromTuple");function Hre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):ne.IsUint8Array(t)?Pe.True:Pe.False}o(Hre,"FromUint8Array");function Wre(e,t){return oo(t)?so(e,t):ne.IsObject(t)?Ms(e,t):ne.IsRecord(t)?bl(e,t):ne.IsVoid(t)?Xre(e,t):ne.IsUndefined(t)?Pe.True:Pe.False}o(Wre,"FromUndefined");function EE(e,t){return t.anyOf.some(r=>wn(e,r)===Pe.True)?Pe.True:Pe.False}o(EE,"FromUnionRight");function qre(e,t){return e.anyOf.every(r=>wn(r,t)===Pe.True)?Pe.True:Pe.False}o(qre,"FromUnion");function ik(e,t){return Pe.True}o(ik,"FromUnknownRight");function Yre(e,t){return ne.IsNever(t)?ek(e,t):ne.IsIntersect(t)?IS(e,t):ne.IsUnion(t)?EE(e,t):ne.IsAny(t)?TE(e,t):ne.IsString(t)?nk(e,t):ne.IsNumber(t)?tk(e,t):ne.IsInteger(t)?QR(e,t):ne.IsBoolean(t)?JR(e,t):ne.IsArray(t)?dre(e,t):ne.IsTuple(t)?zre(e,t):ne.IsObject(t)?Ms(e,t):ne.IsUnknown(t)?Pe.True:Pe.False}o(Yre,"FromUnknown");function Xre(e,t){return ne.IsUndefined(e)||ne.IsUndefined(e)?Pe.True:Pe.False}o(Xre,"FromVoidRight");function Zre(e,t){return ne.IsIntersect(t)?IS(e,t):ne.IsUnion(t)?EE(e,t):ne.IsUnknown(t)?ik(e,t):ne.IsAny(t)?TE(e,t):ne.IsObject(t)?Ms(e,t):ne.IsVoid(t)?Pe.True:Pe.False}o(Zre,"FromVoid");function wn(e,t){return ne.IsTemplateLiteral(e)||ne.IsTemplateLiteral(t)?Ure(e,t):ne.IsRegExp(e)||ne.IsRegExp(t)?Bre(e,t):ne.IsNot(e)||ne.IsNot(t)?Pre(e,t):ne.IsAny(e)?fre(e,t):ne.IsArray(e)?hre(e,t):ne.IsBigInt(e)?gre(e,t):ne.IsBoolean(e)?yre(e,t):ne.IsAsyncIterator(e)?mre(e,t):ne.IsConstructor(e)?vre(e,t):ne.IsDate(e)?xre(e,t):ne.IsFunction(e)?bre(e,t):ne.IsInteger(e)?Ire(e,t):ne.IsIntersect(e)?Sre(e,t):ne.IsIterator(e)?_re(e,t):ne.IsLiteral(e)?Cre(e,t):ne.IsNever(e)?wre(e,t):ne.IsNull(e)?Tre(e,t):ne.IsNumber(e)?Ere(e,t):ne.IsObject(e)?Nre(e,t):ne.IsRecord(e)?kre(e,t):ne.IsString(e)?Gre(e,t):ne.IsSymbol(e)?jre(e,t):ne.IsTuple(e)?$re(e,t):ne.IsPromise(e)?Rre(e,t):ne.IsUint8Array(e)?Hre(e,t):ne.IsUndefined(e)?Wre(e,t):ne.IsUnion(e)?qre(e,t):ne.IsUnknown(e)?Yre(e,t):ne.IsVoid(e)?Zre(e,t):cy("Unknown left type operand '".concat(e[Se],"'"))}o(wn,"Visit");function Xf(e,t){return wn(e,t)}o(Xf,"ExtendsCheck");g();g();g();function Kre(e,t,r,n,i){let a={};for(let u of globalThis.Object.getOwnPropertyNames(e))a[u]=py(e[u],t,r,n,ri(i));return a}o(Kre,"FromProperties");function Jre(e,t,r,n,i){return Kre(e.properties,t,r,n,i)}o(Jre,"FromMappedResult");function ok(e,t,r,n,i){let a=Jre(e,t,r,n,i);return Qr(a)}o(ok,"ExtendsFromMappedResult");function Qre(e,t,r,n){let i=Xf(e,t);return i===Pe.Union?Cn([r,n]):i===Pe.True?r:n}o(Qre,"ExtendsResolve");function py(e,t,r,n,i){return ii(e)?ok(e,t,r,n,i):ka(e)?Ne(sk(e,t,r,n,i)):Ne(Qre(e,t,r,n),i)}o(py,"Extends");function ene(e,t,r,n,i){return{[e]:py(cn(e),t,r,n,ri(i))}}o(ene,"FromPropertyKey");function tne(e,t,r,n,i){return e.reduce((a,u)=>Y(Y({},a),ene(u,t,r,n,i)),{})}o(tne,"FromPropertyKeys");function rne(e,t,r,n,i){return tne(e.keys,t,r,n,i)}o(rne,"FromMappedKey");function sk(e,t,r,n,i){let a=rne(e,t,r,n,i);return Qr(a)}o(sk,"ExtendsFromMappedKey");g();function nne(e){return e.allOf.every(t=>Sp(t))}o(nne,"Intersect");function ine(e){return e.anyOf.some(t=>Sp(t))}o(ine,"Union");function one(e){return!Sp(e.not)}o(one,"Not");function Sp(e){return e[Se]==="Intersect"?nne(e):e[Se]==="Union"?ine(e):e[Se]==="Not"?one(e):e[Se]==="Undefined"}o(Sp,"ExtendsUndefinedCheck");g();function ak(e,t){return fy(jh(e),t)}o(ak,"ExcludeFromTemplateLiteral");function sne(e,t){let r=e.filter(n=>Xf(n,t)===Pe.False);return r.length===1?r[0]:Cn(r)}o(sne,"ExcludeRest");function fy(e,t,r={}){return Ba(e)?Ne(ak(e,t),r):ii(e)?Ne(lk(e,t),r):Ne(un(e)?sne(e.anyOf,t):Xf(e,t)!==Pe.False?_n():e,r)}o(fy,"Exclude");function ane(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=fy(e[n],t);return r}o(ane,"FromProperties");function lne(e,t){return ane(e.properties,t)}o(lne,"FromMappedResult");function lk(e,t){let r=lne(e,t);return Qr(r)}o(lk,"ExcludeFromMappedResult");g();g();g();function uk(e,t){return dy(jh(e),t)}o(uk,"ExtractFromTemplateLiteral");function une(e,t){let r=e.filter(n=>Xf(n,t)!==Pe.False);return r.length===1?r[0]:Cn(r)}o(une,"ExtractRest");function dy(e,t,r){return Ba(e)?Ne(uk(e,t),r):ii(e)?Ne(ck(e,t),r):Ne(un(e)?une(e.anyOf,t):Xf(e,t)!==Pe.False?e:_n(),r)}o(dy,"Extract");function cne(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=dy(e[n],t);return r}o(cne,"FromProperties");function pne(e,t){return cne(e.properties,t)}o(pne,"FromMappedResult");function ck(e,t){let r=pne(e,t);return Qr(r)}o(ck,"ExtractFromMappedResult");g();function pk(e,t){return Ne(e.returns,t)}o(pk,"InstanceType");g();function fk(e){return Ne({[Se]:"Integer",type:"integer"},e)}o(fk,"Integer");g();g();g();function fne(e,t,r){return{[e]:du(cn(e),t,ri(r))}}o(fne,"MappedIntrinsicPropertyKey");function dne(e,t,r){return e.reduce((i,a)=>Y(Y({},i),fne(a,t,r)),{})}o(dne,"MappedIntrinsicPropertyKeys");function hne(e,t,r){return dne(e.keys,t,r)}o(hne,"MappedIntrinsicProperties");function dk(e,t,r){let n=hne(e,t,r);return Qr(n)}o(dk,"IntrinsicFromMappedKey");function mne(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}o(mne,"ApplyUncapitalize");function gne(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}o(gne,"ApplyCapitalize");function yne(e){return e.toUpperCase()}o(yne,"ApplyUppercase");function vne(e){return e.toLowerCase()}o(vne,"ApplyLowercase");function xne(e,t,r){let n=sy(e.pattern);if(!Gh(n))return Ie(Y({},e),{pattern:hk(e.pattern,t)});let u=[...Sv(n)].map(m=>cn(m)),c=mk(u,t),f=Cn(c);return cS([f],r)}o(xne,"FromTemplateLiteral");function hk(e,t){return typeof e=="string"?t==="Uncapitalize"?mne(e):t==="Capitalize"?gne(e):t==="Uppercase"?yne(e):t==="Lowercase"?vne(e):e:e.toString()}o(hk,"FromLiteralValue");function mk(e,t){return e.map(r=>du(r,t))}o(mk,"FromRest");function du(e,t,r={}){return ka(e)?dk(e,t,r):Ba(e)?xne(e,t,r):un(e)?Cn(mk(e.anyOf,t),r):gp(e)?cn(hk(e.const,t),r):Ne(e,r)}o(du,"Intrinsic");function gk(e,t={}){return du(e,"Capitalize",t)}o(gk,"Capitalize");g();function yk(e,t={}){return du(e,"Lowercase",t)}o(yk,"Lowercase");g();function vk(e,t={}){return du(e,"Uncapitalize",t)}o(vk,"Uncapitalize");g();function xk(e,t={}){return du(e,"Uppercase",t)}o(xk,"Uppercase");g();function bk(e,t){return Ne({[Se]:"Not",not:e},t)}o(bk,"Not");g();g();g();function bne(e,t,r){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=hy(e[i],t,ri(r));return n}o(bne,"FromProperties");function Ine(e,t,r){return bne(e.properties,t,r)}o(Ine,"FromMappedResult");function Ik(e,t,r){let n=Ine(e,t,r);return Qr(n)}o(Ik,"OmitFromMappedResult");function Sne(e,t){return e.map(r=>OE(r,t))}o(Sne,"FromIntersect");function _ne(e,t){return e.map(r=>OE(r,t))}o(_ne,"FromUnion");function Cne(e,t){let i=e,{[t]:r}=i;return is(i,[gI(t)])}o(Cne,"FromProperty");function wne(e,t){return t.reduce((r,n)=>Cne(r,n),e)}o(wne,"FromProperties");function Pne(e,t){let r=Ni(e,[ni,"$id","required","properties"]),n=wne(e.properties,t);return Fn(n,r)}o(Pne,"FromObject");function OE(e,t){return $i(e)?ga(Sne(e.allOf,t)):un(e)?Cn(_ne(e.anyOf,t)):yo(e)?Pne(e,t):Fn({})}o(OE,"OmitResolve");function hy(e,t,r){if(ka(t))return Sk(e,t,r);if(ii(e))return Ik(e,t,r);let n=pu(t)?ma(t):t;return Ne(Y(Y({},OE(e,n)),r))}o(hy,"Omit");function Tne(e,t,r){return{[t]:hy(e,[t],ri(r))}}o(Tne,"FromPropertyKey");function Ene(e,t,r){return t.reduce((n,i)=>Y(Y({},n),Tne(e,i,r)),{})}o(Ene,"FromPropertyKeys");function Mne(e,t,r){return Ene(e,t.keys,r)}o(Mne,"FromMappedKey");function Sk(e,t,r){let n=Mne(e,t,r);return Qr(n)}o(Sk,"OmitFromMappedKey");g();function _k(e,t){return pc(e.parameters,t)}o(_k,"Parameters");g();g();function Ck(e){return e.map(t=>wk(t))}o(Ck,"FromRest");function One(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=ha(e[r]);return t}o(One,"FromProperties");function Lne(e){let t=Ni(e,[ni,"$id","required","properties"]),r=One(e.properties);return Fn(r,t)}o(Lne,"FromObject");function wk(e){return $i(e)?ga(Ck(e.allOf)):un(e)?Cn(Ck(e.anyOf)):yo(e)?Lne(e):Fn({})}o(wk,"PartialResolve");function _S(e,t){return ii(e)?Pk(e,t):Ne(Y(Y({},wk(e)),t))}o(_S,"Partial");function Dne(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=_S(e[n],ri(t));return r}o(Dne,"FromProperties");function Ane(e,t){return Dne(e.properties,t)}o(Ane,"FromMappedResult");function Pk(e,t){let r=Ane(e,t);return Qr(r)}o(Pk,"PartialFromMappedResult");g();g();g();function Fne(e,t,r){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=my(e[i],t,ri(r));return n}o(Fne,"FromProperties");function Nne(e,t,r){return Fne(e.properties,t,r)}o(Nne,"FromMappedResult");function Tk(e,t,r){let n=Nne(e,t,r);return Qr(n)}o(Tk,"PickFromMappedResult");function Rne(e,t){return e.map(r=>LE(r,t))}o(Rne,"FromIntersect");function kne(e,t){return e.map(r=>LE(r,t))}o(kne,"FromUnion");function Bne(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}o(Bne,"FromProperties");function Gne(e,t){let r=Ni(e,[ni,"$id","required","properties"]),n=Bne(e.properties,t);return Fn(n,r)}o(Gne,"FromObject");function LE(e,t){return $i(e)?ga(Rne(e.allOf,t)):un(e)?Cn(kne(e.anyOf,t)):yo(e)?Gne(e,t):Fn({})}o(LE,"PickResolve");function my(e,t,r){if(ka(t))return Ek(e,t,r);if(ii(e))return Tk(e,t,r);let n=pu(t)?ma(t):t;return Ne(Y(Y({},LE(e,n)),r))}o(my,"Pick");function jne(e,t,r){return{[t]:my(e,[t],ri(r))}}o(jne,"FromPropertyKey");function Une(e,t,r){return t.reduce((n,i)=>Y(Y({},n),jne(e,i,r)),{})}o(Une,"FromPropertyKeys");function Vne(e,t,r){return Une(e,t.keys,r)}o(Vne,"FromMappedKey");function Ek(e,t,r){let n=Vne(e,t,r);return Qr(n)}o(Ek,"PickFromMappedKey");g();function Mk(e){return yl(ha(e))}o(Mk,"ReadonlyOptional");g();function Uh(e,t,r){return Ne({[Se]:"Record",type:"object",patternProperties:{[e]:t}},r)}o(Uh,"RecordCreateFromPattern");function DE(e,t,r){let n={};for(let i of e)n[i]=t;return Fn(n,Ie(Y({},r),{[ml]:"Record"}))}o(DE,"RecordCreateFromKeys");function zne(e,t,r){return lS(e)?DE(ma(e),t,r):Uh(e.pattern,t,r)}o(zne,"FromTemplateLiteralKey");function $ne(e,t,r){return DE(ma(Cn(e)),t,r)}o($ne,"FromUnionKey");function Hne(e,t,r){return DE([e.toString()],t,r)}o(Hne,"FromLiteralKey");function Wne(e,t,r){return Uh(e.source,t,r)}o(Wne,"FromRegExpKey");function qne(e,t,r){let n=Ci(e.pattern)?vp:e.pattern;return Uh(n,t,r)}o(qne,"FromStringKey");function Yne(e,t,r){return Uh(vp,t,r)}o(Yne,"FromAnyKey");function Xne(e,t,r){return Uh(bR,t,r)}o(Xne,"FromNeverKey");function Zne(e,t,r){return Uh(yp,t,r)}o(Zne,"FromIntegerKey");function Kne(e,t,r){return Uh(yp,t,r)}o(Kne,"FromNumberKey");function Ok(e,t,r={}){return un(e)?$ne(e.anyOf,t,r):Ba(e)?zne(e,t,r):gp(e)?Hne(e.const,t,r):Rh(e)?Zne(e,t,r):kh(e)?Kne(e,t,r):tE(e)?Wne(e,t,r):gv(e)?qne(e,t,r):ZT(e)?Yne(e,t,r):$f(e)?Xne(e,t,r):_n(r)}o(Ok,"Record");g();var Jne=0;function Lk(e,t={}){Ci(t.$id)&&(t.$id="T".concat(Jne++));let r=cv(e({[Se]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,Ne(Y({[ml]:"Recursive"},r),t)}o(Lk,"Recursive");g();function Dk(e,t){if(qn(e))return Ne({[Se]:"Ref",$ref:e},t);if(Ci(e.$id))throw new Error("Reference target type must specify an $id");return Ne({[Se]:"Ref",$ref:e.$id},t)}o(Dk,"Ref");g();function Ak(e,t){let r=qn(e)?new globalThis.RegExp(e):e;return Ne({[Se]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}o(Ak,"RegExp");g();g();function Fk(e){return e.map(t=>Nk(t))}o(Fk,"FromRest");function Qne(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Ni(e[r],[Xs]);return t}o(Qne,"FromProperties");function eie(e){let t=Ni(e,[ni,"$id","required","properties"]),r=Qne(e.properties);return Fn(r,t)}o(eie,"FromObject");function Nk(e){return $i(e)?ga(Fk(e.allOf)):un(e)?Cn(Fk(e.anyOf)):yo(e)?eie(e):Fn({})}o(Nk,"RequiredResolve");function CS(e,t){return ii(e)?Rk(e,t):Ne(Y(Y({},Nk(e)),t))}o(CS,"Required");function tie(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=CS(e[n],t);return r}o(tie,"FromProperties");function rie(e,t){return tie(e.properties,t)}o(rie,"FromMappedResult");function Rk(e,t){let r=rie(e,t);return Qr(r)}o(Rk,"RequiredFromMappedResult");g();function nie(e){var t;return $i(e)?e.allOf:un(e)?e.anyOf:cu(e)?(t=e.items)!=null?t:[]:[]}o(nie,"RestResolve");function kk(e){return nie(e)}o(kk,"Rest");g();function Bk(e,t){return Ne(e.returns,t)}o(Bk,"ReturnType");g();function Gk(e){return JSON.parse(JSON.stringify(e))}o(Gk,"Strict");g();var NE=class NE{constructor(t){this.schema=t}Decode(t){return new FE(this.schema,t)}};o(NE,"TransformDecodeBuilder");var AE=NE,RE=class RE{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let a={Encode:o(u=>r[ni].Encode(t(u)),"Encode"),Decode:o(u=>this.decode(r[ni].Decode(u)),"Decode")};return Ie(Y({},r),{[ni]:a})}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return Ie(Y({},r),{[ni]:n})}Encode(t){return ty(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};o(RE,"TransformEncodeBuilder");var FE=RE;function jk(e){return new AE(e)}o(jk,"Transform");g();function wS(e={}){var t;return Ne({[Se]:(t=e[Se])!=null?t:"Unsafe"},e)}o(wS,"Unsafe");g();function Uk(e){return Ne({[Se]:"Void",type:"void"},e)}o(Uk,"Void");g();var kE={};bf(kE,{Any:()=>Wf,Array:()=>iS,AsyncIterator:()=>oS,Awaited:()=>UR,BigInt:()=>ly,Boolean:()=>uS,Capitalize:()=>gk,Composite:()=>$R,Const:()=>HR,Constructor:()=>sS,ConstructorParameters:()=>WR,Date:()=>mS,Deref:()=>fu,Enum:()=>qR,Exclude:()=>fy,Extends:()=>py,Extract:()=>dy,Function:()=>qf,Index:()=>uy,InstanceType:()=>pk,Integer:()=>fk,Intersect:()=>ga,Iterator:()=>fS,KeyOf:()=>hS,Literal:()=>cn,Lowercase:()=>yk,Mapped:()=>kR,Never:()=>_n,Not:()=>bk,Null:()=>gS,Number:()=>cc,Object:()=>Fn,Omit:()=>hy,Optional:()=>ha,Parameters:()=>_k,Partial:()=>_S,Pick:()=>my,Promise:()=>dS,Readonly:()=>yl,ReadonlyOptional:()=>Mk,Record:()=>Ok,Recursive:()=>Lk,Ref:()=>Dk,RegExp:()=>Ak,Required:()=>CS,Rest:()=>kk,ReturnType:()=>Bk,Strict:()=>Gk,String:()=>gl,Symbol:()=>yS,TemplateLiteral:()=>cS,Transform:()=>jk,Tuple:()=>pc,Uint8Array:()=>xS,Uncapitalize:()=>vk,Undefined:()=>vS,Union:()=>Cn,Unknown:()=>Ip,Unsafe:()=>wS,Uppercase:()=>xk,Void:()=>Uk});g();var D=kE;g();var Tv=D.Object({externalId:D.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:D.String({description:"The name of the entity."}),shortName:D.String({description:"A short name for the entity."}),description:D.String({description:"A description of the entity."}),icon:D.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),BE=D.Partial(Tv,{$id:"Details",description:"Additional information about a given entity."}),Ga=D.Object({details:D.Optional(D.Ref(BE))},{$id:"WithDetails"}),Vh=o(e=>{let t=[...e].sort(),r=D.Pick(Tv,e),n=D.Omit(Tv,e);return D.Object({details:D.Intersect([r,D.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},"WithRequiredDetails"),GE=[Tv,BE];g();var gy=D.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),yy=D.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),zh=D.Tuple([D.Ref(gy),D.Ref(yy)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),Os=D.Object({type:D.Literal("Point"),coordinates:D.Ref(zh)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),PS=D.Object({type:D.Literal("MultiPoint"),coordinates:D.Array(D.Ref(zh))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),TS=D.Object({type:D.Literal("LineString"),coordinates:D.Array(D.Ref(zh),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),ES=D.Object({type:D.Literal("MultiLineString"),coordinates:D.Array(D.Array(D.Ref(zh),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),Vk=D.Array(D.Ref(zh),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),jE=D.Array(D.Ref(Vk),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),vy=D.Object({type:D.Literal("Polygon"),coordinates:D.Ref(jE)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),xy=D.Object({type:D.Literal("MultiPolygon"),coordinates:D.Array(D.Ref(jE))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),cs=o((e,t,r)=>D.Object({type:D.Literal("Feature"),geometry:e,properties:t},r),"Feature"),Ks=o((e,t,r)=>D.Object({type:D.Literal("FeatureCollection"),features:D.Array(e,r)},t),"FeatureCollection"),UE=[gy,yy,zh,Os,PS,TS,ES,Vk,jE,vy,xy];g();var Ri=o((e,t)=>D.Unsafe(D.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]+$")})),"Ident"),Ls=Ri("g","GeometryId"),jr=Ri("f","FloorId"),VE=[Ls,jr];g();g();g();var zE=class zE{constructor(t){b(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};o(zE,"OptionIterator");var MS=zE,$E=class $E{constructor(t){b(this,"_tag","Some");b(this,"_value");this._value=t}get value(){return this._value}isSome(){return!0}isSomeAnd(t){return t(this.value)}isNone(){return!1}equals(t){return t.isSome()&&t.value===this.value}expect(t){return this.value}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectNone(t){return this}map(t){return zk(t(this.value))}mapAsync(t){return t(this.value).then(r=>zk(r))}mapOr(t,r){return this.map(t).unwrapOr(r)}mapOrAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOr(r))}mapOrElse(t,r){return this.map(t).unwrapOrElse(r)}mapOrElseAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOrElse(r))}and(t){return t}andThen(t){return t(this.value)}andThenAsync(t){return t(this.value)}filter(t){return t(this.value)?this:Zf()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?Zf():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return et(this.value)}okOrElse(t){return et(this.value)}iter(){return new MS(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?by([this.value,t.value]):Zf()}zipWith(t,r){return t.isSome()?by(r(this.value,t.value)):Zf()}get[Symbol.toStringTag](){return"Some"}};o($E,"Some");var OS=$E,HE=class HE{constructor(){b(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(t){return!1}isNone(){return!0}equals(t){return t.isNone()}expect(t){throw new Error(t)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(t){return this}inspectNone(t){return t(),this}map(t){return this}mapAsync(t){return Promise.resolve(this)}mapOr(t,r){return r}mapOrAsync(t,r){return Promise.resolve(r)}mapOrElse(t,r){return r()}mapOrElseAsync(t,r){return r()}and(t){return this}andThen(t){return this}andThenAsync(t){return Promise.resolve(this)}filter(t){return this}or(t){return t}orElse(t){return t()}xor(t){return t}toString(){return"None"}okOr(t){return nt(t)}okOrElse(t){return nt(t())}iter(){return new MS(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}get[Symbol.toStringTag](){return"None"}};o(HE,"None");var LS=HE,by=o(e=>new OS(e),"some"),Zf=o(()=>new LS,"none"),zk=o(e=>e instanceof OS||e instanceof LS?e:e==null?Zf():by(e),"option");var YE=class YE{constructor(t){b(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};o(YE,"ResultIterator");var DS=YE,XE=class XE{constructor(t){b(this,"_tag","Ok");b(this,"_value");this._value=t}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(t){return t(this.value)}isErr(){return!1}isErrAnd(t){return!1}ok(){return by(this.value)}err(){return Zf()}expect(t){return this.value}expectErr(t){throw new Error(t)}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectErr(){return this}map(t){return et(t(this.value))}async mapAsync(t){return t(this.value).then(et)}mapOr(t,r){return t(this.value)}async mapOrAsync(t,r){return t(this.value)}mapOrElse(t,r){return t(this.value)}async mapOrElseAsync(t,r){return t(this.value)}mapErr(t){return this}iter(){return new DS(this.value)}[Symbol.iterator](){return this.iter()}and(t){return t}andThen(t){return t(this.value)}or(t){return this}orElse(t){return this}async andThenAsync(t){return t(this.value)}toString(){return"Ok(".concat(this.value,")")}get[Symbol.toStringTag](){return"Ok"}};o(XE,"Ok");var WE=XE,AS=class AS{constructor(t){b(this,"_tag","Err");b(this,"_error");this._error=t}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(t){return!1}isErr(){return!0}isErrAnd(t){return t(this.error)}ok(){return Zf()}err(){return by(this.error)}expect(t){throw new Error(t)}expectErr(t){return this.error}unwrap(){throw this.error}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(){return this}inspectErr(t){return t(this.error),this}map(t){return this}iter(){return new DS(null)}[Symbol.iterator](){return this.iter()}async mapAsync(t){return this}mapOr(t,r){return r}async mapOrAsync(t,r){return r}mapOrElse(t,r){return r()}async mapOrElseAsync(t,r){return r()}mapErr(t){return new AS(t(this.error))}and(t){return this}andThen(t){return this}async andThenAsync(t){return this}or(t){return t}orElse(t){return t(this.error)}toString(){return"Err(".concat(this.error,")")}get[Symbol.toStringTag](){return"Err"}};o(AS,"Err");var qE=AS,et=o(e=>new WE(e),"ok"),nt=o(e=>new qE(e),"err");g();var va;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError",e.DuplicateIdError="DuplicateIdError"})(va||(va={}));g();g();g();g();var KE=class KE extends Tt{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}};o(KE,"TypeSystemDuplicateTypeKind");var ZE=KE,JE=class JE extends Tt{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}};o(JE,"TypeSystemDuplicateFormat");var Ev=JE,FS;(function(e){function t(n,i){if(vo.Has(n))throw new ZE(n);return vo.Set(n,i),(a={})=>wS(Ie(Y({},a),{[Se]:n}))}o(t,"Type"),e.Type=t;function r(n,i){if(Zs.Has(n))throw new Ev(n);return Zs.Set(n,i),n}o(r,"Format"),e.Format=r})(FS||(FS={}));g();function iie(e){switch(e.errorType){case _e.ArrayContains:return"Expected array to contain at least one matching value";case _e.ArrayMaxContains:return"Expected array to contain no more than ".concat(e.schema.maxContains," matching values");case _e.ArrayMinContains:return"Expected array to contain at least ".concat(e.schema.minContains," matching values");case _e.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(e.schema.maxItems);case _e.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(e.schema.minItems);case _e.ArrayUniqueItems:return"Expected array elements to be unique";case _e.Array:return"Expected array";case _e.AsyncIterator:return"Expected AsyncIterator";case _e.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(e.schema.exclusiveMaximum);case _e.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(e.schema.exclusiveMinimum);case _e.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(e.schema.maximum);case _e.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(e.schema.minimum);case _e.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(e.schema.multipleOf);case _e.BigInt:return"Expected bigint";case _e.Boolean:return"Expected boolean";case _e.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(e.schema.exclusiveMinimumTimestamp);case _e.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(e.schema.exclusiveMaximumTimestamp);case _e.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(e.schema.minimumTimestamp);case _e.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(e.schema.maximumTimestamp);case _e.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(e.schema.multipleOfTimestamp);case _e.Date:return"Expected Date";case _e.Function:return"Expected function";case _e.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(e.schema.exclusiveMaximum);case _e.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(e.schema.exclusiveMinimum);case _e.IntegerMaximum:return"Expected integer to be less or equal to ".concat(e.schema.maximum);case _e.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(e.schema.minimum);case _e.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(e.schema.multipleOf);case _e.Integer:return"Expected integer";case _e.IntersectUnevaluatedProperties:return"Unexpected property";case _e.Intersect:return"Expected all values to match";case _e.Iterator:return"Expected Iterator";case _e.Literal:return"Expected ".concat(typeof e.schema.const=="string"?"'".concat(e.schema.const,"'"):e.schema.const);case _e.Never:return"Never";case _e.Not:return"Value should not match";case _e.Null:return"Expected null";case _e.NumberExclusiveMaximum:return"Expected number to be less than ".concat(e.schema.exclusiveMaximum);case _e.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(e.schema.exclusiveMinimum);case _e.NumberMaximum:return"Expected number to be less or equal to ".concat(e.schema.maximum);case _e.NumberMinimum:return"Expected number to be greater or equal to ".concat(e.schema.minimum);case _e.NumberMultipleOf:return"Expected number to be a multiple of ".concat(e.schema.multipleOf);case _e.Number:return"Expected number";case _e.Object:return"Expected object";case _e.ObjectAdditionalProperties:return"Unexpected property";case _e.ObjectMaxProperties:return"Expected object to have no more than ".concat(e.schema.maxProperties," properties");case _e.ObjectMinProperties:return"Expected object to have at least ".concat(e.schema.minProperties," properties");case _e.ObjectRequiredProperty:return"Expected required property";case _e.Promise:return"Expected Promise";case _e.RegExp:return"Expected string to match regular expression";case _e.StringFormatUnknown:return"Unknown format '".concat(e.schema.format,"'");case _e.StringFormat:return"Expected string to match '".concat(e.schema.format,"' format");case _e.StringMaxLength:return"Expected string length less or equal to ".concat(e.schema.maxLength);case _e.StringMinLength:return"Expected string length greater or equal to ".concat(e.schema.minLength);case _e.StringPattern:return"Expected string to match '".concat(e.schema.pattern,"'");case _e.String:return"Expected string";case _e.Symbol:return"Expected symbol";case _e.TupleLength:return"Expected tuple to have ".concat(e.schema.maxItems||0," elements");case _e.Tuple:return"Expected tuple";case _e.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(e.schema.maxByteLength);case _e.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(e.schema.minByteLength);case _e.Uint8Array:return"Expected Uint8Array";case _e.Undefined:return"Expected undefined";case _e.Union:return"Expected union value";case _e.Void:return"Expected void";case _e.Kind:return"Expected kind '".concat(e.schema[Se],"'");default:return"Unknown error type"}}o(iie,"DefaultErrorFunction");var oie=iie;function $k(){return oie}o($k,"GetErrorFunction");g();var eM=class eM extends Tt{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};o(eM,"TypeDereferenceError");var QE=eM;function sie(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new QE(e);return en(r,t)}o(sie,"Resolve");function Il(e,t){return!qr(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}o(Il,"Pushref");function en(e,t){return e[Se]==="This"||e[Se]==="Ref"?sie(e,t):e}o(en,"Deref");g();var rM=class rM extends Tt{constructor(t){super("Unable to hash value"),this.value=t}};o(rM,"ValueHashError");var tM=rM,ja;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(ja||(ja={}));var Iy=BigInt("14695981039346656037"),[aie,lie]=[BigInt("1099511628211"),BigInt("18446744073709551616")],uie=Array.from({length:256}).map((e,t)=>BigInt(t)),Hk=new Float64Array(1),Wk=new DataView(Hk.buffer),qk=new Uint8Array(Hk.buffer);function*cie(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}o(cie,"NumberToBytes");function pie(e){Ds(ja.Array);for(let t of e)Sy(t)}o(pie,"ArrayType");function fie(e){Ds(ja.Boolean),Ds(e?1:0)}o(fie,"BooleanType");function die(e){Ds(ja.BigInt),Wk.setBigInt64(0,e);for(let t of qk)Ds(t)}o(die,"BigIntType");function hie(e){Ds(ja.Date),Sy(e.getTime())}o(hie,"DateType");function mie(e){Ds(ja.Null)}o(mie,"NullType");function gie(e){Ds(ja.Number),Wk.setFloat64(0,e);for(let t of qk)Ds(t)}o(gie,"NumberType");function yie(e){Ds(ja.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Sy(t),Sy(e[t])}o(yie,"ObjectType");function vie(e){Ds(ja.String);for(let t=0;t<e.length;t++)for(let r of cie(e.charCodeAt(t)))Ds(r)}o(vie,"StringType");function xie(e){Ds(ja.Symbol),Sy(e.description)}o(xie,"SymbolType");function bie(e){Ds(ja.Uint8Array);for(let t=0;t<e.length;t++)Ds(e[t])}o(bie,"Uint8ArrayType");function Iie(e){return Ds(ja.Undefined)}o(Iie,"UndefinedType");function Sy(e){if(kt(e))return pie(e);if(ac(e))return fie(e);if(ls(e))return die(e);if(Ys(e))return hie(e);if(fp(e))return mie(e);if(vt(e))return gie(e);if(zt(e))return yie(e);if(qr(e))return vie(e);if(dp(e))return xie(e);if(ey(e))return bie(e);if(wi(e))return Iie(e);throw new tM(e)}o(Sy,"Visit");function Ds(e){Iy=Iy^uie[e],Iy=Iy*aie%lie}o(Ds,"FNV1A64");function Kf(e){return Iy=BigInt("14695981039346656037"),Sy(e),Iy}o(Kf,"Hash");g();var iM=class iM extends Tt{constructor(t){super("Unknown type"),this.schema=t}};o(iM,"ValueCheckUnknownTypeError");var nM=iM;function Sie(e){return e[Se]==="Any"||e[Se]==="Unknown"}o(Sie,"IsAnyOrUnknown");function Nr(e){return e!==void 0}o(Nr,"IsDefined");function _ie(e,t,r){return!0}o(_ie,"FromAny");function Cie(e,t,r){if(!kt(r)||Nr(e.minItems)&&!(r.length>=e.minItems)||Nr(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(a=>ps(e.items,t,a))||e.uniqueItems===!0&&!function(){let a=new Set;for(let u of r){let c=Kf(u);if(a.has(c))return!1;a.add(c)}return!0}())return!1;if(!(Nr(e.contains)||vt(e.minContains)||vt(e.maxContains)))return!0;let n=Nr(e.contains)?e.contains:_n(),i=r.reduce((a,u)=>ps(n,t,u)?a+1:a,0);return!(i===0||vt(e.minContains)&&i<e.minContains||vt(e.maxContains)&&i>e.maxContains)}o(Cie,"FromArray");function wie(e,t,r){return eS(r)}o(wie,"FromAsyncIterator");function Pie(e,t,r){return!(!ls(r)||Nr(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Nr(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Nr(e.maximum)&&!(r<=e.maximum)||Nr(e.minimum)&&!(r>=e.minimum)||Nr(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}o(Pie,"FromBigInt");function Tie(e,t,r){return ac(r)}o(Tie,"FromBoolean");function Eie(e,t,r){return ps(e.returns,t,r.prototype)}o(Eie,"FromConstructor");function Mie(e,t,r){return!(!Ys(r)||Nr(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||Nr(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||Nr(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||Nr(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||Nr(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}o(Mie,"FromDate");function Oie(e,t,r){return zf(r)}o(Oie,"FromFunction");function Lie(e,t,r){return!(!nS(r)||Nr(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Nr(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Nr(e.maximum)&&!(r<=e.maximum)||Nr(e.minimum)&&!(r>=e.minimum)||Nr(e.multipleOf)&&r%e.multipleOf!==0)}o(Lie,"FromInteger");function Die(e,t,r){let n=e.allOf.every(i=>ps(i,t,r));if(e.unevaluatedProperties===!1){let i=new RegExp(bp(e)),a=Object.getOwnPropertyNames(r).every(u=>i.test(u));return n&&a}else if(Yr(e.unevaluatedProperties)){let i=new RegExp(bp(e)),a=Object.getOwnPropertyNames(r).every(u=>i.test(u)||ps(e.unevaluatedProperties,t,r[u]));return n&&a}else return n}o(Die,"FromIntersect");function Aie(e,t,r){return tS(r)}o(Aie,"FromIterator");function Fie(e,t,r){return r===e.const}o(Fie,"FromLiteral");function Nie(e,t,r){return!1}o(Nie,"FromNever");function Rie(e,t,r){return!ps(e.not,t,r)}o(Rie,"FromNot");function kie(e,t,r){return fp(r)}o(kie,"FromNull");function Bie(e,t,r){return!(!vn.IsNumberLike(r)||Nr(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Nr(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Nr(e.minimum)&&!(r>=e.minimum)||Nr(e.maximum)&&!(r<=e.maximum)||Nr(e.multipleOf)&&r%e.multipleOf!==0)}o(Bie,"FromNumber");function Gie(e,t,r){if(!vn.IsObjectLike(r)||Nr(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||Nr(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let n=Object.getOwnPropertyNames(e.properties);for(let i of n){let a=e.properties[i];if(e.required&&e.required.includes(i)){if(!ps(a,t,r[i])||(Sp(a)||Sie(a))&&!(i in r))return!1}else if(vn.IsExactOptionalProperty(r,i)&&!ps(a,t,r[i]))return!1}if(e.additionalProperties===!1){let i=Object.getOwnPropertyNames(r);return e.required&&e.required.length===n.length&&i.length===n.length?!0:i.every(a=>n.includes(a))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(a=>n.includes(a)||ps(e.additionalProperties,t,r[a])):!0}o(Gie,"FromObject");function jie(e,t,r){return rS(r)}o(jie,"FromPromise");function Uie(e,t,r){if(!vn.IsRecordLike(r)||Nr(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||Nr(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[n,i]=Object.entries(e.patternProperties)[0],a=new RegExp(n),u=Object.entries(r).every(([m,v])=>a.test(m)?ps(i,t,v):!0),c=typeof e.additionalProperties=="object"?Object.entries(r).every(([m,v])=>a.test(m)?!0:ps(e.additionalProperties,t,v)):!0,f=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(m=>a.test(m)):!0;return u&&c&&f}o(Uie,"FromRecord");function Vie(e,t,r){return ps(en(e,t),t,r)}o(Vie,"FromRef");function zie(e,t,r){let n=new RegExp(e.source,e.flags);return Nr(e.minLength)&&!(r.length>=e.minLength)||Nr(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}o(zie,"FromRegExp");function $ie(e,t,r){return!qr(r)||Nr(e.minLength)&&!(r.length>=e.minLength)||Nr(e.maxLength)&&!(r.length<=e.maxLength)||Nr(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:Nr(e.format)?Zs.Has(e.format)?Zs.Get(e.format)(r):!1:!0}o($ie,"FromString");function Hie(e,t,r){return dp(r)}o(Hie,"FromSymbol");function Wie(e,t,r){return qr(r)&&new RegExp(e.pattern).test(r)}o(Wie,"FromTemplateLiteral");function qie(e,t,r){return ps(en(e,t),t,r)}o(qie,"FromThis");function Yie(e,t,r){if(!kt(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let n=0;n<e.items.length;n++)if(!ps(e.items[n],t,r[n]))return!1;return!0}o(Yie,"FromTuple");function Xie(e,t,r){return wi(r)}o(Xie,"FromUndefined");function Zie(e,t,r){return e.anyOf.some(n=>ps(n,t,r))}o(Zie,"FromUnion");function Kie(e,t,r){return!(!ey(r)||Nr(e.maxByteLength)&&!(r.length<=e.maxByteLength)||Nr(e.minByteLength)&&!(r.length>=e.minByteLength))}o(Kie,"FromUint8Array");function Jie(e,t,r){return!0}o(Jie,"FromUnknown");function Qie(e,t,r){return vn.IsVoidLike(r)}o(Qie,"FromVoid");function eoe(e,t,r){return vo.Has(e[Se])?vo.Get(e[Se])(e,r):!1}o(eoe,"FromKind");function ps(e,t,r){let n=Nr(e.$id)?[...t,e]:t,i=e;switch(i[Se]){case"Any":return _ie(i,n,r);case"Array":return Cie(i,n,r);case"AsyncIterator":return wie(i,n,r);case"BigInt":return Pie(i,n,r);case"Boolean":return Tie(i,n,r);case"Constructor":return Eie(i,n,r);case"Date":return Mie(i,n,r);case"Function":return Oie(i,n,r);case"Integer":return Lie(i,n,r);case"Intersect":return Die(i,n,r);case"Iterator":return Aie(i,n,r);case"Literal":return Fie(i,n,r);case"Never":return Nie(i,n,r);case"Not":return Rie(i,n,r);case"Null":return kie(i,n,r);case"Number":return Bie(i,n,r);case"Object":return Gie(i,n,r);case"Promise":return jie(i,n,r);case"Record":return Uie(i,n,r);case"Ref":return Vie(i,n,r);case"RegExp":return zie(i,n,r);case"String":return $ie(i,n,r);case"Symbol":return Hie(i,n,r);case"TemplateLiteral":return Wie(i,n,r);case"This":return qie(i,n,r);case"Tuple":return Yie(i,n,r);case"Undefined":return Xie(i,n,r);case"Union":return Zie(i,n,r);case"Uint8Array":return Kie(i,n,r);case"Unknown":return Jie(i,n,r);case"Void":return Qie(i,n,r);default:if(!vo.Has(i[Se]))throw new nM(i);return eoe(i,n,r)}}o(ps,"Visit");function qt(...e){return e.length===3?ps(e[0],e[1],e[2]):ps(e[0],[],e[1])}o(qt,"Check");var _e;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(_e||(_e={}));var sM=class sM extends Tt{constructor(t){super("Unknown type"),this.schema=t}};o(sM,"ValueErrorsUnknownTypeError");var oM=sM;function _p(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(_p,"EscapeKey");function Rr(e){return e!==void 0}o(Rr,"IsDefined");var aM=class aM{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};o(aM,"ValueErrorIterator");var Sl=aM;function Je(e,t,r,n,i=[]){return{type:e,schema:t,path:r,value:n,message:$k()({errorType:e,path:r,schema:t,value:n,errors:i}),errors:i}}o(Je,"Create");function*toe(e,t,r,n){}o(toe,"FromAny");function*roe(e,t,r,n){if(!kt(n))return yield Je(_e.Array,e,r,n);Rr(e.minItems)&&!(n.length>=e.minItems)&&(yield Je(_e.ArrayMinItems,e,r,n)),Rr(e.maxItems)&&!(n.length<=e.maxItems)&&(yield Je(_e.ArrayMaxItems,e,r,n));for(let u=0;u<n.length;u++)yield*ke(fs(e.items,t,"".concat(r,"/").concat(u),n[u]));if(e.uniqueItems===!0&&!function(){let u=new Set;for(let c of n){let f=Kf(c);if(u.has(f))return!1;u.add(f)}return!0}()&&(yield Je(_e.ArrayUniqueItems,e,r,n)),!(Rr(e.contains)||Rr(e.minContains)||Rr(e.maxContains)))return;let i=Rr(e.contains)?e.contains:_n(),a=n.reduce((u,c,f)=>fs(i,t,"".concat(r).concat(f),c).next().done===!0?u+1:u,0);a===0&&(yield Je(_e.ArrayContains,e,r,n)),vt(e.minContains)&&a<e.minContains&&(yield Je(_e.ArrayMinContains,e,r,n)),vt(e.maxContains)&&a>e.maxContains&&(yield Je(_e.ArrayMaxContains,e,r,n))}o(roe,"FromArray");function*noe(e,t,r,n){eS(n)||(yield Je(_e.AsyncIterator,e,r,n))}o(noe,"FromAsyncIterator");function*ioe(e,t,r,n){if(!ls(n))return yield Je(_e.BigInt,e,r,n);Rr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield Je(_e.BigIntExclusiveMaximum,e,r,n)),Rr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield Je(_e.BigIntExclusiveMinimum,e,r,n)),Rr(e.maximum)&&!(n<=e.maximum)&&(yield Je(_e.BigIntMaximum,e,r,n)),Rr(e.minimum)&&!(n>=e.minimum)&&(yield Je(_e.BigIntMinimum,e,r,n)),Rr(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield Je(_e.BigIntMultipleOf,e,r,n))}o(ioe,"FromBigInt");function*ooe(e,t,r,n){ac(n)||(yield Je(_e.Boolean,e,r,n))}o(ooe,"FromBoolean");function*soe(e,t,r,n){yield*ke(fs(e.returns,t,r,n.prototype))}o(soe,"FromConstructor");function*aoe(e,t,r,n){if(!Ys(n))return yield Je(_e.Date,e,r,n);Rr(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield Je(_e.DateExclusiveMaximumTimestamp,e,r,n)),Rr(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield Je(_e.DateExclusiveMinimumTimestamp,e,r,n)),Rr(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield Je(_e.DateMaximumTimestamp,e,r,n)),Rr(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield Je(_e.DateMinimumTimestamp,e,r,n)),Rr(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield Je(_e.DateMultipleOfTimestamp,e,r,n))}o(aoe,"FromDate");function*loe(e,t,r,n){zf(n)||(yield Je(_e.Function,e,r,n))}o(loe,"FromFunction");function*uoe(e,t,r,n){if(!nS(n))return yield Je(_e.Integer,e,r,n);Rr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield Je(_e.IntegerExclusiveMaximum,e,r,n)),Rr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield Je(_e.IntegerExclusiveMinimum,e,r,n)),Rr(e.maximum)&&!(n<=e.maximum)&&(yield Je(_e.IntegerMaximum,e,r,n)),Rr(e.minimum)&&!(n>=e.minimum)&&(yield Je(_e.IntegerMinimum,e,r,n)),Rr(e.multipleOf)&&n%e.multipleOf!==0&&(yield Je(_e.IntegerMultipleOf,e,r,n))}o(uoe,"FromInteger");function*coe(e,t,r,n){let i=!1;for(let a of e.allOf)for(let u of fs(a,t,r,n))i=!0,yield u;if(i)return yield Je(_e.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let a=new RegExp(bp(e));for(let u of Object.getOwnPropertyNames(n))a.test(u)||(yield Je(_e.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(u),n))}if(typeof e.unevaluatedProperties=="object"){let a=new RegExp(bp(e));for(let u of Object.getOwnPropertyNames(n))if(!a.test(u)){let c=fs(e.unevaluatedProperties,t,"".concat(r,"/").concat(u),n[u]).next();c.done||(yield c.value)}}}o(coe,"FromIntersect");function*poe(e,t,r,n){tS(n)||(yield Je(_e.Iterator,e,r,n))}o(poe,"FromIterator");function*foe(e,t,r,n){n!==e.const&&(yield Je(_e.Literal,e,r,n))}o(foe,"FromLiteral");function*doe(e,t,r,n){yield Je(_e.Never,e,r,n)}o(doe,"FromNever");function*hoe(e,t,r,n){fs(e.not,t,r,n).next().done===!0&&(yield Je(_e.Not,e,r,n))}o(hoe,"FromNot");function*moe(e,t,r,n){fp(n)||(yield Je(_e.Null,e,r,n))}o(moe,"FromNull");function*goe(e,t,r,n){if(!vn.IsNumberLike(n))return yield Je(_e.Number,e,r,n);Rr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield Je(_e.NumberExclusiveMaximum,e,r,n)),Rr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield Je(_e.NumberExclusiveMinimum,e,r,n)),Rr(e.maximum)&&!(n<=e.maximum)&&(yield Je(_e.NumberMaximum,e,r,n)),Rr(e.minimum)&&!(n>=e.minimum)&&(yield Je(_e.NumberMinimum,e,r,n)),Rr(e.multipleOf)&&n%e.multipleOf!==0&&(yield Je(_e.NumberMultipleOf,e,r,n))}o(goe,"FromNumber");function*yoe(e,t,r,n){if(!vn.IsObjectLike(n))return yield Je(_e.Object,e,r,n);Rr(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield Je(_e.ObjectMinProperties,e,r,n)),Rr(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield Je(_e.ObjectMaxProperties,e,r,n));let i=Array.isArray(e.required)?e.required:[],a=Object.getOwnPropertyNames(e.properties),u=Object.getOwnPropertyNames(n);for(let c of i)u.includes(c)||(yield Je(_e.ObjectRequiredProperty,e.properties[c],"".concat(r,"/").concat(_p(c)),void 0));if(e.additionalProperties===!1)for(let c of u)a.includes(c)||(yield Je(_e.ObjectAdditionalProperties,e,"".concat(r,"/").concat(_p(c)),n[c]));if(typeof e.additionalProperties=="object")for(let c of u)a.includes(c)||(yield*ke(fs(e.additionalProperties,t,"".concat(r,"/").concat(_p(c)),n[c])));for(let c of a){let f=e.properties[c];e.required&&e.required.includes(c)?(yield*ke(fs(f,t,"".concat(r,"/").concat(_p(c)),n[c])),Sp(e)&&!(c in n)&&(yield Je(_e.ObjectRequiredProperty,f,"".concat(r,"/").concat(_p(c)),void 0))):vn.IsExactOptionalProperty(n,c)&&(yield*ke(fs(f,t,"".concat(r,"/").concat(_p(c)),n[c])))}}o(yoe,"FromObject");function*voe(e,t,r,n){rS(n)||(yield Je(_e.Promise,e,r,n))}o(voe,"FromPromise");function*xoe(e,t,r,n){if(!vn.IsRecordLike(n))return yield Je(_e.Object,e,r,n);Rr(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield Je(_e.ObjectMinProperties,e,r,n)),Rr(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield Je(_e.ObjectMaxProperties,e,r,n));let[i,a]=Object.entries(e.patternProperties)[0],u=new RegExp(i);for(let[c,f]of Object.entries(n))u.test(c)&&(yield*ke(fs(a,t,"".concat(r,"/").concat(_p(c)),f)));if(typeof e.additionalProperties=="object")for(let[c,f]of Object.entries(n))u.test(c)||(yield*ke(fs(e.additionalProperties,t,"".concat(r,"/").concat(_p(c)),f)));if(e.additionalProperties===!1){for(let[c,f]of Object.entries(n))if(!u.test(c))return yield Je(_e.ObjectAdditionalProperties,e,"".concat(r,"/").concat(_p(c)),f)}}o(xoe,"FromRecord");function*boe(e,t,r,n){yield*ke(fs(en(e,t),t,r,n))}o(boe,"FromRef");function*Ioe(e,t,r,n){if(!qr(n))return yield Je(_e.String,e,r,n);if(Rr(e.minLength)&&!(n.length>=e.minLength)&&(yield Je(_e.StringMinLength,e,r,n)),Rr(e.maxLength)&&!(n.length<=e.maxLength)&&(yield Je(_e.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield Je(_e.RegExp,e,r,n)}o(Ioe,"FromRegExp");function*Soe(e,t,r,n){if(!qr(n))return yield Je(_e.String,e,r,n);Rr(e.minLength)&&!(n.length>=e.minLength)&&(yield Je(_e.StringMinLength,e,r,n)),Rr(e.maxLength)&&!(n.length<=e.maxLength)&&(yield Je(_e.StringMaxLength,e,r,n)),qr(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield Je(_e.StringPattern,e,r,n))),qr(e.format)&&(Zs.Has(e.format)?Zs.Get(e.format)(n)||(yield Je(_e.StringFormat,e,r,n)):yield Je(_e.StringFormatUnknown,e,r,n))}o(Soe,"FromString");function*_oe(e,t,r,n){dp(n)||(yield Je(_e.Symbol,e,r,n))}o(_oe,"FromSymbol");function*Coe(e,t,r,n){if(!qr(n))return yield Je(_e.String,e,r,n);new RegExp(e.pattern).test(n)||(yield Je(_e.StringPattern,e,r,n))}o(Coe,"FromTemplateLiteral");function*woe(e,t,r,n){yield*ke(fs(en(e,t),t,r,n))}o(woe,"FromThis");function*Poe(e,t,r,n){if(!kt(n))return yield Je(_e.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield Je(_e.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield Je(_e.TupleLength,e,r,n);if(e.items)for(let i=0;i<e.items.length;i++)yield*ke(fs(e.items[i],t,"".concat(r,"/").concat(i),n[i]))}o(Poe,"FromTuple");function*Toe(e,t,r,n){wi(n)||(yield Je(_e.Undefined,e,r,n))}o(Toe,"FromUndefined");function*Eoe(e,t,r,n){if(qt(e,t,n))return;let i=e.anyOf.map(a=>new Sl(fs(a,t,r,n)));yield Je(_e.Union,e,r,n,i)}o(Eoe,"FromUnion");function*Moe(e,t,r,n){if(!ey(n))return yield Je(_e.Uint8Array,e,r,n);Rr(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield Je(_e.Uint8ArrayMaxByteLength,e,r,n)),Rr(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield Je(_e.Uint8ArrayMinByteLength,e,r,n))}o(Moe,"FromUint8Array");function*Ooe(e,t,r,n){}o(Ooe,"FromUnknown");function*Loe(e,t,r,n){vn.IsVoidLike(n)||(yield Je(_e.Void,e,r,n))}o(Loe,"FromVoid");function*Doe(e,t,r,n){vo.Get(e[Se])(e,n)||(yield Je(_e.Kind,e,r,n))}o(Doe,"FromKind");function*fs(e,t,r,n){let i=Rr(e.$id)?[...t,e]:t,a=e;switch(a[Se]){case"Any":return yield*ke(toe(a,i,r,n));case"Array":return yield*ke(roe(a,i,r,n));case"AsyncIterator":return yield*ke(noe(a,i,r,n));case"BigInt":return yield*ke(ioe(a,i,r,n));case"Boolean":return yield*ke(ooe(a,i,r,n));case"Constructor":return yield*ke(soe(a,i,r,n));case"Date":return yield*ke(aoe(a,i,r,n));case"Function":return yield*ke(loe(a,i,r,n));case"Integer":return yield*ke(uoe(a,i,r,n));case"Intersect":return yield*ke(coe(a,i,r,n));case"Iterator":return yield*ke(poe(a,i,r,n));case"Literal":return yield*ke(foe(a,i,r,n));case"Never":return yield*ke(doe(a,i,r,n));case"Not":return yield*ke(hoe(a,i,r,n));case"Null":return yield*ke(moe(a,i,r,n));case"Number":return yield*ke(goe(a,i,r,n));case"Object":return yield*ke(yoe(a,i,r,n));case"Promise":return yield*ke(voe(a,i,r,n));case"Record":return yield*ke(xoe(a,i,r,n));case"Ref":return yield*ke(boe(a,i,r,n));case"RegExp":return yield*ke(Ioe(a,i,r,n));case"String":return yield*ke(Soe(a,i,r,n));case"Symbol":return yield*ke(_oe(a,i,r,n));case"TemplateLiteral":return yield*ke(Coe(a,i,r,n));case"This":return yield*ke(woe(a,i,r,n));case"Tuple":return yield*ke(Poe(a,i,r,n));case"Undefined":return yield*ke(Toe(a,i,r,n));case"Union":return yield*ke(Eoe(a,i,r,n));case"Uint8Array":return yield*ke(Moe(a,i,r,n));case"Unknown":return yield*ke(Ooe(a,i,r,n));case"Void":return yield*ke(Loe(a,i,r,n));default:if(!vo.Has(a[Se]))throw new oM(e);return yield*ke(Doe(a,i,r,n))}}o(fs,"Visit");function fc(...e){let t=e.length===3?fs(e[0],e[1],"",e[2]):fs(e[0],[],"",e[1]);return new Sl(t)}o(fc,"Errors");g();g();var Aoe=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Xk=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},lM,NS,Zk,cM=class cM extends Tt{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),lM.add(this),NS.set(this,void 0),Aoe(this,NS,t,"f"),this.error=r}Errors(){return new Sl(Xk(this,lM,"m",Zk).call(this))}};o(cM,"AssertError");var uM=cM;NS=new WeakMap,lM=new WeakSet,Zk=o(function*(){this.error&&(yield this.error),yield*ke(Xk(this,NS,"f"))},"_AssertError_Iterator");function Yk(e,t,r){if(!qt(e,t,r))throw new uM(fc(e,t,r))}o(Yk,"AssertValue");function RS(...e){return e.length===3?Yk(e[0],e[1],e[2]):Yk(e[0],[],e[1])}o(RS,"Assert");g();g();g();function Foe(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=tn(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=tn(e[r]);return t}o(Foe,"FromObject");function Noe(e){return e.map(t=>tn(t))}o(Noe,"FromArray");function Roe(e){return e.slice()}o(Roe,"FromTypedArray");function koe(e){return new Map(tn([...e.entries()]))}o(koe,"FromMap");function Boe(e){return new Set(tn([...e.entries()]))}o(Boe,"FromSet");function Goe(e){return new Date(e.toISOString())}o(Goe,"FromDate");function tn(e){if(kt(e))return Noe(e);if(Ys(e))return Goe(e);if(hl(e))return Roe(e);if(AN(e))return koe(e);if(FN(e))return Boe(e);if(zt(e))return Foe(e);if(us(e))return e;throw new Error("ValueClone: Unable to clone value")}o(tn,"Clone");var pM=class pM extends Tt{constructor(t,r){super(r),this.schema=t}};o(pM,"ValueCreateError");var Ua=pM;function rn(e){return zf(e)?e():tn(e)}o(rn,"FromDefault");function joe(e,t){return Et(e,"default")?rn(e.default):{}}o(joe,"FromAny");function Uoe(e,t){if(e.uniqueItems===!0&&!Et(e,"default"))throw new Ua(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!Et(e,"default"))throw new Ua(e,"Array with the contains constraint requires a default value");return"default"in e?rn(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>Va(e.items,t)):[]}o(Uoe,"FromArray");function Voe(e,t){return Et(e,"default")?rn(e.default):function(){return y7(this,null,function*(){})}()}o(Voe,"FromAsyncIterator");function zoe(e,t){return Et(e,"default")?rn(e.default):BigInt(0)}o(zoe,"FromBigInt");function $oe(e,t){return Et(e,"default")?rn(e.default):!1}o($oe,"FromBoolean");function Hoe(e,t){if(Et(e,"default"))return rn(e.default);{let r=Va(e.returns,t);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,i]of Object.entries(r)){let a=this;a[n]=i}}}:class{}}}o(Hoe,"FromConstructor");function Woe(e,t){return Et(e,"default")?rn(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}o(Woe,"FromDate");function qoe(e,t){return Et(e,"default")?rn(e.default):()=>Va(e.returns,t)}o(qoe,"FromFunction");function Yoe(e,t){return Et(e,"default")?rn(e.default):e.minimum!==void 0?e.minimum:0}o(Yoe,"FromInteger");function Xoe(e,t){if(Et(e,"default"))return rn(e.default);{let r=e.allOf.reduce((n,i)=>{let a=Va(i,t);return typeof a=="object"?Y(Y({},n),a):a},{});if(!qt(e,t,r))throw new Ua(e,"Intersect produced invalid value. Consider using a default value.");return r}}o(Xoe,"FromIntersect");function Zoe(e,t){return Et(e,"default")?rn(e.default):function*(){}()}o(Zoe,"FromIterator");function Koe(e,t){return Et(e,"default")?rn(e.default):e.const}o(Koe,"FromLiteral");function Joe(e,t){if(Et(e,"default"))return rn(e.default);throw new Ua(e,"Never types cannot be created. Consider using a default value.")}o(Joe,"FromNever");function Qoe(e,t){if(Et(e,"default"))return rn(e.default);throw new Ua(e,"Not types must have a default value")}o(Qoe,"FromNot");function ese(e,t){return Et(e,"default")?rn(e.default):null}o(ese,"FromNull");function tse(e,t){return Et(e,"default")?rn(e.default):e.minimum!==void 0?e.minimum:0}o(tse,"FromNumber");function rse(e,t){if(Et(e,"default"))return rn(e.default);{let r=new Set(e.required),n={};for(let[i,a]of Object.entries(e.properties))r.has(i)&&(n[i]=Va(a,t));return n}}o(rse,"FromObject");function nse(e,t){return Et(e,"default")?rn(e.default):Promise.resolve(Va(e.item,t))}o(nse,"FromPromise");function ise(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(Et(e,"default"))return rn(e.default);if(r===vp||r===yp)return{};{let i=r.slice(1,r.length-1).split("|"),a={};for(let u of i)a[u]=Va(n,t);return a}}o(ise,"FromRecord");function ose(e,t){return Et(e,"default")?rn(e.default):Va(en(e,t),t)}o(ose,"FromRef");function sse(e,t){if(Et(e,"default"))return rn(e.default);throw new Ua(e,"RegExp types cannot be created. Consider using a default value.")}o(sse,"FromRegExp");function ase(e,t){if(e.pattern!==void 0){if(Et(e,"default"))return rn(e.default);throw new Ua(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(Et(e,"default"))return rn(e.default);throw new Ua(e,"String types with formats must specify a default value")}else return Et(e,"default")?rn(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}o(ase,"FromString");function lse(e,t){return Et(e,"default")?rn(e.default):"value"in e?Symbol.for(e.value):Symbol()}o(lse,"FromSymbol");function use(e,t){if(Et(e,"default"))return rn(e.default);if(!lS(e))throw new Ua(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return ay(e)[0]}o(use,"FromTemplateLiteral");function cse(e,t){if(Kk++>vse)throw new Ua(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Et(e,"default")?rn(e.default):Va(en(e,t),t)}o(cse,"FromThis");function pse(e,t){return Et(e,"default")?rn(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>Va(e.items[n],t))}o(pse,"FromTuple");function fse(e,t){if(Et(e,"default"))return rn(e.default)}o(fse,"FromUndefined");function dse(e,t){if(Et(e,"default"))return rn(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return Va(e.anyOf[0],t)}o(dse,"FromUnion");function hse(e,t){return Et(e,"default")?rn(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}o(hse,"FromUint8Array");function mse(e,t){return Et(e,"default")?rn(e.default):{}}o(mse,"FromUnknown");function gse(e,t){if(Et(e,"default"))return rn(e.default)}o(gse,"FromVoid");function yse(e,t){if(Et(e,"default"))return rn(e.default);throw new Error("User defined types must specify a default value")}o(yse,"FromKind");function Va(e,t){let r=Il(e,t),n=e;switch(n[Se]){case"Any":return joe(n,r);case"Array":return Uoe(n,r);case"AsyncIterator":return Voe(n,r);case"BigInt":return zoe(n,r);case"Boolean":return $oe(n,r);case"Constructor":return Hoe(n,r);case"Date":return Woe(n,r);case"Function":return qoe(n,r);case"Integer":return Yoe(n,r);case"Intersect":return Xoe(n,r);case"Iterator":return Zoe(n,r);case"Literal":return Koe(n,r);case"Never":return Joe(n,r);case"Not":return Qoe(n,r);case"Null":return ese(n,r);case"Number":return tse(n,r);case"Object":return rse(n,r);case"Promise":return nse(n,r);case"Record":return ise(n,r);case"Ref":return ose(n,r);case"RegExp":return sse(n,r);case"String":return ase(n,r);case"Symbol":return lse(n,r);case"TemplateLiteral":return use(n,r);case"This":return cse(n,r);case"Tuple":return pse(n,r);case"Undefined":return fse(n,r);case"Union":return dse(n,r);case"Uint8Array":return hse(n,r);case"Unknown":return mse(n,r);case"Void":return gse(n,r);default:if(!vo.Has(n[Se]))throw new Ua(n,"Unknown type");return yse(n,r)}}o(Va,"Visit");var vse=512,Kk=0;function _l(...e){return Kk=0,e.length===2?Va(e[0],e[1]):Va(e[0],[])}o(_l,"Create");var dM=class dM extends Tt{constructor(t,r){super(r),this.schema=t}};o(dM,"ValueCastError");var kS=dM;function xse(e,t,r){if(e[Se]==="Object"&&typeof r=="object"&&!fp(r)){let n=e,i=Object.getOwnPropertyNames(r),a=Object.entries(n.properties),[u,c]=[1/a.length,a.length];return a.reduce((f,[m,v])=>{let x=v[Se]==="Literal"&&v.const===r[m]?c:0,I=qt(v,t,r[m])?u:0,C=i.includes(m)?u:0;return f+(x+I+C)},0)}else return qt(e,t,r)?1:0}o(xse,"ScoreUnion");function bse(e,t,r){let n=e.anyOf.map(u=>en(u,t)),[i,a]=[n[0],0];for(let u of n){let c=xse(u,t,r);c>a&&(i=u,a=c)}return i}o(bse,"SelectUnion");function Ise(e,t,r){if("default"in e)return typeof r=="function"?e.default:tn(e.default);{let n=bse(e,t,r);return fM(n,t,r)}}o(Ise,"CastUnion");function Sse(e,t,r){return qt(e,t,r)?tn(r):_l(e,t)}o(Sse,"DefaultClone");function _se(e,t,r){return qt(e,t,r)?r:_l(e,t)}o(_se,"Default");function Cse(e,t,r){if(qt(e,t,r))return tn(r);let n=kt(r)?tn(r):_l(e,t),i=vt(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,u=(vt(e.maxItems)&&i.length>e.maxItems?i.slice(0,e.maxItems):i).map(f=>dc(e.items,t,f));if(e.uniqueItems!==!0)return u;let c=[...new Set(u)];if(!qt(e,t,c))throw new kS(e,"Array cast produced invalid data due to uniqueItems constraint");return c}o(Cse,"FromArray");function wse(e,t,r){if(qt(e,t,r))return _l(e,t);let n=new Set(e.returns.required||[]),i=o(function(){},"result");for(let[a,u]of Object.entries(e.returns.properties))!n.has(a)&&r.prototype[a]===void 0||(i.prototype[a]=dc(u,t,r.prototype[a]));return i}o(wse,"FromConstructor");function Pse(e,t,r){let n=_l(e,t),i=zt(n)&&zt(r)?Y(Y({},n),r):r;return qt(e,t,i)?i:_l(e,t)}o(Pse,"FromIntersect");function Tse(e,t,r){throw new kS(e,"Never types cannot be cast")}o(Tse,"FromNever");function Ese(e,t,r){if(qt(e,t,r))return r;if(r===null||typeof r!="object")return _l(e,t);let n=new Set(e.required||[]),i={};for(let[a,u]of Object.entries(e.properties))!n.has(a)&&r[a]===void 0||(i[a]=dc(u,t,r[a]));if(typeof e.additionalProperties=="object"){let a=Object.getOwnPropertyNames(e.properties);for(let u of Object.getOwnPropertyNames(r))a.includes(u)||(i[u]=dc(e.additionalProperties,t,r[u]))}return i}o(Ese,"FromObject");function Mse(e,t,r){if(qt(e,t,r))return tn(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return _l(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[n],a={};for(let[u,c]of Object.entries(r))a[u]=dc(i,t,c);return a}o(Mse,"FromRecord");function Ose(e,t,r){return dc(en(e,t),t,r)}o(Ose,"FromRef");function Lse(e,t,r){return dc(en(e,t),t,r)}o(Lse,"FromThis");function Dse(e,t,r){return qt(e,t,r)?tn(r):kt(r)?e.items===void 0?[]:e.items.map((n,i)=>dc(n,t,r[i])):_l(e,t)}o(Dse,"FromTuple");function Ase(e,t,r){return qt(e,t,r)?tn(r):Ise(e,t,r)}o(Ase,"FromUnion");function dc(e,t,r){let n=qr(e.$id)?[...t,e]:t,i=e;switch(e[Se]){case"Array":return Cse(i,n,r);case"Constructor":return wse(i,n,r);case"Intersect":return Pse(i,n,r);case"Never":return Tse(i,n,r);case"Object":return Ese(i,n,r);case"Record":return Mse(i,n,r);case"Ref":return Ose(i,n,r);case"This":return Lse(i,n,r);case"Tuple":return Dse(i,n,r);case"Union":return Ase(i,n,r);case"Date":case"Symbol":case"Uint8Array":return Sse(e,t,r);default:return _se(i,n,r)}}o(dc,"Visit");function fM(...e){return e.length===3?dc(e[0],e[1],e[2]):dc(e[0],[],e[1])}o(fM,"Cast");g();function Fse(e){return Hf(e)&&e[Se]!=="Unsafe"}o(Fse,"IsCheckable");function Nse(e,t,r){return kt(r)?r.map(n=>za(e.items,t,n)):r}o(Nse,"FromArray");function Rse(e,t,r){let n=e.unevaluatedProperties,a=e.allOf.map(c=>za(c,t,tn(r))).reduce((c,f)=>zt(f)?Y(Y({},c),f):f,{});if(!zt(r)||!zt(a)||!Hf(n))return a;let u=zo(e);for(let c of Object.getOwnPropertyNames(r))u.includes(c)||qt(n,t,r[c])&&(a[c]=za(n,t,r[c]));return a}o(Rse,"FromIntersect");function kse(e,t,r){if(!zt(r)||kt(r))return r;let n=e.additionalProperties;for(let i of Object.getOwnPropertyNames(r)){if(Et(e.properties,i)){r[i]=za(e.properties[i],t,r[i]);continue}if(Hf(n)&&qt(n,t,r[i])){r[i]=za(n,t,r[i]);continue}delete r[i]}return r}o(kse,"FromObject");function Bse(e,t,r){if(!zt(r))return r;let n=e.additionalProperties,i=Object.getOwnPropertyNames(r),[a,u]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let f of i){if(c.test(f)){r[f]=za(u,t,r[f]);continue}if(Hf(n)&&qt(n,t,r[f])){r[f]=za(n,t,r[f]);continue}delete r[f]}return r}o(Bse,"FromRecord");function Gse(e,t,r){return za(en(e,t),t,r)}o(Gse,"FromRef");function jse(e,t,r){return za(en(e,t),t,r)}o(jse,"FromThis");function Use(e,t,r){if(!kt(r))return r;if(wi(e.items))return[];let n=Math.min(r.length,e.items.length);for(let i=0;i<n;i++)r[i]=za(e.items[i],t,r[i]);return r.length>n?r.slice(0,n):r}o(Use,"FromTuple");function Vse(e,t,r){for(let n of e.anyOf)if(Fse(n)&&qt(n,t,r))return za(n,t,r);return r}o(Vse,"FromUnion");function za(e,t,r){let n=qr(e.$id)?[...t,e]:t,i=e;switch(i[Se]){case"Array":return Nse(i,n,r);case"Intersect":return Rse(i,n,r);case"Object":return kse(i,n,r);case"Record":return Bse(i,n,r);case"Ref":return Gse(i,n,r);case"This":return jse(i,n,r);case"Tuple":return Use(i,n,r);case"Union":return Vse(i,n,r);default:return r}}o(za,"Visit");function BS(...e){return e.length===3?za(e[0],e[1],e[2]):za(e[0],[],e[1])}o(BS,"Clean");g();function GS(e){return qr(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}o(GS,"IsStringNumeric");function zse(e){return ls(e)||ac(e)||vt(e)}o(zse,"IsValueToString");function Mv(e){return e===!0||vt(e)&&e===1||ls(e)&&e===BigInt("1")||qr(e)&&(e.toLowerCase()==="true"||e==="1")}o(Mv,"IsValueTrue");function Ov(e){return e===!1||vt(e)&&(e===0||Object.is(e,-0))||ls(e)&&e===BigInt("0")||qr(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}o(Ov,"IsValueFalse");function $se(e){return qr(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}o($se,"IsTimeStringWithTimeZone");function Hse(e){return qr(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}o(Hse,"IsTimeStringWithoutTimeZone");function Wse(e){return qr(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}o(Wse,"IsDateTimeStringWithTimeZone");function qse(e){return qr(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}o(qse,"IsDateTimeStringWithoutTimeZone");function Yse(e){return qr(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}o(Yse,"IsDateString");function Xse(e,t){let r=Qk(e);return r===t?r:e}o(Xse,"TryConvertLiteralString");function Zse(e,t){let r=eB(e);return r===t?r:e}o(Zse,"TryConvertLiteralNumber");function Kse(e,t){let r=Jk(e);return r===t?r:e}o(Kse,"TryConvertLiteralBoolean");function Jse(e,t){return qr(e.const)?Xse(t,e.const):vt(e.const)?Zse(t,e.const):ac(e.const)?Kse(t,e.const):t}o(Jse,"TryConvertLiteral");function Jk(e){return Mv(e)?!0:Ov(e)?!1:e}o(Jk,"TryConvertBoolean");function Qse(e){let t=o(r=>r.split(".")[0],"truncateInteger");return GS(e)?BigInt(t(e)):vt(e)?BigInt(Math.trunc(e)):Ov(e)?BigInt(0):Mv(e)?BigInt(1):e}o(Qse,"TryConvertBigInt");function Qk(e){return zse(e)?e.toString():dp(e)&&e.description!==void 0?e.description.toString():e}o(Qk,"TryConvertString");function eB(e){return GS(e)?parseFloat(e):Mv(e)?1:Ov(e)?0:e}o(eB,"TryConvertNumber");function eae(e){return GS(e)?parseInt(e):vt(e)?e|0:Mv(e)?1:Ov(e)?0:e}o(eae,"TryConvertInteger");function tae(e){return qr(e)&&e.toLowerCase()==="null"?null:e}o(tae,"TryConvertNull");function rae(e){return qr(e)&&e==="undefined"?void 0:e}o(rae,"TryConvertUndefined");function nae(e){return Ys(e)?e:vt(e)?new Date(e):Mv(e)?new Date(1):Ov(e)?new Date(0):GS(e)?new Date(parseInt(e)):Hse(e)?new Date("1970-01-01T".concat(e,".000Z")):$se(e)?new Date("1970-01-01T".concat(e)):qse(e)?new Date("".concat(e,".000Z")):Wse(e)?new Date(e):Yse(e)?new Date("".concat(e,"T00:00:00.000Z")):e}o(nae,"TryConvertDate");function iae(e,t,r){return(kt(r)?r:[r]).map(i=>hc(e.items,t,i))}o(iae,"FromArray");function oae(e,t,r){return Qse(r)}o(oae,"FromBigInt");function sae(e,t,r){return Jk(r)}o(sae,"FromBoolean");function aae(e,t,r){return nae(r)}o(aae,"FromDate");function lae(e,t,r){return eae(r)}o(lae,"FromInteger");function uae(e,t,r){return e.allOf.reduce((n,i)=>hc(i,t,n),r)}o(uae,"FromIntersect");function cae(e,t,r){return Jse(e,r)}o(cae,"FromLiteral");function pae(e,t,r){return tae(r)}o(pae,"FromNull");function fae(e,t,r){return eB(r)}o(fae,"FromNumber");function dae(e,t,r){if(!zt(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))Et(r,n)&&(r[n]=hc(e.properties[n],t,r[n]));return r}o(dae,"FromObject");function hae(e,t,r){if(!zt(r))return r;let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=e.patternProperties[i];for(let[u,c]of Object.entries(r))r[u]=hc(a,t,c);return r}o(hae,"FromRecord");function mae(e,t,r){return hc(en(e,t),t,r)}o(mae,"FromRef");function gae(e,t,r){return Qk(r)}o(gae,"FromString");function yae(e,t,r){return qr(r)||vt(r)?Symbol(r):r}o(yae,"FromSymbol");function vae(e,t,r){return hc(en(e,t),t,r)}o(vae,"FromThis");function xae(e,t,r){return kt(r)&&!wi(e.items)?r.map((i,a)=>a<e.items.length?hc(e.items[a],t,i):i):r}o(xae,"FromTuple");function bae(e,t,r){return rae(r)}o(bae,"FromUndefined");function Iae(e,t,r){for(let n of e.anyOf){let i=hc(n,t,tn(r));if(qt(n,t,i))return i}return r}o(Iae,"FromUnion");function hc(e,t,r){let n=Il(e,t),i=e;switch(e[Se]){case"Array":return iae(i,n,r);case"BigInt":return oae(i,n,r);case"Boolean":return sae(i,n,r);case"Date":return aae(i,n,r);case"Integer":return lae(i,n,r);case"Intersect":return uae(i,n,r);case"Literal":return cae(i,n,r);case"Null":return pae(i,n,r);case"Number":return fae(i,n,r);case"Object":return dae(i,n,r);case"Record":return hae(i,n,r);case"Ref":return mae(i,n,r);case"String":return gae(i,n,r);case"Symbol":return yae(i,n,r);case"This":return vae(i,n,r);case"Tuple":return xae(i,n,r);case"Undefined":return bae(i,n,r);case"Union":return Iae(i,n,r);default:return r}}o(hc,"Visit");function jS(...e){return e.length===3?hc(e[0],e[1],e[2]):hc(e[0],[],e[1])}o(jS,"Convert");g();g();var hM=class hM extends Tt{constructor(t,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};o(hM,"TransformDecodeCheckError");var _y=hM,mM=class mM extends Tt{constructor(t,r,n,i){super(i instanceof Error?i.message:"Unknown error"),this.schema=t,this.path=r,this.value=n,this.error=i}};o(mM,"TransformDecodeError");var $h=mM;function Pi(e,t,r){try{return Yn(e)?e[ni].Decode(r):r}catch(n){throw new $h(e,t,r,n)}}o(Pi,"Default");function Sae(e,t,r,n){return kt(n)?Pi(e,r,n.map((i,a)=>mc(e.items,t,"".concat(r,"/").concat(a),i))):Pi(e,r,n)}o(Sae,"FromArray");function _ae(e,t,r,n){if(!zt(n)||us(n))return Pi(e,r,n);let i=Yf(e),a=i.map(v=>v[0]),u=Y({},n);for(let[v,x]of i)v in u&&(u[v]=mc(x,t,"".concat(r,"/").concat(v),u[v]));if(!Yn(e.unevaluatedProperties))return Pi(e,r,u);let c=Object.getOwnPropertyNames(u),f=e.unevaluatedProperties,m=Y({},u);for(let v of c)a.includes(v)||(m[v]=Pi(f,"".concat(r,"/").concat(v),m[v]));return Pi(e,r,m)}o(_ae,"FromIntersect");function Cae(e,t,r,n){return Pi(e,r,mc(e.not,t,r,n))}o(Cae,"FromNot");function wae(e,t,r,n){if(!zt(n))return Pi(e,r,n);let i=zo(e),a=Y({},n);for(let m of i)Et(a,m)&&(wi(a[m])&&(!ry(e.properties[m])||vn.IsExactOptionalProperty(a,m))||(a[m]=mc(e.properties[m],t,"".concat(r,"/").concat(m),a[m])));if(!Yr(e.additionalProperties))return Pi(e,r,a);let u=Object.getOwnPropertyNames(a),c=e.additionalProperties,f=Y({},a);for(let m of u)i.includes(m)||(f[m]=Pi(c,"".concat(r,"/").concat(m),f[m]));return Pi(e,r,f)}o(wae,"FromObject");function Pae(e,t,r,n){if(!zt(n))return Pi(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),u=Y({},n);for(let v of Object.getOwnPropertyNames(n))a.test(v)&&(u[v]=mc(e.patternProperties[i],t,"".concat(r,"/").concat(v),u[v]));if(!Yr(e.additionalProperties))return Pi(e,r,u);let c=Object.getOwnPropertyNames(u),f=e.additionalProperties,m=Y({},u);for(let v of c)a.test(v)||(m[v]=Pi(f,"".concat(r,"/").concat(v),m[v]));return Pi(e,r,m)}o(Pae,"FromRecord");function Tae(e,t,r,n){let i=en(e,t);return Pi(e,r,mc(i,t,r,n))}o(Tae,"FromRef");function Eae(e,t,r,n){let i=en(e,t);return Pi(e,r,mc(i,t,r,n))}o(Eae,"FromThis");function Mae(e,t,r,n){return kt(n)&&kt(e.items)?Pi(e,r,e.items.map((i,a)=>mc(i,t,"".concat(r,"/").concat(a),n[a]))):Pi(e,r,n)}o(Mae,"FromTuple");function Oae(e,t,r,n){for(let i of e.anyOf){if(!qt(i,t,n))continue;let a=mc(i,t,r,n);return Pi(e,r,a)}return Pi(e,r,n)}o(Oae,"FromUnion");function mc(e,t,r,n){let i=Il(e,t),a=e;switch(e[Se]){case"Array":return Sae(a,i,r,n);case"Intersect":return _ae(a,i,r,n);case"Not":return Cae(a,i,r,n);case"Object":return wae(a,i,r,n);case"Record":return Pae(a,i,r,n);case"Ref":return Tae(a,i,r,n);case"Symbol":return Pi(a,r,n);case"This":return Eae(a,i,r,n);case"Tuple":return Mae(a,i,r,n);case"Union":return Oae(a,i,r,n);default:return Pi(a,r,n)}}o(mc,"Visit");function Cy(e,t,r){return mc(e,t,"",r)}o(Cy,"TransformDecode");g();var gM=class gM extends Tt{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};o(gM,"TransformEncodeCheckError");var wy=gM,yM=class yM extends Tt{constructor(t,r,n,i){super("".concat(i instanceof Error?i.message:"Unknown error")),this.schema=t,this.path=r,this.value=n,this.error=i}};o(yM,"TransformEncodeError");var Hh=yM;function As(e,t,r){try{return Yn(e)?e[ni].Encode(r):r}catch(n){throw new Hh(e,t,r,n)}}o(As,"Default");function Lae(e,t,r,n){let i=As(e,r,n);return kt(i)?i.map((a,u)=>gc(e.items,t,"".concat(r,"/").concat(u),a)):i}o(Lae,"FromArray");function Dae(e,t,r,n){let i=As(e,r,n);if(!zt(n)||us(n))return i;let a=Yf(e),u=a.map(x=>x[0]),c=Y({},i);for(let[x,I]of a)x in c&&(c[x]=gc(I,t,"".concat(r,"/").concat(x),c[x]));if(!Yn(e.unevaluatedProperties))return c;let f=Object.getOwnPropertyNames(c),m=e.unevaluatedProperties,v=Y({},c);for(let x of f)u.includes(x)||(v[x]=As(m,"".concat(r,"/").concat(x),v[x]));return v}o(Dae,"FromIntersect");function Aae(e,t,r,n){return As(e.not,r,As(e,r,n))}o(Aae,"FromNot");function Fae(e,t,r,n){let i=As(e,r,n);if(!zt(i))return i;let a=zo(e),u=Y({},i);for(let v of a)Et(u,v)&&(wi(u[v])&&(!ry(e.properties[v])||vn.IsExactOptionalProperty(u,v))||(u[v]=gc(e.properties[v],t,"".concat(r,"/").concat(v),u[v])));if(!Yr(e.additionalProperties))return u;let c=Object.getOwnPropertyNames(u),f=e.additionalProperties,m=Y({},u);for(let v of c)a.includes(v)||(m[v]=As(f,"".concat(r,"/").concat(v),m[v]));return m}o(Fae,"FromObject");function Nae(e,t,r,n){let i=As(e,r,n);if(!zt(n))return i;let a=Object.getOwnPropertyNames(e.patternProperties)[0],u=new RegExp(a),c=Y({},i);for(let x of Object.getOwnPropertyNames(n))u.test(x)&&(c[x]=gc(e.patternProperties[a],t,"".concat(r,"/").concat(x),c[x]));if(!Yr(e.additionalProperties))return c;let f=Object.getOwnPropertyNames(c),m=e.additionalProperties,v=Y({},c);for(let x of f)u.test(x)||(v[x]=As(m,"".concat(r,"/").concat(x),v[x]));return v}o(Nae,"FromRecord");function Rae(e,t,r,n){let i=en(e,t),a=gc(i,t,r,n);return As(e,r,a)}o(Rae,"FromRef");function kae(e,t,r,n){let i=en(e,t),a=gc(i,t,r,n);return As(e,r,a)}o(kae,"FromThis");function Bae(e,t,r,n){let i=As(e,r,n);return kt(e.items)?e.items.map((a,u)=>gc(a,t,"".concat(r,"/").concat(u),i[u])):[]}o(Bae,"FromTuple");function Gae(e,t,r,n){for(let i of e.anyOf){if(!qt(i,t,n))continue;let a=gc(i,t,r,n);return As(e,r,a)}for(let i of e.anyOf){let a=gc(i,t,r,n);if(qt(e,t,a))return As(e,r,a)}return As(e,r,n)}o(Gae,"FromUnion");function gc(e,t,r,n){let i=Il(e,t),a=e;switch(e[Se]){case"Array":return Lae(a,i,r,n);case"Intersect":return Dae(a,i,r,n);case"Not":return Aae(a,i,r,n);case"Object":return Fae(a,i,r,n);case"Record":return Nae(a,i,r,n);case"Ref":return Rae(a,i,r,n);case"This":return kae(a,i,r,n);case"Tuple":return Bae(a,i,r,n);case"Union":return Gae(a,i,r,n);default:return As(a,r,n)}}o(gc,"Visit");function US(e,t,r){return gc(e,t,"",r)}o(US,"TransformEncode");g();function jae(e,t){return Yn(e)||$o(e.items,t)}o(jae,"FromArray");function Uae(e,t){return Yn(e)||$o(e.items,t)}o(Uae,"FromAsyncIterator");function Vae(e,t){return Yn(e)||$o(e.returns,t)||e.parameters.some(r=>$o(r,t))}o(Vae,"FromConstructor");function zae(e,t){return Yn(e)||$o(e.returns,t)||e.parameters.some(r=>$o(r,t))}o(zae,"FromFunction");function $ae(e,t){return Yn(e)||Yn(e.unevaluatedProperties)||e.allOf.some(r=>$o(r,t))}o($ae,"FromIntersect");function Hae(e,t){return Yn(e)||$o(e.items,t)}o(Hae,"FromIterator");function Wae(e,t){return Yn(e)||$o(e.not,t)}o(Wae,"FromNot");function qae(e,t){return Yn(e)||Object.values(e.properties).some(r=>$o(r,t))||Yr(e.additionalProperties)&&$o(e.additionalProperties,t)}o(qae,"FromObject");function Yae(e,t){return Yn(e)||$o(e.item,t)}o(Yae,"FromPromise");function Xae(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return Yn(e)||$o(n,t)||Yr(e.additionalProperties)&&Yn(e.additionalProperties)}o(Xae,"FromRecord");function Zae(e,t){return Yn(e)?!0:$o(en(e,t),t)}o(Zae,"FromRef");function Kae(e,t){return Yn(e)?!0:$o(en(e,t),t)}o(Kae,"FromThis");function Jae(e,t){return Yn(e)||!wi(e.items)&&e.items.some(r=>$o(r,t))}o(Jae,"FromTuple");function Qae(e,t){return Yn(e)||e.anyOf.some(r=>$o(r,t))}o(Qae,"FromUnion");function $o(e,t){let r=Il(e,t),n=e;if(e.$id&&vM.has(e.$id))return!1;switch(e.$id&&vM.add(e.$id),e[Se]){case"Array":return jae(n,r);case"AsyncIterator":return Uae(n,r);case"Constructor":return Vae(n,r);case"Function":return zae(n,r);case"Intersect":return $ae(n,r);case"Iterator":return Hae(n,r);case"Not":return Wae(n,r);case"Object":return qae(n,r);case"Promise":return Yae(n,r);case"Record":return Xae(n,r);case"Ref":return Zae(n,r);case"This":return Kae(n,r);case"Tuple":return Jae(n,r);case"Union":return Qae(n,r);default:return Yn(e)}}o($o,"Visit");var vM=new Set;function yc(e,t){return vM.clear(),$o(e,t)}o(yc,"HasTransform");function tB(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!qt(t,r,n))throw new _y(t,n,fc(t,r,n).First());return yc(t,r)?Cy(t,r,n):n}o(tB,"Decode");g();function Cp(e,t){let r=Et(e,"default")?e.default:void 0,n=zf(r)?r():tn(r);return wi(t)?n:zt(t)&&zt(n)?Object.assign(n,t):t}o(Cp,"ValueOrDefault");function xM(e){return Hf(e)&&"default"in e}o(xM,"HasDefaultProperty");function ele(e,t,r){let n=Cp(e,r);if(!kt(n))return n;for(let i=0;i<n.length;i++)n[i]=$a(e.items,t,n[i]);return n}o(ele,"FromArray");function tle(e,t,r){return Ys(r)?r:Cp(e,r)}o(tle,"FromDate");function rle(e,t,r){let n=Cp(e,r);return e.allOf.reduce((i,a)=>{let u=$a(a,t,n);return zt(u)?Y(Y({},i),u):u},{})}o(rle,"FromIntersect");function nle(e,t,r){let n=Cp(e,r);if(!zt(n))return n;let i=Object.getOwnPropertyNames(e.properties);for(let a of i){let u=$a(e.properties[a],t,n[a]);wi(u)||(n[a]=$a(e.properties[a],t,n[a]))}if(!xM(e.additionalProperties))return n;for(let a of Object.getOwnPropertyNames(n))i.includes(a)||(n[a]=$a(e.additionalProperties,t,n[a]));return n}o(nle,"FromObject");function ile(e,t,r){let n=Cp(e,r);if(!zt(n))return n;let i=e.additionalProperties,[a,u]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let f of Object.getOwnPropertyNames(n))c.test(f)&&xM(u)&&(n[f]=$a(u,t,n[f]));if(!xM(i))return n;for(let f of Object.getOwnPropertyNames(n))c.test(f)||(n[f]=$a(i,t,n[f]));return n}o(ile,"FromRecord");function ole(e,t,r){return $a(en(e,t),t,Cp(e,r))}o(ole,"FromRef");function sle(e,t,r){return $a(en(e,t),t,r)}o(sle,"FromThis");function ale(e,t,r){let n=Cp(e,r);if(!kt(n)||wi(e.items))return n;let[i,a]=[e.items,Math.max(e.items.length,n.length)];for(let u=0;u<a;u++)u<i.length&&(n[u]=$a(i[u],t,n[u]));return n}o(ale,"FromTuple");function lle(e,t,r){let n=Cp(e,r);for(let i of e.anyOf){let a=$a(i,t,tn(n));if(qt(i,t,a))return a}return n}o(lle,"FromUnion");function $a(e,t,r){let n=Il(e,t),i=e;switch(i[Se]){case"Array":return ele(i,n,r);case"Date":return tle(i,n,r);case"Intersect":return rle(i,n,r);case"Object":return nle(i,n,r);case"Record":return ile(i,n,r);case"Ref":return ole(i,n,r);case"This":return sle(i,n,r);case"Tuple":return ale(i,n,r);case"Union":return lle(i,n,r);default:return Cp(i,r)}}o($a,"Visit");function VS(...e){return e.length===3?$a(e[0],e[1],e[2]):$a(e[0],[],e[1])}o(VS,"Default");g();g();var Cl={};bf(Cl,{Delete:()=>cle,Format:()=>Lv,Get:()=>fle,Has:()=>ple,Set:()=>ule,ValuePointerRootDeleteError:()=>$S,ValuePointerRootSetError:()=>zS});g();var bM=class bM extends Tt{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}};o(bM,"ValuePointerRootSetError");var zS=bM,IM=class IM extends Tt{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};o(IM,"ValuePointerRootDeleteError");var $S=IM;function rB(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}o(rB,"Escape");function*Lv(e){if(e==="")return;let[t,r]=[0,0];for(let n=0;n<e.length;n++)e.charAt(n)==="/"?(n===0||(r=n,yield rB(e.slice(t,r))),t=n+1):r=n;yield rB(e.slice(t))}o(Lv,"Format");function ule(e,t,r){if(t==="")throw new zS(e,t,r);let[n,i,a]=[null,e,""];for(let u of Lv(t))i[u]===void 0&&(i[u]={}),n=i,i=i[u],a=u;n[a]=r}o(ule,"Set");function cle(e,t){if(t==="")throw new $S(e,t);let[r,n,i]=[null,e,""];for(let a of Lv(t)){if(n[a]===void 0||n[a]===null)return;r=n,n=n[a],i=a}if(Array.isArray(r)){let a=parseInt(i);r.splice(a,1)}else delete r[i]}o(cle,"Delete");function ple(e,t){if(t==="")return!0;let[r,n,i]=[null,e,""];for(let a of Lv(t)){if(n[a]===void 0)return!1;r=n,n=n[a],i=a}return Object.getOwnPropertyNames(r).includes(i)}o(ple,"Has");function fle(e,t){if(t==="")return e;let r=e;for(let n of Lv(t)){if(r[n]===void 0)return;r=r[n]}return r}o(fle,"Get");g();function dle(e,t){if(!zt(t))return!1;let r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],n=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return r.length!==n.length?!1:r.every(i=>Wh(e[i],t[i]))}o(dle,"ObjectType");function hle(e,t){return Ys(t)&&e.getTime()===t.getTime()}o(hle,"DateType");function mle(e,t){return!kt(t)||e.length!==t.length?!1:e.every((r,n)=>Wh(r,t[n]))}o(mle,"ArrayType");function gle(e,t){return!hl(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>Wh(r,t[n]))}o(gle,"TypedArrayType");function yle(e,t){return e===t}o(yle,"ValueType");function Wh(e,t){if(Ys(e))return hle(e,t);if(hl(e))return gle(e,t);if(kt(e))return mle(e,t);if(zt(e))return dle(e,t);if(us(e))return yle(e,t);throw new Error("ValueEquals: Unable to compare value")}o(Wh,"Equal");var vle=Fn({type:cn("insert"),path:gl(),value:Ip()}),xle=Fn({type:cn("update"),path:gl(),value:Ip()}),ble=Fn({type:cn("delete"),path:gl()}),iB=Cn([vle,xle,ble]),SM=class SM extends Tt{constructor(t,r){super(r),this.value=t}};o(SM,"ValueDiffError");var HS=SM;function WS(e,t){return{type:"update",path:e,value:t}}o(WS,"CreateUpdate");function oB(e,t){return{type:"insert",path:e,value:t}}o(oB,"CreateInsert");function sB(e){return{type:"delete",path:e}}o(sB,"CreateDelete");function nB(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new HS(e,"Cannot diff objects with symbols")}o(nB,"AssertDiffable");function*Ile(e,t,r){if(nB(t),nB(r),!YT(r))return yield WS(e,r);let n=globalThis.Object.getOwnPropertyNames(t),i=globalThis.Object.getOwnPropertyNames(r);for(let a of i)Et(t,a)||(yield oB("".concat(e,"/").concat(a),r[a]));for(let a of n)Et(r,a)&&(Wh(t,r)||(yield*ke(qS("".concat(e,"/").concat(a),t[a],r[a]))));for(let a of n)Et(r,a)||(yield sB("".concat(e,"/").concat(a)))}o(Ile,"ObjectType");function*Sle(e,t,r){if(!kt(r))return yield WS(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*ke(qS("".concat(e,"/").concat(n),t[n],r[n]));for(let n=0;n<r.length;n++)n<t.length||(yield oB("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield sB("".concat(e,"/").concat(n)))}o(Sle,"ArrayType");function*_le(e,t,r){if(!hl(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield WS(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*ke(qS("".concat(e,"/").concat(n),t[n],r[n]))}o(_le,"TypedArrayType");function*Cle(e,t,r){t!==r&&(yield WS(e,r))}o(Cle,"ValueType");function*qS(e,t,r){if(YT(t))return yield*ke(Ile(e,t,r));if(kt(t))return yield*ke(Sle(e,t,r));if(hl(t))return yield*ke(_le(e,t,r));if(us(t))return yield*ke(Cle(e,t,r));throw new HS(t,"Unable to diff value")}o(qS,"Visit");function aB(e,t){return[...qS("",e,t)]}o(aB,"Diff");function wle(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}o(wle,"IsRootUpdate");function Ple(e){return e.length===0}o(Ple,"IsIdentity");function lB(e,t){if(wle(t))return tn(t[0].value);if(Ple(t))return tn(e);let r=tn(e);for(let n of t)switch(n.type){case"insert":{Cl.Set(r,n.path,n.value);break}case"update":{Cl.Set(r,n.path,n.value);break}case"delete":{Cl.Delete(r,n.path);break}}return r}o(lB,"Patch");g();function uB(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],i=yc(t,r)?US(t,r,n):n;if(!qt(t,r,i))throw new wy(t,i,fc(t,r,i).First());return i}o(uB,"Encode");g();var CM=class CM extends Tt{constructor(t){super(t)}};o(CM,"ValueMutateError");var YS=CM;function Tle(e,t,r,n){if(!zt(r))Cl.Set(e,t,tn(n));else{let i=Object.getOwnPropertyNames(r),a=Object.getOwnPropertyNames(n);for(let u of i)a.includes(u)||delete r[u];for(let u of a)i.includes(u)||(r[u]=null);for(let u of a)_M(e,"".concat(t,"/").concat(u),r[u],n[u])}}o(Tle,"ObjectType");function Ele(e,t,r,n){if(!kt(r))Cl.Set(e,t,tn(n));else{for(let i=0;i<n.length;i++)_M(e,"".concat(t,"/").concat(i),r[i],n[i]);r.splice(n.length)}}o(Ele,"ArrayType");function Mle(e,t,r,n){if(hl(r)&&r.length===n.length)for(let i=0;i<r.length;i++)r[i]=n[i];else Cl.Set(e,t,tn(n))}o(Mle,"TypedArrayType");function Ole(e,t,r,n){r!==n&&Cl.Set(e,t,n)}o(Ole,"ValueType");function _M(e,t,r,n){if(kt(n))return Ele(e,t,r,n);if(hl(n))return Mle(e,t,r,n);if(zt(n))return Tle(e,t,r,n);if(us(n))return Ole(e,t,r,n)}o(_M,"Visit");function cB(e){return hl(e)||us(e)}o(cB,"IsNonMutableValue");function Lle(e,t){return zt(e)&&kt(t)||kt(e)&&zt(t)}o(Lle,"IsMismatchedValue");function pB(e,t){if(cB(e)||cB(t))throw new YS("Only object and array types can be mutated at the root level");if(Lle(e,t))throw new YS("Cannot assign due type mismatch of assignable values");_M(e,"",e,t)}o(pB,"Mutate");g();var Dle=[(e,t,r)=>tn(r),(e,t,r)=>VS(e,t,r),(e,t,r)=>BS(e,t,r),(e,t,r)=>jS(e,t,r),(e,t,r)=>(RS(e,t,r),r),(e,t,r)=>yc(e,t)?Cy(e,t,r):r];function fB(e,t,r){return Dle.reduce((n,i)=>i(e,t,n),r)}o(fB,"ParseValue");function dB(...e){return e.length===3?fB(e[0],e[1],e[2]):fB(e[0],[],e[1])}o(dB,"Parse");g();var wl={};bf(wl,{Assert:()=>RS,Cast:()=>fM,Check:()=>qt,Clean:()=>BS,Clone:()=>tn,Convert:()=>jS,Create:()=>_l,Decode:()=>tB,Default:()=>VS,Diff:()=>aB,Edit:()=>iB,Encode:()=>uB,Equal:()=>Wh,Errors:()=>fc,Hash:()=>Kf,Mutate:()=>pB,Parse:()=>dB,Patch:()=>lB,ValueErrorIterator:()=>Sl});g();g();var hB={},Ale=o(function(e,t,r,n,i){var a=new Worker(hB[t]||(hB[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(u){var c=u.data,f=c.$e$;if(f){var m=new Error(f[0]);m.code=f[1],m.stack=f[2],i(m,null)}else i(null,c)},a.postMessage(r,n),a},"wk"),Nn=Uint8Array,Js=Uint16Array,Nv=Int32Array,Oy=new Nn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ly=new Nn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Dv=new Nn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yB=o(function(e,t){for(var r=new Js(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new Nv(r[30]),n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)i[a]=a-r[n]<<5|n;return{b:r,r:i}},"freb"),vB=yB(Oy,2),OM=vB.b,QS=vB.r;OM[28]=258,QS[258]=28;var xB=yB(Ly,0),bB=xB.b,PM=xB.r,Av=new Js(32768);for(mn=0;mn<32768;++mn)wp=(mn&43690)>>1|(mn&21845)<<1,wp=(wp&52428)>>2|(wp&13107)<<2,wp=(wp&61680)>>4|(wp&3855)<<4,Av[mn]=((wp&65280)>>8|(wp&255)<<8)>>1;var wp,mn,Tl=o(function(e,t,r){for(var n=e.length,i=0,a=new Js(t);i<n;++i)e[i]&&++a[e[i]-1];var u=new Js(t);for(i=1;i<t;++i)u[i]=u[i-1]+a[i-1]<<1;var c;if(r){c=new Js(1<<t);var f=15-t;for(i=0;i<n;++i)if(e[i])for(var m=i<<4|e[i],v=t-e[i],x=u[e[i]-1]++<<v,I=x|(1<<v)-1;x<=I;++x)c[Av[x]>>f]=m}else for(c=new Js(n),i=0;i<n;++i)e[i]&&(c[i]=Av[u[e[i]-1]++]>>15-e[i]);return c},"hMap"),Pp=new Nn(288);for(mn=0;mn<144;++mn)Pp[mn]=8;var mn;for(mn=144;mn<256;++mn)Pp[mn]=9;var mn;for(mn=256;mn<280;++mn)Pp[mn]=7;var mn;for(mn=280;mn<288;++mn)Pp[mn]=8;var mn,Ey=new Nn(32);for(mn=0;mn<32;++mn)Ey[mn]=5;var mn,IB=Tl(Pp,9,0),SB=Tl(Pp,9,1),_B=Tl(Ey,5,0),CB=Tl(Ey,5,1),ZS=o(function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},"max"),Pl=o(function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},"bits"),KS=o(function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},"bits16"),Rv=o(function(e){return(e+7)/8|0},"shft"),Jf=o(function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new Nn(e.subarray(t,r))},"slc"),n_={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},wB=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ti=o(function(e,t,r){var n=new Error(t||wB[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Ti),!r)throw n;return n},"err"),PB=o(function(e,t,r,n){var i=e.length,a=n?n.length:0;if(!i||t.f&&!t.l)return r||new Nn(0);var u=!r,c=u||t.i!=2,f=t.i;u&&(r=new Nn(i*3));var m=o(function(ee){var be=r.length;if(ee>be){var Me=new Nn(Math.max(be*2,ee));Me.set(r),r=Me}},"cbuf"),v=t.f||0,x=t.p||0,I=t.b||0,C=t.l,T=t.d,O=t.m,P=t.n,L=i*8;do{if(!C){v=Pl(e,x,1);var A=Pl(e,x+1,3);if(x+=3,A)if(A==1)C=SB,T=CB,O=9,P=5;else if(A==2){var H=Pl(e,x,31)+257,z=Pl(e,x+10,15)+4,R=H+Pl(e,x+5,31)+1;x+=14;for(var X=new Nn(R),ie=new Nn(19),Q=0;Q<z;++Q)ie[Dv[Q]]=Pl(e,x+Q*3,7);x+=z*3;for(var U=ZS(ie),Te=(1<<U)-1,oe=Tl(ie,U,1),Q=0;Q<R;){var fe=oe[Pl(e,x,Te)];x+=fe&15;var M=fe>>4;if(M<16)X[Q++]=M;else{var se=0,ve=0;for(M==16?(ve=3+Pl(e,x,3),x+=2,se=X[Q-1]):M==17?(ve=3+Pl(e,x,7),x+=3):M==18&&(ve=11+Pl(e,x,127),x+=7);ve--;)X[Q++]=se}}var ue=X.subarray(0,H),he=X.subarray(H);O=ZS(ue),P=ZS(he),C=Tl(ue,O,1),T=Tl(he,P,1)}else Ti(1);else{var M=Rv(x)+4,N=e[M-4]|e[M-3]<<8,B=M+N;if(B>i){f&&Ti(0);break}c&&m(I+N),r.set(e.subarray(M,B),I),t.b=I+=N,t.p=x=B*8,t.f=v;continue}if(x>L){f&&Ti(0);break}}c&&m(I+131072);for(var Z=(1<<O)-1,Ke=(1<<P)-1,Ue=x;;Ue=x){var se=C[KS(e,x)&Z],rt=se>>4;if(x+=se&15,x>L){f&&Ti(0);break}if(se||Ti(2),rt<256)r[I++]=rt;else if(rt==256){Ue=x,C=null;break}else{var Ee=rt-254;if(rt>264){var Q=rt-257,We=Oy[Q];Ee=Pl(e,x,(1<<We)-1)+OM[Q],x+=We}var St=T[KS(e,x)&Ke],yt=St>>4;St||Ti(3),x+=St&15;var he=bB[yt];if(yt>3){var We=Ly[yt];he+=KS(e,x)&(1<<We)-1,x+=We}if(x>L){f&&Ti(0);break}c&&m(I+131072);var pt=I+Ee;if(I<he){var te=a-he,ce=Math.min(he,pt);for(te+I<0&&Ti(3);I<ce;++I)r[I]=n[te+I]}for(;I<pt;++I)r[I]=r[I-he]}}t.l=C,t.p=Ue,t.b=I,t.f=v,C&&(v=1,t.m=O,t.d=T,t.n=P)}while(!v);return I!=r.length&&u?Jf(r,0,I):r.subarray(0,I)},"inflt"),vc=o(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},"wbits"),Py=o(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},"wbits16"),JS=o(function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,a=r.slice();if(!i)return{t:DM,l:0};if(i==1){var u=new Nn(r[0].s+1);return u[r[0].s]=1,{t:u,l:1}}r.sort(function(B,H){return B.f-H.f}),r.push({s:-1,f:25001});var c=r[0],f=r[1],m=0,v=1,x=2;for(r[0]={s:-1,f:c.f+f.f,l:c,r:f};v!=i-1;)c=r[r[m].f<r[x].f?m++:x++],f=r[m!=v&&r[m].f<r[x].f?m++:x++],r[v++]={s:-1,f:c.f+f.f,l:c,r:f};for(var I=a[0].s,n=1;n<i;++n)a[n].s>I&&(I=a[n].s);var C=new Js(I+1),T=e_(r[v-1],C,0);if(T>t){var n=0,O=0,P=T-t,L=1<<P;for(a.sort(function(H,z){return C[z.s]-C[H.s]||H.f-z.f});n<i;++n){var A=a[n].s;if(C[A]>t)O+=L-(1<<T-C[A]),C[A]=t;else break}for(O>>=P;O>0;){var M=a[n].s;C[M]<t?O-=1<<t-C[M]++-1:++n}for(;n>=0&&O;--n){var N=a[n].s;C[N]==t&&(--C[N],++O)}T=t}return{t:new Nn(C),l:T}},"hTree"),e_=o(function(e,t,r){return e.s==-1?Math.max(e_(e.l,t,r+1),e_(e.r,t,r+1)):t[e.s]=r},"ln"),TM=o(function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Js(++t),n=0,i=e[0],a=1,u=o(function(f){r[n++]=f},"w"),c=1;c<=t;++c)if(e[c]==i&&c!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)u(32754);a>2&&(u(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(u(i),--a;a>6;a-=6)u(8304);a>2&&(u(a-3<<5|8208),a=0)}for(;a--;)u(i);a=1,i=e[c]}return{c:r.subarray(0,n),n:t}},"lc"),Ty=o(function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},"clen"),LM=o(function(e,t,r){var n=r.length,i=Rv(t+2);e[i]=n&255,e[i+1]=n>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<n;++a)e[i+a+4]=r[a];return(i+4+n)*8},"wfblk"),EM=o(function(e,t,r,n,i,a,u,c,f,m,v){vc(t,v++,r),++i[256];for(var x=JS(i,15),I=x.t,C=x.l,T=JS(a,15),O=T.t,P=T.l,L=TM(I),A=L.c,M=L.n,N=TM(O),B=N.c,H=N.n,z=new Js(19),R=0;R<A.length;++R)++z[A[R]&31];for(var R=0;R<B.length;++R)++z[B[R]&31];for(var X=JS(z,7),ie=X.t,Q=X.l,U=19;U>4&&!ie[Dv[U-1]];--U);var Te=m+5<<3,oe=Ty(i,Pp)+Ty(a,Ey)+u,fe=Ty(i,I)+Ty(a,O)+u+14+3*U+Ty(z,ie)+2*z[16]+3*z[17]+7*z[18];if(f>=0&&Te<=oe&&Te<=fe)return LM(t,v,e.subarray(f,f+m));var se,ve,ue,he;if(vc(t,v,1+(fe<oe)),v+=2,fe<oe){se=Tl(I,C,0),ve=I,ue=Tl(O,P,0),he=O;var Z=Tl(ie,Q,0);vc(t,v,M-257),vc(t,v+5,H-1),vc(t,v+10,U-4),v+=14;for(var R=0;R<U;++R)vc(t,v+3*R,ie[Dv[R]]);v+=3*U;for(var Ke=[A,B],Ue=0;Ue<2;++Ue)for(var rt=Ke[Ue],R=0;R<rt.length;++R){var Ee=rt[R]&31;vc(t,v,Z[Ee]),v+=ie[Ee],Ee>15&&(vc(t,v,rt[R]>>5&127),v+=rt[R]>>12)}}else se=IB,ve=Pp,ue=_B,he=Ey;for(var R=0;R<c;++R){var We=n[R];if(We>255){var Ee=We>>18&31;Py(t,v,se[Ee+257]),v+=ve[Ee+257],Ee>7&&(vc(t,v,We>>23&31),v+=Oy[Ee]);var St=We&31;Py(t,v,ue[St]),v+=he[St],St>3&&(Py(t,v,We>>5&8191),v+=Ly[St])}else Py(t,v,se[We]),v+=ve[We]}return Py(t,v,se[256]),v+ve[256]},"wblk"),TB=new Nv([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),DM=new Nn(0),EB=o(function(e,t,r,n,i,a){var u=a.z||e.length,c=new Nn(n+u+5*(1+Math.ceil(u/7e3))+i),f=c.subarray(n,c.length-i),m=a.l,v=(a.r||0)&7;if(t){v&&(f[0]=a.r>>3);for(var x=TB[t-1],I=x>>13,C=x&8191,T=(1<<r)-1,O=a.p||new Js(32768),P=a.h||new Js(T+1),L=Math.ceil(r/3),A=2*L,M=o(function(Fe){return(e[Fe]^e[Fe+1]<<L^e[Fe+2]<<A)&T},"hsh"),N=new Nv(25e3),B=new Js(288),H=new Js(32),z=0,R=0,X=a.i||0,ie=0,Q=a.w||0,U=0;X+2<u;++X){var Te=M(X),oe=X&32767,fe=P[Te];if(O[oe]=fe,P[Te]=oe,Q<=X){var se=u-X;if((z>7e3||ie>24576)&&(se>423||!m)){v=EM(e,f,0,N,B,H,R,ie,U,X-U,v),ie=z=R=0,U=X;for(var ve=0;ve<286;++ve)B[ve]=0;for(var ve=0;ve<30;++ve)H[ve]=0}var ue=2,he=0,Z=C,Ke=oe-fe&32767;if(se>2&&Te==M(X-Ke))for(var Ue=Math.min(I,se)-1,rt=Math.min(32767,X),Ee=Math.min(258,se);Ke<=rt&&--Z&&oe!=fe;){if(e[X+ue]==e[X+ue-Ke]){for(var We=0;We<Ee&&e[X+We]==e[X+We-Ke];++We);if(We>ue){if(ue=We,he=Ke,We>Ue)break;for(var St=Math.min(Ke,We-2),yt=0,ve=0;ve<St;++ve){var pt=X-Ke+ve&32767,te=O[pt],ce=pt-te&32767;ce>yt&&(yt=ce,fe=pt)}}}oe=fe,fe=O[oe],Ke+=oe-fe&32767}if(he){N[ie++]=268435456|QS[ue]<<18|PM[he];var ee=QS[ue]&31,be=PM[he]&31;R+=Oy[ee]+Ly[be],++B[257+ee],++H[be],Q=X+ue,++z}else N[ie++]=e[X],++B[e[X]]}}for(X=Math.max(X,Q);X<u;++X)N[ie++]=e[X],++B[e[X]];v=EM(e,f,m,N,B,H,R,ie,U,X-U,v),m||(a.r=v&7|f[v/8|0]<<3,v-=7,a.h=P,a.p=O,a.i=X,a.w=Q)}else{for(var X=a.w||0;X<u+m;X+=65535){var Me=X+65535;Me>=u&&(f[v/8|0]=m,Me=u),v=LM(f,v+1,e.subarray(X,Me))}a.i=u}return Jf(c,0,n+Rv(v)+i)},"dflt"),Fle=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e}(),MB=o(function(){var e=-1;return{p:o(function(t){for(var r=e,n=0;n<t.length;++n)r=Fle[r&255^t[n]]^r>>>8;e=r},"p"),d:o(function(){return~e},"d")}},"crc");var OB=o(function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),u=new Nn(a.length+e.length);u.set(a),u.set(e,a.length),e=u,i.w=a.length}return EB(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,i)},"dopt"),i_=o(function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},"mrg"),mB=o(function(e,t,r){for(var n=e(),i=e.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),u=0;u<n.length;++u){var c=n[u],f=a[u];if(typeof c=="function"){t+=";"+f+"=";var m=c.toString();if(c.prototype)if(m.indexOf("[native code]")!=-1){var v=m.indexOf(" ",8)+1;t+=m.slice(v,m.indexOf("(",v))}else{t+=m;for(var x in c.prototype)t+=";"+f+".prototype."+x+"="+c.prototype[x].toString()}else t+=m}else r[f]=c}return t},"wcln"),XS=[],Nle=o(function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},"cbfs"),Rle=o(function(e,t,r,n){if(!XS[r]){for(var i="",a={},u=e.length-1,c=0;c<u;++c)i=mB(e[c],i,a);XS[r]={c:mB(e[u],i,a),e:a}}var f=i_({},XS[r].e);return Ale(XS[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,f,Nle(f),n)},"wrkr"),kle=o(function(){return[Nn,Js,Nv,Oy,Ly,Dv,OM,bB,SB,CB,Av,wB,Tl,ZS,Pl,KS,Rv,Jf,Ti,PB,a_,o_,LB]},"bInflt"),Ble=o(function(){return[Nn,Js,Nv,Oy,Ly,Dv,QS,PM,IB,Pp,_B,Ey,Av,TB,DM,Tl,vc,Py,JS,e_,TM,Ty,LM,EM,Rv,Jf,EB,OB,s_,o_]},"bDflt");var o_=o(function(e){return postMessage(e,[e.buffer])},"pbf"),LB=o(function(e){return e&&{out:e.size&&new Nn(e.size),dictionary:e.dictionary}},"gopt"),DB=o(function(e,t,r,n,i,a){var u=Rle(r,n,i,function(c,f){u.terminate(),a(c,f)});return u.postMessage([e,t],t.consume?[e.buffer]:[]),function(){u.terminate()}},"cbify");var hu=o(function(e,t){return e[t]|e[t+1]<<8},"b2"),hs=o(function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},"b4"),wM=o(function(e,t){return hs(e,t)+hs(e,t+4)*4294967296},"b8"),ds=o(function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},"wbytes");function Gle(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Ti(7),DB(e,t,[Ble],function(n){return o_(s_(n.data[0],n.data[1]))},0,r)}o(Gle,"deflate");function s_(e,t){return OB(e,t||{},0,0)}o(s_,"deflateSync");function jle(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Ti(7),DB(e,t,[kle],function(n){return o_(a_(n.data[0],LB(n.data[1])))},1,r)}o(jle,"inflate");function a_(e,t){return PB(e,{i:2},t&&t.out,t&&t.dictionary)}o(a_,"inflateSync");var AM=o(function(e,t,r,n){for(var i in e){var a=e[i],u=t+i,c=n;Array.isArray(a)&&(c=i_(n,a[1]),a=a[0]),a instanceof Nn?r[u]=[a,c]:(r[u+="/"]=[new Nn(0),c],AM(a,u,r,n))}},"fltn"),gB=typeof TextEncoder<"u"&&new TextEncoder,MM=typeof TextDecoder<"u"&&new TextDecoder,Ule=0;try{MM.decode(DM,{stream:!0}),Ule=1}catch(e){}var Vle=o(function(e){for(var t="",r=0;;){var n=e[r++],i=(n>127)+(n>223)+(n>239);if(r+i>e.length)return{s:t,r:Jf(e,r-1)};i?i==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}},"dutf8");function My(e,t){if(t){for(var r=new Nn(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(gB)return gB.encode(e);for(var i=e.length,a=new Nn(e.length+(e.length>>1)),u=0,c=o(function(v){a[u++]=v},"w"),n=0;n<i;++n){if(u+5>a.length){var f=new Nn(u+8+(i-n<<1));f.set(a),a=f}var m=e.charCodeAt(n);m<128||t?c(m):m<2048?(c(192|m>>6),c(128|m&63)):m>55295&&m<57344?(m=65536+(m&1047552)|e.charCodeAt(++n)&1023,c(240|m>>18),c(128|m>>12&63),c(128|m>>6&63),c(128|m&63)):(c(224|m>>12),c(128|m>>6&63),c(128|m&63))}return Jf(a,0,u)}o(My,"strToU8");function FM(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else{if(MM)return MM.decode(e);var i=Vle(e),a=i.s,r=i.r;return r.length&&Ti(8),a}}o(FM,"strFromU8");var AB=o(function(e,t){return t+30+hu(e,t+26)+hu(e,t+28)},"slzh"),FB=o(function(e,t,r){var n=hu(e,t+28),i=FM(e.subarray(t+46,t+46+n),!(hu(e,t+8)&2048)),a=t+46+n,u=hs(e,t+20),c=r&&u==4294967295?zle(e,a):[u,hs(e,t+24),hs(e,t+42)],f=c[0],m=c[1],v=c[2];return[hu(e,t+10),f,m,i,a+hu(e,t+30)+hu(e,t+32),v]},"zh"),zle=o(function(e,t){for(;hu(e,t)!=1;t+=4+hu(e,t+2));return[wM(e,t+12),wM(e,t+4),wM(e,t+20)]},"z64e"),Fv=o(function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&Ti(9),t+=n+4}return t},"exfl"),t_=o(function(e,t,r,n,i,a,u,c){var f=n.length,m=r.extra,v=c&&c.length,x=Fv(m);ds(e,t,u!=null?33639248:67324752),t+=4,u!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(a<0&&8),e[t++]=i&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var I=new Date(r.mtime==null?Date.now():r.mtime),C=I.getFullYear()-1980;if((C<0||C>119)&&Ti(10),ds(e,t,C<<25|I.getMonth()+1<<21|I.getDate()<<16|I.getHours()<<11|I.getMinutes()<<5|I.getSeconds()>>1),t+=4,a!=-1&&(ds(e,t,r.crc),ds(e,t+4,a<0?-a-2:a),ds(e,t+8,r.size)),ds(e,t+12,f),ds(e,t+14,x),t+=16,u!=null&&(ds(e,t,v),ds(e,t+6,r.attrs),ds(e,t+10,u),t+=14),e.set(n,t),t+=f,x)for(var T in m){var O=m[T],P=O.length;ds(e,t,+T),ds(e,t+2,P),e.set(O,t+4),t+=4+P}return v&&(e.set(c,t),t+=v),t},"wzh"),NB=o(function(e,t,r,n,i){ds(e,t,101010256),ds(e,t+8,r),ds(e,t+10,r),ds(e,t+12,n),ds(e,t+16,i)},"wzf");function RB(e,t,r){r||(r=t,t={}),typeof r!="function"&&Ti(7);var n={};AM(e,"",n,t);var i=Object.keys(n),a=i.length,u=0,c=0,f=a,m=new Array(a),v=[],x=o(function(){for(var P=0;P<v.length;++P)v[P]()},"tAll"),I=o(function(P,L){r_(function(){r(P,L)})},"cbd");r_(function(){I=r});var C=o(function(){var P=new Nn(c+22),L=u,A=c-u;c=0;for(var M=0;M<f;++M){var N=m[M];try{var B=N.c.length;t_(P,c,N,N.f,N.u,B);var H=30+N.f.length+Fv(N.extra),z=c+H;P.set(N.c,z),t_(P,u,N,N.f,N.u,B,c,N.m),u+=16+H+(N.m?N.m.length:0),c=z+B}catch(R){return I(R,null)}}NB(P,u,m.length,A,L),I(null,P)},"cbf");a||C();for(var T=o(function(P){var L=i[P],A=n[L],M=A[0],N=A[1],B=MB(),H=M.length;B.p(M);var z=My(L),R=z.length,X=N.comment,ie=X&&My(X),Q=ie&&ie.length,U=Fv(N.extra),Te=N.level==0?0:8,oe=o(function(fe,se){if(fe)x(),I(fe,null);else{var ve=se.length;m[P]=i_(N,{size:H,crc:B.d(),c:se,f:z,m:ie,u:R!=L.length||ie&&X.length!=Q,compression:Te}),u+=30+R+U+ve,c+=76+2*(R+U)+(Q||0)+ve,--a||C()}},"cbl");if(R>65535&&oe(Ti(11,0,1),null),!Te)oe(null,M);else if(H<16e4)try{oe(null,s_(M,N))}catch(fe){oe(fe,null)}else v.push(Gle(M,N,oe))},"_loop_1"),O=0;O<f;++O)T(O);return x}o(RB,"zip");function kB(e,t){t||(t={});var r={},n=[];AM(e,"",r,t);var i=0,a=0;for(var u in r){var c=r[u],f=c[0],m=c[1],v=m.level==0?0:8,x=My(u),I=x.length,C=m.comment,T=C&&My(C),O=T&&T.length,P=Fv(m.extra);I>65535&&Ti(11);var L=v?s_(f,m):f,A=L.length,M=MB();M.p(f),n.push(i_(m,{size:f.length,crc:M.d(),c:L,f:x,m:T,u:I!=u.length||T&&C.length!=O,o:i,compression:v})),i+=30+I+P+A,a+=76+2*(I+P)+(O||0)+A}for(var N=new Nn(a+22),B=i,H=a-i,z=0;z<n.length;++z){var x=n[z];t_(N,x.o,x,x.f,x.u,x.c.length);var R=30+x.f.length+Fv(x.extra);N.set(x.c,x.o+R),t_(N,i,x,x.f,x.u,x.c.length,x.o,x.m),i+=16+R+(x.m?x.m.length:0)}return NB(N,i,n.length,H,B),N}o(kB,"zipSync");var r_=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function BB(e,t,r){r||(r=t,t={}),typeof r!="function"&&Ti(7);var n=[],i=o(function(){for(var P=0;P<n.length;++P)n[P]()},"tAll"),a={},u=o(function(P,L){r_(function(){r(P,L)})},"cbd");r_(function(){u=r});for(var c=e.length-22;hs(e,c)!=101010256;--c)if(!c||e.length-c>65558)return u(Ti(13,0,1),null),i;var f=hu(e,c+8);if(f){var m=f,v=hs(e,c+16),x=v==4294967295||m==65535;if(x){var I=hs(e,c-12);x=hs(e,I)==101075792,x&&(m=f=hs(e,I+32),v=hs(e,I+48))}for(var C=t&&t.filter,T=o(function(P){var L=FB(e,v,x),A=L[0],M=L[1],N=L[2],B=L[3],H=L[4],z=L[5],R=AB(e,z);v=H;var X=o(function(Q,U){Q?(i(),u(Q,null)):(U&&(a[B]=U),--f||u(null,a))},"cbl");if(!C||C({name:B,size:M,originalSize:N,compression:A}))if(!A)X(null,Jf(e,R,R+M));else if(A==8){var ie=e.subarray(R,R+M);if(N<524288||M>.8*N)try{X(null,a_(ie,{out:new Nn(N)}))}catch(Q){X(Q,null)}else n.push(jle(ie,{size:N},X))}else X(Ti(14,"unknown compression type "+A,1),null);else X(null,null)},"_loop_3"),O=0;O<m;++O)T(O)}else u(null,{});return i}o(BB,"unzip");function GB(e,t){for(var r={},n=e.length-22;hs(e,n)!=101010256;--n)(!n||e.length-n>65558)&&Ti(13);var i=hu(e,n+8);if(!i)return{};var a=hs(e,n+16),u=a==4294967295||i==65535;if(u){var c=hs(e,n-12);u=hs(e,c)==101075792,u&&(i=hs(e,c+32),a=hs(e,c+48))}for(var f=t&&t.filter,m=0;m<i;++m){var v=FB(e,a,u),x=v[0],I=v[1],C=v[2],T=v[3],O=v[4],P=v[5],L=AB(e,P);a=O,(!f||f({name:T,size:I,originalSize:C,compression:x}))&&(x?x==8?r[T]=a_(e.subarray(L,L+I),{out:new Nn(C)}):Ti(14,"unknown compression type "+x):r[T]=Jf(e,L,L+I))}return r}o(GB,"unzipSync");g();var $le=o(e=>{if(e!=null)return e.trim()===""?void 0:e},"maybePath"),Hle=o(e=>e!=null,"notNull"),l_=o((e,t,r=0)=>{var n;if(ne.IsNull(e))return"null";if(ne.IsUndefined(e))return"undefined";if(ne.IsString(e))return"<string>";if(ne.IsNumber(e))return"<number>";if(ne.IsBoolean(e))return"<boolean>";if(ne.IsLiteral(e))return typeof e.const=="string"?"'".concat(e.const,"'"):"".concat(e.const);if(ne.IsRef(e)){let i=t.find(a=>a.$id===e.$ref);return i==null?e.$ref:l_(i,t,r)}if(ne.IsArray(e))return"".concat(l_(e.items,t,r+1),"[]");if(ne.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let a="".concat(e.anyOf.map(u=>l_(u,t,r+1)).filter(Hle).join(" | "));return r>0?"(".concat(a,")"):a}return(n=e.$id)!=null?n:""},"resolveSchemaIdent"),Wle=o((e,t,r)=>{var a;let n=t.message;ne.IsUnion(t.schema)&&(n="Expected one of: ".concat(l_(t.schema,r)));let i="#/definitions/".concat(e).concat((a=$le(t.path))!=null?a:"");return"".concat(i,": ").concat(n)},"errorHandler"),u_=o((e,t,r)=>{let n=t.First();if(n!=null)return Wle(e,n,r)},"shortError");var Dy;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(Dy||(Dy={}));var NM=class NM extends Error{constructor(r,n){super(n);b(this,"name");b(this,"kind");this.name="CompressError",this.kind=r}};o(NM,"CompressError");var Ay=NM,qle=o(e=>new Ay(Dy.Archive,e.message),"flateErrorIntoCompressError"),Yle=o(e=>{let t=Object.values(n_);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),Xle=o((e,t,r)=>{var n;return new Ay(Dy.Validate,(n=u_(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoCompressError"),Zle=o(e=>new Ay(Dy.Encode,e.message),"encodeErrorIntoCompressError"),Kle=o(e=>new Ay(Dy.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoCompressError"),kv=o((e,t,r)=>t instanceof Hh?Zle(t):t instanceof Sl?Xle(e,t,r):Yle(t)?qle(t):Kle(t),"intoCompressError");g();var Fy;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(Fy||(Fy={}));var RM=class RM extends Error{constructor(r,n){super(n);b(this,"name");b(this,"kind");this.name="DecompressError",this.kind=r}};o(RM,"DecompressError");var Ny=RM,Jle=o(e=>new Ny(Fy.Unarchive,e.message),"flateErrorIntoDecompressError"),Qle=o(e=>{let t=Object.values(n_);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),eue=o((e,t,r)=>{var n;return new Ny(Fy.Validate,(n=u_(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoDecompressError"),tue=o(e=>new Ny(Fy.Decode,e.message),"decodeErrorIntoDecompressError"),rue=o(e=>new Ny(Fy.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoDecompressError"),Bv=o((e,t,r)=>t instanceof $h?tue(t):t instanceof Sl?eue(e,t,r):Qle(t)?Jle(t):rue(t),"intoDecompressError");var jB=o(function*(e,t=""){if(e!=null){if(Array.isArray(e)){for(let r=0;r<e.length;r++)yield[t+"[".concat(r,"]"),e[r]];return}if("features"in e){for(let r=0;r<e.features.length;r++)yield[t===""?"features[".concat(r,"]"):"".concat(t,".features[").concat(r,"]"),e.features[r]];return}for(let[r,n]of Object.entries(e)){let i=t===""?r:"".concat(t,".").concat(r);yield*ke(jB(n,i))}}},"iterRecord"),nue=o((e,t)=>e===""?t:t.startsWith("[")?"".concat(e).concat(t):"".concat(e,".").concat(t),"getPath"),ki=o((e,t,r)=>{let n=new Set;for(let[i,a]of jB(e)){let u=t(a);if(n.has(u))return nt({kind:va.DuplicateIdError,properties:{id:u,path:nue(r,i)}});n.add(u)}return et(!0)},"ensureUniqueIds");var UB=o(e=>e.floors==null?nt({kind:va.FloorMissingError,properties:null}):ki(e.floors.features,t=>t.properties.id,"floors"),"validateFloors");var VB=D.Intersect([D.Object({id:D.Ref(jr),elevation:D.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:D.Optional(D.String({description:"The subtitle of the floor."}))}),Ga],{$id:"FloorProperties"}),zB=cs(D.Union([D.Ref(vy),D.Ref(xy),D.Null()]),D.Ref(VB),{$id:"FloorFeature"}),$B=Ks(D.Ref(zB),{$id:"FloorCollection"}),iue=D.Object({floors:D.Ref($B)}),HB={name:"core:floors",intoBundle:o(function*(e){e.floors!=null&&(yield{path:"floors.geojson",contents:e.floors})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="floors.geojson")return{floors:r(t)}},"fromBundle"),integrityCheck:UB,schema:iue,references:[VB,zB,$B]};g();g();var Bi=o(e=>D.Unsafe(e),"PartialRecord");g();var Zr=o(e=>Object.keys(e),"typedKeys");g();g();var oue=o(e=>{var t,r;return new Map((r=(t=e.floors)==null?void 0:t.features.map(n=>[n.properties.id,n]))!=null?r:[])},"createFloorMap"),mu=o(e=>{let t=oue(e);return o(n=>{let i=t.get(n);return i==null?nt({kind:va.UnknownFloorError,properties:{floorId:n}}):et(i)},"floorLookup")},"createFloorLookup");var WB=o(e=>{if(e.floors==null)return nt({kind:va.FloorMissingError,properties:null});if(e.geometry==null)return nt({kind:va.GeometryMissingError,properties:null});let t=ki(e.geometry,n=>n.properties.id,"geometry");if(t.isErr())return t;let r=mu(e);for(let n of Zr(e.geometry)){let i=r(n);if(i.isErr())return i}return et(!0)},"validateGeometry");var qB=D.Intersect([D.Object({id:D.Ref(Ls)}),Ga],{$id:"GeometryProperties"}),YB=cs(D.Union([D.Ref(Os),D.Ref(PS),D.Ref(TS),D.Ref(ES),D.Ref(vy),D.Ref(xy)]),D.Ref(qB),{$id:"GeometryFeature"}),XB=Ks(D.Ref(YB),{$id:"GeometryCollection"}),sue=D.Object({geometry:Bi(D.Record(jr,D.Ref(XB),{additionalProperties:!1}))},{$id:"GeometrySchema"}),aue=/^geometry\/(.*)\.geojson$/,ZB={name:"core:geometry",schema:sue,intoBundle:o(function*(e){if(e.geometry!=null)for(let t of Zr(e.geometry))yield{path:"geometry/".concat(t,".geojson"),contents:e.geometry[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(aue))==null?void 0:i[1];if(n)return{geometry:{[n]:r(t)}}},"fromBundle"),references:[qB,YB,XB],integrityCheck:WB};g();var kM=D.Object({type:D.Literal("file"),name:D.String({description:"The name of the file."})},{$id:"ManifestFile"}),KB=D.Recursive(e=>D.Object({type:D.Literal("folder"),name:D.String({description:"The name of the folder."}),children:D.Array(D.Union([e,D.Ref(kM)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),JB=D.Object({name:D.String({description:"The name of the map."}),version:D.Literal("3.0.0",{description:"The version of the manifest."}),orgId:D.Optional(D.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:D.Optional(D.String({description:"The identifier of the map that this MVF is for."})),contents:D.Array(D.Union([D.Ref(KB),D.Ref(kM)]),{minItems:1,description:"The contents of the MVF bundle."}),time:D.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:D.Optional(D.Unsafe(D.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:D.Optional(D.Number({minimum:0,maximum:360,description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"'})),defaultFloor:D.Optional(D.Ref(jr,{description:"The default floor ID of the map."})),language:D.Optional(D.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),QB=Ks(cs(Os,D.Ref(JB)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),lue=D.Object({manifest:D.Ref(QB)}),eG={name:"core:manifest",intoBundle:o(function*(e){e.manifest!=null&&(yield{path:"manifest.geojson",contents:e.manifest})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="manifest.geojson")return{manifest:r(t)}},"fromBundle"),schema:lue,references:[kM,KB,JB,QB]};g();g();g();g();var GM=class GM extends Tt{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));b(this,"schema");this.schema=r}};o(GM,"TypeDereferenceError");var BM=GM;function uue(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new BM(e);return qh(r,t)}o(uue,"Resolve");function c_(e,t){return!Wr.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}o(c_,"Pushref");function qh(e,t){return e[Se]==="This"||e[Se]==="Ref"?uue(e,t):e}o(qh,"Deref");g();function cue(e,t,r){let n=e.get(t);if(n!==void 0)return n;let i=yc(t,r);return e.set(t,i),i}o(cue,"HasTransformCached");function p_(){let e=new WeakMap;return{HasTransform:o((t,r)=>cue(e,t,r),"HasTransform")}}o(p_,"CreateTransformCache");function Ei(e,t,r){try{return ne.IsTransform(e)?e[ni].Decode(r):r}catch(n){throw new $h(e,t,r,n)}}o(Ei,"Default");function pue(e,t,r,n,i){return Wr.IsArray(n)?Ei(e,r,n.map((a,u)=>xc(e.items,t,"".concat(r,"/").concat(u),a,i))):Ei(e,r,n)}o(pue,"FromArray");function fue(e,t,r,n,i){if(!Wr.IsObject(n)||us(n))return Ei(e,r,n);let a=Yf(e),u=a.map(x=>x[0]),c=Y({},n);for(let[x,I]of a)x in c&&(c[x]=xc(I,t,"".concat(r,"/").concat(x),c[x],i));if(!ne.IsTransform(e.unevaluatedProperties))return Ei(e,r,c);let f=Object.getOwnPropertyNames(c),m=e.unevaluatedProperties,v=Y({},c);for(let x of f)u.includes(x)||(v[x]=Ei(m,"".concat(r,"/").concat(x),v[x]));return Ei(e,r,v)}o(fue,"FromIntersect");function due(e,t,r,n,i){return Ei(e,r,xc(e.not,t,r,n,i))}o(due,"FromNot");function hue(e,t,r,n,i){if(!Wr.IsObject(n))return Ei(e,r,n);let a=zo(e),u=Y({},n);for(let v of a)Wr.HasPropertyKey(u,v)&&(Wr.IsUndefined(u[v])&&(!ne.IsUndefined(e.properties[v])||vn.IsExactOptionalProperty(u,v))||(u[v]=xc(e.properties[v],t,"".concat(r,"/").concat(v),u[v],i)));if(!ne.IsSchema(e.additionalProperties))return Ei(e,r,u);let c=Object.getOwnPropertyNames(u),f=e.additionalProperties,m=Y({},u);for(let v of c)a.includes(v)||(m[v]=Ei(f,"".concat(r,"/").concat(v),m[v]));return Ei(e,r,m)}o(hue,"FromObject");function mue(e,t,r,n,i){if(!Wr.IsObject(n))return Ei(e,r,n);let a=Object.getOwnPropertyNames(e.patternProperties)[0],u=new RegExp(a),c=Y({},n);for(let x of Object.getOwnPropertyNames(n))u.test(x)&&(c[x]=xc(e.patternProperties[a],t,"".concat(r,"/").concat(x),c[x],i));if(!ne.IsSchema(e.additionalProperties))return Ei(e,r,c);let f=Object.getOwnPropertyNames(c),m=e.additionalProperties,v=Y({},c);for(let x of f)u.test(x)||(v[x]=Ei(m,"".concat(r,"/").concat(x),v[x]));return Ei(e,r,v)}o(mue,"FromRecord");function gue(e,t,r,n,i){let a=qh(e,t);return Ei(e,r,xc(a,t,r,n,i))}o(gue,"FromRef");function yue(e,t,r,n,i){let a=qh(e,t);return Ei(e,r,xc(a,t,r,n,i))}o(yue,"FromThis");function vue(e,t,r,n,i){return Wr.IsArray(n)&&Wr.IsArray(e.items)?Ei(e,r,e.items.map((a,u)=>xc(a,t,"".concat(r,"/").concat(u),n[u],i))):Ei(e,r,n)}o(vue,"FromTuple");function xue(e,t,r,n,i){for(let a of e.anyOf){if(!wl.Check(a,t,n))continue;let u=xc(a,t,r,n,i);return Ei(e,r,u)}return Ei(e,r,n)}o(xue,"FromUnion");function xc(e,t,r,n,i){if(!i.HasTransform(e,t))return n;let a=c_(e,t),u=e;switch(e[Se]){case"Array":return pue(u,a,r,n,i);case"Intersect":return fue(u,a,r,n,i);case"Not":return due(u,a,r,n,i);case"Object":return hue(u,a,r,n,i);case"Record":return mue(u,a,r,n,i);case"Ref":return gue(u,a,r,n,i);case"Symbol":return Ei(u,r,n);case"This":return yue(u,a,r,n,i);case"Tuple":return vue(u,a,r,n,i);case"Union":return xue(u,a,r,n,i);default:return Ei(u,r,n)}}o(xc,"Visit");function tG(e,t,r){let n=p_();return xc(e,t,"",r,n)}o(tG,"FastTransformDecode");g();function Fs(e,t,r){try{return ne.IsTransform(e)?e[ni].Encode(r):r}catch(n){throw new Hh(e,t,r,n)}}o(Fs,"Default");function bue(e,t,r,n,i){let a=Fs(e,r,n);return Wr.IsArray(a)?a.map((u,c)=>bc(e.items,t,"".concat(r,"/").concat(c),u,i)):a}o(bue,"FromArray");function Iue(e,t,r,n,i){let a=Fs(e,r,n);if(!Wr.IsObject(n)||us(n))return a;let u=Yf(e),c=u.map(I=>I[0]),f=Y({},a);for(let[I,C]of u)I in f&&(f[I]=bc(C,t,"".concat(r,"/").concat(I),f[I],i));if(!ne.IsTransform(e.unevaluatedProperties))return f;let m=Object.getOwnPropertyNames(f),v=e.unevaluatedProperties,x=Y({},f);for(let I of m)c.includes(I)||(x[I]=Fs(v,"".concat(r,"/").concat(I),x[I]));return x}o(Iue,"FromIntersect");function Sue(e,t,r,n){return Fs(e.not,r,Fs(e,r,n))}o(Sue,"FromNot");function _ue(e,t,r,n,i){let a=Fs(e,r,n);if(!Wr.IsObject(a))return a;let u=zo(e),c=Y({},a);for(let x of u)Wr.HasPropertyKey(c,x)&&(Wr.IsUndefined(c[x])&&(!ne.IsUndefined(e.properties[x])||vn.IsExactOptionalProperty(c,x))||(c[x]=bc(e.properties[x],t,"".concat(r,"/").concat(x),c[x],i)));if(!ne.IsSchema(e.additionalProperties))return c;let f=Object.getOwnPropertyNames(c),m=e.additionalProperties,v=Y({},c);for(let x of f)u.includes(x)||(v[x]=Fs(m,"".concat(r,"/").concat(x),v[x]));return v}o(_ue,"FromObject");function Cue(e,t,r,n,i){let a=Fs(e,r,n);if(!Wr.IsObject(n))return a;let u=Object.getOwnPropertyNames(e.patternProperties)[0],c=new RegExp(u),f=Y({},a);for(let I of Object.getOwnPropertyNames(n))c.test(I)&&(f[I]=bc(e.patternProperties[u],t,"".concat(r,"/").concat(I),f[I],i));if(!ne.IsSchema(e.additionalProperties))return f;let m=Object.getOwnPropertyNames(f),v=e.additionalProperties,x=Y({},f);for(let I of m)c.test(I)||(x[I]=Fs(v,"".concat(r,"/").concat(I),x[I]));return x}o(Cue,"FromRecord");function wue(e,t,r,n,i){let a=qh(e,t),u=bc(a,t,r,n,i);return Fs(e,r,u)}o(wue,"FromRef");function Pue(e,t,r,n,i){let a=qh(e,t),u=bc(a,t,r,n,i);return Fs(e,r,u)}o(Pue,"FromThis");function Tue(e,t,r,n,i){let a=Fs(e,r,n);return Wr.IsArray(e.items)?e.items.map((u,c)=>bc(u,t,"".concat(r,"/").concat(c),a[c],i)):[]}o(Tue,"FromTuple");function Eue(e,t,r,n,i){for(let a of e.anyOf){if(!wl.Check(a,t,n))continue;let u=bc(a,t,r,n,i);return Fs(e,r,u)}for(let a of e.anyOf){let u=bc(a,t,r,n,i);if(wl.Check(e,t,u))return Fs(e,r,u)}return Fs(e,r,n)}o(Eue,"FromUnion");function bc(e,t,r,n,i){if(!i.HasTransform(e,t))return n;let a=c_(e,t),u=e;switch(e[Se]){case"Array":return bue(u,a,r,n,i);case"Intersect":return Iue(u,a,r,n,i);case"Not":return Sue(u,a,r,n);case"Object":return _ue(u,a,r,n,i);case"Record":return Cue(u,a,r,n,i);case"Ref":return wue(u,a,r,n,i);case"This":return Pue(u,a,r,n,i);case"Tuple":return Tue(u,a,r,n,i);case"Union":return Eue(u,a,r,n,i);default:return Fs(u,r,n)}}o(bc,"Visit");function rG(e,t,r){let n=p_();return bc(e,t,"",r,n)}o(rG,"FastTransformEncode");g();var $M=class $M{constructor(t,r,n,i){this.schema=t,this.references=r,this.checkFunc=n,this.code=i,this.hasTransform=yc(t,r)}Code(){return this.code}Errors(t){return fc(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new _y(this.schema,t,this.Errors(t).First());return this.hasTransform?Cy(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?US(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new wy(this.schema,t,this.Errors(t).First());return r}};o($M,"TypeCheck");var jM=$M,Tp;(function(e){function t(a){return a===36}o(t,"DollarSign"),e.DollarSign=t;function r(a){return a===95}o(r,"IsUnderscore"),e.IsUnderscore=r;function n(a){return a>=65&&a<=90||a>=97&&a<=122}o(n,"IsAlpha"),e.IsAlpha=n;function i(a){return a>=48&&a<=57}o(i,"IsNumeric"),e.IsNumeric=i})(Tp||(Tp={}));var f_;(function(e){function t(a){return a.length===0?!1:Tp.IsNumeric(a.charCodeAt(0))}o(t,"IsFirstCharacterNumeric");function r(a){if(t(a))return!1;for(let u=0;u<a.length;u++){let c=a.charCodeAt(u);if(!(Tp.IsAlpha(c)||Tp.IsNumeric(c)||Tp.DollarSign(c)||Tp.IsUnderscore(c)))return!1}return!0}o(r,"IsAccessor");function n(a){return a.replace(/'/g,"\\'")}o(n,"EscapeHyphen");function i(a,u){return r(u)?"".concat(a,".").concat(u):"".concat(a,"['").concat(n(u),"']")}o(i,"Encode"),e.Encode=i})(f_||(f_={}));var UM;(function(e){function t(r){let n=[];for(let i=0;i<r.length;i++){let a=r.charCodeAt(i);Tp.IsNumeric(a)||Tp.IsAlpha(a)?n.push(r.charAt(i)):n.push("_".concat(a,"_"))}return n.join("").replace(/__/g,"_")}o(t,"Encode"),e.Encode=t})(UM||(UM={}));var VM;(function(e){function t(r){return r.replace(/'/g,"\\'")}o(t,"Escape"),e.Escape=t})(VM||(VM={}));var HM=class HM extends Tt{constructor(t){super("Unknown type"),this.schema=t}};o(HM,"TypeCompilerUnknownTypeError");var zM=HM,WM=class WM extends Tt{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};o(WM,"TypeCompilerTypeGuardError");var d_=WM,Yh;(function(e){function t(u,c,f){return vn.ExactOptionalPropertyTypes?"('".concat(c,"' in ").concat(u," ? ").concat(f," : true)"):"(".concat(f_.Encode(u,c)," !== undefined ? ").concat(f," : true)")}o(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(u){return vn.AllowArrayObject?"(typeof ".concat(u," === 'object' && ").concat(u," !== null)"):"(typeof ".concat(u," === 'object' && ").concat(u," !== null && !Array.isArray(").concat(u,"))")}o(r,"IsObjectLike"),e.IsObjectLike=r;function n(u){return vn.AllowArrayObject?"(typeof ".concat(u," === 'object' && ").concat(u," !== null && !(").concat(u," instanceof Date) && !(").concat(u," instanceof Uint8Array))"):"(typeof ".concat(u," === 'object' && ").concat(u," !== null && !Array.isArray(").concat(u,") && !(").concat(u," instanceof Date) && !(").concat(u," instanceof Uint8Array))")}o(n,"IsRecordLike"),e.IsRecordLike=n;function i(u){return vn.AllowNaN?"typeof ".concat(u," === 'number'"):"Number.isFinite(".concat(u,")")}o(i,"IsNumberLike"),e.IsNumberLike=i;function a(u){return vn.AllowNullVoid?"(".concat(u," === undefined || ").concat(u," === null)"):"".concat(u," === undefined")}o(a,"IsVoidLike"),e.IsVoidLike=a})(Yh||(Yh={}));var h_;(function(e){function t(te){return te[Se]==="Any"||te[Se]==="Unknown"}o(t,"IsAnyOrUnknown");function*r(te,ce,ee){yield"true"}o(r,"FromAny");function*n(te,ce,ee){yield"Array.isArray(".concat(ee,")");let[be,Me]=[Ee("value","any"),Ee("acc","number")];vt(te.maxItems)&&(yield"".concat(ee,".length <= ").concat(te.maxItems)),vt(te.minItems)&&(yield"".concat(ee,".length >= ").concat(te.minItems));let Fe=Z(te.items,ce,"value");if(yield"".concat(ee,".every((").concat(be,") => ").concat(Fe,")"),Yr(te.contains)||vt(te.minContains)||vt(te.maxContains)){let it=Yr(te.contains)?te.contains:_n(),xt=Z(it,ce,"value"),Bt=vt(te.minContains)?["(count >= ".concat(te.minContains,")")]:[],pn=vt(te.maxContains)?["(count <= ".concat(te.maxContains,")")]:[],Xe="const count = value.reduce((".concat(Me,", ").concat(be,") => ").concat(xt," ? acc + 1 : acc, 0)"),Gt=["(count > 0)",...Bt,...pn].join(" && ");yield"((".concat(be,") => { ").concat(Xe,"; return ").concat(Gt,"})(").concat(ee,")")}if(te.uniqueItems===!0){let xt="const set = new Set(); for(const element of value) { ".concat("const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true"," }");yield"((".concat(be,") => { ").concat(xt," )(").concat(ee,")")}}o(n,"FromArray");function*i(te,ce,ee){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(ee,")")}o(i,"FromAsyncIterator");function*a(te,ce,ee){yield"(typeof ".concat(ee," === 'bigint')"),ls(te.exclusiveMaximum)&&(yield"".concat(ee," < BigInt(").concat(te.exclusiveMaximum,")")),ls(te.exclusiveMinimum)&&(yield"".concat(ee," > BigInt(").concat(te.exclusiveMinimum,")")),ls(te.maximum)&&(yield"".concat(ee," <= BigInt(").concat(te.maximum,")")),ls(te.minimum)&&(yield"".concat(ee," >= BigInt(").concat(te.minimum,")")),ls(te.multipleOf)&&(yield"(".concat(ee," % BigInt(").concat(te.multipleOf,")) === 0"))}o(a,"FromBigInt");function*u(te,ce,ee){yield"(typeof ".concat(ee," === 'boolean')")}o(u,"FromBoolean");function*c(te,ce,ee){yield*ke(ue(te.returns,ce,"".concat(ee,".prototype")))}o(c,"FromConstructor");function*f(te,ce,ee){yield"(".concat(ee," instanceof Date) && Number.isFinite(").concat(ee,".getTime())"),vt(te.exclusiveMaximumTimestamp)&&(yield"".concat(ee,".getTime() < ").concat(te.exclusiveMaximumTimestamp)),vt(te.exclusiveMinimumTimestamp)&&(yield"".concat(ee,".getTime() > ").concat(te.exclusiveMinimumTimestamp)),vt(te.maximumTimestamp)&&(yield"".concat(ee,".getTime() <= ").concat(te.maximumTimestamp)),vt(te.minimumTimestamp)&&(yield"".concat(ee,".getTime() >= ").concat(te.minimumTimestamp)),vt(te.multipleOfTimestamp)&&(yield"(".concat(ee,".getTime() % ").concat(te.multipleOfTimestamp,") === 0"))}o(f,"FromDate");function*m(te,ce,ee){yield"(typeof ".concat(ee," === 'function')")}o(m,"FromFunction");function*v(te,ce,ee){yield"Number.isInteger(".concat(ee,")"),vt(te.exclusiveMaximum)&&(yield"".concat(ee," < ").concat(te.exclusiveMaximum)),vt(te.exclusiveMinimum)&&(yield"".concat(ee," > ").concat(te.exclusiveMinimum)),vt(te.maximum)&&(yield"".concat(ee," <= ").concat(te.maximum)),vt(te.minimum)&&(yield"".concat(ee," >= ").concat(te.minimum)),vt(te.multipleOf)&&(yield"(".concat(ee," % ").concat(te.multipleOf,") === 0"))}o(v,"FromInteger");function*x(te,ce,ee){let be=te.allOf.map(Me=>Z(Me,ce,ee)).join(" && ");if(te.unevaluatedProperties===!1){let Me=Ue("".concat(new RegExp(bp(te)),";")),Fe="Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Me,".test(key))");yield"(".concat(be," && ").concat(Fe,")")}else if(Yr(te.unevaluatedProperties)){let Me=Ue("".concat(new RegExp(bp(te)),";")),Fe="Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Me,".test(key) || ").concat(Z(te.unevaluatedProperties,ce,"".concat(ee,"[key]")),")");yield"(".concat(be," && ").concat(Fe,")")}else yield"(".concat(be,")")}o(x,"FromIntersect");function*I(te,ce,ee){yield"(typeof value === 'object' && Symbol.iterator in ".concat(ee,")")}o(I,"FromIterator");function*C(te,ce,ee){typeof te.const=="number"||typeof te.const=="boolean"?yield"(".concat(ee," === ").concat(te.const,")"):yield"(".concat(ee," === '").concat(VM.Escape(te.const),"')")}o(C,"FromLiteral");function*T(te,ce,ee){yield"false"}o(T,"FromNever");function*O(te,ce,ee){let be=Z(te.not,ce,ee);yield"(!".concat(be,")")}o(O,"FromNot");function*P(te,ce,ee){yield"(".concat(ee," === null)")}o(P,"FromNull");function*L(te,ce,ee){yield Yh.IsNumberLike(ee),vt(te.exclusiveMaximum)&&(yield"".concat(ee," < ").concat(te.exclusiveMaximum)),vt(te.exclusiveMinimum)&&(yield"".concat(ee," > ").concat(te.exclusiveMinimum)),vt(te.maximum)&&(yield"".concat(ee," <= ").concat(te.maximum)),vt(te.minimum)&&(yield"".concat(ee," >= ").concat(te.minimum)),vt(te.multipleOf)&&(yield"(".concat(ee," % ").concat(te.multipleOf,") === 0"))}o(L,"FromNumber");function*A(te,ce,ee){yield Yh.IsObjectLike(ee),vt(te.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length >= ").concat(te.minProperties)),vt(te.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length <= ").concat(te.maxProperties));let be=Object.getOwnPropertyNames(te.properties);for(let Me of be){let Fe=f_.Encode(ee,Me),it=te.properties[Me];if(te.required&&te.required.includes(Me))yield*ke(ue(it,ce,Fe)),(Sp(it)||t(it))&&(yield"('".concat(Me,"' in ").concat(ee,")"));else{let xt=Z(it,ce,Fe);yield Yh.IsExactOptionalProperty(ee,Me,xt)}}if(te.additionalProperties===!1)if(te.required&&te.required.length===be.length)yield"Object.getOwnPropertyNames(".concat(ee,").length === ").concat(be.length);else{let Me="[".concat(be.map(Fe=>"'".concat(Fe,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Me,".includes(key))")}if(typeof te.additionalProperties=="object"){let Me=Z(te.additionalProperties,ce,"".concat(ee,"[key]")),Fe="[".concat(be.map(it=>"'".concat(it,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Fe,".includes(key) || ").concat(Me,"))")}}o(A,"FromObject");function*M(te,ce,ee){yield"(typeof value === 'object' && typeof ".concat(ee,".then === 'function')")}o(M,"FromPromise");function*N(te,ce,ee){yield Yh.IsRecordLike(ee),vt(te.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length >= ").concat(te.minProperties)),vt(te.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length <= ").concat(te.maxProperties));let[be,Me]=Object.entries(te.patternProperties)[0],Fe=Ue("".concat(new RegExp(be))),it=Z(Me,ce,"value"),xt=Yr(te.additionalProperties)?Z(te.additionalProperties,ce,ee):te.additionalProperties===!1?"false":"true",Bt="(".concat(Fe,".test(key) ? ").concat(it," : ").concat(xt,")");yield"(Object.entries(".concat(ee,").every(([key, value]) => ").concat(Bt,"))")}o(N,"FromRecord");function*B(te,ce,ee){let be=en(te,ce);if(he.functions.has(te.$ref))return yield"".concat(Ke(te.$ref),"(").concat(ee,")");yield*ke(ue(be,ce,ee))}o(B,"FromRef");function*H(te,ce,ee){let be=Ue("".concat(new RegExp(te.source,te.flags),";"));yield"(typeof ".concat(ee," === 'string')"),vt(te.maxLength)&&(yield"".concat(ee,".length <= ").concat(te.maxLength)),vt(te.minLength)&&(yield"".concat(ee,".length >= ").concat(te.minLength)),yield"".concat(be,".test(").concat(ee,")")}o(H,"FromRegExp");function*z(te,ce,ee){if(yield"(typeof ".concat(ee," === 'string')"),vt(te.maxLength)&&(yield"".concat(ee,".length <= ").concat(te.maxLength)),vt(te.minLength)&&(yield"".concat(ee,".length >= ").concat(te.minLength)),te.pattern!==void 0){let be=Ue("".concat(new RegExp(te.pattern),";"));yield"".concat(be,".test(").concat(ee,")")}te.format!==void 0&&(yield"format('".concat(te.format,"', ").concat(ee,")"))}o(z,"FromString");function*R(te,ce,ee){yield"(typeof ".concat(ee," === 'symbol')")}o(R,"FromSymbol");function*X(te,ce,ee){yield"(typeof ".concat(ee," === 'string')");let be=Ue("".concat(new RegExp(te.pattern),";"));yield"".concat(be,".test(").concat(ee,")")}o(X,"FromTemplateLiteral");function*ie(te,ce,ee){yield"".concat(Ke(te.$ref),"(").concat(ee,")")}o(ie,"FromThis");function*Q(te,ce,ee){if(yield"Array.isArray(".concat(ee,")"),te.items===void 0)return yield"".concat(ee,".length === 0");yield"(".concat(ee,".length === ").concat(te.maxItems,")");for(let be=0;be<te.items.length;be++){let Me=Z(te.items[be],ce,"".concat(ee,"[").concat(be,"]"));yield"".concat(Me)}}o(Q,"FromTuple");function*U(te,ce,ee){yield"".concat(ee," === undefined")}o(U,"FromUndefined");function*Te(te,ce,ee){let be=te.anyOf.map(Me=>Z(Me,ce,ee));yield"(".concat(be.join(" || "),")")}o(Te,"FromUnion");function*oe(te,ce,ee){yield"".concat(ee," instanceof Uint8Array"),vt(te.maxByteLength)&&(yield"(".concat(ee,".length <= ").concat(te.maxByteLength,")")),vt(te.minByteLength)&&(yield"(".concat(ee,".length >= ").concat(te.minByteLength,")"))}o(oe,"FromUint8Array");function*fe(te,ce,ee){yield"true"}o(fe,"FromUnknown");function*se(te,ce,ee){yield Yh.IsVoidLike(ee)}o(se,"FromVoid");function*ve(te,ce,ee){let be=he.instances.size;he.instances.set(be,te),yield"kind('".concat(te[Se],"', ").concat(be,", ").concat(ee,")")}o(ve,"FromKind");function*ue(te,ce,ee,be=!0){let Me=qr(te.$id)?[...ce,te]:ce,Fe=te;if(be&&qr(te.$id)){let it=Ke(te.$id);if(he.functions.has(it))return yield"".concat(it,"(").concat(ee,")");{let xt=rt(it,te,ce,"value",!1);return he.functions.set(it,xt),yield"".concat(it,"(").concat(ee,")")}}switch(Fe[Se]){case"Any":return yield*ke(r(Fe,Me,ee));case"Array":return yield*ke(n(Fe,Me,ee));case"AsyncIterator":return yield*ke(i(Fe,Me,ee));case"BigInt":return yield*ke(a(Fe,Me,ee));case"Boolean":return yield*ke(u(Fe,Me,ee));case"Constructor":return yield*ke(c(Fe,Me,ee));case"Date":return yield*ke(f(Fe,Me,ee));case"Function":return yield*ke(m(Fe,Me,ee));case"Integer":return yield*ke(v(Fe,Me,ee));case"Intersect":return yield*ke(x(Fe,Me,ee));case"Iterator":return yield*ke(I(Fe,Me,ee));case"Literal":return yield*ke(C(Fe,Me,ee));case"Never":return yield*ke(T(Fe,Me,ee));case"Not":return yield*ke(O(Fe,Me,ee));case"Null":return yield*ke(P(Fe,Me,ee));case"Number":return yield*ke(L(Fe,Me,ee));case"Object":return yield*ke(A(Fe,Me,ee));case"Promise":return yield*ke(M(Fe,Me,ee));case"Record":return yield*ke(N(Fe,Me,ee));case"Ref":return yield*ke(B(Fe,Me,ee));case"RegExp":return yield*ke(H(Fe,Me,ee));case"String":return yield*ke(z(Fe,Me,ee));case"Symbol":return yield*ke(R(Fe,Me,ee));case"TemplateLiteral":return yield*ke(X(Fe,Me,ee));case"This":return yield*ke(ie(Fe,Me,ee));case"Tuple":return yield*ke(Q(Fe,Me,ee));case"Undefined":return yield*ke(U(Fe,Me,ee));case"Union":return yield*ke(Te(Fe,Me,ee));case"Uint8Array":return yield*ke(oe(Fe,Me,ee));case"Unknown":return yield*ke(fe(Fe,Me,ee));case"Void":return yield*ke(se(Fe,Me,ee));default:if(!vo.Has(Fe[Se]))throw new zM(te);return yield*ke(ve(Fe,Me,ee))}}o(ue,"Visit");let he={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Z(te,ce,ee,be=!0){return"(".concat([...ue(te,ce,ee,be)].join(" && "),")")}o(Z,"CreateExpression");function Ke(te){return"check_".concat(UM.Encode(te))}o(Ke,"CreateFunctionName");function Ue(te){let ce="local_".concat(he.variables.size);return he.variables.set(ce,"const ".concat(ce," = ").concat(te)),ce}o(Ue,"CreateVariable");function rt(te,ce,ee,be,Me=!0){let[Fe,it]=["\n",Xe=>"".padStart(Xe," ")],xt=Ee("value","any"),Bt=We("boolean"),pn=[...ue(ce,ee,be,Me)].map(Xe=>"".concat(it(4)).concat(Xe)).join(" &&".concat(Fe));return"function ".concat(te,"(").concat(xt,")").concat(Bt," {").concat(Fe).concat(it(2),"return (").concat(Fe).concat(pn).concat(Fe).concat(it(2),")\n}")}o(rt,"CreateFunction");function Ee(te,ce){let ee=he.language==="typescript"?": ".concat(ce):"";return"".concat(te).concat(ee)}o(Ee,"CreateParameter");function We(te){return he.language==="typescript"?": ".concat(te):""}o(We,"CreateReturns");function St(te,ce,ee){let be=rt("check",te,ce,"value"),Me=Ee("value","any"),Fe=We("boolean"),it=[...he.functions.values()],xt=[...he.variables.values()],Bt=qr(te.$id)?"return function check(".concat(Me,")").concat(Fe," {\n return ").concat(Ke(te.$id),"(value)\n}"):"return ".concat(be);return[...xt,...it,Bt].join("\n")}o(St,"Build");function yt(...te){let ce={language:"javascript"},[ee,be,Me]=te.length===2&&kt(te[1])?[te[0],te[1],ce]:te.length===2&&!kt(te[1])?[te[0],[],te[1]]:te.length===3?[te[0],te[1],te[2]]:te.length===1?[te[0],[],ce]:[null,[],ce];if(he.language=Me.language,he.variables.clear(),he.functions.clear(),he.instances.clear(),!Yr(ee))throw new d_(ee);for(let Fe of be)if(!Yr(Fe))throw new d_(Fe);return St(ee,be,Me)}o(yt,"Code"),e.Code=yt;function pt(te,ce=[]){let ee=yt(te,ce,{language:"javascript"}),be=globalThis.Function("kind","format","hash",ee),Me=new Map(he.instances);function Fe(pn,Xe,Gt){if(!vo.Has(pn)||!Me.has(Xe))return!1;let Yi=vo.Get(pn),Gi=Me.get(Xe);return Yi(Gi,Gt)}o(Fe,"typeRegistryFunction");function it(pn,Xe){return Zs.Has(pn)?Zs.Get(pn)(Xe):!1}o(it,"formatRegistryFunction");function xt(pn){return Kf(pn)}o(xt,"hashFunction");let Bt=be(Fe,it,xt);return new jM(te,ce,Bt,ee)}o(pt,"Compile"),e.Compile=pt})(h_||(h_={}));g();g();g();var Mue=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Oue=[0,31,28,31,30,31,30,31,31,30,31,30,31],Lue=o(e=>e%4===0&&(e%100!==0||e%400===0),"isLeapYear"),m_=o(e=>{let t=Mue.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&Lue(r)?29:Oue[n])},"date");g();var Due=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,g_=o(e=>{let t=Due.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3],a=t[4],u=t[5]==="-"?-1:1,c=+(t[6]||0),f=+(t[7]||0);if(c>23||f>59||!a)return!1;if(r<=23&&n<=59&&i<60)return!0;let m=n-f*u,v=r-c*u-(m<0?1:0);return(v===23||v===-1)&&(m===59||m===-1)&&i<61},"time");var Aue=/t|\s/i,nG=o(e=>{let t=e.split(Aue);return t.length===2&&m_(t[0])&&g_(t[1])},"dateTime");g();var Fue=/\/|:/,Nue=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,iG=o(e=>Fue.test(e)&&Nue.test(e),"uri");var Rue=[["date",m_],["time",g_],["date-time",nG],["uri",iG]],oG=o(()=>{for(let[e,t]of Rue)try{FS.Format(e,t)}catch(r){if(r instanceof Ev)continue;throw r}},"registerFormats");g();var qM=D.Record(D.String(),D.Unknown(),{$id:"Extra"}),gu=D.Object({extra:D.Optional(D.Ref(qM))}),YM=[qM];g();g();g();g();g();g();var nn=o(e=>Object.entries(e),"typedEntries");var kue=o(e=>{var r;let t=new Map;for(let[n,i]of nn((r=e.geometry)!=null?r:{}))t.set(n,new Map(i==null?void 0:i.features.map(a=>[a.properties.id,a])));return t},"createLookupMap"),xo=o(e=>{let t=kue(e);return o((n,i)=>{let a=t.get(n);if(a==null)return nt({kind:va.UnknownFloorError,properties:{floorId:n}});let u=a.get(i);return u==null?nt({kind:va.UnknownGeometryError,properties:{floorId:n,geometryId:i}}):et(u)},"geometryLookup")},"createGeometryLookup");g();var El=D.Object({geometryId:D.Ref(Ls)},{$id:"WithGeometryId"}),Ry=D.Object({geometryIds:D.Array(D.Ref(Ls))},{$id:"WithGeometryIds"}),XM=[El,Ry];g();g();g();var sG=o(e=>e instanceof Error?e:new Error(String(e)),"asError");var ky=o(e=>(...t)=>{try{return et(e(...t))}catch(r){return nt(sG(r))}},"safeFn");var aG=ky((e,t)=>{let r={};for(let n of t)for(let i of n.intoBundle(e))r[i.path]=My(JSON.stringify(i.contents));return r}),ZM=o(async(e,t,r)=>aG(e,t).andThenAsync(n=>new Promise(i=>{RB(n,Ie(Y({},r),{consume:!0}),(a,u)=>{i(a?nt(a):et(u))})})),"compress"),Bue=ky(kB),KM=o((e,t,r)=>aG(e,t).andThen(n=>Bue(n,r)),"compressSync");g();g();function y_(e,t,r=[]){let n=Y({},e);for(let[i,a]of Object.entries(t))if(a!==void 0)if(i in n){let u=i;if(Array.isArray(a)&&a.length>0){let c=Gue(a[0],r);if(c){let f=n[u];if(!Array.isArray(f))throw new Error("Expected array at ".concat(i,", got ").concat(typeof f));let m=new Map(a.map(I=>[lG(I,c),I])),x=f.map(I=>{let C=m.get(lG(I,c));return C?y_(I,C,r):I});n[u]=x}else n[u]=a}else{let c=n[u];typeof c=="object"&&c!==null&&typeof a=="object"&&a!==null?Object.keys(a).length===0?n[u]=a:n[u]=y_(c,a,r):n[i]=a}}else n[i]=a;return n}o(y_,"deepMergeOn");function Gue(e,t){function r(n){if(typeof n!="object"||n===null)return null;for(let i of t)if(i in n&&typeof n[i]<"u")return[i];if(Array.isArray(n))return null;for(let[i,a]of Object.entries(n)){let u=r(a);if(u)return[i,...u]}return null}return o(r,"search"),r(e)}o(Gue,"findIdentifierKey");function lG(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}o(lG,"getValueByKeyPath");var jue=o(e=>e,"identity"),Uue=o(e=>JSON.parse(FM(e)),"jsonDecode"),uG=o((e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,jue)!==void 0),"isFileExpected"),cG=ky((e,t)=>{let r={};for(let n of Object.keys(e)){let i=e[n];for(let a of t){let u=a.fromBundle(n,i,Uue);if(u){r=y_(r,u,[]);break}}}return r}),JM=o(async(e,t)=>new Promise(r=>BB(e,{filter:o(n=>uG(n,t),"filter")},(n,i)=>{r(n?nt(n):et(i))})).then(r=>r.andThen(n=>cG(n,t))),"decompress"),Vue=ky(GB),QM=o((e,t)=>Vue(e,{filter:o(r=>uG(r,t),"filter")}).andThen(r=>cG(r,t)),"decompressSync");g();var zue=o(e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string","isRef"),$ue=o(e=>{if(e.length<2)return!1;let t=e.filter(zue);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},"isDuplicateRef"),v_=o(e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&$ue(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,v_(r)])):Array.isArray(e)?e.map(v_):e,"fixDuplicateAllOf");g();var x_=o(e=>typeof e=="object"&&e!=null&&"$ref"in e?Ie(Y({},e),{$ref:"#/definitions/".concat(e.$ref)}):typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,x_(r)])):Array.isArray(e)?e.map(x_):e,"prefixReferences");var By;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(By||(By={}));var Hue=o(e=>({next(){for(let r of e){let n=r.next();if(!n.done)return n}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),"join"),Wue=o((...e)=>{let t=new Map;for(let r of Hue(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return nt({kind:By.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:r});t.set(r.$id,r)}return et(t)},"computeReferenceMap"),Ho,Gy,Ha,ms,I_=class I_{constructor(t,r,n,i){j(this,Ho);j(this,Gy);j(this,Ha,[]);j(this,ms);$(this,Ho,t),$(this,Gy,r),$(this,Ha,n),$(this,ms,i),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(t,r="CoreMVF",n=!1){let i=D.Composite(t.extensions.map(u=>u.schema),{$id:r});if(!ne.IsSchema(i))return nt({kind:By.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:i});let a=Wue(UE.values(),VE.values(),GE.values(),YM.values(),e4.values(),XM.values(),t.extensions.flatMap(u=>{var c;return(c=u.references)!=null?c:[]}).values());if(!a.isOk())return a;try{oG();let u=n?null:h_.Compile(i,[...a.value.values()]);return et(new I_(i,u,t.extensions,a.value))}catch(u){return u instanceof Tt?nt({kind:By.TypeboxError,message:u.message,original:u}):nt({kind:By.UnknownError,message:"An unknown error occurred while compiling the schema",original:u})}}is(t){var r,n;return(n=(r=d(this,Gy))==null?void 0:r.Check(t))!=null?n:wl.Check(d(this,Ho),[...d(this,ms).values()],t)}parse(t){var r,n;return this.is(t)?et(t):nt((n=(r=d(this,Gy))==null?void 0:r.Errors(t))!=null?n:wl.Errors(d(this,Ho),[...d(this,ms).values()],t))}decode(t){try{return et(tG(d(this,Ho),[...d(this,ms).values()],t))}catch(r){return nt(r)}}encode(t){try{return et(rG(d(this,Ho),[...d(this,ms).values()],t))}catch(r){return nt(r)}}verify(t){for(let r of d(this,Ha))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return nt(n.error)}return et(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([d(this,Ho),...d(this,ms).values()])),r=v_(x_({$id:"#/definitions/".concat((n=d(this,Ho).$id)!=null?n:"CoreMVF"),$schema:"http://json-schema.org/draft-07/schema#",references:t}));return JSON.stringify(r,null,2)}async compress(t){return this.encode(t).andThen(r=>this.parse(r)).andThenAsync(r=>ZM(r,d(this,Ha))).then(r=>r.mapErr(n=>{var i;return kv((i=d(this,Ho).$id)!=null?i:"CoreMVF",n,[...d(this,ms).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>ZM(r,d(this,Ha))).then(r=>r.mapErr(n=>{var i;return kv((i=d(this,Ho).$id)!=null?i:"CoreMVF",n,[...d(this,ms).values()])}))}compressSync(t){return this.encode(t).andThen(r=>this.parse(r)).andThen(r=>KM(r,d(this,Ha))).mapErr(r=>{var n;return kv((n=d(this,Ho).$id)!=null?n:"CoreMVF",r,[...d(this,ms).values()])})}compressUnsafeSync(t){return this.encode(t).andThen(r=>KM(r,d(this,Ha))).mapErr(r=>{var n;return kv((n=d(this,Ho).$id)!=null?n:"CoreMVF",r,[...d(this,ms).values()])})}async decompress(t){return JM(t,d(this,Ha)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var i;return Bv((i=d(this,Ho).$id)!=null?i:"CoreMVF",n,[...d(this,ms).values()])}))}async decompressUnsafe(t){return JM(t,d(this,Ha)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var i;return Bv((i=d(this,Ho).$id)!=null?i:"CoreMVF",n,[...d(this,ms).values()])}))}decompressSync(t){return QM(t,d(this,Ha)).andThen(r=>this.parse(r)).andThen(r=>this.decode(r)).mapErr(r=>{var n;return Bv((n=d(this,Ho).$id)!=null?n:"CoreMVF",r,[...d(this,ms).values()])})}decompressUnsafeSync(t){return QM(t,d(this,Ha)).andThen(r=>this.decode(r)).mapErr(r=>{var n;return Bv((n=d(this,Ho).$id)!=null?n:"CoreMVF",r,[...d(this,ms).values()])})}};Ho=new WeakMap,Gy=new WeakMap,Ha=new WeakMap,ms=new WeakMap,o(I_,"MVFParser");var b_=I_;var jy,t4=class t4{constructor(){j(this,jy,[]);this.extend=this.extend.bind(this)}extend(t){return d(this,jy).push(t),this}extendOptional(t){let r=Ie(Y({},t),{schema:D.Partial(t.schema)});return d(this,jy).push(r),this}build(t){return b_.create(this,void 0,t==null?void 0:t.cspSafe)}get extensions(){return d(this,jy)}};jy=new WeakMap,o(t4,"MVFParserBuilder");var S_=t4;g();g();g();g();var Uy=D.Object({geometryId:D.Ref(Ls),floorId:D.Ref(jr)},{$id:"GeometryAnchor"}),que=D.Object({geometryAnchor:D.Ref(Uy)}),Gv=o((e,t)=>D.Object({geometryAnchors:D.Array(D.Ref(Uy),e)},t),"WithGeometryAnchors"),e4=[Uy];g();g();g();var pG=o((e,t)=>D.Unsafe(D.Transform(D.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),"SafeStringEnumSchema"),xa=o((e,t)=>{let r=pG(e,t),n=[...e,"unknown"],i=Object.freeze(Object.fromEntries([...e,"unknown"].map(a=>[a,a])));return{schema:r,values:n,record:i}},"SafeStringEnum");var fG=o(()=>new S_().extend(HB).extend(ZB).extend(eG),"createParser");g();g();g();g();g();g();var jv;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(jv||(jv={}));var dG=o(e=>{var i;if(e.annotations==null)return et(!0);let t=ki(e.annotations,a=>a.id,"annotations");if(t.isErr())return t;let r=xo(e),n=new Set(Zr((i=e.annotationSymbols)!=null?i:{}));for(let a of Zr(e.annotations)){let u=e.annotations[a];if(u!=null)for(let c of u){if(!n.has(c.symbolKey))return nt({kind:jv.AnnotationUnknownSymbolError,properties:{annotationId:c.id,symbolKey:c.symbolKey}});let f=r(a,c.geometryId);if(f.isErr())return f;if(f.value.geometry.type!=="Point")return nt({kind:jv.AnnotationNonPointGeometryError,properties:{annotationId:c.id,floorId:a,geometryId:c.geometryId}})}}return et(!0)},"validateAnnotations");var hG=Ri("a","AnnotationId"),r4=D.Intersect([El,D.Object({id:D.Ref(hG,{description:"The unique identifier for the annotation."}),externalId:D.Optional(D.String({description:"The external identifier for the annotation."})),symbolKey:D.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),mG=D.Object({url:D.String({format:"uri",description:"The URL for the symbol."}),name:D.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),Yue=D.Object({annotations:Bi(D.Record(jr,D.Array(D.Ref(r4)),{additionalProperties:!1})),annotationSymbols:Bi(D.Record(D.Index(r4,["symbolKey"]),D.Ref(mG)))},{$id:"AnnotationsSchema"}),Xue=/^annotations\/(.*)\.json$/,gG={name:"ext:mvf-annotations",schema:Yue,intoBundle:o(function*(e){if(e.annotations!=null)for(let t of Zr(e.annotations))yield{path:"annotations/".concat(t,".json"),contents:e.annotations[t]};e.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:e.annotationSymbols})},"intoBundle"),fromBundle:o((e,t,r)=>{var i;if(e==="annotation-symbols.json")return{annotationSymbols:r(t)};let n=(i=e.match(Xue))==null?void 0:i[1];if(n)return{annotations:{[n]:r(t)}}},"fromBundle"),references:[hG,r4,mG],integrityCheck:dG};g();g();g();var Ep=Ri("lcat","LocationCategoryId"),n4=D.Intersect([D.Object({id:D.Ref(Ep),parent:D.Optional(D.Ref(Ep))}),Vh(["name"]),gu],{$id:"LocationCategory"}),yG=[Ep,n4];g();g();var Xh;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(Xh||(Xh={}));var vG=o(e=>{var i,a,u,c,f,m,v,x,I;if(e.locationCategories==null&&e.locations==null)return et(!0);if(e.locationCategories!=null){let C=ki(e.locationCategories,T=>T.id,"locationCategories");if(C.isErr())return C}if(e.locations!=null){let C=ki(e.locations,T=>T.id,"locations");if(C.isErr())return C}if(e.locationInstances!=null){let C=ki(e.locationInstances,T=>T.id,"locationInstances");if(C.isErr())return C}let t=new Set((a=(i=e.locationCategories)==null?void 0:i.map(C=>C.id))!=null?a:[]);for(let C of(u=e.locationCategories)!=null?u:[])if(C.parent!=null&&!t.has(C.parent))return nt({kind:Xh.UnknownParentCategoryError,properties:{categoryId:C.id,parentCategoryId:C.parent}});let r=xo(e);for(let C of(c=e.locations)!=null?c:[]){for(let T of C.categories)if(!t.has(T))return nt({kind:Xh.UnknownCategoryError,properties:{locationId:C.id,categoryId:T}});for(let T of C.geometryAnchors){let O=r(T.floorId,T.geometryId);if(O.isErr())return O}}let n=new Set((m=(f=e.locations)==null?void 0:f.map(C=>C.id))!=null?m:[]);for(let C of(v=e.locationInstances)!=null?v:[]){if(!n.has(C.parentId))return nt({kind:Xh.UnknownParentLocationError,properties:{locationInstanceId:C.id,parentLocationId:C.parentId}});for(let T of(x=C.categories)!=null?x:[])if(!t.has(T))return nt({kind:Xh.UnknownCategoryError,properties:{locationId:C.id,categoryId:T}});for(let T of(I=C.geometryAnchors)!=null?I:[]){let O=r(T.floorId,T.geometryId);if(O.isErr())return O}}return et(!0)},"validateLocations");g();var Mp=Ri("loc","LocationId"),__=Ri("loci","LocationInstanceId"),xG=D.Object({name:D.String(),url:D.String({format:"uri"})},{$id:"LocationSocial"}),bG=D.Object({url:D.String({format:"uri"})},{$id:"LocationImage"}),i4=D.Object({label:D.String(),url:D.String({format:"uri"})},{$id:"LocationLink"}),o4=D.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),IG=D.Union([D.Literal("Sunday"),D.Literal("Monday"),D.Literal("Tuesday"),D.Literal("Wednesday"),D.Literal("Thursday"),D.Literal("Friday"),D.Literal("Saturday")],{$id:"OpeningHoursDay"}),Zue="PublicHolidays",s4=D.Union([IG,D.Literal(Zue)],{$id:"OpeningHoursDayOrPublicHoliday"}),C_=D.Object({"@type":D.Optional(D.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:D.Optional(D.Ref(o4,{description:"The time the opening hours start"})),closes:D.Optional(D.Ref(o4,{description:"The time the opening hours end"})),dayOfWeek:D.Optional(D.Union([D.Ref(s4),D.Array(D.Ref(s4))],{description:"The days of the week the opening hours apply to"})),validFrom:D.Optional(D.String({format:"date",description:"The date the opening hours start, in ISO 8601 format"})),validTo:D.Optional(D.String({format:"date",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),w_=D.Intersect([D.Object({id:D.Ref(Mp),categories:D.Array(D.Ref(Ep)),logo:D.Optional(D.String({format:"uri"})),phone:D.Optional(D.String()),social:D.Array(D.Ref(xG)),images:D.Array(D.Ref(bG)),links:D.Array(D.Ref(i4)),website:D.Optional(D.Ref(i4)),openingHours:D.Optional(D.Array(D.Ref(C_)))}),Vh(["name"]),Gv(),gu],{$id:"Location"}),a4=D.Intersect([D.Object({id:D.Ref(__),parentId:D.Ref(Mp)}),D.Partial(D.Omit(w_,["id","parentId","details"])),Ga],{$id:"LocationInstance",description:"A location instance is a particular instance of an location that has some properties different from the parent."}),P_=[Mp,__,xG,bG,i4,o4,IG,s4,C_,w_,a4];var Kue=D.Object({locations:D.Array(D.Ref(w_)),locationCategories:D.Array(D.Ref(n4)),locationInstances:D.Optional(D.Array(D.Ref(a4)))},{$id:"LocationsExtensionSchema"}),SG="locations.json",_G="location-categories.json",CG="location-instances.json",wG={name:"ext:locations",schema:Kue,intoBundle:o(function*(e){e.locations!=null&&(yield{path:SG,contents:e.locations}),e.locationCategories!=null&&(yield{path:_G,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:CG,contents:e.locationInstances})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===SG)return{locations:r(t)};if(e===_G)return{locationCategories:r(t)};if(e===CG)return{locationInstances:r(t)}},"fromBundle"),references:[...yG,...P_],integrityCheck:vG};g();g();var yu;(function(e){e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling",e.EnterpriseVenueWithUnknownTopLocationError="EnterpriseVenueWithUnknownTopLocationError",e.EnterpriseLocationWithInvalidPrimaryCategory="EnterpriseLocationWithInvalidPrimaryCategory"})(yu||(yu={}));var PG=o(e=>{var I,C,T,O,P,L,A,M,N,B,H,z,R,X,ie,Q,U,Te,oe,fe;if(e.cms==null)return et(!0);let t=e.cms,r=ki(e.cms.categories,se=>se.id,"cms.categories");if(r.isErr())return r;let n=new Set((C=(I=e.locationCategories)==null?void 0:I.map(se=>se.id))!=null?C:[]);for(let se of(T=t.categories)!=null?T:[])if(!n.has(se.categoryId))return nt({kind:yu.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:se.id,locationCategoryId:se.categoryId}});let i=ki(e.cms.locations,se=>se.id,"cms.locations");if(i.isErr())return i;let a=new Map((P=(O=e.locations)==null?void 0:O.map(se=>[se.id,se]))!=null?P:[]);for(let se of(L=t.locations)!=null?L:[]){if(!a.has(se.locationId))return nt({kind:yu.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:se.id,locationId:se.locationId}});for(let ve of(A=se.siblingGroups)!=null?A:[])for(let ue of(M=ve.siblings)!=null?M:[])if(!a.has(ue))return nt({kind:yu.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:se.id,siblingLocationId:ue,label:ve.label}});if(se.primaryCategory!=null){let ve=a.get(se.locationId);if(ve!=null&&!ve.categories.includes(se.primaryCategory))return nt({kind:yu.EnterpriseLocationWithInvalidPrimaryCategory,properties:{enterpriseLocationId:se.id,locationId:se.locationId,primaryCategory:se.primaryCategory}})}}if(((N=t.venue)==null?void 0:N.topLocations)!=null){for(let se of t.venue.topLocations)if(!a.has(se))return nt({kind:yu.EnterpriseVenueWithUnknownTopLocationError,properties:{locationId:se}})}let u=new Set((H=(B=e.cms.locations)==null?void 0:B.map(se=>se.id))!=null?H:[]),c=ki(e.cms.locationInstances,se=>se.id,"cms.locationInstances");if(c.isErr())return c;let f=new Set((R=(z=e.locationInstances)==null?void 0:z.map(se=>se.id))!=null?R:[]);for(let se of(X=t.locationInstances)!=null?X:[]){if(!u.has(se.parentId))return nt({kind:yu.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:se.id,enterpriseLocationId:se.parentId}});if(!f.has(se.locationInstanceId))return nt({kind:yu.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:se.id,locationInstanceId:se.locationInstanceId}});for(let ve of(ie=se.siblingGroups)!=null?ie:[])for(let ue of(Q=ve.siblings)!=null?Q:[])if(!a.has(ue))return nt({kind:yu.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:se.id,siblingLocationId:ue,label:ve.label}})}let m=mu(e),v=xo(e),x=ki(e.cms.floorText,se=>se.properties.id,"cms.floorText");if(x.isErr())return x;for(let[se,ve]of nn((U=t.floorText)!=null?U:{})){let ue=m(se);if(ue.isErr())return ue;for(let he of ve.features){if(!("geometryId"in he.properties))continue;let Z=v(se,he.properties.geometryId);if(Z.isErr())return Z}}for(let[se,ve]of nn((Te=t.textures)!=null?Te:{})){let ue=m(se);if(ue.isErr())return ue;for(let he of ve){let Z=v(se,he.geometryId);if(Z.isErr())return Z}}for(let[se,ve]of nn((oe=t.layers)!=null?oe:{})){let ue=m(se);if(ue.isErr())return ue;for(let he of Zr(ve!=null?ve:{})){let Z=v(se,he);if(Z.isErr())return Z}}for(let[se,ve]of nn((fe=t.textAreas)!=null?fe:{})){let ue=m(se);if(ue.isErr())return ue;for(let he of ve.features)if("geometryId"in he.properties){let Z=v(se,he.properties.geometryId);if(Z.isErr())return Z}}return et(!0)},"validateCMS");g();g();var Uv=Ri("el","EnterpriseLocationId"),l4=Ri("ec","EnterpriseCategoryId"),u4=Ri("eli","EnterpriseLocationInstanceId"),c4=Ri("ev","EnterpriseVenueId"),p4=Ri("eft","EnterpriseFloorTextId"),TG=[Uv,l4,u4,c4,p4];var EG=D.Object({id:D.Ref(l4),categoryId:D.Ref(Ep),color:D.Optional(D.String()),sortOrder:D.Number(),iconFromDefaultList:D.Optional(D.Union([D.String(),D.Null()])),picture:D.Optional(D.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),f4=D.Object({categories:D.Optional(D.Array(D.Ref(EG)))},{$id:"EnterpriseCategoriesSchema"}),MG=[EG,f4];g();var OG=xa(["left","center","right"]),Jue=OG.schema,w0t=OG.values,d4=D.Object({id:D.Ref(p4),text:D.String(),visible:D.Boolean({default:!0}),fontSize:D.Number({default:12,exclusiveMinimum:0}),fontFamily:D.String({default:"Droid Sans"}),color:D.String({default:"black"}),rotation:D.Number({minimum:0,maximum:360}),align:Jue},{$id:"FloorTextCommonProperties"}),h4=D.Intersect([D.Ref(d4),El],{$id:"AnchoredFloorTextProperties"}),m4=D.Intersect([D.Ref(d4),D.Object({verticalOffset:D.Number()})],{$id:"FloatingFloorTextProperties"}),LG=D.Union([D.Ref(h4),D.Ref(m4)],{$id:"FloorTextProperties"}),DG=cs(Os,D.Ref(LG),{$id:"FloorTextFeature"}),Que=cs(Os,D.Ref(h4),{$id:"AnchoredFloorTextFeature"}),ece=cs(Os,D.Ref(m4),{$id:"FloatingFloorTextFeature"}),AG=Ks(D.Ref(DG),{$id:"EnterpriseFloorTextFeatureCollection"}),FG=D.Record(jr,D.Ref(AG),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),g4=D.Object({floorText:D.Optional(D.Ref(FG))},{$id:"EnterpriseFloorTextSchema"}),NG=[d4,h4,m4,LG,DG,Que,ece,AG,FG,g4];g();var RG=Bi(D.Record(Ls,D.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),kG=Bi(D.Record(jr,D.Ref(RG),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),y4=D.Object({layers:D.Optional(D.Ref(kG))},{$id:"EnterpriseLayersSchema"}),BG=[RG,kG,y4];g();g();g();var v4=xa(["closed-temporarily","new","pop-up","coming-soon","relocated"]),tce=v4.schema,R0t=v4.values,k0t=v4.record,x4=D.Object({type:tce,start:D.Optional(D.String({format:"date",description:"The start date of the state"})),end:D.Optional(D.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),b4=D.Object({label:D.String(),siblings:D.Array(D.Ref(Mp))},{$id:"SiblingGroup"}),T_=D.Object({name:D.String(),code:D.String()},{$id:"Language"}),GG=[x4,b4,T_];var E_=D.Object({id:D.Ref(Uv),locationId:D.Ref(Mp),cmsId:D.String(),type:D.String(),sortOrder:D.Number(),tags:D.Optional(D.Array(D.String())),picture:D.Optional(D.String({format:"uri",description:"The picture of the location"})),states:D.Optional(D.Array(D.Ref(x4),{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set"})),siblingGroups:D.Optional(D.Array(D.Ref(b4))),gallery:D.Optional(D.Array(D.Object({caption:D.Optional(D.String()),image:D.String({format:"uri"}),embeddedUrl:D.Optional(D.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:D.Optional(D.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:D.Optional(D.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:D.Optional(D.Boolean({description:"Whether to show the logo of the location"})),primaryCategory:D.Optional(D.Ref(Ep))},{$id:"EnterpriseLocation"}),I4=D.Object({locations:D.Optional(D.Array(D.Ref(E_)))},{$id:"EnterpriseLocationsSchema"}),jG=[E_,I4];var UG=D.Intersect([D.Object({id:D.Ref(u4),parentId:D.Ref(Uv),locationInstanceId:D.Ref(__)}),D.Partial(D.Omit(E_,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),S4=D.Object({locationInstances:D.Optional(D.Array(D.Ref(UG)))},{$id:"EnterpriseLocationInstancesSchema"}),VG=[UG,S4];g();var _4=xa(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),zG=_4.schema,r1t=_4.values,n1t=_4.record,C4=D.Object({maxWidth:D.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:D.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:D.Ref(zG),rotation:D.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),$G=D.Intersect([D.Ref(C4),El],{$id:"EnterpriseAnchoredTextAreaProperties"}),HG=D.Intersect([D.Ref(C4),D.Object({verticalOffset:D.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),WG=D.Union([$G,HG],{$id:"EnterpriseTextAreaProperties"}),qG=cs(D.Ref(Os),WG,{$id:"EnterpriseTextAreaFeature"}),YG=Ks(D.Ref(qG),{$id:"EnterpriseTextAreaCollection"}),XG=D.Record(jr,D.Ref(YG),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),ZG=D.Object({textAreas:D.Optional(D.Ref(XG))},{$id:"EnterpriseTextAreasSchema"}),KG=[zG,C4,$G,HG,WG,qG,YG,XG];g();var w4=D.Object({u:D.Number(),v:D.Number()},{$id:"EnterpriseTextureUV"}),P4=xa(["top","side"],{$id:"EnterpriseTextureFace"}),JG=P4.schema,l1t=P4.values,u1t=P4.record,T4=xa(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),QG=T4.schema,c1t=T4.values,p1t=T4.record,ej=D.Tuple([gy,yy,gy,yy],{$id:"EnterpriseTextureBounds"}),tj=D.Intersect([D.Object({repeat:D.Ref(w4),offset:D.Ref(w4),rotation:D.Number({minimum:0,maximum:360}),path:D.String({format:"uri"}),face:D.Ref(JG),surface:D.Ref(QG),bounds:D.Ref(ej)},{$id:"EnterpriseTextureProperties"}),El],{$id:"EnterpriseTexture"}),rj=D.Array(D.Ref(tj),{$id:"EnterpriseTextures"}),nj=D.Record(jr,D.Ref(rj),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),E4=D.Object({textures:D.Optional(D.Ref(nj))},{$id:"EnterpriseTexturesSchema"}),ij=[tj,rj,E4,w4,JG,QG,ej,nj];g();var oj=D.Intersect([D.Object({id:D.Ref(c4),slug:D.String(),defaultLanguage:D.Ref(T_),languages:D.Array(D.Ref(T_)),countrycode:D.Optional(D.String()),logo:D.Optional(D.String({format:"uri"})),mappedinWebUrl:D.Optional(D.String({format:"uri"})),topLocations:D.Optional(D.Array(D.Ref(Mp))),operationHours:D.Optional(D.Array(D.Ref(C_))),coverImage:D.Optional(D.String({format:"uri"}))}),Vh(["name"]),gu],{$id:"EnterpriseVenue"}),M4=D.Object({venue:D.Optional(D.Ref(oj))},{$id:"EnterpriseVenueSchema"}),sj=[oj,M4];var lj=D.Intersect([M4,I4,S4,f4,E4,g4,y4,ZG],{$id:"CMSProperties"}),aj=D.Object({cms:D.Optional(D.Ref(lj))},{$id:"CMSExtensionSchema"}),rce=/^cms\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,uj={name:"ext:cms",schema:aj,intoBundle:o(function*(e){var r,n,i,a,u,c;if(e.cms==null)return;let t=e.cms;for(let f of Zr(t))switch(f){case"floorText":for(let m of Zr((r=t.floorText)!=null?r:{}))yield{path:"cms/floorText/".concat(m,".geojson"),contents:((n=t.floorText)!=null?n:{})[m]};continue;case"textures":for(let m of Zr((i=t.textures)!=null?i:{}))yield{path:"cms/textures/".concat(m,".json"),contents:((a=t.textures)!=null?a:{})[m]};continue;case"textAreas":for(let m of Zr((u=t.textAreas)!=null?u:{}))yield{path:"cms/textAreas/".concat(m,".geojson"),contents:((c=t.textAreas)!=null?c:{})[m]};continue;default:yield{path:"cms/".concat(f,".json"),contents:t[f]};continue}},"intoBundle"),fromBundle:o((e,t,r)=>{let n=e.match(rce);if(!n)return;let[,i,a]=n,u=r(t);switch(i){case"floorText":case"textures":case"textAreas":return{cms:{[i]:{[a]:u}}};default:return{cms:{[a]:u}}}},"fromBundle"),references:[lj,aj,...sj,...jG,...VG,...MG,...ij,...BG,...NG,...KG,...TG,...GG,...P_],integrityCheck:PG};g();g();g();g();var vu;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(vu||(vu={}));var cj=o(e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return et(!0);let r=Object.entries(t).map(([a,u])=>Y({key:a},u)).sort((a,u)=>a.index!==u.index?a.index-u.index:a.bit-u.bit),n=0,i=-1;for(let a of r){if(a.bit===i)return nt({kind:vu.NavigationFlagDuplicateBit,properties:{index:a.index,bit:a.bit,path:"navigationFlags.".concat(a.key)}});if(a.index!=n){if(i!=31)return nt({kind:vu.NavigationFlagMissingDeclaration,properties:{index:n,bit:i+1,path:"navigationFlags"}});if(a.index!=n+1||a.bit!=0)return nt({kind:vu.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=a.index,i=0}else{if(a.bit!==i+1)return nt({kind:vu.NavigationFlagMissingDeclaration,properties:{index:a.index,bit:i+1,path:"navigationFlags"}});i=a.bit}}return et(!0)},"validateNavigationFlags");g();function Qf(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}o(Qf,"hasFlag");g();var pj=2**32-1,Vv=o(e=>{var i;let t=Object.keys((i=e.navigationFlags)!=null?i:{}).length;if(t===0)return{index:-1,flag:0};let r=Math.floor(t/32),n=t%32;return{index:r,flag:2**n-1}},"determineMaxNavigationFlags"),Vy=o((e,t,r)=>{if(t.index==-1&&e.length===0)return et(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return nt({kind:vu.NavigationFlagIncorrectFlagsLength,properties:{expected:n,actual:e.length,path:r}});for(let i=0;i<e.length;i++){let a=e[i];if(i<t.index){if(a>pj)return nt({kind:vu.NavigationFlagValueTooBig,properties:{index:i,flagValue:a,expectedMaxFlagValue:pj,path:r}});continue}else if(a>t.flag)return nt({kind:vu.NavigationFlagValueTooBig,properties:{index:i,flagValue:a,expectedMaxFlagValue:t.flag,path:r}})}return et(!0)},"validateFlags");var nce=D.Object({index:D.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:D.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),fj=D.Intersect([nce,Ga],{$id:"NavigationFlagDeclaration",description:'A NavigationFlagDeclaration describes the relationship between a "key" that a developer might use to wayfind using that flag, and the index and bit position in an object\'s `flags` array.'}),O4={accessible:"accessible",outdoors:"outdoors"},dj=D.Record(D.String(),fj,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),ice=D.Object({navigationFlags:D.Ref(dj)},{$id:"NavigationFlagsSchema"}),M_=D.Array(D.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),L4=D.Object({flags:D.Ref(M_)},{$id:"WithFlags"}),Zh=D.Intersect([Uy,L4],{$id:"FlaggedGeometryAnchor"}),oce=D.Object({geometryAnchor:Zh},{$id:"WithFlaggedGeometryAnchor"}),sce=D.Object({geometryAnchors:D.Array(Zh)},{$id:"WithFlaggedGeometryAnchors"}),hj={name:"ext:mvf-navigation-flags",schema:ice,intoBundle:o(function*(e){e.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:e.navigationFlags})},"intoBundle"),fromBundle:o((e,t,r)=>e!=="navigationFlags.json"?void 0:{navigationFlags:r(t)},"fromBundle"),references:[fj,dj,M_,Zh,oce,sce],integrityCheck:cj};g();var mj=o(e=>{if(e.connections==null)return et(!0);let t=ki(e.connections,i=>i.id,"connections");if(t.isErr())return t;let r=xo(e),n=Vv(e);for(let[i,a]of e.connections.entries()){for(let[u,c]of a.entrances.entries()){let f=r(c.floorId,c.geometryId);if(f.isErr())return f;let m=Vy(c.flags,n,"connections[".concat(i,"].entrances[").concat(u,"]"));if(m.isErr())return m}for(let[u,c]of a.exits.entries()){let f=r(c.floorId,c.geometryId);if(f.isErr())return f;let m=Vy(c.flags,n,"connections[".concat(i,"].exits[").concat(u,"]"));if(m.isErr())return m}}return et(!0)},"validateConnections");var yj=Ri("c","ConnectionId"),{schema:ace,values:xvt,record:lce}=xa(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),vj=ace;var D4=lce,xj=D.Intersect([D.Object({id:D.Ref(yj,{description:"The unique identifier for the connection."}),entrances:D.Array(D.Ref(Zh)),exits:D.Array(D.Ref(Zh)),entryCost:D.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:D.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:D.Ref(vj,{description:"The type of connection."})}),Ga,gu],{$id:"ConnectionsProperties"}),bj=D.Array(D.Ref(xj),{$id:"ConnectionsCollection"}),uce=D.Object({connections:D.Ref(bj)},{$id:"ConnectionsExtensionSchema"}),gj="connections.json",Ij={name:"ext:connections",schema:uce,intoBundle:o(function*(e){e.connections!=null&&(yield{path:gj,contents:e.connections})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===gj)return{connections:r(t)}},"fromBundle"),references:[xj,bj,vj,yj,Zh,M_],integrityCheck:mj};g();g();var Sj=o(e=>{if(e.defaultStyle==null)return et(!0);let t=xo(e);for(let r of Object.values(e.defaultStyle))if(r!=null)for(let n of r.geometryAnchors){let i=t(n.floorId,n.geometryId);if(i.isErr())return i}return et(!0)},"validateDefaultStyle");var _j=D.Intersect([Gv(),gu,D.Object({altitude:D.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:D.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:D.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:D.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:D.Number({description:"The buffer amount to apply to the geometry, in meters. This can be used to inflate line string geometry for walls, but might also be applicable as a way to grow or shrink polygon geometry for aesthetic purposes. Can be negative."}),hidden:D.Optional(D.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),Cj=D.Record(D.String(),D.Ref(_j),{$id:"DefaultStyleCollection",additionalProperties:!1}),cce=D.Object({defaultStyle:D.Ref(Cj)},{$id:"DefaultStyleSchema"}),wj={name:"ext:mvf-default-style",schema:cce,intoBundle:o(function*(e){e.defaultStyle!=null&&(yield{path:"default-style.json",contents:e.defaultStyle})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="default-style.json")return{defaultStyle:r(t)}},"fromBundle"),references:[_j,Cj],integrityCheck:Sj};g();g();g();g();var O_;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(O_||(O_={}));var Pj=o(e=>{if(e.floorStacks==null)return et(!0);let t=ki(e.floorStacks,n=>n.id,"floorStacks");if(t.isErr())return t;let r=mu(e);for(let n of e.floorStacks){for(let i of n.floors){let a=r(i);if(a.isErr())return a}if(n.defaultFloor!=null&&!n.floors.includes(n.defaultFloor))return nt({kind:O_.InvalidDefaultFloorError,properties:{floorStackId:n.id,floorId:n.defaultFloor}})}return et(!0)},"validateFloorStacks");var zv=Ri("fs","FloorStackId"),Ej=D.Intersect([D.Object({id:D.Ref(zv,{description:"The unique identifier for the floor stack."}),floors:D.Array(D.Ref(jr),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:D.Optional(D.Ref(jr,{description:"The default floor for the floor stack."}))}),Ga],{$id:"FloorStacksProperties"}),Mj=D.Array(D.Ref(Ej),{$id:"FloorStackCollection"}),pce=D.Object({floorStacks:D.Ref(Mj)},{$id:"FloorStackExtensionSchema"}),Tj="floor-stacks.json",Oj={name:"ext:floor-stacks",schema:pce,intoBundle:o(function*(e){e.floorStacks!=null&&(yield{path:Tj,contents:e.floorStacks})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===Tj)return{floorStacks:r(t)}},"fromBundle"),references:[zv,Ej,Mj],integrityCheck:Pj};g();g();var $v;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})($v||($v={}));var Lj=o(e=>{if(e.facade==null)return et(!0);if(e.floorStacks==null)return nt({kind:$v.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(i=>i.id)),r=xo(e),n=mu(e);for(let[i,a]of nn(e.facade)){if(a==null)continue;let u=n(i);if(u.isErr())return u;for(let c of a){let{floorStackId:f,geometryIds:m}=c;if(!t.has(f))return nt({kind:$v.UnknownFloorStackError,properties:{floorStackId:f}});for(let v of m){let x=r(i,v);if(x.isErr())return x}}}return et(!0)},"validateFacade");var Dj=D.Intersect([D.Object({floorStackId:D.Ref(zv)}),Ry],{$id:"Facade"}),fce=D.Object({facade:Bi(D.Record(jr,D.Array(D.Ref(Dj)),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),dce=/^facade\/(.*)\.json$/,Aj={name:"ext:facade",schema:fce,intoBundle:o(function*(e){if(e.facade!=null)for(let t of Zr(e.facade))yield{path:"facade/".concat(t,".json"),contents:e.facade[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(dce))==null?void 0:i[1];if(n)return{facade:{[n]:r(t)}}},"fromBundle"),references:[zv,Dj],integrityCheck:Lj};g();g();var Fj=o(e=>{if(e.floorImages==null)return et(!0);let t=xo(e);for(let[r,n]of nn(e.floorImages))if(n!=null)for(let i of n.features){if(!("geometryId"in i.properties))continue;let a=i.properties.geometryId,u=t(r,a);if(u.isErr())return u}return et(!0)},"validateFloorImages");var A4=D.Object({path:D.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:D.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:D.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:D.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),Nj=D.Intersect([D.Ref(A4),El],{$id:"AnchoredFloorImageProperties"}),Rj=D.Intersect([D.Ref(A4),D.Object({verticalOffset:D.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),kj=D.Union([Nj,Rj],{$id:"FloorImageProperties"}),Bj=cs(D.Ref(Os),kj,{$id:"FloorImageFeature"}),Gj=Ks(D.Ref(Bj),{$id:"FloorImageCollection"}),hce=D.Object({floorImages:Bi(D.Record(jr,D.Ref(Gj),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),mce=/^floorImages\/(.*)\.geojson$/,jj={name:"ext:floor-images",schema:hce,intoBundle:o(function*(e){if(e.floorImages!=null)for(let t of Zr(e.floorImages))yield{path:"floorImages/".concat(t,".geojson"),contents:e.floorImages[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(mce))==null?void 0:i[1];if(n)return{floorImages:{[n]:r(t)}}},"fromBundle"),references:[A4,Nj,Rj,kj,Bj,Gj],integrityCheck:Fj};g();g();var Uj=o(e=>{if(e.kinds==null)return et(!0);let t=xo(e);for(let[r,n]of nn(e.kinds))if(n!=null)for(let i of Zr(n)){let a=t(r,i);if(a.isErr())return a}return et(!0)},"validateKinds");var{values:Uxt,schema:gce,record:Vxt}=xa(["room","hallway","wall","object","poi","area","window"],{$id:"Kind"}),Vj=gce;var zj=Bi(D.Record(Ls,D.Ref(Vj),{additionalProperties:!1,$id:"GeometryKinds"})),yce=D.Object({kinds:Bi(D.Record(jr,D.Ref(zj),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),vce=/^kinds\/(.*)\.json$/,$j={name:"ext:kinds",schema:yce,intoBundle:o(function*(e){if(e.kinds!=null)for(let t of Zr(e.kinds))yield{path:"kinds/".concat(t,".json"),contents:e.kinds[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(vce))==null?void 0:i[1];if(n)return{kinds:{[n]:r(t)}}},"fromBundle"),references:[Vj,zj],integrityCheck:Uj};g();g();g();var L_;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(L_||(L_={}));var Hj=o(e=>{if(e.nodes==null)return et(!0);let t=ki(e.nodes,i=>i.properties.id,"nodes");if(t.isErr())return t;let r=xo(e),n=Vv(e);for(let[i,a]of nn(e.nodes)){if(a==null)continue;let u=new Set(a.features.map(c=>c.properties.id));for(let[c,f]of a.features.entries()){for(let m of f.properties.geometryIds){let v=r(i,m);if(v.isErr())return v}for(let[m,v]of f.properties.neighbors.entries()){if(!u.has(v.id))return nt({kind:L_.UnknownNeighbor,properties:{floorId:i,nodeId:f.properties.id,neighborId:v.id}});let x=Vy(v.flags,n,'nodes["'.concat(i,'"].features[').concat(c,"].properties.neighbors[").concat(m,"]"));if(x.isErr())return x}}}return et(!0)},"validateNodes");var F4=Ri("n","NodeId"),Wj=D.Intersect([D.Object({id:D.Ref(F4,{description:"The unique identifier for the node."}),extraCost:D.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),L4],{$id:"NodeNeighbor"}),qj=D.Intersect([D.Object({id:D.Ref(F4,{description:"The unique identifier for the node."}),neighbors:D.Array(D.Ref(Wj),{description:"The neighbors of the node."})}),Ry],{$id:"NodeProperties"}),Yj=cs(D.Ref(Os),qj,{$id:"NodeFeature"}),Xj=Ks(D.Ref(Yj),{$id:"NodeCollection"}),xce=D.Object({nodes:Bi(D.Record(jr,D.Ref(Xj),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),bce=/^nodes\/(.*)\.json$/,Zj={name:"ext:nodes",schema:xce,intoBundle:o(function*(e){if(e.nodes!=null)for(let t of Zr(e.nodes))yield{path:"nodes/".concat(t,".json"),contents:e.nodes[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(bce))==null?void 0:i[1];if(n)return{nodes:{[n]:r(t)}}},"fromBundle"),references:[F4,Wj,qj,Yj,Xj],integrityCheck:Hj};g();g();g();var D_;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(D_||(D_={}));var Kj=o(e=>{if(e.outdoors==null)return et(!0);let t=mu(e);for(let r of e.outdoors.floors){let n=t(r);if(n.isErr())return n;if(e.floorStacks!=null){for(let i of e.floorStacks)if(i.floors.includes(r))return nt({kind:D_.FloorInFloorStackError,properties:{floorId:r,floorStackId:i.id}})}}return et(!0)},"validateOutdoors");var Qj=D.Object({floors:D.Array(D.Ref(jr),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),Ice=D.Object({outdoors:D.Ref(Qj)},{$id:"OutdoorsExtensionSchema"}),Jj="outdoors.json",eU={name:"ext:outdoors",schema:Ice,intoBundle:o(function*(e){e.outdoors!=null&&(yield{path:Jj,contents:e.outdoors})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===Jj)return{outdoors:r(t)}},"fromBundle"),references:[Qj],integrityCheck:Kj};g();g();g();var A_;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(A_||(A_={}));var tU=o(e=>{if(e.tileset==null)return et(!0);let t=new Set;if(t.add(e.tileset.default.key),e.tileset.others)for(let r of e.tileset.others){if(t.has(r.key))return nt({kind:A_.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return et(!0)},"validateTilesets");var N4=D.Object({key:D.String({minLength:1,description:"Unique identifier for the tileset style."}),name:D.String({minLength:1,description:"Display name of the tileset style."}),url:D.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),rU=D.Object({default:D.Ref(N4,{description:"The default tileset style, which should be used."}),others:D.Optional(D.Array(D.Ref(N4,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),Sce=D.Object({tileset:D.Ref(rU)},{$id:"TilesetExtensionSchema"}),nU={name:"ext:mvf-tileset",schema:Sce,intoBundle:o(function*(e){e.tileset!=null&&(yield{path:"tileset.json",contents:e.tileset})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="tileset.json")return{tileset:r(t)}},"fromBundle"),references:[N4,rU],integrityCheck:tU};g();var iU=D.Object({},{$id:"WalkableProperties"}),oU=D.Object({},{$id:"NonWalkableProperties"}),sU=Bi(D.Record(Ls,D.Ref(iU),{$id:"WalkableGeometries",additionalProperties:!1})),aU=Bi(D.Record(Ls,D.Ref(oU),{$id:"NonWalkableGeometries",additionalProperties:!1})),_ce=D.Object({walkable:Bi(D.Record(jr,D.Ref(sU),{additionalProperties:!1})),nonwalkable:Bi(D.Record(jr,D.Ref(aU),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),Cce=/^walkable\/(.*)\.json$/,wce=/^nonwalkable\/(.*)\.json$/,lU={name:"ext:mvf-traversability",schema:_ce,intoBundle:o(function*(e){if(e.walkable!=null)for(let t of Zr(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of Zr(e.nonwalkable))yield{path:"nonwalkable/".concat(t,".json"),contents:e.nonwalkable[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var a,u;let n=(a=e.match(Cce))==null?void 0:a[1];if(n!=null)return{walkable:{[n]:r(t)}};let i=(u=e.match(wce))==null?void 0:u[1];if(i!=null)return{nonwalkable:{[i]:r(t)}}},"fromBundle"),references:[iU,oU,sU,aU]};g();g();function uU(e){return e.replace(/^g_/,"s_")}o(uU,"toSpaceId");function Pce(e){return e.replace(/^g_/,"o_")}o(Pce,"toObstructionId");function Tce(e){return e.replace(/^g_/,"w_")}o(Tce,"toWindowId");function cU(e){return e.replace(/^loci_/,"eli_")}o(cU,"convertLocationInstanceId");function Wv(e){return e.replace(/^loc_/,"el_")}o(Wv,"convertLocationId");function F_(e){return e.replace(/^lcat_/,"ec_")}o(F_,"convertLocationCategoryId");function Ece(e){return e.replace(/^g_/,"ar_")}o(Ece,"convertAreaId");function Mce(e,t,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],i=0,a=e.geometry.type.replace("Multi","");for(let u of e.geometry.coordinates)n.push(Ie(Y({},e),{geometry:{type:a,coordinates:u},properties:Ie(Y({},e.properties),{id:"".concat(t,"-").concat(i++),kind:r})}));return n}default:return[Ie(Y({},e),{properties:Ie(Y({},e.properties),{id:t,kind:r})})]}}o(Mce,"splitMultiPartGeometryFeatureWithNewId");function Hv(e,t,r,n){let i=new Map;for(let{feature:a,floorId:u}of e){let c=a.properties.id,f=n.get(c);if(t.has(c)){let m=Mce(a,r(c),f),v=m.map(I=>I.properties.id),x=v.map(I=>({geometryId:I,floorId:u}));i.set(c,{ids:v,features:m,anchors:x})}}return i}o(Hv,"mapGeometryToOtherIds");function pU(e){var f,m,v;let t={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!e.geometry)return t;let r=new Map(Object.values((f=e.kinds)!=null?f:{}).filter(x=>x!==void 0).flatMap(nn)),n=nn(e.geometry).flatMap(([x,I])=>{var C;return((C=I==null?void 0:I.features)!=null?C:[]).map(T=>({feature:T,floorId:x}))}).flat(),i=new Set(Object.values((m=e.walkable)!=null?m:{}).filter(x=>x!==void 0).flatMap(Zr)),a=new Set(Object.values((v=e.nonwalkable)!=null?v:{}).filter(x=>x!==void 0).flatMap(Zr)),u=new Set(Array.from(r.entries()).filter(([x,I])=>I==="area").map(([x])=>x)),c=new Set(Array.from(r.entries()).filter(([x,I])=>I==="window").map(([x])=>x));return i.size>0&&(t.space=Hv(n,i,uU,r)),a.size>0&&(t.obstruction=Hv(n,a,Pce,r)),u.size>0&&(t.area=Hv(n,u,Ece,r)),c.size>0&&(t.window=Hv(n,c,Tce,r)),i.size===0&&a.size===0&&u.size===0&&(t.space=Hv(n,new Set(n.map(x=>x.feature.properties.id)),uU,r)),t}o(pU,"createGeometryMaps");function fU(e){var c;let{nodesByGeometryId:t,incomingEdgesByNodeId:r}=Oce(e),n=pU(e),i=Lce(e),a=(c=e.navigationFlags)!=null?c:{};return{geometryMaps:n,nodesByGeometryId:t,geometryFeatureById:i,navigationFlags:a,incomingEdgesByNodeId:r}}o(fU,"buildBuilderOptions");function Oce(e){var n,i,a;let t=new Map,r=new Map;for(let u of Object.values((n=e.nodes)!=null?n:{}))for(let c of(i=u==null?void 0:u.features)!=null?i:[]){if(c.properties.geometryIds.length>0)for(let f of c.properties.geometryIds){let m=(a=t.get(f))!=null?a:[];m.push(c.properties.id),t.set(f,m)}if(c.properties.neighbors.length>0)for(let f of c.properties.neighbors){let m=r.get(f.id);m!=null?m.push(f):r.set(f.id,[f])}}return{nodesByGeometryId:t,incomingEdgesByNodeId:r}}o(Oce,"buildNodeMaps");function Lce(e){var r,n;let t=new Map;for(let i of Object.values((r=e.geometry)!=null?r:{}))for(let a of(n=i==null?void 0:i.features)!=null?n:[])t.set(a.properties.id,a);return t}o(Lce,"buildGeometryFeatureById");g();function dU(e,t){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let r={};for(let[n,i]of nn(e.annotations)){if(!i||i.length===0||!e.geometry[n]||e.geometry[n].features.length===0)continue;let a=new Map(e.geometry[n].features.map(c=>[c.properties.id,c])),u={type:"FeatureCollection",features:[]};for(let c of i){let f=a.get(c.geometryId);if(!f||f.geometry.type!=="Point")continue;let m={id:c.id,externalId:c.externalId,symbolId:c.symbolKey};u.features.push({type:"Feature",geometry:f.geometry,properties:m})}r[n]=u}return{annotation:r}}o(dU,"buildAnnotations");g();function hU(e,{nodesByGeometryId:t}){var u,c,f,m,v,x,I;let r={"connection.json":[],entrance:{}},n=(u=e.navigationFlags)==null?void 0:u[O4.accessible],i=(c=e.navigationFlags)==null?void 0:c[O4.outdoors],a=new Map(Object.values((f=e.geometry)!=null?f:{}).flatMap(C=>{var T;return(T=C==null?void 0:C.features)!=null?T:[]}).map(C=>[C.properties.id,C]));for(let C of(m=e.connections)!=null?m:[]){if(R4(C,a)){let L=Dce(C,a,t,i);for(let[A,M]of L)r.entrance[A]||(r.entrance[A]={type:"FeatureCollection",features:[]}),r.entrance[A].features.push(M);continue}let T=n!=null&&C.entrances.some(L=>Qf(L,n))&&C.exits.some(L=>Qf(L,n)),O=Array.from(new Set([...C.entrances.map(L=>t.get(L.geometryId)),...C.exits.map(L=>t.get(L.geometryId))].flat().filter(L=>L!=null))),P={id:C.id,externalId:(x=(v=C.details)==null?void 0:v.externalId)!=null?x:"",type:C.type,accessible:T,nodes:O};(I=C.details)!=null&&I.name&&(P.details={name:C.details.name}),C.extra&&(P.extra=C.extra),r["connection.json"].push(P)}return r}o(hU,"buildConnections");function R4(e,t){return e.type==D4.door&&e.entrances.every(r=>{let n=t.get(r.geometryId);return(n==null?void 0:n.geometry.type)==="LineString"})}o(R4,"isLineDoor");function Dce(e,t,r,n){var a,u;if(e.type!==D4.door)return[];let i=[];for(let c of e.entrances){let f=t.get(c.geometryId);if((f==null?void 0:f.geometry.type)==="LineString"){let m={type:"Feature",geometry:f.geometry,properties:{id:e.id,externalId:(u=(a=e.details)==null?void 0:a.externalId)!=null?u:"",isExterior:Ace(e,n)}},v=e.details;v&&(m.properties.details={name:v.name,description:v.description},v.icon&&(m.properties.details.images=[{url:v.icon,altText:"".concat(v.name," icon")}]));let x=r.get(c.geometryId);x&&x.length>0&&(m.properties.node=x[0]),i.push([c.floorId,m])}}return i}o(Dce,"buildEntranceFeaturesFromConnection");function Ace(e,t){return e.entrances.some(r=>Qf(r,t))||e.exits.some(r=>Qf(r,t))}o(Ace,"isExterior");g();function gU(e,{geometryMaps:t,nodesByGeometryId:r}){var M,N,B,H,z,R,X,ie,Q,U,Te,oe,fe,se,ve,ue,he,Z,Ke,Ue,rt,Ee,We,St,yt,pt,te,ce,ee,be,Me,Fe,it,xt,Bt,pn,Xe,Gt,Yi,Gi,Po,Zn,Ge,aa,xs,ut,To,Ca;let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"English",code:"en"},languages:[]}},i=(M=e.manifest)==null?void 0:M.features[0];i&&(n.venue.defaultFloor=i.properties.defaultFloor,n.venue.tzid=i.properties.tzid,n.venue.name=i.properties.name,n.venue.defaultLanguage={name:(N=i.properties.language)!=null?N:"English",code:(B=i.properties.language)!=null?B:"en"});let a=(H=e.cms)==null?void 0:H.venue;a&&(n.venue=Ie(Y({},n.venue),{slug:a.slug,name:(X=(R=(z=a.details)==null?void 0:z.name)!=null?R:n.venue.name)!=null?X:i.properties.name,externalId:(Q=(ie=a.details)==null?void 0:ie.externalId)!=null?Q:"",defaultLanguage:a.defaultLanguage,languages:(U=a.languages)!=null?U:[],countrycode:a.countrycode,coverImage:a.coverImage,logo:a.logo,icon:(Te=a.details)==null?void 0:Te.icon,extra:a.extra,mappedinWebUrl:a.mappedinWebUrl,operationHours:a.operationHours,topLocations:a.topLocations}));let u=new Map,c=(oe=e.locations)!=null?oe:[],f=(se=(fe=e.cms)==null?void 0:fe.locations)!=null?se:[],m=(ue=(ve=e.cms)==null?void 0:ve.categories)!=null?ue:[],v=new Map((m!=null?m:[]).map(Ht=>[Ht.categoryId,Ht]));if(c.length>0){let Ht=new Map(f.map(ot=>[ot.locationId,ot]));for(let ot of c){let qe=(he=Ht.get(ot.id))!=null?he:{};if(ot){let It=ot.details,Ct={id:(qe==null?void 0:qe.cmsId)!==void 0?"el_".concat(qe==null?void 0:qe.cmsId):Wv(ot.id),name:It.name,externalId:(Z=It.externalId)!=null?Z:"",type:(Ke=qe.type)!=null?Ke:"location",sortOrder:(Ue=qe.sortOrder)!=null?Ue:0,amenity:qe.amenity,description:It.description,extra:ot.extra,links:ot.links,operationHours:ot.openingHours,gallery:qe.gallery,logo:ot.logo,shortName:It.shortName,picture:qe.picture,showFloatingLabelWhenImagePresent:qe.showFloatingLabelWhenImagePresent,showLogo:qe.showLogo,siblingGroups:qe.siblingGroups,states:qe.states,tags:qe.tags,spaces:[],nodes:[],polygons:[]};if(ot.phone&&(Ct.phone={number:ot.phone}),qe.primaryCategory){let Mt=v.get(qe.primaryCategory);Mt&&(Ct.primaryCategory=Mt.id)}let Nt=mU(ot.social);ot.website&&(Nt.website=ot.website.url),Ct.social=Nt;for(let Mt of ot.geometryAnchors){let Dt=t.space.get(Mt.geometryId);if(Dt){let Tn=new Set(Dt.features.filter(Le=>Le.geometry.type==="Polygon").map(Le=>Le.properties.id));for(let Le of Dt.anchors)Ct.spaces.push({floor:Le.floorId,id:Le.geometryId}),Tn.has(Le.geometryId)&&Ct.polygons.push({map:Le.floorId,id:Le.geometryId})}let xi=r.get(Mt.geometryId);for(let Tn of xi!=null?xi:[])Ct.nodes.push({map:Mt.floorId,id:Tn})}n.locations.push(Ct);for(let Mt of ot.categories)u.set(Mt,[...(rt=u.get(Mt))!=null?rt:[],ot.id])}}}let x=(We=(Ee=e.cms)==null?void 0:Ee.locationInstances)!=null?We:[],I=e.locationInstances;if(I){let Ht=new Map(x.map(qe=>[qe.locationInstanceId,qe])),ot=[];for(let qe of I){let It=(St=Ht.get(qe.id))!=null?St:{};if(qe){let Ct={id:cU(qe.id),parent:(yt=It.parentId)!=null?yt:Wv(qe.parentId),name:(pt=qe.details)==null?void 0:pt.name,externalId:(te=qe.details)==null?void 0:te.externalId,type:It.type,sortOrder:It.sortOrder,amenity:It.amenity,description:(ce=qe.details)==null?void 0:ce.description,extra:qe.extra,links:qe.links,operationHours:qe.openingHours,gallery:It.gallery,picture:It.picture,showFloatingLabelWhenImagePresent:It.showFloatingLabelWhenImagePresent,showLogo:It.showLogo,siblingGroups:It.siblingGroups,states:It.states,tags:It.tags,logo:qe.logo,shortName:(ee=qe.details)==null?void 0:ee.shortName};qe.phone&&(Ct.phone={number:qe.phone});let Nt=mU((be=qe.social)!=null?be:[]);if(qe.website&&(Nt.website=qe.website.url),Object.keys(Nt).length>0&&(Ct.social=Nt),(Me=qe.geometryAnchors)!=null&&Me.length){let Mt=qe.geometryAnchors.flatMap(Dt=>{var xi,Tn;return(Tn=(xi=t.space.get(Dt.geometryId))==null?void 0:xi.anchors)!=null?Tn:[]});Mt.length>0&&(Ct.spaces=Mt.map(Dt=>({floor:Dt.floorId,id:Dt.geometryId})))}if(qe.geometryAnchors){Ct.spaces=[],Ct.polygons=[],Ct.nodes=[];for(let Mt of qe.geometryAnchors){let Dt=t.space.get(Mt.geometryId);if(Dt){let Tn=new Set(Dt.features.filter(Le=>Le.geometry.type==="Polygon").map(Le=>Le.properties.id));for(let Le of Dt.anchors)Ct.spaces.push({floor:Le.floorId,id:Le.geometryId}),Tn.has(Le.geometryId)&&Ct.polygons.push({map:Le.floorId,id:Le.geometryId})}let xi=r.get(Mt.geometryId);for(let Tn of xi!=null?xi:[])Ct.nodes.push({map:Mt.floorId,id:Tn})}}ot.push(Ct)}}ot.length>0&&(n.locationInstances=ot)}let C=e.locationCategories;if(C){let Ht=[],ot=new Map(C.map(Nt=>[Nt.id,Nt])),qe=new Map((m!=null?m:[]).map(Nt=>[Nt.categoryId,Nt])),It=new Map;for(let Nt of C){let Mt=ot.get(Nt.parent);if(Mt){let Dt=(Fe=It.get(Mt.id))!=null?Fe:[];Dt.push(Nt.id),It.set(Mt.id,Dt)}}for(let Nt of C){let Mt=qe.get(Nt.id);if(Nt){let Dt=((it=It.get(Nt.id))!=null?it:[]).map(F_),xi={id:F_(Nt.id),name:Nt.details.name,externalId:(xt=Nt.details.externalId)!=null?xt:"",sortOrder:(Bt=Mt==null?void 0:Mt.sortOrder)!=null?Bt:0,children:Dt,locations:((pn=u.get(Nt.id))!=null?pn:[]).map(Wv),icon:Nt.details.icon,picture:Mt==null?void 0:Mt.picture,color:Mt==null?void 0:Mt.color,extra:Nt.extra,iconFromDefaultList:Mt==null?void 0:Mt.iconFromDefaultList};Ht.push(xi)}}n.categories=Ht;let Ct={};for(let Nt of c)Ct[Wv(Nt.id)]=Nt.categories.map(F_).filter(Mt=>Mt!==void 0);n.categoryPriorities=Ct}let T={};for(let[Ht,ot]of Object.entries((Xe=e.defaultStyle)!=null?Xe:{}))if(ot.buffer){let qe=ot.geometryAnchors.flatMap(It=>{var Ct,Nt;return(Nt=(Ct=t.space.get(It.geometryId))==null?void 0:Ct.anchors)!=null?Nt:[]});T[Ht]={edgeOffset:ot.buffer,geometryAnchors:qe}}Object.keys(T).length>0&&(n.enterpriseStyles=T);let O=new Map;for(let Ht of Object.values((Yi=(Gt=e.cms)==null?void 0:Gt.layers)!=null?Yi:{}))if(Ht)for(let[ot,qe]of nn(Ht)){if(typeof qe!="string")continue;let It=(Gi=O.get(qe))!=null?Gi:{name:qe,id:"ely_".concat(qe),spaces:[]};It.spaces.push(...(Zn=(Po=t.space.get(ot))==null?void 0:Po.anchors.map(Ct=>({floorId:Ct.floorId,spaceId:Ct.geometryId})))!=null?Zn:[]),O.set(qe,It)}O.size>0&&(n.layers=Array.from(O.values()));let P=[];for(let Ht of Object.values((aa=(Ge=e.cms)==null?void 0:Ge.textures)!=null?aa:{}))for(let ot of Ht){let qe=(xs=t.space.get(ot.geometryId))==null?void 0:xs.anchors;!qe||qe.length<1||ot.face==="unknown"||ot.surface==="unknown"||P.push({repeat:ot.repeat,offset:ot.offset,rotation:ot.rotation,path:ot.path,face:ot.face,surface:ot.surface,bounds:ot.bounds,geometryAnchors:qe})}P.length>0&&(n.textures=P);let L={};for(let[Ht,ot]of Object.entries((To=(ut=e.cms)==null?void 0:ut.floorText)!=null?To:{})){let qe={type:"FeatureCollection",features:[]};for(let It of ot.features){if(It.properties.align==="unknown")continue;let Ct={align:It.properties.align,color:It.properties.color,fontFamily:It.properties.fontFamily,fontSize:It.properties.fontSize,rotation:It.properties.rotation,text:It.properties.text,visible:It.properties.visible};"geometryId"in It.properties?Ct.geometryId=It.properties.geometryId:Ct.verticalOffset=It.properties.verticalOffset,qe.features.push({type:"Feature",geometry:It.geometry,properties:Ct})}qe.features.length>0&&(L[Ht]=qe)}Object.keys(L).length>0&&(n.floorText=L);let A={enterprise:n};if((Ca=e.cms)!=null&&Ca.textAreas){let Ht={};for(let[ot,qe]of nn(e.cms.textAreas)){let It={type:"FeatureCollection",features:[]};for(let Ct of qe.features){if(Ct.properties.align==="unknown")continue;let Nt={align:Ct.properties.align,maxWidth:Ct.properties.maxWidth,maxHeight:Ct.properties.maxHeight,rotation:Ct.properties.rotation};"geometryId"in Ct.properties?Nt.anchorId=Ct.properties.geometryId:Nt.verticalOffset=Ct.properties.verticalOffset;let Mt={type:"Feature",geometry:Ct.geometry,properties:Nt};It.features.push(Mt)}Ht[ot]=It}A.textAreas=Ht}return A}o(gU,"buildEnterprise");var Fce=["facebook","instagram","twitter"];function mU(e){let t={};for(let{name:r,url:n}of e){let i=r.toLowerCase();Fce.includes(i)&&(t[i]=n)}return t}o(mU,"convertSocials");g();var Nce=o(e=>"fc_".concat(e.slice(3)),"convertFloorStackIdToFacadeId");function yU(e,{geometryMaps:t}){var i;if(!e.facade)return{};let r={},n={};for(let[a,u]of nn(e.facade))if(u)for(let c of Object.values(u)){let{floorStackId:f,geometryIds:m}=c,v=Nce(f);(i=n[f])!=null||(n[f]={id:v,spaces:[]}),n[f].spaces.push(...m.map(x=>{var I,C;return{floorId:a,spaceId:(C=(I=t.space.get(x))==null?void 0:I.ids[0])!=null?C:""}}))}return Object.keys(n).length>0&&(r.facade=n),r}o(yU,"buildFacade");g();function vU(e,t={}){var i,a,u,c,f,m,v,x,I,C,T,O;let r={type:"FeatureCollection",features:[]},n=[];for(let P of e.floors.features)n.push({id:P.properties.id.replace(/^f_/,"m_"),externalId:(a=(i=P.properties.details)==null?void 0:i.externalId)!=null?a:"",elevation:P.properties.elevation,name:(c=(u=P.properties.details)==null?void 0:u.name)!=null?c:"",shortName:(m=(f=P.properties.details)==null?void 0:f.shortName)!=null?m:"",subtitle:P.properties.subtitle}),r.features.push({type:"Feature",geometry:P.geometry,properties:{id:P.properties.id,externalId:(x=(v=P.properties.details)==null?void 0:v.externalId)!=null?x:"",elevation:P.properties.elevation,name:(C=(I=P.properties.details)==null?void 0:I.name)!=null?C:"",shortName:(O=(T=P.properties.details)==null?void 0:T.shortName)!=null?O:"",subtitle:P.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}o(vU,"buildFloors");g();function xU(e,{geometryMaps:t}){var i,a,c,f,m;let r={},n={};for(let[v,x]of nn((i=e.floorImages)!=null?i:{})){let I={features:[],type:"FeatureCollection"};for(let C of(a=x==null?void 0:x.features)!=null?a:[])if("verticalOffset"in C.properties)I.features.push(C);else{let u=C.properties,{geometryId:T}=u,O=is(u,["geometryId"]),P=(m=(c=t.space.get(T))==null?void 0:c.ids[0])!=null?m:(f=t.obstruction.get(T))==null?void 0:f.ids[0];if(!P)continue;let L={geometry:C.geometry,properties:Ie(Y({},O),{anchorId:P}),type:C.type};I.features.push(L)}n[v]=I}return Object.keys(n).length>0&&(r.floorImages=n),r}o(xU,"buildFloorImages");g();function bU(e,t={}){var i,a,u,c,f,m,v;let r=[];for(let x of(i=e==null?void 0:e.floorStacks)!=null?i:[]){let I={id:x.id,floors:x.floors,maps:x.floors,externalId:(u=(a=x.details)==null?void 0:a.externalId)!=null?u:"",name:(f=(c=x.details)==null?void 0:c.name)!=null?f:"",shortName:(v=(m=x.details)==null?void 0:m.shortName)!=null?v:"",type:"Building"};x.defaultFloor&&(I.defaultFloor=x.defaultFloor),r.push(I)}if(e.outdoors){let x={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(x)}return{"floorstack.json":r,"mapstack.geojson":r}}o(bU,"buildFloorStacks");g();g();var _U=Mn(SU(),1);var jce=o(e=>{let t=e.geometry.coordinates[0],r=0;for(let n=0;n<t.length-1;n++)r+=t[n][0]*t[n+1][1]-t[n+1][0]*t[n][1];return Math.abs(r/2)},"calculateArea"),Uce=o((e,t)=>{let[r,n]=e,i=t.geometry.coordinates[0],a=!1;for(let u=0,c=i.length-1;u<i.length;c=u++){let[f,m]=i[u],[v,x]=i[c];m>n!=x>n&&r<(v-f)*(n-m)/(x-m)+f&&(a=!a)}return a},"pointInPolygon"),Vce=o(e=>{let t=e.geometry.coordinates[0],r=0,n=0;for(let i=0;i<t.length-1;i++)r+=t[i][0],n+=t[i][1];return{geometry:{coordinates:[r/(t.length-1),n/(t.length-1)]}}},"calculateCenterOfMass"),zce=o(e=>{let t=jce(e),r=Number.isFinite(t)?Math.max(t,1):1;return Math.sqrt(r)*1e-6},"estimatePrecision"),R_=o(e=>{try{let r=Vce(e).geometry.coordinates;if(!Uce(r,e)){let i=(0,_U.default)(e.geometry.coordinates,zce(e));return et([i[0],i[1]])}return et(r)}catch(t){return nt(new Error("Unable to calculate center of polygon"))}},"labelCenter");function B4(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Polygon"}o(B4,"isPolygonFeature");function CU(e,{geometryMaps:t,nodesByGeometryId:r}){var m,v,x,I,C,T,O,P,L;let n=Yce(e.defaultStyle),i={},a={},u={},c={};for(let A of Zr(e.geometry)){let M=e.geometry[A];if(!M)continue;let N=[],B=[],H=[],z=[];for(let R of M.features){let X=R.properties.id,ie=n.has(X),Q=(m=r.get(X))!=null?m:[];for(let U of(x=(v=t.space.get(X))==null?void 0:v.features)!=null?x:[])N.push($ce(U,Q));for(let U of(C=(I=t.obstruction.get(X))==null?void 0:I.features)!=null?C:[])B.push(Hce(U,ie));for(let U of(O=(T=t.area.get(X))==null?void 0:T.features)!=null?O:[])H.push(Wce(U,Q));for(let U of(L=(P=t.window.get(X))==null?void 0:P.features)!=null?L:[])z.push(qce(U))}N.length>0&&(i[A]={type:"FeatureCollection",features:N.filter(R=>R!==null)}),B.length>0&&(a[A]={type:"FeatureCollection",features:B.filter(R=>R!==null)}),H.length>0&&(u[A]={type:"FeatureCollection",features:H.filter(R=>R!==null)}),z.length>0&&(c[A]={type:"FeatureCollection",features:z.filter(R=>R!==null)})}let f={space:i,obstruction:a};return Object.keys(u).length>0&&(f.area=u),Object.keys(c).length>0&&(f.window=c),f}o(CU,"buildGeometry");function $ce(e,t){var n,i;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let r={type:"Feature",geometry:e.geometry,properties:{destinationNodes:t,id:e.properties.id,externalId:(i=(n=e.properties.details)==null?void 0:n.externalId)!=null?i:"",kind:e.properties.kind}};return e.properties.details&&(r.properties.details={name:e.properties.details.name,description:e.properties.details.description,images:e.properties.details.icon?[{url:e.properties.details.icon,altText:e.properties.details.name?"".concat(e.properties.details.name," icon"):"icon"}]:void 0}),B4(r)&&(r.properties.center=R_(r).unwrapOr(void 0)),r}o($ce,"buildSpace");function Hce(e,t){var i,a;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(a=(i=r.details)==null?void 0:i.externalId)!=null?a:"",entrances:[],kind:r.kind,footprintComponent:t}};return B4(n)&&(n.properties.center=R_(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}o(Hce,"buildObstruction");function Wce(e,t){var i,a;if(e.geometry.type!=="Polygon")return null;let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(a=(i=r.details)==null?void 0:i.externalId)!=null?a:"",destinationNodes:t}};return B4(n)&&(n.properties.center=R_(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}o(Wce,"buildArea");function qce(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}o(qce,"buildWindow");function Yce(e){var n,i,a,u;let t=[...(i=(n=e==null?void 0:e.ExteriorWalls)==null?void 0:n.geometryAnchors)!=null?i:[],...(u=(a=e==null?void 0:e.Walls)==null?void 0:a.geometryAnchors)!=null?u:[]];return new Set(t.map(c=>c.geometryId))}o(Yce,"calculateFootprintGeometry");g();function wU(e,{geometryMaps:t,geometryFeatureById:r}){var i,a,u,c,f,m,v,x,I,C,T,O,P;if(!e.locationCategories&&!e.locations)return{};let n={};if((i=e.locationCategories)!=null&&i.length){let L=[];for(let A of e.locationCategories){let M={id:A.id,name:A.details.name,icon:(a=A.details.icon)!=null?a:""};A.parent&&(M.parent=A.parent),L.push(M)}n["category.json"]=L}if((u=e.locations)!=null&&u.length){let L=Xce(e,{geometryFeatureById:r}),A=[];for(let M of e.locations){let N={id:M.id,name:M.details.name,categories:M.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:M.links,openingHoursSpecification:(c=M.openingHours)!=null?c:[],pictures:M.images,social:M.social,description:M.details.description,externalId:M.details.externalId,icon:M.details.icon,logo:M.logo,phone:M.phone,website:M.website};A.push(N);for(let{geometryId:B,floorId:H}of M.geometryAnchors)N.spaces.push(...(m=(f=t.space.get(B))==null?void 0:f.ids.map(z=>({id:z,floor:H})))!=null?m:[]),N.obstructions.push(...(x=(v=t.obstruction.get(B))==null?void 0:v.ids.map(z=>({id:z,floor:H})))!=null?x:[]),N.areas.push(...(C=(I=t.area.get(B))==null?void 0:I.ids.map(z=>({id:z,floor:H})))!=null?C:[]),N.entrances.push(...(T=L.entrancesByGeometryId.get(B))!=null?T:[]),N.connections.push(...(O=L.connectionsByGeometryId.get(B))!=null?O:[]),N.annotations.push(...(P=L.annotationsByGeometryId.get(B))!=null?P:[])}n["location.json"]=A}return n}o(wU,"buildLocations");function Xce(e,{geometryFeatureById:t}){var n,i,a;let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(e.annotations)for(let[u,c]of nn(e.annotations))for(let f of c!=null?c:[]){let m=f.geometryId,v=f.id,x=(n=r.annotationsByGeometryId.get(m))!=null?n:[];x.push({floor:u,id:v}),r.annotationsByGeometryId.set(m,x)}if(e.connections)for(let u of e.connections){let c=R4(u,t),f=Array.from(new Map([...u.entrances,...u.exits].map(m=>["".concat(m.geometryId,"_").concat(m.floorId),m])).values());for(let m of f){let v=m.geometryId;if(c){let x=(i=r.entrancesByGeometryId.get(v))!=null?i:[];x.push({floor:m.floorId,id:u.id}),r.entrancesByGeometryId.set(v,x)}else{let x=(a=r.connectionsByGeometryId.get(v))!=null?a:[];x.push(u.id),r.connectionsByGeometryId.set(v,x)}}}return r}o(Xce,"buildLocationAttachmentMaps");g();function PU(e,t){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},i=e.manifest;if(i.features.length>0){let a=i.features[0],u=a.properties,c={type:"Feature",geometry:a.geometry,properties:{folder_struct:[],version:"2.0.0",time:u.time,name:u.name,naturalBearing:u.naturalBearing,tzid:u.tzid,map:u.mapId,org_id:u.orgId,language:u.language}};r.features.push(c)}return n}o(PU,"buildManifest");g();function TU(e,{geometryMaps:t,navigationFlags:r,incomingEdgesByNodeId:n}){var m,v,x,I,C,T,O,P,L,A,M,N,B,H,z,R;let i={"node.geojson":{type:"FeatureCollection",features:[]}},a=i["node.geojson"].features,u=new Map;for(let X of(v=(m=e.floors)==null?void 0:m.features)!=null?v:[])u.set(X.properties.id,X.properties.elevation);let c=new Map;for(let X of Object.values((x=e.nodes)!=null?x:{}))for(let ie of(I=X==null?void 0:X.features)!=null?I:[])for(let Q of ie.properties.geometryIds)c.set(Q,[...(C=c.get(Q))!=null?C:[],ie.properties.id]);let f=new Map;for(let X of(T=e.connections)!=null?T:[]){let ie=X.exits.map(Q=>{var U;return Ie(Y({},Q),{nodes:(U=c.get(Q.geometryId))!=null?U:[]})});for(let Q of X.entrances){let U=(O=c.get(Q.geometryId))!=null?O:[];for(let Te of U)for(let oe of ie){let fe=Math.abs(((P=u.get(Q.floorId))!=null?P:0)-((L=u.get(oe.floorId))!=null?L:0))*X.floorCostMultiplier,se=(A=f.get(Te))!=null?A:[];se.push(...oe.nodes.map(ve=>({id:ve,weight:fe+X.entryCost}))),f.set(Te,se)}}}for(let[X,ie]of nn((M=e.nodes)!=null?M:{}))for(let Q of(N=ie==null?void 0:ie.features)!=null?N:[]){let U=(B=t.space.get(Q.properties.geometryIds[0]))==null?void 0:B.features[0],Te=(U==null?void 0:U.geometry.type)==="Point"&&((H=U==null?void 0:U.properties.details)!=null&&H.externalId)?U.properties.details.externalId:"",oe=(z=n.get(Q.properties.id))!=null?z:[],fe=Object.keys(r!=null?r:{}),se=[];for(let ue of oe)for(let he of fe)Qf(ue,r[he])&&se.push(r[he]);let ve={type:"Feature",geometry:Q.geometry,properties:{id:Q.properties.id,floor:X,space:Q.properties.geometryIds.map(ue=>{var he;return(he=t.space.get(ue))==null?void 0:he.ids}).flat().filter(ue=>ue!==void 0),neighbors:[...Q.properties.neighbors.map(ue=>({id:ue.id,weight:ue.extraCost})),...(R=f.get(Q.properties.id))!=null?R:[]],map:X,externalId:Te,flags:se.length>0?Zce(se):void 0}};a.push(ve)}return i}o(TU,"buildNodes");function Zce(e){if(e==null||e.length===0)return;let t=new Array(Math.max(...e.map(r=>r.index))+1).fill(0);for(let r of e)t[r.index]|=1<<r.bit;return t}o(Zce,"buildFlagsArray");g();function Kce(e,t){var n;let r={};for(let i of e){let a=t.get(i);a&&((n=r[a])!=null||(r[a]=[]),r[a].push(i))}return r}o(Kce,"groupGeometryByType");function EU(e,{geometryMaps:t}){var u,c,f;if(!e.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let i=[...Array.from(t.space.values()).map(m=>m.features),...Array.from(t.obstruction.values()).map(m=>m.features)],a=new Map(i.flatMap(m=>m.map(v=>[v.properties.id,v.geometry.type])));for(let[m,v]of nn(e.defaultStyle)){let x=Kce(v.geometryAnchors.flatMap(I=>{var C,T,O,P;return[...(T=(C=t.space.get(I.geometryId))==null?void 0:C.ids)!=null?T:[],...(P=(O=t.obstruction.get(I.geometryId))==null?void 0:O.ids)!=null?P:[]]}),a);if(x.Point&&x.Point.length>0){let I={points:Array.from(x.Point.values()),showImage:((u=v.extra)==null?void 0:u.showImage)!==void 0?((c=v.extra)==null?void 0:c.showImage)===!0:v.opacity!==0};n["".concat(m,".Point")]=I}if(x.LineString&&x.LineString.length>0){let I={lineStrings:Array.from(x.LineString.values()),altitude:v.altitude,color:v.color,height:v.height,opacity:v.opacity,width:v.buffer};n["".concat(m,".LineString")]=I}if(x.Polygon&&x.Polygon.length>0){let I={polygons:Array.from(x.Polygon.values()),altitude:v.altitude,color:v.color,height:v.height,opacity:v.opacity};((f=v.extra)==null?void 0:f.showImage)!==void 0&&(I.showImage=v.extra.showImage===!0),n["".concat(m,".Polygon")]=I}}return r}o(EU,"buildStyles");var Jce=fG().extendOptional(hj).extendOptional(Zj).extendOptional(Ij).extendOptional($j).extendOptional(lU).extendOptional(wj).extendOptional(Oj).extendOptional(eU).extendOptional(nU).extendOptional(jj).extendOptional(Aj).extendOptional(gG).extendOptional(wG).extendOptional(uj).build({cspSafe:!0}).expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function MU(e){let t=fU(e),r=vU(e,t),n=CU(e,t),i=TU(e,t),a=hU(e,t),u=EU(e,t),c=bU(e,t),f=xU(e,t),m=yU(e,t),v=dU(e,t),x=wU(e,t),I=gU(e,t),C=PU(e,t);return Y(Y(Y(Y(Y(Y(Ie(Y(Y(Y(Y(Y(Y({},r),n),i),a),u),c),{"tileset.json":e.tileset}),f),m),v),x),I),C)}o(MU,"convertUnzippedStandardMVFv3ToParsedMVFv2");function G4(e){let t=Jce.decompressUnsafeSync(e);return t.isOk()?et(MU(t.value)):nt(t.error)}o(G4,"extractAndConvertMVFv3UnsafeSync");g();function zy(e){return e.endsWith("/")?e:"".concat(e,"/")}o(zy,"normalizeUrl");g();var $y="https://app.mappedin.com/",OU="https://auth.mappedin.com/";g();g();var Qce=o(e=>{let t=Date.now();return e-t},"fromNow"),k_=o((e,t)=>Qce(e)<=t*60*1e3,"shouldRefreshToken");var DU=60,AU=DU*60*1e3,LU="accessTokens";async function B_(e,t=!1){let r="".concat(e.key),n=Kc.getInstance(),i=(n==null?void 0:n.loadSessionData(LU))||{},a=Math.floor(Date.now()/1e3);if(i[r]&&!k_(i[r].expiresTimestamp*1e3,DU))return i[r];let u=t?await epe(e,a):await tpe(e,a),c=Ie(Y({},i),{[r]:u});return n==null||n.saveSessionData(LU,c),u}o(B_,"getAccessToken");async function epe(e,t){var a;let r="".concat((a=e.baseAuthUri)!=null?a:OU,"oauth2/token"),n=await xu()(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:e.key,client_secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:t+i.expires_in}}o(epe,"fetchAccessTokenEnterprise");async function tpe(e,t){let r="".concat(e.baseAuthUri?zy(e.baseAuthUri):$y,"api/api-key/token"),n=await xu()(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e.key,secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:t+i.expires_in}}o(tpe,"fetchAccessToken");g();var NU=60,RU=NU*60*1e3,FU="miSasTokens";async function j4(e,t){let r="".concat(t,"__").concat(e.mapId),n=Kc.getInstance(),i=(n==null?void 0:n.loadSessionData(FU))||{};if(i[r]&&!k_(i[r].expires,NU))return i[r];let a=await rpe(e,t),u=Ie(Y({},i),{[r]:{token:a.token,expires:new Date(a.expires).getTime()}});return n==null||n.saveSessionData(FU,u),a}o(j4,"getSasToken");async function rpe(e,t){let r="".concat(e.baseUri?zy(e.baseUri):$y,"api/v1/venue/").concat(e.mapId,"/sas-token"),n=await xu()(r,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{token:i.token,expires:new Date(i.expires).getTime()}}o(rpe,"fetchSasToken");var kU=globalThis.fetch,jU,npe=(jU=S==null?void 0:S.env)==null?void 0:jU.npm_package_version;function xu(){if(kU==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return kU}o(xu,"isomorphicFetch");var U4={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function UU(e){var r;let t=Y(Y({},U4),e);return t.headers=Ie(Y({},t.headers),{"mappedin-sdk-version":npe}),t.things=[],"platformString"in e&&(t.headers=Ie(Y({},t.headers),{"mappedin-platform-version":e.platformString})),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(r=t.language)==null?void 0:r.toLowerCase(),t}o(UU,"parseOptions");function ipe(e,t,r=!1){let n={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};r&&delete n.language;let{headers:i}=e;i["Content-Type"]=i["Content-Type"]||"text/json",e.accessToken?i.Authorization="Bearer ".concat(e.accessToken):e.noAuth||e.clientId&&e.clientSecret&&(i["x-mappedin-key"]=btoa(e.clientId),i["x-mappedin-secret"]=btoa(e.clientSecret));let a={method:"GET",headers:i};return e.secure&&(t+="&withcdntoken"),{req:a,url:t}}o(ipe,"constructParamsForRequest");async function ope(e,t,r=!1){let n=ipe(e,t,r),i=await xu()(n.url,n.req);if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}o(ope,"generateAPIRequest");var spe=o(e=>{let t=e!=null&&typeof e=="object"&&"perspectives"in e&&e.perspectives!=null&&typeof e.perspectives=="object"?e.perspectives:null;if(t==null||Object.keys(t).length===0)return ae.warn("No perspectives available in response!"),null;let r={};for(let[n,i]of Object.entries(t)){let a="url"in i&&typeof i.url=="string"?i.url:null,u="locale_packs"in i&&typeof i.locale_packs=="object"?i.locale_packs:null;if(a==null||u==null){ae.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}r[n]={url:a,locale_packs:u}}return r},"getPerspectivesFromResponse");async function ape(e,t="exports/mvf/1/bundle"){var m,v;let r=UU(Y(Y({baseUri:"https://api-gateway.mappedin.com/"},U4),e));r.mvfVersion==="3.0.0"&&(t="exports/mvf3/1/bundle");let n="".concat(r.baseUri+t,"?venue=").concat(r.venue,"&version=").concat((m=r.version)!=null?m:"2.0.0");r.headers["Content-Type"]="application/zip";let i=await ope(r,n),a=i.url,u=i.locale_packs,c=(v=r.perspective)!=null?v:U4.perspective,f=spe(i);if(c!=null&&c!==""&&f!=null){let x=f[c];x==null?ae.warn("Perspective ".concat(c," not found in response! Loading default perspective instead.")):(ae.log('Loading perspective "'.concat(c,'"')),a=x.url,u=x.locale_packs)}return{url:a,localePacks:u,updated_at:i.updated_at}}o(ape,"getVenueMVFURL");var Hy=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function V4(e,{signal:t}){let r=await(await xu()(e,{signal:t})).arrayBuffer();return new Uint8Array(r)}o(V4,"getLanguagePackUnitArray");async function qv(e){let r=(await import("./browser-M5OR7Q7D.js")).unzipSync(e),n={};if(r["enterprise/"]!=null){n.enterprise={};let i=r["enterprise/locations.json"];i&&(n.enterprise.locations=JSON.parse(Hy().decode(i)));let a=r["enterprise/locationInstances.json"];a&&(n.enterprise.locationInstances=JSON.parse(Hy().decode(a)));let u=r["enterprise/categories.json"];u&&(n.enterprise.categories=JSON.parse(Hy().decode(u)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(Hy().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(Hy().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(Hy().decode(r["manifest.json"]))),n}o(qv,"parseLanguagePack");async function VU(e,{signal:t}){try{let r=await(await xu()(e,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(r);return await qv(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}o(VU,"downloadLanguagePack");async function z4(e){return new Promise(async(t,r)=>{try{let n=e.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:i,localePacks:a}=await ape(e,n),u=await xu()(i).then(f=>f.arrayBuffer()),c=new Uint8Array(u);t({compressed:c,localePacks:a})}catch(n){r(n)}})}o(z4,"downloadVenueBundleMVFAPIGateway");async function $4(e,t){return new Promise(async(r,n)=>{try{let{url:i}=await lpe(e,t),a=await xu()(i).then(c=>c.arrayBuffer()),u=new Uint8Array(a);r(u)}catch(i){n(i)}})}o($4,"downloadMVF");async function lpe(e,t){let r=new URL("".concat(e.baseUri?zy(e.baseUri):$y,"api/venue/").concat(e.mapId,"/mvf"));e.viewId&&r.searchParams.set("configId",e.viewId),e.mvfVersion&&r.searchParams.set("version",e.mvfVersion);let n=await xu()(r.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}o(lpe,"getMakerBundleURL");function H4(e){var n,i,a,u,c,f,m,v,x,I,C,T,O,P,L,A,M,N;let t=new TextDecoder,r=t.decode.bind(t);try{let B={"connection.json":JSON.parse(r(e["connection.json"])),"manifest.geojson":JSON.parse(r(e["manifest.geojson"])),"map.geojson":e["map.geojson"]?JSON.parse(r(e["map.geojson"])):void 0,"mapstack.geojson":e["mapstack.geojson"]?JSON.parse(r(e["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(r(e["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":e["tileset.json"]?JSON.parse(r(e["tileset.json"])):void 0,"navigationFlags.json":e["navigationFlags.json"]?JSON.parse(r(e["navigationFlags.json"])):void 0};if(e.enterprise!=null&&(B.enterprise={},(n=e.enterprise)!=null&&n["locations.json"]&&(B.enterprise.locations=JSON.parse(r((i=e.enterprise)==null?void 0:i["locations.json"]))),(a=e.enterprise)!=null&&a["categories.json"]&&(B.enterprise.categories=JSON.parse(r((u=e.enterprise)==null?void 0:u["categories.json"]))),(c=e.enterprise)!=null&&c["venue.json"]&&(B.enterprise.venue=JSON.parse(r((f=e.enterprise)==null?void 0:f["venue.json"]))),(m=e.enterprise)!=null&&m["layers.json"]&&(B.enterprise.layers=JSON.parse(r((v=e.enterprise)==null?void 0:v["layers.json"]))),(x=e.enterprise)!=null&&x["locationInstances.json"]&&(B.enterprise.locationInstances=JSON.parse(r((I=e.enterprise)==null?void 0:I["locationInstances.json"]))),(C=e.enterprise)!=null&&C["enterpriseStyles.json"]&&(B.enterprise.enterpriseStyles=JSON.parse(r((T=e.enterprise)==null?void 0:T["enterpriseStyles.json"]))),(O=e.enterprise)!=null&&O["textures.json"]&&(B.enterprise.textures=JSON.parse(r((P=e.enterprise)==null?void 0:P["textures.json"]))),(L=e.enterprise)!=null&&L["floorText.json"]&&(B.enterprise.floorText=JSON.parse(r((A=e.enterprise)==null?void 0:A["floorText.json"]))),(M=e.enterprise)!=null&&M["categoryPriorities.json"]&&(B.enterprise.categoryPriorities=JSON.parse(r((N=e.enterprise)==null?void 0:N["categoryPriorities.json"])))),e["floorstack.json"]!=null?B["floorstack.json"]=JSON.parse(r(e["floorstack.json"])):e["mapstack.json"]!=null&&(B["mapstack.json"]=JSON.parse(r(e["mapstack.json"]))),B["floorstack.json"]==null&&B["mapstack.json"]==null&&B["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(e["floor.geojson"]&&(B["floor.geojson"]=JSON.parse(r(e["floor.geojson"]))),B["floor.geojson"]==null&&B["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in e&&(B["styles.json"]=JSON.parse(r(e["styles.json"]))),"shapes.json"in e&&(B["shapes.json"]=JSON.parse(r(e["shapes.json"]))),"location.json"in e&&(B["location.json"]=JSON.parse(r(e["location.json"]))),"category.json"in e&&(B["category.json"]=JSON.parse(r(e["category.json"]))),e.annotation!=null){B.annotation={};let z=Object.keys(e.annotation);for(let R of z){let X=R.replace(/\.json|\.geojson/g,"");B.annotation[X]=JSON.parse(r(e.annotation[R]))}}let H=Object.keys(e.space);for(let z of H){let R=z.replace(/\.json|\.geojson/g,"");B.space[R]=JSON.parse(r(e.space[z]))}if(e.obstruction!=null){let z=Object.keys(e.obstruction);for(let R of z){let X=R.replace(/\.json|\.geojson/g,"");B.obstruction[X]=JSON.parse(r(e.obstruction[R]))}}else B.obstruction={};if(e.entrance!=null){let z=Object.keys(e.entrance);for(let R of z){let X=R.replace(/\.json|\.geojson/g,"");B.entrance[X]=JSON.parse(r(e.entrance[R]))}}else B.entrance={};if("floorImages"in e&&e.floorImages!=null){B.floorImages={};for(let z of Object.keys(e.floorImages)){let R=z.replace(/\.json|\.geojson/g,"");B.floorImages[R]=JSON.parse(r(e.floorImages[z]))}}if("textAreas"in e&&e.textAreas!=null){B.textAreas={};for(let z of Object.keys(e.textAreas)){let R=z.replace(/\.json|\.geojson/g,"");B.textAreas[R]=JSON.parse(r(e.textAreas[z]))}}if("facade"in e&&e.facade!=null){B.facade={};for(let z of Object.keys(e.facade)){let R=z.replace(/\.json|\.geojson/g,"");B.facade[R]=JSON.parse(r(e.facade[z]))}}if("area"in e&&e.area!=null){B.area={};for(let z of Object.keys(e.area)){let R=z.replace(/\.json|\.geojson/g,"");B.area[R]=JSON.parse(r(e.area[z]))}}return B}catch(B){throw ae.error(B),new Error("MVF parsing failed! Probably encountered a bad file.")}}o(H4,"parseMVF");function upe(e){if(e==null||typeof e!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in e?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in e?"floorstack.json":"mapstack.json"in e?"mapstack.json":"mapstack.geojson"];"styles.json"in e&&t.push("styles.json"),"shapes.json"in e&&t.push("shapes.json");for(let r of t)if(e[r]==null||e[r][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}o(upe,"validateStaticMVFFiles");async function W4(e){return new Promise(async(t,r)=>{try{if(e==null||typeof e!="object")throw new Error("Error parsing data! Unzipping failed.");if(e[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let i=(await import("./browser-M5OR7Q7D.js")).unzipSync(e);if(!upe(i))throw new Error("MVF is missing some expect static files. Unzipping failed.");let a={},u=Object.keys(i);for(let c of u){if(i[c].length===0)continue;let f=c.split("/");if(f.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(f.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(f.length===1){a[f[0]]=i[c];continue}if(f[0]==="image"){ae.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else a[f[0]]==null&&(a[f[0]]={}),a[f[0]][f[1]]=i[c]}t(a)}catch(n){r(n)}})}o(W4,"unzipMVF");function Wy(){let e="us",t={};function r(){return dpe(mpe(e),t)}return o(r,"getState"),{updateByUserOption(n){var i,a;n.environment&&(e=n.environment),n.baseUri&&(t.baseUri=n.baseUri),n.baseAuthUri&&(t.baseAuthUri=n.baseAuthUri),(i=n.analytics)!=null&&i.baseUri&&(t.analyticsBaseUri=(a=n.analytics)==null?void 0:a.baseUri)},updateTileServerBaseUrl(n){t.tileServerUri=n},updateEnvironment(n){e=n},getBaseUri(n){return e==="us"&&n?BU.baseUri:r().baseUri},getBaseAuthUri(n=!1){return e==="us"&&n?BU.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){e="us",t={}},__getState:r}}o(Wy,"createEnvControl");var zU=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"}),BU=Object.freeze(Ie(Y({},zU),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),cpe=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"}),ppe=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"}),fpe=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 dpe(e,t){return Y(Y({},e),t)}o(dpe,"getAuthStateByEnvironment");var hpe={eu:cpe,us:zU,"us-staging-enterprise":ppe,"us-staging-self-serve":fpe};function mpe(e){return hpe[e]}o(mpe,"getEnvironmentAuthState");var q4=o(e=>{var r,n;let t=Object.values((n=(r=e["floorstack.json"])!=null?r:e["mapstack.json"])!=null?n:{});return t.length===1?[]:t.filter(i=>i.type!=="Outdoor").map(i=>i.id.replace("fs_","").replace("ms_",""))},"getBuildingIds"),GU=o(async e=>{let t=performance.now(),r=G4(e);return ae.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),r.inspectErr(i=>{throw ae.error(i),new Error("MVFv3 parsing failed!")}),r.unwrap()},"unzipAndParseMVFv3ToMVFv2");async function Y4(e,t="2.0.0"){switch(t){case"2.0.0":try{let r=await W4(e);return H4(r)}catch(r){return GU(e)}case"3.0.0":return GU(e);default:throw new Error("Unsupported MVF version: ".concat(t))}}o(Y4,"unzipAndParseMVFv2");g();g();g();g();g();g();g();g();var Xv,Zv,Kv,X4=class X4{constructor(t,r,{enabled:n=!1}={}){j(this,Xv);b(this,"searchInstance");j(this,Zv);j(this,Kv);b(this,"enabled",!1);$(this,Xv,t),$(this,Zv,r),$(this,Kv,()=>{var i;(i=this.searchInstance)==null||i.then(a=>a.populate())}),n&&this.enable()}async query(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return ae.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,r)}catch(n){return ae.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return ae.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,r)}catch(n){return ae.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-WXMWXAC3.js").then(({InternalSearch:t})=>new t(d(this,Xv)))),d(this,Zv).on("language-change",d(this,Kv)),await this.searchInstance)}};Xv=new WeakMap,Zv=new WeakMap,Kv=new WeakMap,o(X4,"Search");var Yv=X4;var $U=new WeakMap,Kh,oi,J4=class J4{constructor(t,{search:r}={}){j(this,Kh);j(this,oi);b(this,"Analytics");b(this,"Search");b(this,"Query");b(this,"internal");b(this,"on",o((t,r)=>{d(this,Kh).on(t,r)},"on"));b(this,"off",o((t,r)=>{d(this,Kh).off(t,r)},"off"));b(this,"__LEGACY_GET_DIRECTIONS_SYNC",o((t,r,n)=>d(this,oi).__LEGACY_GET_DIRECTIONS_SYNC(t,r,n),"__LEGACY_GET_DIRECTIONS_SYNC"));b(this,"getDirections",o((t,r,n)=>d(this,oi).getDirections(t,r,n),"getDirections"));b(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",o((t,r,n)=>d(this,oi).__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(t,r,n),"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC"));b(this,"getDirectionsMultiDestination",o((t,r,n)=>d(this,oi).getDirectionsMultiDestination(t,r,n),"getDirectionsMultiDestination"));$(this,Kh,new Rt),$(this,oi,t),$U.set(this,t),this.Analytics=new iv(t.Analytics),this.Query=t.Query,this.internal=t,this.Search=new Yv(this,t,{enabled:r==null?void 0:r.enabled}),d(this,oi).on("language-change",n=>{d(this,Kh).publish("language-change",n)})}getEnv(){return d(this,oi).getEnv()}getAccessToken(){var t;return(t=d(this,oi).tokenManager)==null?void 0:t.getAccessToken().token}get mapName(){return d(this,oi).mapName}get mapId(){var t;return(t=d(this,oi).getMapDataOptions)==null?void 0:t.mapId}get mapCenter(){return d(this,oi).mapCenter}get organizationId(){return d(this,oi).organizationId}get outdoorViewToken(){return d(this,oi).outdoorViewToken}getByType(t){return d(this,oi).getByType(t)}getById(t,r){return d(this,oi).getById(t,r)}getByExternalId(t,r){return d(this,oi).getByExternalId(t,r)}getGeoJSON(t){return t.geoJSON}async changeLanguage(t){return d(this,oi).changeLanguage(t)}get currentLanguage(){return d(this,oi).currentLanguage}get naturalBearing(){var t;return(t=d(this,oi).naturalBearing)!=null?t:0}getDistance(t,r){return d(this,oi).getDistance(t,r)}toBinaryBundle({downloadLanguagePacks:t=!0}={}){return d(this,oi).toBinaryBundle({downloadLanguagePacks:t})}toJSONBundle({downloadLanguagePacks:t=!0}={}){return d(this,oi).toJSONBundle({downloadLanguagePacks:t})}};Kh=new WeakMap,oi=new WeakMap,o(J4,"MapData");var Z4=J4,K4=Z4;function Jv(e){let t=$U.get(e);if(!t)throw new Error("MapDataInternal not found");return t}o(Jv,"getMapDataInternal");g();g();g();g();var gpe=1e-7;function Q4(e){return{type:"Point",coordinates:e}}o(Q4,"point");function ype(e,t){let{coordinates:r}=t.geometry,{coordinates:n}=e.geometry,i=r.map(a=>Qc(e,Q4(a)));return n.reduce((a,u)=>{let c=o2(Q4(u),i[0],e),f=o2(Q4(u),i[1],e),m=qd(c)<qd(f)?c:f;return m.properties=Ie(Y({},e.properties),{entrances:[]}),a.concat([m])},[])}o(ype,"splitObstructionByEntrance");function e5(e,t){return t.reduce((r,n)=>{let i={epsilon:gpe},a=r.obstructions.findIndex(c=>wg(qu(n),c,i)),u=r.obstructions[a];if(u){let[c,f]=ype(u,n);r.entrances.push(n),r.obstructions.splice(a,1,c,f)}return r},{obstructions:[e],entrances:[]})}o(e5,"findAndSplitObstructionByAllEntrances");g();g();g();g();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:o(function(){return this},"get"),configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var HU="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=";g();g();var xpe=!1;function WU(){return xpe}o(WU,"isTestMode");var t5=class t5{constructor(t){b(this,"backgroundAlpha",1);b(this,"backgroundColor",new Hn);b(this,"width",0);b(this,"height",0);b(this,"options",{});b(this,"renderer");b(this,"enabledLayers",new Set([0,1]));b(this,"handleWebGLContextCreationError",o(t=>{var r,n;(n=(r=this.options).onWebGLContextCreationError)==null||n.call(r,t)},"handleWebGLContextCreationError"));b(this,"handleWebGLContextLost",o(t=>{var r,n;(n=(r=this.options).onWebGLContextLost)==null||n.call(r,t)},"handleWebGLContextLost"));b(this,"handleWebGLContextRestored",o(t=>{var r,n;(n=(r=this.options).onWebGLContextRestored)==null||n.call(r,t)},"handleWebGLContextRestored"));var r,n,i,a,u;try{this.options=t,WU()?(this.renderer={setSize:o(()=>{},"setSize"),state:{reset:o(()=>{},"reset")},properties:{get:o(()=>{},"get")},getSize:o(()=>({width:window.innerWidth,height:innerHeight}),"getSize"),getDrawingBufferSize:o(()=>({width:window.innerWidth,height:innerHeight}),"getDrawingBufferSize"),getClearAlpha:o(()=>1,"getClearAlpha"),getClearColor:o(()=>new Hn,"getClearColor"),autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:o(()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),"getContext"),readRenderTargetPixelsAsync:o(()=>Promise.resolve([]),"readRenderTargetPixelsAsync"),setRenderTarget:o(()=>{},"setRenderTarget"),setClearColor:o(()=>{},"setClearColor"),clear:o(()=>{},"clear"),render:o(()=>{},"render"),clearStencil:o(()=>{},"clearStencil"),clearDepth:o(()=>{},"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 B7({canvas:t.canvas,alpha:t.alpha||!1,stencil:!0,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new Hn((r=t.backgroundColor)!=null?r:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(c){ae.error(c),t.onWebGLRendererError&&t.onWebGLRendererError(c)}(i=this.domElement())==null||i.addEventListener("webglcontextlost",this.handleWebGLContextLost),(a=this.domElement())==null||a.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(u=this.domElement())==null||u.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,r,n,i,a;this.renderer&&((r=(t=this.renderer).dispose)==null||r.call(t)),(n=this.domElement())==null||n.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(i=this.domElement())==null||i.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(a=this.domElement())==null||a.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,r){if(this.renderer){this.renderer.state.reset(),r.layers.disableAll();for(let n of this.enabledLayers.values())r.layers.enable(n);this.renderer.clearStencil(),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,r),this.renderer.clearDepth(),r.layers.disableAll(),r.layers.enable(NI.ALWAYS_ON_TOP),this.renderer.render(t,r),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,r){S.env.NODE_ENV==="test"||!this.renderer||(this.width=t,this.height=r,this.renderer.setSize(t,r,!1))}setBackgroundColor(t,r){this.backgroundColor=t,this.backgroundAlpha=r}domElement(){var t;return(t=this.renderer)==null?void 0:t.domElement}};o(t5,"Renderer");var G_=t5;g();g();var qU='"use strict";(()=>{var He=Object.defineProperty,bt=Object.defineProperties;var kt=Object.getOwnPropertyDescriptors;var Ge=Object.getOwnPropertySymbols;var wt=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable;var Fe=(r,e,t)=>e in r?He(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,c=(r,e)=>{for(var t in e||(e={}))wt.call(e,t)&&Fe(r,t,e[t]);if(Ge)for(var t of Ge(e))Tt.call(e,t)&&Fe(r,t,e[t]);return r},y=(r,e)=>bt(r,kt(e));var Rt=(r,e)=>{for(var t in e)He(r,t,{get:e[t],enumerable:!0})};var C=(r,e,t)=>Fe(r,typeof e!="symbol"?e+"":e,t);function et(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}function tt(r,e){let[t,s]=e;return t>=r.x&&t<=r.x+r.w&&s>=r.y&&s<=r.y+r.h}function rt(r,e){let t=e.x,s=e.y,n=e.x+e.w,a=e.y+e.h,o=r.x,i=r.y,u=r.x+r.w,l=r.y+r.h;return t<u&&o<n&&s<l&&i<a}function V(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}var w=class{constructor(e,t,s,n,a){C(this,"x");C(this,"y");C(this,"w");C(this,"h");C(this,"userData");this.userData=typeof a>"u"?null:a,this.x=e,this.y=t,this.w=s,this.h=n}contains(e){return e===this?!1:et(this,e)}intersects(e){return rt(this,e)}intersectsPoint(e){return tt(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var Ae=class r{constructor(e,t){C(this,"topLeft");C(this,"topRight");C(this,"bottomLeft");C(this,"bottomRight");C(this,"divided",!1);C(this,"boundary");C(this,"capacity",16);C(this,"objects",[]);C(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:s,h:n}=this.boundary;this.topLeft=new r(new w(e,t,s/2,n/2),this),this.topRight=new r(new w(e+s/2,t,s/2,n/2),this),this.bottomLeft=new r(new w(e,t+n/2,s/2,n/2),this),this.bottomRight=new r(new w(e+s/2,t+n/2,s/2,n/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(V(t,this.topLeft.queryRect(e)),V(t,this.topRight.queryRect(e)),V(t,this.bottomLeft.queryRect(e)),V(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(V(t,this.topLeft.queryPoint(e)),V(t,this.topRight.queryPoint(e)),V(t,this.bottomLeft.queryPoint(e)),V(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 we={};Rt(we,{BRAND:()=>Kt,DIRTY:()=>K,EMPTY_PATH:()=>Ot,INVALID:()=>m,NEVER:()=>Pr,OK:()=>S,ParseStatus:()=>R,Schema:()=>x,ZodAny:()=>q,ZodArray:()=>F,ZodBigInt:()=>H,ZodBoolean:()=>ee,ZodBranded:()=>Ie,ZodCatch:()=>le,ZodDate:()=>te,ZodDefault:()=>ue,ZodDiscriminatedUnion:()=>Pe,ZodEffects:()=>M,ZodEnum:()=>ce,ZodError:()=>A,ZodFirstPartyTypeKind:()=>g,ZodFunction:()=>$e,ZodIntersection:()=>ae,ZodIssueCode:()=>d,ZodLazy:()=>ie,ZodLiteral:()=>oe,ZodMap:()=>xe,ZodNaN:()=>ke,ZodNativeEnum:()=>de,ZodNever:()=>P,ZodNull:()=>se,ZodNullable:()=>L,ZodNumber:()=>G,ZodObject:()=>O,ZodOptional:()=>j,ZodParsedType:()=>h,ZodPipeline:()=>Ne,ZodPromise:()=>Y,ZodReadonly:()=>fe,ZodRecord:()=>Ze,ZodSchema:()=>x,ZodSet:()=>be,ZodString:()=>W,ZodSymbol:()=>_e,ZodTransformer:()=>M,ZodTuple:()=>$,ZodType:()=>x,ZodUndefined:()=>re,ZodUnion:()=>ne,ZodUnknown:()=>B,ZodVoid:()=>ve,addIssueToContext:()=>f,any:()=>ir,array:()=>ur,bigint:()=>tr,boolean:()=>ht,coerce:()=>Mr,custom:()=>ut,date:()=>rr,datetimeRegex:()=>ct,defaultErrorMap:()=>D,discriminatedUnion:()=>pr,effect:()=>Cr,enum:()=>wr,function:()=>xr,getErrorMap:()=>me,getParsedType:()=>Z,instanceof:()=>Ht,intersection:()=>mr,isAborted:()=>Ee,isAsync:()=>ye,isDirty:()=>Me,isValid:()=>U,late:()=>Gt,lazy:()=>br,literal:()=>kr,makeIssue:()=>Oe,map:()=>_r,nan:()=>er,nativeEnum:()=>Tr,never:()=>cr,null:()=>ar,nullable:()=>Ar,number:()=>ft,object:()=>lr,objectUtil:()=>Ue,oboolean:()=>Er,onumber:()=>jr,optional:()=>Sr,ostring:()=>Nr,pipeline:()=>Ir,preprocess:()=>Or,promise:()=>Rr,quotelessJson:()=>Ct,record:()=>gr,set:()=>vr,setErrorMap:()=>At,strictObject:()=>fr,string:()=>lt,symbol:()=>sr,transformer:()=>Cr,tuple:()=>yr,undefined:()=>nr,union:()=>hr,unknown:()=>or,util:()=>b,void:()=>dr});var b;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{let a={};for(let o of n)a[o]=o;return a},r.getValidEnumValues=n=>{let a=r.objectKeys(n).filter(i=>typeof n[n[i]]!="number"),o={};for(let i of a)o[i]=n[i];return r.objectValues(o)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.push(o);return a},r.find=(n,a)=>{for(let o of n)if(a(o))return o},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(o=>typeof o=="string"?"\'".concat(o,"\'"):o).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(b||(b={}));var Ue;(function(r){r.mergeShapes=(e,t)=>c(c({},e),t)})(Ue||(Ue={}));var h=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Z=r=>{switch(typeof r){case"undefined":return h.undefined;case"string":return h.string;case"number":return Number.isNaN(r)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(r)?h.array:r===null?h.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?h.promise:typeof Map<"u"&&r instanceof Map?h.map:typeof Set<"u"&&r instanceof Set?h.set:typeof Date<"u"&&r instanceof Date?h.date:h.object;default:return h.unknown}};var d=b.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"]),Ct=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),A=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};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},s={_errors:[]},n=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(t(o));else{let i=s,u=0;for(;u<o.path.length;){let l=o.path[u];u===o.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(t(o))):i[l]=i[l]||{_errors:[]},i=i[l],u++}}};return n(this),s}static assert(e){if(!(e instanceof r))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};A.create=r=>new A(r);var St=(r,e)=>{let t;switch(r.code){case d.invalid_type:r.received===h.undefined?t="Required":t="Expected ".concat(r.expected,", received ").concat(r.received);break;case d.invalid_literal:t="Invalid literal value, expected ".concat(JSON.stringify(r.expected,b.jsonStringifyReplacer));break;case d.unrecognized_keys:t="Unrecognized key(s) in object: ".concat(b.joinValues(r.keys,", "));break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t="Invalid discriminator value. Expected ".concat(b.joinValues(r.options));break;case d.invalid_enum_value:t="Invalid enum value. Expected ".concat(b.joinValues(r.options),", received \'").concat(r.received,"\'");break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.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,\'"\'):b.assertNever(r.validation):r.validation!=="regex"?t="Invalid ".concat(r.validation):t="Invalid";break;case d.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 d.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 d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t="Number must be a multiple of ".concat(r.multipleOf);break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,b.assertNever(r)}return{message:t}},D=St;var st=D;function At(r){st=r}function me(){return st}var Oe=r=>{let{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],o=y(c({},n),{path:a});if(n.message!==void 0)return y(c({},n),{path:a,message:n.message});let i="",u=s.filter(l=>!!l).slice().reverse();for(let l of u)i=l(o,{data:e,defaultError:i}).message;return y(c({},n),{path:a,message:i})},Ot=[];function f(r,e){let t=me(),s=Oe({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===D?void 0:D].filter(n=>!!n)});r.common.issues.push(s)}var R=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let n of t){let a=await n.key,o=await n.value;s.push({key:a,value:o})}return r.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let n of t){let{key:a,value:o}=n;if(a.status==="aborted"||o.status==="aborted")return m;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[a.value]=o.value)}return{status:e.value,value:s}}},m=Object.freeze({status:"aborted"}),K=r=>({status:"dirty",value:r}),S=r=>({status:"valid",value:r}),Ee=r=>r.status==="aborted",Me=r=>r.status==="dirty",U=r=>r.status==="valid",ye=r=>typeof Promise<"u"&&r instanceof Promise;var p;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(p||(p={}));var E=class{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}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}},nt=(r,e)=>{if(U(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 A(r.common.issues);return this._error=t,this._error}}};function v(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(\'Can\\\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.\');return e?{errorMap:e,description:n}:{errorMap:(o,i)=>{var l,_;let{message:u}=r;return o.code==="invalid_enum_value"?{message:u!=null?u:i.defaultError}:typeof i.data>"u"?{message:(l=u!=null?u:s)!=null?l:i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:(_=u!=null?u:t)!=null?_:i.defaultError}},description:n}}var x=class{get description(){return this._def.description}_getType(e){return Z(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new R,ctx:{common:e.parent.common,data:e.data,parsedType:Z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ye(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 s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var a;let s={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:Z(e)},n=this._parseSync({data:e,path:s.path,parent:s});return nt(s,n)}"~validate"(e){var s,n;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Z(e)};if(!this["~standard"].async)try{let a=this._parseSync({data:e,path:[],parent:t});return U(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>U(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={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:Z(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(ye(n)?n:Promise.resolve(n));return nt(s,a)}refine(e,t){let s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{let o=e(n),i=()=>a.addIssue(c({code:d.custom},s(n)));return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(i(),!1)):o?!0:(i(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new M({schema:this,typeName:g.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:t=>this["~validate"](t)}}optional(){return j.create(this,this._def)}nullable(){return L.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return F.create(this)}promise(){return Y.create(this,this._def)}or(e){return ne.create([this,e],this._def)}and(e){return ae.create(this,e,this._def)}transform(e){return new M(y(c({},v(this._def)),{schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let t=typeof e=="function"?e:()=>e;return new ue(y(c({},v(this._def)),{innerType:this,defaultValue:t,typeName:g.ZodDefault}))}brand(){return new Ie(c({typeName:g.ZodBranded,type:this},v(this._def)))}catch(e){let t=typeof e=="function"?e:()=>e;return new le(y(c({},v(this._def)),{innerType:this,catchValue:t,typeName:g.ZodCatch}))}describe(e){let t=this.constructor;return new t(y(c({},this._def),{description:e}))}pipe(e){return Ne.create(this,e)}readonly(){return fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},It=/^c[^\\s-]{8,}$/i,Nt=/^[0-9a-z]+$/,jt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Et=/^[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,Mt=/^[a-z0-9_-]{21}$/i,Pt=/^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/,Zt=/^[-+]?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)?)??$/,$t=/^(?!\\.)(?!.*\\.\\.)([A-Z0-9_\'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i,Lt="^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$",We,Vt=/^(?:(?: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])$/,Dt=/^(?:(?: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])$/,zt=/^(([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]))$/,Bt=/^(([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])$/,Ft=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ut=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,it="((\\\\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])))",Wt=new RegExp("^".concat(it,"$"));function ot(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)}function qt(r){return new RegExp("^".concat(ot(r),"$"))}function ct(r){let e="".concat(it,"T").concat(ot(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,"$"))}function Yt(r,e){return!!((e==="v4"||!e)&&Vt.test(r)||(e==="v6"||!e)&&zt.test(r))}function Xt(r,e){if(!Pt.test(r))return!1;try{let[t]=r.split("."),s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch(t){return!1}}function Jt(r,e){return!!((e==="v4"||!e)&&Dt.test(r)||(e==="v6"||!e)&&Bt.test(r))}var W=class r extends x{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){let a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.string,received:a.parsedType}),m}let s=new R,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,i=e.data.length<a.value;(o||i)&&(n=this._getOrReturnCtx(e,n),o?f(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&f(n,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")$t.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"email",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")We||(We=new RegExp(Lt,"u")),We.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"emoji",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")Et.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"uuid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")Mt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"nanoid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")It.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cuid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")Nt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cuid2",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")jt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"ulid",code:d.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch(o){n=this._getOrReturnCtx(e,n),f(n,{validation:"url",code:d.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"regex",code:d.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.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)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?ct(a).test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?Wt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?qt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:d.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?Zt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"duration",code:d.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Yt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"ip",code:d.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?Xt(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"jwt",code:d.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?Jt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cidr",code:d.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?Ft.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"base64",code:d.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?Ut.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"base64url",code:d.invalid_string,message:a.message}),s.dirty()):b.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),c({validation:t,code:d.invalid_string},p.errToObj(s)))}_addCheck(e){return new r(y(c({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(c({kind:"email"},p.errToObj(e)))}url(e){return this._addCheck(c({kind:"url"},p.errToObj(e)))}emoji(e){return this._addCheck(c({kind:"emoji"},p.errToObj(e)))}uuid(e){return this._addCheck(c({kind:"uuid"},p.errToObj(e)))}nanoid(e){return this._addCheck(c({kind:"nanoid"},p.errToObj(e)))}cuid(e){return this._addCheck(c({kind:"cuid"},p.errToObj(e)))}cuid2(e){return this._addCheck(c({kind:"cuid2"},p.errToObj(e)))}ulid(e){return this._addCheck(c({kind:"ulid"},p.errToObj(e)))}base64(e){return this._addCheck(c({kind:"base64"},p.errToObj(e)))}base64url(e){return this._addCheck(c({kind:"base64url"},p.errToObj(e)))}jwt(e){return this._addCheck(c({kind:"jwt"},p.errToObj(e)))}ip(e){return this._addCheck(c({kind:"ip"},p.errToObj(e)))}cidr(e){return this._addCheck(c({kind:"cidr"},p.errToObj(e)))}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(c({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:(s=e==null?void 0:e.local)!=null?s:!1},p.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(c({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision},p.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(c({kind:"duration"},p.errToObj(e)))}regex(e,t){return this._addCheck(c({kind:"regex",regex:e},p.errToObj(t)))}includes(e,t){return this._addCheck(c({kind:"includes",value:e,position:t==null?void 0:t.position},p.errToObj(t==null?void 0:t.message)))}startsWith(e,t){return this._addCheck(c({kind:"startsWith",value:e},p.errToObj(t)))}endsWith(e,t){return this._addCheck(c({kind:"endsWith",value:e},p.errToObj(t)))}min(e,t){return this._addCheck(c({kind:"min",value:e},p.errToObj(t)))}max(e,t){return this._addCheck(c({kind:"max",value:e},p.errToObj(t)))}length(e,t){return this._addCheck(c({kind:"length",value:e},p.errToObj(t)))}nonempty(e){return this.min(1,p.errToObj(e))}trim(){return new r(y(c({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new r(y(c({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new r(y(c({},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}};W.create=r=>{var e;return new W(c({checks:[],typeName:g.ZodString,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},v(r)))};function Qt(r,e){let t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=Number.parseInt(r.toFixed(n).replace(".","")),o=Number.parseInt(e.toFixed(n).replace(".",""));return a%o/10**n}var G=class r extends x{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)!==h.number){let a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.number,received:a.parsedType}),m}let s,n=new R;for(let a of this._def.checks)a.kind==="int"?b.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Qt(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),f(s,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{code:d.not_finite,message:a.message}),n.dirty()):b.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,p.toString(t))}gt(e,t){return this.setLimit("min",e,!1,p.toString(t))}lte(e,t){return this.setLimit("max",e,!0,p.toString(t))}lt(e,t){return this.setLimit("max",e,!1,p.toString(t))}setLimit(e,t,s,n){return new r(y(c({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:p.toString(n)}]}))}_addCheck(e){return new r(y(c({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:p.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:p.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:p.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:p.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:p.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"&&b.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};G.create=r=>new G(c({checks:[],typeName:g.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1},v(r)));var H=class r extends x{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)!==h.bigint)return this._getInvalidInput(e);let s,n=new R;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),f(s,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):b.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return f(t,{code:d.invalid_type,expected:h.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,p.toString(t))}gt(e,t){return this.setLimit("min",e,!1,p.toString(t))}lte(e,t){return this.setLimit("max",e,!0,p.toString(t))}lt(e,t){return this.setLimit("max",e,!1,p.toString(t))}setLimit(e,t,s,n){return new r(y(c({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:p.toString(n)}]}))}_addCheck(e){return new r(y(c({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:p.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:p.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}};H.create=r=>{var e;return new H(c({checks:[],typeName:g.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},v(r)))};var ee=class extends x{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){let s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_type,expected:h.boolean,received:s.parsedType}),m}return S(e.data)}};ee.create=r=>new ee(c({typeName:g.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1},v(r)));var te=class r extends x{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){let a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_type,expected:h.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return f(a,{code:d.invalid_date}),m}let s=new R,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):b.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r(y(c({},this._def),{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:p.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:p.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}};te.create=r=>new te(c({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:g.ZodDate},v(r)));var _e=class extends x{_parse(e){if(this._getType(e)!==h.symbol){let s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_type,expected:h.symbol,received:s.parsedType}),m}return S(e.data)}};_e.create=r=>new _e(c({typeName:g.ZodSymbol},v(r)));var re=class extends x{_parse(e){if(this._getType(e)!==h.undefined){let s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_type,expected:h.undefined,received:s.parsedType}),m}return S(e.data)}};re.create=r=>new re(c({typeName:g.ZodUndefined},v(r)));var se=class extends x{_parse(e){if(this._getType(e)!==h.null){let s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_type,expected:h.null,received:s.parsedType}),m}return S(e.data)}};se.create=r=>new se(c({typeName:g.ZodNull},v(r)));var q=class extends x{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}};q.create=r=>new q(c({typeName:g.ZodAny},v(r)));var B=class extends x{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}};B.create=r=>new B(c({typeName:g.ZodUnknown},v(r)));var P=class extends x{_parse(e){let t=this._getOrReturnCtx(e);return f(t,{code:d.invalid_type,expected:h.never,received:t.parsedType}),m}};P.create=r=>new P(c({typeName:g.ZodNever},v(r)));var ve=class extends x{_parse(e){if(this._getType(e)!==h.undefined){let s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_type,expected:h.void,received:s.parsedType}),m}return S(e.data)}};ve.create=r=>new ve(c({typeName:g.ZodVoid},v(r)));var F=class r extends x{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==h.array)return f(t,{code:d.invalid_type,expected:h.array,received:t.parsedType}),m;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(o||i)&&(f(t,{code:o?d.too_big:d.too_small,minimum:i?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(f(t,{code:d.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(f(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((o,i)=>n.type._parseAsync(new E(t,o,t.path,i)))).then(o=>R.mergeArray(s,o));let a=[...t.data].map((o,i)=>n.type._parseSync(new E(t,o,t.path,i)));return R.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new r(y(c({},this._def),{minLength:{value:e,message:p.toString(t)}}))}max(e,t){return new r(y(c({},this._def),{maxLength:{value:e,message:p.toString(t)}}))}length(e,t){return new r(y(c({},this._def),{exactLength:{value:e,message:p.toString(t)}}))}nonempty(e){return this.min(1,e)}};F.create=(r,e)=>new F(c({type:r,minLength:null,maxLength:null,exactLength:null,typeName:g.ZodArray},v(e)));function ge(r){if(r instanceof O){let e={};for(let t in r.shape){let s=r.shape[t];e[t]=j.create(ge(s))}return new O(y(c({},r._def),{shape:()=>e}))}else return r instanceof F?new F(y(c({},r._def),{type:ge(r.element)})):r instanceof j?j.create(ge(r.unwrap())):r instanceof L?L.create(ge(r.unwrap())):r instanceof $?$.create(r.items.map(e=>ge(e))):r}var O=class r extends x{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=b.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==h.object){let l=this._getOrReturnCtx(e);return f(l,{code:d.invalid_type,expected:h.object,received:l.parsedType}),m}let{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(let l in n.data)o.includes(l)||i.push(l);let u=[];for(let l of o){let _=a[l],T=n.data[l];u.push({key:{status:"valid",value:l},value:_._parse(new E(n,T,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof P){let l=this._def.unknownKeys;if(l==="passthrough")for(let _ of i)u.push({key:{status:"valid",value:_},value:{status:"valid",value:n.data[_]}});else if(l==="strict")i.length>0&&(f(n,{code:d.unrecognized_keys,keys:i}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let _ of i){let T=n.data[_];u.push({key:{status:"valid",value:_},value:l._parse(new E(n,T,n.path,_)),alwaysSet:_ in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let _ of u){let T=await _.key,he=await _.value;l.push({key:T,value:he,alwaysSet:_.alwaysSet})}return l}).then(l=>R.mergeObjectSync(s,l)):R.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new r(c(y(c({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,s)=>{var a,o,i,u;let n=(i=(o=(a=this._def).errorMap)==null?void 0:o.call(a,t,s).message)!=null?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(u=p.errToObj(e).message)!=null?u:n}:{message:n}}}:{}))}strip(){return new r(y(c({},this._def),{unknownKeys:"strip"}))}passthrough(){return new r(y(c({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new r(y(c({},this._def),{shape:()=>c(c({},this._def.shape()),e)}))}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>c(c({},this._def.shape()),e._def.shape()),typeName:g.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r(y(c({},this._def),{catchall:e}))}pick(e){let t={};for(let s of b.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new r(y(c({},this._def),{shape:()=>t}))}omit(e){let t={};for(let s of b.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new r(y(c({},this._def),{shape:()=>t}))}deepPartial(){return ge(this)}partial(e){let t={};for(let s of b.objectKeys(this.shape)){let n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new r(y(c({},this._def),{shape:()=>t}))}required(e){let t={};for(let s of b.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof j;)a=a._def.innerType;t[s]=a}return new r(y(c({},this._def),{shape:()=>t}))}keyof(){return dt(b.objectKeys(this.shape))}};O.create=(r,e)=>new O(c({shape:()=>r,unknownKeys:"strip",catchall:P.create(),typeName:g.ZodObject},v(e)));O.strictCreate=(r,e)=>new O(c({shape:()=>r,unknownKeys:"strict",catchall:P.create(),typeName:g.ZodObject},v(e)));O.lazycreate=(r,e)=>new O(c({shape:r,unknownKeys:"strip",catchall:P.create(),typeName:g.ZodObject},v(e)));var ne=class extends x{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(let i of a)if(i.result.status==="valid")return i.result;for(let i of a)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let o=a.map(i=>new A(i.ctx.common.issues));return f(t,{code:d.invalid_union,unionErrors:o}),m}if(t.common.async)return Promise.all(s.map(async a=>{let o=y(c({},t),{common:y(c({},t.common),{issues:[]}),parent:null});return{result:await a._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(n);{let a,o=[];for(let u of s){let l=y(c({},t),{common:y(c({},t.common),{issues:[]}),parent:null}),_=u._parseSync({data:t.data,path:t.path,parent:l});if(_.status==="valid")return _;_.status==="dirty"&&!a&&(a={result:_,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let i=o.map(u=>new A(u));return f(t,{code:d.invalid_union,unionErrors:i}),m}}get options(){return this._def.options}};ne.create=(r,e)=>new ne(c({options:r,typeName:g.ZodUnion},v(e)));var z=r=>r instanceof ie?z(r.schema):r instanceof M?z(r.innerType()):r instanceof oe?[r.value]:r instanceof ce?r.options:r instanceof de?b.objectValues(r.enum):r instanceof ue?z(r._def.innerType):r instanceof re?[void 0]:r instanceof se?[null]:r instanceof j?[void 0,...z(r.unwrap())]:r instanceof L?[null,...z(r.unwrap())]:r instanceof Ie||r instanceof fe?z(r.unwrap()):r instanceof le?z(r._def.innerType):[],Pe=class r extends x{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.object)return f(t,{code:d.invalid_type,expected:h.object,received:t.parsedType}),m;let s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);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}):(f(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let n=new Map;for(let a of t){let o=z(a.shape[e]);if(!o.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let i of o){if(n.has(i))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(i)));n.set(i,a)}}return new r(c({typeName:g.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n},v(s)))}};function qe(r,e){let t=Z(r),s=Z(e);if(r===e)return{valid:!0,data:r};if(t===h.object&&s===h.object){let n=b.objectKeys(e),a=b.objectKeys(r).filter(i=>n.indexOf(i)!==-1),o=c(c({},r),e);for(let i of a){let u=qe(r[i],e[i]);if(!u.valid)return{valid:!1};o[i]=u.data}return{valid:!0,data:o}}else if(t===h.array&&s===h.array){if(r.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<r.length;a++){let o=r[a],i=e[a],u=qe(o,i);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===h.date&&s===h.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var ae=class extends x{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=(a,o)=>{if(Ee(a)||Ee(o))return m;let i=qe(a.value,o.value);return i.valid?((Me(a)||Me(o))&&t.dirty(),{status:t.value,value:i.data}):(f(s,{code:d.invalid_intersection_types}),m)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,o])=>n(a,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};ae.create=(r,e,t)=>new ae(c({left:r,right:e,typeName:g.ZodIntersection},v(t)));var $=class r extends x{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.array)return f(s,{code:d.invalid_type,expected:h.array,received:s.parsedType}),m;if(s.data.length<this._def.items.length)return f(s,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&s.data.length>this._def.items.length&&(f(s,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...s.data].map((o,i)=>{let u=this._def.items[i]||this._def.rest;return u?u._parse(new E(s,o,s.path,i)):null}).filter(o=>!!o);return s.common.async?Promise.all(a).then(o=>R.mergeArray(t,o)):R.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new r(y(c({},this._def),{rest:e}))}};$.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $(c({items:r,typeName:g.ZodTuple,rest:null},v(e)))};var Ze=class r extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.object)return f(s,{code:d.invalid_type,expected:h.object,received:s.parsedType}),m;let n=[],a=this._def.keyType,o=this._def.valueType;for(let i in s.data)n.push({key:a._parse(new E(s,i,s.path,i)),value:o._parse(new E(s,s.data[i],s.path,i)),alwaysSet:i in s.data});return s.common.async?R.mergeObjectAsync(t,n):R.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof x?new r(c({keyType:e,valueType:t,typeName:g.ZodRecord},v(s))):new r(c({keyType:W.create(),valueType:e,typeName:g.ZodRecord},v(t)))}},xe=class extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.map)return f(s,{code:d.invalid_type,expected:h.map,received:s.parsedType}),m;let n=this._def.keyType,a=this._def.valueType,o=[...s.data.entries()].map(([i,u],l)=>({key:n._parse(new E(s,i,s.path,[l,"key"])),value:a._parse(new E(s,u,s.path,[l,"value"]))}));if(s.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let u of o){let l=await u.key,_=await u.value;if(l.status==="aborted"||_.status==="aborted")return m;(l.status==="dirty"||_.status==="dirty")&&t.dirty(),i.set(l.value,_.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let u of o){let l=u.key,_=u.value;if(l.status==="aborted"||_.status==="aborted")return m;(l.status==="dirty"||_.status==="dirty")&&t.dirty(),i.set(l.value,_.value)}return{status:t.value,value:i}}}};xe.create=(r,e,t)=>new xe(c({valueType:e,keyType:r,typeName:g.ZodMap},v(t)));var be=class r extends x{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==h.set)return f(s,{code:d.invalid_type,expected:h.set,received:s.parsedType}),m;let n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(f(s,{code:d.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(f(s,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function o(u){let l=new Set;for(let _ of u){if(_.status==="aborted")return m;_.status==="dirty"&&t.dirty(),l.add(_.value)}return{status:t.value,value:l}}let i=[...s.data.values()].map((u,l)=>a._parse(new E(s,u,s.path,l)));return s.common.async?Promise.all(i).then(u=>o(u)):o(i)}min(e,t){return new r(y(c({},this._def),{minSize:{value:e,message:p.toString(t)}}))}max(e,t){return new r(y(c({},this._def),{maxSize:{value:e,message:p.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};be.create=(r,e)=>new be(c({valueType:r,minSize:null,maxSize:null,typeName:g.ZodSet},v(e)));var $e=class r extends x{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.function)return f(t,{code:d.invalid_type,expected:h.function,received:t.parsedType}),m;function s(i,u){return Oe({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,me(),D].filter(l=>!!l),issueData:{code:d.invalid_arguments,argumentsError:u}})}function n(i,u){return Oe({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,me(),D].filter(l=>!!l),issueData:{code:d.invalid_return_type,returnTypeError:u}})}let a={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Y){let i=this;return S(async function(...u){let l=new A([]),_=await i._def.args.parseAsync(u,a).catch(Te=>{throw l.addIssue(s(u,Te)),l}),T=await Reflect.apply(o,this,_);return await i._def.returns._def.type.parseAsync(T,a).catch(Te=>{throw l.addIssue(n(T,Te)),l})})}else{let i=this;return S(function(...u){let l=i._def.args.safeParse(u,a);if(!l.success)throw new A([s(u,l.error)]);let _=Reflect.apply(o,this,l.data),T=i._def.returns.safeParse(_,a);if(!T.success)throw new A([n(_,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r(y(c({},this._def),{args:$.create(e).rest(B.create())}))}returns(e){return new r(y(c({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new r(c({args:e||$.create([]).rest(B.create()),returns:t||B.create(),typeName:g.ZodFunction},v(s)))}},ie=class extends x{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})}};ie.create=(r,e)=>new ie(c({getter:r,typeName:g.ZodLazy},v(e)));var oe=class extends x{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return f(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}};oe.create=(r,e)=>new oe(c({value:r,typeName:g.ZodLiteral},v(e)));function dt(r,e){return new ce(c({values:r,typeName:g.ZodEnum},v(e)))}var ce=class r extends x{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return f(t,{expected:b.joinValues(s),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return f(t,{received:t.data,code:d.invalid_enum_value,options:s}),m}return S(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 r.create(e,c(c({},this._def),t))}exclude(e,t=this._def){return r.create(this.options.filter(s=>!e.includes(s)),c(c({},this._def),t))}};ce.create=dt;var de=class extends x{_parse(e){let t=b.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==h.string&&s.parsedType!==h.number){let n=b.objectValues(t);return f(s,{expected:b.joinValues(n),received:s.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(b.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=b.objectValues(t);return f(s,{received:s.data,code:d.invalid_enum_value,options:n}),m}return S(e.data)}get enum(){return this._def.values}};de.create=(r,e)=>new de(c({values:r,typeName:g.ZodNativeEnum},v(e)));var Y=class extends x{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&t.common.async===!1)return f(t,{code:d.invalid_type,expected:h.promise,received:t.parsedType}),m;let s=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return S(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Y.create=(r,e)=>new Y(c({type:r,typeName:g.ZodPromise},v(e)));var M=class extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:o=>{f(s,o),o.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let o=n.transform(s.data,a);if(s.common.async)return Promise.resolve(o).then(async i=>{if(t.value==="aborted")return m;let u=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return u.status==="aborted"?m:u.status==="dirty"?K(u.value):t.value==="dirty"?K(u.value):u});{if(t.value==="aborted")return m;let i=this._def.schema._parseSync({data:o,path:s.path,parent:s});return i.status==="aborted"?m:i.status==="dirty"?K(i.value):t.value==="dirty"?K(i.value):i}}if(n.type==="refinement"){let o=i=>{let u=n.refinement(i,a);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?m:(i.status==="dirty"&&t.dirty(),o(i.value),{status:t.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?m:(i.status==="dirty"&&t.dirty(),o(i.value).then(()=>({status:t.value,value:i.value}))))}if(n.type==="transform")if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!U(o))return m;let i=n.transform(o.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>U(o)?Promise.resolve(n.transform(o.value,a)).then(i=>({status:t.value,value:i})):m);b.assertNever(n)}};M.create=(r,e,t)=>new M(c({schema:r,typeName:g.ZodEffects,effect:e},v(t)));M.createWithPreprocess=(r,e,t)=>new M(c({schema:e,effect:{type:"preprocess",transform:r},typeName:g.ZodEffects},v(t)));var j=class extends x{_parse(e){return this._getType(e)===h.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};j.create=(r,e)=>new j(c({innerType:r,typeName:g.ZodOptional},v(e)));var L=class extends x{_parse(e){return this._getType(e)===h.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};L.create=(r,e)=>new L(c({innerType:r,typeName:g.ZodNullable},v(e)));var ue=class extends x{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===h.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};ue.create=(r,e)=>new ue(c({innerType:r,typeName:g.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},v(e)));var le=class extends x{_parse(e){let{ctx:t}=this._processInputParams(e),s=y(c({},t),{common:y(c({},t.common),{issues:[]})}),n=this._def.innerType._parse({data:s.data,path:s.path,parent:c({},s)});return ye(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new A(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new A(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};le.create=(r,e)=>new le(c({innerType:r,typeName:g.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},v(e)));var ke=class extends x{_parse(e){if(this._getType(e)!==h.nan){let s=this._getOrReturnCtx(e);return f(s,{code:d.invalid_type,expected:h.nan,received:s.parsedType}),m}return{status:"valid",value:e.data}}};ke.create=r=>new ke(c({typeName:g.ZodNaN},v(r)));var Kt=Symbol("zod_brand"),Ie=class extends x{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},Ne=class r extends x{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),K(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{let n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new r({in:e,out:t,typeName:g.ZodPipeline})}},fe=class extends x{_parse(e){let t=this._def.innerType._parse(e),s=n=>(U(n)&&(n.value=Object.freeze(n.value)),n);return ye(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}};fe.create=(r,e)=>new fe(c({innerType:r,typeName:g.ZodReadonly},v(e)));function at(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function ut(r,e={},t){return r?q.create().superRefine((s,n)=>{var o,i;let a=r(s);if(a instanceof Promise)return a.then(u=>{var l,_;if(!u){let T=at(e,s),he=(_=(l=T.fatal)!=null?l:t)!=null?_:!0;n.addIssue(y(c({code:"custom"},T),{fatal:he}))}});if(!a){let u=at(e,s),l=(i=(o=u.fatal)!=null?o:t)!=null?i:!0;n.addIssue(y(c({code:"custom"},u),{fatal:l}))}}):q.create()}var Gt={object:O.lazycreate},g;(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"})(g||(g={}));var Ht=(r,e={message:"Input not instance of ".concat(r.name)})=>ut(t=>t instanceof r,e),lt=W.create,ft=G.create,er=ke.create,tr=H.create,ht=ee.create,rr=te.create,sr=_e.create,nr=re.create,ar=se.create,ir=q.create,or=B.create,cr=P.create,dr=ve.create,ur=F.create,lr=O.create,fr=O.strictCreate,hr=ne.create,pr=Pe.create,mr=ae.create,yr=$.create,gr=Ze.create,_r=xe.create,vr=be.create,xr=$e.create,br=ie.create,kr=oe.create,wr=ce.create,Tr=de.create,Rr=Y.create,Cr=M.create,Sr=j.create,Ar=L.create,Or=M.createWithPreprocess,Ir=Ne.create,Nr=()=>lt().optional(),jr=()=>ft().optional(),Er=()=>ht().optional(),Mr={string:r=>W.create(y(c({},r),{coerce:!0})),number:r=>G.create(y(c({},r),{coerce:!0})),boolean:r=>ee.create(y(c({},r),{coerce:!0})),bigint:r=>H.create(y(c({},r),{coerce:!0})),date:r=>te.create(y(c({},r),{coerce:!0}))};var Pr=m;var Vs=we.union([we.enum(["low","medium","high","always-visible"]),we.number()]);var Le=5;var X=200,Ve=10;function pt(r,e,t,s,n,a,o="-1"){let i=1/0,u=1/0,l=-1/0,_=-1/0,T=new w(-Ve,0,5,t),he=new w(-Ve,0,e,5),Te=new w(e-5,0,e+Ve,t),yt=new w(0,t-5,e,t+Ve),gt=Zr(e,t,s,n,a),_t=[T,he,Te,yt],Ye=new w(-X,-X,e+X*2,t+X*2);for(let k of r){let Ce,Se;for(let I=0;I<k.bboxes.length;I++){if(k.bboxes[I]==null||(Ce=k.bboxes[I].boundingBox,Se=k.bboxes[I].index,k.lockedToStrategyIndex!==-1&&Se!==k.lockedToStrategyIndex))continue;let[je,N,J,Xe]=Ce,[Q,vt,Je,xt]=[k.y-je,k.y+N,k.x-J,k.x+Xe],ze=Je,Be=Q,Qe=xt-Je,Ke=vt-Q;i=Math.min(i,ze)-X,u=Math.min(u,Be)-X,l=Math.max(l,ze+Qe)+X,_=Math.max(_,Be+Ke)+X,k.bboxes[I].boundingRect=new w(ze,Be,Qe,Ke)}}let pe={msgId:o,colliders:new Array(r.length),debug:[]},De=new Ae(new w(i,u,l-i,_-u)),Re;for(let k=0;k<r.length;k++)if(Re=r[k],pe.colliders[k]=[-1,0],Re.enabledAndVisible){let[Ce,Se,I]=[1/0,-1,void 0];for(let{index:je,boundingRect:N}of Re.bboxes){if(N==null)continue;let J=[];if(J=De.queryRect(N).filter(Q=>N.intersects(Q)),Re.shouldCollideWithScreenEdges&&_t.forEach(Q=>{N.intersects(Q)&&J.push(Q)}),N.intersects(gt)){pe.colliders[k]=[-1,0,N];break}if(J.length<=Ce&&(I=N,Se=je,Ce=J.length),J.length===0){De.insert(N),pe.colliders[k]=[je,Ye.contains(N)?0:1,N];break}}Re.rank===Le&&I!=null&&(De.insert(I),pe.colliders[k]=[Se,Ye.contains(I)?0:1,I])}else pe.colliders[k]=[-1,0];return pe}function Zr(r,e,t,s,n){switch(n){case"top-right":return new w(r-t,0,t,s);case"bottom-left":return new w(0,e-s,t,s);case"bottom-right":return new w(r-t,e-s,t,s);case"top-left":return new w(0,0,t,s)}}function mt(r){let e=r[0].map(t=>{let s=t[0].map(n=>({index:n[4],boundingBox:[n[0],n[1],n[2],n[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?Le:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:s,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:r[3],totalHeight:r[2],watermarkWidth:r[4],watermarkHeight:r[5],watermarkPosition:r[6],colliders:e,devicePixelRatio:r[1]}}self.onmessage=r=>{let e=mt(r.data);self.postMessage(pt(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';g();g();g();g();g();function YU(e,t){return t.x+t.w<e.x+e.w&&t.x>e.x&&t.y>e.y&&t.y+t.h<e.y+e.h}o(YU,"contains");g();function XU(e,t){let[r,n]=t;return r>=e.x&&r<=e.x+e.w&&n>=e.y&&n<=e.y+e.h}o(XU,"intersectPoint");g();function ZU(e,t){let r=t.x,n=t.y,i=t.x+t.w,a=t.y+t.h,u=e.x,c=e.y,f=e.x+e.w,m=e.y+e.h;return r<f&&u<i&&n<m&&c<a}o(ZU,"intersects");g();function Op(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}o(Op,"appendItems");g();var r5=class r5{constructor(t,r,n,i,a){b(this,"x");b(this,"y");b(this,"w");b(this,"h");b(this,"userData");this.userData=typeof a>"u"?null:a,this.x=t,this.y=r,this.w=n,this.h=i}contains(t){return t===this?!1:YU(this,t)}intersects(t){return ZU(this,t)}intersectsPoint(t){return XU(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};o(r5,"Rectangle");var gn=r5;var Jh=class Jh{constructor(t,r){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=r,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:r,w:n,h:i}=this.boundary;this.topLeft=new Jh(new gn(t,r,n/2,i/2),this),this.topRight=new Jh(new gn(t+n/2,r,n/2,i/2),this),this.bottomLeft=new Jh(new gn(t,r+i/2,n/2,i/2),this),this.bottomRight=new Jh(new gn(t+n/2,r+i/2,n/2,i/2),this),this.divided=!0}queryRect(t){let r=[];if(this.boundary.intersects(t))r.push(...this.objects);else return[];return this.divided&&(Op(r,this.topLeft.queryRect(t)),Op(r,this.topRight.queryRect(t)),Op(r,this.bottomLeft.queryRect(t)),Op(r,this.bottomRight.queryRect(t))),r}queryPoint(t){let r=[];if(this.boundary.intersectsPoint(t))r.push(...this.objects);else return[];return this.divided&&(Op(r,this.topLeft.queryPoint(t)),Op(r,this.topRight.queryPoint(t)),Op(r,this.bottomLeft.queryPoint(t)),Op(r,this.bottomRight.queryPoint(t))),r}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(r=>r.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};o(Jh,"QuadTree");var Ml=Jh;g();g();var qy=W.union([W.enum(["low","medium","high","always-visible"]),W.number()]),KU=["","","low","medium","high","always-visible"],bpe=2,Ipe=3;var Qh=5;function JU(e){return Math.min(Qh,Math.max(bpe,e))}o(JU,"clampTierNumber");function Yy(e){if(typeof e=="number")return JU(e);let t=KU.indexOf(e);return t===-1?Ipe:t}o(Yy,"convertCollisionRankingTierToNumber");function Qv(e){let t=JU(e);return KU[t]}o(Qv,"convertNumberToCollisionRankingTier");function QU(e,t,r){let n,i,a,u=null,c=0;r||(r={});let f=o(function(){c=r.leading===!1?0:Date.now(),u=null,a=e.apply(n,i),u||(n=i=null)},"later");return function(){let m=Date.now();!c&&r.leading===!1&&(c=m);let v=t-(m-c);return n=globalThis,i=arguments,v<=0||v>t?(u&&(clearTimeout(u),u=null),c=m,a=e.apply(n,i),u||(n=i=null)):!u&&r.trailing!==!1&&(u=setTimeout(f,v)),a}}o(QU,"throttle");function eV(e){let t=e[0].map(r=>{let n=r[0].map(i=>({index:i[4],boundingBox:[i[0],i[1],i[2],i[3]]}));return{enabledAndVisible:r[1]===1,rank:r[2]===1?Qh:0,x:r[3],y:r[4],shouldCollideWithScreenEdges:r[5]===1,bboxes:n,lockedToStrategyIndex:r[6]}});return{msgId:"-1",totalWidth:e[3],totalHeight:e[2],watermarkWidth:e[4],watermarkHeight:e[5],watermarkPosition:e[6],colliders:t,devicePixelRatio:e[1]}}o(eV,"unpackMessage");g();g();var td=200,j_=10;function tV(e,t,r,n,i,a,u="-1"){let c=1/0,f=1/0,m=-1/0,v=-1/0,x=new gn(-j_,0,5,r),I=new gn(-j_,0,t,5),C=new gn(t-5,0,t+j_,r),T=new gn(0,r-5,t,r+j_),O=Spe(t,r,n,i,a),P=[x,I,C,T],L=new gn(-td,-td,t+td*2,r+td*2);for(let B of e){let H,z;for(let R=0;R<B.bboxes.length;R++){if(B.bboxes[R]==null||(H=B.bboxes[R].boundingBox,z=B.bboxes[R].index,B.lockedToStrategyIndex!==-1&&z!==B.lockedToStrategyIndex))continue;let[X,ie,Q,U]=H,[Te,oe,fe,se]=[B.y-X,B.y+ie,B.x-Q,B.x+U],ve=fe,ue=Te,he=se-fe,Z=oe-Te;c=Math.min(c,ve)-td,f=Math.min(f,ue)-td,m=Math.max(m,ve+he)+td,v=Math.max(v,ue+Z)+td,B.bboxes[R].boundingRect=new gn(ve,ue,he,Z)}}let A={msgId:u,colliders:new Array(e.length),debug:[]},M=new Ml(new gn(c,f,m-c,v-f)),N;for(let B=0;B<e.length;B++)if(N=e[B],A.colliders[B]=[-1,0],N.enabledAndVisible){let[H,z,R]=[1/0,-1,void 0];for(let{index:X,boundingRect:ie}of N.bboxes){if(ie==null)continue;let Q=[];if(Q=M.queryRect(ie).filter(Te=>ie.intersects(Te)),N.shouldCollideWithScreenEdges&&P.forEach(Te=>{ie.intersects(Te)&&Q.push(Te)}),ie.intersects(O)){A.colliders[B]=[-1,0,ie];break}if(Q.length<=H&&(R=ie,z=X,H=Q.length),Q.length===0){M.insert(ie),A.colliders[B]=[X,L.contains(ie)?0:1,ie];break}}N.rank===Qh&&R!=null&&(M.insert(R),A.colliders[B]=[z,L.contains(R)?0:1,R])}else A.colliders[B]=[-1,0];return A}o(tV,"processColliders");function Spe(e,t,r,n,i){switch(i){case"top-right":return new gn(e-r,0,r,n);case"bottom-left":return new gn(0,t-n,r,n);case"bottom-right":return new gn(e-r,t-n,r,n);case"top-left":return new gn(0,0,r,n)}}o(Spe,"getWatermarkBoundary");var n5=class n5{constructor(){b(this,"onmessage",o(()=>{},"onmessage"));b(this,"postMessage",o(t=>{let r=eV(t);this.onmessage({data:tV(r.colliders,r.totalWidth,r.totalHeight,r.watermarkWidth,r.watermarkHeight,r.watermarkPosition,r.msgId)})},"postMessage"));b(this,"terminate",o(()=>{},"terminate"))}};o(n5,"SyncWorker");var U_=n5;var em=!1,_pe=150,i5=class i5 extends Rt{constructor(r,n,i=!0){super();b(this,"worker");b(this,"debugContext");b(this,"debugCanvas");b(this,"collidersDirty",!0);b(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);b(this,"visibleCollidersQTree",new Ml(new gn(0,0,0,0)));b(this,"interactiveCollidersQTree",new Ml(new gn(0,0,0,0)));b(this,"coreState");b(this,"postMessage");b(this,"showCollisionBoxes",o(()=>{em=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));b(this,"hideCollisionBoxes",o(()=>{em=!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",o(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));b(this,"componentArray",[]);b(this,"update",o((r,n,i="bottom-left",a=!1)=>{let u=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let c;for(let f of this.coreState.geometry2DIdsInScene){let m=this.coreState.geometry2DMap.get(f);m&&(c=m.components[0],this.componentArray.push(c))}this.resize(r,n,i),this.collidersDirty=!1,u=!0}else u=this.componentArray.some(c=>c.collisionDirty===!0);u&&this.componentArray.sort((c,f)=>f.rank-c.rank);for(let c=0;c<this.componentArray.length;c++)if(this.packedMessage){let f=this.componentArray[c].toPackedMessage(a&&!u);this.packedMessage[0][c]==null&&(this.packedMessage[0][c]=[]),this.packedMessage[0][c][0]==null&&(this.packedMessage[0][c][0]=[]),this.packedMessage[0][c][0]=f.bboxes,this.packedMessage[0][c][1]=f.enabled&&this.componentArray[c].visible&&!this.componentArray[c].isOccluded?1:0,this.packedMessage[0][c][2]=f.rank===Qh?1:0,this.packedMessage[0][c][3]=f.x,this.packedMessage[0][c][4]=f.y,this.packedMessage[0][c][5]=f.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][c][6]=f.lockedToStrategyIndex}this.working||this.postMessage()},"update"));b(this,"resolve",o(r=>{if(this.working=!1,this.collidersDirty||!r.data)return;let n=r.data.colliders,i=-1,a,u,c;em&&(this.visibleCollidersQTree=new Ml(new gn(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Ml(new gn(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let f=0;f<this.componentArray.length;f++){let m=this.componentArray[f];n[f]!=null&&(i=n[f][0],a=n[f][2],m.offscreen=n[f][1]===1,i!==-1&&a!=null?(c=new gn(a.x,a.y,a.w,a.h,{entityId:m.id}),em&&this.visibleCollidersQTree.insert(c),u=this.coreState.geometry2DMap.get(m.id),(u==null?void 0:u.components[1])!=null&&this.interactiveCollidersQTree.insert(new gn(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=c,m.onStrategySelected(i))):((m.canShow===!0||m.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in m&&(m.visibilityNeedsUpdate="hide"),i!==-1&&i!==m.currentStrategyIndex&&m.onStrategySelected(i)))}em&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));b(this,"drawDebug",o(()=>{em&&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",o(()=>{this.worker.terminate()},"destroy"));this.worker=i===!1?new U_:Xy!==""?new Worker(Xy):new Worker(URL.createObjectURL(new Blob([qU],{type:"text/javascript"}))),this.coreState=n,this.debugCanvas=r,this.debugContext=r.getContext("2d"),this.worker.onmessage=a=>this.resolve(a),this.postMessage=QU(this._postMessage,_pe,!1),em?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(r,n,i){this.packedMessage[6]=i,this.packedMessage[5]=n,this.packedMessage[4]=r,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};o(i5,"CollisionSystem");var V_=i5;g();g();g();g();var s5=class s5{constructor(t){b(this,"type");b(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};o(s5,"Tap");var z_=s5,a5=class a5{constructor(){b(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,r;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((r=this.taps[1])==null?void 0:r.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(r=>t-r.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};o(a5,"TapsController");var $_=a5;g();function u5(e){let t=new Set;for(let r of e){let n=r.object;for(;n.visible&&n.parent&&n.parent.visible===!0&&!t.has(n.parent);)n=n.parent,n instanceof Bn&&n.type==="group-container"&&n.visible&&n.components[0]&&t.add(n)}return Array.from(t)}o(u5,"getUniqueIntersectedGroupContainers");var Zy,c5=class c5 extends Rt{constructor(r,n,i,a,u){super();b(this,"raycaster",new Vu);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 Ml(new gn(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);j(this,Zy);b(this,"onPointerMoveRaf",o(r=>{this.lastPointerEvent=r,d(this,Zy)&&cancelAnimationFrame(d(this,Zy)),$(this,Zy,requestAnimationFrame(()=>{this.onPointerMove(r)}))},"onPointerMoveRaf"));b(this,"onPointerMove",o(r=>{r.preventDefault(),this.updateInteractionStateIfPanning(r),(r.pointerType!=="touch"||r.pointerType===void 0&&this.hasTouched)&&this.handleHover(r),this.handleCursor()},"onPointerMove"));b(this,"tapsControl",new $_);b(this,"onPointerDown",o(r=>{r.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:r.timeStamp,clientX:r.clientX,clientY:r.clientY},this.lastPointerEvent=r,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),r.pointerType==="touch"&&(this.tapsControl.add(new z_(r)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));b(this,"clickTimeout");b(this,"onPointerUp",o(r=>{this.tapsControl.discardOutsideOfWaitWindow(r.timeStamp),this.lastPointerEvent=r,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(r);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)&&(r.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",r),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(r),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",r),this.flush()):this.handleClick(r)),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 Ft);b(this,"debugPanel");this.isUserInteracting=u,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=i,this._container=r,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(r){this._quadtree=r}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let r=this.state.hovered3DEntity.components[2];r&&(r.dirty=!0)}}getThreeDIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(a=>{var u,c;return((u=a.object)==null?void 0:u.name)==="worldPlane"||((c=a.object)==null?void 0:c.visible)}),i=n.findIndex(a=>{var u;return((u=a.object)==null?void 0:u.name)==="worldPlane"});return i!==-1&&n.push(n.splice(i,1)[0]),n}getGroupContainerIntersectsFromXY(r){let n=this.getThreeDIntersectsFromXY(r),i;return n!=null&&n.length>0&&(i=u5(n)),i}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(r){let n=r||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!n||this.isUserInteracting())return;let{entity3D:i,entity2D:a,position:u,groupContainers:c}=this.intersect(n);(this.detect3DEntityHover(i)||this.detect2DEntityHover(a)||this.detect3DContainerHover(c))&&(this.state.hovered3DEntity=i,this.state.lastHover=i,this.state.hovered2DEntity=a,this.state.hovered3DContainers=c,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:u,groupContainers:c})),this.handleCursor()}handleCursor(){var u;let r=!!(this.state.hovered3DEntity&&((u=this.state.hovered3DEntity)!=null&&u.components[2])||this.state.hovered2DEntity),n=!!this.state.interaction.mouseDownStart,i=this.state.interaction.isPanning,a=Tpe(r,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(r){return this.state.hovered2DEntity!==r}handleClick(r){let n=this.intersect(r);this.publish("click",{entity2D:n.entity2D,entity3D:n.entity3D,position:n.position,groupContainers:n.groupContainers,pointerEvent:{button:r.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[];let r;for(let n of this.coreState.geometry3DIdsInScene)r=this.coreState.geometry3DMap.get(n),((r==null?void 0:r.type)==="geometry"||(r==null?void 0:r.type)==="model"||(r==null?void 0:r.type)==="path"||(r==null?void 0:r.type)==="custom-geometry")&&r.components[0].mesh&&!this.cachedHitBoxes.entities.includes(r.components[0].mesh)&&this.cachedHitBoxes.entities.push(r.components[0].mesh);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(r){var L,A,M,N,B;let n=[r.offsetX,r.offsetY],i=this._quadtree.queryPoint(n),[a]=i.filter(H=>H.intersectsPoint(n)),u=this.coreState.containerOffset[0],c=this.coreState.containerOffset[1];this.ndcPoint.x=(r.clientX-c)/this._container.clientWidth*2-1,this.ndcPoint.y=-((r.clientY-u)/this._container.clientHeight)*2+1;let f=this.getThreeDIntersectsFromXY(this.ndcPoint),m=(L=f[0])==null?void 0:L.point,v=[],x=[],I=f.filter(H=>H.object.name!=="worldPlane");for(let H of I)H.object instanceof Vt&&H.object.material.depthTest===!1?v.push(H):x.push(H);let C=(M=(A=v[0])!=null?A:x[0])!=null?M:void 0,T,O;if(C!=null){if(T=Mpe(C.object,this.coreState.geometry3DMap),!T){let H=(N=C==null?void 0:C.instanceId)!=null?N:C==null?void 0:C.batchId;T=H!=null&&(C!=null&&C.object.userData.entities)?this.coreState.geometry3DMap.get(C==null?void 0:C.object.userData.entities[H]):this.coreState.geometry3DMap.get(C==null?void 0:C.object.userData.entityId)}T!=null&&T.components[2]&&(O=T)}let P=u5(I);return{entity2D:((B=a==null?void 0:a.userData)==null?void 0:B.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(a==null?void 0:a.userData.entityId),entity3D:O,position:m,groupContainers:P.length>0?P:void 0}}detect3DEntityHover(r){return this.state.lastHover!==r&&(this.state.lastHover&&nV(this.state.lastHover,!1,this.coreState),r&&nV(r,!0,this.coreState)),this.state.hovered3DEntity!==r}detect3DContainerHover(r){return!OI(this.state.hovered3DContainers,r)}updateInteractionStateIfPanning(r){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(r.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(r.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 r=document.createElement("div");r.style.position="absolute",r.style.top="0",r.style.right="0",r.style.backgroundColor="white",r.style.padding="10px",document.body.append(r),r.id="interaction-debug-panel",this.debugPanel=r,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",n=>{var i,a,u;this.queueDebugMessage("CLICK \n3D: ".concat((i=n.entity3D)==null?void 0:i.id," \n2D: ").concat((a=n.entity2D)==null?void 0:a.id," \nPos: ").concat((u=n.position)==null?void 0:u.toArray().join(", ")),"#fdffb6")}),this.on("hover",n=>{var i,a,u;this.queueDebugMessage("HOVER \n3D: ".concat((i=n.entity3D)==null?void 0:i.id," \n2D: ").concat((a=n.entity2D)==null?void 0:a.id," \nPos: ").concat((u=n.position)==null?void 0:u.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(r,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=r,(a=this.debugPanel)==null||a.prepend(i),setTimeout(()=>{i.style.opacity="0",setTimeout(()=>{i.remove()},500)},2500)}getCursor(){return this.cursor}};Zy=new WeakMap,o(c5,"InteractionSystem");var ex=c5;function nV(e,t,r){var u;let n=e.components[2];n&&n.hover!==!0&&(n.hover=t?"user-interaction":!1,n.dirty=!0);let i=(u=e.components[0].textMesh)==null?void 0:u.userData.entityId;if(!i)return;let a=r.geometry3DMap.get(i);(a==null?void 0:a.type)==="text3d"&&(a.components[1].hoverByPolygon=t,a.components[1].dirty=!0)}o(nV,"updateHover");function Tpe(e,t,r){return t?"grabbing":e?"pointer":r?"grabbing":"grab"}o(Tpe,"processCursor");function Epe(e){let t=e;for(;t!=null&&t.parent;){if(t instanceof Sf)return;if(t.userData.isSingleModel)return t;t=t.parent}}o(Epe,"findModelParent");function Mpe(e,t){let r=Epe(e);return r?t.get(r.userData.entityId):void 0}o(Mpe,"findModelParentEntity");g();var AV=Mn(I5());var sx=4,Sde=8,_de="0.6",DV="low-priority-pin",S5=W.object({rank:W.union([W.enum(["low","medium","high","always-visible"]),W.number()]).optional(),interactive:W.union([W.boolean(),W.literal("pointer-events-auto")]).optional(),id:W.string().optional(),placement:W.union([W.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),W.array(W.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:W.boolean().optional(),zIndex:W.number().optional(),lowPriorityPin:W.object({enabled:W.boolean().optional(),size:W.number().positive().optional(),color:W.string().optional()}).optional()});function FV(e,t,r){W.array(W.number()).min(2).max(3).parse(e),W.string().parse(t),S5.parse(r)}o(FV,"validateMarker");var Cde=Object.freeze({enabled:!0,size:Sde,color:"#666"}),im=class im{constructor(t,r={}){b(this,"id");b(this,"type","marker");b(this,"rank",0);b(this,"initialRank",0);b(this,"activePlacement","center");b(this,"pointerEvents","none");b(this,"options",{rank:"low",interactive:!1,id:"",placement:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:Y({},Cde)});b(this,"projection",new Ft);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",o((t,r=!1)=>{var i,a;if(this.currentStrategyIndex===t&&!r)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activePlacement="center",this.markerContainer.setAttribute("data-placement",DV);let u=this.options.lowPriorityPin,c=u.size,f=u.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(c,"px")),this.markerContainer.style.setProperty("--pin-color",f),this.markerContainer.style.opacity=_de,this.style.top=-c/2+"px",this.style.left=-c/2+"px"}else{this.activePlacement=(a=(i=this.strategies[t])==null?void 0:i.name)!=null?a:"center",this.markerContainer.setAttribute("data-placement",this.activePlacement),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:u,height:c}=this.dimensions,f=-c/2+"px",m=-u/2+"px";switch(this.style.top=f,this.style.left=m,this.activePlacement){case"top":{this.style.top=-c+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-u+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-c+"px",this.style.left=-u+"px";break}case"top-right":{this.style.top=-c+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-u+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=f,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=(r==null?void 0:r.id)||an(),this.options=(0,AV.default)(this.options,r),typeof r.rank=="string")this.rank=Yy(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let u=Math.trunc(S.env.NODE_ENV==="test"?im.testId:im.testId*10)/10;im.testId+=.001,this.rank=u}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(n=this.markerContainer.firstElementChild)!=null?n:null,this.contentEl=(a=(i=this.markerContainer.firstElementChild)==null?void 0:i.firstElementChild)!=null?a:null}updateDimensions(t,r){if(t!=null&&r!=null)this.dimensions={width:t,height:r};else{let{width:n,height:i}=this.markerContainer.getBoundingClientRect();this.dimensions={width:n,height:i}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){var a;let{width:t,height:r}=this.dimensions;if(t===0||r===0)return[];let i=(Array.isArray(this.options.placement)?this.options.placement:[this.options.placement]).map(u=>({name:u,getBoundingBox:o(()=>{let c=r/2,f=r/2,m=t/2,v=t/2;switch(u){case"top":{c=r,f=0;break}case"bottom":{c=0,f=r;break}case"left":{m=t,v=0;break}case"right":{m=0,v=t;break}case"top-left":{c=r,m=t,f=0,v=0;break}case"top-right":{c=r,v=t,f=0,m=0;break}case"bottom-left":{f=r,m=t,c=0,v=0;break}case"bottom-right":{f=r,v=t,c=0,m=0;break}}return[c+sx,f+sx,m+sx,v+sx]},"getBoundingBox")}));if((a=this.options.lowPriorityPin)!=null&&a.enabled&&this.options.rank!=="always-visible"){let u={name:DV,getBoundingBox:o(()=>{let c=Math.max(2,sx/2);return[this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c]},"getBoundingBox")};i.push(u)}return i}toPackedMessage(t=!1){var n;this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0;let r=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&t&&r&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,r&&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&&r?this.packedMessage.bboxes.unshift([...a.getBoundingBox(),i]):this.packedMessage.bboxes.push([...a.getBoundingBox(),i])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var t;return!((t=this.options.lowPriorityPin)!=null&&t.enabled)||this.options.rank==="always-visible"?-1:Array.isArray(this.options.placement)?this.options.placement.length:1}destroy(){}};o(im,"MarkerComponent"),b(im,"testId",0);var Sc=im;g();g();g();g();g();var _5=class _5{constructor(){b(this,"hover",!1);b(this,"dirty",!1)}};o(_5,"InteractionComponent");var e0=_5;g();var Tz=Mn(N5());g();g();g();var gme=o(e=>{let t=e[0];for(let r=1;r<e.length;r++){let n=e[r];if(n<=t)return!1;t=n}return!0},"isStrictlyIncreasing"),yme=o(e=>{let t=e[0];for(let r=1;r<e.length;r++){let n=e[r];if(n>=t)return!1;t=n}return!0},"isStrictlyDecreasing"),vme=o(e=>gme(e)||yme(e),"isStrictlyIncreasingOrDecreasing"),pz=He.object({on:He.literal("zoom-level"),input:He.array(He.number()).nonempty().refine(vme,{message:"input array must be strictly increasing or decreasing"}),output:He.array(He.number()).nonempty(),easing:V7.default("linear")}).refine(e=>e.input.length===e.output.length,{message:"input and output must have the same length"});g();function aC(e){"@babel/helpers - typeof";return aC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aC(e)}o(aC,"_typeof");var xme=/^\s+/,bme=/\s+$/;function ct(e,t){if(e=e||"",t=t||{},e instanceof ct)return e;if(!(this instanceof ct))return new ct(e,t);var r=Ime(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}o(ct,"tinycolor");ct.prototype={isDark:o(function(){return this.getBrightness()<128},"isDark"),isLight:o(function(){return!this.isDark()},"isLight"),isValid:o(function(){return this._ok},"isValid"),getOriginalInput:o(function(){return this._originalInput},"getOriginalInput"),getFormat:o(function(){return this._format},"getFormat"),getAlpha:o(function(){return this._a},"getAlpha"),getBrightness:o(function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},"getBrightness"),getLuminance:o(function(){var t=this.toRgb(),r,n,i,a,u,c;return r=t.r/255,n=t.g/255,i=t.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),n<=.03928?u=n/12.92:u=Math.pow((n+.055)/1.055,2.4),i<=.03928?c=i/12.92:c=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*u+.0722*c},"getLuminance"),setAlpha:o(function(t){return this._a=vz(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:o(function(){var t=dz(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},"toHsv"),toHsvString:o(function(){var t=dz(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHsvString"),toHsl:o(function(){var t=fz(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},"toHsl"),toHslString:o(function(){var t=fz(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHslString"),toHex:o(function(t){return hz(this._r,this._g,this._b,t)},"toHex"),toHexString:o(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:o(function(t){return wme(this._r,this._g,this._b,this._a,t)},"toHex8"),toHex8String:o(function(t){return"#"+this.toHex8(t)},"toHex8String"),toRgb:o(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:o(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:o(function(){return{r:Math.round(mi(this._r,255)*100)+"%",g:Math.round(mi(this._g,255)*100)+"%",b:Math.round(mi(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:o(function(){return this._a==1?"rgb("+Math.round(mi(this._r,255)*100)+"%, "+Math.round(mi(this._g,255)*100)+"%, "+Math.round(mi(this._b,255)*100)+"%)":"rgba("+Math.round(mi(this._r,255)*100)+"%, "+Math.round(mi(this._g,255)*100)+"%, "+Math.round(mi(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:o(function(){return this._a===0?"transparent":this._a<1?!1:kme[hz(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:o(function(t){var r="#"+mz(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=ct(t);n="#"+mz(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},"toFilter"),toString:o(function(t){var r=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!r&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},"toString"),clone:o(function(){return ct(this.toString())},"clone"),_applyModification:o(function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:o(function(){return this._applyModification(Mme,arguments)},"lighten"),brighten:o(function(){return this._applyModification(Ome,arguments)},"brighten"),darken:o(function(){return this._applyModification(Lme,arguments)},"darken"),desaturate:o(function(){return this._applyModification(Pme,arguments)},"desaturate"),saturate:o(function(){return this._applyModification(Tme,arguments)},"saturate"),greyscale:o(function(){return this._applyModification(Eme,arguments)},"greyscale"),spin:o(function(){return this._applyModification(Dme,arguments)},"spin"),_applyCombination:o(function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},"_applyCombination"),analogous:o(function(){return this._applyCombination(Nme,arguments)},"analogous"),complement:o(function(){return this._applyCombination(Ame,arguments)},"complement"),monochromatic:o(function(){return this._applyCombination(Rme,arguments)},"monochromatic"),splitcomplement:o(function(){return this._applyCombination(Fme,arguments)},"splitcomplement"),triad:o(function(){return this._applyCombination(gz,[3])},"triad"),tetrad:o(function(){return this._applyCombination(gz,[4])},"tetrad")};ct.fromRatio=function(e,t){if(aC(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=fx(e[n]));e=r}return ct(e,t)};function Ime(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,a=null,u=!1,c=!1;return typeof e=="string"&&(e=Ume(e)),aC(e)=="object"&&(Rp(e.r)&&Rp(e.g)&&Rp(e.b)?(t=Sme(e.r,e.g,e.b),u=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Rp(e.h)&&Rp(e.s)&&Rp(e.v)?(n=fx(e.s),i=fx(e.v),t=Cme(e.h,n,i),u=!0,c="hsv"):Rp(e.h)&&Rp(e.s)&&Rp(e.l)&&(n=fx(e.s),a=fx(e.l),t=_me(e.h,n,a),u=!0,c="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=vz(r),{ok:u,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}o(Ime,"inputToRGB");function Sme(e,t,r){return{r:mi(e,255)*255,g:mi(t,255)*255,b:mi(r,255)*255}}o(Sme,"rgbToRgb");function fz(e,t,r){e=mi(e,255),t=mi(t,255),r=mi(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a,u,c=(n+i)/2;if(n==i)a=u=0;else{var f=n-i;switch(u=c>.5?f/(2-n-i):f/(n+i),n){case e:a=(t-r)/f+(t<r?6:0);break;case t:a=(r-e)/f+2;break;case r:a=(e-t)/f+4;break}a/=6}return{h:a,s:u,l:c}}o(fz,"rgbToHsl");function _me(e,t,r){var n,i,a;e=mi(e,360),t=mi(t,100),r=mi(r,100);function u(m,v,x){return x<0&&(x+=1),x>1&&(x-=1),x<1/6?m+(v-m)*6*x:x<1/2?v:x<2/3?m+(v-m)*(2/3-x)*6:m}if(o(u,"hue2rgb"),t===0)n=i=a=r;else{var c=r<.5?r*(1+t):r+t-r*t,f=2*r-c;n=u(f,c,e+1/3),i=u(f,c,e),a=u(f,c,e-1/3)}return{r:n*255,g:i*255,b:a*255}}o(_me,"hslToRgb");function dz(e,t,r){e=mi(e,255),t=mi(t,255),r=mi(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a,u,c=n,f=n-i;if(u=n===0?0:f/n,n==i)a=0;else{switch(n){case e:a=(t-r)/f+(t<r?6:0);break;case t:a=(r-e)/f+2;break;case r:a=(e-t)/f+4;break}a/=6}return{h:a,s:u,v:c}}o(dz,"rgbToHsv");function Cme(e,t,r){e=mi(e,360)*6,t=mi(t,100),r=mi(r,100);var n=Math.floor(e),i=e-n,a=r*(1-t),u=r*(1-i*t),c=r*(1-(1-i)*t),f=n%6,m=[r,u,a,a,c,r][f],v=[c,r,r,u,a,a][f],x=[a,a,c,r,r,u][f];return{r:m*255,g:v*255,b:x*255}}o(Cme,"hsvToRgb");function hz(e,t,r,n){var i=[Iu(Math.round(e).toString(16)),Iu(Math.round(t).toString(16)),Iu(Math.round(r).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("")}o(hz,"rgbToHex");function wme(e,t,r,n,i){var a=[Iu(Math.round(e).toString(16)),Iu(Math.round(t).toString(16)),Iu(Math.round(r).toString(16)),Iu(xz(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("")}o(wme,"rgbaToHex");function mz(e,t,r,n){var i=[Iu(xz(n)),Iu(Math.round(e).toString(16)),Iu(Math.round(t).toString(16)),Iu(Math.round(r).toString(16))];return i.join("")}o(mz,"rgbaToArgbHex");ct.equals=function(e,t){return!e||!t?!1:ct(e).toRgbString()==ct(t).toRgbString()};ct.random=function(){return ct.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Pme(e,t){t=t===0?0:t||10;var r=ct(e).toHsl();return r.s-=t/100,r.s=lC(r.s),ct(r)}o(Pme,"_desaturate");function Tme(e,t){t=t===0?0:t||10;var r=ct(e).toHsl();return r.s+=t/100,r.s=lC(r.s),ct(r)}o(Tme,"_saturate");function Eme(e){return ct(e).desaturate(100)}o(Eme,"_greyscale");function Mme(e,t){t=t===0?0:t||10;var r=ct(e).toHsl();return r.l+=t/100,r.l=lC(r.l),ct(r)}o(Mme,"_lighten");function Ome(e,t){t=t===0?0:t||10;var r=ct(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),ct(r)}o(Ome,"_brighten");function Lme(e,t){t=t===0?0:t||10;var r=ct(e).toHsl();return r.l-=t/100,r.l=lC(r.l),ct(r)}o(Lme,"_darken");function Dme(e,t){var r=ct(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,ct(r)}o(Dme,"_spin");function Ame(e){var t=ct(e).toHsl();return t.h=(t.h+180)%360,ct(t)}o(Ame,"_complement");function gz(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=ct(e).toHsl(),n=[ct(e)],i=360/t,a=1;a<t;a++)n.push(ct({h:(r.h+a*i)%360,s:r.s,l:r.l}));return n}o(gz,"polyad");function Fme(e){var t=ct(e).toHsl(),r=t.h;return[ct(e),ct({h:(r+72)%360,s:t.s,l:t.l}),ct({h:(r+216)%360,s:t.s,l:t.l})]}o(Fme,"_splitcomplement");function Nme(e,t,r){t=t||6,r=r||30;var n=ct(e).toHsl(),i=360/r,a=[ct(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(ct(n));return a}o(Nme,"_analogous");function Rme(e,t){t=t||6;for(var r=ct(e).toHsv(),n=r.h,i=r.s,a=r.v,u=[],c=1/t;t--;)u.push(ct({h:n,s:i,v:a})),a=(a+c)%1;return u}o(Rme,"_monochromatic");ct.mix=function(e,t,r){r=r===0?0:r||50;var n=ct(e).toRgb(),i=ct(t).toRgb(),a=r/100,u={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return ct(u)};ct.readability=function(e,t){var r=ct(e),n=ct(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};ct.isReadable=function(e,t,r){var n=ct.readability(e,t),i,a;switch(a=!1,i=Vme(r),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};ct.mostReadable=function(e,t,r){var n=null,i=0,a,u,c,f;r=r||{},u=r.includeFallbackColors,c=r.level,f=r.size;for(var m=0;m<t.length;m++)a=ct.readability(e,t[m]),a>i&&(i=a,n=ct(t[m]));return ct.isReadable(e,n,{level:c,size:f})||!u?n:(r.includeFallbackColors=!1,ct.mostReadable(e,["#fff","#000"],r))};var R5=ct.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"},kme=ct.hexNames=Bme(R5);function Bme(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}o(Bme,"flip");function vz(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}o(vz,"boundAlpha");function mi(e,t){Gme(e)&&(e="100%");var r=jme(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}o(mi,"bound01");function lC(e){return Math.min(1,Math.max(0,e))}o(lC,"clamp01");function Wa(e){return parseInt(e,16)}o(Wa,"parseIntFromHex");function Gme(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}o(Gme,"isOnePointZero");function jme(e){return typeof e=="string"&&e.indexOf("%")!=-1}o(jme,"isPercentage");function Iu(e){return e.length==1?"0"+e:""+e}o(Iu,"pad2");function fx(e){return e<=1&&(e=e*100+"%"),e}o(fx,"convertToPercentage");function xz(e){return Math.round(parseFloat(e)*255).toString(16)}o(xz,"convertDecimalToHex");function yz(e){return Wa(e)/255}o(yz,"convertHexToDecimal");var bu=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),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 Rp(e){return!!bu.CSS_UNIT.exec(e)}o(Rp,"isValidCSSUnit");function Ume(e){e=e.replace(xme,"").replace(bme,"").toLowerCase();var t=!1;if(R5[e])e=R5[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=bu.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=bu.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=bu.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=bu.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=bu.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=bu.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=bu.hex8.exec(e))?{r:Wa(r[1]),g:Wa(r[2]),b:Wa(r[3]),a:yz(r[4]),format:t?"name":"hex8"}:(r=bu.hex6.exec(e))?{r:Wa(r[1]),g:Wa(r[2]),b:Wa(r[3]),format:t?"name":"hex"}:(r=bu.hex4.exec(e))?{r:Wa(r[1]+""+r[1]),g:Wa(r[2]+""+r[2]),b:Wa(r[3]+""+r[3]),a:yz(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=bu.hex3.exec(e))?{r:Wa(r[1]+""+r[1]),g:Wa(r[2]+""+r[2]),b:Wa(r[3]+""+r[3]),format:t?"name":"hex"}:!1}o(Ume,"stringInputToObject");function Vme(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}o(Vme,"validateWCAG2Parms");var uC=W.object({margin:W.number().min(6).default(6),maxLines:W.number().min(1).default(2),textSize:W.number().min(0).default(11.5),maxWidth:W.number().min(0).default(150),lineHeight:W.number().min(0).default(1.2),color:W.string().default("#333"),outlineColor:W.string().default("white"),textColor:W.string().optional(),textOutlineColor:W.string().optional(),pinColor:W.string().optional(),pinOutlineColor:W.string().optional(),pinColorInactive:W.string().optional(),pinOutlineColorInactive:W.string().optional(),icon:W.string().optional(),iconSize:W.number().min(0).default(20),iconScale:W.union([W.number(),pz]).default(1),iconPadding:W.number().min(0).default(2),iconFit:W.enum(["fill","contain","cover"]).default("cover"),iconOverflow:W.enum(["visible","hidden"]).default("hidden"),iconVisibleAtZoomLevel:W.number().default(-1/0)}),bz=uC.transform(e=>{var t,r,n,i,a,u,c,f;return Ie(Y({},e),{textColor:(t=e.textColor)!=null?t:e.color,textOutlineColor:(r=e.textOutlineColor)!=null?r:e.outlineColor,pinColor:(n=e.pinColor)!=null?n:e.color,pinOutlineColor:(i=e.pinOutlineColor)!=null?i:e.outlineColor,pinColorInactive:(u=e.pinColorInactive)!=null?u:ct((a=e.pinColor)!=null?a:e.color).setAlpha(.5).toRgbString(),pinOutlineColorInactive:(f=e.pinOutlineColorInactive)!=null?f:ct((c=e.pinOutlineColor)!=null?c:e.outlineColor).setAlpha(.5).toRgbString()})}),G3t=uC.strict(),cC=o(e=>bz.parse(e),"parseLabelAppearance"),zme=W.object({rank:qy.optional(),appearance:bz.optional(),interactive:W.boolean().default(!1)}),k5=o(e=>{zme.parse(e!=null?e:{})},"validateLabelOptions"),Iz=o((e,t,r)=>{W.array(W.number()).min(2).max(3).parse(e),W.string().parse(t),k5(r)},"validateLabel"),Sz=["color","outlineColor","margin"],$me=[...Sz,"maxLines","lineHeight","textSize","maxWidth","textColor","textOutlineColor"],Hme=[...Sz,"icon","pinColor","pinOutlineColor","pinColorInactive","pinOutlineColorInactive"],_z=o((e,t)=>$me.some(r=>t[r]!=null&&e[r]!==t[r]),"isOneOfTextDirtyOptions"),Cz=o((e,t)=>Hme.some(r=>t[r]!=null&&e[r]!==t[r]),"isOneOfPinDirtyOptions");var Yme="LOW_PRIORITY",wz=4,Xme=6,Pz=6.5,Zme={heightAbovePolygon:0},am=class am{constructor(t,r,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 Ft);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",o(t=>{if(this.currentStrategyIndex===t)return;this.currentStrategyIndex=t;let r=this.strategies[this.currentStrategyIndex];if(r){r.onStrategySelected();let n=this.style;this.style=this.newStyle,this.newStyle=n}},"onStrategySelected"));b(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var a,u;if(this.id=(a=r.id)!=null?a:an(),this.options=(0,Tz.default)({},r,Zme),this.text=t,this.dp=(c=1)=>c*n.pixelRatio,typeof r.rank=="string")this.rank=Yy(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let c=Math.trunc(S.env.NODE_ENV==="test"?am.testId:am.testId*10)/10;am.testId+=.001,this.rank=c,this.initialRank=c}let i=cC((u=r.appearance)!=null?u:{});this.appearance=i,this.iconPadding=i.iconPadding}get scaledMarkerSize(){return this.totalMarkerSize*this.iconScale}get scaledIconPadding(){return this.appearance.iconPadding*this.iconScale}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.iconSize):this.markerSize=this.dp(Pz),this.totalMarkerSize=Math.ceil((this.markerSize+2.5)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,i=Math.max(Xme,n),a=this.iconVisible?i/2:0,u=this.iconVisible?this.scaledMarkerSize:Pz/2,c=[{name:"RIGHT",getBoundingBox:o(()=>{let f=Math.max(this.scaledMarkerSize,r);return[f/2+i,f/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+t+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.scaledMarkerSize/2+wz,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"LEFT",getBoundingBox:o(()=>{let f=Math.max(this.scaledMarkerSize,r);return[f/2+i,f/2+i,this.scaledMarkerSize/2+t+i,this.scaledMarkerSize/2+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-t-this.scaledMarkerSize/2-wz,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"TOP",getBoundingBox:o(()=>{let f=this.dp();return[r+this.scaledMarkerSize/2/f+i,this.scaledMarkerSize/2+i,t/2+i,t/2+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.scaledMarkerSize/2,this.newStyle.left=-t/2},"onStrategySelected")},{name:Yme,getBoundingBox:o(()=>[u+a,u+a,u+a,u+a],"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:o(()=>[this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i],"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}]:c}recomputeCurrentStrategy(t=this.iconScale){if(this.iconScale!==t||this.dirty){let r=this.strategies[this.currentStrategyIndex];if(this.iconScale=t,this.collisionDirty=!0,r){r.onStrategySelected(t);let n=this.style;this.style=this.newStyle,this.newStyle=n}this.dirty=!1}}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){var r;if(this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==((r=this.packedMessage.bboxes[0])==null?void 0:r[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(){}};o(am,"LabelComponent"),b(am,"testId",0);var B5=am,_c=B5;g();g();var $5=class $5 extends Rt{constructor(r,n,i=!0){super();b(this,"rendererState");b(this,"convertTo3DMapPosition");b(this,"textSet",new Set);b(this,"batchedTextMap",new Map);b(this,"useWorker",!0);b(this,"debugTextAreaMesh",new Map);i===!1&&(this.useWorker=!1,V5(!1)),this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var c,f,m;let n,i,a,u=[];for(let v of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(v),(n==null?void 0:n.type)==="text3d"){i=n.components[0],a=n.components[1];let x=(c=i.mesh)==null?void 0:c.parent;if(!x||!(x instanceof Bn)||!(i instanceof rd))continue;if("textArea"in i.feature.properties&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((m=(f=i.feature.properties)==null?void 0:f.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,hx().then(({BatchedText:T})=>{let O=new T;return O.type="batchedtext",x.add(O),O}));let C=this.batchedTextMap.get(x);if(!C)throw new Error("batched text required");u.push(Ez({entityId:v,textComponent:i,styleComponent:a,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:C,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,hx().then(({BatchedText:T})=>{let O=new T;return O.type="batchedtext",x.add(O),O}));let C=this.batchedTextMap.get(x);if(!C)throw new Error("batched text required");u.push(Ez({entityId:v,textComponent:i,styleComponent:a,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:C,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let I=this.batchedTextMap.get(x);i.textMesh&&I&&i.polygonEntityId!=null&&Promise.all([I,Promise.resolve({meshComponent:i,styleComponent:a})]).then(([C,{meshComponent:T,styleComponent:O}])=>{let{textMesh:P}=T;if(C&&P){let L=z5(C,P);T.visible&&!L?C.add(P):!T.visible&&L&&C.remove(P)}O.flipToFaceCamera&&this.flipIfNeeded(T,r)})}return Promise.all(u)}flipIfNeeded(r,n){let i=r.textMesh;if(!i)return!1;let a=i.rotation.z,u=Sw(a+n);u>Math.PI/2&&u<3*Math.PI/2&&(i.rotation.z=Sw(a+Math.PI))}showTextAreaMesh(){let r,n;for(let i of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(i),(r==null?void 0:r.type)==="text3d"&&(n=r.components[0],"textArea"in n.feature.properties)){let a=n.feature.properties.textArea;if(!a)continue;let u=new Jl(a.maxWidth,a.maxHeight),c=new Vt(u,new po({color:"pink"})),{textMesh:f}=n;if(!f)continue;let m=this.convertTo3DMapPosition(a.position,dx);c.position.copy(m),c.position.z=f.position.z-.1,c.rotation.z=f.rotation.z,j5.identity(),j5.makeRotationAxis(new lt(0,0,1),f.userData.rotationZ),dx.set(a.maxWidth/2,0,0),dx.applyMatrix4(j5),c.position.x-=dx.x,c.position.y-=dx.y,this.rendererState.entityScene.add(c),this.debugTextAreaMesh.set(i,c)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};o($5,"Text3DSystem");var pC=$5;function V5(e){hx().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}o(V5,"configureWorker");var j5=new La,dx=new lt,U5;function hx(){return U5||(U5=import("./text3d-DWR5PXYU.js").then(e=>e)),U5}o(hx,"getText3DService");async function Ez({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:a,type:u="text-area"}){return Promise.all([hx(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:c,createTroikaTextArea:f},m])=>u==="text-area"?f(m.entityId,m.meshComponent,m.styleComponent,n):c(m.entityId,m.meshComponent,m.styleComponent,n)).catch(c=>{ae.warn("Trouble creating text: ",c)}).then(c=>{if(!(c!=null&&c.text))return;let f=[Promise.resolve(c.text),i,Promise.resolve()];if(t.polygonEntityId){let m=a.geometry3DMap.get(t.polygonEntityId);if((m==null?void 0:m.type)==="geometry"){let v=m.components[0],x=m.components[1];v.textMesh=c.text,v.mesh!=null&&(c.text.position.z=x.altitude+x.height+Kme)}}else f[2]=hx().then(({syncText:m})=>m(c.text));return Promise.all(f)}).then(c=>{if(!c)return;let[f,m]=c;m.add(f),t.batchedText||(t.batchedText=m)})}o(Ez,"createText");function z5(e,t){return e._members.has(t)}o(z5,"doesBatchedTextContainsText");var Kme=.5;var H5=W.object({visible:W.boolean(),color:W.string(),flipToFaceCamera:W.boolean(),font:W.string().optional(),fontSize:W.number(),margin:W.union([W.number(),W.tuple([W.number(),W.number(),W.number(),W.number()])]),outlineColor:W.string(),outlineOpacity:W.number(),outlineBlur:W.union([W.number(),W.string()]),outlineWidth:W.number(),outlineOffsetX:W.number(),outlineOffsetY:W.number(),strokeWidth:W.number(),maxWidth:W.number().optional(),maxHeight:W.number().optional(),strokeOpacity:W.number(),strokeColor:W.string(),fillOpacity:W.number(),hoverColor:W.string().optional(),id:W.union([W.string(),W.number()]),type:W.literal("text3d"),position:W.tuple([W.number(),W.number(),W.number()]),content:W.string()}),Mz=H5.partial().omit({id:!0,type:!0}).strict(),fC=Mz.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),Oz=W.object({appearance:Mz.optional(),parentId:W.string().optional()}).strict(),W5=class W5{constructor(t){b(this,"mesh",new eu);b(this,"textMesh");b(this,"type","text3d");b(this,"feature");b(this,"parent");b(this,"batchedText");b(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?z5(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};o(W5,"Text3DComponent");var rd=W5;g();var i0,q5=class q5{constructor(t){b(this,"color");b(this,"dirty",!0);b(this,"enabled",!0);j(this,i0,!1);b(this,"edgeColors");b(this,"edgeVisibility");b(this,"geometry");b(this,"ranges");b(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[this.ranges.start*4+3]:0}set visible(t){if(!this.edgeVisibility||!this.ranges||d(this,i0)===t)return;$(this,i0,t);let r=this.edgeVisibility.array,n=t?1:0;for(let i=0;i<this.ranges.count;i++){let a=this.ranges.start+i;r[a]=n}this.edgeVisibility.needsUpdate=!0}get visible(){return d(this,i0)}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]}};i0=new WeakMap,o(q5,"OutlineComponent");var o0=q5;g();g();g();var Y5=class Y5 extends O7{constructor(r){let n=r,i=3,a=i*4;super(new Uint8Array(r*a),i,r,xI,vI);b(this,"_width");b(this,"_height");b(this,"_propertiesLength");this._width=a,this._height=n,this._propertiesLength=i}setColor(r,n,i){let a=this.image.data,u=r*this._width;a[u]=Math.round(n.r*255),a[u+1]=Math.round(n.g*255),a[u+2]=Math.round(n.b*255),a[u+3]=0,a[u+4]=Math.round(i.r*255),a[u+5]=Math.round(i.g*255),a[u+6]=Math.round(i.b*255),a[u+7]=0,this.needsUpdate=!0}getColor(r){let n=this.image.data,i=r*this._width,a=new Hn(n[i]/255,n[i+1]/255,n[i+2]/255),u=new Hn(n[i+4]/255,n[i+5]/255,n[i+6]/255);return{color:a,topColor:u}}setTexture(r,n,i){let a=this.image.data,u=r*this._width;a[u+8]=n?255:0,a[u+9]=i?255:0,a[u+10]=0,a[u+11]=0,this.needsUpdate=!0}getTexture(r){let n=this.image.data,i=r*this._width,a=n[i+8]===255,u=n[i+9]===255;return{texture:a,topTexture:u}}};o(Y5,"BatchedPropertiesTexture");var dC=Y5;g();var Lz="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying float vVerticalOffset;\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 vVerticalOffset = position.z;\n}\n";g();var Dz="#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 float vVerticalOffset;\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(vVerticalOffset) - 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 Jme=-.05,Qme=1,X5=class X5 extends sl{constructor(r,n,i=1){super(r);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",kd);b(this,"showTextures",o(r=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,n,i),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new dC(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=a=>{let u=this.uniforms.uGradientIntensity,c=this.uniforms.uGradientEnd,f=this.uniforms.uGradientStart,m=this.uniforms.uTopTexture,v=this.uniforms.uTexture,x=this.uniforms.uRepeatYFactor,I=this.uniforms.uBlendTexture;this.uniforms=a.uniforms,a.vertexShader=Lz,a.fragmentShader=Dz,Object.assign(this.uniforms,{uGradientIntensity:u,uGradientEnd:c,uGradientStart:f,uMinSideAlpha:{value:Jme},uMaxSideAlpha:{value:Qme},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:m,uTexture:v,uRepeatYFactor:x,uBlendTexture:I})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){r.wrapS=Gu,r.wrapT=Gu,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=Gu,r.wrapT=Gu,r.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=r}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(r){r!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=r,this.colorSpace=r?I7:kd,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(r,n,i){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}getGradientShading(){return{start:this.uniforms.uGradientStart.value,end:this.uniforms.uGradientEnd.value,intensity:this.uniforms.uGradientIntensity.value}}setColor(r,n,i){this.propertiesTexture.setColor(r,n,i)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,n),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};o(X5,"BatchedStandardMaterial");var lm=X5;g();function Az(e,t){var m,v,x;let r=0;for(let I of e)r+=((v=(m=I.components[0])==null?void 0:m.geometry)==null?void 0:v.attributes.position.count)||0;let n=new Hn(t.color),i;i=new lm({color:n,side:t.side==="back"?h1:t.side==="front"?Rd:Xl,opacity:(x=t.opacity)!=null?x:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let a=new AI(e.length,r,0,i);a.renderOrder=0;let u,c,f;for(let I of e)u=I.components[0],!(!(u instanceof Ii)||!u.geometry)&&(u.mesh=a,u.material=i,u.instanceIndex=a.addGeometry(u.geometry),a.addInstance(u.instanceIndex),a.userData.entities[u.instanceIndex]=I.id,i instanceof lm&&i.setColor(u.instanceIndex,n,t.topColor?new Hn(t.topColor):n),c=a.getGeometryIdAt(u.instanceIndex),u.batchedProps&&(f=a.getGeometryRangeAt(c),f&&(u.batchedProps.range=f),u.batchedProps.geometryId=c));return a.perObjectFrustumCulled=!0,a.matrixAutoUpdate=!1,a}o(Az,"batchGeometries");function mx(e){return ct(e).darken(30).toRgbString()}o(mx,"darkenColorForOutline");function Fz(e,t,r,n){if(t.length<1)return;e.boundingBox||e.computeBoundingBox();let i=e.boundingBox,a=e.getAttribute("position"),u=e.getAttribute("normal"),c=e.getAttribute("uv"),f,m;e.index?(f=e.index.count/3,m=o(function(M,N){return e.index.getX(M*3+N)},"meshIndex")):(f=a.count/3,m=o(function(M,N){return M*3+N},"meshIndex"));let v=new La;v.makeRotationFromQuaternion(new Bd().setFromEuler(new Zc(0,0,r/180*Math.PI)));let x=t.find(M=>M.face==="top"),I;x&&(I={min:n(x.bounds[1],x.bounds[0],0),max:n(x.bounds[3],x.bounds[2],i.max.z)});let C=t.find(M=>M.face==="side"),T;if(C&&(T={min:n(C.bounds[1],C.bounds[0],0),max:n(C.bounds[3],C.bounds[2],i.max.z)}),!(!T&&!I))for(let M=0;M<f;++M){let N=u.getX(m(M,0))+u.getX(m(M,1))+u.getX(m(M,2)),B=u.getY(m(M,0))+u.getY(m(M,1))+u.getY(m(M,2)),H=u.getZ(m(M,0))+u.getZ(m(M,1))+u.getZ(m(M,2)),z=Math.abs(N),R=Math.abs(B),X=Math.abs(H);var O,P;z<=R&&z<=X?(O="x",R<=X?P="y":P="z"):R<=z&&R<=X?(O="y",z<=X?P="x":P="z"):(O="z",z<=R?P="x":P="y"),O==="z"&&(O=P,P="z");let ie,Q,U,Te,oe,fe;if(P==="z"||O==="z"){if(!C||!T)continue;ie=C.repeat.u,Q=C.repeat.v,U=C.offset.u,Te=C.offset.v,oe=C.rotation,fe=T}else{if(!x||!I)continue;ie=x.repeat.u,Q=x.repeat.v,U=x.offset.u,Te=x.offset.v,oe=(360-r+x.rotation)%360,fe=I}let{min:se,max:ve}=fe,ue=new Zl;ue.position.set(se.x,se.y,0),ue.updateMatrix(),ue.updateMatrixWorld();let he=se.clone().applyMatrix4(v),Z=ve.clone().applyMatrix4(v),Ke=Math.abs(Z.x-he.x),Ue=Math.abs(Z.y-he.y),rt=new lt(Ke,Ue,ve.z).applyMatrix4(ue.matrixWorld),Ee=Math.abs(rt[O]-se[O]),We=Math.abs(rt[P]-se[P]),St=oe*Math.PI/180||0,yt=Math.cos(St),pt=Math.sin(St),te=ue.matrixWorld.clone().invert(),ce=new Bd().setFromEuler(new Zc(0,0,r/180*Math.PI));for(let ee=0;ee<3;ee++){let Me=new lt(a.getX(m(M,ee)),a.getY(m(M,ee)),a.getZ(m(M,ee))).applyMatrix4(te);Me.applyQuaternion(ce);let Fe=Me.applyMatrix4(ue.matrixWorld),it=Fe.x,xt=Fe.y,Bt=Fe.z;var L,A;O==="x"?L=ie*(it-se[O])/Ee+U:O==="y"?L=ie*(xt-se[O])/Ee+U:L=ie*(Bt-se[O])/Ee+U,P==="x"?A=Q*(it-se[P])/We+Te:P==="y"?A=Q*(xt-se[P])/We+Te:A=Q*(Bt-se[P])/We+Te,L-=.5,A-=.5;let pn=L*yt-A*pt+.5,Xe=L*pt+A*yt+.5;c.setX(m(M,ee),pn),c.setY(m(M,ee),Xe)}}}o(Fz,"updateUVsLegacy");g();var Z5=class Z5{constructor(){b(this,"focusMesh");b(this,"dirty",!0)}};o(Z5,"FocusableComponent");var kp=Z5;function Wo(e,t,r){if(t!==void 0){if(e.type==="model"||e.type==="path"||e.type==="marker"||e.type==="label"||e.type==="geometry"||e.type==="group-container"||e.type==="custom-geometry")return t===!0?(e instanceof Vd&&e.components[1]===void 0?(e.components[1]=new e0,e.components[1].dirty=!0):e instanceof Hr&&e.components[2]===void 0?(e.components[2]=new e0,e.components[2].dirty=!0):e instanceof Bn&&e.components[0]===void 0&&(e.components[0]=new e0,e.components[0].dirty=!0),!0):(e instanceof Vd?e.components[1]=void 0:e instanceof Hr?e.components[2]=void 0:e instanceof Bn&&(e.components[0]=void 0),!0);if(e.type==="geometry-group"){let n;for(let i of e.userData.entities3D.values())n=r.geometry3DMap.get(i),Wo(n,t,r);return!0}}return!1}o(Wo,"updateInteractivity");function Nz(e,t,r){if(!(!(r!=null&&r.color)&&!("topColor"in r))){if(r!==void 0&&e.type==="geometry-group"){let n;for(let i of e.userData.entities3D.values())n=t.geometry3DMap.get(i),n&&mC(n,r);return!0}return!1}}o(Nz,"updateGroupColor");function rge(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].shading=t,e.components[1].dirty=!0)}o(rge,"updateShading");function Rz(e,t,r){if(r!==void 0&&e.type==="geometry-group"){for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i&&rge(i,r)}return!0}return!1}o(Rz,"updateGroupShading");function kz(e,t){t!==void 0&&e.type==="geometry"&&(t.showImage!==void 0&&(e.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(e.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}o(kz,"updateImageProps");function hC(e,t,r){if(r!==void 0){if(e.type==="geometry"){let n=e.components[1];if(n.height!==r)return n.height=r,n.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),!0}else if(e.type==="geometry-group"){for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&hC(i,t,r)}return!0}}return!1}o(hC,"updateHeight");function mC(e,t){if(t!==void 0){let r=!1;(e.type==="path"||e.type==="geometry")&&(t.initialColor!==void 0&&t.initialColor!==e.components[1].initialColor&&(e.components[1].initialColor=t.initialColor,r=!0),t.color!==void 0&&t.color!==e.components[1].color&&(e.components[1].color=t.color,r=!0,e.components[3]&&(e.components[3].color=mx(t.color),e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor,r=!0),r&&(e.components[1].dirty=!0))}}o(mC,"updateColor");function K5(e,t,r){t!==void 0&&(e.type==="label"||e.type==="marker"?e.updatePosition(r(t[1],t[0],t[2]||0)):e.type==="custom-geometry"&&e.components[0].position.copy(r(t[1],t[0],t[2]||0)))}o(K5,"updatePosition");function J5(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof Bn?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}o(J5,"updateParent");function Bz(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}o(Bz,"updateEnabled");function Gz(e,t,r){if(t!==void 0&&e.type==="marker"){let n=e.components[0];if(t.contentHTML!==void 0)return n.containerEl.innerHTML=t.contentHTML,n.contentHtml=t.contentHTML,!0;if(t.placement!==void 0&&(n.options.placement=t.placement,n.collisionDirty=!0),t.dynamicResize!==void 0)return n.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{S5.parse(t.options||{})}catch(i){return ae.error(i),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Wo(e,!1,r)):(n.pointerEvents="none",Wo(e,t.options.interactive,r))),jz(e,t.options.rank),!0}}return!1}o(Gz,"updateMarker");function jz(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=Yy(t),!0):!1}o(jz,"updateRank");function Uz(e,t,r){var n,i,a,u,c,f;if(t!==void 0&&e.type==="label"){let m=e.components[0];t.text!==void 0&&t.text!==m.text&&(m.text=t.text,m.textDirty=!0);try{k5((n=t.options)!=null?n:{})}catch(v){ae.error(v);return}_z(m.appearance,((i=t.options)==null?void 0:i.appearance)||{})&&(m.textDirty=!0),Cz(m.appearance,((a=t.options)==null?void 0:a.appearance)||{})&&(m.markerDirty=!0),oD(m.appearance,((u=t.options)==null?void 0:u.appearance)||{}),Wo(e,(c=t.options)==null?void 0:c.interactive,r),jz(e,(f=t.options)==null?void 0:f.rank)}}o(Uz,"updateLabel");function Vz(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}o(Vz,"updateHoverColor");function zz(e,t){if(t!==void 0){let r=e.components[2];if(e.type==="geometry"&&r!=null)return r.hover=t,r.dirty=!0,!0}return!1}o(zz,"updateHovered");function Q5(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}o(Q5,"updateFlipImageToFaceCamera");function Cc(e,t,r){if(r!==void 0)if(e.type==="model"||e.type==="path"||e.type==="geometry"||e.type==="custom-geometry"||e.type==="image"||e.type==="text3d"){r!==e.components[1].visible&&(e.components[1].visible=r,e.components[1].dirty=!0);let n=e.components[3];return n&&(n.dirty=!0),!0}else{if(e.type==="geometry-group")return e.setVisible(r),!0;if(e.type==="group-container"){if(e.visible!==r)return e.setVisible(r),r===!1&&e.traverse(n=>{if(n instanceof Z7){let i=t.geometry2DMap.get(n.userData.entityId);if(i){let a=i.components[0];a instanceof _c&&(a.canShow=r)}}}),!0}else if(e.type==="label")return e.components[0].visible=r,!0}return!1}o(Cc,"updateVisibility");function gx(e,t,r){if(r!==void 0)if(e.type==="geometry-group"){for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&gx(i,t,r)}return!0}else if(e.type==="group-container"){if(e.opacity!==r){e.setOpacity(r);let n=1;return e.parent instanceof Bn&&(n=e.parent.opacity),$z(e,t,n),!0}}else e instanceof Hr&&e.components[1].opacity!==r&&(e.components[1].opacity=r,e.components[1].dirty=!0);return!1}o(gx,"updateOpacity");function $z(e,t,r=1){if(e.type==="group-container"&&"children"in e&&e.children.length>0){let n=r*e.opacity;e.userData.computedOpacity=n;for(let i of e.children)(i instanceof al&&i.type==="geometry-group"||i instanceof Bn&&i.type==="group-container")&&$z(i,t,n)}else if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n),a;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(a=i.components[1],a.dirty=!0)}}o($z,"cascadeOpacity");function Hz(e,t,r){if(r!==void 0&&e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i&&eO(i,r)}}o(Hz,"updateGroupTexture");function eO(e,t){if(e.type==="geometry"){let r=!1,n=e.components[1];if((t==null?void 0:t.texture)!=null&&n.texture!==(t==null?void 0:t.texture)&&(n.texture=t.texture,r=!0),(t==null?void 0:t.topTexture)!=null&&n.topTexture!==(t==null?void 0:t.topTexture)&&(n.topTexture=t.topTexture,r=!0),r&&e.components[0]instanceof Ii){let i=e.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),e.components[1].dirty=!0,!0}}return!1}o(eO,"updateIndividualGeometryTexture");function Wz(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.opacity!==t){r.opacity=t;let n=e.components[0],i=e.components[3];i&&(i.dirty=!0),n.detached===!1&&(n.detached=!0,n.dirty=!0),r.dirty=!0;let a=e.parentObject3D;return(a==null?void 0:a.type)==="geometry-group"&&(a.userData.shadingDirty=!0),!0}}return!1}o(Wz,"updateIndividualGeometryOpacity");function s0(e,t){if(t!==void 0)if(e.type==="geometry"||e.type==="path"||e.type==="custom-geometry"){let r=e.components[1];if(r.altitude!==t)return r.altitude=t,r.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),!0}else{if(e.type==="group-container"&&e.altitude!==t)return e.setAltitude(t),!0;if(e.type==="geometry-group"&&e.altitude!==t)return e.setAltitude(t),!0}return!1}o(s0,"updateAltitude");function gC(e,t,r){if(r!==void 0){if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i instanceof Hr&&gC(i,t,r)}else if(e.type==="geometry"){let n=e.components[3],i=e.components[1];!n&&r===!0?e.components[3]=new o0(mx(i.color)):n&&(n.enabled=r,n.dirty=!0)}return!0}return!1}o(gC,"updateOutline");function yC(e,t){if(t!==void 0){let r,n=4;if(e.type==="geometry"?(r=e.components[4],n=4):e.type==="group-container"&&(r=e.components[1],n=1),t===!0&&r==null)return e.components[n]=new kp,!0;if(t===!1&&r!=null)return e.components[n]=void 0,!0}return!1}o(yC,"updateFocusable");function qz(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.renderOrder!==t){r.renderOrder=t;let n=e.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=t+1),r.dirty=!0,!0}}return!1}o(qz,"updateIndividualGeometryRenderOrder");function vC(e,t,r){if(r!=null){if(e.type==="geometry"){let n=e.components[1];n.side!==r&&(n.side=r,n.dirty=!0)}else if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i instanceof Hr&&vC(i,t,r)}}}o(vC,"updateSide");function Yz(e,t,r){let{visible:n,color:i}=r;if(e.type!=="path")return;let a=e.components[0];n!=null&&Cc(e,t,n),i!=null&&mC(e,{color:i}),Object.assign(a,tO(r)),tD(r)||(a.materialDirty=!0,r.width!=null&&(a.dirty=!0))}o(Yz,"handlePathUpdate");function tO(e){return RI(e,nge)}o(tO,"pickPathOptions");var nge=["animateArrowsOnPath","displayArrowsOnPath","width","accentColor","completeFraction","dashed","visibleThroughGeometry"];function Xz(e){if(!(e instanceof Hr&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}o(Xz,"assetGeometryIsText3D");var Zz=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function Kz(e,t,r){Cc(e,t,r.visible);let n=e.components[1],i=RI(r,Zz);"margin"in r&&ae.warn("update to margin is not supported atm"),"content"in r&&ae.warn("content update is not supported atm");try{fC.parse(i)}catch(a){ae.error(a);return}Object.keys(i).length>0&&(Object.assign(n,i),n.dirty=!0)}o(Kz,"handleText3DUpdate");var ige=["color","material","opacity","verticalOffset","rotation","position","scale"];function Jz(e,t){let r=RI(t,ige),n=e.components[1],i=e.components[0];Object.keys(r).length>0&&(r.material&&(n.material=r.material),r.opacity!=null&&(n.opacity=r.opacity),r.visible!=null&&(n.visible=r.visible),r.verticalOffset!=null&&(n.verticalOffset=r.verticalOffset),r.color!=null&&(n.color=r.color),r.position!=null&&(i.feature.geometry.coordinates=r.position,i.positionDirty=!0),r.rotation!=null&&(n.rotation=r.rotation),r.scale!=null&&(n.scale=r.scale),n.dirty=!0)}o(Jz,"handleModelStyleUpdate");var um,wc,xC,nd,Qz,vx,bC,e$,t$,xx,IC,bx,Ix,SC,rO=class rO{constructor(t){j(this,nd);j(this,um,null);j(this,wc);b(this,"getCurrentSceneGLTF",o(async t=>{let r=Y({onlyVisible:!0,binary:!0,light:!0,scale:1},t),n=await Re(this,nd,Qz).call(this),i=d(this,xC).call(this,r),a=await n.parseAsync(i,{trs:!1,maxTextureSize:1/0,onlyVisible:r.onlyVisible,binary:r.binary,scale:r.scale}),u;if(a instanceof ArrayBuffer)u=new Blob([a],{type:"application/octet-stream"});else{let c=JSON.stringify(a,null,2);u=new Blob([c],{type:"text/plain"})}return u},"getCurrentSceneGLTF"));j(this,xC,o(t=>{let{scale:r,light:n,onlyVisible:i}=t,a=new Sf,u=new ro().setFromObject(d(this,wc).entityScene);if(d(this,vx).call(this,d(this,wc).entityScene,a,i),n){let c=new PI(16777215,.3*Math.PI);c.position.set(0,Math.max(u.max.x,u.max.y)*r*.5,u.max.y*r*4),c.lookAt(0,0,-1),c.target.position.set(0,0,-1),c.add(c.target),a.add(c)}return a},"#getExportedScene"));j(this,vx,o((t,r,n)=>{t.material&&(t instanceof _I?Re(this,nd,e$).call(this,t).forEach(i=>r.add(i)):t instanceof lg&&r.add(Re(this,nd,t$).call(this,t))),t.children.forEach(i=>{(!n||i.visible)&&d(this,vx).call(this,i,r,n)})},"#processObject3D"));j(this,bC,o((t,r,n)=>{let i=new F7({color:new Hn(t),metalness:0});return i.opacity=r,i.transparent=n,i},"#createStandardMaterial"));j(this,xx,o(t=>{let{geometry:r,material:n,position:i,rotation:a,quaternion:u,scale:c}=t;if(!(r!=null&&r.isBufferGeometry))return t;let f=r.attributes.position,m=r.attributes.normal,v=r.attributes.uv;return d(this,IC).call(this,f,m),d(this,Ix).call(this,i,c,a,u),v&&d(this,SC).call(this,v),n!=null&&n.map&&r.type==="PlaneGeometry"&&(t.side=Xl),t},"#convertGeometry"));j(this,IC,o((t,r)=>{let n=new lt,i=new lt;for(let a=0;a<t.count;a++)n.fromBufferAttribute(t,a),d(this,bx).call(this,n),t.setXYZ(a,n.x,n.y,n.z),r&&(i.fromBufferAttribute(r,a),d(this,bx).call(this,i),r.setXYZ(a,i.x,i.y,i.z))},"#convertAttributes"));j(this,bx,o(t=>{let r=t.y;t.y=t.z,t.z=-r},"#convertVector"));j(this,Ix,o((t,r,n,i)=>{let a=t.y;t.y=t.z,t.z=-a;let u=r.y;if(r.y=r.z,r.z=u,n instanceof Zc)n.order="YXZ",n.set(n.x,n.y,n.z,n.order);else{let c=i.y;i.set(i.x,i.z,-c,i.w)}},"#convertObjectProperties"));j(this,SC,o(t=>{for(let r=0;r<t.count;r++){let n=t.getX(r),i=t.getY(r);t.setXY(r,n,i)}},"#convertUVs"));$(this,wc,t),d(this,wc).entityScene=t.entityScene,d(this,wc).geometry3DMap=t.geometry3DMap}destroy(){$(this,um,null)}};um=new WeakMap,wc=new WeakMap,xC=new WeakMap,nd=new WeakSet,Qz=o(async function(){if(!d(this,um)){let{GLTFExporter:t}=await import("./GLTFExporter-NKUJLBWQ.js");$(this,um,new t)}return d(this,um)},"#getGLTFExporter"),vx=new WeakMap,bC=new WeakMap,e$=o(function(t){var u,c;let r=[],i=((u=t.userData)!=null&&u.entities?Object.values((c=t.userData)==null?void 0:c.entities):[]).map(f=>d(this,wc).geometry3DMap.get(f)),a=new Map;return i.forEach(f=>{var C;if(!f||!(f instanceof Hr))return;let m=f.components[1],v=f.components[2];if(!m.visible||m instanceof Wu&&m.opacity===0||m instanceof v1||m instanceof jI)return;let x=v!=null&&v.hover?m.hoverColor||d(this,wc).hoverColor:m.color,I="".concat(x,"-").concat(m.opacity,"-").concat(Number(m.visible));a.has(I)||a.set(I,[]),(C=a.get(I))==null||C.push(f)}),a.forEach((f,m)=>{let[v,x,I]=m.split("-"),C=f.reduce((L,A)=>{if(A.type==="custom-geometry")return L;let M=A.components[0];return"geometry"in M&&M.geometry instanceof SI&&L.push(M.geometry),L},[]),T=d(this,bC).call(this,v,Number(x),t.material.transparent),O=ll(C,!0),P=new Vt(O,T);P.position.copy(t.position),P.rotation.copy(t.rotation),P.scale.copy(t.scale),P.visible=!!I,d(this,Ix).call(this,P.position,P.scale,P.rotation,P.quaternion),r.push(d(this,xx).call(this,P))}),r},"#processBatchedMesh"),t$=o(function(t){let r=t.geometry.clone(),n=t.material,i=new po({color:n.color,side:Xl});i.opacity=n.opacity,i.transparent=n.transparent;let a=new lg(r,i);return a.position.copy(t.position),a.rotation.copy(t.rotation),a.scale.copy(t.scale),a.visible=t.visible,d(this,xx).call(this,a)},"#processLineSegments"),xx=new WeakMap,IC=new WeakMap,bx=new WeakMap,Ix=new WeakMap,SC=new WeakMap,o(rO,"ExporterSystem");var yx=rO;g();g();g();var oO=Mn(p$());function f$(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}o(f$,"JSClipperError");f$.prototype=Error.prototype;oO.default.Error=function(e){throw new f$(e)};var So=oO.default;var Kye="gray",Jye=.1,Cx=100,sO=new So.ClipperOffset;function Qye(e,t){sO.Clear(),t/=2;let r=e.map(i=>({X:i.x*Cx,Y:i.y*Cx}));sO.AddPath(r,So.JoinType.jtMiter,So.EndType.etClosedPolygon);let n=new So.Paths;return sO.Execute(n,t*Cx),n.length?n.map(a=>a.map(u=>({x:u.X/Cx,y:u.Y/Cx}))):[e]}o(Qye,"offset");function EC(e,t,r){var I,C,T,O,P;let{color:n=Kye,opacity:i=1,altitude:a=0,height:u=Jye}=r||{};Array.isArray(i)&&(i=1);let c={min:{x:1/0,y:1/0,z:a},max:{x:-1/0,y:-1/0,z:u+a},center:{x:0,y:0,z:(u+a)/2}},m=e.geometry.coordinates[0].map(L=>{let A=t(L[1],L[0]);return c.min.x=Math.min(c.min.x,A.x),c.min.y=Math.min(c.min.y,A.y),c.max.x=Math.max(c.max.x,A.x),c.max.y=Math.max(c.max.y,A.y),A});((C=(I=e.properties)==null?void 0:I.style)==null?void 0:C.edgeOffset)!=null&&e.properties.style.edgeOffset!==0||((T=e.properties)==null?void 0:T.image)!=null?m=Qye(m,((P=(O=e.properties)==null?void 0:O.style)==null?void 0:P.edgeOffset)||0):m=[m];let v=[];for(let L of m){let A=new ju;A.moveTo(L[0].x,L[0].y),L.slice(1).forEach(H=>A.lineTo(H.x,H.y)),A.lineTo(L[0].x,L[0].y);let M=e.geometry.coordinates.slice(1);A.holes=M.map(H=>{let z=H.map(X=>t(X[1],X[0])),R=new Cf;return R.moveTo(z[0].x,z[0].y),z.slice(1).forEach(X=>R.lineTo(X.x,X.y)),R.lineTo(z[0].x,z[0].y),R});let N={bevelEnabled:!1,depth:u},B=new Uu(A,N);B.userData={style:{color:n,opacity:i}},v.push(B)}if(v.length===1)return v[0];let x=ll(v);return x.userData={style:{color:n,opacity:i},_split:!0},x}o(EC,"renderPolygonGeometry");g();var e0e="gray",t0e=.1;function MC(e,t,r){let{color:n=e0e,opacity:i=1,altitude:a=0,height:u=t0e}=r||{};Array.isArray(i)&&(i=1);let c={min:{x:1/0,y:1/0,z:a},max:{x:-1/0,y:-1/0,z:u+a}},f={bevelEnabled:!1,depth:u},m=[];e.geometry.coordinates.forEach(x=>{let I=new ju,C=x[0].map(P=>{let L=t(P[1],P[0]);return c.min.x=Math.min(c.min.x,L.x),c.min.y=Math.min(c.min.y,L.y),c.max.x=Math.max(c.max.x,L.x),c.max.y=Math.max(c.max.y,L.y),L});I.moveTo(C[0].x,C[0].y),C.slice(1).forEach(P=>I.lineTo(P.x,P.y)),I.lineTo(C[0].x,C[0].y);let T=x.slice(1);I.holes=T.map(P=>{let L=P.map(M=>t(M[1],M[0])),A=new Cf;return A.moveTo(L[0].x,L[0].y),L.slice(1).forEach(M=>A.lineTo(M.x,M.y)),A.lineTo(L[0].x,L[0].y),A});let O=new Uu(I,f);m.push(O)});let v=ll(m);return v.translate(0,0,a||0),v.userData={style:{color:n,opacity:i}},v}o(MC,"renderMultiPolygonGeometry");g();var r0e="gray",aO=new So.ClipperOffset,ea=100;function d$(e,t,r){let{color:n=r0e,opacity:i=1,width:a=1,join:u="round",cap:c="round",height:f=.01,altitude:m=0}=r||{};Array.isArray(i)&&(i=0);let v=[];for(let O=0;O<e.geometry.coordinates.length-1;O++){let P=t(e.geometry.coordinates[O][1],e.geometry.coordinates[O][0]),L=t(e.geometry.coordinates[O+1][1],e.geometry.coordinates[O+1][0]);v.push([P,L])}aO.AddPaths(v.map(O=>O.map(P=>({X:P.x*ea,Y:P.y*ea}))),u==="round"?So.JoinType.jsRound:u==="miter"?So.JoinType.jsMiter:So.JoinType.jsSquare,c==="round"?So.EndType.etOpenRound:c==="butt"?So.EndType.etOpenButt:So.EndType.etOpenSquare);let x=new So.PolyTree;aO.Execute(x,a/2*ea);let I=[],C={bevelEnabled:!1,depth:f};for(let O of x.m_AllPolys){let P=new ju;if(O.IsHole())continue;let L=O.m_polygon;P.moveTo(L[0].X/ea,L[0].Y/ea),L.slice(1).forEach(A=>P.lineTo(A.X/ea,A.Y/ea)),P.lineTo(L[0].X/ea,L[0].Y/ea),P.holes=O.m_Childs.map(A=>{let M=new Cf,N=A.m_polygon;return M.moveTo(N[0].X/ea,N[0].Y/ea),N.slice(1).forEach(B=>M.lineTo(B.X/ea,B.Y/ea)),M.lineTo(N[0].X/ea,N[0].Y/ea),M}),I.push(new Uu(P,C))}let T=ll(I);return T.translate(0,0,m||0),T.userData={style:{color:n,opacity:i}},aO.Clear(),T}o(d$,"renderLineStringGeometry");g();var ta=100,n0e=.22,i0e=.01;function h$(e,t,r={}){let{width:n=n0e,height:i=i0e,color:a="gray",opacity:u=1,altitude:c=0}=r,f={min:{x:1/0,y:1/0,z:c},max:{x:-1/0,y:-1/0,z:c+i}},m={bevelEnabled:!1,depth:i},v=new So.ClipperOffset,x=e.geometry.coordinates.map(O=>O.map(P=>t(P[1],P[0])));v.AddPaths(x.map(O=>O.map(P=>({X:P.x*ta,Y:P.y*ta}))),So.JoinType.jsMiter,So.EndType.etOpenRound);let I=new So.PolyTree;v.Execute(I,n/2*ta);let C=[];for(let O of I.m_AllPolys){let P=new ju;if(O.IsHole())continue;f.min.x=Math.min(f.min.x,O.m_polygon[0].X),f.min.y=Math.min(f.min.y,O.m_polygon[0].Y),f.max.x=Math.max(f.max.x,O.m_polygon[0].X),f.max.y=Math.max(f.max.y,O.m_polygon[0].Y);let L=O.m_polygon;P.moveTo(L[0].X/ta,L[0].Y/ta),L.slice(1).forEach(A=>P.lineTo(A.X/ta,A.Y/ta)),P.lineTo(L[0].X/ta,L[0].Y/ta),P.holes=O.m_Childs.map(A=>{let M=new Cf,N=A.m_polygon;return M.moveTo(N[0].X/ta,N[0].Y/ta),N.slice(1).forEach(B=>M.lineTo(B.X/ta,B.Y/ta)),M.lineTo(N[0].X/ta,N[0].Y/ta),M}),C.push(new Uu(P,m))}let T=ll(C);return T.translate(0,0,c||0),T.userData={style:{color:a,opacity:u}},v.Clear(),T}o(h$,"renderMultiLineStringGeometry");g();g();var u0=W.object({type:W.enum(["Point"]),coordinates:W.array(W.number()).min(2).max(3)});var lO=W.object({rotation:W.array(W.number()).length(3).optional(),altitude:W.number().optional(),scale:W.array(W.number()).length(3).optional(),interactive:W.boolean().optional(),verticalOffset:W.number().optional(),id:W.union([W.number(),W.string()]).optional()}),o0e=W.object({type:W.enum(["Feature"]),geometry:u0,properties:lO}),s0e=W.object({type:W.enum(["FeatureCollection"]),features:W.array(o0e)}),uO=W.object({color:W.string()}),a0e=W.object({url:W.string(),color:W.string().optional(),opacity:W.number().optional(),material:W.record(W.string(),uO).optional()});function g$(e,t,r){W.union([W.number(),W.string()]).parse(e),s0e.parse(t),a0e.parse(r)}o(g$,"validateModelGroup");var wx,Px,cO=class cO{constructor(t){b(this,"mesh");b(this,"type","model");b(this,"positionDirty",!0);b(this,"outline");b(this,"geometry");b(this,"material");b(this,"feature");b(this,"instanceIndex",-1);b(this,"visible",!0);b(this,"color",new Hn);b(this,"position",new lt);j(this,wx,0);j(this,Px,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return d(this,wx)}set altitude(t){this.mesh&&(this.mesh.position.z=t,$(this,wx,t))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(t){this.mesh&&this.mesh.rotation.set(Br.degToRad(t[0]),Br.degToRad(t[1]),Br.degToRad(t[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(t){this.mesh&&this.mesh.scale.set(t[0],t[1],t[2])}get opacity(){return d(this,Px)}set opacity(t){var r,n,i;if(this.mesh){if(this.mesh.children[0]instanceof _f){for(let a of this.mesh.children)if(a instanceof _f){((r=a.userData)==null?void 0:r.originalOpacity)===void 0&&(a.userData.originalOpacity=a.material.opacity);let u=jd(t,0,(n=a.userData)==null?void 0:n.originalOpacity,0,1);a.material.opacity=u,a.material.transparent=u<1,a.material.needsUpdate=!0}}else(i=this.mesh)==null||i.traverse(a=>{a instanceof Vt&&a.material&&(Array.isArray(a.material)?a.material.forEach(u=>{m$(u,t)}):m$(a.material,t))});$(this,Px,t)}}};wx=new WeakMap,Px=new WeakMap,o(cO,"ModelComponent");var sd=cO;function m$(e,t){e.opacity!==t&&(t===1?(e.opacity=1,e.transparent=!1):(e.opacity=t,e.transparent=!0),e.needsUpdate=!0)}o(m$,"updateMaterialOpacity");g();function OC(e){var c,f;let t=e.components[0],r=e.components[1];r.opacity!=null&&r.opacity!==t.opacity&&(t.opacity=r.opacity);let n=r.material,i=r.color;if(n||i){let m=l0e(i,n);(c=t.mesh)==null||c.traverse(v=>{v instanceof Vt&&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=(f=t.feature.geometry.coordinates[2])!=null?f:0,u=r.verticalOffset+a;t.altitude!==u&&(t.altitude=u),r.visible!==t.visible&&(t.visible=r.visible),r.rotation&&t.setRotation(r.rotation),r.scale&&t.setScale(r.scale)}o(OC,"applyModelGeometryStyle");function l0e(e,t){let r={};if(e&&Object.assign(r,{Default:{color:e},Fabric:{color:e},Mpdn_Logo:{color:e},CouchLogo:{color:e}}),t)for(let n in t)t[n].color&&(r[n]?r[n].color=t[n].color:r[n]={color:t[n].color});return r}o(l0e,"consolidateColorAndMaterial");function y$(e,t){var u,c;let r=e.components[0],i=(u=e.components[1].verticalOffset)!=null?u:0,a=r.feature.geometry.coordinates.slice();a[2]=((c=a[2])!=null?c:0)+i,r.mesh?r.mesh.position.copy(t(a)):r.position.copy(t(a))}o(y$,"applyModelPosition");function v$(e){return e instanceof Ii?e.material:null}o(v$,"getMaterial");function x$(e){return e.side===h1?"back":e.side===Rd?"front":"double"}o(x$,"getMaterialSide");function b$(e,t){e.side=t==="back"?h1:t==="front"?Rd:Xl}o(b$,"setMaterialSide");function u0e(e){let{color:t,opacity:r,topColor:n,texture:i,topTexture:a}=e;return"".concat(t).concat(r).concat(n||"").concat(i||"").concat(a||"")}o(u0e,"generateIndex");var pO=class pO extends Rt{constructor(r,n){super();b(this,"state");b(this,"convertTo3DMapPosition");b(this,"loader");b(this,"optimizePromise",[]);this.state=r,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:r}=await import("./GLTFLoader-BQHL354R.js");return this.loader=new r,this.loader}createEntityFromFeature(r,n,i){var c,f;let a=new Ii(n),u=new Hr(a,new Wu(Ie(Y({},i),{url:(f=(c=n.properties)==null?void 0:c.image)==null?void 0:f.path})));return i!=null&&i.outline&&(u.components[3]=new o0(mx(i.color))),i!=null&&i.focusable&&(u.components[4]=new kp),u.id=r,u}createModelFromFeature(r,n,i){let a=new sd(n),u=Y({},i);n.properties.verticalOffset!=null&&(u.verticalOffset=n.properties.verticalOffset),n.properties.rotation!=null&&(u.rotation=n.properties.rotation),n.properties.scale!=null&&(u.scale=n.properties.scale);let c=new jI(u),f=new Hr(a,c);return f.id=r,f}populateEntityMesh(r,n){let i=r.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=r.components[1].height,i.dirty=!1}async populateModelGroup(r,n,i){let a=new La,u=new Zc,c=new Bd,f=new lt,m=new eu,v=await this.getGLTFLoader(),x=new Promise(I=>{v.load(n,C=>{"entities3D"in i.userData&&(i.userData.entities3D.size>1?C.scene.traverse(T=>{let O=T;if("isMesh"in O&&O.isMesh===!0){let P=new _f(O.geometry,O.material,r.size);P.userData={entities:{}},m.add(P),i.add(m)}}):(C.scene.traverse(T=>{"isMesh"in T&&T.isMesh===!0&&(T.position.set(0,0,0),T.rotation.set(0,0,0),T.scale.set(1,1,1),T.updateMatrix())}),m.add(C.scene),i.add(m),m.userData.isSingleModel=!0,m.userData.entityId=r.values().next().value,m.userData.type="model")),I()})});return this.optimizePromise.push(x.then(()=>{var T,O,P,L,A,M,N,B,H,z,R,X;let I=0,C;for(let ie of r.values()){if(C=this.state.geometry3DMap.get(ie),!C||(C==null?void 0:C.type)!=="model")continue;let Q=C.components[0],U=C.components[1],Te=C.components[0].feature;Q.mesh=m,Q.instanceIndex=I,OC(C),C.components[1].dirty=!1;let{x:oe,y:fe}=this.convertTo3DMapPosition(Te.geometry.coordinates[1],Te.geometry.coordinates[0],0);Q.position.set(oe,fe,Q.altitude),u.set(Br.degToRad((O=(T=U.rotation)==null?void 0:T[0])!=null?O:yg[0]),Br.degToRad((L=(P=U.rotation)==null?void 0:P[1])!=null?L:yg[1]),Br.degToRad((M=(A=U.rotation)==null?void 0:A[2])!=null?M:yg[2])),f.set((B=(N=U.scale)==null?void 0:N[0])!=null?B:gg[0],(z=(H=U.scale)==null?void 0:H[1])!=null?z:gg[1],(X=(R=U.scale)==null?void 0:R[2])!=null?X:gg[2]),c.setFromEuler(u),a.compose(Q.position,c,f),m.children.forEach(se=>{!C||(C==null?void 0:C.type)!=="model"||!(se instanceof _f)||(se.setMatrixAt(I,a),se.userData.entities[I]=C.id)}),Q.mesh.userData.isSingleModel&&(Q.mesh.matrix.copy(a),Q.mesh.matrix.decompose(Q.mesh.position,Q.mesh.quaternion,Q.mesh.scale)),I++}this.publish("model-loaded")})),m}populateEntityGroup(r){var c;let n,i,a,u;for(let f of r.values())u=this.state.geometry3DMap.get(f),u.components[0]instanceof Ii&&(i=u.components[0].feature,a=u.components[1],i.geometry.type==="Polygon"?(n=EC(i,this.convertTo3DMapPosition,a),(c=i.properties)!=null&&c.textures&&i.properties.textures.length>0&&Fz(n,i.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(u,n)):i.geometry.type==="MultiPolygon"?(n=MC(i,this.convertTo3DMapPosition,a),this.populateEntityMesh(u,n)):i.geometry.type==="LineString"?(n=d$(i,this.convertTo3DMapPosition,a),this.populateEntityMesh(u,n)):i.geometry.type==="MultiLineString"&&(n=h$(i,this.convertTo3DMapPosition,a),this.populateEntityMesh(u,n)));return r}update(){var r;for(let n of this.state.geometryGroupIdsToLoad.values()){let i=this.state.geometry3DMap.get(n);if(i instanceof al&&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(c){ae.warn(c)}let a,u={};for(let c of i.userData.entities3D.values()){a=this.state.geometry3DMap.get(c);let f=a==null?void 0:a.components[0];if((a==null?void 0:a.type)==="geometry"){let m=a.components[1],v=u0e(m);u[v]===void 0&&(u[v]={style:m,entities:[]}),u[v].entities.push(a)}else f&&"mesh"in f&&f.mesh&&((r=f.mesh)==null?void 0:r.parent)!==i&&i.add(f.mesh)}for(let c in u){let f=Az(u[c].entities,u[c].style);i.add(f)}for(let c of i.userData.entities3D.values())if(a=this.state.geometry3DMap.get(c),a!=null&&a.entities2D.size>0)for(let f of a.entities2D.values())f&&(a.attach(f),this.publish("geometry-2d-added"));this.publish("geometry-group-added"),i.userData.dirty=!1}}return Promise.resolve()}};o(pO,"MeshCreationAndOptimizationSystem");var LC=pO;g();var fO=class fO{constructor(t,r){b(this,"state");b(this,"dirty",!0);b(this,"domTree");this.state=t,this.domTree=r}update(){if(this.dirty){let t;for(let r of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(r.userData.entityId),t){let n=t.components[0];(!n.enabled||!n.visible||!this.state.geometry2DIdsInScene.has(r.userData.entityId))&&this.domTree.removeChild(r)}else this.domTree.removeChild(r);for(let r of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(r),t){let n=t.components[0];n instanceof Sc&&n.enabled&&n.markerContainer&&!this.domTree.contains(n.markerContainer)&&(n.markerContainer.userData={entityId:t.id},this.domTree.appendChild(n.markerContainer),n.updateDimensions())}this.dirty=!1}}};o(fO,"DOMVisibilitySystem");var DC=fO;g();var dO=class dO{constructor(t,r){b(this,"state");b(this,"project");this.state=t,this.project=r}update(){let t,r=0,n,i;for(let a of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(a),t){i=t.components[0];let u=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(u instanceof Hr)if(this.state.geometry3DIdsInScene.has(u.id)){n=u.components[1],i=t.components[0],(n.dirty||t.components[0].attachedDirty)&&(r=n.height,t.setAltitude(r));let c=n.visible;i.visible!==c&&(i.visible=c)}else i.visible===!0&&(i.visible=!1);this.project(t.components[0].projection,t.position),t.components[0].attachedDirty=!1}}};o(dO,"TwoDProjectionSystem");var AC=dO;g();g();var c0e=o(function(){let t,r;return n=>{if((!r||!r)&&(t=document.createElement("canvas"),t.width=500*n,t.height=500*n,t.style.width="500px",t.style.height="500px",r=t.getContext("2d")),!r)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:r}}},"createMeasureCanvasContext")(),I$=o(({text:e,size:t,maxWidth:r,pixelRatio:n,maxLines:i=2,lineHeight:a=1.2,options:u={strokeText:!0}})=>{let c="bold ".concat(t*n,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:f}=c0e(n);f.font=c;let m=[],v=e.split(" "),x=0,I=0,C=0;for(;I<v.length;){let L=v[I];if(x===i&&x>0){m[x-1]+="...";break}if(m[x]==null&&(m[x]=L,I++),v.length===1){m[x]=L;break}if(v[I]==null)break;let{width:A}=f.measureText(m[x]+" "+v[I]);A<=r*n?(m[x]+=" "+v[I],I++):x++}m.forEach(L=>{let{width:A}=f.measureText(L);C=Math.max(A,C)});let T=t*n*a,O=m.length*T;return{maxWidth:C,maxHeight:O,lines:m.length,draw:o((L,A,M)=>{m.length===1?(u.strokeText&&L.strokeText(m[0],A,M),L.fillText(m[0],A,M)):(u.strokeText&&(L.strokeText(m[0],A,M-T/2),L.strokeText(m[1],A,M+T/2)),L.fillText(m[0],A,M-T/2),L.fillText(m[1],A,M+T/2))},"draw")}},"shaveText");g();function S$(e){let t=new Image;return e&&(/<svg[\s\S]*>/i.test(e)?t.src="data:image/svg+xml;base64,".concat(btoa(e)):t.src=e),t}o(S$,"createImage");var hO=class hO extends Rt{constructor(r,n,i){super();b(this,"dirty",!1);b(this,"state");b(this,"colliderContext");b(this,"colliderCanvas");b(this,"transformRequestFunc");b(this,"transformRequest",o(async r=>this.transformRequestFunc?await this.transformRequestFunc(r):{url:r},"transformRequest"));b(this,"pinCache",{});b(this,"imageCache",{});b(this,"imagePromiseCache",{});b(this,"imageDimensionsCache",{});b(this,"textCache",{});b(this,"update",o(r=>{let n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let i,a,u,c,f,m,v;for(let x of this.state.geometry2DIdsInScene)if(v=this.state.geometry2DMap.get(x),v!=null&&(m=v.components[0],m instanceof _c&&!v.disposed)){if(f=m.appearance.iconVisibleAtZoomLevel,m.appearance.icon!=null&&f&&r>=f!==m.iconVisible&&(m.iconVisible=r>=f,m.dirty=!0),(m.dirty||this.dirty)&&m.calculateMarkerSize(),a={active:m.appearance.pinColor,inactive:m.appearance.pinColorInactive},u={active:m.appearance.pinOutlineColor,inactive:m.appearance.pinOutlineColorInactive},c=zu(m.markerSize,2),i="".concat(a.active,"-").concat(a.inactive,"-").concat(u.active,"-").concat(u.inactive,"-").concat(c,"-").concat(m.iconVisible),m.labelCacheId=i,(!this.pinCache[i]||this.dirty)&&(this.prepare(m,i,this.colliderContext),m.dirty=!0),(m.appearance.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:C,width:T,height:O}=this.processText(m.text,m.appearance.textSize,m.appearance.maxWidth,m.appearance.maxLines,m.appearance.lineHeight);["left","center","right"].forEach(P=>{this.textCache[m.id][P]=this.textToCanvas(C,m.appearance.textSize,P,T,O,m.appearance.textColor,m.appearance.textOutlineColor)}),m.dimensions={width:Math.ceil(T/n),height:Math.ceil(O/n)}}let I=1;if(m.appearance.iconScale)if(typeof m.appearance.iconScale=="number")I=m.appearance.iconScale;else{let{on:C,input:T,output:O,easing:P}=m.appearance.iconScale;C==="zoom-level"?I=W7(r,T,O,P!=null?P:"linear"):ae.warn("Unsupported interpolation property: ".concat(C))}m.recomputeCurrentStrategy(m.iconVisible?I: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",o((r,n,i,a,u)=>{let c=this.state.pixelRatio,{draw:f,maxWidth:m,maxHeight:v}=I$({text:r,size:n,pixelRatio:c,maxWidth:i,maxLines:a,lineHeight:u});return{textDrawFn:f,width:m+2.5*c*2,height:v+2.5*c*2}},"processText"));b(this,"textToCanvas",o((r,n,i,a,u,c,f)=>{let m=this.state.pixelRatio,v,x=a,I=u;window.OffscreenCanvas!=null&&!eD()?v=new OffscreenCanvas(x,I):(v=document.createElement("canvas"),v.width=x,v.height=I,v.style.width=x+"px",v.style.height=I+"px");let C=v.getContext("2d",{willReadFrequently:!0});if(!C)return;C.textAlign=i,C.font="bold ".concat(n*m,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),C.textBaseline="middle",C.lineJoin="miter",C.miterLimit=2,C.strokeStyle="white",C.lineWidth=2.5*m,C.fillStyle=c,C.strokeStyle=f;let T=i==="left"?0:i==="center"?x/2:x-2.5*m/2;return r(C,T,(I+2.5*m/2)/2),v},"textToCanvas"));b(this,"cacheImage",o(r=>{if(!r.appearance.icon)return;let n=lD(r.appearance.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(i=>{this.transformRequest(r.appearance.icon).then(a=>{let u=S$(a.url);u.onload=()=>{this.imageCache[n]=u,this.publish("img:loaded"),i(u)}})})),r.imageHash!==n&&(r.imageHash=n,this.imagePromiseCache[n].then(()=>{r.dirty=!0}))},"cacheImage"));b(this,"createPinCanvas",o((r,n,i,a,u=1)=>{let c,f=this.state.pixelRatio,m=r.totalMarkerSize*2*f*u;window.OffscreenCanvas!=null?c=new OffscreenCanvas(m,m):(c=document.createElement("canvas"),c.width=m,c.height=m,c.style.width=m/f+"px",c.style.height=m/f+"px");let v=c.getContext("2d");return v.shadowColor="rgba(0,0,0,0.3)",v.shadowOffsetY=2*f,v.shadowBlur=5*f,v.beginPath(),v.arc(m/2,m/2,(n/2+2.5*f/2)*u,0,2*Math.PI),v.fillStyle=i,v.fill(),v.beginPath(),v.arc(m/2,m/2,n/2*u,0,2*Math.PI),v.shadowColor="transparent",v.fillStyle=a,v.fill(),c},"createPinCanvas"));b(this,"prepare",o((r,n,i)=>{let a=this.state.pixelRatio;i.lineWidth=4*a;let u=typeof r.appearance.iconScale=="number"?[r.appearance.iconScale]:r.appearance.iconScale==null?[]:r.appearance.iconScale.output,c=u.length>0?Math.max(...u):void 0,f=this.createPinCanvas(r,r.markerSize,r.appearance.pinOutlineColor,r.appearance.pinColor,c),m=this.createPinCanvas(r,r.iconVisible?r.markerSize:3.5*a,r.appearance.pinOutlineColorInactive,r.appearance.pinColorInactive,c);this.pinCache[n]=[f,m]},"prepare"));this.state=r,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=i}draw(r,n,i){var m;if(!r.canShow||!r.visible)return;i.save(),i.globalAlpha=r.opacity;let a=this.state.pixelRatio,u=r.projection.x*a,c=r.projection.y*a,f=r.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1];if(i.drawImage(f,u-r.scaledMarkerSize*a,c-r.scaledMarkerSize*a,r.scaledMarkerSize*2*a,r.scaledMarkerSize*2*a),r.appearance.icon&&r.iconVisible&&r.imageHash&&r.appearance.iconSize&&this.imageCache[r.imageHash]){let v=this.imageCache[r.imageHash],x=(r.scaledMarkerSize-r.scaledIconPadding)*a,I=r.appearance.iconFit,C=x,T=x,O="".concat(r.imageHash,"_").concat(I);if(this.imageDimensionsCache[O])C=this.imageDimensionsCache[O].width,T=this.imageDimensionsCache[O].height;else{let P=v.width*a,L=v.height*a;if(I==="contain"){let A=Math.sqrt(P**2+L**2),M=x/A;C=P*M,T=L*M}if(I==="cover"){let A=x/P,M=x/L,N=Math.max(A,M);C=P*N,T=L*N}}i.save(),i.beginPath(),i.arc(u,c,x/2,0,2*Math.PI),i.closePath(),((m=r==null?void 0:r.appearance)==null?void 0:m.iconOverflow)!=="visible"&&i.clip(),i.drawImage(v,u-C/2,c-T/2,C,T),i.restore()}r.style.textLabelVisible&&r.style.textAlign!=null&&r.style.left!=null&&r.style.top!=null&&i.drawImage(this.textCache[r.id][r.style.textAlign],u+r.style.left*a,c+r.style.top*a),i.restore()}};o(hO,"TwoDDrawSystem");var FC=hO;g();g();var ad=class ad{constructor(){b(this,"loader");this.loader=new ug}static getInstance(){return ad.instance||(ad.instance=new ad),ad.instance}getLoader(){return this.loader}load(t){return new Promise((r,n)=>{this.loader.load(t,r,void 0,n)})}};o(ad,"TextureLoaderSingleton"),b(ad,"instance");var mO=ad,ld=mO.getInstance();function h0e(e,t){let r=e.components[2],n=e.components[1];return r!=null&&r.hover?[n.hoverColor||t,n.hoverColor||t]:[n.color,n.topColor||n.color]}o(h0e,"processColor");var dm,Ex,gO=class gO extends Rt{constructor(r,n){super();j(this,dm);b(this,"state");b(this,"convertTo3DMapPosition");b(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=n,this.state=r}processTextures(r,n,i){var a;if(n.texture!==r.texture&&n.texture!==""&&Re(this,dm,Ex).call(this,n.texture,r,"texture"),n.topTexture!==r.topTexture&&n.topTexture!==""&&Re(this,dm,Ex).call(this,n.topTexture,r,"topTexture"),(r.texture==null||r.topTexture==null)&&Array.isArray((a=r.feature.properties)==null?void 0:a.textures)&&r.feature.properties.textures.length>0)for(let u of r.feature.properties.textures)u.face==="top"&&r.topTexture!==u.path?Re(this,dm,Ex).call(this,u.path,r,"topTexture"):u.face==="side"&&r.texture!==u.path&&Re(this,dm,Ex).call(this,u.path,r,"texture"),r.blendTexture=!0;(r.texture!=null||r.topTexture!=null)&&(i!=null&&i.hover&&r.texturesVisible?r.hideTextures():r.texturesVisible||r.showTextures(),n.texture===""&&r.removeSideTexture(),n.topTexture===""&&r.removeTopTexture())}update(){var a,u,c,f,m,v,x,I,C,T,O,P,L,A,M,N,B;let r,n,i;for(let H of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(H),i&&(i.type==="geometry"||i.type==="custom-geometry")&&((a=i.components[1])!=null&&a.dirty||(u=i.components[2])!=null&&u.dirty)){let z=i.components[0],R=i.components[1];n=i.components[2];let X=h0e(i,this.state.hoverColor);z.setColor(X[0],X[1]);let ie=v$(z);if(R.visible!==z.visible&&(z.visible=R.visible,z instanceof Ii&&z.textMesh)){let U=this.state.geometry3DMap.get(z.textMesh.userData.entityId);(U==null?void 0:U.type)==="text3d"&&U.components[0].polygonEntityId!=null&&(U.components[0].visible=R.visible)}R.altitude!==z.altitude&&(z.altitude=R.altitude);let Q=R.opacity*hg(i);Q!==z.opacity&&(z.opacity=Q),R.renderOrder!==z.renderOrder&&(z.renderOrder=R.renderOrder),ie&&R.side!==x$(ie)&&b$(ie,R.side),z instanceof Ii&&R.shading!=null&&(((c=R.shading)==null?void 0:c.start)!==(ie==null?void 0:ie.getGradientShading().start)||((f=R.shading)==null?void 0:f.end)!==(ie==null?void 0:ie.getGradientShading().end)||((m=R.shading)==null?void 0:m.intensity)!==(ie==null?void 0:ie.getGradientShading().intensity))&&(ie==null||ie.setGradientShading((x=(v=R.shading)==null?void 0:v.start)!=null?x:0,(C=(I=R.shading)==null?void 0:I.end)!=null?C:0,(O=(T=R.shading)==null?void 0:T.intensity)!=null?O:0)),R.dirty=!1,z instanceof Ii&&this.processTextures(z,R,n),i.components[2]&&(i.components[2].dirty=!1)}else if((i==null?void 0:i.type)==="model")i.components[1].dirty&&(OC(i),i.components[1].dirty=!1),i.components[0].positionDirty&&(y$(i,this.convertTo3DMapPosition),i.components[0].positionDirty=!1);else if((i==null?void 0:i.type)==="image"&&((P=i.components[1])!=null&&P.dirty)){r=i.components[0];let z=i.components[1];z.visible!==r.visible&&(r.visible=z.visible),z.dirty=!1}else if((i==null?void 0:i.type)==="text3d"&&((L=i.components[1])!=null&&L.dirty)&&i.components[0].polygonEntityId!=null){r=i.components[0];let z=i.components[1];z.visible!=null&&z.visible!==r.visible&&(r.visible=z.visible);let{textMesh:R}=r;if(R){Object.assign(R,z.getState());let X=(A=z.hoverColor)!=null?A:this.state.text3dHoverColor;R.color=z.hoverByPolygon?X:(M=z.color)!=null?M:mg.color,R.outlineColor=z.hoverByPolygon?X:(N=z.outlineColor)!=null?N:mg.outlineColor,R.strokeColor=z.hoverByPolygon?X:(B=z.strokeColor)!=null?B:mg.strokeColor}z.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async r=>{(await r).dispose()}),this.textureLoadingCache.clear()}};dm=new WeakSet,Ex=o(async function(r,n,i){if(!(!r||!n.showTextures))if(this.textureLoadingCache.has(r)){i==="topTexture"?n.topTexture=await this.textureLoadingCache.get(r):n.texture=await this.textureLoadingCache.get(r),n.showTextures();return}else{let a=new Promise((u,c)=>{ld.getLoader().load(r,f=>{i==="topTexture"?n.topTexture=f:n.texture=f,n.showTextures(),this.publish("texture-loaded"),u(f)},void 0,()=>{ae.error("Failed to load texture: ".concat(r)),c("Failed to load texture: ".concat(r))})});this.textureLoadingCache.set(r,a)}},"#loadTexture"),o(gO,"DrawSystem");var NC=gO;g();var yO=class yO extends Rt{constructor(r){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",o(()=>{this.animating.clear();let r,n;for(let i of this.state.geometry2DIdsInScene)r=this.state.geometry2DMap.get(i),r&&(n=r.components[0],n instanceof _c&&(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=r,this.playAnimations=this._playAnimations}_playAnimations(){let r=performance.now();for(let[n,[i,a]]of this.animating.entries()){let u=a===1?this.showDuration:this.hideDuration,c=(r-this.startTime)/u;n.opacity=jd(c,0,1,i,a,a===0?z7:$7),r-this.startTime>=u&&(a===1?n.canShow=!0:a===0&&(n.canShow=!1),n.visibilityNeedsUpdate=!1,this.animating.delete(n))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};o(yO,"TwoDVisibilitySystem");var RC=yO;g();var vO=class vO extends Rt{constructor(r,n,i,a,u,c,f){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",o((r=!1)=>{var n;if(((n=this.renderer)==null?void 0:n.renderer)==null)return Promise.resolve();if(r){let i=this.commitRenderState();return this.paint(),i}else return this.frameId?Promise.resolve():new Promise((i,a)=>{this.frameId=requestAnimationFrame(()=>{var u,c;return((u=this.renderer)==null?void 0:u.renderer)==null?i():this.mode==="standalone"?(c=this.commitRenderState())==null?void 0:c.then(()=>{this.paint(),i()}).catch(f=>{a(f)}):i()})})},"update"));b(this,"animate2D",o(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));b(this,"drawEntities2D",o(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));b(this,"updateEntities2D",o(()=>{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",o(()=>{try{let r=[];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(),iD(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(),nD(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&&r.push(n),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),r.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.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(r)}catch(r){return Promise.reject(r)}},"commitRenderState"));this.renderer=r,this.state=n,this.mode=i,this.scene=a,this.cameraObject=u,this.viewCamera=c,this.systems=f,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 r;(r=this.renderer)!=null&&r.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)}};o(vO,"RenderSystem");var kC=vO;g();var m0e=W.object({interactive:W.boolean().optional(),id:W.string().optional(),width:W.union([W.number(),W.object({on:W.literal("zoom-level").optional(),input:W.array(W.number()).nonempty(),output:W.array(W.number()).nonempty(),easing:W.string().optional()})]).optional(),accentColor:W.string().optional(),displayArrowsOnPath:W.boolean().optional(),animateArrowsOnPath:W.boolean().optional(),visibleThroughGeometry:W.boolean().optional(),dashed:W.boolean().optional()}),g0e=W.object({type:W.enum(["Feature"]),geometry:u0,properties:W.object({parentId:W.any().optional()})});function _$(e,t){W.object({features:W.array(g0e)}).parse(e),m0e.parse(t)}o(_$,"validatePath");var Mx,xO=class xO{constructor(t,r){b(this,"type","path");b(this,"mesh",new eu);b(this,"material");b(this,"geometry");b(this,"outline");b(this,"feature");b(this,"options");b(this,"width",{on:"zoom-level",input:[17,22],output:[.4,.8]});b(this,"breakpoint",0);b(this,"altitudeBreakpoints");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 lt);j(this,Mx,0);var n,i,a,u,c,f;this.feature=t,this.options=r||{},this.width=(n=r==null?void 0:r.width)!=null?n:this.width,this.accentColor=(i=r==null?void 0:r.accentColor)!=null?i:this.accentColor,this.displayArrowsOnPath=(a=r==null?void 0:r.displayArrowsOnPath)!=null?a:this.displayArrowsOnPath,this.animateArrowsOnPath=(u=r==null?void 0:r.animateArrowsOnPath)!=null?u:this.animateArrowsOnPath,this.visibleThroughGeometry=(c=r==null?void 0:r.visibleThroughGeometry)!=null?c:this.visibleThroughGeometry,this.dashed=(f=r==null?void 0:r.dashed)!=null?f:this.dashed}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return d(this,Mx)}set altitude(t){this.mesh&&(this.mesh.position.z=t,$(this,Mx,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Mx=new WeakMap,o(xO,"PathComponent");var ud=xO;g();g();g();var _o=Object.freeze({Linear:Object.freeze({None:o(function(e){return e},"None"),In:o(function(e){return e},"In"),Out:o(function(e){return e},"Out"),InOut:o(function(e){return e},"InOut")}),Quadratic:Object.freeze({In:o(function(e){return e*e},"In"),Out:o(function(e){return e*(2-e)},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},"InOut")}),Cubic:Object.freeze({In:o(function(e){return e*e*e},"In"),Out:o(function(e){return--e*e*e+1},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},"InOut")}),Quartic:Object.freeze({In:o(function(e){return e*e*e*e},"In"),Out:o(function(e){return 1- --e*e*e*e},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},"InOut")}),Quintic:Object.freeze({In:o(function(e){return e*e*e*e*e},"In"),Out:o(function(e){return--e*e*e*e*e+1},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},"InOut")}),Sinusoidal:Object.freeze({In:o(function(e){return 1-Math.sin((1-e)*Math.PI/2)},"In"),Out:o(function(e){return Math.sin(e*Math.PI/2)},"Out"),InOut:o(function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))},"InOut")}),Exponential:Object.freeze({In:o(function(e){return e===0?0:Math.pow(1024,e-1)},"In"),Out:o(function(e){return e===1?1:1-Math.pow(2,-10*e)},"Out"),InOut:o(function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},"InOut")}),Circular:Object.freeze({In:o(function(e){return 1-Math.sqrt(1-e*e)},"In"),Out:o(function(e){return Math.sqrt(1- --e*e)},"Out"),InOut:o(function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},"InOut")}),Elastic:Object.freeze({In:o(function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},"In"),Out:o(function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},"Out"),InOut:o(function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)},"InOut")}),Back:Object.freeze({In:o(function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},"In"),Out:o(function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},"Out"),InOut:o(function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},"InOut")}),Bounce:Object.freeze({In:o(function(e){return 1-_o.Bounce.Out(1-e)},"In"),Out:o(function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},"Out"),InOut:o(function(e){return e<.5?_o.Bounce.In(e*2)*.5:_o.Bounce.Out(e*2-1)*.5+.5},"InOut")}),generatePow:o(function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:o(function(t){return Math.pow(t,e)},"In"),Out:o(function(t){return 1-Math.pow(1-t,e)},"Out"),InOut:o(function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5},"InOut")}},"generatePow")}),Ox=o(function(){return performance.now()},"now"),BC=function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return o(e,"Group"),e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(r){return t._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var i=0,a=r;i<a.length;i++){var u=a[i];(t=u._group)===null||t===void 0||t.remove(u),u._group=this,this._tweens[u.getId()]=u,this._tweensAddedDuringUpdate[u.getId()]=u}},e.prototype.remove=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++){var a=i[n];a._group=void 0,delete this._tweens[a.getId()],delete this._tweensAddedDuringUpdate[a.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,r){t===void 0&&(t=Ox()),r===void 0&&(r=!0);var n=Object.keys(this._tweens);if(n.length!==0)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var a=this._tweens[n[i]],u=!r;a&&a.update(t,u)===!1&&!r&&this.remove(a)}n=Object.keys(this._tweensAddedDuringUpdate)}},e}(),c0={Linear:o(function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),a=c0.Utils.Linear;return t<0?a(e[0],e[1],n):t>1?a(e[r],e[r-1],r-n):a(e[i],e[i+1>r?r:i+1],n-i)},"Linear"),Bezier:o(function(e,t){for(var r=0,n=e.length-1,i=Math.pow,a=c0.Utils.Bernstein,u=0;u<=n;u++)r+=i(1-t,n-u)*i(t,u)*e[u]*a(n,u);return r},"Bezier"),CatmullRom:o(function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),a=c0.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(i=Math.floor(n=r*(1+t))),a(e[(i-1+r)%r],e[i],e[(i+1)%r],e[(i+2)%r],n-i)):t<0?e[0]-(a(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[r]-(a(e[r],e[r],e[r-1],e[r-1],n-r)-e[r]):a(e[i?i-1:0],e[i],e[r<i+1?r:i+1],e[r<i+2?r:i+2],n-i)},"CatmullRom"),Utils:{Linear:o(function(e,t,r){return(t-e)*r+e},"Linear"),Bernstein:o(function(e,t){var r=c0.Utils.Factorial;return r(e)/r(t)/r(e-t)},"Bernstein"),Factorial:function(){var e=[1];return function(t){var r=1;if(e[t])return e[t];for(var n=t;n>1;n--)r*=n;return e[t]=r,r}}(),CatmullRom:o(function(e,t,r,n,i){var a=(r-e)*.5,u=(n-t)*.5,c=i*i,f=i*c;return(2*t-2*r+a+u)*f+(-3*t+3*r-2*a-u)*c+a*i+t},"CatmullRom")}},C$=function(){function e(){}return o(e,"Sequence"),e.nextId=function(){return e._nextId++},e._nextId=0,e}(),bO=new BC,Su=function(){function e(t,r){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=_o.Linear.None,this._interpolationFunction=c0.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=C$.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=bO,bO.add(this))}return o(e,"Tween"),e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,r){if(t===void 0&&(t=Ox()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){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,r)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,r,n,i,a){for(var u in n){var c=t[u],f=Array.isArray(c),m=f?"array":typeof c,v=!f&&Array.isArray(n[u]);if(!(m==="undefined"||m==="function")){if(v){var x=n[u];if(x.length===0)continue;for(var I=[c],C=0,T=x.length;C<T;C+=1){var O=this._handleRelativeValue(c,x[C]);if(isNaN(O)){v=!1,console.warn("Found invalid interpolation list. Skipping.");break}I.push(O)}v&&(n[u]=I)}if((m==="object"||f)&&c&&!v){r[u]=f?[]:{};var P=c;for(var L in P)r[u][L]=P[L];i[u]=f?[]:{};var x=n[u];if(!this._isDynamic){var A={};for(var L in x)A[L]=x[L];n[u]=x=A}this._setupProperties(P,r[u],x,i[u],a)}else(typeof r[u]>"u"||a)&&(r[u]=c),f||(r[u]*=1),v?i[u]=n[u].slice().reverse():i[u]=r[u]||0}}},e.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},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=Ox()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Ox()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,r=this._chainedTweens.length;t<r;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=_o.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=c0.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,r){var n=this,i;if(t===void 0&&(t=Ox()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var u=t-this._startTime,c=this._duration+((i=this._repeatDelayTime)!==null&&i!==void 0?i:this._delayTime),f=this._duration+this._repeat*c,m=o(function(){if(n._duration===0||u>f)return 1;var O=Math.trunc(u/c),P=u-O*c,L=Math.min(P/n._duration,1);return L===0&&u===n._duration?1:L},"calculateElapsedPortion"),v=m(),x=this._easingFunction(v);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,x),this._onUpdateCallback&&this._onUpdateCallback(this._object,v),this._duration===0||u>=this._duration)if(this._repeat>0){var I=Math.min(Math.trunc((u-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=I);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+=c*I,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var C=0,T=this._chainedTweens.length;C<T;C++)this._chainedTweens[C].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,r,n,i){for(var a in n)if(r[a]!==void 0){var u=r[a]||0,c=n[a],f=Array.isArray(t[a]),m=Array.isArray(c),v=!f&&m;v?t[a]=this._interpolationFunction(c,i):typeof c=="object"&&c?this._updateProperties(t[a],u,c,i):(c=this._handleRelativeValue(u,c),typeof c=="number"&&(t[a]=u+(c-u)*i))}},e.prototype._handleRelativeValue=function(t,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?t+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(t){var r=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=r},e.autoStartOnUpdate=!1,e}();var kEt=C$.nextId,Pc=bO,BEt=Pc.getAll.bind(Pc),GEt=Pc.removeAll.bind(Pc),jEt=Pc.add.bind(Pc),UEt=Pc.remove.bind(Pc),VEt=Pc.update.bind(Pc);g();g();g();var w$=o((e,t)=>(t-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),P$=o((e,t)=>new Ft(e.clientX-t.offsetLeft,e.clientY-t.offsetTop),"getTouchPos"),IO=o((e,t)=>Math.atan2(t.y-e.y,t.x-e.x),"angle"),Lx=o((e,t)=>Math.sqrt((t.y-e.y)**2+(t.x-e.x)**2),"distance"),SO=o((e,t)=>new Ft((e.x+t.x)/2,(e.y+t.y)/2),"average"),_O=o(e=>{let t=0,{wheelDelta:r,detail:n}=e;return r!==void 0?t=r:n!==void 0&&(t=-n),t},"getScrollDelta");var CO=class CO{constructor(t,r){b(this,"input1");b(this,"input2");b(this,"lastAngle");b(this,"lastDistance");b(this,"totalDistance");b(this,"first");b(this,"second");this.input1=t,this.input2=r,this.lastAngle=IO(t,r),this.lastDistance=Lx(t,r),this.totalDistance=0,this.first=t,this.second=r}update(t,r){let n=Lx(t,r);this.input1=t,this.input2=r;let i=IO(t,r);this.lastAngle=i,this.lastDistance=n,this.totalDistance+=(Lx(this.first,t)+Lx(this.second,r))/2,this.first=SO(this.first,t),this.second=SO(this.second,r)}};o(CO,"InputSet");var GC=CO;g();var wO=class wO{constructor(t,r,n){b(this,"touch");b(this,"camera");b(this,"cameraPlane");b(this,"viewCoordinate");b(this,"snapHolderMatrix");b(this,"snapCamera");b(this,"cameraPosition");b(this,"raycaster");b(this,"worldCoordinate");b(this,"snapshotted",!1);this.touch=t,this.camera=r,this.cameraPlane=n,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new Ft(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Vu,this.raycaster.setFromCamera(t,this.snapCamera);let r=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=r&&r.length>0?r[0].point:null,this.snapshotted=!0}updateAnchorState(t,r){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(r),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var n,i;let t=new Ft(this.viewCoordinate.x,this.viewCoordinate.y);(n=this.raycaster)==null||n.setFromCamera(t,this.snapCamera);let r=(i=this.raycaster)==null?void 0:i.intersectObject(this.cameraPlane,!0)[0];return r?r.point:void 0}};o(wO,"TouchAnchor");var Dx=wO;var Ll={};bf(Ll,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>v0e,CLIPPING_RADIUS:()=>Ax,CONTROL_OPTIONS:()=>y0e,DEFAULT_ANIMATION_DURATION:()=>OO,DEFAULT_BEARING:()=>_0e,DEFAULT_MAX_ZOOM_LEVEL:()=>I0e,DEFAULT_MIN_ZOOM_LEVEL:()=>LO,DEFAULT_PITCH:()=>S0e,DEFAULT_ZOOM_LEVEL:()=>b0e,EVENTS:()=>zC,MAPLIBRE_TILE_SIZE:()=>jC,MAX_LAT:()=>TO,MAX_MERCATOR_ZOOM_LEVEL:()=>VC,MIN_LAT:()=>PO,MIN_MERCATOR_ZOOM_LEVEL:()=>UC,ROOM_MERCATOR_ZOOM_LEVEL:()=>x0e,TWO_PI:()=>EO,WHEEL_ZOOM_MULTIPLIER:()=>MO,ZRANGE:()=>p0});g();var jC=512,PO=-85.051129,TO=85.051129,Ax=1e4,y0e={chain:"chain",cancel:"cancel"},EO=Math.PI*2,p0=100,MO=1e4,UC=0,VC=24,v0e=17,x0e=20,OO=200,zC=["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"],b0e=18,LO=12,I0e=22,S0e=0,_0e=0;g();function T$(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}o(T$,"scrubMaterial");function gi(e){for(let t=e.children.length-1;t>=0;t--)gi(e.children[t]);"geometry"in e&&e.geometry&&e.geometry.dispose(),e.parent&&e.parent.remove(e),"material"in e&&Array.isArray(e.material)?e.material.forEach(function(t){T$(t)}):"material"in e&&typeof e.material<"u"&&T$(e.material)}o(gi,"destroyObject3D");var $C=!1,C0e=!1;var HC,WC=class WC extends Rt{constructor(r,n,i,a,u){super();b(this,"dirty",!1);b(this,"zoomDirty",!1);b(this,"rotationDirty",!1);b(this,"panDirty",!1);b(this,"stateDirty",!1);j(this,HC,LO);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 lt(1/0,1/0),max:new lt(-1/0,-1/0),center:new lt(0,0,0),radius:1/0});b(this,"minTilt",0);b(this,"maxTilt",1.2);b(this,"MOUSE_BUTTONS",{ORBIT:yI.RIGHT,ZOOM:yI.MIDDLE,PAN:yI.LEFT});b(this,"camera");b(this,"scene");b(this,"renderer");b(this,"elevation");b(this,"orbit");b(this,"cameraPlane");b(this,"raycaster",new Vu);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 R7(!0));b(this,"coords",{mouse:new Ft,rotateStart:new Ft,rotateEnd:new Ft,rotateDelta:new Ft,panStart:new lt,panCameraStart:new lt,panEnd:new lt,panDelta:new lt,initialShiftPos:new Ft,initialPedestal:0,floorAnchor:new lt});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",o(r=>{this.raycaster.setFromCamera(r,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new lt},"raycastToFloor"));b(this,"isUserInteracting",o(()=>this.userInteracting,"isUserInteracting"));b(this,"getPosition",o(()=>new lt(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));b(this,"getPedestal",o(()=>this.orbit.position.z,"getPedestal"));b(this,"pan",o((r,n)=>{isNaN(r)||isNaN(n)||(this.setPosition(this.orbit.position.x+r,this.orbit.position.y+n),this.publish("position-updated"))},"pan"));b(this,"postRender",o(()=>{(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",o(()=>this.cameraMoving,"isCameraMoving"));b(this,"lastCameraStoppedMovingTime",o(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));b(this,"setPosition",o((r,n)=>{r===void 0||n===void 0||isNaN(r)||isNaN(n)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(r,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",o((r,n)=>{let i=r-this.panBounds.center.x,a=n-this.panBounds.center.y,u=Math.sqrt(i*i+a*a);if(this.stayInsideBounds&&u>this.panBounds.radius){let c=Math.atan2(a,i),f={x:Math.cos(c)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(c)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=f.x,this.orbit.position.y=f.y}else this.orbit.position.x=r,this.orbit.position.y=n},"updateCameraPosition"));b(this,"tilt",o(r=>{if(isNaN(r))return;this.state===-1&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(r+this.getTilt(),this.maxTilt),this.minTilt):r+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",o((r,n,i)=>{let a=this.getZoomAltitude();this.animateCamera({zoom:a/1.5},r,n,i)},"zoomIn"));b(this,"zoomOut",o((r,n,i)=>{let a=this.getZoomAltitude();this.animateCamera({zoom:a*1.5},r,n,i)},"zoomOut"));b(this,"getRotation",o(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));b(this,"cancelAnimation",o(()=>{let r=Array.from(this.tweens.keys()),n=r[r.length-1];n.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(n)},"cancelAnimation"));b(this,"animateCamera",o((r,n,i,a,u,c)=>{let f=Y({interruptible:!0},c),m={},v={},x=this.getPosition();if(r.position!=null&&(r.position.x!==void 0&&(m.x=x.x,v.x=r.position.x),r.position.y!==void 0&&(m.y=x.y,v.y=r.position.y),r.position.z!==void 0&&(m.z=x.z,v.z=r.position.z)),r.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=r.zoom:v.zoom=Math.min(Math.max(r.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),r.rotation!==void 0){let{start:M,end:N}=MI(this.getRotation(),r.rotation);m.rotation=M,v.rotation=N}r.tilt!==void 0&&(m.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?v.tilt=r.tilt:v.tilt=Math.max(Math.min(r.tilt,this.maxTilt),this.minTilt));let I=m.zoom!==v.zoom,C=m.rotation!==v.rotation,T=m.tilt!==v.tilt,O=new Su(m).to(v,S.env.TESTING?0:n).onUpdate(M=>{this.setMulti({x:M.x,y:M.y,z:M.z},M.zoom,M.rotation,M.tilt)}).onComplete(()=>{this.completeTween(O),this.publish("multi-end",{zooming:I,rotating:C,tilting:T}),a&&a()}).onStart(()=>{this.state!==7&&(this.state=7,O.state=7,this.publish("multi-start",{zooming:I,rotating:C,tilting:T})),this.publish("change")});this.rendererState.internalTweenGroup.add(O);let P=Array.from(this.tweens.entries()),L=P[P.length-1],A=!1;return L!=null&&(L[1].interruptible?(typeof L[1].cancelledCallback=="function"&&L[1].cancelledCallback(),this.completeTween(L[0])):(A=!0,L[0].chain(O))),this.tweens.set(O,{cancelledCallback:u,interruptible:f.interruptible}),i?O.easing(i):O.easing(_o.Quadratic.In),!r.doNotAutoStart&&!A&&(O.start(),this.publish("change")),O.cameraAnimation=!0,O},"animateCamera"));b(this,"setMulti",o((r,n,i,a,u=!0)=>{this.state===-1&&this.publish("multi-start");let c=!1;r!=null&&(r.x!==void 0&&!isNaN(r.x)&&r.y!==void 0&&!isNaN(r.y)&&(this.updateCameraPosition(r.x,r.y),c=!0),r.z!==void 0&&!isNaN(r.z)&&(this.setPedestal(r.z,!0,!1),c=!0)),c&&this.publish("position-updated");let f={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&&(f.zooming=!0,this.camera.position.z=m,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>Ax&&(this.camera.near=n-Ax,this.camera.far=n+Ax):(this.camera.near=n/p0,this.camera.far=n*p0),this.camera.updateProjectionMatrix())}if(i!==void 0&&!isNaN(i)&&i!==this.getRotation()&&(f.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&&(f.tilting=!0,this.elevation.rotation.x=m,this.publish("tilt-updated"))}u&&this.publish("change"),this.state===-1&&this.publish("multi-end",f),this.stateDirty=!0},"setMulti"));b(this,"getZoomScaledMin",o(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));b(this,"getZoomScaledMax",o(()=>{let r=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,r)},"getZoomScaledMax"));b(this,"setRotation",o((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let i=-(r%EO);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",o(r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.stayInsideBounds?Math.min(Math.max(r,this.getZoomScaledMin()),this.getZoomScaledMax()):r;n!==this.camera.position.z&&(this.camera.position.z=n,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=n/p0,this.camera.far=n*p0,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0,this.stateDirty=!0},"setZoomAltitude"));b(this,"setZoomLevel",o(r=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(r))},"setZoomLevel"));b(this,"getZoomAltitude",o(()=>this.camera.position.z,"getZoomAltitude"));b(this,"getZoomLevel",o(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));b(this,"setTilt",o((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(r,this.maxTilt),this.minTilt):r;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",o(()=>this.elevation.rotation.x,"getTilt"));b(this,"setCameraPlaneElevation",o(r=>{this.cameraPlane.position.z=r},"setCameraPlaneElevation"));b(this,"zoom",o(r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.getZoomAltitude()-r;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",o((r,n,i)=>_w(r,n,i),"getProjectionScaleFactor"));b(this,"update",o(()=>{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",o((r,n=!1,i=!0)=>{typeof r=="number"&&!isNaN(r)&&(this.orbit.position.z=r,n&&(this.publishPedestalChangeEvent(r),this.publish("pedestal-change",{pedestal:r})),this.publish("change"),this.dirty=!0,i&&(this.stateDirty=!0))},"setPedestal"));b(this,"dispose",o(()=>{for(let r of zC)r.endsWith("start")?(this.off(r,this.setCameraMoving),r.startsWith("user")&&this.off(r,this.setUserInteracting)):(r.endsWith("end")||r.endsWith("cancel"))&&(this.off(r,this.unsetCameraMoving),r.startsWith("user")&&this.off(r,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));b(this,"createCameraPlane",o(()=>{let r=$C?2e3:1e10,n=$C?100:1,i=new Jl(r,r,n,n),a=new po({color:0,wireframe:$C,visible:$C}),u=new Vt(i,a);return this.scene.add(u),u},"createCameraPlane"));b(this,"addEventListeners",o(()=>{let{domElement:r}=this.renderer;for(let n of zC)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));r.addEventListener("contextmenu",this.onContextMenu,!1),r.addEventListener("mousedown",this.onMouseDown,!1),r.addEventListener("wheel",this.onMouseWheel,{passive:!1}),r.addEventListener("touchstart",this.onTouchStart,!1),r.addEventListener("touchend",this.onTouchEnd,!1),r.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));b(this,"addMouseEventListeners",o(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));b(this,"addMouseMoveEventListeners",o(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));b(this,"removeMouseMoveEventListeners",o(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));b(this,"removeEventListeners",o(()=>{let{domElement:r}=this.renderer;r.removeEventListener("contextmenu",this.onContextMenu,!1),r.removeEventListener("mousedown",this.onMouseDown,!1),r.removeEventListener("wheel",this.onMouseWheel,!1),r.removeEventListener("touchstart",this.onTouchStart,!1),r.removeEventListener("touchend",this.onTouchEnd,!1),r.removeEventListener("touchmove",this.onTouchMove,!1),r.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));b(this,"removeMouseUpEventListeners",o(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));b(this,"onContextMenu",o(r=>{r.preventDefault()},"onContextMenu"));b(this,"onMouseUp",o(()=>{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",o(r=>{if(this.enabled!==!1)if(r.preventDefault(),this.mouseToScene(r),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(r)}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(r)},"onMouseMove"));b(this,"onTouchStart",o(r=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(r),r.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(r),this.state=9):this.enablePan&&(this.handleTouchStartPan(r),this.state=6);break;case 2:this.touch.inputs=new GC(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));b(this,"onTouchMove",o(r=>{if(this.enabled!==!1)switch(this.touchToScene(r),r.touches.length){case 2:r.preventDefault(),r.stopPropagation();let n=Y({},this.touch.inputs.first),i=Y({},this.touch.inputs.second),a=new Ft(this.touch.touches[0].x,this.touch.touches[0].y),u=new Ft(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(r);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let c=n.y<a.y&&i.y<u.y,f=n.y>a.y&&i.y>u.y;this.enableRotate&&this.state!==4&&(f||c)?(this.handleTouchStartTilt(r),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(r.preventDefault(),r.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(r):this.enablePan&&this.state===6&&this.handleTouchMovePan(r);break;default:this.state=-1}},"onTouchMove"));b(this,"onTouchEnd",o(r=>{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}r.touches.length?this.onTouchStart(r):this.state=-1}},"onTouchEnd"));b(this,"handleTouchMovePan",o(r=>{let n=Object.hasOwn(r,"x")?new Ft(r.x,r.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",o(()=>{let r=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 Ft(this.touch.touches[0].x-r/2,this.touch.touches[0].y-n/2);this.coords.floorAnchor=this.raycastToFloor(i),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Dx(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Dx(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",o(()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(r.x,r.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",o(r=>{this.coords.rotateStart.set(r.touches[1].clientX,r.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));b(this,"handleTouchMovePedestal",o(r=>{this.handleMouseMovePedestal(r.touches[0])},"handleTouchMovePedestal"));b(this,"handleTouchMoveTilt",o(r=>{this.coords.rotateEnd.set(r.touches[1].clientX,r.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",o(()=>{let r=this.touch.inputs.first,n=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:r.x,y:r.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,r),this.touch.anchor2.updateAnchorState(this.camera,n)},"handleTouchMoveDolly"));b(this,"handleTouchEnd",o(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));b(this,"handleTouchStartPan",o(r=>{let n=Object.hasOwn(r,"x")?new Ft(r.x,r.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",o(r=>{this.handleMouseDownPedestal(r.touches[0])},"handleTouchStartPedestal"));b(this,"onMouseDown",o(r=>{if(this.enabled!==!1){if(this.mouseToScene(r),r.preventDefault(),this.state===3&&this.publish("zoom-end"),r.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(r),this.state=0}else r.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(r),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));b(this,"onMouseWheel",o(r=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(r.preventDefault(),r.stopPropagation(),this.mouseToScene(r),this.canScrollZoom(r)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(r)&&(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(r))},"onMouseWheel"));b(this,"handleMouseWheel",o(r=>{if(this.publish("zoom-start"),!this.canScrollZoom(r)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let n=this.getZoomAltitude(),i=n-_O(r)*n/MO*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",o(r=>{this.orbit.updateMatrixWorld();let n=new Zc;n.setFromRotationMatrix(r,"ZYX");let i=(r.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),a=n.z,u=new lt(0,0,1);u.applyEuler(n),u.setLength(i);let c=new lt;c.setFromMatrixPosition(r),c.sub(u),this.enablePan&&this.setPosition(c.x,c.y),this.enableZoom&&this.setZoomAltitude(i),this.enableRotate&&this.setRotation(-a)},"setCameraFromTransformMatrix"));b(this,"makeTransformFromTouchAnchors",o((r,n)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let i=this.camera.projectionMatrix.clone(),a=r.worldCoordinate,u=n.worldCoordinate,c=r.reUnproject(),f=n.reUnproject();if(!c||!f||!a||!u)return null;let m=r.viewCoordinate,v=n.viewCoordinate,x=u.x-a.x,I=u.y-a.y,C=Math.atan2(I,x),T=f.x-c.x,O=f.y-c.y,P=Math.atan2(O,T),L=w$(C,P),A=new La;A.makeRotationZ(-L);let M=A.clone();M.multiply(r.snapHolderMatrix);let N=o((Ht,ot,qe)=>Ht.elements[(ot-1)*4+qe-1],"m"),B=N(i,1,1)*N(M,1,1)-m.x*N(i,3,4)*N(M,3,1),H=N(i,1,1)*N(M,1,2)-m.x*N(i,3,4)*N(M,3,2),z=N(i,1,1)*N(M,1,3)-m.x*N(i,3,4)*N(M,3,3),R=a.x*B+a.y*H+a.z*z,X=N(i,2,2)*N(M,2,1)-m.y*N(i,3,4)*N(M,3,1),ie=N(i,2,2)*N(M,2,2)-m.y*N(i,3,4)*N(M,3,2),Q=N(i,2,2)*N(M,2,3)-m.y*N(i,3,4)*N(M,3,3),U=a.x*X+a.y*ie+a.z*Q,Te=N(i,1,1)*N(M,1,1)-v.x*N(i,3,4)*N(M,3,1),oe=N(i,1,1)*N(M,1,2)-v.x*N(i,3,4)*N(M,3,2),fe=N(i,1,1)*N(M,1,3)-v.x*N(i,3,4)*N(M,3,3),se=u.x*Te+u.y*oe+u.z*fe,ve=N(i,2,2)*N(M,2,1)-v.y*N(i,3,4)*N(M,3,1),ue=N(i,2,2)*N(M,2,2)-v.y*N(i,3,4)*N(M,3,2),he=N(i,2,2)*N(M,2,3)-v.y*N(i,3,4)*N(M,3,3),Z=u.x*ve+u.y*ue+u.z*he,Ke=Math.abs(Te-B),Ue=Math.abs(oe-H),rt=Math.abs(fe-z),Ee=Math.abs(Te-X),We=Math.abs(oe-ie),St=Math.abs(fe-Q),yt=Math.abs(ve-B),pt=Math.abs(ue-H),te=Math.abs(he-z),ce=Math.abs(ve-X),ee=Math.abs(ue-ie),be=Math.abs(he-Q),Me=Math.min(Ke+Ue+rt,Ee+We+St),Fe=Math.min(yt+pt+te,ce+ee+be);Me<Fe&&(Te=ve,oe=ue,fe=he,se=Z);let it=X*z-B*Q,xt=ie*z-H*Q,Bt=U*z-R*Q,pn=Te*Q-X*fe,Xe=oe*Q-ie*fe,Gt=se*Q-U*fe,Yi=(Gt*xt-Bt*Xe)/(pn*xt-it*Xe),Gi=(Gt*it-Bt*pn)/(Xe*it-xt*pn),Po=ie*B-H*X,Zn=Q*B-z*X,Ge=U*B-R*X,aa=oe*X-ie*Te,xs=fe*X-Q*Te,To=((se*X-U*Te)*Po-Ge*aa)/(xs*Po-Zn*aa),Ca=M.clone();return Ca.elements[12]=Yi,Ca.elements[13]=Gi,Ca.elements[14]=To,To>0?Ca:null},"makeTransformFromTouchAnchors"));b(this,"updateTouchOrigin",o(()=>{let r=this.renderer.domElement;this.touch.origin.offsetLeft=r.getBoundingClientRect().left,this.touch.origin.offsetTop=r.getBoundingClientRect().top},"updateTouchOrigin"));b(this,"touchToScene",o(r=>{this.touch.touches=[];for(let n=0,i=r.touches.length;n<i;n++){let a=r.touches[n],u=P$(a,this.touch.origin);this.touch.touches.push(new Ft(u.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(u.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));b(this,"canScrollZoom",o(r=>{let n=_O(r),i=this.getZoomAltitude();return!(n<0&&i===this.getZoomScaledMax()||n>0&&i===this.getZoomScaledMin())},"canScrollZoom"));b(this,"mouseToScene",o(r=>{let n=this.getMousePos(r);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",o(r=>({x:r.offsetX,y:r.offsetY}),"getMousePos"));b(this,"handleMouseDownRotate",o(r=>{this.coords.rotateStart.set(r.clientX,r.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));b(this,"handleMouseDownPan",o(()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(r.x,r.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",o(r=>{let n=new Ft(r.clientX,r.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=_w(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));b(this,"handleMouseMovePedestal",o(r=>{let n={x:r.clientX,y:r.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",o(r=>{this.coords.rotateEnd.set(r.clientX,r.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",y1(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));b(this,"publishUserZoomEvent",o(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));b(this,"setCameraMoving",o(()=>{this.cameraMoving=!0},"setCameraMoving"));b(this,"unsetCameraMoving",o(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));b(this,"setUserInteracting",o(()=>{this.userInteracting=!0},"setUserInteracting"));b(this,"unsetUserInteracting",o(()=>{this.userInteracting=!1},"unsetUserInteracting"));b(this,"publishPedestalChangeEvent",o(r=>{this.publish("pedestal-change",{pedestal:r,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));b(this,"convertAltitudeToZoomLevel",o(r=>{let[,n]=this.center,a=r*2*Math.tan(Br.degToRad(this.camera.fov)/2)/this.options.canvasHeight,u=Math.cos(Br.degToRad(n))*2*Math.PI*dw/a;return Br.clamp(Math.log2(u/512),UC,VC)},"convertAltitudeToZoomLevel"));b(this,"convertZoomLevelToAltitude",o(r=>{let[,n]=this.center,i=Br.clamp(r,UC,VC),a=Math.pow(2,i),u=Br.clamp(n,PO,TO),c=a*512;return Math.cos(Br.degToRad(u))*Math.PI*2*dw/c*this.options.canvasHeight/2/Math.tan(Br.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));b(this,"completeTween",o(r=>{r.isPlaying()&&r.stop(),this.rendererState.internalTweenGroup.remove(r),this.tweens.delete(r)},"completeTween"));b(this,"debugContainer",new Zl);this.camera=r,this.renderer=i,this.rendererState=a,this.scene=n,this.options=u,this.elevation=r.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=r.position.z,u.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(r){this.minZoomAltitude=this.convertZoomLevelToAltitude(r),this.stateDirty=!0}get defaultMinZoomLevel(){return d(this,HC)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(r){this.maxZoomAltitude=this.convertZoomLevelToAltitude(r),this.stateDirty=!0}get scrollPercent(){let r=this.minPedestal,n=this.maxPedestal,i=this.getPedestal();return i=Math.min(i,n),i=Math.max(i,r),(i-r)/(n-r)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var a,u,c,f;let r=this.getPosition(),{lat:n,lon:i}=kI((u=(a=this.rendererState.center)==null?void 0:a[1])!=null?u:0,(f=(c=this.rendererState.center)==null?void 0:c[0])!=null?f:0,r.x,r.y);return[i,n]}setCenter(r,n){var u,c,f,m;let{x:i,y:a}=BI((c=(u=this.rendererState.center)==null?void 0:u[1])!=null?c:0,(m=(f=this.rendererState.center)==null?void 0:f[0])!=null?m:0,n,r);this.setPosition(i,a)}get isAnimating(){return this.rendererState.internalTweenGroup.getAll().some(r=>r.cameraAnimation)}getCameraFrameForCoordinates(r,n){let i=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,a=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,u=this.options.canvasWidth,c=this.options.canvasHeight,f=this.getRotation(),m=this.getTilt(),v=this.getPosition();this.setRotation(n.rotation||f,!0),this.setTilt(n.tilt||m,!0);let x=E$(r,{canvasWidth:u,canvasHeight:c,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:i,maxZoom:a,position:v,camera:this.camera,orbit:this.orbit});return this.setRotation(f,!0),this.setTilt(m,!0),{center:x.position,zoomLevel:this.convertAltitudeToZoomLevel(x.zoom)}}focusOn(r,n){if(C0e){this.debugContainer&&gi(this.debugContainer);let P=new Kl(4,4,4),L=new po({color:65280,depthTest:!1}),A=new _f(P,L,r.length),M=new La;r.forEach((N,B)=>{M.setPosition(N),A.setMatrixAt(B,M)}),A.instanceMatrix.needsUpdate=!0,this.debugContainer.add(A),this.scene.add(this.debugContainer)}let i=n.curve,a=n.callback,u=n.cancelledCallback,c=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,f=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,m=this.options.canvasWidth,v=this.options.canvasHeight,x;n.duration!==void 0?x=n.duration:S.env.TESTING==="true"?x=0:x=OO;let I=n.padding,C=this.getRotation(),T=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let O=E$(r,{canvasHeight:v,paddingOption:I,canvasWidth:m,minZoom:c,maxZoom:f,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(C),this.setTilt(T),this.animateCamera({position:O.position,tilt:n.tilt,rotation:n.rotation,zoom:O.zoom},x,i,a,u,n)}resize(r,n){this.options.canvasWidth=r,this.options.canvasHeight=n}};HC=new WeakMap,o(WC,"CameraSystem"),b(WC,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var f0=WC;function E$(e,{canvasWidth:t,orbit:r,paddingOption:n,verticalPadding:i=0,canvasHeight:a,minZoom:u,maxZoom:c,camera:f,position:m}){let v={zoom:u,position:m};if(e.length===0)return v;for(let it of f0.CAMERA_FRAME_PADDING_SIDES)typeof n[it]!="number"&&(n[it]=0);let x=n.type==="portion"?{top:n.top*a,bottom:n.bottom*a,left:n.left*t,right:n.right*t,type:"pixel"}:n;if(x.left+x.right>=t||x.top+x.bottom>=a)return v;r.updateMatrixWorld();let I=f.matrixWorldInverse,C=f.fov*(Math.PI/180)/2,T=C,P=Math.atan(Math.tan(C)*(t/a)),L=new lt(1/0,1/0,1/0),A=new lt(-1/0,-1/0,-1/0),M=new ro,N=new lt;for(let it=0,xt=e.length;it<xt;it++)N.copy(e[it]),M.expandByPoint(N),N.applyMatrix4(I),L.min(N),A.max(N),N.copy(e[it]),N.z-=i,N.applyMatrix4(I),L.min(N),A.max(N),N.copy(e[it]),N.z+=i,N.applyMatrix4(I),L.min(N),A.max(N);let B=A.x-L.x,H=A.y-L.y,z=t-x.left-x.right,R=a-x.top-x.bottom,X=(A.x+L.x)/2,ie=(A.y+L.y)/2,Q=B/z,U=H/R,Te=u,oe=c,fe=Te*Math.tan(P)*2,se=oe*Math.tan(P)*2,ve=fe/t,ue=se/t,he=Math.max(Q,U);he=Br.clamp(he,ve,ue);let Z=z*he,Ke=R*he,Ue={min:{x:X-Z/2-x.left*he,y:ie-Ke/2-x.bottom*he},max:{x:X+Z/2+x.right*he,y:ie+Ke/2+x.top*he}},rt=(Ue.min.x+Ue.max.x)/2,Ee=(Ue.min.y+Ue.max.y)/2,We=M.getCenter(new lt),St=Math.abs(rt-Ue.min.x),yt=Math.abs(Ee-Ue.min.y),pt=St/Math.tan(P),te=yt/Math.tan(T),ce=new lt;ce.set(rt,Ee,A.z+Math.max(pt,te)),ce.applyMatrix4(f.matrixWorld);let ee=new lt;ee.set(rt,Ee,A.z),ee.applyMatrix4(f.matrixWorld);let be=new lt().subVectors(ee,ce),Me=(We.z-ce.z)/be.z,Fe=new lt().copy(ce).add(be.clone().multiplyScalar(Me));return ee.set(Fe.x,Fe.y,Fe.z),ce.sub(ee),{position:Fe,zoom:ce.length()}}o(E$,"getCameraFrameForPoints");g();var w0e=300,Fx,Nx,DO=class DO{constructor(t){b(this,"state");j(this,Fx,new lt);j(this,Nx,new lt);this.state=t}update(t){var i;let r,n;this.state.cameraObject.getWorldPosition(d(this,Nx));for(let a of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(a),r&&(n=r.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{r.object3d.getWorldPosition(d(this,Fx));let u=d(this,Nx).distanceTo(d(this,Fx));n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(-u,"px)")}if(n.canShow===!0&&n.visible===!0?n.markerContainer.style.pointerEvents=t?"none":n.pointerEvents:n.markerContainer.style.pointerEvents="none",n.currentStrategyIndex===-1&&n.visible&&n.visibilityNeedsUpdate==="show")continue;n.visibilityNeedsUpdate!==!1&&!n.offscreen&&(n.visibilityNeedsUpdate==="show"&&(n.markerContainer.style.opacity="0"),n.animation&&n.animation.cancel(),n.animation=n.markerContainer.animate([{opacity:n.canShow&&n.visible?"1":"0"}],{duration:w0e,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};Fx=new WeakMap,Nx=new WeakMap,o(DO,"DOMDrawSystem");var qC=DO;g();var AO=class AO extends Rt{constructor(r,n){super();b(this,"state");b(this,"dirty",!0);b(this,"domTree");b(this,"observers",new Map);b(this,"updateDimensions",o(r=>{r.forEach(n=>{var u;let a=(u=n.target.parentElement)==null?void 0:u.getAttribute("data-marker-id");if(a){let c=this.state.geometry2DMap.get(a),f=c==null?void 0:c.components[0];c&&f instanceof Sc&&(f.updateDimensions(n.contentRect.width,n.contentRect.height),f.collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=r,this.domTree=n}setupObserver(){var i;if(this.observers){for(let a of this.observers.values())a.disconnect();this.observers.clear()}let r,n;for(let a of this.domTree.children){let u=a.getAttribute("data-marker-id");if(u!=null&&(r=this.state.geometry2DMap.get(u),n=r.components[0],(i=n.options)!=null&&i.dynamicResize)){let c=new ResizeObserver(this.updateDimensions);c.observe(n.containerEl),this.observers.set(a.userData.entityId,c)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let r of this.observers.values())r.disconnect();this.observers.clear()}};o(AO,"DOMResizeSystem");var YC=AO;g();var P0e=0,T0e=90,E0e=(S.env.NODE_ENV==="test",!1),hm={linear:_o.Linear.None,"ease-in":_o.Quadratic.In,"ease-out":_o.Quadratic.Out,"ease-in-out":_o.Quadratic.InOut},M0e=-50,gt,Ot,Bp,Rx,kx,NO,RO=class RO{constructor(t,r,n){j(this,kx);j(this,gt);j(this,Ot);j(this,Bp);j(this,Rx);$(this,gt,t),$(this,Ot,r),$(this,Bp,n),d(this,gt).map&&d(this,gt).map.transform.setMinElevationForCurrentTile(M0e),d(this,Ot).cameraSystem.on("pedestal-change",({pedestal:i})=>{d(this,Ot).cameraSystem.setCameraPlaneElevation(i)})}get center(){var t,r;return d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map?(r=(t=d(this,gt).map).getCenter)==null?void 0:r.call(t).toArray():d(this,Ot).cameraSystem.center}setCenter(t){var r;if(d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map){(r=d(this,gt).map)==null||r.setCenter(t),d(this,Ot).interactionSystem.handleHover();return}d(this,Ot).cameraSystem.setCenter(t[0],t[1]),d(this,Ot).interactionSystem.handleHover()}get zoomLevel(){var t;return d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map?(t=d(this,gt).map)==null?void 0:t.getZoom():d(this,Ot).cameraSystem.getZoomLevel()}setZoomLevel(t){var r;d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map&&((r=d(this,gt).map)==null||r.setZoom(t)),d(this,Ot).cameraSystem.setZoomLevel($u(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}getState(){return{zoomLevel:this.zoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,minPitch:this.minPitch,maxPitch:this.maxPitch,autoMinZoomLevel:this.autoMinZoomLevel,panMode:this.panMode,screenOffsets:this.insetsPadding,center:this.center,bearing:this.bearing,pitch:this.pitch,elevation:this.elevation}}get isAnimating(){return d(this,Ot).cameraSystem.isAnimating}cancelAnimation(){d(this,Ot).cameraSystem.cancelAnimation()}get maxZoomLevel(){return d(this,Ot).cameraSystem.maxZoomLevel}get minZoomLevel(){return d(this,Ot).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){d(this,Ot).panBoundsSystem.autoMinZoomLevel=t,t&&(d(this,Ot).panBoundsSystem.dirty=!0,d(this,Ot).panBoundsSystem.update())}get autoMinZoomLevel(){return d(this,Ot).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,r=!1){var i;r&&this.setAutoMinZoomLevel(!1);let n=$u(t,Ll.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Ll.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));d(this,Ot).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(i=d(this,gt).map)==null||i.setMinZoom(n)}setMaxZoomLevel(t){var n;let r=$u(t,this.minZoomLevel,Ll.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Ll.MAX_MERCATOR_ZOOM_LEVEL,"."));d(this,Ot).cameraSystem.setMaxZoomLevel(r),this.zoomLevel>r&&this.setZoomLevel(r),(n=d(this,gt).map)==null||n.setMaxZoom(r)}get maxPitch(){var t,r;return d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map?(r=(t=d(this,gt).map)==null?void 0:t.getMaxPitch)==null?void 0:r.call(t):Br.radToDeg(d(this,Ot).cameraSystem.maxTilt)}get minPitch(){var t,r;return d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map?(r=(t=d(this,gt).map)==null?void 0:t.getMinPitch)==null?void 0:r.call(t):Br.radToDeg(d(this,Ot).cameraSystem.minTilt)}setMinPitch(t){var n;let r=Math.max(P0e,t);(n=d(this,gt).map)==null||n.setMinPitch(r),d(this,Ot).cameraSystem.minTilt=Br.degToRad(r)}setMaxPitch(t){var n;let r=Math.min(T0e,t);(n=d(this,gt).map)==null||n.setMaxPitch(r),d(this,Ot).cameraSystem.maxTilt=Br.degToRad(r)}get bearing(){var t;return d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map?(t=d(this,gt).map)==null?void 0:t.getBearing():Br.radToDeg(d(this,Ot).cameraSystem.getRotation())}setBearing(t){var r;if(d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map){(r=d(this,gt).map)==null||r.setBearing(t);return}d(this,Ot).cameraSystem.setRotation(Br.degToRad(t))}get pitch(){var t;return d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map?(t=d(this,gt).map)==null?void 0:t.getPitch():Br.radToDeg(d(this,Ot).cameraSystem.getTilt())}setPitch(t){var r;if(d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map){(r=d(this,gt).map)==null||r.setPitch(t);return}d(this,Ot).cameraSystem.setTilt(Br.degToRad($u(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return d(this,Ot).cameraSystem.getPedestal()}setElevation(t){d(this,Ot).cameraSystem.setPedestal(t,!0)}animateElevation(t,r){return d(this,Rx)&&d(this,Rx).stop(),new Promise(n=>{var i;d(this,Ot).cameraSystem.animateCamera({position:{z:t}},(r==null?void 0:r.duration)||300,hm[(r==null?void 0:r.easing)||"ease-in-out"],n,n,{interruptible:(i=r==null?void 0:r.interruptible)!=null?i:!0})})}get insetsPadding(){return d(this,Bp).insetsPadding}get panMode(){return d(this,Ot).cameraSystem.enablePan===!1&&d(this,Ot).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(d(this,Ot).cameraSystem.enablePan=!0,d(this,Ot).cameraSystem.enablePedestal=!1):(d(this,Ot).cameraSystem.enablePan=!1,d(this,Ot).cameraSystem.enablePedestal=!0))}setInsetPadding(t){d(this,Bp).insetsPadding=Object.assign({},d(this,Bp).insetsPadding,t)}animateTo(t){var u,c,f,m,v,x;if(d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map)return(x=d(this,gt).map)==null||x.flyTo({center:(u=t.center)!=null?u:this.center,zoom:(c=t.zoomLevel)!=null?c:this.zoomLevel,bearing:(f=t.bearing)!=null?f:this.bearing,pitch:(m=t.pitch)!=null?m:this.pitch,duration:(v=t.duration)!=null?v:600}),Promise.resolve();let r=t.center?d(this,gt).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?d(this,Ot).cameraSystem.convertZoomLevelToAltitude($u(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,i=t.bearing!==void 0?Br.degToRad(t.bearing):void 0,a=t.pitch!==void 0?Br.degToRad($u(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(I=>{var C;d(this,Ot).cameraSystem.animateCamera({position:r,zoom:n,rotation:i,tilt:a},t.duration||0,hm[t.easing||"ease-in-out"],()=>{d(this,Ot).interactionSystem.handleHover(),I()},I,{interruptible:(C=t==null?void 0:t.interruptible)!=null?C:!0})})}getCameraFrameForCoordinates(t,r){let n=Re(this,kx,NO).call(this,r||{},()=>Promise.resolve()),{pointCloud:i}=M$(t,d(this,gt),d(this,Bp).geometry3DMap);if(i.length===0)return ae.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:a,zoomLevel:u}=d(this,Ot).cameraSystem.getCameraFrameForCoordinates(i,n);return{center:d(this,gt).convert3DMapPositionToCoordinate(a),zoomLevel:u}}focusOn(t,r){var u,c,f,m;let{pointCloud:n,geoBounds:i,firstPosition:a}=M$(t,d(this,gt),d(this,Bp).geometry3DMap);return n.length===0?(ae.error("No valid coordinates found in targets:",t),Promise.resolve()):d(this,gt).mode==="outdoors-overlay"&&d(this,gt).map?(n.length===1&&a?(u=d(this,gt).map)==null||u.flyTo({center:[a[0],a[1]],duration:(r==null?void 0:r.duration)||d(this,gt).map.getBearing(),animate:!0,bearing:(r==null?void 0:r.bearing)===void 0?d(this,gt).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?d(this,gt).map.getPitch():r==null?void 0:r.pitch,zoom:(r==null?void 0:r.maxZoomLevel)||d(this,gt).map.getMaxZoom()}):(E0e&&O0e(d(this,gt),i),(m=d(this,gt).map)==null||m.fitBounds(i,{duration:(c=r==null?void 0:r.duration)!=null?c:Ll.DEFAULT_ANIMATION_DURATION,bearing:(r==null?void 0:r.bearing)===void 0?d(this,gt).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?d(this,gt).map.getPitch():r==null?void 0:r.pitch,maxZoom:(f=r==null?void 0:r.maxZoomLevel)!=null?f:d(this,gt).map.getMaxZoom()})),d(this,Ot).interactionSystem.handleHover(),Promise.resolve()):new Promise(v=>{d(this,Ot).cameraSystem.focusOn(n,Re(this,kx,NO).call(this,r||{},v))})}};gt=new WeakMap,Ot=new WeakMap,Bp=new WeakMap,Rx=new WeakMap,kx=new WeakSet,NO=o(function(t,r){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:d(this,Ot).cameraSystem.convertZoomLevelToAltitude($u(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:d(this,Ot).cameraSystem.convertZoomLevelToAltitude($u(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:t!=null&&t.padding?Object.assign({},FI,t==null?void 0:t.padding):this.insetsPadding,curve:hm[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:Br.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?Br.degToRad($u(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:t==null?void 0:t.duration,callback:o(()=>{d(this,Ot).interactionSystem.handleHover(),r()},"callback"),cancelledCallback:r,interruptible:(n=t==null?void 0:t.interruptible)!=null?n:!0,verticalPadding:t==null?void 0:t.verticalPadding}},"#convertToLegacy"),o(RO,"Camera");var XC=RO;function FO(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}o(FO,"updateBounds");function M$(e,t,r){var c;let n=[],i=[1/0,1/0,-1/0,-1/0],a=null;if(!e||!Array.isArray(e)||e.length===0)return{pointCloud:n,geoBounds:i,firstPosition:a};let u=t.getSystems().renderSystem;(u.threeDdirty||u.twoDdirty)&&t.renderSync();for(let f of e)if(typeof f=="string"){let m=r.get(f);if(!m){ae.error("Entity not found with id:",f);continue}let v=new ro;Q7(t,"userData"in m&&(c=m.userData.entityId)!=null?c:m.id,n,v,m instanceof Bn?m.position.z:void 0);let x=t.convert3DMapPositionToCoordinate(v.min),I=t.convert3DMapPositionToCoordinate(v.max);FO(i,x),FO(i,I),a||(a=t.convert3DMapPositionToCoordinate(v.getCenter(new lt)))}else n.push(t.convertTo3DMapPosition(f[1],f[0],f[2]||0)),FO(i,f),a||(a=f);return{pointCloud:n,geoBounds:i,firstPosition:a}}o(M$,"processTargets");function O0e(e,t){var n,i,a,u;let r=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(n=e.map)!=null&&n.getLayer("bounds-outline")&&e.map.removeLayer("bounds-outline"),(i=e.map)!=null&&i.getSource("bounds-source")&&e.map.removeSource("bounds-source"),(a=e.map)==null||a.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:r}}}),(u=e.map)==null||u.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}o(O0e,"drawBounds");g();g();var O$="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}";g();var L$="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}";g();var D$=4.291666666666667,A$=15,F$=25,N$=43/60;g();var R$=["horizontal","icon"],L0e=new Map([[R$[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>'],[R$[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>']]),D0e=/<svg([^>]*)>/g;function k$(e,t,r,n){let i=L0e.get(e);return i?i.replace(D0e,'<svg$1 width="'.concat(r,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}o(k$,"getLogoIcon");var B$=!1,Rn,Gp,d0,Co,ra,mm,_u,Tc,kO=class kO extends Rt{constructor(r,n,i){super();j(this,Rn,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:o(()=>{window!=null&&window.open("https://www.mappedin.com")},"onClick"),interactive:!0,visible:!0});j(this,Gp);j(this,d0);j(this,Co);j(this,ra);j(this,mm);j(this,_u,0);j(this,Tc,0);b(this,"dirty",!0);b(this,"getPositionAlignedCanvasCoordinates",o((r,n)=>({"top-left":{x:0,y:0},"top-right":{x:r,y:0},"bottom-left":{x:0,y:n},"bottom-right":{x:r,y:n},center:{x:r/2,y:n/2},top:{x:r/2,y:0},bottom:{x:r/2,y:n},left:{x:0,y:n/2},right:{x:r,y:n/2}})[d(this,Rn).position],"getPositionAlignedCanvasCoordinates"));b(this,"getPositionAlignedPadding",o(()=>{var i,a,u,c;let r=d(this,Rn).padding;if(typeof r=="number")return{"top-left":{x:r,y:r},"top-right":{x:-r,y:r},"bottom-left":{x:r,y:-r},"bottom-right":{x:-r,y:-r},center:{x:0,y:0},top:{x:0,y:r},bottom:{x:0,y:-r},left:{x:r,y:0},right:{x:-r,y:0}}[d(this,Rn).position];let n={top:(i=r.top)!=null?i:0,right:(a=r.right)!=null?a:0,bottom:(u=r.bottom)!=null?u:0,left:(c=r.left)!=null?c:0};return{x:n.left-n.right,y:n.top-n.bottom}},"getPositionAlignedPadding"));i&&Object.entries(i).forEach(([a,u])=>{u!==void 0&&(d(this,Rn)[a]=u)}),$(this,d0,r),$(this,Gp,n)}get color(){return d(this,Rn).color==="light"?"white":"#293136"}get iconName(){return d(this,Rn).iconOnly?"icon":"horizontal"}get minWidth(){return d(this,Rn).iconOnly?A$:75}get defaultWidth(){return d(this,Rn).iconOnly?F$:150}get aspectRatio(){return d(this,Rn).iconOnly?N$:D$}get options(){return Y({},d(this,Rn))}set options(r){var n,i;$(this,Rn,{padding:r.padding||d(this,Rn).padding,position:r.position||d(this,Rn).position,iconOnly:r.iconOnly||d(this,Rn).iconOnly,color:r.color||d(this,Rn).color,scale:r.scale||d(this,Rn).scale,onClick:d(this,Rn).onClick,interactive:(n=r.interactive)!=null?n:d(this,Rn).interactive,visible:(i=r.visible)!=null?i:d(this,Rn).visible})}get icon(){return k$(this.iconName,this.color,d(this,_u)*d(this,Gp).pixelRatio,d(this,Tc)*d(this,Gp).pixelRatio)}setSize(r,n){d(this,ra)&&(d(this,ra).uniforms.uSize.value.x=r,d(this,ra).uniforms.uSize.value.y=n)}setXY(r,n){d(this,ra)&&(d(this,ra).uniforms.uSize.value.w=r,d(this,ra).uniforms.uSize.value.z=n)}get width(){return d(this,_u)}get height(){return d(this,Tc)}getPositionAlignedOffset(r,n){return{"top-left":{x:0,y:0},"top-right":{x:-r,y:0},"bottom-left":{x:0,y:-n},"bottom-right":{x:-r,y:-n},center:{x:-(r/2),y:-(n/2)},top:{x:-(r/2),y:0},bottom:{x:-(r/2),y:-n},left:{x:0,y:-(n/2)},right:{x:-r,y:-(n/2)}}[d(this,Rn).position]}insertIntoQuadTree(r){d(this,mm)!=null&&typeof d(this,Rn).onClick=="function"&&d(this,Rn).interactive&&r.insert(d(this,mm))}resize(r,n){if(d(this,Rn).visible!==!0)return;let i=this.getPositionAlignedCanvasCoordinates(r,n),a=this.getPositionAlignedPadding(),u=this.getPositionAlignedOffset(d(this,_u),d(this,Tc)),c=Math.min(r-d(this,_u),Math.max(0,i.x+a.x+u.x)),f=Math.min(n-d(this,Tc),Math.max(0,i.y+a.y+u.y));this.setSize(d(this,_u)/r,d(this,Tc)/n),this.setXY(c/r,f/n),$(this,mm,new gn(c,f,d(this,_u),d(this,Tc),{entityId:"watermark"}))}update(){this.dirty&&(d(this,Rn).visible===!0?($(this,_u,Math.min(d(this,Gp).canvasWidth,Math.max(this.minWidth,this.defaultWidth*d(this,Rn).scale))),$(this,Tc,d(this,_u)/this.aspectRatio),ld.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),r=>{if($(this,ra,new If({uniforms:{uTexture:{value:r},uSize:{value:new P7(0,0,0,0)},uOpacity:{value:.7}},vertexShader:O$,fragmentShader:L$,depthWrite:!1,depthTest:!1,defines:{debug:B$},wireframe:B$,transparent:!0,visible:!0})),d(this,Co))d(this,Co).visible=!0,d(this,Co).material=d(this,ra),d(this,Co).material.needsUpdate=!0;else{let n=new Jl(2,2,1,1);$(this,Co,new Vt(n,d(this,ra))),d(this,Co).position.set(0,0,-1),d(this,Co).frustumCulled=!1,d(this,Co).renderOrder=999;let i=new Kl(1,1,1),a=new Vt(i,new po({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));a.frustumCulled=!1,a.layers.set(1),d(this,Co).add(a),d(this,d0).add(d(this,Co))}this.resize(d(this,Gp).canvasWidth,d(this,Gp).canvasHeight),this.publish("texture-loaded")})):d(this,Co)&&(d(this,Co).visible=!1),this.dirty=!1)}destroy(){d(this,Co)&&(d(this,d0).remove(d(this,Co)),gi(d(this,Co))),$(this,Co,void 0),d(this,ra)&&d(this,ra).dispose(),$(this,ra,void 0),$(this,mm,void 0)}};Rn=new WeakMap,Gp=new WeakMap,d0=new WeakMap,Co=new WeakMap,ra=new WeakMap,mm=new WeakMap,_u=new WeakMap,Tc=new WeakMap,o(kO,"WatermarkSystem");var ZC=kO;g();var KC=100,N0e=!1,BO=class BO extends Rt{constructor(r,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=r,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new ro,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new lt(0,0,0),new lt(KC*2,KC*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(KC)));let r=new ro().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(r);let n=r.getSize(new lt),i=Math.max(n.x,n.y,n.z);for(let u of this.state.geometry2DMap.values())u.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(u.position),u.positionDirty=!1);let a=JC.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(i,KC)).getBoundingSphere(R0e).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new lt),min:JC.min,max:JC.max,radius:a},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,N0e&&this.state.entityScene.parent instanceof Sf){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Zl,this.debugMesh.add(new Vt(new wI(this.cameraSystem.panBounds.radius),new po({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let u=new lt;JC.getSize(u);let c=new Kl(u.x,u.y,u.z),f=new po({color:65280,wireframe:!0,transparent:!0,opacity:.5}),m=new Vt(c,f);m.position.copy(this.currentTotalBoundingBox.getCenter(new lt)),this.debugMesh.add(m)}}}};o(BO,"PanBoundsSystem");var QC=BO,JC=new ro,R0e=new E7;g();var GO="\xA9 Mappedin",k0e="https://info.mappedin.com/feedback",UO=["top-left","top-right","bottom-left","bottom-right"],B0e=640,G0e=o(()=>"<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"),jO={custom:[],position:"bottom-right",feedback:!0},h0,VO=class VO{constructor(t,r={}){b(this,"controlContainerEl");b(this,"controlPositions");b(this,"compact");j(this,h0);b(this,"attribContainerEl");b(this,"attribInnerEl");b(this,"attribButtonEl");b(this,"feedbackLinkEl");b(this,"attribHTML",GO);b(this,"customAttributions",[]);b(this,"toggleAttribution",o(t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));$(this,h0,!!r.outdoorEnabled),this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=UO.reduce((n,i)=>{let a=document.createElement("div");return a.classList.add("mappedin-ctrl-".concat(i)),this.controlContainerEl.appendChild(a),n[i]=a,n},{})}addAttributionControl(t=jO){var i;let r=t.position&&UO.includes(t.position)?t.position:jO.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(r)),this.attribContainerEl.open=!0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[r].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=G0e(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribHTML=d(this,h0)?GO:"",this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((i=t.feedback)!=null?i:jO.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=k0e,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)),t.custom&&(this.customAttributions=t.custom),this.updateAttributionDisplay()}updateAttribution(t){if(!t.style||!this.attribInnerEl||!this.attribContainerEl)return;let r=d(this,h0)?[GO]:[],n=t.style.sourceCaches;for(let i in n){let a=n[i];if(a.used||a.usedForTerrain){let u=a.getSource();u.attribution&&r.indexOf(u.attribution)<0&&r.push(u.attribution)}}r=r.filter(i=>String(i).trim()),r=r.filter((i,a)=>{for(let u=a+1;u<r.length;u++)if(r[u].indexOf(i)>=0)return!1;return!0}),this.attribHTML=r.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=B0e||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(t){this.resizeAttribution(t)}updateData(t){this.updateAttribution(t)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};h0=new WeakMap,o(VO,"HTMLControlsSystem");var e3=VO;g();var Bx,Gx,zO=class zO{constructor(t,r){b(this,"mesh");b(this,"type","custom-geometry");b(this,"dirty",!0);b(this,"feature");b(this,"builder");b(this,"outline");j(this,Bx,1);b(this,"color",new Hn);j(this,Gx,0);this.mesh=new eu,this.feature=t,this.builder=r}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){$(this,Bx,t)}get opacity(){return d(this,Bx)}setColor(t){this.color.set(t)}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return d(this,Gx)}set altitude(t){this.mesh&&(this.mesh.position.z=t,$(this,Gx,t))}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(t){this.mesh&&(this.mesh.renderOrder=t)}};Bx=new WeakMap,Gx=new WeakMap,o(zO,"CustomGeometryComponent");var m0=zO;g();var $O=class $O{constructor(t,r){b(this,"state");b(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=r}update(){let t,r;for(let n of this.state.geometry3DIdsInScene){let i=this.state.geometry3DMap.get(n);(i==null?void 0:i.type)==="custom-geometry"&&(t=i.components[0],r=i.components[1],t.dirty&&r.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],r.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(a=>{a.userData=Ie(Y({},a.userData),{entityId:n,type:"custom-geometry"})}),t.dirty=!1),r.visible!==!1&&t.builder.update(t.mesh))}}};o($O,"CustomGeometrySystem");var t3=$O;g();g();function G$(e){return e.children.some(t=>t.userData.isOutline)}o(G$,"hasOutline");function j$(e,t){var n;let r=e.userData.entities3D.values().next().value;return r?((n=t.geometry3DMap.get(r))==null?void 0:n.components[3])!==void 0:!1}o(j$,"needsOutline");function r3(e,t,r,n){let a=e.getAttribute("position").array,u=-1/0;for(let c=0;c<t.count;c++){let m=(t.start+c)*3,v=a[m+2];u=Math.max(u,v)}for(let c=0;c<t.count;c++){let m=(t.start+c)*3,v=a[m+2];Math.abs(v-u)<1e-4?a[m+2]=Math.max(r+n,2e-4+n):a[m+2]=n}e.attributes.position.needsUpdate=!0}o(r3,"updateBufferGeometryHeight");g();function HO(e){var m,v;let t=new SI,r=(m=e.mesh)==null?void 0:m.geometry;if(!r||!((v=e.batchedProps)!=null&&v.range))return;let n=e.batchedProps.range,i=n.start,a=n.count,u=r.getAttribute("position");if(u){let x=new Float32Array(a*3);for(let I=0;I<a;I++){let C=i+I;x[I*3]=u.array[C*3],x[I*3+1]=u.array[C*3+1],x[I*3+2]=u.array[C*3+2]}t.setAttribute("position",new zs(x,3))}let c=r.getAttribute("normal");if(c){let x=new Float32Array(a*3);for(let I=0;I<a;I++){let C=i+I;x[I*3]=c.array[C*3],x[I*3+1]=c.array[C*3+1],x[I*3+2]=c.array[C*3+2]}t.setAttribute("normal",new zs(x,3))}let f=r.getAttribute("uv");if(f){let x=new Float32Array(a*2);for(let I=0;I<a;I++){let C=i+I;x[I*2]=f.array[C*2],x[I*2+1]=f.array[C*2+1]}t.setAttribute("uv",new zs(x,2))}if(r.index){let x=r.index,I=new Uint32Array(a);for(let C=0;C<a;C++)I[C]=x.array[i+C];t.setIndex(new zs(I,1))}return t}o(HO,"extractBufferGeometryFromBatchedGeometry");function U$(e,t){let r=HO(e);if(!r||!e.mesh)return;e.mesh.deleteInstance(e.instanceIndex),e.mesh.optimize();let n=t.addGeometry(r);t.addInstance(n);let i=t.getGeometryIdAt(n),a=t.getGeometryRangeAt(i);return a&&e.batchedProps&&(e.batchedProps.range=a),r.dispose(),n}o(U$,"transferGeometryToNewBatchedMesh");g();var WO=class WO extends mw{constructor(t){super(t),this.onBeforeCompile=r=>{r.vertexShader=r.vertexShader.replace("#include <common>","#include <common>\n attribute float visibility;"),r.vertexShader=r.vertexShader.replace("#include <project_vertex>","#include <project_vertex>\n if (visibility < 0.5) {\n gl_Position = vec4(-2.0, -2.0, -2.0, 1.0);\n }")}}};o(WO,"OutlineLineMaterial");var n3=WO;var V0e=80,gm,g0,o3,s3,qO=class qO{constructor(t){b(this,"rendererState");b(this,"outlineOpacitiesDirty",!0);j(this,gm,!0);j(this,g0,-1/0);j(this,o3,new Map);j(this,s3,new n3({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:Rd}));this.rendererState=t}get geometries3DDirty(){return d(this,gm)}set geometries3DDirty(t){$(this,gm,t)}update(t,r=!0){let n;if(this.geometries3DDirty){for(let a of this.rendererState.geometry3DIdsInScene){let u=this.rendererState.geometry3DMap.get(a);if(u instanceof al&&j$(u,this.rendererState)&&!G$(u)&&u.userData.entities3D.size>0){let c=[];for(let P of u.userData.entities3D.values()){let L=this.rendererState.geometry3DMap.get(P);if(L instanceof Hr&&L.type==="geometry"&&L.components[3]&&L.components[3].dirty===!0&&L.components[0].material!=null){let A=L.components[0].geometry,M=!1;A||(A=HO(L.components[0]),M=!0),c.push([L.components[3],new gw(A,V0e)]),M&&(A==null||A.dispose(),A=void 0)}}if(c.length===0)continue;let f=ll(c.map(P=>P[1]),!1);if(f==null)continue;let m=f.getAttribute("position"),v=new Float32Array(m.count*4),x=new zs(v,4);f.setAttribute("color",x);let I=new Uint8Array(m.count);I.fill(0);let C=new zs(I,1,!1);f.setAttribute("visibility",C);let T=0;for(let P=0;P<c.length;P++){let[L,A]=c[P],M=A.getAttribute("position").count;L.edgeColors=x,L.edgeVisibility=C,L.geometry=f,L.ranges={count:M,start:T},T+=M,A.dispose()}let O=new lg(f,d(this,s3));O.userData.isOutline=!0,u.add(O)}}$(this,gm,!1),this.outlineOpacitiesDirty=!0}for(let a of this.rendererState.geometry3DIdsInScene){let u=this.rendererState.geometry3DMap.get(a);if(u instanceof Hr&&u.type==="geometry"&&u.components[3]&&u.components[3].dirty===!0&&u.components[0].material!=null&&u.parentObject3D instanceof al){let c=u.components[3].geometry;if(!c)continue;let f=u.components[3];if(!f)continue;let m=f.enabled&&u.components[1].visible;if(f.visible!==m&&(f.visible=m),!f.visible)continue;let v=f.edgeColors;if(!v||!f.ranges)continue;let x=new Hn(f.color);for(let T=0;T<f.ranges.count;T++){let O=f.ranges.start+T;v.setXYZ(O,x.r,x.g,x.b)}let I=u.components[1].height,C=u.components[1].altitude;r3(c,f.ranges,I,C),c.attributes.color.needsUpdate=!0,c.computeBoundingSphere(),f.dirty=!1}}let i=r?jd(t,16,19,0,1):d(this,g0);if((i!==d(this,g0)||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 Ii){let u=n.components[3];if(u&&u.edgeColors&&u.geometry&&u.visible){let c=Math.min(i,n.components[1].opacity*hg(n));if(u.currentOpacity!==c){for(let f=0;f<u.ranges.count;f++){let m=u.ranges.start+f;u.edgeColors.setW(m,c)}u.geometry.attributes.color.needsUpdate=!0}}}}$(this,g0,i),$(this,gm,!1),this.outlineOpacitiesDirty=!1}destroy(){d(this,o3).clear()}};gm=new WeakMap,g0=new WeakMap,o3=new WeakMap,s3=new WeakMap,o(qO,"OutlineInterpolationSystem");var i3=qO;g();g();var YO=class YO extends Vt{constructor(){super(...arguments);b(this,"userData",{entityId:""})}};o(YO,"EntityMesh");var a3=YO,z0e=W.object({flipImageToFaceCamera:W.boolean().optional(),url:W.string()}),$0e=W.object({type:W.enum(["Feature"]),properties:W.object({width:W.number(),height:W.number(),rotation:W.number().min(0).max(360).optional(),verticalOffset:W.number().optional()}),geometry:u0});function V$(e,t,r){W.union([W.number(),W.string()]).parse(e),$0e.parse(t),z0e.parse(r)}o(V$,"validateImage");var XO=class XO{constructor(t){b(this,"mesh",new eu);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 lt);this.feature=t}get visible(){var t,r;return(r=(t=this.mesh)==null?void 0:t.visible)!=null?r:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};o(XO,"ImageComponent");var l3=XO;g();function ZO(e,t){return{x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)}}o(ZO,"rotatePoint");function H0e(e,t){return e.map(r=>ZO(r,t))}o(H0e,"rotatePoints");function W0e(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:t,minY:r,maxX:n,maxY:i}}o(W0e,"getBounds");function q0e(e,t){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let a=t[n].x,u=t[n].y,c=t[i].x,f=t[i].y;u>e.y!=f>e.y&&e.x<(c-a)*(e.y-u)/(f-u)+a&&(r=!r)}return r}o(q0e,"pointInPolygon");function z$(e,t,r,n,i){for(let a=0;a<i;a++)for(let u=0;u<n;u++)if(e[r+a][t+u]!==1)return!1;return!0}o(z$,"isValidRectangle");function Y0e(e,t,r){let n=e.maxX-e.minX,i=e.maxY-e.minY,a,u,c=Y({},e);return n/i>t?(u=i/r,a=u*t,c.minX+=(n-a*r)/2):(a=n/r,u=a/t,c.minY+=(i-u*r)/2),{dx:a,dy:u,gridBounds:c}}o(Y0e,"calculateGridDimensions");function X0e(e,t,r,n,i){let a=Array(r).fill(0).map(()=>Array(r).fill(0));for(let u=0;u<r;u++)for(let c=0;c<r;c++){let f={x:t.minX+c*n,y:t.minY+u*i};q0e(f,e)&&(a[u][c]=1)}return a}o(X0e,"createAndFillGrid");function Z0e(e,t){let r=Array(t).fill(0).map(()=>Array(t).fill(0));for(let n=0;n<t;n++)for(let i=0;i<t;i++)if(e[n][i]===1){let a=0;for(let u=1;u<=Math.min(t-i,t-n)&&z$(e,i,n,u,u);u++)a=u;r[n][i]=a}return r}o(Z0e,"calculateRectSizes");function K0e(e,t,r,n,i,a){let u=0,c=0,f=0;for(let m=0;m<n;m++)for(let v=0;v<n;v++)if(e[m][v]===1){let x=Math.pow(t[m][v],2),I=r.minX+v*i,C=r.minY+m*a;u+=x,c+=I*x,f+=C*x}return{x:c/u,y:f/u}}o(K0e,"calculatePolygonCenter");function J0e(e,t,r,n,i,a,u){let c=-1/0,f=null,m=e.length,v=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let x=0;x<m;x++)for(let I=0;I<m;I++)if(e[x][I]===1)for(let C=1;C<=m-I;C++){let T=C;if(!(T>m-x)&&z$(e,I,x,C,T)){let O=C*T,P=t.minX+(I+C/2)*r,L=t.minY+(x+T/2)*n,A={x:P,y:L},N=Math.sqrt(Math.pow(A.x-i.x,2)+Math.pow(A.y-i.y,2))/v,B=O*(1-a)-N*a*O;B>c&&(c=B,f={center:A,width:C*r*u,height:C*n*u})}}return f}o(J0e,"findBestRectangle");function KO(e,t,r,n={}){let{scaleFactor:i=.9,centerPriority:a=.5,resolution:u=100,minimumSizeRatio:c=.5}=n,f=G7(r),m=e.width/e.height,v=H0e(t,f),x=W0e(v),{dx:I,dy:C,gridBounds:T}=Y0e(x,m,u),O=X0e(v,T,u,I,C),P=Z0e(O,u),L=K0e(O,P,T,u,I,C),A=J0e(O,T,I,C,L,a,i);return!A||A.width<e.width*c||A.height<e.height*c?e:Ie(Y({},A),{center:ZO(A.center,-f),rotation:r,polygonCenter:ZO(L,-f)})}o(KO,"findLargestInteriorRectangle");var jx=Math.PI*2,Q0e=Math.PI/2,e1e=Math.PI*1.5,t1e=zu(Q0e,2),r1e=zu(e1e,2),n1e=.01,$$=!1,JO=class JO extends Rt{constructor(r,n,i=0,a=0,u={}){super();b(this,"rendererState");b(this,"convertTo3DMapPosition");b(this,"initialBearing",0);b(this,"naturalBearing",0);b(this,"imagePlacementOptions");b(this,"imageLoadingCache",new Map);this.rendererState=r,this.convertTo3DMapPosition=n,this.initialBearing=i,this.naturalBearing=a,this.imagePlacementOptions=u}createImageMesh(r,n,i,a=0,u,c){var T,O,P;let f={width:i.width,height:i.height,center:this.convertTo3DMapPosition(u),rotation:(T=i.rotation)!=null?T:0},m=(O=this.imagePlacementOptions.mode)!=null?O:"default",v=(()=>{switch(m){case"fit-nearest-90":let L=(this.initialBearing-this.naturalBearing+360)%180;return L>=45&&L<=135?KO(f,c,f.rotation+90,this.imagePlacementOptions):f;case"fit-initial-bearing":return KO(f,c,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return f}})();if($$&&v.polygonCenter){let L=new Vt(new wI(1),new sl({color:65280}));L.position.set(v.polygonCenter.x,v.polygonCenter.y,a),this.rendererState.entityScene.add(L)}let x=new sl({transparent:!0,depthWrite:!1,side:Xl}),I=new Jl(v.width,v.height),C=new a3(I);if(C.visible=!1,C.renderOrder=1,(P=this.getOrDownloadImage(n))==null||P.then(L=>{x.map=L,x.needsUpdate=!0,x.map.colorSpace=kd,C.visible=!0,this.publish("image-loaded")}),C.userData.entityId=r,C.material=x,$$){let L=new Vt(new Jl(i.width,i.height),new sl({color:"gray"}));C.add(L);let A=new k7;C.add(A),A.scale.set(10,10,10)}return C.position.set(v.center.x,v.center.y,a+n1e),C.rotation.z=(-Br.degToRad(v.rotation)+jx)%jx,C}getOrDownloadImage(r){var n;if(this.imageLoadingCache.has(r))return(n=this.imageLoadingCache.get(r))==null?void 0:n.promise;{let i=new Promise(a=>{ld.getLoader().load(r,u=>{let c=this.imageLoadingCache.get(r);c&&!c.loaded&&(c.loaded=!0),a(u)})});return this.imageLoadingCache.set(r,{loaded:!1,promise:i}),i}}flipIfNeeded(r,n){if(r.imageMesh==null)return;let i=-n,a=r.imageMesh.rotation.z,u=zu((a-i+jx)%jx,2);u>t1e&&u<r1e&&(r.imageMesh.rotation.z=(a+Math.PI)%jx)}update(r){var u,c,f,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 I=this.convertTo3DMapPosition(i.feature.geometry.coordinates),C={x:I.x,y:I.y};i.imageMesh=this.createImageMesh(n.id,a.url,i.feature.properties,i.feature.properties.verticalOffset,i.feature.geometry.coordinates,[C]),i.mesh.add(i.imageMesh),i.position.copy(i.imageMesh.position)}i.imageMesh&&(a.flipImageToFaceCamera&&this.flipIfNeeded(i,r),i.imageMesh.material instanceof sl&&a.dirty&&(i.imageMesh.material.opacity=a.opacity))}else if((n==null?void 0:n.type)==="geometry"){if(i=n.components[0],a=n.components[1],a.showImage&&((u=i.feature.properties)!=null&&u.image)&&i.imageMesh==null&&i.visible&&i.mesh!=null&&i.mesh.parent!=null&&((c=i.feature.properties)==null?void 0:c.image.position)!=null&&i.feature.geometry.coordinates!=null&&i.feature.geometry.coordinates.length>0){let I=i.feature.geometry.coordinates[0].map(T=>{let O=this.convertTo3DMapPosition(T);return{x:O.x,y:O.y}}),C=this.createImageMesh(x,(f=i.feature.properties)==null?void 0:f.image.path,(m=i.feature.properties)==null?void 0:m.image,a.height,(v=i.feature.properties)==null?void 0:v.image.position,I);i.mesh.parent.add(C),i.imageMesh=C}if(i.imageMesh){if(!i.visible)i.imageMesh.visible=!1;else if(a.showImage&&!i.imageMesh.visible)if(a.url){let I=this.imageLoadingCache.get(a.url);I&&I.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,r)}}}};o(JO,"ImageSystem");var u3=JO;g();var i1e=250,cd,QO=class QO extends Rt{constructor(r,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);j(this,cd);b(this,"update",o((r=!1,n=Date.now())=>{this.focusablesDirty&&this.updateFocusableEntities(),!r&&(Date.now()-n>i1e||(d(this,cd)&&cancelAnimationFrame(d(this,cd)),$(this,cd,requestAnimationFrame(()=>{this.updateRaf()}))))},"update"));this.state=r,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let r=new Ft(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new Ft(r.x/1.2,r.y/1.2),i=new Ft(r.x+(r.x-n.x),n.y),a=new Ft(n.x,r.y+(r.y-n.y)),u=new Ft(i.x,a.y),c=new Ft(r.x,r.y/1.5),f=new Ft(r.x,r.y+(r.y-c.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=[r,c,f,n,i,a,u].map((m,v)=>{if(this.debugRaycasters){let O=document.createElement("div");O.style.position="absolute",O.style.top=m.y+"px",O.style.left=m.x+"px",O.style.width="10px",O.style.height="10px",O.style.backgroundColor="red",this.debugEl.append(O)}let x=m.x/this.state.canvasWidth*2-1,I=-(m.y/this.state.canvasHeight)*2+1,C=new Ft(x,I),T=new Vu;return T.setFromCamera(C,this.camera),[T,C,v===0?10:v<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let r,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[1]!==void 0&&i.components[1]instanceof kp){if(n=i.components[1],n.dirty===!0||n.focusMesh==null){n.focusMesh&&gi(n.focusMesh);let u=new ro;u.setFromObject(i);let c=u.max.x-u.min.x,f=u.max.y-u.min.y,m=u.max.z-u.min.z;if(!isFinite(c)||!isFinite(f)||!isFinite(m)||isNaN(c)||isNaN(f)||isNaN(m)||c<=0||f<=0||m<=0)continue;let v=new Kl(c,f,m),x={transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters};if(this.debugRaycasters){let T=["red","green","blue","yellow","purple","orange","pink","brown","gray","black"];x.color=T[Math.floor(Math.random()*T.length)]}let I=new po(x),C=new Vt(v,I);C.position.set((u.min.x+u.max.x)/2,(u.min.y+u.max.y)/2,0),C.userData={entityId:i.userData.entityId},n.focusMesh=C,i.add(C),i.components[1].dirty=!1}this.focusableEntities.add(n.focusMesh)}else if(i.type==="geometry"&&i.components[4]&&i.components[4]instanceof kp&&(r=i.components[0],n=i.components[4],r instanceof Ii&&r.geometry!=null&&(n.dirty===!0||n.focusMesh==null))){if(n.focusMesh==null){let u=new Vt(r.geometry);u.userData={entityId:i.id},n.focusMesh=u}this.focusableEntities.add(n.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.cameraDirty&&this.raycast()}raycast(){this.collisions.clear();for(let[n,i]of this.raycasters)n.setFromCamera(i,this.camera);for(let[n,i,a]of this.raycasters)n.intersectObjects(Array.from(this.focusableEntities.values())).forEach(c=>{var f;if((c==null?void 0:c.object)!=null&&"isMesh"in c.object&&(c!=null&&c.object.isMesh)){let m=c.object.userData.entityId,v=(f=this.collisions.get(m))!=null?f:0;this.collisions.set(m,v+a)}});let r=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",r),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){d(this,cd)&&cancelAnimationFrame(d(this,cd)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};cd=new WeakMap,o(QO,"GeometryInFocusSystem");var c3=QO;g();var H$=20,o1e=5e3,Dl,Ux,Vx,pd,ym,vm,f3,zx,e6=class e6{constructor(t){b(this,"dirty",!0);b(this,"map");b(this,"stylesheetId","");b(this,"userHiddenLayers",new Set);b(this,"hiddenLayersInStyle",new Set);b(this,"centerPoint");b(this,"bbox");b(this,"polygons");j(this,Dl,null);j(this,Ux,o(()=>{d(this,Dl)&&(clearTimeout(d(this,Dl)),$(this,Dl,null),this.dirty=!1)},"#stopTrying"));j(this,Vx,o(()=>{d(this,Dl)&&(clearTimeout(d(this,Dl)),$(this,Dl,null)),$(this,Dl,setTimeout(()=>{d(this,Ux).call(this)},o1e))},"#startTrying"));b(this,"handleRender",o(async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(d(this,pd)&&(d(this,f3).call(this),$(this,pd,!1)),this.centerPoint){let t=this.map.project(this.centerPoint),r=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});if(r.length>0){for(let n of r)this.expr.push(["!=",["id"],n.id]);this.expr.length>0&&this.hiddenLayersInStyle.forEach(n=>{this.map.setFilter(n,["all",...this.expr])}),this.expr=[],$(this,pd,!1),this.dirty=!1}}else if(this.bbox&&this.polygons){let t=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(t.length>0){$(this,pd,!0);for(let r=0;r<t.length;r+=H$){let n=t.slice(r,r+H$);d(this,ym).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=On(i.geometry.coordinates):i.geometry.type==="MultiPolygon"&&(a=Ql(i.geometry.coordinates)),!a)continue;for(let u of this.polygons)if(R1(u,a)){this.expr.push(["!=",["id"],i.id]);continue}}})}d(this,zx).call(this)}}}},"handleRender"));b(this,"expr",[]);j(this,pd,!1);j(this,ym,[]);j(this,vm,null);j(this,f3,o(()=>{d(this,vm)&&(globalThis.cancelAnimationFrame(d(this,vm)),$(this,vm,null)),$(this,ym,[])},"#cancelJobs"));j(this,zx,o(()=>{let t=d(this,ym).pop();typeof t=="function"&&(t(),d(this,ym).length>0&&$(this,vm,globalThis.requestAnimationFrame(d(this,zx)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(r=>{this.map.setFilter(r,["all",...this.expr])}),this.dirty=!1),this.expr=[],$(this,pd,!1),d(this,Ux).call(this)},"#runJobs"));b(this,"handleStyleChange",o(t=>{var r,n;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let i=(n=(r=t==null?void 0:t.style)==null?void 0:r.stylesheet)==null?void 0:n.id;(!i||i!==this.stylesheetId)&&(this.stylesheetId=i,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,r){d(this,Vx).call(this),this.centerPoint=t;for(let n of r)this.userHiddenLayers.add(n);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,r,n){d(this,Dl)&&clearTimeout(d(this,Dl)),d(this,Vx).call(this),this.bbox=t,this.polygons=r.reduce((i,a)=>{if(a.geometry.type==="Polygon"){let u=On(a.geometry.coordinates);i.push(u)}else a.geometry.type==="MultiPolygon"&&i.push(...a.geometry.coordinates.map(u=>On(u)));return i},[]);for(let i of n)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};Dl=new WeakMap,Ux=new WeakMap,Vx=new WeakMap,pd=new WeakMap,ym=new WeakMap,vm=new WeakMap,f3=new WeakMap,zx=new WeakMap,o(e6,"OutdoorLayers");var p3=e6;g();g();g();g();var d3="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";g();var t6="#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";g();var W$="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 q$="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 a1e=new ug;function Y$(e,t,r){var ce;let{breakpoint:n,width:i,accentColor:a,completeFraction:u,isVertical:c,visibleThroughGeometry:f,dashed:m}=t,{color:v}=r,x=!0,I=0,C=1/0,T=t.displayArrowsOnPath,O=!0,P=T,L=typeof i=="object"?Number(i.output[n])/2:i/2,A=typeof i=="object"?Number((ce=i.output[n+1])!=null?ce:i.output[n])/2:i/2,M=L/2+l1e,N=0;e[0].z+=M;for(let ee=1;ee<e.length;++ee){e[ee].z+=M;let be=e[ee].x-e[ee-1].x,Me=e[ee].z-e[ee-1].z;if(c)N+=Math.sqrt(be*be+Me*Me);else{let Fe=e[ee].y-e[ee-1].y;N+=Math.sqrt(be*be+Fe*Fe+Me*Me)}}if(!c){let ee=e[0],be=e[e.length-1];e.push(be.clone().setZ(be.z-.01)),e.unshift(ee.clone().setZ(ee.z-.01))}let B=new w7;P&&(B=a1e.load(q$),B.colorSpace=kd);let H=new Hn(v),z=new Hn(a),R={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new Ft(1,1)},cameraParameters:{type:"v2",value:new Ft(I,0)},complete:{type:"f",value:x?0:1},color:{type:"c",value:H},pathLength:{type:"f",value:N},nearRadius:{type:"f",value:L},farRadius:{type:"f",value:A},nearZoom:{type:"f",value:I},farZoom:{type:"f",value:C},pulseColor:{type:"c",value:z},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:c},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:B},displayArrowsOnPath:{type:"b",value:T},showPulse:{type:"b",value:O},opacityMultiplier:{type:"f",value:1},dashed:{type:"b",value:m}},X=new D7(e);X.curveType="catmullrom",X.tension=0;let ie=30,Q=8,U=ie*e.length,Te=new A7(X,U,L,Q,!1),oe=new Float32Array(Te.attributes.position.count);for(let ee=e.length;ee<oe.length;ee++)oe[ee]=ee;Te.setAttribute("vertexIndex",new zs(oe,1));let fe=new Float32Array(Te.attributes.position.count),se=new zs(fe,1);for(let ee=0;ee<=U;ee++)for(let be=0;be<=Q;++be)se.setX(ee*(Q+1)+be,ee/U);Te.setAttribute("pathDistance",se);let ve=new Float32Array(Te.attributes.normal.count*3),ue=new zs(ve,3);for(let ee=0;ee<U;ee++){let be=Te.tangents[ee];for(let Me=0;Me<=Q;++Me)ue.setXYZ(ee*(Q+1)+Me,be.x,be.y,be.z)}Te.setAttribute("pathTangent",ue);let he=new Float32Array(Te.attributes.normal.count*3),Z=new zs(he,3);for(let ee=0;ee<U;ee++){let be=Te.tangents[ee];var Ke,Ue,rt;c?(Ke=be.x*be.y,Ue=-1+be.y*be.y,rt=be.z*be.y):(Ke=-be.x*be.z,Ue=-be.y*be.z,rt=1-be.z*be.z);let Me=Math.sqrt(Ke*Ke+Ue*Ue+rt*rt);Me===0&&(Me=1);let Fe=Ke/Me,it=Ue/Me,xt=rt/Me;for(let Bt=0;Bt<=Q;++Bt)Z.setXYZ(ee*(Q+1)+Bt,Fe,it,xt)}Te.setAttribute("pathNormal",Z);let Ee=new If({uniforms:R,vertexShader:d3,fragmentShader:t6});Ee.transparent=!0,Ee.alphaTest=.5,R.resolution.value.x=1,R.resolution.value.y=1,R.vertexes.value=oe.length,R.arrowTexture.value.wrapS=Gu,R.arrowTexture.value.wrapT=Gu,R.arrowTexture.value.anisotropy=16;let We=new Vt(Te,Ee),St=We.clone(),yt=Ie(Y({},R),{opacityMultiplier:{type:"f",value:.25}});yt.complete.value=1,St.material=new If({uniforms:yt,vertexShader:d3,fragmentShader:t6}),St.material.transparent=!0,St.material.alphaTest=.5,St.material.depthWrite=!1,St.material.depthTest=!1,yt.resolution.value.x=1,yt.resolution.value.y=1,yt.vertexes.value=oe.length,yt.arrowTexture.value.wrapS=Gu,yt.arrowTexture.value.wrapT=Gu,yt.arrowTexture.value.anisotropy=16,yt.complete.value=u,We.userData=St.userData=t.mesh.userData;let pt=t.mesh;if(!f){let ee=new If({uniforms:R,vertexShader:d3,fragmentShader:W$}),be=new Vt(Te,ee);be.name="stencil",be.material.colorWrite=!1,be.material.stencilWrite=!0,be.material.stencilRef=1,be.material.stencilFunc=_7,be.material.stencilZPass=II,be.material.stencilZFail=II,be.material.stencilFail=II,be.material.depthWrite=!1,be.material.depthTest=!1,be.userData=t.mesh.userData,pt.add(be),pt.add(St),St.renderOrder=0,We.renderOrder=1}if(pt.add(We),c){let ee=new ro().setFromObject(We),be=new lt;ee.getCenter(be),pt.children.forEach(Me=>{Me.geometry.center(),Me.position.copy(be)})}f&&(We.material.stencilWrite=!0,We.material.stencilRef=1,We.material.stencilFunc=S7,We.material.stencilZPass=bI,We.material.stencilZFail=bI,We.material.stencilFail=bI,We.material.needsUpdate=!0,We.layers.disableAll(),We.layers.enable(NI.ALWAYS_ON_TOP)),Te.computeBoundingBox();let te=new lt;return Te.boundingBox.getCenter(te),{mesh:pt,material:Ee,center:te}}o(Y$,"buildPath");var l1e=.15;var u1e=.5,r6=class r6 extends Rt{constructor(r,n,i,a){super();b(this,"rendererState");b(this,"altitudeDirty",!0);b(this,"convertTo3DMapPosition");b(this,"getParentContainer");b(this,"convertZoomLevelToAltitude");this.rendererState=r,this.convertTo3DMapPosition=n,this.getParentContainer=i,this.convertZoomLevelToAltitude=a}update(r,n,i,a=0){let u,c=!1;for(let f of this.rendererState.geometry3DIdsInScene)if(u=this.rendererState.geometry3DMap.get(f),u&&u.type==="path"&&u.components[0].type==="path"){let m=u.components[0],v=u.components[1],x=m.isVertical&&this.altitudeDirty;if(!(m instanceof ud))continue;let I=[];if(m.dirty||x){if(m.mesh.parent!=null)for(let C=m.mesh.children.length-1;C>=0;C--)gi(m.mesh.children[0]);if(m.feature.features.length===2&&m.feature.features[0].properties.parentId&&m.feature.features[1].properties.parentId){let C=m.feature.features[0],T=m.feature.features[m.feature.features.length-1],O,P,L=C.geometry.coordinates[2]||0,A=T.geometry.coordinates[2]||0;C.properties.parentId&&(O=this.getParentContainer(C.properties.parentId,!0),O!=null&&O.altitude!=null&&(L+=O.altitude,m.isVertical=!0)),T.properties.parentId&&(P=this.getParentContainer(T.properties.parentId,!0),P!=null&&P.altitude!=null&&(A+=P.altitude,m.isVertical=!0));let M=this.convertTo3DMapPosition(C.geometry.coordinates[1],C.geometry.coordinates[0],L),N=this.convertTo3DMapPosition(T.geometry.coordinates[1],T.geometry.coordinates[0],A);Math.abs(M.z-N.z)>u1e&&O!=null&&O.visible&&P!=null&&P.visible&&(I=[M,N])}else{let C=m.feature.features;for(let T=0;T<C.length;T++)if(T===0||!pD(C[T].geometry.coordinates,C[T-1].geometry.coordinates)){let O=this.convertTo3DMapPosition(C[T].geometry.coordinates[1],C[T].geometry.coordinates[0],C[T].geometry.coordinates[2]||0);I.push(O)}}if(I.length>1){let{mesh:C,material:T,center:O}=Y$(I,m,{color:v.color});m.mesh=C,m.material=T,m.position=O}m.dirty&&typeof m.width=="object"&&m.width.on==="zoom-level"&&(m.altitudeBreakpoints=m.width.input.map(C=>this.convertZoomLevelToAltitude(C))),m.dirty=!1}v.dirty&&(m.mesh.children.forEach(C=>{C.name!=="stencil"&&(C.material.uniforms.color.value.set(v.color),C.material.visible=v.visible,C.material.needsUpdate=!0)}),m.mesh.position.z=v.altitude,v.dirty=!1),m.isVertical&&m.mesh.children.forEach(C=>{C.rotation.z=-a}),m.material&&(m.mesh.children.forEach(C=>{var O,P,L,A,M,N,B;let T=C.material.uniforms;if(C.name==="stencil"){m.materialDirty&&(T.complete.value=m.completeFraction);return}if(typeof m.width=="object"&&m.width.on==="zoom-level"){m.altitudeBreakpoints&&m.altitudeBreakpoints.length>2&&ae.warn("Path width interpolation does not yet support more than 2 breakpoints! This will be added in a future version. Path width will only use the first two breakpoints.");let H=H7(i,(P=(O=m.altitudeBreakpoints)==null?void 0:O.slice(0,2))!=null?P:[r,n]);m.breakpoint=H,T.nearZoom.value=(A=(L=m.altitudeBreakpoints)==null?void 0:L[H])!=null?A:r,T.farZoom.value=(N=(M=m.altitudeBreakpoints)==null?void 0:M[H+1])!=null?N:n,T.nearRadius.value=Number(m.width.output[H])/2,T.farRadius.value=Number((B=m.width.output[H+1])!=null?B:m.width.output[H])/2}T.cameraParameters.value.x=i,m.materialDirty&&(T.displayArrowsOnPath.value=m.displayArrowsOnPath,T.pulseColor.value.set(m.accentColor),T.complete.value=m.completeFraction,typeof m.width=="number"&&(T.nearZoom.value=r,T.farZoom.value=n,T.nearRadius.value=Number(m.width)/2,T.farRadius.value=Number(m.width)/2))}),m.displayArrowsOnPath&&m.animateArrowsOnPath&&(m.mesh.children.forEach(C=>{C.name!=="stencil"&&(C.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,C.material.needsUpdate=!0)}),c=!0),m.materialDirty=!1)}this.altitudeDirty=!1,c&&this.publish("animate:path")}};o(r6,"PathSystem");var $x=r6;g();var ao,y0,jp,n6=class n6{constructor(t){b(this,"rendererState");b(this,"dirty",!1);j(this,ao);j(this,y0);j(this,jp);this.rendererState=t}updateOne(t){if(t instanceof Hr&&t.components[0]instanceof Ii&&t.components[1]instanceof Wu&&t.parentObject3D instanceof al&&($(this,ao,t.components[0]),$(this,jp,t.components[1]),d(this,ao).detached&&d(this,ao).dirty&&d(this,ao).mesh!=null&&d(this,ao).material!=null&&d(this,ao).batchedProps!=null)){$(this,y0,t.parentObject3D),d(this,ao).visible=!1;let r=new Hn(d(this,jp).color),n=d(this,jp).opacity*hg(t),i=new lm({color:r,side:Xl,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,d(this,ao).material.repeatYFactor),a=new AI(1,d(this,ao).batchedProps.positionCount,0,i),u=U$(d(this,ao),a);if(u==null)return;a.userData={entities:{0:t.id},detached:!0},d(this,ao).instanceIndex=u,d(this,ao).material.setColor(d(this,ao).instanceIndex,r,d(this,jp).topColor?new Hn(d(this,jp).topColor):r),d(this,ao).mesh=a,d(this,ao).material=i,d(this,y0).add(a),d(this,ao).dirty=!1}}update(){if(!this.dirty)return;let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){$(this,ao,void 0),$(this,y0,void 0),$(this,jp,void 0)}};ao=new WeakMap,y0=new WeakMap,jp=new WeakMap,o(n6,"MeshDetachmentSystem");var h3=n6;g();g();function X$(e,t,r){var n;if((n=e.batchedProps)!=null&&n.range&&e.mesh){let i=t||1e-4,a=i/Math.max(r,1e-4);return r3(e.mesh.geometry,e.batchedProps.range,i,0),e.material&&(e.material.repeatYFactor=a),e.currentHeight=i,!0}return!1}o(X$,"updateHeight");function Z$(e,t,r,n,i,a){return e.mesh&&e.instanceIndex!==-1?(e.mesh.getMatrixAt(e.instanceIndex,r),r.decompose(n,i,a),n.z=t,r.compose(n,i,a),e.mesh.setMatrixAt(e.instanceIndex,r),e.altitude=t,!0):!1}o(Z$,"updateAltitude");var Cu,Ec,g3,y3,v3,x3,i6=class i6{constructor(t){b(this,"rendererState");b(this,"dirty",!1);j(this,Cu);j(this,Ec);j(this,g3,new La);j(this,y3,new lt);j(this,v3,new Bd);j(this,x3,new lt);this.rendererState=t}updateOne(t){var r;if(t instanceof Hr&&t.type==="geometry"&&((r=t.components[1])!=null&&r.dirty)&&($(this,Cu,t.components[0]),$(this,Ec,t.components[1]),t.type==="geometry")){let n=!1;d(this,Ec).height!==d(this,Cu).currentHeight&&(n=X$(d(this,Cu),d(this,Ec).height,d(this,Ec).initialHeight)),d(this,Ec).altitude!==d(this,Cu).altitude&&(n=Z$(d(this,Cu),d(this,Ec).altitude,d(this,g3),d(this,y3),d(this,v3),d(this,x3))),n&&d(this,Cu).mesh!=null&&d(this,Cu).mesh.computeBoundingSphere()}}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.cleanup()}cleanup(){$(this,Cu,void 0),$(this,Ec,void 0)}};Cu=new WeakMap,Ec=new WeakMap,g3=new WeakMap,y3=new WeakMap,v3=new WeakMap,x3=new WeakMap,o(i6,"MeshModificationSystem");var m3=i6;g();var c1e={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},o6=class o6{constructor(t){b(this,"state",c1e);b(this,"core");this.core=t}update(t){let r={};for(let[n,i]of Object.entries(t))n in this.state&&this.state[n]!==t[n]&&(this.state[n]=i,r[n]=i);this.handleUpdate(r)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap!=null&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),t.showCollisionBoxes!=null&&(t.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};o(o6,"Debug");var b3=o6;g();var Hx=9,p1e=!1,K$=.1;function f1e(e,t,r){for(let n=0;n<t;n++){let i=(r&16711680)>>16,a=(r&65280)>>8,u=r&255;e[n*3]=i/255,e[n*3+1]=a/255,e[n*3+2]=u/255}}o(f1e,"fillArrayWithColor");var s6=class s6{constructor(t,r,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",o(()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new T7(this.width,this.height,{format:xI,type:vI,internalFormat:"RGBA"})},"resize"));b(this,"shouldShowByXY",o((t,r,n)=>{if(this.pixelBuffer==null)return!1;let i=t+(this.height-r-1)*this.width,a=this.pixelBuffer[i*4],u=this.pixelBuffer[i*4+1],c=this.pixelBuffer[i*4+2],f=a<<16|u<<8|c;return f===n||f===this.backgroundId},"shouldShowByXY"));b(this,"activeOccluders",new Set);b(this,"update",o(()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,r;for(let i of this.state.geometry3DIdsInScene){let a=this.state.geometry3DMap.get(i);if(a&&a instanceof Bn&&a.userData.occluderFeature!=null&&a.userData.occluderId!=null&&(this.activeOccluders.add(a.userData.occluderId),a.userData.occluderDirty)){if(t=a.userData.occluderFeature,t.geometry.type==="Polygon"){let u=EC(t,this.convertTo3DMapPosition,{color:"white",height:K$});r=this.createOccluderMesh(u,a.userData.occluderId),a.add(r)}else if(t.geometry.type==="MultiPolygon"){let u=MC(t,this.convertTo3DMapPosition,{color:"white",height:K$});r=this.createOccluderMesh(u,a.userData.occluderId),a==null||a.add(r)}a.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new Hn(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(Hx),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(Hx),p1e?this.renderService.enabledLayers.add(Hx):this.renderService.enabledLayers.delete(Hx),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let i of this.state.geometry2DIdsInScene){let a=this.state.geometry2DMap.get(i);if(a&&(a==null?void 0:a.occluderId)!=null&&this.activeOccluders.has(a==null?void 0:a.occluderId)){let u=a.components[0].projection,c=Math.floor(u.x*this.scale),f=Math.floor(u.y*this.scale),m=this.shouldShowByXY(c,f,a.occluderId);a.components[0].isOccluded=!m}}})},"update"));if(this.state=t,this.convertTo3DMapPosition=r,(n==null?void 0:n.renderer)==null)throw new Error("No Renderer");this.renderService=n,this.renderer=n.renderer,this.resize(),this.pickingMaterial=new If({glslVersion:C7,vertexShader:"\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec3 vColor;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(vColor, 1.0);\n }\n "})}applyId(t,r){let n=t.attributes.position,i=new Float32Array(n.count*3);f1e(i,n.count,r),t.setAttribute("color",new zs(i,3))}createOccluderMesh(t,r){let n=new Vt(t,this.pickingMaterial);return n.layers.set(Hx),this.applyId(n.geometry,r),n.userData.occluderId=r,n}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var t;this.destroyed=!0,(t=this.pickingTexture)==null||t.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};o(s6,"Occlusion2DSystem");var I3=s6;g();var a6=class a6{constructor(t){this.state=t;b(this,"dirty",!0)}update(){var t;if(this.dirty){for(let r of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(r);if(n instanceof Hr&&n.type==="geometry"&&((t=n.components[0])==null?void 0:t.geometry)!=null){let i=n.components[0];i.geometry&&(i.geometry.dispose(),i.geometry=void 0)}}this.dirty=!1}}};o(a6,"GeometryDisposalSystem");var S3=a6;var J$=new Vu;var{DEFAULT_PITCH:f6,DEFAULT_BEARING:d6,DEFAULT_ZOOM_LEVEL:h6,DEFAULT_MIN_ZOOM_LEVEL:d1e,DEFAULT_MAX_ZOOM_LEVEL:h1e}=Ll,m1e=Br.radToDeg(.6435011087932844),Mi,yi,xm,Wx,v0,fd,bm,x0,gs,u6,pe,Pn,wu,Oi,Mc,qo,me,qx,Yo,jn,Q$,eH,tH,Up,_3,Yx,Xx,Zx,b0,C3,Kx,Jx,Qx,I0,c6,Im,eb,tb,na,ia,p6,S0,rb,g6=class g6 extends Rt{constructor(r,n={}){var I,C,T,O,P,L,A,M,N,B,H,z,R,X,ie;super();j(this,gs);b(this,"options");b(this,"container");b(this,"Debug");j(this,Mi);j(this,yi);j(this,xm);j(this,Wx);j(this,v0);j(this,fd);j(this,bm);j(this,x0);b(this,"rendererDomElement");j(this,pe,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,geometryGroupIdsToLoad:new Set,entityScene:new Bn("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:FI,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,internalTweenGroup:new BC,externalTweenGroup:new BC,cameraObject:new hw,naturalBearing:0,containerOffset:[0,0],useStandaloneCamera:!1});b(this,"camera");j(this,Pn);j(this,wu);j(this,Oi);j(this,Mc);j(this,qo);j(this,me,{});j(this,qx,window.matchMedia("screen and (min-resolution: 2dppx)"));b(this,"map");j(this,Yo,o(()=>{d(this,me).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));j(this,jn,o(()=>{d(this,me).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));j(this,Up,"standalone");j(this,_3,o(()=>{d(this,me).geometryDisposalSystem.dirty=!0,this.render()},"#setGeometryDisposalDirty"));j(this,Yx,o(r=>Math.trunc(r*10)/10,"#round10"));j(this,Xx,o(()=>{Re(this,gs,u6).call(this,dg()),d(this,me).twoDDrawSystem.dirty=!0,d(this,b0).call(this,void 0,void 0,!0)},"#handlePixelRatioChange"));j(this,Zx,o(()=>{d(this,b0).call(this)},"#handleWindowResizeWithEvent"));j(this,b0,o((r,n,i=!1)=>{let a=r!=null?r:this.rendererDomElement.clientWidth,u=n!=null?n:this.rendererDomElement.clientHeight;if((a===0||u===0)&&!i)return;d(this,pe).canvasWidth=a,d(this,pe).canvasHeight=u,Re(this,gs,u6).call(this,dg()),d(this,I0).call(this),Re(this,gs,tH).call(this),d(this,me).cameraSystem.resize(this.canvasWidth,this.canvasHeight),d(this,me).cameraSystem.dirty=!0,d(this,me).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),d(this,me).htmlControlsSystem.resize(this.canvasWidth),d(this,me).geometryInFocusSystem.resize(),d(this,me).occlusion2DSystem.resize();let{top:c,left:f}=this.container.getBoundingClientRect();d(this,pe).containerOffset=[c,f],this.publish("resize"),this.render()},"#handleWindowResize"));j(this,C3,o(()=>{this.renderSync()},"#renderFull"));j(this,Kx,new lt);j(this,Jx,o((r,n)=>{let i=this.mode==="standalone"?d(this,yi):this.viewCamera;if(d(this,yi).position.z+this.camera.elevation>n.z){d(this,Kx).copy(n);let a=d(this,Kx).project(i),u=(a.x+1)/2*this.canvasWidth-0/2,c=(-a.y+1)/2*this.canvasHeight-0/2,f=d(this,Yx).call(this,u),m=d(this,Yx).call(this,c);r.x=f,r.y=m}else r.x=-1e3,r.y=-1e3},"#project"));j(this,Qx,o((r,n)=>{d(this,qo).setBufferSize(r,n),d(this,yi).aspect=r/n,d(this,yi).updateProjectionMatrix(),d(this,yi).updateMatrixWorld(!0),d(this,v0).x=r,d(this,v0).y=n},"#setBufferSize"));j(this,I0,o(()=>{var u;let r=d(this,pe).canvasWidth=this.rendererDomElement.clientWidth,n=d(this,pe).canvasHeight=this.rendererDomElement.clientHeight,i=Math.floor(r*this.resolutionScale),a=Math.floor(n*this.resolutionScale);d(this,Qx).call(this,i,a),(u=this.map)==null||u.resize(),d(this,pe).shouldMeasureCanvas=!1},"#measureCanvas"));b(this,"getParentContainer",o((r,n=!0)=>{if(!r)return n?d(this,pe).entityScene:void 0;if(typeof r=="string"||typeof r=="number"){let i=d(this,pe).geometry3DMap.get(r);return i instanceof Bn?i:(ae.warn("Parent (".concat(typeof r=="object"?r.id:r,") is not a valid container, adding to scene")),n?d(this,pe).entityScene:void 0)}else if(r.type==="group-container"){let i=d(this,pe).geometry3DMap.get(r.id);if(i instanceof Bn)return i}return n?d(this,pe).entityScene:void 0},"getParentContainer"));b(this,"showCollisionBoxes",o(()=>{d(this,me).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));b(this,"hideCollisionBoxes",o(()=>{d(this,me).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));b(this,"projectScreenXYToCoordinate",o((r,n,i=!1)=>{var I,C;let a=d(this,pe).containerOffset[0],u=d(this,pe).containerOffset[1],c=(r-u)/d(this,pe).canvasWidth*2-1,f=-((n-a)/d(this,pe).canvasHeight)*2+1,m=new Ft(c,f),v,x;if(i)J$.setFromCamera(m,d(this,yi)),v=(I=J$.intersectObject(d(this,fd),!1)[0])==null?void 0:I.point;else{let T=d(this,me).interactionSystem.getThreeDIntersectsFromXY(m);v=(C=T==null?void 0:T[0])==null?void 0:C.point,x=d(this,me).interactionSystem.getGroupContainerIntersectsFromXY(m)}if(v)return{coordinate:this.convert3DMapPositionToCoordinate(v),groupContainers:x}},"projectScreenXYToCoordinate"));b(this,"projectCoordinateToScreenXY",o(r=>{let n=this.convertTo3DMapPosition(r[1],r[0],r[2]||0),i=new Ft;return d(this,Jx).call(this,i,n),{x:i.x,y:i.y}},"projectCoordinateToScreenXY"));b(this,"convert3DMapPositionToCoordinate",o(r=>{var a,u,c,f;let{lat:n,lon:i}=kI((u=(a=d(this,pe).center)==null?void 0:a[1])!=null?u:0,(f=(c=d(this,pe).center)==null?void 0:c[0])!=null?f:0,r.x,r.y);return[i,n,r.z]},"convert3DMapPositionToCoordinate"));b(this,"setBackgroundColor",o((r,n)=>{d(this,qo).setBackgroundColor(r,n)},"setBackgroundColor"));b(this,"getMetresPerPixel",o(()=>{let r=this.container.clientWidth,n=this.container.clientHeight/2,i=this.projectScreenXYToCoordinate(0,n,!0),a=this.projectScreenXYToCoordinate(r,n,!0);return i==null||a==null?void 0:EI(i.coordinate,a.coordinate)/r},"getMetresPerPixel"));b(this,"hideOutdoorLayersUnderPoint",o((r,n)=>{!this.map||(n==null?void 0:n.length)===0||(d(this,me).outdoorLayersSystem.hideLayersUnderPoint(r,n),this.render())},"hideOutdoorLayersUnderPoint"));b(this,"hideOutdoorLayersIntersectingPolygons",o((r,n,i)=>{d(this,me).outdoorLayersSystem.hideLayersIntersectingPolygons(r,n,i),this.render()},"hideOutdoorLayersIntersectingPolygons"));j(this,Im,new L7);j(this,eb,new La);j(this,tb,o(r=>{var n;ae.error("Render failed: ",r,(n=r.stack)!=null?n:"No stack trace available"),this.publish("render-error",{error:r})},"#onRenderError"));b(this,"render",o(()=>{var r;if(((r=d(this,me))==null?void 0:r.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return d(this,me).renderSystem.update().catch(d(this,tb))},"render"));b(this,"renderSync",o(()=>d(this,me).renderSystem.update(!0).catch(d(this,tb)),"renderSync"));j(this,na,y1(()=>{this.publish("user-interaction-start",void 0)},0,!0));j(this,ia,y1(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));b(this,"on",o((r,n)=>{super.on(r,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(r)&&this.mode==="standalone"&&S.env.NODE_ENV!=="test"&&(ae.warn('"'.concat(r,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(r))},"on"));b(this,"off",o((r,n)=>{super.off(r,n)},"off"));b(this,"getCursor",o(()=>d(this,me).interactionSystem.getCursor(),"getCursor"));b(this,"destroy",o(()=>{var r;d(this,me)&&(d(this,me).cameraSystem.off("user-dolly-start",d(this,na)),d(this,me).cameraSystem.off("user-pan-start",d(this,na)),d(this,me).cameraSystem.off("user-rotate-start",d(this,na)),d(this,me).cameraSystem.off("user-zoom-start",d(this,na)),d(this,me).cameraSystem.off("user-tilt-start",d(this,na)),d(this,me).cameraSystem.off("user-pedestal-start",d(this,na)),d(this,me).cameraSystem.off("user-dolly-end",d(this,ia)),d(this,me).cameraSystem.off("user-pan-end",d(this,ia)),d(this,me).cameraSystem.off("user-rotate-end",d(this,ia)),d(this,me).cameraSystem.off("user-zoom-end",d(this,ia)),d(this,me).cameraSystem.off("user-tilt-end",d(this,ia)),d(this,me).cameraSystem.off("user-pedestal-end",d(this,ia)),d(this,me).renderSystem.off("measure-canvas",d(this,I0)),d(this,me).meshOptimizationSystem.off("geometry-2d-added",this.render),d(this,me).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),d(this,Yo).call(this),d(this,jn).call(this),this.renderSync(),d(this,me).renderSystem.destroy(),d(this,me).cameraSystem.off("change",this.render),d(this,me).pathSystem.off("animate:path",this.render),d(this,me).cameraSystem.dispose(),d(this,me).exporterSystem.destroy(),d(this,me).outdoorLayersSystem.destroy(),d(this,me).drawSystem.destroy(),window.removeEventListener("resize",d(this,Zx),!1),d(this,qx).removeEventListener("change",d(this,Xx)),d(this,bm)&&d(this,bm).disconnect(),this._subscribers={},d(this,qo).destroy(),(r=d(this,Mi))==null||r.traverse(n=>{gi(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),$(this,Mi,void 0),d(this,me).htmlControlsSystem.destroy(),d(this,me).collisionSystem.destroy(),d(this,me).interactionSystem.destroy(),d(this,me).domMutationSystem.destroy(),d(this,me).geometryInFocusSystem.destroy(),$(this,me,void 0),d(this,Up)!=="outdoors-overlay"&&(this.map&&this.map.remove(),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(d(this,Mc)),this.container.removeChild(d(this,Pn)),$(this,qo,void 0))},"destroy"));j(this,S0,new lt);j(this,rb,new lt);if(d(this,pe).useStandaloneCamera=(I=n.useStandaloneCamera)!=null?I:!1,d(this,pe).naturalBearing=(C=n.naturalBearing)!=null?C:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!r.clientWidth||!r.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&&($(this,Up,n.mode),this.map=n.map),d(this,pe).entityScene.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,Yo).call(this)}),d(this,pe).entityScene.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,Yo).call(this)}),d(this,pe).geometry3DMap.set(d(this,pe).entityScene.userData.entityId,d(this,pe).entityScene),n.center&&(d(this,pe).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=r,Re(this,gs,Q$).call(this),Re(this,gs,eH).call(this),d(this,me).htmlControlsSystem=new e3(this.container,{outdoorEnabled:!!this.map}),d(this,Up)!=="outdoors-overlay"&&d(this,me).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),S.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),$(this,qo,new G_({antialias:typeof n.antialias=="boolean"?n.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(T=n.gl)==null?void 0:T.canvas:void 0,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:o(Q=>{var U;(U=n.onWebGLContextRestored)==null||U.call(n,Q),d(this,Yo).call(this),d(this,jn).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(O=n.backgroundAlpha)!=null?O:1})),$(this,Mi,new Sf),d(this,Up)!=="standalone"&&d(this,Mi).add(fD()),d(this,Mi).add(d(this,pe).entityScene);let i=window.__THREE_DEVTOOLS__;S.env.NODE_ENV==="dev"&&typeof i<"u"&&(i.dispatchEvent(new CustomEvent("observe",{detail:d(this,Mi)})),i.dispatchEvent(new CustomEvent("observe",{detail:d(this,qo)}))),$(this,yi,new hw(m1e,this.aspect,50,1e5)),d(this,pe).cameraObject=d(this,yi),$(this,Wx,new M7),d(this,yi).renderOrder=999;let a=new Zl;a.add(d(this,yi)),$(this,x0,new Zl),d(this,x0).add(a),d(this,Mi).add(d(this,x0)),d(this,yi).updateProjectionMatrix(),d(this,yi).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:o(()=>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=d(this,qo).domElement(),$(this,v0,new Ft);let u=new Jl(1e6,1e6),c=new po({color:0,visible:!1});$(this,fd,new Vt(u,c)),d(this,fd).name="worldPlane",d(this,Mi).add(d(this,fd)),(P=n.gl)!=null&&P.canvas||r.appendChild(this.rendererDomElement),window.addEventListener("resize",d(this,Zx),!1),d(this,qx).addEventListener("change",d(this,Xx)),typeof ResizeObserver=="function"&&((L=S.env)==null?void 0:L.NODE_ENV)!=="test"&&($(this,bm,new ResizeObserver(K7(Q=>{d(this,b0).call(this,Q[0].contentRect.width,Q[0].contentRect.height)},50))),(A=d(this,bm))==null||A.observe(r)),r.classList.add("mappedin-map"),this.rendererDomElement.style.width=(M=globalThis.MappedinDebug)!=null&&M.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(N=globalThis.MappedinDebug)!=null&&N.TEST_IOS?"1920px":"100%",S.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),this.mode!=="outdoors-overlay"&&this.rendererDomElement.tabIndex!==void 0&&this.rendererDomElement.removeAttribute("tabindex"),d(this,pe).canvasWidth=this.rendererDomElement.clientWidth,d(this,pe).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let f=this.canvasWidth,m=this.canvasHeight;d(this,me).watermarkSystem=new ZC(d(this,yi),d(this,pe),n==null?void 0:n.watermark),d(this,me).watermarkSystem.on("texture-loaded",this.render),d(this,pe).shouldMeasureCanvas=!0,d(this,pe).pixelRatio=this.resolutionScale,d(this,Qx).call(this,Math.floor(f*this.resolutionScale),Math.floor(m*this.resolutionScale));let v=new PI(16777215,.3*Math.PI);v.position.set(-150,-150,350),d(this,Mi).add(v);let x=new N7(16777215,.741*Math.PI);d(this,Mi).add(x),d(this,me).cameraSystem=new f0(d(this,yi),d(this,Mi),d(this,qo).renderer,d(this,pe),{mode:this.mode,canvasHeight:m,canvasWidth:f}),d(this,me).cameraSystem.on("user-dolly-start",d(this,na)),d(this,me).cameraSystem.on("user-pan-start",d(this,na)),d(this,me).cameraSystem.on("user-rotate-start",d(this,na)),d(this,me).cameraSystem.on("user-zoom-start",d(this,na)),d(this,me).cameraSystem.on("user-tilt-start",d(this,na)),d(this,me).cameraSystem.on("user-pedestal-start",d(this,na)),d(this,me).cameraSystem.on("user-dolly-end",d(this,ia)),d(this,me).cameraSystem.on("user-pan-end",d(this,ia)),d(this,me).cameraSystem.on("user-rotate-end",d(this,ia)),d(this,me).cameraSystem.on("user-zoom-end",d(this,ia)),d(this,me).cameraSystem.on("user-tilt-end",d(this,ia)),d(this,me).cameraSystem.on("user-pedestal-end",d(this,ia)),d(this,me).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),d(this,me).geometryInFocusSystem&&(d(this,me).geometryInFocusSystem.cameraDirty=!0),this.render()}),d(this,me).pathSystem=new $x(d(this,pe),this.convertTo3DMapPosition,this.getParentContainer,d(this,me).cameraSystem.convertZoomLevelToAltitude),d(this,me).pathSystem.on("animate:path",this.render),d(this,me).panBoundsSystem=new QC(d(this,pe),d(this,me).cameraSystem),d(this,me).panBoundsSystem.on("update",()=>{let{panBounds:Q,fov:U,convertAltitudeToZoomLevel:Te}=d(this,me).cameraSystem;if(d(this,me).panBoundsSystem.autoMinZoomLevel){if(Q.radius<=0)return;let oe=Math.min(d(this,pe).canvasWidth/d(this,pe).canvasHeight,1),fe=U*Math.PI/180*oe,se=Math.tan(fe/2),{radius:ve,center:ue}=d(this,me).cameraSystem.panBounds,he=ve/se,Z=this.getThreeCamera().getWorldPosition(new lt),Ke=ue.distanceTo(Z),Ue=Math.abs(Z.z-ue.z),rt=he*Ue/Ke,Ee=Te(rt);cD(Ee,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(Ee)}this.publish("pan-bounds-change",d(this,me).cameraSystem.panBounds)}),this.camera=new XC(this,d(this,me),d(this,pe)),this.camera.setZoomLevel((B=n.zoomLevel)!=null?B:h6),this.camera.setBearing((H=n.bearing)!=null?H:d6),this.camera.setPitch((z=n.pitch)!=null?z:f6),this.camera.setMaxZoomLevel(h1e),this.camera.setMinZoomLevel(d1e),d(this,me).domVisiblitySystem=new DC(d(this,pe),d(this,Mc)),d(this,me).domMutationSystem=new YC(d(this,pe),d(this,Mc)),d(this,me).domMutationSystem.on("dimensions-update",()=>{d(this,me).collisionSystem.collidersDirty=!0,this.render()}),d(this,me).domDrawSystem=new qC(d(this,pe)),d(this,me).collisionSystem=new V_(d(this,wu),d(this,pe),((R=n.useCollisionWorker)!=null?R:!0)&&((X=n.useWorkers)!=null?X:!0)),d(this,me).twoDDrawSystem=new FC(d(this,pe),d(this,Oi),n.transformImageRequest),d(this,me).twoDDrawSystem.on("img:loaded",this.render),d(this,me).interactionSystem=new ex(this.rendererDomElement,d(this,pe),d(this,yi),d(this,fd),d(this,me).cameraSystem.isUserInteracting),d(this,me).interactionSystem.on("doubletap-with-onefinger",Q=>{var U;this.camera.animateTo({center:(U=this.projectScreenXYToCoordinate(Q.clientX,Q.clientY))==null?void 0:U.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:Iw,easing:"ease-out"})}),d(this,me).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:Iw,easing:"ease-out"})}),d(this,me).interactionSystem.on("hover",this.render),d(this,me).interactionSystem.on("click",Q=>{var Te,oe,fe,se,ve,ue,he,Z,Ke,Ue,rt,Ee;if(((Te=Q.entity2D)==null?void 0:Te.id)==="watermark"&&typeof d(this,me).watermarkSystem.options.onClick=="function"&&d(this,me).watermarkSystem.options.interactive){d(this,me).watermarkSystem.options.onClick();return}let U=Q.entity3D?[(oe=Q.entity3D)==null?void 0:oe.id]:[];(ve=(se=(fe=Q.entity3D)==null?void 0:fe.parentObject3D)==null?void 0:se.userData)!=null&&ve.entityId&&U.push((Z=(he=(ue=Q.entity3D)==null?void 0:ue.parentObject3D)==null?void 0:he.userData)==null?void 0:Z.entityId),this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(Q.position),geometry:U,paths:((Ke=Q.entity3D)==null?void 0:Ke.components[0])instanceof ud?[Q.entity3D.id]:[],markers:((Ue=Q.entity2D)==null?void 0:Ue.components[0])instanceof Sc?[Q.entity2D.id]:[],models:((rt=Q.entity3D)==null?void 0:rt.components[0])instanceof sd?[Q.entity3D.id]:[],labels:((Ee=Q.entity2D)==null?void 0:Ee.components[0])instanceof _c?[Q.entity2D.id]:[],containers:Array.isArray(Q.groupContainers)?Q.groupContainers.map(We=>We.userData.entityId):[],pointerEvent:Q.pointerEvent})}),d(this,me).interactionSystem.on("hover",Q=>{var U,Te,oe,fe,se;Q.position&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(Q.position),geometry:Q.entity3D?[(U=Q.entity3D)==null?void 0:U.id]:[],paths:((Te=Q.entity3D)==null?void 0:Te.components[0])instanceof ud?[Q.entity3D.id]:[],markers:((oe=Q.entity2D)==null?void 0:oe.components[0])instanceof Sc?[Q.entity2D.id]:[],models:((fe=Q.entity3D)==null?void 0:fe.components[0])instanceof sd?[Q.entity3D.id]:[],labels:((se=Q.entity2D)==null?void 0:se.components[0])instanceof _c?[Q.entity2D.id]:[],containers:Array.isArray(Q.groupContainers)?Q.groupContainers.map(ve=>ve.userData.entityId):[]})}),d(this,me).geometryInFocusSystem=new c3(d(this,pe),d(this,yi)),d(this,me).geometryInFocusSystem.on("geometry-in-focus",Q=>{this.publish("geometry-in-focus",Q)}),d(this,me).twoDVisiblitySystem=new RC(d(this,pe)),d(this,me).drawSystem=new NC(d(this,pe),this.convertTo3DMapPosition),d(this,me).drawSystem.on("texture-loaded",this.render),d(this,me).twoDProjectionSystem=new AC(d(this,pe),d(this,Jx)),d(this,me).exporterSystem=new yx(d(this,pe)),d(this,me).meshOptimizationSystem=new LC(d(this,pe),this.convertTo3DMapPosition),d(this,me).meshOptimizationSystem.on("model-loaded",this.render),d(this,me).meshOptimizationSystem.on("geometry-2d-added",this.render),d(this,me).meshOptimizationSystem.on("geometry-group-added",d(this,_3)),d(this,me).meshDetachmentSystem=new h3(d(this,pe)),d(this,me).meshModificationSystem=new m3(d(this,pe)),d(this,me).geometryDisposalSystem=new S3(d(this,pe)),d(this,me).customGeometrySystem=new t3(d(this,pe),this.convertTo3DMapPosition),d(this,me).outlineInterpolationSystem=new i3(d(this,pe)),d(this,me).renderSystem=new kC(d(this,qo),d(this,pe),this.mode,d(this,Mi),d(this,yi),this.viewCamera,d(this,me)),d(this,me).imageSystem=new u3(d(this,pe),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),d(this,me).text3DSystem=new pC(d(this,pe),this.convertTo3DMapPosition,(ie=n.useWorkers)!=null?ie:!0),d(this,me).text3DSystem.on("render",this.render),d(this,me).imageSystem.on("image-loaded",this.render),d(this,me).renderSystem.on("pre-render",()=>this.publish("pre-render")),d(this,me).renderSystem.on("post-render",()=>this.publish("post-render")),d(this,me).renderSystem.on("measure-canvas",d(this,I0)),d(this,me).outdoorLayersSystem=new p3(this.map),d(this,me).occlusion2DSystem=new I3(d(this,pe),this.convertTo3DMapPosition,d(this,qo)),n.occlusionEnabled&&d(this,me).occlusion2DSystem.enable(),this.Debug=new b3(this),n.environment!==!1&&$(this,xm,Re(this,gs,p6).call(this)),d(this,C3).call(this)}get viewCamera(){return d(this,Wx)}get canvasWidth(){return d(this,pe).canvasWidth}get canvasHeight(){return d(this,pe).canvasHeight}get resolutionScale(){var r,n;return(n=(r=this.map)==null?void 0:r._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:dg()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return d(this,Up)}addGroupContainer(r,n,i){if(!d(this,pe).geometry3DMap.has(r)&&!d(this,pe).geometry2DMap.has(r)){let a=new Bn(r);a.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,Yo).call(this)}),a.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,Yo).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&&Wo(a,n.interactive,d(this,pe)),(n==null?void 0:n.focusable)!==void 0&&yC(a,n.focusable),(n==null?void 0:n.preloadGeometry)!==void 0&&(a.userData.preloadGeometry=n.preloadGeometry),d(this,pe).geometry3DMap.set(r,a);let u=this.getParentContainer(i);u instanceof Bn&&u.addEntity(a),d(this,jn).call(this),this.render()}else ae.error("Group container with ID '".concat(r,"' already exists. The group container cannot be added."));return{id:r,type:"group-container"}}addCustomGeometry(r,n,i,a,u){if(d(this,pe).geometry3DMap.has(r))ae.error("Custom geometry with ID '".concat(r,"' already exists. The custom geometry cannot be added."));else{let c=new m0(n,i),f=new Hr(c,new Wu(a));(a==null?void 0:a.interactive)!==void 0&&Wo(f,a.interactive,d(this,pe)),f.id=r,c.mesh.userData={entityId:r,type:"custom-geometry"},d(this,pe).geometry3DMap.set(f.id,f);let m=this.getParentContainer(u);u&&m instanceof Bn?m.addEntity(f):d(this,pe).entityScene.addEntity(f),d(this,jn).call(this),this.render()}return{id:r,type:"custom-geometry"}}addGeometryGroup(r,n,i,a){var u,f;if(!d(this,pe).geometry3DMap.has(r)&&!d(this,pe).geometry2DMap.has(r)){let m=new al(r);m.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,Yo).call(this)}),m.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,Yo).call(this)}),m.userData.dirty=!0,d(this,pe).geometry3DMap.set(r,m);for(let x of n.features){if(x.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(x.geometry.type))continue;let I=(x==null?void 0:x.id)||((u=x==null?void 0:x.properties)==null?void 0:u.id)||an(),c=i||{color:X7},{visible:C,altitude:T}=c,O=is(c,["visible","altitude"]),P=d(this,me).meshOptimizationSystem.createEntityFromFeature(I,x,Y({outline:!0},O));d(this,pe).geometry3DMap.set(I,P),m.userData.entities3D.add(I)}m.setVisible((f=i==null?void 0:i.visible)!=null?f:!0),(i==null?void 0:i.altitude)!=null&&m.setAltitude(i.altitude);let v=this.getParentContainer(a);v instanceof Bn&&v.addEntity(m),d(this,jn).call(this),this.render()}else ae.error("Geometry group with ID '".concat(r,"' already exists. The geometry group cannot be added."));return d(this,me).outlineInterpolationSystem.geometries3DDirty=!0,{id:r,type:"geometry-group"}}addOccluder(r,n){let i=this.getParentContainer(n),a=d(this,me).occlusion2DSystem.reserveOccluderId();return i==null||i.addOccluderFeature(r,a),a}addImage(r,n,i,a){try{V$(r,n,i)}catch(u){ae.error(u);return}if(!d(this,pe).geometry3DMap.has(r)&&!d(this,pe).geometry2DMap.has(r)){let u=new l3(n),c=new Hr(u,new Wu(i));c.id=r||an(),u.mesh.userData={entityId:c.id,type:"path"},d(this,pe).geometry3DMap.set(c.id,c);let f=this.getParentContainer(a);f instanceof Bn&&f.addEntity(c),d(this,jn).call(this),this.render()}else ae.error("Image with ID '".concat(r,"' already exists. The image cannot be added."));return{id:r,type:"image"}}addModelGroup(r,n,i,{parent:a,onComplete:u}={}){var c,f;try{g$(r,n,i)}catch(m){ae.error(m);return}if(!d(this,pe).geometry3DMap.has(r)&&!d(this,pe).geometry2DMap.has(r)){let m=new al(r);m.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,Yo).call(this)}),m.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,Yo).call(this)}),d(this,pe).geometry3DMap.set(r,m),m.userData.dirty=!0,m.userData.modelURL=i.url;for(let x of n.features){let I=x.id||x.properties.id||an(),C=d(this,me).meshOptimizationSystem.createModelFromFeature(I,x,Y({},i));(x.properties.interactive!==void 0||i.interactive!=null)&&Wo(C,(c=x.properties.interactive)!=null?c:i.interactive,d(this,pe)),d(this,pe).geometry3DMap.set(I,C),m.userData.entities3D.add(I)}let v=this.getParentContainer(a);v instanceof Bn&&v.addEntity(m),d(this,jn).call(this),(f=this.render())==null||f.then(u)}else ae.error("Model group with ID '".concat(r,"' already exists. The model group cannot be added."));return{id:r,type:"geometry-group"}}addMarker2D(r,n,i,a){var c;let u=i==null?void 0:i.id;try{FV(r,n,i||{})}catch(f){ae.error(f);return}if(u===void 0||!d(this,pe).geometry2DMap.has(u)&&!d(this,pe).geometry3DMap.has(u)){let f=Re(this,gs,c6).call(this,r,new Sc(n,i),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);f.id=u||String(f.id),u=f.id,(i==null?void 0:i.interactive)!=null&&i.interactive!=="pointer-events-auto"&&Wo(f,i==null?void 0:i.interactive,d(this,pe));let m=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?d(this,pe).geometry3DMap.get(i.attachTo):void 0;m instanceof Hr&&m.attach(f),(c=this.getParentContainer(a))==null||c.addEntity(f),this.render()}else ae.error("Marker2D with ID '".concat(u,"' already exists. The marker cannot be added."));return{id:u,type:"marker"}}addText3D(r,n,i,a){if(!d(this,pe).geometry3DMap.has(r)&&!d(this,pe).geometry2DMap.has(r)){let u=new rd(Ie(Y({},n),{properties:Ie(Y({},n.properties),{id:r,content:n.properties.text})})),c=new Hr(u,new v1(i==null?void 0:i.appearance));c.id=r,u.mesh.userData.entityId=r.toString(),u.mesh.userData.type="text3d",d(this,pe).geometry3DMap.set(r,c);let f=this.getParentContainer(a);f instanceof Bn&&f.addEntity(c),d(this,jn).call(this),this.render()}else ae.error("Text3D with ID '".concat(r,"' already exists. The text3d cannot be added."));return{id:r,type:"text3d"}}labelText3D(r,n,i={}){var m,v;try{if(!n||!r)throw new Error("content and meshGeometryId are required");Oz.parse(i)}catch(x){ae.error(x);return}let a=d(this,pe).geometry3DMap.get(r);if((a==null?void 0:a.type)!=="geometry"){ae.error(".labelText3D failed: target incorrect");return}let u=a==null?void 0:a.components[0];if(!u.feature.properties.textArea)return;if(u.textEntityId){let x=d(this,pe).geometry3DMap.get(u.textEntityId);if((x==null?void 0:x.type)!=="text3d"){ae.error(".labelText3D failed: existing text3d not found");return}return{id:x.id,type:x.type}}let c=new rd({type:"Feature",geometry:{coordinates:(m=u.feature.properties.textArea)==null?void 0:m.position,type:"Point"},properties:{textArea:u.feature.properties.textArea,content:n,id:an()}});c.polygonEntityId=r;let f=new Hr(c,new v1(i==null?void 0:i.appearance));return u.textEntityId=f.id.toString(),c.mesh.userData.entityId=f.id.toString(),c.mesh.userData.type="text3d",d(this,pe).geometry3DMap.set(f.id.toString(),f),i.parentId&&((v=this.getParentContainer(i.parentId))==null||v.addEntity(f)),this.render(),{id:f.id,type:"text3d"}}addLabel2D(r,n,i,a){var c;let u=i==null?void 0:i.id;try{Iz(r,n,i||{})}catch(f){ae.error(f);return}if(u===void 0||!d(this,pe).geometry2DMap.has(u)&&!d(this,pe).geometry3DMap.has(u)){let f=Re(this,gs,c6).call(this,r,new _c(n,i||{},d(this,pe)),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);f.id=u||String(f.id),u=f.id,(i==null?void 0:i.interactive)!=null&&Wo(f,i==null?void 0:i.interactive,d(this,pe));let m=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?d(this,pe).geometry3DMap.get(i.attachTo):void 0;m instanceof Hr&&m.attach(f),(c=this.getParentContainer(a))==null||c.addEntity(f),d(this,Yo).call(this),this.render()}else ae.error("Label2D with ID '".concat(u,"' already exists. The label cannot be added."));return{id:u,type:"label"}}addPath(r,n={},i){var f;try{_$(r,n||{})}catch(m){ae.error(m);return}let a=new ud(r,tO(n)),u=new Hr(a,new Wu({color:(f=n==null?void 0:n.color)!=null?f:"#ff834c"}));u.id=(n==null?void 0:n.id)||an(),a.mesh.userData={entityId:u.id,type:"path"},d(this,pe).geometry3DMap.set(u.id,u),(n==null?void 0:n.interactive)!=null&&Wo(u,n==null?void 0:n.interactive,d(this,pe));let c=this.getParentContainer(i);return c instanceof Bn&&c.addEntity(u),d(this,jn).call(this),this.render(),{id:u.id,type:"path"}}updateWatermark(r){d(this,me).watermarkSystem.options=r,d(this,me).watermarkSystem.dirty=!0,d(this,me).collisionSystem.collidersDirty=!0,this.render()}remove(r){var i;let n;if(typeof r=="string"||typeof r=="number"?(n=d(this,pe).geometry2DMap.get(r),n==null&&(n=d(this,pe).geometry3DMap.get(r))):typeof r.id=="string"||typeof r.id=="number"?(n=d(this,pe).geometry2DMap.get(r.id),n==null&&(n=d(this,pe).geometry3DMap.get(r.id))):n=r,n!=null){if(n.type==="custom-geometry")d(this,pe).geometry3DMap.delete(n.id),n.object3d&&gi(n.object3d);else if(n.type==="group-container"){d(this,pe).geometry3DMap.delete(n.userData.entityId);for(let u of n.childrenIds.values())this.remove(u),n.userData.entities2D.delete(u);let a=n.components[1];a&&a.focusMesh&&gi(a.focusMesh),gi(n)}else if(n.type==="geometry-group"){d(this,pe).geometry3DMap.delete(n.userData.entityId);for(let a of n.userData.entities3D.values())this.remove(a),n.userData.entities3D.delete(a);gi(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let a=n.components[0],u=n.components[4];if(n.entities2D.size>0){for(let c of n.entities2D.values())this.remove(c);n.removeAllEntities()}if(n.object3d&&(((i=n.parentObject3D)==null?void 0:i.type)==="geometry-group"&&n.parentObject3D.userData.entities3D.delete(n.id),gi(n.object3d)),n.type==="geometry"){let c=n.components[3];c&&(c.enabled=!1,c.dirty=!0)}u&&"focusMesh"in u&&u.focusMesh!=null&&gi(u.focusMesh),"textMesh"in a&&a.textMesh!=null&&this.remove(a.textMesh.userData.entityId),d(this,pe).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let a=n.attachedTo;if(a){let u=d(this,pe).geometry3DMap.get(a);u instanceof Hr&&u.detach(n)}n.object3d&&gi(n.object3d),n.type==="label"&&delete d(this,me).twoDDrawSystem.textCache[n.id],d(this,pe).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&gi(n.object3d),d(this,pe).geometry3DMap.delete(n.id);else if(n.type==="text3d"){gi(n.object3d);let{batchedText:a,textMesh:u,polygonEntityId:c}=n.components[0];if(u&&(a&&a.removeText(u),gi(u)),c){d(this,me).text3DSystem.remove(c);let f=d(this,pe).geometry3DMap.get(c);(f==null?void 0:f.type)==="geometry"&&(f.components[0].textMesh=void 0,f.components[0].textEntityId=void 0)}d(this,pe).geometry3DMap.delete(n.id)}d(this,jn).call(this),d(this,Yo).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return d(this,Mi)}getThreeCamera(){return d(this,yi)}async setEnvironment(r){if(d(this,Mi))if(r==="basic"){d(this,xm)||$(this,xm,Re(this,gs,p6).call(this));let n=await d(this,xm);d(this,Mi).environment=n}else d(this,Mi).environment=null}getEnvironment(){var r;return(r=d(this,Mi))!=null&&r.environment?"basic":!1}getCurrentSceneGLTF(r){return d(this,me).exporterSystem.getCurrentSceneGLTF(r)}getBoundingArea(r){(d(this,me).renderSystem.threeDdirty||d(this,me).renderSystem.twoDdirty)&&this.renderSync();let n=new ro;if(r==null)n.setFromObject(d(this,pe).entityScene);else{let i=fg(d(this,pe),r);if((i==null?void 0:i.type)==="geometry"&&(i==null?void 0:i.object3d)!=null){let a=i.components[0],u=a instanceof Ii?a.geometry:void 0;a.mesh instanceof _I&&u?(u.computeBoundingBox(),u.boundingBox&&n.union(u.boundingBox)):n.setFromObject(i.object3d)}else((i==null?void 0:i.type)==="geometry-group"||(i==null?void 0:i.type)==="group-container")&&(i==null?void 0:i.userData.entityId)!=null&&n.setFromObject(i)}if(Gd(n))return J7(n).map(this.convert3DMapPositionToCoordinate)}hasState(r){return fg(d(this,pe),r)!=null}getState(r){var i,a,u,c,f,m,v,x,I,C,T,O,P,L,A;if(r==null)return{type:"map-view",hoverColor:d(this,pe).hoverColor,text3dHoverColor:d(this,pe).text3dHoverColor};let n=fg(d(this,pe),r);if((n==null?void 0:n.type)==="custom-geometry"){let M=n.components[0],N=n.components[1];return{id:n.id,type:"custom-geometry",visible:N.visible,altitude:N.altitude,parent:(i=n.parentObject3D)==null?void 0:i.userData.entityId,position:this.convert3DMapPositionToCoordinate(M.position)}}else if((n==null?void 0:n.type)==="geometry-group"){let M=[];for(let H of n.userData.entities3D.values()){let z=this.getState(H);((z==null?void 0:z.type)==="geometry"||(z==null?void 0:z.type)==="model")&&M.push(z)}let N=n.userData.entities3D.values().next().value,B=N?this.getState(N):{};return{id:n.userData.entityId,type:"geometry-group",visible:n.visible,altitude:n.altitude,color:B==null?void 0:B.color,initialColor:B==null?void 0:B.initialColor,side:(a=B==null?void 0:B.side)!=null?a:"double",opacity:B==null?void 0:B.opacity,height:B==null?void 0:B.height,texture:B==null?void 0:B.texture,topColor:B==null?void 0:B.topColor,topTexture:B==null?void 0:B.topTexture,interactive:Array.from(n.userData.entities3D.values()).map(H=>d(this,pe).geometry3DMap.get(H)).every(H=>H&&H.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(H=>this.getState(H)).filter(Boolean)}}else{if((n==null?void 0:n.type)==="group-container")return{id:n.userData.entityId,type:"group-container",visible:n.visible,altitude:(u=n.getWorldPosition(g1e).z)!=null?u:0,opacity:n.opacity,interactive:!!n.components[0],children:Array.from(n.childrenIds.values()).map(M=>this.getState(M)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let M=n.components[0],N=n.object3d.parent,B=N==null?void 0:N.userData.entityId;return{id:n.id,type:"label",text:M.text||"",parent:{id:B,type:N==null?void 0:N.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:M.enabled,visible:M.visible,initialRank:Qv(M.initialRank),options:{rank:Qv(M.rank),appearance:M.appearance,interactive:n.components[1]!=null,verticalOffset:n.verticalOffset,attachTo:n.attachedTo}}}else if((n==null?void 0:n.type)==="marker"){let M=n.components[0],N=n.object3d.parent,B=N==null?void 0:N.userData.entityId;return{id:n.id,type:"marker",enabled:M.enabled,visible:M.visible,placement:M.options.placement,dynamicResize:M.options.dynamicResize,parent:{id:B,type:N==null?void 0:N.type},position:this.convert3DMapPositionToCoordinate(n.position),element:M.containerEl,initialRank:Qv(M.initialRank),contentHTML:M.contentHtml,options:{rank:Qv(M.rank),interactive:n.components[1]!=null||!1,verticalOffset:n.verticalOffset,attachTo:n.attachedTo,lowPriorityPin:M.options.lowPriorityPin}}}else if((n==null?void 0:n.type)==="geometry"){let{color:M,hoverColor:N,initialColor:B,initialTopColor:H,topColor:z,altitude:R}=n.components[1],X=n.components[0],ie=n.components[1],Q=n.components[1],U=n.components[2],Te=n.components[3],oe=n.parentObject3D;return{id:n.id,type:"geometry",opacity:Q.opacity,initialColor:B,color:M,focusable:ie!=null&&ie.focusMesh!=null,initialTopColor:H,topColor:z,side:Q.side,hoverColor:N,hovered:!!(U!=null&&U.hover),height:Q.height,visible:Q.visible,outline:Te==null?void 0:Te.enabled,showImage:Q.showImage,texture:Q.texture,topTexture:Q.topTexture,flipImageToFaceCamera:Q.flipImageToFaceCamera,parent:{id:oe==null?void 0:oe.userData.entityId,type:oe==null?void 0:oe.type},altitude:R,position:this.convert3DMapPositionToCoordinate(X.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let M=n.components[0],N=n.components[1],B=n.components[2];return{id:n.id,type:"model",position:M.mesh?this.convert3DMapPositionToCoordinate((c=M.mesh)==null?void 0:c.getWorldPosition(new lt)):this.convert3DMapPositionToCoordinate(M.position),interactive:B!=null,material:N.material,parent:(f=n.parentObject3D)!=null&&f.parent?{id:n.parentObject3D.parent.userData.entityId,type:n.parentObject3D.parent.type}:void 0,visible:N.visible,verticalOffset:N.verticalOffset,color:N.color,opacity:N.opacity,rotation:(m=N.rotation)!=null?m:yg,scale:(v=N.scale)!=null?v:gg}}else if((n==null?void 0:n.type)==="path"){let M=n.components[0],N=n.components[2],B=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(M.position),visible:B.visible,interactive:N!=null,completeFraction:M.completeFraction,color:B.color,accentColor:M.accentColor,width:M.width,animateArrowsOnPath:M.animateArrowsOnPath,displayArrowsOnPath:M.displayArrowsOnPath,altitude:B.altitude}}else if((n==null?void 0:n.type)==="image"){let M=n.components[0];return{id:n.id,type:"image",position:this.convert3DMapPositionToCoordinate(M.position),visible:n.components[1].visible,verticalOffset:(x=M.feature.properties.verticalOffset)!=null?x:0,opacity:n.components[1].opacity,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera,width:(I=M.feature.properties.width)!=null?I:0,height:(C=M.feature.properties.height)!=null?C:0,rotation:(T=M.feature.properties.rotation)!=null?T:0}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof rd&&"textArea"in n.components[0].feature.properties){Xz(n);let M=n.components[0],N=n.components[1],{textMesh:B}=M,H=(O=M.mesh)==null?void 0:O.parent;H instanceof Bn&&((P=H.children.find(X=>X.type==="batchedtext"))==null||P.getWorldPosition(d(this,rb))),d(this,S0).set(0,0,0);let z=B?B.getWorldPosition(d(this,S0)):d(this,S0);return Object.assign({},mg,N.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(z.add(d(this,rb))),visible:(L=M.visible)!=null?L:!1,content:(A=M.feature.properties.content)!=null?A:""})}else return}}setState(r,n){var a,u;if(typeof r=="object"&&n==null){"hoverColor"in r&&(g1(r.hoverColor)?d(this,pe).hoverColor=(a=r.hoverColor)!=null?a:d(this,pe).hoverColor:ae.warn('Failed to update global hover color. Invalid color "'.concat(r.hoverColor,'".'))),"text3dHoverColor"in r&&(d(this,pe).text3dHoverColor=(u=r.text3dHoverColor)!=null?u:d(this,pe).text3dHoverColor);return}let i=fg(d(this,pe),r);if(i!=null){if(i.type==="custom-geometry"){let c=d(this,pe).geometry3DMap.get(i.id);if(c instanceof Hr&&c.components[0]instanceof m0){let f=n;Cc(i,d(this,pe),f.visible),s0(i,f.altitude),K5(i,f.position,this.convertTo3DMapPosition),J5(i,this.getParentContainer(f.parent,!1)),Wo(i,f.interactive,d(this,pe))&&d(this,jn).call(this)}}else if(i.type==="path"){let c=n;Wo(i,c.interactive,d(this,pe))&&d(this,jn).call(this),s0(i,c.altitude),Yz(i,d(this,pe),c)}else if(i.type==="model"){let c=n;Wo(i,c.interactive,d(this,pe))&&d(this,jn).call(this),Cc(i,d(this,pe),c.visible),Jz(i,c)}else if(i.type==="group-container"){let c=n;Cc(i,d(this,pe),c.visible)&&(d(this,me).pathSystem.altitudeDirty=!0,d(this,me).geometryInFocusSystem.focusablesDirty=!0),s0(i,c.altitude)&&(d(this,me).pathSystem.altitudeDirty=!0),Wo(i,c.interactive,d(this,pe))&&d(this,jn).call(this),gx(i,d(this,pe),c.opacity)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),c.preloadGeometry&&i.userData.preloadGeometry!==!0&&(i.userData.preloadGeometry=!0,d(this,me).outlineInterpolationSystem.geometries3DDirty=!0),yC(i,c.focusable)&&(d(this,me).geometryInFocusSystem.focusablesDirty=!0)}else if(i.type==="geometry-group"){let c=n;Cc(i,d(this,pe),c.visible),Nz(i,d(this,pe),c),gC(i,d(this,pe),c.outline),c.height!=null&&hC(i,d(this,pe),c.height),s0(i,c.altitude),Hz(i,d(this,pe),c),Rz(i,d(this,pe),c.shading),gx(i,d(this,pe),c.opacity)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Wo(i,c.interactive,d(this,pe))&&(d(this,jn).call(this),d(this,Yo).call(this)),vC(i,d(this,pe),c.side)}else if(i.type==="geometry"){if(i.components[0]instanceof Ii){let c=n;Cc(i,d(this,pe),c.visible),gC(i,d(this,pe),c.outline),kz(i,c),yC(i,c.focusable)&&(d(this,me).geometryInFocusSystem.focusablesDirty=!0),qz(i,c.renderOrder)&&(d(this,me).meshDetachmentSystem.dirty=!0),Wz(i,c.opacity)&&(d(this,me).meshDetachmentSystem.dirty=!0,d(this,me).interactionSystem.dirty3D=!0,d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Q5(i,c.flipImageToFaceCamera),s0(i,c.altitude),c.height!=null&&hC(i,d(this,pe),c.height),eO(i,c)&&(d(this,me).meshDetachmentSystem.dirty=!0),mC(i,c),Vz(i,c.hoverColor),Wo(i,c.interactive,d(this,pe)),zz(i,c.hovered),vC(i,d(this,pe),c.side)}d(this,jn).call(this)}else if(i.type==="label"||i.type==="marker"){let c=n;Uz(i,n,d(this,pe)),Gz(i,n,d(this,pe))&&(d(this,Yo).call(this),d(this,me).domMutationSystem.dirty=!0),K5(i,c.position,this.convertTo3DMapPosition),J5(i,this.getParentContainer(c.parent,!1))&&(d(this,Yo).call(this),d(this,me).panBoundsSystem.dirty=!0),Bz(i,c.enabled),Cc(i,d(this,pe),c.visible)}else if(i.type==="image"){let c=n;Cc(i,d(this,pe),c.visible),gx(i,d(this,pe),c.opacity),Q5(i,c.flipImageToFaceCamera)}else if(i.type==="text3d"){let c=n;Kz(i,d(this,pe),c)}this.render()}}convertTo3DMapPosition(r,n,i=0,a){var f,m,v,x,I;if(Array.isArray(r))return this.convertTo3DMapPosition(r[1],r[0],(f=r[2])!=null?f:i,typeof n=="function"?n:void 0);if(typeof n!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:u,y:c}=BI((v=(m=d(this,pe).center)==null?void 0:m[1])!=null?v:0,(I=(x=d(this,pe).center)==null?void 0:x[0])!=null?I:0,r,n);return a?(a.set(u,c,i),a):new lt(u,c,i)}get backgroundColor(){return typeof d(this,qo).backgroundColor=="string"?d(this,qo).backgroundColor:"#".concat(d(this,qo).backgroundColor.getHexString())}get backgroundAlpha(){return d(this,qo).backgroundAlpha}getThreeRenderer(){return d(this,qo)}getCenter(r){let n=Array.isArray(r)?r:this.getBoundingArea(r);return n?uD(n):void 0}isInView(r){let n=fg(d(this,pe),r);if(d(this,eb).identity().multiply(d(this,yi).projectionMatrix).multiply(d(this,yi).matrixWorldInverse),d(this,Im).setFromProjectionMatrix(d(this,eb)),n instanceof Vd)return d(this,Im).containsPoint(n.position);if(n instanceof Hr){let i=n==null?void 0:n.components[0];if(i instanceof m0||i instanceof sd)return d(this,Im).containsPoint(this.convertTo3DMapPosition(i.feature.geometry.coordinates));if(i instanceof Ii){let a=new ro(this.convertTo3DMapPosition(i.featureBbox[1],i.featureBbox[0],0),this.convertTo3DMapPosition(i.featureBbox[3],i.featureBbox[2],0));return d(this,Im).intersectsBox(a)}}return!1}getSystems(){return d(this,me)}getInternalState(){return d(this,pe)}getInternalTweenGroup(){return d(this,pe).internalTweenGroup}getExternalTweenGroup(){return d(this,pe).externalTweenGroup}computeMinZOffsetBetweenContainers(r,n,i){if(!r||!n)return-1;cg(r,"group-container"),cg(n,"group-container");let a=GI(r,this.getThreeCamera()),u=n.clone(),c=GI(u,this.getThreeCamera());if(!Gd(a)||!Gd(c))return-1;let f=0,m;i&&this.container.querySelectorAll(".debug-box").forEach(x=>x.remove());do{if(f>1e4)return-1;if(f+=20,u.position.z=f,u.updateMatrixWorld(),c.makeEmpty(),GI(u,d(this,yi),c),m=a.intersectsBox(c),i){let v=Cw(a,"blue",this.container),x=Cw(c,m?"red":"green",this.container);v.classList.add("debug-box"),x.classList.add("debug-box")}}while(m);return f}};Mi=new WeakMap,yi=new WeakMap,xm=new WeakMap,Wx=new WeakMap,v0=new WeakMap,fd=new WeakMap,bm=new WeakMap,x0=new WeakMap,gs=new WeakSet,u6=o(function(r){var n;d(this,Up)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(r)),d(this,pe).pixelRatio=this.resolutionScale},"#setResolutionScale"),pe=new WeakMap,Pn=new WeakMap,wu=new WeakMap,Oi=new WeakMap,Mc=new WeakMap,qo=new WeakMap,me=new WeakMap,qx=new WeakMap,Yo=new WeakMap,jn=new WeakMap,Q$=o(function(){$(this,Pn,document.createElement("div")),d(this,Pn).classList.add("mappedin__smart-collision-engine__container"),$(this,wu,document.createElement("canvas")),d(this,wu).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(d(this,Pn)),$(this,Oi,document.createElement("canvas")),d(this,Oi).classList.add("mappedin__smart-collision-engine__container"),d(this,Oi).width=d(this,Pn).clientWidth*this.resolutionScale,d(this,Oi).height=d(this,Pn).clientHeight*this.resolutionScale,d(this,Oi).style.width=d(this,Pn).clientWidth+"px",d(this,Oi).style.height=d(this,Pn).clientHeight+"px",d(this,Pn).appendChild(d(this,wu)),d(this,Pn).appendChild(d(this,Oi)),d(this,wu).width=d(this,Pn).clientWidth,d(this,wu).height=d(this,Pn).clientHeight,d(this,Oi).width=d(this,Pn).clientWidth*this.resolutionScale,d(this,Oi).height=d(this,Pn).clientHeight*this.resolutionScale,d(this,Oi).style.width=d(this,Pn).clientWidth+"px",d(this,Oi).style.height=d(this,Pn).clientHeight+"px"},"#renderEntity2DContainer"),eH=o(function(){$(this,Mc,document.createElement("div")),d(this,Mc).classList.add("mappedin-2d-entities"),Object.assign(d(this,Mc).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(d(this,Mc))},"#renderEntityDOMContainer"),tH=o(function(){d(this,Oi).width=d(this,Pn).clientWidth*this.resolutionScale,d(this,Oi).height=d(this,Pn).clientHeight*this.resolutionScale,d(this,Oi).style.width=d(this,Pn).clientWidth+"px",d(this,Oi).style.height=d(this,Pn).clientHeight+"px",d(this,wu).width=d(this,Pn).clientWidth,d(this,wu).height=d(this,Pn).clientHeight,d(this,Oi).width=d(this,Pn).clientWidth*this.resolutionScale,d(this,Oi).height=d(this,Pn).clientHeight*this.resolutionScale,d(this,Oi).style.width=d(this,Pn).clientWidth+"px",d(this,Oi).style.height=d(this,Pn).clientHeight+"px",d(this,me).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),Up=new WeakMap,_3=new WeakMap,Yx=new WeakMap,Xx=new WeakMap,Zx=new WeakMap,b0=new WeakMap,C3=new WeakMap,Kx=new WeakMap,Jx=new WeakMap,Qx=new WeakMap,I0=new WeakMap,c6=o(function(r,n,i,a){let u=new Vd(n,this.convertTo3DMapPosition(r[1],r[0],r[2]||0),a);return u.occluderId=i!=null?i:d(this,me).occlusion2DSystem.backgroundId,d(this,pe).geometry2DMap.set(u.id,u),u},"#createEntity2D"),Im=new WeakMap,eb=new WeakMap,tb=new WeakMap,na=new WeakMap,ia=new WeakMap,p6=o(async function(){return ld.load(HU).then(r=>{var n;return d(this,Mi)&&((n=d(this,Mi).environment)==null||n.dispose(),r.mapping=b7,d(this,Mi).environment=r,this.render()),r})},"#loadEnvMap"),S0=new WeakMap,rb=new WeakMap,o(g6,"Core");var l6=g6,g1e=new lt,m6=l6;g();function y1e(e,t){v1e(e,t)(e.getScene(),t),x1e(e,t),t.addFolder("Export").add({export:o(async()=>{let u=await e.getCurrentSceneGLTF({binary:!0}),c=new Blob([u],{type:"application/octet-stream"});var f=document.createElement("a");document.body.appendChild(f),f.style.display="none";let m=window.URL.createObjectURL(c);f.href=m,f.download="scene.glb",f.click(),window.URL.revokeObjectURL(m)},"export")},"export");let i=t.addFolder("Camera"),a={get bearing(){return e.camera.bearing},set bearing(u){e.camera.setBearing(u)},get pitch(){return e.camera.pitch},set pitch(u){e.camera.setPitch(u)},get zoomLevel(){return e.camera.zoomLevel},set zoomLevel(u){e.camera.setZoomLevel(u)}};i.add(a,"bearing",-359,359,1),i.add(a,"pitch",e.camera.minPitch,e.camera.maxPitch,1),i.add(a,"zoomLevel",e.camera.minZoomLevel,e.camera.maxZoomLevel,.1)}o(y1e,"mountSceneGraphVisualizer");function v1e(e,t){let r=t;return o(function n(i,a){let u=a.addFolder("".concat([i.type]," ").concat(i.id.slice(0,16)));if(a.close(),i.type==="geometry"||i.type==="model"||i.type==="path"||i.type==="image"){let c={get height(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry"?f.height:0},set height(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry"&&e.setState(i,{height:f})},set flipImageToFaceCamera(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="image"&&e.setState(i,{flipImageToFaceCamera:f})},get flipImageToFaceCamera(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="image"?f.flipImageToFaceCamera:!1},set visible(f){let m=e.getState(i.id);((m==null?void 0:m.type)==="geometry"||(m==null?void 0:m.type)==="path"||(m==null?void 0:m.type)==="image")&&e.setState(i,{visible:f})},get visible(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry"||(f==null?void 0:f.type)==="path"||(f==null?void 0:f.type)==="image"?f.visible:!1},set outline(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry"&&e.setState(i,{outline:f})},get outline(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry"?f.outline:!1},get opacity(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry"?f.opacity:1},set opacity(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry"&&e.setState(m,{opacity:f})},get color(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry"&&f.color?ct(f.color).toHexString():"#ffffff"},set color(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry"&&e.setState(m,{color:f})},set interactive(f){let m=e.getState(i.id);((m==null?void 0:m.type)==="geometry"||(m==null?void 0:m.type)==="model"||(m==null?void 0:m.type)==="path")&&(e.setState(i,{interactive:f}),r.controllersRecursive().forEach(v=>v.updateDisplay()))},get interactive(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry"||(f==null?void 0:f.type)==="model"||(f==null?void 0:f.type)==="path"?f.interactive:!1},get completeFraction(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="path"?f.completeFraction:1},set completeFraction(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="path"&&e.setState(m,{completeFraction:f})},focus:o(()=>{},"focus")};u.add(c,"focus").onChange(()=>{let f=e.getState(i.id);(f==null?void 0:f.type)==="model"||(f==null?void 0:f.type)==="path"||(f==null?void 0:f.type)==="image"?e.camera.focusOn([f.position]):(f==null?void 0:f.type)==="geometry"&&e.camera.focusOn(e.getBoundingArea(f))}),u.add(c,"visible"),i.type==="image"?u.add(c,"flipImageToFaceCamera"):(u.add(c,"interactive"),i.type==="path"&&u.add(c,"completeFraction",0,1,.1),i.type!=="model"&&(u.addColor(c,"color"),u.add(c,"outline"))),i.type==="geometry"&&(u.add(c,"height"),u.add(c,"opacity",0,1,.1))}else if(i.type==="marker"){let c={get interactive(){var m;let f=e.getState(i.id);return(f==null?void 0:f.type)==="marker"?(m=f.options)==null?void 0:m.interactive:!1},set interactive(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="marker"&&(e.setState(m,{options:{interactive:f}}),r.controllersRecursive().forEach(v=>v.updateDisplay()))},focus:o(()=>{},"focus")};u.add(c,"focus").onChange(()=>{let f=e.getState(i.id);(f==null?void 0:f.type)==="marker"&&e.camera.focusOn([f.position])}),u.add(c,"interactive")}else if(i.type==="label"){let c={get interactive(){var m;let f=e.getState(i.id);return(f==null?void 0:f.type)==="label"?(m=f.options)==null?void 0:m.interactive:!1},set interactive(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="label"&&(e.setState(m,{options:{interactive:f}}),r.controllersRecursive().forEach(v=>v.updateDisplay()))},get text(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="label"?f.text:""},set text(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="label"&&e.setState(m,{text:f})},get"Text Color"(){var m;let f=e.getState(i.id);return(f==null?void 0:f.type)==="label"?(m=f.options.appearance)==null?void 0:m.textColor:"#000000"},set"Text Color"(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="label"&&e.setState(i.id,{text:c.text,options:{appearance:{textColor:f}}})},get"Text Size"(){var m;let f=e.getState(i.id);return(f==null?void 0:f.type)==="label"?(m=f.options.appearance)==null?void 0:m.textSize:10},set"Text Size"(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="label"&&e.setState(m,{text:c.text,options:{appearance:{textSize:f}}})},get"Icon Size"(){var m;let f=e.getState(i.id);return(f==null?void 0:f.type)==="label"?(m=f.options.appearance)==null?void 0:m.iconSize:10},set"Icon Size"(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="label"&&e.setState(m,{text:c.text,options:{appearance:{iconSize:f}}})},get"Pin Color"(){var m;let f=e.getState(i.id);return(f==null?void 0:f.type)==="label"?(m=f.options.appearance)==null?void 0:m.pinColor:"#000000"},set"Pin Color"(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="label"&&e.setState(m,{text:c.text,options:{appearance:{pinColor:f}}})},get"Pin Color Inactive"(){var m;let f=e.getState(i.id);return(f==null?void 0:f.type)==="label"?(m=f.options.appearance)==null?void 0:m.pinColorInactive:"#000000"},set"Pin Color Inactive"(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="label"&&e.setState(m,{text:c.text,options:{appearance:{pinColorInactive:f}}})},get"Pin Outline Color"(){var m;let f=e.getState(i.id);return(f==null?void 0:f.type)==="label"?(m=f.options.appearance)==null?void 0:m.pinOutlineColor:"#000000"},set"Pin Outline Color"(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="label"&&e.setState(m,{text:c.text,options:{appearance:{pinOutlineColor:f}}})},get"Pin Outline Color Inactive"(){var m;let f=e.getState(i.id);return(f==null?void 0:f.type)==="label"?(m=f.options.appearance)==null?void 0:m.pinOutlineColorInactive:"#000000"},set"Pin Outline Color Inactive"(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="label"&&e.setState(m,{text:c.text,options:{appearance:{pinOutlineColorInactive:f}}})},focus:o(()=>{},"focus")};u.add(c,"focus").onChange(()=>{let f=e.getState(i.id);(f==null?void 0:f.type)==="label"&&e.camera.focusOn([f.position])}),u.add(c,"interactive"),u.add(c,"text"),u.add(c,"Text Size",10,50),u.add(c,"Icon Size",10,50),u.addColor(c,"Text Color"),u.addColor(c,"Active Background Color"),u.addColor(c,"Inactive Background Color"),u.addColor(c,"Active Foreground Color"),u.addColor(c,"Inactive Foreground Color")}else if(i.type==="geometry-group"){let c={get opacity(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry-group"?f.opacity:1},set opacity(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&e.setState(i,{opacity:f})},set visible(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&e.setState(i,{visible:f})},get visible(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry-group"?f.visible:!1},set outline(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&e.setState(i,{outline:f})},get outline(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry-group"?f.outline:!1},set altitude(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&e.setState(i,{altitude:f})},get altitude(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry-group"?f.altitude:0},set interactive(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&(e.setState(i,{interactive:f}),r.controllersRecursive().forEach(v=>v.updateDisplay()))},get interactive(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry-group"?f.interactive:!1},get shadingStart(){var m,v;let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry-group"&&(v=(m=f.shading)==null?void 0:m.start)!=null?v:0},set shadingStart(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&e.setState(m,{shading:{start:f}})},get shadingEnd(){var m,v;let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry-group"&&(v=(m=f.shading)==null?void 0:m.end)!=null?v:0},set shadingEnd(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&e.setState(m,{shading:{end:f}})},get shadingIntensity(){var m,v;let f=e.getState(i.id);return(f==null?void 0:f.type)==="geometry-group"&&(v=(m=f.shading)==null?void 0:m.intensity)!=null?v:0},set shadingIntensity(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&e.setState(m,{shading:{intensity:f}})}};u.add(c,"visible"),u.add(c,"opacity",0,1,.1),u.add(c,"interactive"),u.add(c,"outline"),u.add(c,"altitude",0,100,1),u.add(c,"shadingStart",0,1,.1),u.add(c,"shadingEnd",0,1,.1),u.add(c,"shadingIntensity",0,1,.1)}else if(i.type==="group-container"){let c={set visible(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="group-container"&&e.setState(i,{visible:f})},get visible(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="group-container"?f.visible:!1},set interactive(f){let m=e.getState(i.id);(m==null?void 0:m.type)==="group-container"&&(e.setState(m,{interactive:f}),r.controllersRecursive().forEach(v=>v.updateDisplay()))},get interactive(){let f=e.getState(i.id);return(f==null?void 0:f.type)==="group-container"?f.interactive:!1}};u.add(c,"visible"),u.add(c,"interactive")}if(u.close(),i.children)for(let c of i.children.values())n(c,u)},"parseChild")}o(v1e,"createParseChild");function x1e(e,t){let r=t.addFolder("Watermark"),n={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};r.add(n,"padding",0,100,1),r.add(n,"scale",.5,1.5,.1),r.add(n,"color",["dark","light"]),r.add(n,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),r.add(n,"iconOnly"),r.onChange(()=>{e.updateWatermark(n)})}o(x1e,"createWatermarkChild");g();g();g();g();g();g();var y6=class y6{constructor({origin:t,destination:r,distance:n=0,angle:i=0,pathWeight:a=0,multiplicativeDistanceWeightScaling:u=!0}){b(this,"origin");b(this,"destination");b(this,"distance");b(this,"angle");b(this,"weight");if(this.origin=t,this.destination=r,this.distance=n,this.angle=i,this.weight=a||0,u?t.properties.floor===r.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===r.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.")}};o(y6,"Edge");var Sm=y6;g();g();g();g();function Vp([e,t],[r,n]){let i=t-n,a=e-r;return(Math.atan2(a,i)+Math.PI*3)%(Math.PI*2)}o(Vp,"getAngle");g();var b1e=63710088e-1;function qa(e,t){let[r,n]=e.map(v=>v*Math.PI/180),[i,a]=t.map(v=>v*Math.PI/180),u=a-n,c=i-r,f=Math.sin(u/2)*Math.sin(u/2)+Math.cos(n)*Math.cos(a)*Math.sin(c/2)*Math.sin(c/2),m=2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f));return b1e*m}o(qa,"getDistance");g();g();function w3(e,t,r,n){let[i,a]=e,[u,c]=t,[f,m]=r,[v,x]=n;if(a===c&&i===u||m===x&&f===v)return null;let I=(v-f)*(c-a)-(x-m)*(u-i);if(I===0)return null;let C=((x-m)*(i-f)-(v-f)*(a-m))/I,T=((c-a)*(i-f)-(u-i)*(a-m))/I;if(C<0||C>1||T<0||T>1)return null;let O=a+C*(c-a);return[i+C*(u-i),O]}o(w3,"getLineIntersection");g();function v6(e,t,r,n){let i=Aa(e,r/1e3,n),a=Aa(t,r/1e3,n);return[i.geometry.coordinates,a.geometry.coordinates]}o(v6,"getOffsetLine");g();function x6(e){let t=e*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}o(x6,"radToDegNormalized");var rH=111e3;function b6(e,t,r=[],n=0){let i=!0,a=e.geometry.coordinates,u=t.geometry.coordinates,c=x6(Vp(a,u)-Math.PI/2),f=x6(Vp(a,u)+Math.PI/2),m=n/rH,v=n/(rH*Math.cos(a[1]*Math.PI/180)),x=Math.min(a[1],u[1])-m,I=Math.max(a[1],u[1])+m,C=Math.min(a[0],u[0])-v,T=Math.max(a[0],u[0])+v;for(let O of r)if(!(Math.max(O[0][1],O[1][1])<x||Math.min(O[0][1],O[1][1])>I||Math.max(O[0][0],O[1][0])<C||Math.min(O[0][0],O[1][0])>T)){if(n>0){let P=v6(a,u,n,c),L=v6(a,u,n,f);if(w3(P[0],P[1],O[0],O[1])||w3(L[0],L[1],O[0],O[1])){i=!1;return}}else if(w3(a,u,O[0],O[1])){i=!1;return}}return i}o(b6,"hasLineOfSight");var _m,ys,I6,nH,iH,oH,sH,aH,lH,T3,S6=class S6{constructor({nodes:t,groupBy:r,multiplicativeDistanceWeightScaling:n}){j(this,ys);b(this,"edges",{});b(this,"nodesById");b(this,"nodesByGroup",new Map);j(this,_m);j(this,T3,o((t,r)=>{let n=0;for(let i of r)(!i[d(this,_m)]||i[d(this,_m)]===t.properties[d(this,_m)])&&ti(t.geometry.coordinates,i.geometry.geometry)&&(n+=Math.max(0,i.cost));return n},"#getZonalCost"));$(this,_m,r);let{features:i}=t;this.nodesById=Re(this,ys,nH).call(this,i),Re(this,ys,iH).call(this),Re(this,ys,oH).call(this,i,r,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,r){return r.reduce((n,i)=>{let a=qa(t.geometry.coordinates,i.geometry.coordinates);return Math.min(n,a)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:r,excludedNodeIds:n,disabledConnectionNodeIds:i,zones:a,overrideEdgeWeights:u}){var I;let c=Re(this,ys,I6).call(this,t),f=Re(this,ys,I6).call(this,r);if(c.length===0||f.length===0)return[];let{frontier:m,cameFrom:v,costSoFar:x}=Re(this,ys,sH).call(this,c,f);for(;m.length>0;){let C=m.shift();if(!C)break;if(Re(this,ys,aH).call(this,C.origin,f))return Re(this,ys,lH).call(this,v,C.origin.properties.id);for(let T of this.edges[C.origin.properties.id]){let O=(I=u==null?void 0:u.get(T))!=null?I:T.weight;if(i!=null&&i.has(T.origin.properties.id)&&T.destination.properties.map!==T.origin.properties.map)continue;let P=x[C.origin.properties.id]+O+d(this,T3).call(this,T.destination,a);if(!(P===1/0||n!=null&&n.has(T.destination.properties.id))&&(x[T.destination.properties.id]==null||P<x[T.destination.properties.id])){let L=P+this.getShortestEuclideanDistance(T.destination,f);x[T.destination.properties.id]=P,v[T.destination.properties.id]=T,m.push({origin:T.destination,priority:L})}}m.sort((T,O)=>T.priority-O.priority)}return[]}};_m=new WeakMap,ys=new WeakSet,I6=o(function(t){return t.map(r=>this.nodesById[r]).filter(Boolean)},"#filterValidNodes"),nH=o(function(t){return t.reduce((r,n)=>(r[n.properties.id]=n,r),{})},"#createNodesById"),iH=o(function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:r})=>!!this.nodesById[r]))},"#removeInvalidNeighbors"),oH=o(function(t,r,n){t.forEach(i=>{let a=r==="default"?r:i.properties[r];this.nodesByGroup.has(a)||this.nodesByGroup.set(a,[]),this.nodesByGroup.get(a).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:u,weight:c})=>{let f=this.nodesById[u],m=qa(i.geometry.coordinates,f.geometry.coordinates),v=Vp(i.geometry.coordinates,f.geometry.coordinates);return new Sm({origin:i,destination:f,pathWeight:c,distance:m,angle:v,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),sH=o(function(t,r){let n=[],i={},a={};return t.forEach(u=>{let c=this.getShortestEuclideanDistance(u,r);n.push({origin:u,priority:c}),i[u.properties.id]=null,a[u.properties.id]=0}),n.sort((u,c)=>u.priority-c.priority),{frontier:n,cameFrom:i,costSoFar:a}},"#initializeSearch"),aH=o(function(t,r){return r.some(n=>n.properties.id===t.properties.id)},"#isDestinationNode"),lH=o(function(t,r){let n=[],i=t[r];for(;i;)n.push(i),i=t[i.origin.properties.id];return n.reverse()},"#reconstructPath"),T3=new WeakMap,o(S6,"NavigationGraph");var P3=S6;var uH=.4,_6=class _6{constructor({nodes:t,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:i}){b(this,"groupBy");b(this,"graph");b(this,"geometryEdgesByMapId",new Map);b(this,"generatePath",o(t=>{let{destination:r}=t[t.length-1],n={type:"FeatureCollection",features:[]};for(let a=0;a<t.length;a++){let{origin:u,destination:c}=t[a],f={id:u.properties.id,angle:t[a].angle,distance:t[a].distance,destination:c.properties.id,edges:this.graph.edges[u.properties.id]};this.groupBy!=="default"&&(f.groupBy=u.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[u.geometry.coordinates[0],u.geometry.coordinates[1]]},properties:f})}let i={id:r.properties.id,edges:this.graph.edges[r.properties.id]};return this.groupBy!=="default"&&(i.groupBy=r.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[r.geometry.coordinates[0],r.geometry.coordinates[1]]},properties:i}),n},"generatePath"));b(this,"hasLineOfSight",o((t,r,n,i=uH)=>b6({type:"Feature",properties:{id:"origin",neighbors:[]},geometry:{type:"Point",coordinates:t}},{type:"Feature",properties:{id:"destination",neighbors:[]},geometry:{type:"Point",coordinates:r}},this.geometryEdgesByMapId.get(n),i)===!0,"hasLineOfSight"));b(this,"getDistance",o((t,r)=>qa(t,r),"getDistance"));b(this,"getAngle",o((t,r)=>Vp(t,r),"getAngle"));this.groupBy=n,this.graph=new P3({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:i}),((r==null?void 0:r.features)||[]).forEach(u=>{let c=null;if(u.geometry.type==="LineString"?c=u.geometry.coordinates:u.geometry.type==="Polygon"&&(c=u.geometry.coordinates.flat()),c){let f=this.groupBy==="default"?this.groupBy:u.properties[this.groupBy];this.geometryEdgesByMapId.has(f)||this.geometryEdgesByMapId.set(f,[]),c.forEach((m,v)=>{this.geometryEdgesByMapId.get(f).push([m,c[v+1]||c[0]])})}})}getDirections({zones:t,originIds:r,destinationNodeIds:n,excludedNodeIds:i,disabledConnectionNodeIds:a,simplify:u,multiplicativeDistanceWeightScaling:c,overrideEdgeWeights:f}){var I,C;let m=(I=u==null?void 0:u.enabled)!=null?I:!0,v=t!=null?t:[],x=this.graph.aStar({originIds:r,destinationNodeIds:n,zones:v,excludedNodeIds:new Set(i),disabledConnectionNodeIds:new Set(a),overrideEdgeWeights:f});return x.length===0?{type:"FeatureCollection",features:[]}:(m&&(x=this.simplifyAllSteps(x,(C=u==null?void 0:u.bufferRadius)!=null?C:uH,c)),this.generatePath(x))}simplifyAllSteps(t,r,n){var m,v;let i=[],a=[t[0]];for(let x=1;x<t.length;x++)if(this.groupBy!=="default"&&t[x].origin.properties[this.groupBy]!==t[x-1].origin.properties[this.groupBy]){let I=t[x-1].origin.properties[this.groupBy],C=(m=this.geometryEdgesByMapId.get(I))!=null?m:[];i.push(...this.simplifySteps(a,C,r,n)),a=[t[x]]}else a.push(t[x]);let u=t[t.length-1],c=this.groupBy==="default"?this.groupBy:u.origin.properties[this.groupBy],f=(v=this.geometryEdgesByMapId.get(c))!=null?v:[];return i.push(...this.simplifySteps(a,f,r,n)),i}simplifySteps(t,r,n,i){if(t.length<3)return t;let a=[t[0]],u=1;for(let c=u+2;c<t.length;c++)if(t[u].origin.properties.preventSmoothing||!b6(t[u].origin,t[c].origin,r,n)){let f=c-1;a.push(new Sm(Ie(Y({},t[u]),{destination:t[f].origin,distance:qa(t[u].origin.geometry.coordinates,t[f].origin.geometry.coordinates),angle:Vp(t[u].origin.geometry.coordinates,t[f].origin.geometry.coordinates)}))),u=f}return a.push(new Sm(Ie(Y({},t[u]),{destination:t[t.length-1].origin,distance:qa(t[u].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:Vp(t[u].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:i})),t[t.length-1]),a}};o(_6,"Navigator");var _0=_6;var cH="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",w1e="https://auth.mappedin.com/oauth2/token";var C6="";var Xy="";async function pH(e,t){var i,a,u,c,f,m,v,x;let r=(i=t==null?void 0:t.useWorkers)!=null?i:!0,n=Ie(Y({},t),{watermark:t==null?void 0:t.watermark,attribution:t==null?void 0:t.attribution,antialias:t==null?void 0:t.antialias,occlusionEnabled:t==null?void 0:t.occlusionEnabled,transformImageRequest:t==null?void 0:t.transformImageRequest,naturalBearing:(a=t==null?void 0:t.naturalBearing)!=null?a:0,imagePlacementOptions:t==null?void 0:t.imagePlacementOptions,onWebGLContextCreationError:t==null?void 0:t.onWebGLContextCreationError,onWebGLContextLost:t==null?void 0:t.onWebGLContextLost,onWebGLContextRestored:t==null?void 0:t.onWebGLContextRestored,onWebGLRendererError:t==null?void 0:t.onWebGLRendererError,useStandaloneCamera:(u=t==null?void 0:t.useStandaloneCamera)!=null?u:!1,useCollisionWorker:(c=t==null?void 0:t.useCollisionWorker)!=null?c:!0,useWorkers:r});if(r===!0&&((f=t==null?void 0:t.outdoorView)!=null&&f.enabled)){let{Map:I,MercatorCoordinate:C}=await import("./outdoor-context-v5-N4FV7A64.js"),T=t.outdoorView.headers;T==null&&(T=await aD(w1e));let O=t.center||[0,0],P=new I({container:e,style:t.outdoorView.style||cH,center:O,attributionControl:!1,zoom:(m=t.zoomLevel)!=null?m:h6,pitch:(v=t.pitch)!=null?v:f6,bearing:(x=t.bearing)!=null?x:d6,transformRequest:rD(T),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:dg(),canvasContextAttributes:{antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance"},interactive:!1,validateStyle:!1,centerClampedToGround:!1,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),L=P.painter.context.gl,A=new m6(e,Y({center:O,zoomLevel:P.getZoom(),pitch:P.getPitch(),bearing:P.getBearing(),gl:L,map:P,mode:"outdoors-interleaved"},n)),M={center:P.getCenter().toArray(),zoom:P.getZoom(),bearing:P.getBearing(),pitch:P.getPitch(),elevation:P.getCenterElevation()};P.setMinZoom(A.camera.minZoomLevel),P.setMaxZoom(A.camera.maxZoomLevel),P.setMaxPitch(A.camera.maxPitch),P.setMinPitch(A.camera.minPitch),A.on("camera-change",X=>{M.center=X.center,M.zoom=X.zoomLevel,M.bearing=X.bearing,M.pitch=X.pitch,M.elevation=X.elevation,P.jumpTo(M)});let N=C.fromLngLat(O,0),B=sD(N,A.viewCamera,()=>{A.renderSync()});P.on("style.load",async()=>{P&&(P.addLayer(B),A.renderSync())});let H=!1,z=!1;P.on("idle",()=>{P&&(H||(A.publish("outdoor-view-loaded"),H=!0),z||(z=!0,A.publish("outdoor-style-loaded")))});let R=o(X=>{X&&(X.sourceDataType==="metadata"||X.sourceDataType==="visibility"||X.dataType==="style"||X.type==="terrain")&&A.getSystems().htmlControlsSystem.updateData(P)},"updateData");return P.on("styledata",X=>{P&&X&&X.dataType==="style"&&X.type==="styledata"&&(z=!1),R(X)}),P.on("sourcedata",R),P.on("terrain",R),P.on("error",X=>{var ie;if(((ie=X.error)==null?void 0:ie.url)===cH){ae.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(T["x-mappedin-tiles-key"],'"'));return}ae.warn(X)}),A}else return new m6(e,n)}o(pH,"createRenderer");g();g();g();g();g();var C0=class C0{constructor(t,r,n){b(this,"id");b(this,"text");b(this,"target");b(this,"__type",C0.__type);this.id=t,this.text=r,this.target=n}static is(t){return t.__type===C0.__type}get focusTarget(){return this.target.anchorTarget}};o(C0,"Label"),b(C0,"__type","Label");var dd=C0;g();var wm,Cm=class Cm{constructor(t,r,n){b(this,"id");j(this,wm);b(this,"__type",Cm.__type);b(this,"contentEl");this.id=t,this.contentEl=r,$(this,wm,n)}get target(){return d(this,wm)}get coordinate(){return d(this,wm).anchorTarget}toJSON(){return{id:this.id,__type:Cm.__type,target:this.target,coordinate:this.coordinate}}static is(t){return t.__type===Cm.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){$(this,wm,t)}};wm=new WeakMap,o(Cm,"Marker"),b(Cm,"__type","Marker");var zp=Cm;g();var nb,ib,w0=class w0{constructor(t,r,n){j(this,nb);j(this,ib);b(this,"target");b(this,"__type",w0.__type);$(this,nb,t),$(this,ib,r),this.target=n}static is(t){return t.__type===w0.__type}get id(){return d(this,nb)}get url(){return d(this,ib)}};nb=new WeakMap,ib=new WeakMap,o(w0,"Image"),b(w0,"__type","Image");var Pm=w0;g();var Em,Tm=class Tm{constructor(t,r,n){b(this,"id");b(this,"groupId");b(this,"__type",Tm.__type);j(this,Em);this.id=t,this.groupId=r,$(this,Em,n)}get target(){return d(this,Em)}static is(t){return t.__type===Tm.__type}updateTarget(t){$(this,Em,t)}toJSON(){return{id:this.id,__type:Tm.__type,groupId:this.groupId,target:d(this,Em)}}};Em=new WeakMap,o(Tm,"Model"),b(Tm,"__type","Model");var Mm=Tm;g();var P0=class P0{constructor(t,r){b(this,"id");b(this,"coordinates");b(this,"__type",P0.__type);this.id=t,this.coordinates=r}static is(t){return t.__type===P0.__type}get focusTarget(){return this.coordinates}};o(P0,"PathSegment"),b(P0,"__type","PathSegment");var T0=P0,Om=class Om{constructor(t,r,n,i){b(this,"id");b(this,"animation");b(this,"coordinates");b(this,"segments");b(this,"__type",Om.__type);this.id=t,this.animation=r,this.coordinates=n,this.segments=i.map(({id:a,coordinates:u})=>new T0(a.toString(),u))}static is(t){return t.__type===Om.__type}get focusTarget(){return this.coordinates}toJSON(){return{__type:Om.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};o(Om,"Path"),b(Om,"__type","Path");var Al=Om;g();var P1e=7,hd,Lm,w6=class w6{constructor(t,r){j(this,hd);j(this,Lm);var n;$(this,hd,t),$(this,Lm,(n=r==null?void 0:r.precision)!=null?n:P1e)}toJSON(){return{center:this.center,bearing:this.bearing,pitch:this.pitch,zoomLevel:this.zoomLevel}}get center(){let t=d(this,hd).center;if(d(this,Lm)===-1)return t;let r=zu(t.latitude,d(this,Lm)),n=zu(t.longitude,d(this,Lm));return new bt({latitude:r,longitude:n,floorId:t.floorId,verticalOffset:t.verticalOffset})}get bearing(){return d(this,hd).bearing}get pitch(){return d(this,hd).pitch}get zoomLevel(){return zu(d(this,hd).zoomLevel,5)}};hd=new WeakMap,Lm=new WeakMap,o(w6,"CameraTransform");var ob=w6;g();var E0=class E0{constructor(t){b(this,"id");b(this,"__type",E0.__type);this.id=t}static is(t){return t.__type===E0.__type}get focusTarget(){return this}};o(E0,"Shape"),b(E0,"__type","Shape");var $p=E0;g();var sb=class sb{constructor(t,r){b(this,"id");b(this,"target");b(this,"__type","Text3D");this.id=t,this.target=r}static is(t){return t.__type===sb.__type}};o(sb,"Text3D"),b(sb,"__type","Text3D");var md=sb;g();g();g();var T1e=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>']]),E1e=/<svg([^>]*)>/g;function fH(e,t,r){let n=T1e.get(e);return n?n.replace(E1e,'<svg$1 style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}o(fH,"getStyledIcon");var M1e=o(e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></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(e,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),O1e=o(e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></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(e,'"\n />\n </svg>\n '),"getDestinationPin"),P6="#722ED1",T6="#1890FF",dH=o(({type:e="departure",color:t=T6})=>'<div class="dropped-pin-wrapper">\n '.concat(e==="departure"?M1e(t):O1e(t),"\n </div>"),"DroppedPin"),L1e=o(e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),hH=o(({type:e="stairs",color:t=P6,direction:r="up"})=>{let n=L1e("default"),i=n/2+2,a=r&&r!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(n,"px; height:").concat(n,'px;"\n >\n ').concat(fH("connection-"+e+"-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(r==="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");g();var mH=o(async e=>new Promise(t=>setTimeout(t,e)),"ms");var D1e={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},A1e={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},gd={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:D1e,inactivePathOptions:A1e,markerOptions:{departureColor:T6,destinationColor:P6},animatePathDrawing:!0},Hp,Pu,Fl,Ur,ub,Wp,Dm,Hi,Tu,ba,Nl,yd,Un,gH,yH,E6,ab,E3,M0,M6,O0,O6=class O6{constructor(t,r,n){j(this,Un);j(this,Hp,new Map);j(this,Pu);j(this,Fl);j(this,Ur,gd);j(this,ub);j(this,Wp);j(this,Dm);j(this,Hi,[]);j(this,Tu);j(this,ba,new Map);j(this,Nl,new Map);j(this,yd,new Map);j(this,O0,o(t=>{var r;if((r=d(this,Ur).createMarkers)!=null&&r.connection&&t.markers.length>0){let{instruction:n}=d(this,Hp).get(t.markers[0]);n!=null&&n.action.toFloor&&(d(this,Ur).setMapOnConnectionClick&&this.currentMap.setFloor(n.action.toFloor.id,"navigation-connection-click"),d(this,Fl).publish("navigation-connection-click",{instruction:n,fromFloor:n.action.fromFloor,toFloor:n.action.toFloor}))}},"#handleClick"));$(this,Pu,t),$(this,ub,n),$(this,Fl,r)}get currentMap(){return d(this,ub).call(this)}get isMultiFloor(){if(!d(this,Hi).length)return!1;let t=new Set;for(let r of d(this,Hi))for(let n of r.coordinates)if(n.floorId&&(t.add(n.floorId),t.size>1))return!0;return!1}getPathById(t){return d(this,ba).get(t)}getMarkerById(t){return d(this,Hp).get(t)}get paths(){let t=new Set;return d(this,ba).forEach(({path:r})=>t.add(r)),Array.from(t)}get activeDirections(){return d(this,yd).get(d(this,Tu))}get activePath(){var t;if(d(this,Tu))return(t=d(this,ba).get(d(this,Tu).id))==null?void 0:t.path}get floorStacks(){let t=d(this,Fl).getMapData();if(!d(this,Hi).length||!t)return[];let r=new Set;for(let n of d(this,Hi))for(let i of n.coordinates)if(i.floorId){let a=t.getById("floor",i.floorId);a&&r.add(a.floorStack)}return Array.from(r)}get floors(){let t=d(this,Fl).getMapData();if(!d(this,Hi).length||!t)return[];let r=new Set;for(let n of d(this,Hi))for(let i of n.coordinates)if(i.floorId){let a=t.getById("floor",i.floorId);a&&r.add(a)}return Array.from(r)}setActivePathByIndex(t){let r=d(this,Hi)[t];if(!d(this,Hi).length){ae.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!d(this,Hi)[t]){ae.warn("Direction #".concat(t," does not exist"));return}let n=d(this,Nl).get(r);if(!n){ae.warn("The direction is not a part of muli-direcional path");return}Re(this,Un,E3).call(this,n)}setActivePath(t){if(!d(this,Hi).length){ae.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!d(this,yd).get(t)){ae.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}Re(this,Un,E3).call(this,t)}setActivePathByDirections(t){if(!d(this,Hi).length){ae.warn("[setActivePathByDirections] Cannot set an active path before drawing. Call Navigation.draw() first.");return}let r=d(this,Nl).get(t);if(!r){let n=d(this,Hi).find(i=>i.id===t.id);if(!n){ae.warn("[setActivePathByDirections] Cannot find directions for id");return}r=d(this,Nl).get(n)}if(!r){ae.warn("[setActivePathByDirections] Cannot find path for directions");return}Re(this,Un,E3).call(this,r)}drawSync(t,r={}){var c,f,m;d(this,Dm)&&this.clear(),$(this,Dm,!0),Re(this,Un,E6).call(this,r);let n=Array.isArray(t)?t:[t],i=n[0],a=n[n.length-1],u=i.coordinates[0];$(this,Hi,n),u.floorId&&d(this,Ur).setMapToDeparture&&this.currentMap.setFloor(u.floorId),(c=d(this,Ur).createMarkers)!=null&&c.departure&&Re(this,Un,M0).call(this,i.coordinates[0],"departure",i.instructions[0]);for(let v=0;v<n.length;v++){let x=n[v],I=v?Y({},d(this,Ur).inactivePathOptions):Y({},d(this,Ur).pathOptions);if(x.coordinates.length<2){ae.warn("Directions must have at least 2 coordinates");return}let C=this.currentMap.Paths.add(x.coordinates,Ie(Y({},I),{animateDrawing:d(this,Ur).animatePathDrawing})),T=C.paths.map(P=>P.id.toString()),O=new Al(an(),C.animation,x.coordinates,C.paths);for(let P of T){d(this,ba).set(P,{path:O,entityIds:T});let L=v?Ie(Y({},d(this,Ur).inactivePathOptions),{altitude:0}):Ie(Y({},d(this,Ur).pathOptions),{altitude:.05});d(this,Pu).setState(P,L)}d(this,ba).set(O.id,{path:O,entityIds:T}),d(this,Nl).set(x,O),d(this,yd).set(O,x),(f=d(this,Ur).createMarkers)!=null&&f.connection&&Re(this,Un,M6).call(this,x.instructions,"connection"),v===0&&($(this,Tu,d(this,Nl).get(d(this,Hi)[0])),d(this,Pu).on("click",d(this,O0)))}(m=d(this,Ur).createMarkers)!=null&&m.destination&&Re(this,Un,M0).call(this,a.coordinates[a.coordinates.length-1],"destination",a.instructions[a.instructions.length-1]),d(this,Fl).mapObjects.forEach(v=>{v.processFloorChange(v.currentFloorId)}),Re(this,Un,ab).call(this)}async draw(t,r={}){d(this,Wp)&&this.clear(),Re(this,Un,E6).call(this,r);let n=Array.isArray(t)?t:[t],a=n[0].coordinates[0];return $(this,Hi,n),a.floorId&&d(this,Ur).setMapToDeparture&&this.currentMap.setFloor(a.floorId),Re(this,Un,yH).call(this,n)}clear(){d(this,Hp).forEach((t,r)=>{this.currentMap.Markers.remove(r.toString())}),d(this,Hp).clear(),d(this,ba).forEach(({path:t,entityIds:r})=>{d(this,ba).delete(t.id),r.forEach(n=>d(this,ba).delete(n)),this.currentMap.Paths.remove(r)}),d(this,Wp)&&(d(this,Wp).cancel(),$(this,Wp,void 0)),d(this,Dm)&&$(this,Dm,!1),$(this,Hi,[]),d(this,Nl).clear(),d(this,yd).clear(),$(this,Tu,void 0),d(this,Pu).off("click",d(this,O0)),d(this,Fl).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)}),Re(this,Un,ab).call(this)}};Hp=new WeakMap,Pu=new WeakMap,Fl=new WeakMap,Ur=new WeakMap,ub=new WeakMap,Wp=new WeakMap,Dm=new WeakMap,Hi=new WeakMap,Tu=new WeakMap,ba=new WeakMap,Nl=new WeakMap,yd=new WeakMap,Un=new WeakSet,gH=o(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),yH=o(function(t){let r=t[0],n=t[t.length-1],i=!1;return $(this,Wp,{promise:new Promise(async a=>{var u,c,f;if(S.env.NODE_ENV!=="test"&&await mH(500),i||!t.length){a();return}(u=d(this,Ur).createMarkers)!=null&&u.departure&&Re(this,Un,M0).call(this,r.coordinates[0],"departure",r.instructions[0]);for(let m=0;m<t.length;m++){let v=t[m],x=m?Y({},d(this,Ur).inactivePathOptions):Y({},d(this,Ur).pathOptions);if(v.coordinates.length<2){ae.warn("Directions must have at least 2 coordinates"),a();return}let I=this.currentMap.Paths.add(v.coordinates,Ie(Y({},x),{animateDrawing:d(this,Ur).animatePathDrawing})),C=I.paths.map(O=>O.id.toString()),T=new Al(an(),I.animation,v.coordinates,I.paths);for(let O of C){d(this,ba).set(O,{path:T,entityIds:C});let P=m?Ie(Y({},d(this,Ur).inactivePathOptions),{altitude:0}):Ie(Y({},d(this,Ur).pathOptions),{altitude:.05});d(this,Pu).setState(O,P)}if(d(this,ba).set(T.id,{path:T,entityIds:C}),d(this,Nl).set(v,T),d(this,yd).set(T,v),S.env.NODE_ENV!=="test"&&await I.animation,i){a();return}(c=d(this,Ur).createMarkers)!=null&&c.connection&&Re(this,Un,M6).call(this,v.instructions,"connection"),m===0&&($(this,Tu,d(this,Nl).get(d(this,Hi)[0])),d(this,Pu).on("click",d(this,O0)))}if((f=d(this,Ur).createMarkers)!=null&&f.destination&&Re(this,Un,M0).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),i){a();return}d(this,Fl).mapObjects.forEach(m=>{m.processFloorChange(m.currentFloorId)}),Re(this,Un,ab).call(this),a()}),cancel:o(()=>{i=!0},"cancel")}),d(this,Wp).promise},"#drawAsync"),E6=o(function(t){var r,n,i;$(this,Ur,{setMapOnConnectionClick:(r=t.setMapOnConnectionClick)!=null?r:gd.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:gd.setMapToDeparture,pathOptions:Y(Y({},gd.pathOptions),t.pathOptions),inactivePathOptions:Y(Y({},gd.inactivePathOptions),t.inactivePathOptions),createMarkers:Y(Y({},gd.createMarkers),t.createMarkers),markerOptions:Y(Y({},gd.markerOptions),t.markerOptions),animatePathDrawing:(i=t.animatePathDrawing)!=null?i:gd.animatePathDrawing})},"#setupOptions"),ab=o(function(){d(this,Fl).publish("navigation-state-change",{isMultiFloor:this.isMultiFloor,floorStacks:this.floorStacks,floors:this.floors,activeDirections:this.activeDirections,activePath:this.activePath,paths:this.paths})},"#emitNavigationStateChanged"),E3=o(function(t){$(this,Tu,t),d(this,Hi).forEach(r=>{let n=d(this,Nl).get(r);if(n){let i=d(this,ba).get(n.id),a=i.path.id===d(this,Tu).id?Ie(Y({},d(this,Ur).pathOptions),{altitude:.05}):Ie(Y({},d(this,Ur).inactivePathOptions),{altitude:0});i.entityIds.forEach(u=>{d(this,Pu).setState(u,a)})}}),d(this,Fl).publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath}),Re(this,Un,ab).call(this)},"#setActiveDirections"),M0=o(function(t,r,n){var i,a,u,c,f;if(r==="connection"&&n){let m=n.action.type==="ExitConnection"?d(this,Ur).markerOptions.departureColor:d(this,Ur).markerOptions.destinationColor,v;if(typeof((i=d(this,Ur).createMarkers)==null?void 0:i.connection)=="function"){let I=d(this,Ur).createMarkers.connection(n);d(this,Pu).setState(I.id.toString(),{options:{interactive:!0}}),v={id:I.id,type:"marker"}}else v=this.currentMap.Markers.add(n.coordinate,hH({type:(u=(a=n.action.connection)==null?void 0:a.type)!=null?u:n.action.connectionType,color:m,direction:n.action.direction}),{interactive:!0,placement:"top",rank:"always-visible"});let x=this.currentMap.Markers.getContentEl(v.id.toString());if(!x)throw new Error("marker component should exist");d(this,Hp).set(v.id,{instruction:n,marker:new zp(v.id.toString(),x,n.coordinate)})}else{let m=r==="departure"?d(this,Ur).markerOptions.departureColor:d(this,Ur).markerOptions.destinationColor,v;typeof((c=d(this,Ur).createMarkers)==null?void 0:c.departure)=="function"&&r==="departure"?v={id:d(this,Ur).createMarkers.departure(n).id,type:"marker"}:typeof((f=d(this,Ur).createMarkers)==null?void 0:f.destination)=="function"&&r==="destination"?v={id:d(this,Ur).createMarkers.destination(n).id,type:"marker"}:v=this.currentMap.Markers.add(t,dH({type:r,color:m}),{placement:"top",rank:"always-visible"}),d(this,Hp).set(v.id,void 0)}},"#addMarker"),M6=o(function(t,r){t.filter(i=>Re(this,Un,gH).call(this,i.action)).forEach(i=>{Re(this,Un,M0).call(this,i.coordinate,r,i)})},"#addMarkers"),O0=new WeakMap,o(O6,"Navigation");var lb=O6;g();g();g();var F1e=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>']]),N1e=/<svg([^>]*)>/g;function vH(e,t,r){let n=F1e.get(e);return n?n.replace(N1e,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}o(vH,"getStyledIcon");var Am,L0,Ia,L6,xH,bH,D6,IH,A6=class A6{constructor(t,r){j(this,Ia);j(this,Am);j(this,L0);b(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});$(this,Am,t),$(this,L0,r)}auto(){let t=[],r=d(this,L0)[Object.keys(d(this,L0))[0]];return[...r.getByType("connection"),...r.getByType("point-of-interest"),...r.getByType("space")].forEach(n=>{if(n.__type==="connection")n.coordinates.forEach(i=>{let a=n.name||n.externalId;if(a){let u=d(this,Am).Labels.add(i,a,Re(this,Ia,L6).call(this,n));t.push(u)}});else{n.__type==="space"&&n.name!==""&&d(this,Am).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let i=n.name;if(i){let a=d(this,Am).Labels.add(n,i,Re(this,Ia,L6).call(this,n));t.push(a)}}}),{labels:t}}};Am=new WeakMap,L0=new WeakMap,Ia=new WeakSet,L6=o(function(t){let r=vH(Re(this,Ia,xH).call(this,t),"white",12);return{appearance:{textColor:Re(this,Ia,D6).call(this,t),pinColor:Re(this,Ia,D6).call(this,t),icon:r,iconSize:12},interactive:!0,rank:Re(this,Ia,IH).call(this,t)}},"#generatLabelAppearance"),xH=o(function(t){return t.__type==="connection"?Re(this,Ia,bH).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),bH=o(function(t){let r="";switch(t){case"elevator":r="connection-elevator-12x12";break;case"escalator":r="connection-escalator-12x12";break;case"stairs":r="connection-stairs-12x12";break}return r},"#attemptIconNameForConnection"),D6=o(function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),IH=o(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),o(A6,"Labels");var M3=A6;var F6=class F6{constructor(t,r){b(this,"Labels");b(this,"auto",o(()=>this.Labels.auto(),"auto"));this.Labels=new M3(t,r)}};o(F6,"DefaultTheme");var O3=F6;g();var Lt,pb,qp,L3,N6,R6=class R6{constructor(t){j(this,qp);j(this,Lt);j(this,pb);b(this,"interactions",{set:o(t=>{(t==null?void 0:t.pan)!=null&&(d(this,Lt).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(d(this,Lt).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(d(this,Lt).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},"set"),enable:o(()=>{d(this,Lt).getSystems().cameraSystem.enablePan=!0,d(this,Lt).getSystems().cameraSystem.enableZoom=!0,d(this,Lt).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:o(()=>{d(this,Lt).getSystems().cameraSystem.enablePan=!1,d(this,Lt).getSystems().cameraSystem.enableZoom=!1,d(this,Lt).getSystems().cameraSystem.enableRotate=!1},"disable")});b(this,"setMinPitch",o(t=>{d(this,Lt).camera.setMinPitch(t)},"setMinPitch"));b(this,"setMaxPitch",o(t=>{d(this,Lt).camera.setMaxPitch(t)},"setMaxPitch"));b(this,"setMinZoomLevel",o(t=>{d(this,Lt).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));b(this,"setMaxZoomLevel",o(t=>{d(this,Lt).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));$(this,pb,t),$(this,Lt,t.core)}setScreenOffsets(t){d(this,Lt).camera.setInsetPadding(t)}get screenOffsets(){return d(this,Lt).camera.insetsPadding}get panMode(){return d(this,Lt).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&d(this,Lt).camera.setPanMode(t)}getFocusOnTransform(t,r){var i,a,u;let n=d(this,Lt).camera.getCameraFrameForCoordinates(Re(this,qp,N6).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,verticalPadding:(i=r==null?void 0:r.axisAlignedPadding)==null?void 0:i.vertical,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,easing:r==null?void 0:r.easing});return{center:new bt(n.center[1],n.center[0]),zoomLevel:n.zoomLevel,bearing:(a=r==null?void 0:r.bearing)!=null?a:this.bearing,pitch:(u=r==null?void 0:r.pitch)!=null?u:this.pitch}}focusOn(t,r){var n;return d(this,Lt).camera.focusOn(Re(this,qp,N6).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,verticalPadding:(n=r==null?void 0:r.axisAlignedPadding)==null?void 0:n.vertical,easing:r==null?void 0:r.easing})}animateTo(t,r){var f;let{center:n,zoomLevel:i,bearing:a,pitch:u}=t,c=n!=null?n:this.center;return d(this,Lt).camera.animateTo({center:n!=null?[c.longitude,c.latitude,d(this,Lt).camera.elevation]:void 0,zoomLevel:i,bearing:a,pitch:u,duration:(f=r==null?void 0:r.duration)!=null?f:600,easing:r==null?void 0:r.easing})}set(t){let{center:r=this.center,zoomLevel:n=this.zoomLevel,bearing:i=this.bearing,pitch:a=this.pitch}=t,u=[r.longitude,r.latitude];d(this,Lt).camera.setCenter(u),d(this,Lt).camera.setZoomLevel(n),d(this,Lt).camera.setBearing(i),d(this,Lt).camera.setPitch(a)}get center(){let t=d(this,Lt).camera.center;return new bt(t[1],t[0],void 0)}setAutoMinZoomLevel(t){d(this,Lt).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return d(this,Lt).camera.autoMinZoomLevel}get zoomLevel(){return d(this,Lt).camera.zoomLevel}get pitch(){return d(this,Lt).camera.pitch}get minPitch(){return d(this,Lt).camera.minPitch}get maxPitch(){return d(this,Lt).camera.maxPitch}get bearing(){let t=d(this,Lt).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return d(this,Lt).camera.minZoomLevel}get maxZoomLevel(){return d(this,Lt).camera.maxZoomLevel}setElevation(t){d(this,Lt).camera.setElevation(t)}get elevation(){return d(this,Lt).camera.elevation}animateElevation(t,r){return d(this,Lt).camera.animateElevation(t,r)}updateFacadesInView(){d(this,Lt).getSystems().geometryInFocusSystem.raycast()}};Lt=new WeakMap,pb=new WeakMap,qp=new WeakSet,L3=o(function(t){var n,i,a,u,c,f;let r=d(this,Lt).camera.elevation;return bt.is(t)&&t.floorId!=null?(i=(n=d(this,Lt).getState(t.floorId))==null?void 0:n.altitude)!=null?i:r:fa.is(t)?(u=(a=d(this,Lt).getState(t.id))==null?void 0:a.altitude)!=null?u:r:"floor"in t&&fa.is(t.floor)&&(f=(c=d(this,Lt).getState(t.floor.id))==null?void 0:c.altitude)!=null?f:r},"#getFloorAltitude"),N6=o(function(t){var a;let r=[],i=(Array.isArray(t)?t:[t]).flatMap(u=>{var c;return(c=u==null?void 0:u.focusTarget)!=null?c:[u]});for(let u of i)if(u!=null)if(bt.is(u)){let c=Re(this,qp,L3).call(this,u);r.push([u.longitude,u.latitude,c])}else if((u==null?void 0:u.id)!=null){let c=Re(this,qp,L3).call(this,u);if(fa.is(u)&&((a=d(this,pb).getMapDataInternal())!=null&&a.enterpriseMode)){r.push(u.id);continue}else if("geoJSON"in u&&u.geoJSON.geometry.coordinates.length>0){os(u.geoJSON,m=>{r.push([m[0],m[1],c])});continue}let f=d(this,Lt).getBoundingArea(u.id);if(f)r.push(...f.map(m=>[m[0],m[1],c]));else if("geoJSONBoundingBox"in u){let m=Re(this,qp,L3).call(this,u);if(u.geoJSONBoundingBox!=null){let v=[[u.geoJSONBoundingBox[0],u.geoJSONBoundingBox[1],m],[u.geoJSONBoundingBox[2],u.geoJSONBoundingBox[3],m]];r.push(...v)}}}else IT(u)&&r.push(u);return r},"#computeCoordinateCloud"),o(R6,"Camera");var cb=R6;g();var D0,k6=class k6{constructor({currentMapGetter:t}){j(this,D0);$(this,D0,t)}get currentMap(){return d(this,D0).call(this)}async getCurrentSceneGLTF(t){let r=d(this,D0).call(this);return r?r==null?void 0:r.Exporter.getCurrentSceneGLTF(t):(ae.error("There is no map to export. Please load a map first."),new Blob)}};D0=new WeakMap,o(k6,"Exporter");var fb=k6;g();var Oc,hb,B6=class B6{constructor({currentMapGetter:t}){j(this,Oc,new Map);j(this,hb);$(this,hb,t)}get currentMap(){return d(this,hb).call(this)}getById(t){return d(this,Oc).get(t)}add(t,r,n){let i=t.anchorTarget,a=this.currentMap;if(!a)throw new Error("currentMap should exist");let u=a.Labels.add(i,r,Ie(Y({},n),{attachTo:A0(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank})),c=new dd(u.id.toString(),r,t);return d(this,Oc).set(c.id,{label:c,entityId:c.id}),c}__EXPERIMENTAL__all(t){var n;let r=[];return(n=this.currentMap)==null||n.Labels.all({onCreate:o((i,a,u)=>{let c=new dd(i.toString(),a,u);d(this,Oc).set(c.id,{label:c,entityId:c.id}),r.push(c)},"onCreate"),labelOptions:t}),r}remove(t){var n;let r=d(this,Oc).get(t.id);r&&((n=this.currentMap)==null||n.Labels.remove(r),d(this,Oc).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Oc).forEach(({label:r})=>{this.remove(r),t.push(r),d(this,Oc).delete(r.id.toString())}),t}};Oc=new WeakMap,hb=new WeakMap,o(B6,"Labels");var db=B6;g();g();var G6={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},SH={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},_H=.5,V6=class V6{constructor(t,r,n=new Map){b(this,"containerId");b(this,"layers");b(this,"renderer");this.containerId=r,this.layers=n,this.renderer=t}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};o(V6,"Layer");var Lc=V6,CH=0,Fm,z6=class z6{constructor(t,r,n,i,a,u,c,f){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,"mapObject");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);j(this,Fm);b(this,"load",o(()=>{var a,u,c,f,m,v,x,I,C,T,O,P,L,A,M,N;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(nc,"-").concat(this.id),{},this.id);this.layers.set(nc,new Lc(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer("".concat(au,"-").concat(this.id),{},this.id);this.layers.set(au,new Lc(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat(Fi,"-").concat(this.id),{},this.id);this.layers.set(Fi,new Lc(this.renderer,n.id.toString()));let i=this.renderer.addGroupContainer("".concat(ic,"-").concat(this.id),{},this.id);if(this.layers.set(ic,new Lc(this.renderer,i.id.toString())),((a=this.footprint)==null?void 0:a.geometry)!=null&&((u=this.footprint)==null?void 0:u.geometry.coordinates.length)!==0){let B=G6;if(this.obstructions!=null&&this.obstructions.features.length>0){let R=this.obstructions.features.filter(X=>{var ie;return X.geometry.type==="LineString"&&((ie=X.properties.kind)==null?void 0:ie.toLowerCase())==="wall"&&X.properties.footprintComponent===!0});R!=null&&R.length>0&&(B=this.styleMap[(c=R[0].properties)==null?void 0:c.id])}let H=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},Ie(Y({},B),{height:(m=(f=this.multiFloorView)==null?void 0:f.floorGap)!=null?m:10,altitude:0,outline:(x=(v=this.options.style)==null?void 0:v.outlines)!=null?x:!0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":B.color,renderOrder:2}),this.id);this.layers.set(Xg,new Lc(this.renderer,H.id.toString()));let z=this.renderer.addGroupContainer("".concat(kf,"-").concat(this.id),{},this.id);this.layers.set(kf,new Lc(this.renderer,z.id.toString()))}if(this.spaces!=null&&this.spaces.features.length>0){let B=[],H=new Map;this.spaces.features.filter(ie=>{var Q;return ie.geometry.type==="Polygon"&&((Q=ie.properties.kind)==null?void 0:Q.toLowerCase())!=="void"}).forEach(ie=>{var U;let Q=(U=this.mapDataInternal)==null?void 0:U.facadesBySpaceId[ie.properties.id];if(Q){let Te=H.get(Q.id)||[];H.set(Q.id,[...Te,ie])}else B.push(ie)});let z=D3(B,this.styleMap),R=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),X=0;for(let[ie,Q]of z){let U=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(X),{features:Q},F0(ie,this.options),R);X++;let Te=R.id.toString();this.layers.get(Fi).layers.set(ie.id||Te,U.id.toString())}if(H.size>0){let ie=this.renderer.addGroupContainer("".concat(bh,"-").concat(this.id),{},this.id);this.layers.set(bh,new Lc(this.renderer,ie.id.toString()));for(let[Q,U]of H){let Te=this.renderer.addGroupContainer(Q,{focusable:!0},ie),oe=this.renderer.addGroupContainer("".concat(Q,"-geometry"),{},Te),fe=D3(U,this.styleMap),se=0;for(let[ve,ue]of fe){let he=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(Q,"-").concat(se),{features:ue},Ie(Y({},F0(ve,this.options)),{renderOrder:3}),oe);se++;let Z=ve.id||he.id.toString();this.layers.get(bh).layers.set("".concat(Q,"-").concat(Z),he.id.toString()),this.facadesByStyleId.has(Z)?(I=this.facadesByStyleId.get(Z))==null||I.push(Q):this.facadesByStyleId.set(Z,[Q])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let B=this.obstructions.features.filter(oe=>oe.geometry.type==="Polygon"&&(oe.properties.kind==="object"||oe.properties.kind==="unknown")),H=D3(B,this.styleMap),z=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),R=0;for(let[oe,fe]of H){let se=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(R),{features:fe},F0(oe,this.options),z);R++;let ve=z.id.toString();this.layers.get(Fi).layers.set(oe.id||ve,se.id.toString())}let X=this.obstructions.features.filter(oe=>{var fe;return oe.geometry.type==="LineString"&&((fe=oe.properties.kind)==null?void 0:fe.toLowerCase())==="wall"&&oe.properties.footprintComponent===!1}),ie=this.obstructions.features.filter(oe=>{var fe;return oe.geometry.type==="LineString"&&((fe=oe.properties.kind)==null?void 0:fe.toLowerCase())==="wall"&&oe.properties.footprintComponent===!0}),Q=this.entrances,U=G6,Te=G6;if(X!=null&&X.length>0){let oe=this.styleMap[(C=X[0].properties)==null?void 0:C.id];oe!=null&&(U=Y({},oe)),Te=U;let{walls:fe,entrances:se}=j6(X,(Q==null?void 0:Q.features)||[]),ve=Math.max(U.height-.11,_H),ue=Ie(Y({},SH),{height:ve}),he=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),se,ue,n);this.layers.get(Fi).layers.set(qg,he.id.toString());let Z=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[fe]},F0(U,this.options),n);this.layers.get(Fi).layers.set(Rf,Z.id.toString())}if(ie!=null&&ie.length>0){let oe=this.styleMap[(T=ie[0].properties)==null?void 0:T.id];oe!=null&&(Te=Ie(Y({},oe),{id:rc}));let{walls:fe,entrances:se}=j6(ie,(Q==null?void 0:Q.features)||[]),ve=Math.max(Te.height-.11,_H),ue=Ie(Y({},SH),{height:ve}),he=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),se,ue,n);this.layers.get(Fi).layers.set(Yg,he.id.toString());let Z=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[fe]},F0(Te,this.options),n);this.layers.get(Fi).layers.set(rc,Z.id.toString())}}if(this.floorImages!=null){let B=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let H of this.floorImages.features||[])if(!("anchorId"in H.properties||"anchorId"in H.properties&&((O=H.properties)==null?void 0:O.anchorId)==null)){let z=wH(H,CH);this.mapObject.api.Images.add(new bt({latitude:H.geometry.coordinates[1],longitude:H.geometry.coordinates[0],floorId:this.id}),H.properties.path,Y({id:z,flipImageToFaceCamera:(P=this.options.flipImagesToFaceCamera)!=null?P:!0},H.properties)),CH++}this.layers.set(Zg,new Lc(this.renderer,B.id.toString()))}if(this.floorText!=null)for(let B of this.floorText.features||[]){let H=0;"geometryId"in B.properties?H=(A=(L=this.renderer.getState(B.properties.geometryId))==null?void 0:L.height)!=null?A:0:H=(M=B.properties.verticalOffset)!=null?M:0,this.renderer.addText3D(an(),Ie(Y({},B),{properties:Ie(Y({},B.properties),{verticalOffset:H})}),{},this.id)}return(N=this.multiFloorView)!=null&&N.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorGap}),this.renderer.render(),this},"load"));var v,x,I,C,T;this.mapObject=n,this.renderer=n.renderer,this.id=r.id,this.options=a;let m=this.renderer.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:(v=a.preloadFloors)==null?void 0:v.map(O=>O.id).includes(r.id)},t);this.containerId=m.id.toString(),this.externalId=r.externalId,this.metadata=r.metadata,this.shortName=r.shortName,this.subtitle=r.subtitle,this.name=r.name,this.elevation=r.elevation,u!=null&&c!=null&&(this.styleMap=c,this.spaces=u.space[this.id],this.entrances=u.entrance[this.id],this.obstructions=u.obstruction[this.id],this.floorImages=(x=u.floorImages)==null?void 0:x[this.id],this.floorText=(C=(I=u.enterprise)==null?void 0:I.floorText)==null?void 0:C[this.id],this.footprint=(T=u["floor.geojson"])==null?void 0:T.features.find(O=>O.properties.id===r.id)),this.floorStackId=t,this.multiFloorView=i,this.mapDataInternal=f}get geoJSONBoundingBox(){if(d(this,Fm))return d(this,Fm);if(!this.footprint){ae.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return $(this,Fm,A3(this.footprint)),d(this,Fm)}addOccluder(){let t=this.layers.get(kf);if(t==null||t.containerId==null||this.footprint==null){ae.warn("Tried to add occluder to floor ".concat(this.id," but the floor does not have an occlusion layer."));return}this.occluderId=this.renderer.addOccluder(this.footprint,t.containerId)}get hasFacadeGeometry(){return this.facadesByStyleId.size>0}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};Fm=new WeakMap,o(z6,"FloorObject");var mb=z6;g();var N0,$6=class $6{constructor(t,r,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");j(this,N0);var u;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(u=t.floors)!=null?u:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=n;let a=n.addGroupContainer(this.id,{visible:!0,interactive:!0},r);this.containerId=a.id.toString(),this.facade=i}get defaultFloor(){if(d(this,N0)==null){if(this.floorObjects.length===0)throw new Ro("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(r=>r.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r)),$(this,N0,t)}return d(this,N0)}get isOutdoors(){var r;return((r=this.type)==null?void 0:r.toLowerCase())==="outdoor"?!0:this.facade!=null?!1:this.floorObjects.some(n=>n.hasFacadeGeometry)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){ae.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t),this.facade&&this.renderer.setState(t.containerId,{focusable:!0})}loadAllFloors(){for(let t of this.floorObjects)t.load(),!this.isOutdoors&&!t.hasFacadeGeometry&&t.footprint!=null&&t.addOccluder()}};N0=new WeakMap,o($6,"FloorStackObject");var gb=$6;g();function H6(e,t,r,n){let i={outdoorOpacity:1,floorStates:[]},a=e.sort((v,x)=>v.elevation-x.elevation),u=Math.min(0,a[0].elevation),c=a[a.length-1].elevation,f,m;for(let v=u;v<=c;v++){let x=a.find(P=>P.elevation===v);if(x==null){v>=0&&(f==null?f=v:m=v);continue}let I=0,C=v<0?Math.abs(x.elevation)*r:r,T=!1;if(f===0&&m!=null){let P=r*m;I=-P,C=P,T=!0}else if(f!=null&&m!=null){let P=f,L=e.find(M=>M.elevation===P-1),A=i.floorStates.find(M=>M.floor===L);if(A){let M=r*(m-f+2);A.state.footprint=Ie(Y({},A.state.footprint),{altitude:0,height:M,visible:!0})}}f=void 0,m=void 0;let O={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(O),x.id===t.id?(O.state.visible=!0,O.state.geometry.visible=!0,O.state.labels.enabled=!0,O.state.markers.enabled=!0,O.state.occlusion.enabled=!0,(x.elevation<0||T)&&(x.elevation<0&&(i.outdoorOpacity=.2),O.state.footprint.height=C,O.state.footprint.altitude=I,O.state.footprint.visible=!0)):n.includes(x.id)&&x.elevation<t.elevation?(O.state.visible=!0,O.state.geometry.visible=!0,O.state.markers.enabled=!0,O.state.occlusion.enabled=!0,O.state.footprint.visible=!0,x.elevation<0?(O.state.footprint.height=C,O.state.footprint.altitude=I,i.outdoorOpacity=.2):(O.state.footprint.height=C,O.state.footprint.altitude=I)):t.elevation>0&&x.elevation<t.elevation&&x.elevation>=0&&(O.state.visible=!0,O.state.footprint.visible=!0,O.state.footprint.height=r,O.state.footprint.altitude=I)}return i}o(H6,"getMultiFloorState");var R1e={linear:_o.Linear.None,easeIn:_o.Quadratic.In,easeOut:_o.Quadratic.Out,easeInOut:_o.Quadratic.InOut},Dc,Y6=class Y6 extends Rt{constructor(r,n,i,a){var m,v,x,I;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,"animations",new Map);b(this,"Models",{add:o((r,n,i)=>{let x=i,{floorId:a,scale:u}=x,c=is(x,["floorId","scale"]),f=a?this.floorsById.get(a):this.currentFloor,m=Y({},c);u!=null&&(m.scale=Array.isArray(i.scale)?i.scale:[i.scale,i.scale,i.scale]);let v=this.renderer.addModelGroup(r,{type:"FeatureCollection",features:n.map(I=>{var C;return{type:"Feature",properties:{id:an(),rotation:i.rotation,scale:m.scale,interactive:i.interactive,verticalOffset:I.verticalOffset+((C=i.verticalOffset)!=null?C:0)},geometry:{type:"Point",coordinates:Rl(I)}}})},m,{parent:f.id});if(v==null)throw new Ro("error creating model");return this.renderer.getState(v).children},"add"),remove:o((r,n)=>{this.renderer.remove(r),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)},"remove")});b(this,"Images",{add:o((r,n,i)=>{var x;let v=i,{floorId:a,flipImageToFaceCamera:u}=v,c=is(v,["floorId","flipImageToFaceCamera"]),f=a?this.floorsById.get(a):this.currentFloor,m={type:"Feature",properties:c,geometry:{type:"Point",coordinates:r}};return this.renderer.addImage((x=i.id)!=null?x:an(),m,{url:n,flipImageToFaceCamera:u!=null?u:!1},f.id)},"add"),remove:o(r=>{this.renderer.remove(r)},"remove"),removeAll:o(()=>{},"removeAll")});b(this,"Markers",{add:o((r,n,i)=>{let a=q6(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),x=i,{attachTo:u}=x,c=is(x,["attachTo"]),f=c;c.rank==="initial"&&(f.rank="medium");let m=a.layers.get(au),v=this.renderer.addMarker2D(Rl(r),n,Ie(Y({},f),{occluderId:a==null?void 0:a.occluderId,attachTo:u}),m==null?void 0:m.containerId);if(!v)throw new Ro("Failed to create Marker");return v},"add"),remove:o(r=>{this.renderer.remove(r)},"remove"),getContentEl:o(r=>{let n=this.renderer.getState(r);if((n==null?void 0:n.type)==="marker")return n.element},"getContentEl"),removeAll:o(()=>{},"removeAll"),setPosition:o((r,n,i)=>{var c;let a=this.renderer.getState(r),u=i?this.floorsById.get(i):this.currentFloor;if(!a){ae.error('Failed to retrieve state for Marker with id "'.concat(r,'".'));return}if(a.type!=="marker"){ae.error('Geometry with id "'.concat(r,'" is not of type "marker".'));return}this.renderer.setState(a,{position:n,parent:(c=u==null?void 0:u.layers.get(au))==null?void 0:c.containerId})},"setPosition"),animateTo:o((r,n,i,a)=>{let u=this.renderer.getState(r),c=i?this.floorsById.get(i):this.currentFloor;if(!u)return ae.error('Failed to retrieve state for Marker with id "'.concat(r,'".')),Promise.resolve();if(u.type!=="marker")return ae.error('Geometry with id "'.concat(r,'" is not of type "marker".')),Promise.resolve();let f=Y({duration:1e3,easing:"ease-in-out"},a);this.cancelAnimation(r);let m=new Su({lon:u.position[0],lat:u.position[1]}).to({lon:n[0],lat:n[1]},f.duration).easing(R1e[f.easing]).onUpdate(({lon:v,lat:x})=>{var C;if(!this.renderer.getState(r))this.cancelAnimation(r);else{let T=(C=c==null?void 0:c.layers.get(au))==null?void 0:C.containerId;T&&this.Markers.setPosition(r,[v,x],T)}}).start();return this.renderer.getInternalTweenGroup().add(m),this.renderer.render(),this.animations.set(r,m),W6(m).then(()=>{this.animations.delete(r)})},"animateTo")});b(this,"Exporter",{getCurrentSceneGLTF:o(async r=>this.renderer.getCurrentSceneGLTF(r),"getCurrentSceneGLTF")});b(this,"Shapes",{add:o((r,n,i)=>{let a=i!=null&&i.floorId?this.floorsById.get(i==null?void 0:i.floorId):this.currentFloor,u="shape-"+an();return this.renderer.addGeometryGroup(u,r,n,a.id),u},"add"),remove:o(r=>(this.renderer.remove(r.id),r.id),"remove")});b(this,"Text3D",{label:o((r,n,i)=>{var u;if(!((u=this.api.getMapDataInternal())!=null&&u.enterpriseMode)){ae.warn("Enterprise mode is not enabled, skipping label creation");return}let a=PH(this.renderer,r,n,i);if(a)return{textInfo:a,target:r}},"label"),labelAll:o((r={})=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode))return ae.warn("Enterprise mode is not enabled, skipping label creation"),[];let n=this.api.getMapData();if(!n)return[];let i=[];return n.getByType("space").forEach(u=>{var c,f;if(u.locations[0]){let m=PH(this.renderer,u,(f=(c=u.locations[0])==null?void 0:c.name)!=null?f:u.name,r);m&&i.push({textInfo:m,target:u})}}),i},"labelAll"),remove:o(r=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){ae.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(r),r},"remove")});b(this,"Labels",{all:o(({onCreate:r,labelOptions:n={}})=>{for(let i of Object.entries(this.mvf.space)){let[a,u]=i;u&&u.features.forEach(c=>{var O,P,L,A;let f=(O=this.api.getMapData())==null?void 0:O.getById("space",c.properties.id);if(!f)return;let m=(P=this.styleMap[c.properties.id])==null?void 0:P.showImage,v=(L=c.properties.details)==null?void 0:L.images,x=m&&((A=v==null?void 0:v[0])!=null&&A.url)?{icon:v[0].url}:{},I=Y({icon:x.icon},n.appearance),T=(a?this.floorsById.get(a):this.currentFloor).layers.get(nc);if(c.properties.center&&f.name!==""){let M=this.renderer.addLabel2D(c.properties.center,f.name,Ie(Y({id:c.properties.id+"-label"},n),{appearance:I,rank:n.rank,attachTo:A0(f)}),Vo.is(f)?f.id:T==null?void 0:T.containerId);M&&r(M.id,f.name,f)}})}},"all"),add:o((r,n,i={})=>{let v=i,{attachTo:a}=v,u=is(v,["attachTo"]),c=q6(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),f=c.layers.get(nc),m=this.renderer.addLabel2D(Rl(r),n,Ie(Y({},u),{occluderId:c.occluderId,attachTo:a}),f==null?void 0:f.containerId);if(!m)throw new Ro("label creating failed");return m},"add"),remove:o(({entityId:r})=>{this.renderer.remove(r)},"remove"),removeAll:o(()=>{},"removeAll")});b(this,"Paths",{add:o((r,n)=>{var m;let i=(m=n==null?void 0:n.animateDrawing)!=null?m:!0,a=[],u=r[0].floorId||"root",c=0;for(let v of r){let{floorId:x="root",latitude:I,longitude:C}=v;x!==u&&(c++,u=x),a[c]==null&&a.push({floorId:x,coordinates:[]});let T=x===v.floorId?v:new bt({longitude:C,latitude:I,floorId:x});a[c].coordinates.push(T)}let f=a.reduce((v,{floorId:x,coordinates:I},C)=>{var P,L;if(C!==0){let A=a[C-1],M=A.coordinates[A.coordinates.length-1],N=I[0],B=Rl(M),H=Rl(N),z=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:A.floorId},geometry:{type:"Point",coordinates:B}},{type:"Feature",properties:{parentId:x},geometry:{type:"Point",coordinates:H}}]},n,this.id);z&&(i&&this.renderer.setState(z.id,{completeFraction:0}),v.push(Ie(Y({},z),{coordinates:[M,N]})))}if(I.length<2)return v;let T=(L=(P=this.floorsById.get(x))==null?void 0:P.layers.get(ic))==null?void 0:L.containerId,O=this.renderer.addPath({type:"FeatureCollection",features:I.map(A=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:Rl(A)}}))},n,T!=null?T:x);return O&&(i&&this.renderer.setState(O.id,{completeFraction:0}),v.push(Ie(Y({},O),{coordinates:I}))),v},[]);if(i){let v=[],x=this.api.getMapData();return f.forEach(I=>{var T;let C=EH(I,x,this.api);v.push(new Su({fraction:0}).to({fraction:1},C?(T=n==null?void 0:n.drawDuration)!=null?T:1500:0).onUpdate(O=>{this.renderer.setState(I.id,{completeFraction:O.fraction})}))}),v.forEach((I,C)=>{C<v.length-1&&I.chain(v[C+1]),this.renderer.getInternalTweenGroup().add(I)}),v[0].start(),this.renderer.render(),this.animations.set(f[0].id.toString(),v[0]),{paths:f,animation:W6(v[v.length-1]).then(()=>{this.animations.delete(f[0].id.toString())})}}else return{paths:f,animation:Promise.resolve()}},"add"),remove:o(r=>{r.forEach(n=>{this.cancelAnimation(n),this.renderer.remove(n)})},"remove")});j(this,Dc,{enabled:!1,floorGap:10,updateCameraElevationOnFloorChange:!0});this.renderer=a.core,this.api=a,this.id=r,this.renderer.addGroupContainer(r,{},"root"),this.options=i!=null?i:{},this.mvf=(m=n==null?void 0:n.mvf)!=null?m:{};let u=TH(this.mvf["styles.json"]||{});if(this.styleMap=u,$(this,Dc,Y({enabled:!1,floorGap:10,updateCameraElevationOnFloorChange:!0},i==null?void 0:i.multiFloorView)),!n){this.id!=="outdoors-container"&&ae.warn("Map (".concat(this.id,") created with no data."));let C=new gb({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(C.id,C),this.currentFloorStackId=C.id;let T=new mb(C.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this,d(this,Dc),i!=null?i:{});this.floorsById.set(T.id,T),C.addFloor(T),this.setFloor(T.id);return}let c=n.getMVFFeatureByType("floor-stack");if(c==null||c.length===0)throw new Ro("MVF does not contain any Floor Stacks.");for(let C of c){let T=new gb(C,this.id,this.renderer,(v=this.mvf.facade)==null?void 0:v[C.id]);if(T.floorIds.length!==0){for(let O of T.floorIds){let P=n.getMVFFeatureById("floor",O);if(P!=null){let L=this.mvf.space[P.id],A=this.mvf.obstruction[P.id];if((L==null||L.features.length===0)&&(A==null||A.features.length===0))continue;let M=new mb(T.id,P,this,d(this,Dc),i!=null?i:{},this.mvf,u,n);this.floorsById.set(M.id,M),T.addFloor(M)}}this.floorStacksById.set(C.id,T),this.currentFloorStackId||(this.currentFloorStackId=C.id)}}for(let[C]of Object.entries(n.facadesBySpaceId)){let T=n.getById("space",C);T&&(this.outdoorFloorStacks.add(T.floor.floorStack.id),(x=this.floorsById.get(T.floor.id))==null||x.setVisible(!0))}let f=(I=this.mvf.enterprise)==null?void 0:I.venue.defaultMap;if(i!=null&&i.initialFloor){let C=Y1(i.initialFloor);C&&this.floorsById.has(C)?f=C:ae.error("Invalid initial floor specified (".concat(i.initialFloor,"), using default behavior instead"))}f||(f=this.currentFloorStack.defaultFloor.id),this.startingFloorId=f}get currentFloorStack(){let r=this.floorStacksById.get(this.currentFloorStackId);if(!r)throw new Ro('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return r}setFloorStack(r,n){if(this.currentFloorStackId===r)return;let i=this.floorStacksById.get(r);if(i==null){ae.error("Invalid floor stack passed to setFloorStack (".concat(r,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(i.floorObjects.length===0){ae.error("Floor stack (".concat(r,") 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 r=this.floorsById.get(this.currentFloorId);if(!r)throw new Ro('Floor with id "'.concat(this.currentFloorId,'" not found'));return r}get floors(){return Array.from(this.floorsById.values())}processFloorChange(r){var a,u,c,f,m,v,x;if(this.api.manualFloorVisibility===!0)return;let n=(a=this.api.getMapDataInternal())==null?void 0:a.getById("floor",r),i=(u=this.api.getMapDataInternal())==null?void 0:u.getById("floor-stack",this.currentFloorStackId);if(n&&i)if(!((c=d(this,Dc))!=null&&c.enabled)||n.floorStack.id!==(i==null?void 0:i.id))for(let I of this.floorStacksById.values())I.floorObjects.forEach(C=>{C.id!==r&&C.setVisible(!1)});else{let I=H6(i.floors,n,d(this,Dc).floorGap,((m=(f=this.api.Navigation)==null?void 0:f.floors)==null?void 0:m.map(C=>C.id))||[]);(x=(v=this.api)==null?void 0:v.Outdoor)==null||x.setOpacity(I.outdoorOpacity),I.floorStates.forEach(C=>{var T;if(C.floor){let O=(T=this.api.getMapData())==null?void 0:T.getById("floor",C.floor.id);O&&this.api.updateState(O,C.state)}}),d(this,Dc).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*d(this,Dc).floorGap)}}setFloor(r,n){if(this.currentFloorId===r)return;if(!this.floorsById.get(r)){ae.error("Invalid floor passed to setFloor (".concat(r,"), 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:r,reason:n}),this.currentFloorStack&&this.processFloorChange(r),this.currentFloorId=r,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.updatePathLayersVisibility(),this.publish("floor-change",{reason:n,floorId:this.currentFloor.id,previousFloorId:a})}updatePathLayersVisibility(){var n;let r=this.api.hidePathsNotOnCurrentFloor===!0&&!((n=this.options.multiFloorView)!=null&&n.enabled);for(let i of this.floorsById.values()){let a=i.layers.get(ic);if(!a)continue;let u=!r||i.id===this.currentFloor.id;a.setVisible(u)}}cancelAnimation(r){let n=this.animations.get(r);n&&(n.stop(),this.animations.delete(r),this.renderer.getInternalTweenGroup().remove(n))}loadAllFloors(){for(let r of this.floorStacksById.values())r.loadAllFloors()}};Dc=new WeakMap,o(Y6,"GeojsonApiMapObject");var yb=Y6;function PH(e,t,r,n){return e.labelText3D(t.id,r!=null?r:t.name,Ie(Y({},n),{parentId:t.floor.id}))}o(PH,"labelSpace");g();var Eu,xb,X6=class X6{constructor({currentMapGetter:t}){j(this,Eu,new Map);j(this,xb);$(this,xb,t)}get currentMap(){return d(this,xb).call(this)}getById(t){return d(this,Eu).get(t)}add(t,r,n){var m;let i=t.anchorTarget;if(!i)throw new Error("get coordinate failed");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let u=a.Markers.add(i,r,Ie(Y({},n),{rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(m=n==null?void 0:n.dynamicResize)!=null?m:!0,attachTo:A0(t)}));if(u==null)throw new Error("error creating marker");let c=a.Markers.getContentEl(u.id.toString());if(!c)throw new Error("marker component should exist");let f=new zp(u.id.toString(),c,t);return d(this,Eu).set(f.id,{marker:f,entityId:u.id.toString()}),f}remove(t){var n;let r=d(this,Eu).get(t.id);r&&((n=this.currentMap)==null||n.Markers.remove(r.entityId),d(this,Eu).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Eu).forEach(({marker:r})=>{this.remove(r),t.push(r),d(this,Eu).delete(r.id.toString())}),t}setPosition(t,r){var u;let n=r.anchorTarget;if(!n){ae.error("Cannot determine coordinate from target.");return}let i=this.currentMap;if(!i){ae.error("Cannot determine the current map.");return}let a=d(this,Eu).get(t.id);if(!a){ae.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}i.Markers.setPosition(a.entityId,Rl(n),(u=n.floorId)!=null?u:i.currentFloorId),a.marker.updateTarget(r)}animateTo(t,r,n){var c;let i=r.anchorTarget;if(!i)return ae.error("Cannot determine coordinate from target."),Promise.resolve();let a=this.currentMap;if(!a)return ae.error("Cannot determine the current map."),Promise.resolve();let u=d(this,Eu).get(t.id);return u?(u.marker.updateTarget(r),a.Markers.animateTo(u.entityId,Rl(i),(c=i.floorId)!=null?c:a.currentFloorId,n)):(ae.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};Eu=new WeakMap,xb=new WeakMap,o(X6,"Markers");var vb=X6;g();var Yp,Ib,Z6=class Z6{constructor({currentMapGetter:t}){j(this,Yp,new Map);j(this,Ib);$(this,Ib,t)}get currentMap(){return d(this,Ib).call(this)}getById(t){return d(this,Yp).get(t)}add(t,r,n){var f;let i=t.anchorTarget;if(!i)throw new Error("Target does not implement IAnchorable.");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let u=a.Images.add(Rl(i),r,Ie(Y({},n),{floorId:i.floorId,verticalOffset:i.verticalOffset+((f=n.verticalOffset)!=null?f:0)}));if(!u)throw new Error("image component should exist");let c=new Pm(u.id.toString(),r,t);return d(this,Yp).set(c.id,{image:c,entityId:u.id.toString()}),c}remove(t){var n;let r=d(this,Yp).get(t.id);r&&((n=this.currentMap)==null||n.Images.remove(r.entityId),d(this,Yp).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Yp).forEach(({image:r})=>{this.remove(r),t.push(r),d(this,Yp).delete(r.id.toString())}),t}};Yp=new WeakMap,Ib=new WeakMap,o(Z6,"Images");var bb=Z6;g();var Ac,_b,K6=class K6{constructor({currentMapGetter:t}){j(this,Ac,new Map);j(this,_b);$(this,_b,t)}get currentMap(){return d(this,_b).call(this)}getById(t){return d(this,Ac).get(t)}add(t,r,n){let i=[t],a=i.reduce((f,m)=>{var v;return m?(f.has(m.floorId)||f.set(m.floorId,[]),(v=f.get(m.floorId))==null||v.push(m),f):(ae.error("Cannot determine coordinate from options."),f)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let u=this.currentMap;if(!u)throw new Error("currentMap should exist");let c=[];return a.forEach((f,m)=>{let v=an();u.Models.add(v,f,Ie(Y({},n),{url:r,floorId:m})).forEach(({id:I})=>{let C=new Mm(I.toString(),v,f[0]);d(this,Ac).set(C.id,{model:C,entityId:I.toString(),groupId:v}),c.push(C)})}),c[0]}remove(t){var n;let r=d(this,Ac).get(t.id);r&&((n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),d(this,Ac).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Ac).forEach(({model:r})=>{var i;let n=d(this,Ac).get(r.id);n&&(t.push(r),(i=this.currentMap)==null||i.Models.remove(n.entityId,n.groupId),d(this,Ac).delete(r.id.toString()))}),t}};Ac=new WeakMap,_b=new WeakMap,o(K6,"Models");var Sb=K6;g();var Fc,wb,J6=class J6{constructor({currentMapGetter:t}){j(this,Fc,new Map);j(this,wb);$(this,wb,t)}get currentMap(){return d(this,wb).call(this)}getById(t){return d(this,Fc).get(t)}add(t,r){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let i=n.Paths.add(t,r),a=i.paths.map(c=>c.id.toString()),u=new Al(an(),i.animation,t,i.paths);for(let c of a)d(this,Fc).set(c,{path:u,entityIds:a});return d(this,Fc).set(u.id,{path:u,entityIds:a}),u}remove(t){var n;let r=d(this,Fc).get(t.id);r&&((n=this.currentMap)==null||n.Paths.remove(r.entityIds),d(this,Fc).delete(t.id),r.entityIds.forEach(i=>d(this,Fc).delete(i)))}removeAll(){let t=[];return d(this,Fc).forEach(({path:r})=>{this.remove(r),t.push(r)}),t}};Fc=new WeakMap,wb=new WeakMap,o(J6,"Paths");var Cb=J6;g();g();var UH=Mn(N5(),1);g();var Pb="blue-dot",MH="blue-dot-accuracy-ring";var Q6="#2266ff",k1e="#808080",OH="#f5f5f5";var LH={radius:10,color:Q6,inactiveColor:k1e,heading:{color:Q6,opacity:.7},accuracyRing:{color:Q6,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};g();var DH="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";g();var AH=o((e,t,r=0)=>{if(Math.abs(e)>=Math.PI)throw new Error("Sector angle too wide!");let n=r/Math.tan(e/2),i=r/Math.sin(e/2),a=i+t,u=10,c=new ju;c.moveTo(-i*Math.sin(e/2),i*Math.cos(e/2)-n);for(let f=0;f<u;f++)c.lineTo(-(a*Math.sin(e/2-e/u*f)),a*Math.cos(e/2-e/u*f)-n);for(let f=0;f<u;f++)c.lineTo(-(r*Math.sin(Math.PI/-2+Math.PI/u*f)),r*Math.cos(Math.PI/-2+Math.PI/u*f));return new Uu(c,{depth:.1,bevelEnabled:!1,UVGenerator:G1e(t)})},"createSectorGeometry"),eL=o((e,t,r)=>{let i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/r;return i>1?i=1:i<0&&(i=0),new Ft(0,i)},"generateRadialUV"),G1e=o(e=>({generateTopUV:o((t,r,n,i,a)=>{let u=r[n*3],c=r[n*3+1],f=r[i*3],m=r[i*3+1],v=r[a*3],x=r[a*3+1];return[eL(u,c,e),eL(f,m,e),eL(v,x,e)]},"generateTopUV"),generateSideWallUV:o(()=>[new Ft(0,1),new Ft(0,1),new Ft(0,1),new Ft(0,1)],"generateSideWallUV")}),"radialUVGenerator");function FH(e,t){if(t==null)return e;let r={latitude:e==null?void 0:e.latitude,longitude:e==null?void 0:e.longitude,accuracy:e==null?void 0:e.accuracy,floor:e==null?void 0:e.floor,heading:e==null?void 0:e.heading};return"latitude"in t&&(r.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?e==null?void 0:e.latitude:t.latitude),"longitude"in t&&(r.longitude=t.longitude==null||t.longitude==="device"?e==null?void 0:e.longitude:t.longitude),"accuracy"in t&&(r.accuracy=t.accuracy==="device"?e==null?void 0:e.accuracy:t.accuracy),"floor"in t&&(r.floor=t.floor==="device"?e==null?void 0:e.floor:t.floor),"heading"in t&&(r.heading=t.heading==="device"?e==null?void 0:e.heading:t.heading),r}o(FH,"getPositionWithOverrides");function j1e([e,t],[r,n],[i,a]){let u=r-e,c=n-t,f=u**2+c**2;if(f===0)return;let m=((i-e)*u+(a-t)*c)/f,v;m<=0?v=[e,t]:m>=1?v=[r,n]:v=[e+m*u,t+m*c];let x=EI([i,a],v);return{proportion:Math.max(0,Math.min(1,m)),intersection:v,distance:x}}o(j1e,"getPointLineIntersection");function NH(e,t){if(e==null||e.length<2)return;let r=Number.MAX_SAFE_INTEGER,n,i=0,a=0;for(let u=0;u<e.length-1;u++){let c=e[u],f=e[u+1],m=j1e(c,f,t);m!=null&&m.distance<r&&(r=m.distance,n=m.intersection,i=u,a=m.proportion)}if(n)return{intersection:n,distance:r,segmentIndex:i,proportion:a}}o(NH,"findBlueDotOnPath");function RH(e,t){let r=new sl({color:e,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,i=.35*4,a=AH(Math.PI/6,i,n);new ug().load(DH,c=>{r.alphaMap=c,r.needsUpdate=!0});let u=new Vt(a,r);return u.position.z=-.05,u.renderOrder=0,u}o(RH,"createHeadingCone");function kH(e,t){let r=new CI(1,1,.05,32),n=new sl({transparent:!0,color:e,opacity:t,depthTest:!1,depthWrite:!1}),i=new Vt(r,n);return i.scale.set(0,0,.05),i.renderOrder=1,i.rotation.x=Math.PI/2,i}o(kH,"createAccuracyRing");function BH(e){let t=new CI(.35,.35,.07,32),r=new sl({transparent:!0,color:OH,depthTest:!1,depthWrite:!1}),n=new Vt(t,r);n.renderOrder=2;let i=new CI(.35*.8,.35*.8,.01,32),a=new sl({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),u=new Vt(i,a);return u.renderOrder=3,n.rotation.x=Math.PI/2,n.position.z=.07/2,u.rotation.x=Math.PI/2,u.position.z=.07,{outerMesh:n,innerMesh:u}}o(BH,"createBlueDot");var VH=Mn(GH(),1);var Sr,Xo,Nm,Xp,Ya,Xa,Zp,Rm,km,Bm,Wi,Sa,Tb,Kp,Vn,Eb,Mb,Ob,R3,k3,Lb,B3,Db,G3,Nc,Jp,j3,xd,k0,Rc,Ab,tL=class tL extends Rt{constructor(r,n){super();j(this,Sr);j(this,Xo);j(this,Nm,null);b(this,"primaryGeometry");b(this,"secondaryGeometry");j(this,Xp);j(this,Ya);j(this,Xa);j(this,Zp);j(this,Rm);j(this,km);j(this,Bm);j(this,Wi,LH);j(this,Sa,1);j(this,Tb);j(this,Kp);j(this,Vn,new N3);b(this,"bounds");b(this,"state","disabled");b(this,"following",!1);j(this,Eb,o(r=>{var n;return(n=d(this,Xo).getMapData())==null?void 0:n.getById("floor",r)},"#getFloorByFloorId"));j(this,Mb,o(r=>{var i;let n;if(r!=null){let a=(i=d(this,Xo).currentMap)==null?void 0:i.currentFloorStack.floorObjectsByElevation.get(r);n=a?d(this,Eb).call(this,a.id):void 0}return n},"#getFloorByFloorLevel"));j(this,Ob,o(()=>this.state!=="hidden"&&this.state!=="disabled","#shouldUpdateGeometry"));j(this,R3,o((r,n)=>{d(this,G3).call(this),r.scale.set(d(this,Sa),d(this,Sa),d(this,Sa)),r.position.z=.07/2*d(this,Sa),n.scale.set(d(this,Sa),d(this,Sa),d(this,Sa)),n.position.z=.07*d(this,Sa),this.state==="active"?n.material.color.set(d(this,Wi).color):this.state==="inactive"&&n.material.color.set(d(this,Wi).inactiveColor)},"#updatePrimaryGeometry"));j(this,k3,o((r,n)=>{if(this.state==="active"){let i=this.accuracy;i!=null?(r.visible=!0,d(this,km)&&d(this,km).stop(),$(this,km,new Su({scale:r.scale.x}).to({scale:i/2},150).onUpdate(({scale:u})=>{r.scale.set(u,1,u)}).start()),d(this,Sr).getInternalTweenGroup().add(d(this,km))):r.visible=!1;let a=this.heading;if(a!=null){n.visible=!0,d(this,Bm)&&d(this,Bm).stop();let{start:u,end:c}=MI(n.rotation.z,-Br.degToRad(a));$(this,Bm,new Su({rotation:u}).to({rotation:c},150).onUpdate(({rotation:f})=>{n.rotation.z=f}).start()),d(this,Sr).getInternalTweenGroup().add(d(this,Bm)),n.scale.set(d(this,Sa),d(this,Sa),1)}else n.visible=!1}else this.state==="inactive"&&(n.visible=!1,r.visible=!1)},"#updateSecondaryGeometry"));j(this,Lb,o(r=>{if(!d(this,Ob).call(this))return;let[n,i]=r.children;!n||!i||d(this,R3).call(this,n,i)},"#updatePrimaryGeometryPerFrame"));j(this,B3,o(r=>{if(!d(this,Ob).call(this))return;let[,,n,i]=r.children;!n||!i||d(this,k3).call(this,n,i)},"#updateSecondaryGeometryPerFrame"));j(this,Db,o(r=>{var m,v,x,I,C,T,O,P,L,A,M;let n;try{n=H1e.parse(FH(r,d(this,Ya)))}catch(N){d(this,Nc).call(this,"error"),ae.error("BlueDot: Position parse failed",N instanceof W.ZodError?N.message:String(N));return}d(this,Wi).debug&&ae.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 N=d(this,Sr).convertTo3DMapPosition(n.latitude,n.longitude,0);if(!(N.x>=i.x&&N.x<=a.x&&N.y>=i.y&&N.y<=a.y)){ae.warn("BlueDot: Position [".concat(n.longitude,", ").concat(n.latitude,"] is outside map bounds. Position update will be discarded."));return}}$(this,Xa,n),d(this,Nc).call(this,"position-update"),d(this,Zp)&&clearTimeout(d(this,Zp)),typeof d(this,Wi).timeout=="number"&&d(this,Wi).timeout<1/0&&$(this,Zp,setTimeout(()=>{d(this,Wi).debug&&ae.log("BlueDot: Position timed out after ".concat(d(this,Wi).timeout,"ms")),d(this,Nc).call(this,"timeout"),d(this,Sr).render()},d(this,Wi).timeout)),(v=d(this,Xo).getMapDataInternal())==null||v.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:n.latitude,longitude:n.longitude,floorLevel:(m=n.floor)==null?void 0:m.elevation,accuracy:n.accuracy}});let u,c=0;if(!this.primaryGeometry)u=[n.longitude,n.latitude,0],c=(x=n.floor)!=null&&x.id?d(this,Sr).getState((I=n.floor)==null?void 0:I.id).altitude:0,d(this,Vn).matrixAutoUpdate=!1,d(this,Vn).userData.floorId=(C=n.floor)==null?void 0:C.id,this.primaryGeometry=d(this,Sr).addCustomGeometry(Pb,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:u}},{setup:o(N=>{let{outerMesh:B,innerMesh:H}=BH(d(this,Wi).color);d(this,Vn).add(B),d(this,Vn).add(H),N.add(d(this,Vn));let z=d(this,Vn).userData.floorId?d(this,Sr).getState(d(this,Vn).userData.floorId):void 0;(z==null?void 0:z.altitude)!=null?d(this,Vn).matrix.elements[14]=z==null?void 0:z.altitude:d(this,Vn).matrix.identity(),d(this,Lb).call(this,d(this,Vn))},"setup"),update:o(()=>{let N=d(this,Vn).userData.floorId?d(this,Sr).getState(d(this,Vn).userData.floorId):void 0;(N==null?void 0:N.altitude)!=null?d(this,Vn).matrix.elements[14]=N==null?void 0:N.altitude:d(this,Vn).matrix.identity(),d(this,Lb).call(this,d(this,Vn))},"update")},{visible:!0,interactive:!0}),this.secondaryGeometry=d(this,Sr).addCustomGeometry(MH,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:u}},{setup:o(()=>{let N=kH(d(this,Wi).accuracyRing.color,d(this,Wi).accuracyRing.opacity),B=RH(d(this,Wi).heading.color,d(this,Wi).heading.opacity);d(this,Vn).add(N),d(this,Vn).add(B),B.visible=!1,N.visible=!1},"setup"),update:o(()=>{d(this,B3).call(this,d(this,Vn))},"update")},{visible:!0,interactive:!1});else{let N=d(this,Sr).getState(this.primaryGeometry);if(u=[N.position[0],N.position[1],0],d(this,Vn).userData.floorId){let B=d(this,Sr).getState(d(this,Vn).userData.floorId);c=((T=N.position[2])!=null?T:0)+((O=B==null?void 0:B.altitude)!=null?O:0)}}if(d(this,Rm)&&d(this,Rm).stop(),d(this,Vn).userData.floorId!==((P=n.floor)==null?void 0:P.id)){let N=(L=n.floor)!=null&&L.id?d(this,Sr).getState((A=n.floor)==null?void 0:A.id).altitude:0,B=c;d(this,Vn).userData.floorId=(M=n.floor)==null?void 0:M.id,u[2]=B-N}let f=[n.longitude,n.latitude,0];$(this,Rm,new Su(u).to(f,1e3).easing(_o.Cubic.Out).onUpdate(N=>{let B={position:N};this.primaryGeometry&&this.secondaryGeometry&&d(this,Sr).setState(this.primaryGeometry,B),this.secondaryGeometry&&d(this,Sr).setState(this.secondaryGeometry,B)}).start()),d(this,Sr).getInternalTweenGroup().add(d(this,Rm)),this.publish("blue-dot-position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),d(this,Sr).render()},"#setPosition"));b(this,"onPositionUpdate",o(r=>{var n,i,a,u,c;if(this.state!=="disabled"){try{$1e.parse(r)}catch(f){d(this,Nc).call(this,"error"),ae.error("BlueDot: Browser sent invalid position",f instanceof W.ZodError?f.message:String(f));return}$(this,Xp,{latitude:(n=r.coords)==null?void 0:n.latitude,longitude:(i=r.coords)==null?void 0:i.longitude,accuracy:(a=r.coords)==null?void 0:a.accuracy,heading:(u=r.coords)==null?void 0:u.heading,floor:d(this,Mb).call(this,(c=r.coords)==null?void 0:c.floorLevel)}),d(this,Db).call(this,d(this,Xp))}},"onPositionUpdate"));b(this,"onPositionError",o(r=>{var n;switch(d(this,Nc).call(this,"error"),r.code){case r.PERMISSION_DENIED:ae.error("Geolocation permission denied by the user.",r),(n=d(this,Xo).getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case r.POSITION_UNAVAILABLE:ae.error("Geolocation position unavailable.",r);break;case r.TIMEOUT:ae.error("Geolocation request timed out.",r);break;default:ae.error("An unknown geolocation error occurred.",r);break}this.publish("blue-dot-position-error",r)},"onPositionError"));j(this,G3,o(()=>{var n;let r=Math.round(d(this,Sr).camera.zoomLevel*1e5);if(r!==d(this,Tb)){$(this,Tb,r);let i=(n=d(this,Sr).getMetresPerPixel())!=null?n:1;$(this,Sa,Math.max(d(this,Wi).radius/(.35/i),1))}},"#updateScale"));j(this,Nc,o(r=>{let n=z1e[this.state].actions[r];if(n){switch(d(this,Wi).debug&&ae.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(n," using ").concat(r)),n){case"hidden":case"disabled":this.primaryGeometry&&d(this,Sr).setState(this.primaryGeometry,{visible:!1}),this.secondaryGeometry&&d(this,Sr).setState(this.secondaryGeometry,{visible:!1});break;case"active":this.primaryGeometry&&d(this,Sr).setState(this.primaryGeometry,{visible:!0}),this.secondaryGeometry&&d(this,Sr).setState(this.secondaryGeometry,{visible:!0});break}this.state!==n&&(this.state=n,this.publish("blue-dot-state-change",{state:n,action:r}))}else ae.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(r))},"#transitionAction"));j(this,Jp);j(this,j3,o(()=>{if(d(this,Jp)==null&&d(this,Xo).Navigation.activeDirections!=null){let n=(Array.isArray(d(this,Xo).Navigation.activeDirections)?d(this,Xo).Navigation.activeDirections.flatMap(i=>i.coordinates):d(this,Xo).Navigation.activeDirections.coordinates).filter(i=>i.floorId===d(this,Xo).currentFloor.id);$(this,Jp,(0,VH.default)(n.map(i=>({x:i.longitude,y:i.latitude})),1e-5).map(i=>[i.x,i.y]))}return d(this,Jp)},"#getSimplifiedDirections"));j(this,xd,o(()=>{d(this,Sr).camera.isAnimating&&d(this,Sr).camera.cancelAnimation(),d(this,Rc)&&(this.off("blue-dot-position-update",d(this,Rc)),$(this,Rc,void 0)),this.following=!1,$(this,Jp,void 0),d(this,Sr).off("user-interaction-start",d(this,xd)),d(this,Xo).off("navigation-active-path-change",d(this,k0)),this.publish("blue-dot-follow-change",{following:!1})},"#cancelFollow"));j(this,k0,o(()=>{$(this,Jp,void 0)},"#pathChangeHandler"));j(this,Rc);b(this,"follow",o((r,n)=>{var a,u,c,f;if(r===!1){d(this,xd).call(this);return}r!=="position-only"&&(n==null?void 0:n.bearing)!=null&&ae.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(r,"'. To control the bearing manually, use mode 'position-only'."));let i={zoomLevel:(a=n==null?void 0:n.zoomLevel)!=null?a:21,bearing:r==="position-only"?n==null?void 0:n.bearing:void 0,pitch:(u=n==null?void 0:n.pitch)!=null?u:45,duration:(c=n==null?void 0:n.duration)!=null?c:1e3,easing:(f=n==null?void 0:n.easing)!=null?f:"ease-in-out"};this.following?d(this,Rc)&&this.off("blue-dot-position-update",d(this,Rc)):(this.following=!0,d(this,Sr).on("user-interaction-start",d(this,xd)),d(this,Xo).on("navigation-active-path-change",d(this,k0))),$(this,Rc,m=>{let{coordinate:v,heading:x,floor:I}=m;if(i.center=[v.longitude,v.latitude],I!=null&&I.id!==d(this,Xo).currentFloor.id&&(d(this,Xo).currentMap.setFloor(I.id),$(this,Jp,void 0)),r==="position-and-heading")i.bearing=x!=null?x:void 0;else if(r==="position-and-path-direction"){let C=d(this,j3).call(this);if(C!=null){let T=NH(C,[v.longitude,v.latitude]);if(T!=null){let O=C[T.segmentIndex],P=C[T.segmentIndex+1];i.bearing=j7(O,P)}}}d(this,Sr).camera.animateTo(i)}),this.on("blue-dot-position-update",d(this,Rc)),this.publish("blue-dot-follow-change",{following:!0,mode:r})},"follow"));j(this,Ab,o(r=>{this.bounds=r},"#handlePanBoundsChange"));$(this,Sr,r),$(this,Xo,n)}get heading(){var r;return(r=d(this,Xa))==null?void 0:r.heading}get accuracy(){var r;return(r=d(this,Xa))==null?void 0:r.accuracy}get coordinate(){var r,n;if(d(this,Xa)!=null)return(d(this,Kp)==null||((r=this.floor)==null?void 0:r.id)!==d(this,Kp).floorId||d(this,Xa).latitude!==d(this,Kp).latitude||d(this,Xa).longitude!==d(this,Kp).longitude)&&$(this,Kp,new bt(d(this,Xa).latitude,d(this,Xa).longitude,(n=this.floor)==null?void 0:n.id)),d(this,Kp)}get floor(){var r;return(r=d(this,Xa))==null?void 0:r.floor}enable(r){$(this,Wi,(0,UH.default)({},r,d(this,Wi))),d(this,Nc).call(this,"enable"),this.watchDevicePosition(d(this,Wi).watchDevicePosition),this.bounds||(this.bounds=d(this,Sr).getSystems().cameraSystem.panBounds,d(this,Sr).on("pan-bounds-change",d(this,Ab)))}disable(){d(this,Sr).remove(d(this,Vn).id),$(this,Vn,new N3),this.primaryGeometry&&(d(this,Sr).remove(this.primaryGeometry.id),this.primaryGeometry=void 0),this.secondaryGeometry&&(d(this,Sr).remove(this.secondaryGeometry.id),this.secondaryGeometry=void 0),d(this,Zp)&&(clearTimeout(d(this,Zp)),$(this,Zp,void 0)),this.following&&d(this,xd).call(this),this.watchDevicePosition(!1),$(this,Xa,void 0),$(this,Ya,void 0),d(this,Nc).call(this,"disable"),d(this,Sr).off("user-interaction-start",d(this,xd)),d(this,Xo).off("navigation-active-path-change",d(this,k0)),d(this,Sr).off("pan-bounds-change",d(this,Ab))}watchDevicePosition(r){if(d(this,Nm)&&(navigator.geolocation.clearWatch(d(this,Nm)),$(this,Nm,null)),d(this,Xp)&&$(this,Xp,void 0),r){if(this.state==="disabled"){ae.warn("BlueDot must be enabled before watching browser position.");return}$(this,Nm,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(r){var i,a;r==null?$(this,Ya,void 0):"coords"in r?$(this,Ya,Object.assign({},d(this,Ya),{latitude:r.coords.latitude,longitude:r.coords.longitude,accuracy:r.coords.accuracy,heading:r.coords.heading,floor:d(this,Mb).call(this,r.coords.floorLevel)})):($(this,Ya,Object.assign({},d(this,Ya),r)),"floorOrFloorId"in r&&(d(this,Ya).floor=typeof r.floorOrFloorId=="string"&&r.floorOrFloorId!=="device"?d(this,Eb).call(this,r.floorOrFloorId):r.floorOrFloorId)),(((i=d(this,Ya))==null?void 0:i.latitude)!=null&&((a=d(this,Ya))==null?void 0:a.longitude)!=null||d(this,Xp)!=null)&&d(this,Db).call(this,d(this,Xp))}};Sr=new WeakMap,Xo=new WeakMap,Nm=new WeakMap,Xp=new WeakMap,Ya=new WeakMap,Xa=new WeakMap,Zp=new WeakMap,Rm=new WeakMap,km=new WeakMap,Bm=new WeakMap,Wi=new WeakMap,Sa=new WeakMap,Tb=new WeakMap,Kp=new WeakMap,Vn=new WeakMap,Eb=new WeakMap,Mb=new WeakMap,Ob=new WeakMap,R3=new WeakMap,k3=new WeakMap,Lb=new WeakMap,B3=new WeakMap,Db=new WeakMap,G3=new WeakMap,Nc=new WeakMap,Jp=new WeakMap,j3=new WeakMap,xd=new WeakMap,k0=new WeakMap,Rc=new WeakMap,Ab=new WeakMap,o(tL,"BlueDot");var B0=tL,z1e={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"}}},$1e=W.object({coords:W.object({latitude:W.number(),longitude:W.number(),accuracy:W.number(),altitude:W.number().optional().nullable(),altitudeAccuracy:W.number().optional().nullable(),heading:W.number().optional().nullable(),speed:W.number().optional().nullable(),floorLevel:W.number().optional().nullable()}),timestamp:W.number()}),H1e=W.object({latitude:W.number(),longitude:W.number(),floor:W.custom().optional(),accuracy:W.number().optional(),heading:W.number().optional().nullable()}),rL=class rL extends Zl{constructor(){super(...arguments);b(this,"children",[]);b(this,"userData",{})}};o(rL,"BlueDotContainer");var N3=rL;g();var Qp,Nb,nL=class nL{constructor({currentMapGetter:t}){j(this,Qp,new Map);j(this,Nb);$(this,Nb,t)}get currentMap(){return d(this,Nb).call(this)}getById(t){return d(this,Qp).get(t)}add(t,r,n){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Shapes.add(t,r||{},{floorId:n==null?void 0:n.id}),u=new $p(a);return d(this,Qp).set(u.id,u),u}remove(t){var n;d(this,Qp).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),d(this,Qp).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Qp).forEach(r=>{this.remove(r),t.push(r.id),d(this,Qp).delete(r.id.toString())}),t}};Qp=new WeakMap,Nb=new WeakMap,o(nL,"Shapes");var Fb=nL;g();var kb,iL=class iL{constructor({currentMapGetter:t}){j(this,kb);$(this,kb,t)}get currentMap(){return d(this,kb).call(this)}setFromStyleCollection(t){var r,n,i,a;for(let u in t)for(let c of((r=this.currentMap)==null?void 0:r.floors)||[]){if(t[u]==null||!c.layers.has(Fi))continue;let f=c.layers.get(Fi);if(f!=null&&f.layers.has(u)&&"color"in t[u]){let x=f.layers.get(u);x&&((n=this.currentMap)==null||n.renderer.setState(x,{color:t[u].color}))}if(f&&u===Rf&&!(rc in t)){let x=f.layers.get(rc);x&&"color"in t[u]&&((i=this.currentMap)==null||i.renderer.setState(x,{color:t[u].color}))}if(!c.layers.has(bh))continue;let m=c.layers.get(bh),v=c.facadesByStyleId.get(u);if(v&&v.length>0)for(let x of v){let I=m.layers.get("".concat(x,"-").concat(u));I&&"color"in t[u]&&((a=this.currentMap)==null||a.renderer.setState(I,{color:t[u].color}))}}}};kb=new WeakMap,o(iL,"Style");var Rb=iL;g();var oL={opacity:1},Ns,Bb,Gb,bd,ef,Gm,sL,zH,aL=class aL{constructor(t,r){j(this,Gm);j(this,Ns);j(this,Bb,[]);j(this,Gb,{opacity:"initial"});j(this,bd,{opacity:new Map});j(this,ef,new Set);$(this,Ns,t),$(this,Bb,r||[]);let n=d(this,Ns).map;n&&n.on("idle",()=>{d(this,bd).opacity.size||Re(this,Gm,sL).call(this,n)})}setStyle(t){var r,n;if(d(this,Ns).map){(r=d(this,Ns).map)==null||r.setStyle(t),d(this,ef).size&&(d(this,ef).clear(),this.hide()),Re(this,Gm,zH).call(this),Re(this,Gm,sL).call(this,d(this,Ns).map),this.setOpacity(d(this,Gb).opacity),(n=d(this,Ns).map)==null||n.moveLayer(bw);for(let[i,a,u]of d(this,Bb)||[])d(this,Ns).hideOutdoorLayersIntersectingPolygons(i,a,u)}}get map(){return d(this,Ns).map}get enabled(){return!!d(this,Ns).map}get visible(){return d(this,ef).size===0}show(){let t=d(this,Ns).map;if(!t)return;let r=t.getStyle().layers;r&&(r.forEach(n=>{d(this,ef).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),d(this,ef).clear())}hide(t=[]){let r=d(this,Ns).map;if(!r)return;let n=r.getStyle().layers;n&&n.forEach(i=>{let a=r.getLayoutProperty(i.id,"visibility");!t.includes(i.id)&&a!=="none"&&(r.setLayoutProperty(i.id,"visibility","none"),d(this,ef).add(i.id))})}setOpacity(t,r=[]){var a,u,c;let n=d(this,Ns).map;if(!n)return;let i=(c=(u=(a=d(this,Ns).map)==null?void 0:a.getStyle)==null?void 0:u.call(a))==null?void 0:c.layers;i&&n.once("idle",()=>{i.forEach(f=>{let m=n.getLayoutProperty(f.id,"visibility");if(!r.includes(f.id)&&m!=="none")try{let v=d(this,bd).opacity.get(f.id);v!==void 0&&(f.id==="background"||(f.type==="symbol"?(n.setPaintProperty(f.id,"icon-opacity",t==="initial"?v[0]:t),n.setPaintProperty(f.id,"text-opacity",t==="initial"?v[1]:t)):n.setPaintProperty(f.id,"".concat(f.type,"-opacity"),t==="initial"?v[0]:t)),d(this,Gb).opacity=t)}catch(v){ae.warn("Error setting opacity:",v)}})})}};Ns=new WeakMap,Bb=new WeakMap,Gb=new WeakMap,bd=new WeakMap,ef=new WeakMap,Gm=new WeakSet,sL=o(function(t){let r=t.getStyle().layers;r&&r.forEach(n=>{var a,u,c;t.getLayoutProperty(n.id,"visibility")!=="none"&&(n.id==="background"||(n.type==="symbol"?d(this,bd).opacity.set(n.id,[(a=t.getPaintProperty(n.id,"icon-opacity"))!=null?a:oL.opacity,(u=t.getPaintProperty(n.id,"text-opacity"))!=null?u:oL.opacity]):d(this,bd).opacity.set(n.id,[(c=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?c:oL.opacity,void 0])))})},"#setInitialStyle"),zH=o(function(){Object.values(d(this,bd)).forEach(t=>t.clear())},"#clearInitialStyle"),o(aL,"Outdoor");var G0=aL;g();var tf,rf,Id,lL=class lL{constructor({currentMapGetter:t}){j(this,tf);j(this,rf,new Map);j(this,Id,new Map);$(this,tf,t)}labelAll(t={}){var i,a;let r=[],n=new Set;return(a=(i=d(this,tf).call(this))==null?void 0:i.Text3D.labelAll(t))==null||a.forEach(({textInfo:u,target:c})=>{let f=u.id.toString(),m=d(this,Id).get(f);if(m){n.has(f)||r.push(m.text3DView),n.add(f);return}n.add(f);let v=new md(f,c);d(this,rf).set(v.id,{targetId:c.id,text3d:f,text3DView:v}),d(this,Id).set(f,{text3DView:v}),r.push(v)}),r}label(t,r,n={}){var a;if(d(this,tf).call(this))if(Vo.is(t)){let u=(a=d(this,tf).call(this))==null?void 0:a.Text3D.label(t,r,n);if(!u)return;let c=u.textInfo.id.toString(),f=d(this,Id).get(c);if(f)return f.text3DView;let m=new md(c,u.target);return d(this,rf).set(m.id,{targetId:u.target.id,text3d:c,text3DView:m}),d(this,Id).set(c,{text3DView:m}),m}else throw new Error("Non-space target is not supported")}remove(t){var i;let r=typeof t=="string"?t:t.id,n=d(this,rf).get(r);n&&((i=d(this,tf).call(this))==null||i.Text3D.remove(n.text3d),d(this,rf).delete(r),d(this,Id).delete(n.text3d))}removeAll(){d(this,rf).forEach(t=>{var r;(r=d(this,tf).call(this))==null||r.Text3D.remove(t.text3d)}),d(this,rf).clear()}};tf=new WeakMap,rf=new WeakMap,Id=new WeakMap,o(lL,"Text3D");var U3=lL;g();g();g();function $H(e){try{let t=e.shape;if("type"in t){let r=t.type;if(r instanceof W.ZodOptional&&(r=r._def.innerType),"value"in r)return String(r.value);if(r instanceof W.ZodDefault&&"value"in r._def.innerType)return String(r._def.innerType.value)}return"unknown"}catch(t){return"unknown"}}o($H,"extractTypeFromSchema");function HH(e){if(e.success)return[];let t=e.error.flatten();return Object.keys(t.fieldErrors)}o(HH,"extractInvalidFields");function WH(e,t){e.length>0&&ae.warn("".concat(e.length," invalid field(s) in ").concat(t!=null?t:"unknown"," state: ").concat(e.join(", ")))}o(WH,"logInvalidFields");function vi(e,t,r){if(t==null||typeof t!="object")return{};let n=e.partial().safeParse(t);if(n.success)return n.data;let i=HH(n);r!=null&&r.warn&&WH(i,$H(e));let a={};for(let u of Object.keys(t))!i.includes(u)&&u in e.shape&&(a[u]=t[u]);return a}o(vi,"parsePartialState");function Zo(e,t,r){let n=e.safeParse(t);if(n.success)return n.data;if((r==null?void 0:r.warn)===!0){let i=HH(n);WH(i,$H(e))}return t}o(Zo,"parseCompleteState");var qH="doors",jm=He.object({type:He.literal(qH).default(qH),color:He.string().default("#ffffff"),topColor:He.string().optional(),texture:He.object({url:He.string().optional()}).optional(),topTexture:He.object({url:He.string().optional()}).optional(),visible:He.boolean().default(!1),opacity:He.number().default(1)}),x9t=jm.partial(),b9t=jm.strict();function YH(e){let{color:t,topColor:r,texture:n,topTexture:i,visible:a,opacity:u}=e;return Zo(jm,{visible:a,color:t,topColor:r,opacity:u,texture:n?{url:n}:void 0,topTexture:i?{url:i}:void 0})}o(YH,"getDoorsState");function V3(e,t){var n,i;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((i=e.topTexture)==null?void 0:i.url)!==void 0&&(r.topTexture=e.topTexture.url),e.opacity!==void 0&&(r.opacity=e.opacity)),r}o(V3,"translateDoorsStateToGeojsonCore");g();var XH="facade",jb=W.object({type:W.literal(XH).default(XH),opacity:W.number().default(1),visible:W.boolean().default(!0)}),P9t=jb.partial(),T9t=jb.strict();function ZH(e){return Zo(jb,{opacity:e.opacity,visible:e.visible})}o(ZH,"getFacadeState");g();var nf="floor",KH="".concat(nf,".footprint"),JH="".concat(nf,".geometry"),QH="".concat(nf,".labels"),eW="".concat(nf,".markers"),tW="".concat(nf,".images"),rW="".concat(nf,".occlusion"),nW="".concat(nf,".paths"),Ub=W.object({type:W.literal(KH).default(KH),altitude:W.number().default(0),visible:W.boolean().default(!1),height:W.number().default(0),opacity:W.number().default(1),side:W.enum(["double","front","back"]),color:W.string().default("#ffffff")}),Vb=W.object({type:W.literal(JH).default(JH),opacity:W.number().default(1),visible:W.boolean().default(!0)}),zb=W.object({type:W.literal(QH).default(QH),enabled:W.boolean().default(!0)}),$b=W.object({type:W.literal(eW).default(eW),enabled:W.boolean().default(!0)}),Hb=W.object({type:W.literal(tW).default(tW),visible:W.boolean().default(!0)}),Wb=W.object({type:W.literal(rW).default(rW),enabled:W.boolean().default(!0)}),qb=W.object({type:W.literal(nW).default(nW),visible:W.boolean().default(!0)}),Yb=W.object({type:W.literal(nf).default(nf),visible:W.boolean().default(!1),altitude:W.number().default(0)}),W1e=W.object(Ie(Y({},Yb.shape),{geometry:Vb,labels:zb,markers:$b,images:Hb,footprint:Ub,occlusion:Wb,paths:qb})),N9t=W.object(Ie(Y({},Yb.shape),{geometry:Vb.partial(),labels:zb.partial(),markers:$b.partial(),images:Hb.partial(),footprint:Ub.partial(),occlusion:Wb.partial(),paths:qb.partial()})).partial(),R9t=W.object(Ie(Y({},Yb.shape),{geometry:Vb.strict(),labels:zb.strict(),markers:$b.strict(),images:Hb.strict(),footprint:Ub.strict(),occlusion:Wb.strict(),paths:qb.strict()}));function iW(e,t,r){if(!t){ae.error("Floor is not defined. Cannot get floor state.");return}let n=t.layers.get(Fi),i=n?r==null?void 0:r.getState(n.containerId):void 0,a=t.layers.get(nc),u=t.layers.get(au),c=t.layers.get(Xg),f=c?r==null?void 0:r.getState(c.containerId):void 0,m=t.layers.get(kf),v=m?r==null?void 0:r.getState(m.containerId):void 0,x=t.layers.get(Zg),I=x?r==null?void 0:r.getState(x.containerId):void 0,C=t.layers.get(ic),T=C?r==null?void 0:r.getState(C.containerId):void 0;return Zo(W1e,{geometry:{opacity:i==null?void 0:i.opacity,visible:i==null?void 0:i.visible},labels:{enabled:a==null?void 0:a.visible},markers:{enabled:u==null?void 0:u.visible},footprint:{altitude:f==null?void 0:f.altitude,visible:f==null?void 0:f.visible,height:f==null?void 0:f.height,opacity:f==null?void 0:f.opacity,side:f==null?void 0:f.side,color:f==null?void 0:f.color},images:{visible:I==null?void 0:I.visible},occlusion:{enabled:v==null?void 0:v.visible},paths:{visible:T==null?void 0:T.visible},visible:e.visible,altitude:e.altitude})}o(iW,"getFloorState");g();var oW="geometry",Xb=W.object({type:W.literal(oW).default(oW),visible:W.boolean().default(!0),color:W.union([W.string(),W.literal("initial")]).default("#ffffff"),topColor:W.union([W.string(),W.literal("initial")]).optional(),hoverColor:W.union([W.string(),W.literal("initial")]).optional(),interactive:W.boolean().default(!1),opacity:W.number().default(1),height:W.number().default(0),altitude:W.number().default(0),texture:W.object({url:W.string()}).optional(),topTexture:W.object({url:W.string()}).optional(),flipImageToFaceCamera:W.boolean().default(!1)}),V9t=Xb.partial(),z9t=Xb.strict();function sW(e,t){let r=t!=null&&t.altitude?e.altitude+t.altitude:e.altitude,{interactive:n,hoverColor:i,color:a,visible:u,opacity:c,height:f,texture:m,topTexture:v,flipImageToFaceCamera:x,topColor:I}=e;return Zo(Xb,{interactive:n,hoverColor:i,color:a,visible:u,opacity:c,height:f,texture:m?{url:e.texture}:void 0,topTexture:v?{url:v}:void 0,flipImageToFaceCamera:x,topColor:I,altitude:r})}o(sW,"getGeometryState");function aW(e,t,r){var i,a,u;let n={};return t==null||(e.color&&(e.color==="initial"?n.color=t.initialColor:n.color=e.color),e.topColor&&(e.topColor==="initial"?n.topColor=t.initialTopColor:n.topColor=e.topColor),e.visible!==void 0&&(n.visible=e.visible),((i=e.texture)==null?void 0:i.url)!==void 0&&(n.texture=e.texture.url),((a=e.topTexture)==null?void 0:a.url)!==void 0&&(n.topTexture=e.topTexture.url),e.hoverColor!==void 0&&(n.hoverColor=e.hoverColor),e.interactive!==void 0&&(n.interactive=e.interactive),e.height!==void 0&&(n.height=e.height),e.opacity!==void 0&&(n.opacity=e.opacity),e.flipImageToFaceCamera!==void 0&&(n.flipImageToFaceCamera=e.flipImageToFaceCamera),e.altitude!==void 0&&(n.altitude=e.altitude-((u=r==null?void 0:r.altitude)!=null?u:0))),n}o(aW,"translateGeometryStateToGeojsonCore");g();var uL="label",cL=He.object({type:He.literal(uL).default(uL),text:He.string(),rank:He.custom(e=>qy.safeParse(e).success||e==="initial"),appearance:He.custom(e=>uC.safeParse(e).success).optional(),interactive:He.boolean().default(!1),enabled:He.boolean().default(!0)}),Z9t=cL.partial();function lW(e){var i,a;let{text:t,enabled:r,options:n}=e;return{type:uL,text:t!=null?t:"",appearance:n!=null&&n.appearance?cC(n.appearance):void 0,rank:(i=n==null?void 0:n.rank)!=null?i:"medium",enabled:r!=null?r:!0,interactive:(a=n==null?void 0:n.interactive)!=null?a:!1}}o(lW,"getLabelState");function uW(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.text&&(r.text=e.text),e.appearance&&(r.options.appearance=e.appearance),e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!==void 0&&(r.enabled=e.enabled),e.interactive!==void 0&&(r.options.interactive=e.interactive),e.enabled!==void 0&&(r.enabled=e.enabled),r}o(uW,"translateLabelStateToGeojsonCore");g();var pL="marker",cW=new Set(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),fL=He.object({type:He.literal(pL).default(pL),rank:He.custom(e=>qy.safeParse(e).success||e==="initial"),placement:He.custom(e=>typeof e=="string"?cW.has(e):Array.isArray(e)?e.every(t=>typeof t=="string"&&cW.has(t)):!1).optional(),interactive:He.union([He.boolean(),He.literal("pointer-events-auto")]).default(!1),dynamicResize:He.boolean().default(!0),enabled:He.boolean().default(!0),zIndex:He.number().optional(),lowPriorityPin:He.object({enabled:He.boolean().optional(),size:He.number().positive().optional(),color:He.string().optional()}).optional(),element:He.custom(e=>e instanceof HTMLElement,{message:"Must be an HTMLElement instance"}),contentHTML:He.string()}),nFt=fL.omit({element:!0}).partial();function pW(e,t){var I,C,T,O;let r=t!=null&&t.target?t.target.anchorTarget:void 0,{enabled:n,placement:i,element:a,dynamicResize:u,contentHTML:c,options:f,position:m,parent:v}=e,x=typeof v=="object"?v.id:v;return r==null&&(r=new bt({latitude:(I=m==null?void 0:m[1])!=null?I:0,longitude:(C=m==null?void 0:m[0])!=null?C:0,floorId:x==null?void 0:x.toString()})),{type:pL,rank:(T=f==null?void 0:f.rank)!=null?T:"medium",interactive:(O=f==null?void 0:f.interactive)!=null?O:!1,enabled:n!=null?n:!0,element:a,placement:i!=null?i:[],zIndex:f==null?void 0:f.zIndex,dynamicResize:u!=null?u:!0,lowPriorityPin:f==null?void 0:f.lowPriorityPin,contentHTML:c!=null?c:""}}o(pW,"getMarkerState");function fW(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!=null&&(r.enabled=e.enabled),e.interactive!=null&&(r.options.interactive=e.interactive),e.enabled!==null&&(r.enabled=e.enabled),e.contentHTML!==void 0&&(r.contentHTML=e.contentHTML),r}o(fW,"translateMarkerStateToGeojsonCore");g();var dW="path",z3={color:"#4b90e2",width:1,completeFraction:0,visible:!0,altitude:0},j0=He.object({type:He.literal(dW).default(dW),color:He.string().default(z3.color),width:He.union([He.number(),He.any()]),completeFraction:He.number().default(z3.completeFraction),visible:He.boolean().default(z3.visible),altitude:He.number().default(z3.altitude)}),uFt=j0.partial(),cFt=j0.strict();function hW(e){let{color:t,visible:r,width:n,altitude:i,completeFraction:a}=e;return Zo(j0,{color:t,visible:r,width:n,altitude:i,completeFraction:a})}o(hW,"getPathState");g();var mW="shape",Zb=W.object({type:W.literal(mW).default(mW),visible:W.boolean().default(!0),altitude:W.number().default(0),color:W.string().default("#ffffff"),height:W.number().default(0),opacity:W.number().default(1),interactive:W.boolean().default(!1)}),yFt=Zb.partial(),vFt=Zb.strict();function gW(e){let{altitude:t,visible:r,color:n,opacity:i,interactive:a,children:u}=e,[c]=u!=null?u:[];if((c==null?void 0:c.type)!=="geometry"){ae.error("Expected first child of Shape to be a geometry. Cannot get shape state.");return}return Zo(Zb,{altitude:t,visible:r,color:n,height:c==null?void 0:c.height,opacity:i,interactive:a})}o(gW,"getShapeState");g();var yW="text3d",vW=He.object({type:He.literal(yW).default(yW),position:He.custom(e=>e instanceof bt,{message:"Must be a Coordinate instance"})}),xW=H5.extend(Y({},vW.shape)),bW=fC.extend(Y({},vW.shape)).partial(),PFt=xW.strict();function IW(e){var A,M;let{position:t,visible:r,color:n,flipToFaceCamera:i,font:a,fontSize:u,outlineColor:c,outlineOpacity:f,outlineBlur:m,outlineWidth:v,outlineOffsetX:x,outlineOffsetY:I,strokeWidth:C,strokeOpacity:T,strokeColor:O,fillOpacity:P,hoverColor:L}=e;return Zo(xW,{position:new bt({latitude:(A=t==null?void 0:t[1])!=null?A:0,longitude:(M=t==null?void 0:t[0])!=null?M:0}),visible:r,color:n,flipToFaceCamera:i,font:a,fontSize:u,outlineColor:c,outlineOpacity:f,outlineBlur:m,outlineWidth:v,outlineOffsetX:x,outlineOffsetY:I,strokeWidth:C,strokeOpacity:T,strokeColor:O,fillOpacity:P,hoverColor:L})}o(IW,"getText3DState");g();var SW="walls",U0=He.object({type:He.literal(SW).default(SW),color:He.string().default("#ffffff"),topColor:He.string().optional(),texture:He.object({url:He.string()}).or(He.undefined()),topTexture:He.object({url:He.string()}).or(He.undefined()),visible:He.boolean().default(!0),height:He.number().default(0),opacity:He.number().default(1)}),DFt=U0.partial(),AFt=U0.strict();function _W(e){let{color:t,topColor:r,texture:n,topTexture:i,visible:a,height:u,opacity:c}=e;return Zo(U0,{visible:a,color:t,topColor:r,texture:n?{url:n}:void 0,topTexture:i?{url:i}:void 0,height:u,opacity:c})}o(_W,"getWallsState");function dL(e,t){var n,i;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((i=e.topTexture)==null?void 0:i.url)!==void 0&&(r.topTexture=e.topTexture.url),e.height!==void 0&&(r.height=e.height),e.opacity!==void 0&&(r.opacity=e.opacity)),r}o(dL,"translateWallsStateToGeojsonCore");g();var hL="image",mL=W.object({type:W.literal(hL).default(hL),visible:W.boolean().default(!0),opacity:W.number().min(0).max(1).default(1),position:W.custom(e=>e instanceof bt,{message:"Must be a Coordinate instance"}),width:W.number().default(1),height:W.number().default(1),rotation:W.number().default(0),verticalOffset:W.number().default(0),flipImagesToFaceCamera:W.boolean().default(!1)}),GFt=mL.partial();function CW(e){var r,n,i,a,u,c,f,m,v;let{position:t}=e;return{type:hL,visible:(r=e.visible)!=null?r:!0,opacity:(n=e.opacity)!=null?n:1,position:new bt({latitude:(i=t==null?void 0:t[1])!=null?i:0,longitude:(a=t==null?void 0:t[0])!=null?a:0,verticalOffset:t==null?void 0:t[2]}),width:(u=e.width)!=null?u:1,height:(c=e.height)!=null?c:1,rotation:(f=e.rotation)!=null?f:0,verticalOffset:(m=e.verticalOffset)!=null?m:0,flipImagesToFaceCamera:(v=e.flipImageToFaceCamera)!=null?v:!1}}o(CW,"getImageState");g();var wW="model",gL=lO.extend({type:W.literal(wW).default(wW),color:W.string().optional(),position:W.custom(e=>e instanceof bt,{message:"Must be a Coordinate instance"}),visible:W.boolean().default(!0),rotation:W.tuple([W.number(),W.number(),W.number()]).default([0,0,0]),scale:W.tuple([W.number(),W.number(),W.number()]).default([1,1,1]),verticalOffset:W.number().default(0),opacity:W.number().default(1),material:W.record(W.string(),uO).optional(),interactive:W.boolean().default(!1)}),PW=gL.extend({scale:W.union([W.number(),W.tuple([W.number(),W.number(),W.number()])]),rotation:W.union([W.number(),W.tuple([W.number(),W.number(),W.number()])])}).partial(),qFt=gL.strict();function TW(e){var I,C,T;let{color:t,position:r,rotation:n,scale:i,visible:a,interactive:u,opacity:c,material:f,verticalOffset:m,parent:v}=e,x=typeof v=="object"?(I=v==null?void 0:v.id)==null?void 0:I.toString():v==null?void 0:v.toString();return Zo(gL,{color:t,position:new bt({latitude:(C=r==null?void 0:r[1])!=null?C:0,longitude:(T=r==null?void 0:r[0])!=null?T:0,verticalOffset:r==null?void 0:r[2],floorId:x}),rotation:n,scale:i,visible:a,interactive:u,opacity:c,material:f,verticalOffset:m})}o(TW,"getModelState");var $3=.05,Jb,Qb,yL=class yL extends Rt{constructor(r,n,i){super();b(this,"core");b(this,"mapObjects",[]);b(this,"id");b(this,"mapDataExternal",{});b(this,"mapsByFloorId",{});b(this,"mapData");b(this,"currentMap");b(this,"hiddenOutdoorGeometries",[]);b(this,"lastFacadeIntersected");j(this,Jb,!1);j(this,Qb,!1);b(this,"mapView");b(this,"externalPubSub");b(this,"Camera");b(this,"Labels");b(this,"Text3D");b(this,"Markers");b(this,"Models");b(this,"Paths");b(this,"Exporter");b(this,"Navigation");b(this,"Outdoor");b(this,"BlueDot");b(this,"Shapes");b(this,"Style");b(this,"Images");b(this,"update",o(()=>{this.core.render()},"update"));this.core=r,this.mapView=n,this.externalPubSub=i,this.Camera=new cb(this),this.id=this.core.addGroupContainer("root").id.toString();let a=new yb("outdoors-container",void 0,void 0,this);this.mapObjects.push(a),this.currentMap=a,this.core.on("pre-render",()=>{i.publish("pre-render")}),this.core.on("post-render",()=>{i.publish("post-render")}),this.core.on("resize",()=>{i.publish("resize")}),this.core.on("render-error",({error:x})=>{i.publish("render-error",{error:new x7(x instanceof Error?x.message:"Unknown error")})});let u=o(x=>{let I=this.getMapDataObject(x);switch(I==null?void 0:I.__type){case"facade":return I;case"floor":return I.floorStack.facade;default:return null}},"getFacadeFromEntityId");this.core.on("geometry-in-focus",x=>{let I=new Set;for(let C of x){let T=u(C);T&&I.add(T)}i.publish("facades-in-view-change",{facades:Array.from(I)})}),this.core.getSystems().renderSystem.on("camera-state-change",()=>{i.publish("state-change-internal",{Camera:this.getCameraState()})});let c=new ob(this.Camera,{precision:7});this.core.on("camera-change",()=>{i.publish("camera-change",c)});let f=o(x=>I=>{let C=[],T=[],O=[],P=[];I.labels.forEach(X=>{let ie=this.Labels.getById(X.toString());ie&&C.push(ie.label)}),I.markers.forEach(X=>{let ie=this.Markers.getById(X.toString())||this.Navigation.getMarkerById(X.toString());ie&&T.push(ie.marker)}),I.models.forEach(X=>{let ie=this.Models.getById(X.toString());ie&&O.push(ie.model)}),I.paths.forEach(X=>{let ie=this.Paths.getById(X.toString())||this.Navigation.getPathById(X.toString());ie&&P.push(ie.path)});let L=I.geometry.includes(Pb),A=I.geometry.filter(X=>X!==Pb),M;A.length>0&&(M=A.map(X=>{var ie;return(ie=this.getMapDataInternal())==null?void 0:ie.getById("space",X)}).filter(Boolean)[0],M||(M=A.map(X=>{var ie;return(ie=this.getMapDataInternal())==null?void 0:ie.getById("object",X)}).filter(Boolean)[0]),M||(M=A.map(X=>this.Shapes.getById(X)).filter(Boolean)[0]));let N=I.containers.reduce((X,ie)=>{var U;let Q=(U=this.getMapDataInternal())==null?void 0:U.getById("floor",ie);return Q&&fa.is(Q)&&X.push(Q),X},[]),B,H=0;if(N.length>0){B=N[0].id;let X=this.core.getState(B);H=I.coordinate[2]?I.coordinate[2]-X.altitude:H}let z;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(X=>{this.core.setState(X.id,{hovered:!1})}),M&&Vo.is(M)&&(z=A.map(X=>{var ie;return(ie=this.getMapDataInternal())==null?void 0:ie.facadesBySpaceId[X]}).filter(Boolean)[0],z&&z.spaces.forEach(X=>{this.core.setState(X.id,{hovered:!0})})),this.lastFacadeIntersected=z;let R={coordinate:new bt({latitude:I.coordinate[1],longitude:I.coordinate[0],floorId:B,verticalOffset:H}),spaces:M&&Vo.is(M)?[M]:[],objects:M&&Ra.is(M)?[M]:[],shapes:M&&$p.is(M)?[M]:[],markers:T,labels:C,models:O,paths:P,floors:N,facades:z?[z]:[]};"pointerEvent"in I&&(R.pointerEvent=I.pointerEvent),L&&(x==="click"?this.BlueDot.publish("click",{coordinate:new bt({longitude:I.coordinate[0],latitude:I.coordinate[1]})}):x==="hover"&&this.BlueDot.publish("hover")),i.publish(x,R)},"createHandler");this.core.on("hover",f("hover")),this.core.on("click",f("click")),this.core.on("user-interaction-start",()=>{i.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{i.publish("user-interaction-end")});let m={currentMapGetter:o(()=>this.currentMap,"currentMapGetter")};this.Markers=new vb(m),this.Models=new Sb(m),this.Labels=new db(m),this.Text3D=new U3(m),this.Exporter=new fb(m),this.Paths=new Cb(m),this.Navigation=new lb(this.core,this,m.currentMapGetter),this.on("navigation-state-change",x=>{this.externalPubSub.publish("state-change-internal",{Navigation:x})}),this.on("navigation-connection-click",x=>{this.externalPubSub.publish("navigation-connection-click",x)}),this.on("navigation-active-path-change",x=>{this.externalPubSub.publish("navigation-active-path-change",x)}),this.BlueDot=new B0(this.core,this),this.BlueDot.on("blue-dot-position-update",()=>{this._publishBlueDotState({coordinate:this.BlueDot.coordinate,heading:this.BlueDot.heading,accuracy:this.BlueDot.accuracy,floor:this.BlueDot.floor})}),this.BlueDot.on("blue-dot-state-change",()=>{this._publishBlueDotState({state:this.BlueDot.state})}),this.BlueDot.on("blue-dot-follow-change",()=>{this._publishBlueDotState({following:this.BlueDot.following})}),this.Outdoor=new G0(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{i.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{i.publish("outdoor-style-loaded")})),this.Images=new bb(m),this.Shapes=new Fb(m),this.Style=new Rb(m);let v=new O3(n,this.mapDataExternal);this.__EXPERIMENTAL__auto=v.auto}get manualFloorVisibility(){return d(this,Jb)}set manualFloorVisibility(r){$(this,Jb,r),this.externalPubSub.publish("state-change-internal",{manualFloorVisibility:r})}get hidePathsNotOnCurrentFloor(){return d(this,Qb)}set hidePathsNotOnCurrentFloor(r){var n;$(this,Qb,r),(n=this.currentMap)==null||n.updatePathLayersVisibility()}preloadFloors(r){r.forEach(n=>{n instanceof fa&&this.core.setState(n.id,{preloadGeometry:!0})})}updateState(r,n){if(n==null||typeof n!="object")return;if(r==="interior-walls"){this.currentMap.floors.forEach(u=>{let c=u.layers.get(Fi);if(c){let f=c.layers.get(Rf);f&&this.core.hasState(f)&&this.core.setState(f,dL(vi(U0,n,{warn:!0}),this.core.getState(f)))}});return}if(r==="exterior-walls"){this.currentMap.floors.forEach(u=>{let c=u.layers.get(Fi);if(c){let f=c.layers.get(rc);f&&this.core.hasState(f)&&this.core.setState(f,dL(vi(U0,n,{warn:!0}),this.core.getState(f)))}});return}if(r==="interior-doors"){this.currentMap.floors.forEach(u=>{let c=u.layers.get(Fi);if(c){let f=c.layers.get(qg);f&&this.core.hasState(f)&&this.core.setState(f,V3(vi(jm,n,{warn:!0}),this.core.getState(f)))}});return}if(r==="exterior-doors"){this.currentMap.floors.forEach(u=>{let c=u.layers.get(Fi);if(c){let f=c.layers.get(Yg);f&&this.core.hasState(f)&&this.core.setState(f,V3(vi(jm,n,{warn:!0}),this.core.getState(f)))}});return}let i=typeof r=="string"?this.getMapDataObject(r):r;if(i){if(i.__type!==Al.__type&&!this.core.hasState(i.id)){ae.warn('Failed to update state for "'.concat(i.id,'". No ').concat(i.__type," found with that ID."));return}if(dd.is(i))return this.core.setState(i.id,uW(vi(cL,n,{warn:!0}),this.core.getState(i.id)));if(zp.is(i))return this.core.setState(i.id,fW(vi(fL,n,{warn:!0}),this.core.getState(i.id)));if(Vo.is(i)||Ra.is(i)){let u=this.core.getState(i.id);if(u!=null){let c=u.parent&&u.parent.type==="geometry-group"?this.core.getState(u.parent):void 0;this.core.setState(i.id,aW(vi(Xb,n,{warn:!0}),u,c))}}if(Pm.is(i)&&this.core.setState(i.id,vi(mL,n,{warn:!0})),tc.is(i)&&this.core.setState(i.id,V3(vi(jm,n,{warn:!0}),this.core.getState(i.id))),$p.is(i)&&this.core.setState(i.id,vi(Zb,n,{warn:!0})),Mm.is(i)){let a=vi(PW,n,{warn:!0}),{position:u,scale:c,rotation:f}=a,v=is(a,["position","scale","rotation"]);u&&(v.position=[u.longitude,u.latitude,u.verticalOffset]),c!=null&&(Array.isArray(c)?v.scale=c:v.scale=[c,c,c]),f!=null&&(Array.isArray(f)?v.rotation=f:v.rotation=[f,f,f]),u&&i.updateTarget(u),this.core.setState(i.id,v)}if(fa.is(i)){let u=this.currentMap.floorsById.get(i.id);if(u==null)return;let c=vi(Yb,n,{warn:!0});this.core.setState(i.id,c);let f=u.layers.get(Fi);f!=null&&"geometry"in n&&n.geometry&&this.core.setState(f.containerId,vi(Vb,n.geometry,{warn:!0}));let m=u.layers.get(nc);if(m!=null&&"labels"in n&&n.labels){let O=vi(zb,n.labels,{warn:!0});"enabled"in O&&typeof O.enabled=="boolean"&&m.setVisible(O.enabled)}let v=u.layers.get(au);if(v!=null&&"markers"in n&&n.markers){let O=vi($b,n.markers,{warn:!0});"enabled"in O&&typeof O.enabled=="boolean"&&v.setVisible(O.enabled)}let x=u.layers.get(Xg);x!=null&&"footprint"in n&&n.footprint&&this.core.setState(x.containerId,vi(Ub,n.footprint,{warn:!0}));let I=u.layers.get(kf);if(I!=null&&"occlusion"in n&&n.occlusion){let O=vi(Wb,n.occlusion,{warn:!0});"enabled"in O&&typeof O.enabled=="boolean"&&I.setVisible(O.enabled)}let C=u.layers.get(Zg);if(C!=null&&"images"in n&&n.images){let O=vi(Hb,n.images,{warn:!0});"visible"in O&&typeof O.visible=="boolean"&&C.setVisible(O.visible)}let T=u.layers.get(ic);if(T!=null&&"paths"in n&&n.paths!=null){let O=vi(qb,n.paths,{warn:!0});O.visible!=null&&typeof O.visible=="boolean"&&T.setVisible(O.visible)}}if(su.is(i)){let u=this.core.getState(i.id);for(let c of u.children)c.type==="group-container"&&this.core.setState(c.id,vi(jb,n,{warn:!0}))}if(md.is(i)&&this.core.setState(i.id,vi(bW,n,{warn:!0})),Al.is(i))for(let u of i.segments)this.core.setState(u.id,vi(j0,n,{warn:!0}));T0.is(i)&&this.core.setState(i.id,vi(j0,n,{warn:!0}))}}getMapDataObject(r){var n;return(n=this.getMapDataInternal())==null?void 0:n.getMapDataById(r)}getMapDataInternal(){if(this.mapData)return Jv(this.mapData)}getMapData(){return this.mapData}addMap(r,n){return new Promise(i=>{var I,C,T,O;let a;try{a=Jv(r)}catch(P){ae.error("Error adding map",P),i(r);return}this.mapDataExternal[r.mapName]=r,this.mapData=r;let{mvf:u}=a,c=u["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new bt(c[1],c[0])});let f=u["manifest.geojson"].features[0].properties.name,m=new yb("mapObject-".concat(f),a,n,this);this.currentMap=m,this.currentMap.loadAllFloors(),this.currentMap.setFloor(this.currentMap.startingFloorId);let v=this.core.getBoundingArea(m.currentFloor.id);v==null&&ae.error("Could not determine bounding box for map:",m.currentFloor.id);let x=(C=(I=n==null?void 0:n.outdoorView)==null?void 0:I.layersHiddenByGeometry)!=null?C:[];if(x.length>0){let P,L=[];for(let A of m.floorStacksById.values())if(A.defaultFloor.footprint&&A.defaultFloor.footprint.geometry!=null&&((T=A.defaultFloor.footprint.geometry)==null?void 0:T.coordinates.length)>0){let M=A.defaultFloor.footprint,N=A3(M);P==null?P=N:LW(P,N),L.push(M)}L.length>0&&P!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(P,L,x),this.hiddenOutdoorGeometries.push([P,L,x]))}if(this.mapObjects.push(m),a.getMVFFeatureByType("floor").forEach(P=>{this.mapsByFloorId[P.id]=m}),m.on("floor-change-start",P=>{var L,A,M,N;this.externalPubSub.publish("floor-change-start",{reason:P.reason,floor:(A=(L=this.getMapDataInternal())==null?void 0:L.getById("floor",P.floorId))!=null?A:this.currentFloor,previousFloor:(N=(M=this.getMapDataInternal())==null?void 0:M.getById("floor",P.previousFloorId))!=null?N:this.currentFloor})}),m.on("floor-change",P=>{var L,A;this.externalPubSub.publish("floor-change",{reason:P.reason,floor:this.currentFloor,previousFloor:(A=(L=this.getMapDataInternal())==null?void 0:L.getById("floor",P.previousFloorId))!=null?A:this.currentFloor}),this.externalPubSub.publish("state-change-internal",{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack})}),(n==null?void 0:n.zoomLevel)!=null)this.core.camera.setZoomLevel(n.zoomLevel),i(r);else if(this.core.mode!=="outdoors-overlay"&&v){let P=(O=n==null?void 0:n.screenOffsets)!=null?O:{top:$3*this.core.canvasHeight,left:$3*this.core.canvasWidth,right:$3*this.core.canvasWidth,bottom:$3*this.core.canvasHeight};this.core.camera.focusOn(v,{duration:hN,padding:P}).then(()=>{this.Camera.setElevation(this.currentFloor.elevation),i(r)})}else i(r)})}setFloor(r,n){return this.currentMap.setFloor(Y1(r),n)}setFloorStack(r,n){return this.currentMap.setFloorStack(Y1(r),n)}updateWatermark(r){this.core.updateWatermark(r)}get currentFloorStack(){var i;let r=this.currentMap.currentFloorStack.id;if(!r)throw new Ro("Missing currentFloorStack.");let n=(i=this.mapData)==null?void 0:i.getById("floor-stack",r);if(!n)throw new Ro("FloorStack was not found in map data.");return n}get currentFloor(){var i;let r=this.currentMap.currentFloor.id;if(!r)throw new Ro("Missing currentFloor object from GeoJsonApi");let n=(i=this.mapData)==null?void 0:i.getById("floor",r);if(!n)throw new Ro("Missing currentFloor");return n}getState(r){var a,u;typeof r=="object"&&Al.is(r)&&ae.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let n=OW(r,this),i=this.core.getState(n);if(i){if(["interior-walls","exterior-walls"].includes(r)&&i.type==="geometry-group")return _W(i);if(["interior-doors","exterior-doors"].includes(r)&&i.type==="geometry-group")return YH(i);if(i.type==="geometry"){let c;return"parent"in i&&i.parent&&i.parent.type==="geometry-group"&&(c=this.core.getState(i.parent)),sW(i,c)}else{if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return lW(i);if(i.type==="marker"&&((a=i.options)==null?void 0:a.rank)!==void 0&&i.options.interactive!==void 0)return pW(i,(u=this.Markers.getById(i.id.toString()))==null?void 0:u.marker);if(i.type==="model")return TW(i);if(i.type==="image")return CW(i);if(i.type==="text3d")return IW(i);if(i.type==="geometry-group"&&r&&typeof r!="string"&&$p.is(r))return gW(i);if(i.type==="path")return hW(i);if(i.type==="group-container"&&typeof r!="string"&&fa.is(r))return iW(i,this.currentMap.floorsById.get(r.id),this.core);if(i.type==="group-container"&&i.children.length>0&&typeof r!="string"&&su.is(r)){let c=this.core.getState(i.children[0].id);return ZH(c)}}}}setHoverColor(r){this.core.setState({hoverColor:r})}getHoverColor(){let r=this.core.getState();return(r==null?void 0:r.type)==="map-view"?r.hoverColor:void 0}createCoordinateFromScreenCoordinate(r,n,i){var m;if(i!=null){let v=this.core.projectScreenXYToCoordinate(r,n,!0);return v?new bt(v.coordinate[1],v.coordinate[0],i.id):void 0}let a=this.core.projectScreenXYToCoordinate(r,n);if(a==null||a.coordinate==null)return;let{coordinate:u,groupContainers:c}=a,f=(m=c==null?void 0:c.find(v=>{let x=v.userData.entityId.toString();return x.includes("f_")||x.includes("m_")}))==null?void 0:m.userData.entityId.toString();return new bt(u[1],u[0],f)}getScreenCoordinateFromCoordinate(r){var i,a,u;let n=0;if(r.floorId!=null){let c=(i=this.mapData)==null?void 0:i.getById("floor",r.floorId);c!=null&&(n=(u=(a=this.getState(c))==null?void 0:a.altitude)!=null?u:0)}return this.core.projectCoordinateToScreenXY([r.longitude,r.latitude,n])}isInView(r){return this.core.isInView(typeof r=="string"?r:r.id)}__EXPERIMENTAL__auto(){return{labels:this.Labels.__EXPERIMENTAL__all()}}tween(r){let n=new Su(r);return this.core.getExternalTweenGroup().add(n),this.core.render(),n}removeTween(r){this.core.getExternalTweenGroup().remove(r)}tweenGroup(){return this.core.getExternalTweenGroup()}get __core(){return this.core}getCameraState(){return this.core.camera.getState()}getNavigationState(){return{isMultiFloor:this.Navigation.isMultiFloor,floorStacks:this.Navigation.floorStacks,floors:this.Navigation.floors,activeDirections:this.Navigation.activeDirections,activePath:this.Navigation.activePath,paths:this.Navigation.paths}}getAllState(){return{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack,Camera:this.getCameraState(),Navigation:this.getNavigationState(),manualFloorVisibility:this.manualFloorVisibility}}publishAllState(){this.externalPubSub.publish("state-change-internal",this.getAllState())}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}_publishBlueDotState(r){let n;if(r)n=r;else{let{state:i,following:a,heading:u,accuracy:c,coordinate:f,floor:m}=this.BlueDot;n={state:i,following:a,heading:u,accuracy:c,coordinate:f,floor:m}}this.externalPubSub.publish("state-change-internal",{BlueDot:n})}getOptimalVisualDistanceBetweenFloors(r,n=!1){let i=this.currentMap;if(!i){ae.error("Cannot compute optimal visual distance between floors. Missing current map.");return}if(r.length<2){ae.warn("Cannot compute optimal visual distance between floors. Must provide at least 2 floors.");return}let a=i.renderer.getInternalState().geometry3DMap.get(r[0].id),u=i.renderer.getInternalState().geometry3DMap.get(r[1].id);if(!a||!u){ae.warn("Cannot compute optimal visual distance between floors. Floors not found in current map.");return}if(cg(a,"group-container"),cg(u,"group-container"),n){let f=new ro;f.setFromObject(a);let m=new ro;if(m.setFromObject(u),a.children.forEach(P=>{P instanceof Vt&&P.userData.debugBox&&gi(P)}),u.children.forEach(P=>{P instanceof Vt&&P.userData.debugBox&&gi(P)}),!Gd(f)||!Gd(m))return;let v=new Kl(f.max.x-f.min.x,f.max.y-f.min.y,f.max.z-f.min.z),x=new po({color:255,transparent:!0,opacity:.5}),I=new Vt(v,x);I.position.set((f.min.x+f.max.x)/2,(f.min.y+f.max.y)/2,(f.min.z+f.max.z)/2),I.userData.debugBox=!0;let C=new Kl(m.max.x-m.min.x,m.max.y-m.min.y,m.max.z-m.min.z),T=new po({color:"cyan",transparent:!0,opacity:.5}),O=new Vt(C,T);O.position.set((m.min.x+m.max.x)/2,(m.min.y+m.max.y)/2,(m.min.z+m.max.z)/2),O.userData.debugBox=!0,a.add(I),u.add(O)}let c=i.renderer.computeMinZOffsetBetweenContainers(a,u);if(c!==-1)return c}};Jb=new WeakMap,Qb=new WeakMap,o(yL,"GeoJsonApi");var Kb=yL;g();var vL=class vL{constructor(t){b(this,"state");b(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};o(vL,"Debug");var H3=vL;g();var DW=He.object({environment:He.union([He.literal("basic"),He.literal(!1)]).optional(),text3d:He.object({hoverColor:He.string().optional()}).optional(),geometry:He.object({hoverColor:He.string().optional()}).optional(),backgroundColor:He.string().optional(),backgroundAlpha:He.number().optional()}).strict();g();var xL=Mn(I5(),1);var q1e=o((e,t)=>{let r={},n=o((i,a,u)=>{for(let c in a){let f=i[c],m=a[c];typeof m=="object"&&!Array.isArray(m)&&m!==null&&typeof f=="object"&&!Array.isArray(f)&&f!==null?(u[c]={},n(f,m,u[c])):u[c]=f}},"processObject");return n(e,t,r),r},"extractProperties"),AW=o((e,t)=>{let r=q1e(e,t),n=(0,xL.default)({},r,t),i=(0,xL.default)({},r),a=o((u,c,f,m=i)=>{for(let v in c){let x=u[v],I=c[v];if(typeof I=="number"&&typeof x=="number")m[v]=x+(I-x)*f;else if(typeof I=="string"&&typeof x=="string"){if(g1(x)&&g1(I)){let C=vw(x),T=vw(I);C&&T?m[v]=U7([C[0]+(T[0]-C[0])*f,C[1]+(T[1]-C[1])*f,C[2]+(T[2]-C[2])*f]):ae.warn('Color "'.concat(v,'" could not be animated!'))}}else typeof I=="object"&&I!==null&&typeof x=="object"&&x!==null?a(x,I,f,m[v]):ae.warn('Value "'.concat(v,'" could not be animated!'))}},"interpolate");return u=>(u=Math.min(Math.max(u,0),1),u===0?e:u===1?n:(a(r,t,u),i))},"animationFactory");var Um,tt,kc,bL=class bL{constructor(t){j(this,Um);j(this,tt);j(this,kc);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",o(()=>{d(this,tt).core.render()},"update"));b(this,"__LEGACY_GET_DIRECTIONS_SYNC",o((t,r,n)=>{var i,a;return(a=(i=d(this,tt).getMapData())==null?void 0:i.__LEGACY_GET_DIRECTIONS_SYNC(t,r,n))!=null?a:void 0},"__LEGACY_GET_DIRECTIONS_SYNC"));b(this,"getDirections",o((t,r,n)=>{var i,a;return(a=(i=d(this,tt).getMapData())==null?void 0:i.getDirections(t,r,n))!=null?a:Promise.resolve(void 0)},"getDirections"));b(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",o((t,r,n)=>{var i,a;return(a=(i=d(this,tt).getMapData())==null?void 0:i.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(t,r,n))!=null?a:void 0},"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC"));b(this,"getDirectionsMultiDestination",o((t,r,n)=>{var i,a;return(a=(i=d(this,tt).getMapData())==null?void 0:i.getDirectionsMultiDestination(t,r,n))!=null?a:Promise.resolve(void 0)},"getDirectionsMultiDestination"));b(this,"on",o((t,r)=>{d(this,Um).on(t,r)},"on"));b(this,"off",o((t,r)=>{d(this,Um).off(t,r)},"off"));b(this,"Debug");$(this,Um,new Rt),$(this,kc,t);let r=new Kb(t,this,d(this,Um));$(this,tt,r),this.Camera=d(this,tt).Camera,this.Markers=d(this,tt).Markers,this.Models=d(this,tt).Models,this.Labels=d(this,tt).Labels,this.Text3D=d(this,tt).Text3D,this.Exporter=d(this,tt).Exporter,this.Paths=d(this,tt).Paths,this.Navigation=d(this,tt).Navigation,this.__BlueDot=d(this,tt).BlueDot,this.Shapes=d(this,tt).Shapes,this.Style=d(this,tt).Style,this.__EXPERIMENTAL__auto=d(this,tt).__EXPERIMENTAL__auto,this.Outdoor=d(this,tt).Outdoor,this.Images=d(this,tt).Images,d(this,kc).container.dataset.version=S.env.npm_package_version,this.Debug=new H3(d(this,tt).core)}updateState(t,r){return d(this,tt).updateState(t,r)}animateState(t,r,n){var f;let i=d(this,tt).getState(t);if(i==null)return ae.warn("Cannot animate state of ".concat(t,".")),new Promise(v=>v({result:"completed"}));let a=AW(i,r),u=d(this,tt).tween({percent:0}).to({percent:1},(f=n==null?void 0:n.duration)!=null?f:1e3).onUpdate(({percent:m})=>{d(this,tt).updateState(t,a(m))});n!=null&&n.easing&&n.easing in hm&&u.easing(hm[n.easing]);let c=new Promise(m=>{u.onComplete(()=>{d(this,tt).removeTween(u),m({result:"completed"})}).onStop(()=>{d(this,tt).removeTween(u),m({result:"cancelled"})}),u.start()});return c.cancel=()=>{u.stop(),d(this,tt).updateState(t,a(0))},c}updateGlobalState(t){var r,n,i,a;try{DW.parse(t)}catch(u){ae.error("updateGlobalState",u);return}if(typeof t=="object"){let u={};if((r=t.text3d)!=null&&r.hoverColor&&(u.text3dHoverColor=t.text3d.hoverColor),(n=t.geometry)!=null&&n.hoverColor&&(u.hoverColor=t.geometry.hoverColor),t.backgroundColor||t.backgroundAlpha!==void 0){let c=(i=t.backgroundColor)!=null?i:d(this,tt).core.backgroundColor,f=(a=t.backgroundAlpha)!=null?a:d(this,tt).core.backgroundAlpha;d(this,tt).core.setBackgroundColor(c,f)}t.environment!=null&&d(this,tt).core.setEnvironment(t.environment),d(this,tt).core.setState(u)}}get options(){return yN(d(this,tt).currentMap.options)}getGlobalState(){let t=d(this,tt).core.getState();return{backgroundColor:d(this,tt).core.backgroundColor,backgroundAlpha:d(this,tt).core.backgroundAlpha,environment:d(this,tt).core.getEnvironment(),geometry:{hoverColor:t.hoverColor},text3d:{hoverColor:t.text3dHoverColor}}}getMapData(){if(d(this,tt).mapData==null)throw new Ro("MapData not found.");return d(this,tt).mapData}getDimensions(){return{width:d(this,kc).canvasWidth,height:d(this,kc).canvasHeight}}addMap(t,r){return d(this,tt).addMap(t,r)}setFloor(t,r){return d(this,tt).setFloor(t,r==null?void 0:r.context)}setFloorStack(t,r){return d(this,tt).setFloorStack(t,r==null?void 0:r.context)}preloadFloors(t){d(this,tt).preloadFloors(t)}tween(t){return d(this,tt).tween(t)}removeTween(t){d(this,tt).removeTween(t)}get tweenGroup(){return d(this,tt).tweenGroup()}get currentFloorStack(){return d(this,tt).currentFloorStack}get currentFloor(){return d(this,tt).currentFloor}updateWatermark(t){d(this,tt).updateWatermark(t)}getState(t){return d(this,tt).getState(t)}setHoverColor(t){d(this,tt).setHoverColor(t)}getHoverColor(){return d(this,tt).getHoverColor()}convertAltitudeToMercatorZoomLevel(t){return d(this,tt).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(t)}convertMercatorZoomLevelToAltitude(t){return d(this,tt).core.getSystems().cameraSystem.convertZoomLevelToAltitude(t)}isInView(t){return d(this,tt).isInView(t)}getDistance(t,r){var n;return(n=d(this,tt).getMapData())==null?void 0:n.getDistance(t,r)}createCoordinate(t,r,n){return typeof t=="object"?new bt(t):new bt(t,r,n==null?void 0:n.id)}createCoordinateFromScreenCoordinate(t,r,n){return d(this,tt).createCoordinateFromScreenCoordinate(t,r,n)}getScreenCoordinateFromCoordinate(t){return d(this,tt).getScreenCoordinateFromCoordinate(t)}__EXPERIMENTAL__auto(){return{labels:this.Labels.__EXPERIMENTAL__all()}}get __core(){if(S.env.INTERNAL==="true")return d(this,tt).core;throw new Error("__core is not available.")}get container(){return d(this,kc).container}publishAllState(){d(this,tt).publishAllState()}clear(){d(this,tt).clear()}destroy(){d(this,tt).destroy()}async enableDebug(t={}){let{Inspector:r}=await import("./inspector-QOSD3H5O.js");await new r(this,d(this,tt)).enable(t)}async takeScreenshot(){return await d(this,kc).renderSync(),d(this,kc).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return d(this,tt).manualFloorVisibility}set manualFloorVisibility(t){d(this,tt).manualFloorVisibility=t}getOptimalVisualDistanceBetweenFloors(t){return d(this,tt).getOptimalVisualDistanceBetweenFloors(t)}get __INTERNAL__hidePathsNotOnCurrentFloor(){return d(this,tt).hidePathsNotOnCurrentFloor}set __INTERNAL__hidePathsNotOnCurrentFloor(t){d(this,tt).hidePathsNotOnCurrentFloor=!!t}};Um=new WeakMap,tt=new WeakMap,kc=new WeakMap,o(bL,"MapView");var eI=bL;g();var Y1e=1e3*60*60*2,_d,z0,Xn,Mu,Ou,kl,Lu,$0,H0,rI,li,FW,NW,V0,W3,IL,SL,_L,CL=class CL{constructor(t,r){j(this,li);j(this,_d,new Rt);j(this,z0);j(this,Xn);j(this,Mu);j(this,Ou);j(this,kl);j(this,Lu);j(this,$0);j(this,H0);j(this,rI,o(()=>{"key"in d(this,Xn)&&"secret"in d(this,Xn)&&Re(this,li,V0).call(this),Re(this,li,W3).call(this)},"#handleWindowFocus"));b(this,"on",o((t,r)=>d(this,_d).on(t,r),"on"));b(this,"off",o((t,r)=>d(this,_d).off(t,r),"off"));$(this,z0,t),$(this,Xn,r)}setMapIds(t){$(this,z0,t)}setEnterprise(t){d(this,Xn).enterprise=t}async readySync(){var i;if((!("key"in d(this,Xn))||!("secret"in d(this,Xn)))&&!("accessToken"in d(this,Xn))){ae.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[Re(this,li,V0).call(this),null];d(this,Xn).enterprise||(t[1]=this.getSasTokensAsync());let[r,n]=await Promise.all(t);Re(this,li,_L).call(this),Re(this,li,IL).call(this,r),n!=null&&Re(this,li,SL).call(this,n),m1()&&((i=globalThis.addEventListener)==null||i.call(globalThis,"focus",d(this,rI)))}async refreshing(){let t=[];return d(this,Mu)!=null&&t.push(d(this,Mu)),d(this,Ou)!=null&&t.push(d(this,Ou)),Promise.all(t)}getAccessTokenAsync(){return Re(this,li,V0).call(this)}getSasTokensAsync(){return Re(this,li,W3).call(this)}getAccessToken(){return d(this,kl)==null?(ae.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):d(this,kl)}getSasToken(t){return this.isEnterpriseMode()?(ae.error("SAS tokens are not available in the enterprise mode!"),{token:""}):d(this,Lu)==null?(ae.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in d(this,Lu).tokens?d(this,Lu).tokens[t]:(ae.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=d(this,Xn).enterprise)!=null?t:!1}destroy(){Re(this,li,_L).call(this),d(this,_d).destroy(),m1()&&globalThis.removeEventListener("focus",d(this,rI))}};_d=new WeakMap,z0=new WeakMap,Xn=new WeakMap,Mu=new WeakMap,Ou=new WeakMap,kl=new WeakMap,Lu=new WeakMap,$0=new WeakMap,H0=new WeakMap,rI=new WeakMap,li=new WeakSet,FW=o(function(t){var n;let r=t.token!==((n=d(this,kl))==null?void 0:n.token);$(this,kl,t),r&&d(this,_d).publish("access-token-refreshed",{accessToken:t})},"#setAccessToken"),NW=o(function(t){var n;let r=JSON.stringify(t.tokens)!==JSON.stringify((n=d(this,Lu))==null?void 0:n.tokens);$(this,Lu,t),r&&d(this,_d).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},"#setSasTokens"),V0=o(async function(t=!1){var r;if("accessToken"in d(this,Xn)&&typeof d(this,Xn).accessToken=="string"){let n={token:d(this,Xn).accessToken,expires:Date.now()+72e5};return $(this,kl,n),n}if(!("key"in d(this,Xn))||!("secret"in d(this,Xn))||typeof d(this,Xn).key!="string"||typeof d(this,Xn).secret!="string")throw new Error("No API keys or access token provided!");return d(this,Mu)!=null?d(this,Mu):d(this,kl)!=null&&d(this,kl).expires!=null&&d(this,kl).expires>Date.now()&&!t?d(this,kl):($(this,Mu,B_(Ie(Y({},d(this,Xn)),{key:d(this,Xn).key,secret:d(this,Xn).secret}),(r=d(this,Xn).enterprise)!=null?r:!1).then(n=>{let i={token:n.accessToken,expires:n.expiresTimestamp*1e3};return Re(this,li,FW).call(this,i),i})),d(this,Mu).finally(()=>{$(this,Mu,void 0)}),d(this,Mu))},"#refreshAccessToken"),W3=o(async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:d(this,Ou)!=null?d(this,Ou):d(this,Lu)!=null&&d(this,Lu).expires>Date.now()&&!t?d(this,Lu):($(this,Ou,new Promise((r,n)=>{Re(this,li,V0).call(this).then(i=>{let a={},u=d(this,z0).map(c=>j4(Ie(Y({},d(this,Xn)),{mapId:c}),i.token).then(f=>{a[c]={token:f.token,expires:f.expires}}).catch(f=>{ae.error("Error getting SAS token for map ".concat(c,":"),f)}));Promise.all(u).then(()=>{let c={tokens:a,expires:Math.min(...Object.values(a).map(f=>{var m;return(m=f.expires)!=null?m:1/0}))};Re(this,li,NW).call(this,c),r(c)})}).catch(i=>{n(i)})})),d(this,Ou).catch(r=>{throw r}).finally(()=>{$(this,Ou,void 0)}),d(this,Ou))},"#refreshSasTokens"),IL=o(function(t){if(!("key"in d(this,Xn))||!("secret"in d(this,Xn)))return;let r=t.expires!=null?t.expires-Date.now():Y1e;isFinite(r)&&$(this,$0,setTimeout(()=>{Re(this,li,V0).call(this,!0).then(n=>{Re(this,li,IL).call(this,n)})},r-AU))},"#setAccessTokenRefresh"),SL=o(function(t){let r=t.expires-Date.now();isFinite(r)&&$(this,H0,setTimeout(()=>{Re(this,li,W3).call(this,!0).then(n=>{Re(this,li,SL).call(this,n)})},r-RU))},"#setSasTokensRefresh"),_L=o(function(){d(this,$0)!=null&&clearTimeout(d(this,$0)),d(this,H0)!=null&&clearTimeout(d(this,H0))},"#stopRefreshing"),o(CL,"TokenManager");var tI=CL;g();g();var RW=o((e,{id:t}={})=>{let r=Array.isArray(e)?e:[e];if(!r.every(a=>typeof a=="string"))return;let n=r.join(""),i=null;if(t){let a=document.getElementById(t);a instanceof HTMLStyleElement&&(i=a)}i==null&&(i=document.createElement("style")),t&&t!==""&&(i.id=t),i.textContent=n,document.head.appendChild(i)},"injectCSS");var kW=":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 BW=".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-placement='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-placement='low-priority-pin']::before {\n display: block;\n}\n";var GW=".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 jW=".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 UW=".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 VW='.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 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 {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n}\n\n.maplibregl-ctrl-top-left {\n top: 0;\n left: 0;\n}\n\n.maplibregl-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n.maplibregl-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n}\n\n.maplibregl-ctrl-bottom-right {\n right: 0;\n bottom: 0;\n}\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 {\n margin: 10px 0 0 10px;\n float: left;\n}\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl {\n margin: 10px 10px 0 0;\n float: right;\n}\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl {\n margin: 0 0 10px 10px;\n float: left;\n}\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl {\n margin: 0 10px 10px 0;\n float: right;\n}\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 (forced-colors: 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 (forced-colors: 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@media (hover: hover) {\n .maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0/5%);\n }\n}\n\n.maplibregl-ctrl button:not(:disabled):active {\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 (forced-colors: 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 (forced-colors: active) and (prefers-color-scheme: light) {\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 (forced-colors: 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 (forced-colors: active) and (prefers-color-scheme: light) {\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 (forced-colors: 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 (forced-colors: active) and (prefers-color-scheme: light) {\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-globe url("svg/maplibregl-ctrl-globe.svg") {\n stroke: #333;\n}\n\n@svg-load ctrl-globe-enabled url("svg/maplibregl-ctrl-globe.svg") {\n stroke: #33b5e5;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-globe);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-globe-enabled);\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n \n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n \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 (forced-colors: 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 (forced-colors: active) and (prefers-color-scheme: light) {\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 (forced-colors: 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 (forced-colors: active) and (prefers-color-scheme: light) {\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 (forced-colors: 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 (forced-colors: active) and (prefers-color-scheme: light) {\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), (pointer: coarse) {\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';g();function tve(e){var t,r;if(!(!e.languages||!m1()||!((r=(t=globalThis.navigator)==null?void 0:t.languages)!=null&&r.length)))for(let n=0;n<globalThis.navigator.languages.length;n++){let i=e.languages.find(a=>a.code.toLowerCase()===globalThis.navigator.languages[n].toLowerCase());if(i)return{code:i.code,name:i.name}}}o(tve,"findNavigatorPreferredLanguageInVenue");function wL(e,t){var u,c,f;let r=(u=t==null?void 0:t.languageCode)!=null?u:"",n=(c=t==null?void 0:t.fallbackToNavigatorLanguage)!=null?c:!0,i=(f=e==null?void 0:e.languages)==null?void 0:f.find(m=>m.code.toLowerCase()===r.toLowerCase()),a;if(i)a=i;else if(n==null||n)try{let m=tve(e);m&&(a=m)}catch(m){ae.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",m)}return a!=null?a:e.defaultLanguage}o(wL,"findPreferredLanguageInVenue");var nve=[kW,BW,GW,jW,UW,VW],ive;var ove=!1;var sve=!1;function q3(){return sve}o(q3,"shouldForceEnterpriseLocations");var Lkt=o(async e=>{var P,L;let t=ove,r,n=Wy();n.updateByUserOption(e);let i=Ie(Y({prefetchTokens:!0},e),{fallbackToNavigatorLanguage:(P=e.fallbackToNavigatorLanguage)!=null?P:!0}),a=new tI([i.mapId],i);if("accessToken"in i){r=i.accessToken;let{aud:A,sub:M}=TI(r);(mN.some(N=>A.includes(N))||M&&M.startsWith("client"))&&(t=!0,a.setEnterprise(t))}else if("key"in i&&"secret"in i){if(i.key.startsWith("mipk_"))throw new Error("Partner API keys detected! \n\nPartner API keys should not be passed directly to the SDK. See https://developer.mappedin.com/docs/rest-apis/partner for more details.");i.key.startsWith("mik_")||(t=!0,a.setEnterprise(t)),i.baseAuthUri=n.getBaseAuthUri(t),r=(await a.getAccessTokenAsync()).token}else throw new Error("Missing key or secret.");i.layoutId!=null&&(t?i.layoutId!=="draft"&&ae.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):ae.warn("layoutId is currently unsupported!")),i.baseUri=n.getBaseUri(t);let u=performance.now(),c,f;if(t){let A=Ie(Y({},i),{venue:i.mapId,clientId:i.key,clientSecret:i.secret,version:"1.0.0",perspective:i.viewId,useDraftData:i.layoutId==="draft"}),M=await z4(A);c=M.compressed,f=M.localePacks}else c=await $4(i,r);let m=performance.now(),v=await Y4(c,i.mvfVersion),x=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(v);let I=q4(v);if(I.length>0?a.setMapIds(I):a.setMapIds([i.mapId]),i.prefetchTokens)try{await a.readySync()}catch(A){ae.error("Failed to ready token manager!",A)}q3()&&(t&&ae.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),i.mvfVersion!=="3.0.0"&&ae.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let C=new nI(v,{env:n,outdoorViewToken:r,tokenManager:a,enterprise:t,localePacksUrls:f,binaryBundle:c,getMapDataOptions:i}),T=new K4(C,{search:e.search});C.Analytics.init(Ie(Y({accessToken:r,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:(L=i.analytics)==null?void 0:L.context})),C.Analytics.sendGetMapDataEvent({parseDuration:x-m,downloadDuration:m-u,viewId:i.viewId});let O=C.findPreferredLanguage({languageCode:i.language,fallbackToNavigatorLanguage:i.fallbackToNavigatorLanguage});if(O)try{await T.changeLanguage(O.code)}catch(A){}return T},"getMapData");var ave=o(async()=>{if(Xy===""||C6==="")return!1;let e=[fetch(Xy,{mode:"same-origin"}),fetch(C6,{mode:"same-origin"})],[t,r]=[{ok:!1},{ok:!1}];try{[t,r]=await Promise.all(e)}catch(n){}return{collision:t.ok,maplibre:r.ok}},"checkWorkerUrls"),Dkt=o(async(e,t,r)=>{var I,C,T,O,P,L,A,M,N,B,H,z,R,X,ie;let n=performance.now(),i=MT(r,t);i&&ET(i),((I=i.injectStyles)==null||I)&&RW(nve,{id:"mappedin__styles"});let a=gN((C=t.outdoorViewToken)!=null?C:""),u=Jv(t);(T=i.outdoorView)!=null&&T.style&&u.envControl.updateTileServerBaseUrl((O=i.outdoorView)==null?void 0:O.style);let c=!1,f=!1,m=await ave();m&&(m.collision||(c=!0),m.maplibre||(f=!0));let v=await pH(e,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:i.bearing,pitch:i.pitch,zoomLevel:i.zoomLevel,backgroundAlpha:(P=i.style)==null?void 0:P.backgroundAlpha,backgroundColor:(L=i.style)==null?void 0:L.backgroundColor,outdoorView:!f&&((A=i.outdoorView)!=null&&A.token)?{headers:{"x-mappedin-tiles-key":(M=i.outdoorView)==null?void 0:M.token},style:t.getEnv().tileServerUri,enabled:!!((N=i.outdoorView)!=null&&N.enabled),lowDpi:(B=i.outdoorView)==null?void 0:B.lowDpi}:void 0,watermark:Ie(Y({},i.watermark),{visible:(z=(H=i.watermark)==null?void 0:H.visible)!=null?z:!u.enterpriseMode&&!a.remove_watermark,onClick:ive||void 0}),attribution:i.attribution,antialias:typeof i.antialiasing=="boolean"?i.antialiasing:!!((R=i.antialiasing)!=null&&R.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:!0,transformImageRequest:u.enterpriseMode?void 0:u.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:i.imagePlacementOptions,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:i.onWebGLContextRestored,onWebGLRendererError:i.onWebGLRendererError,useStandaloneCamera:(X=i.useStandaloneCamera)!=null?X:!1,useWorkers:!((ie=i.disableWorkers)!=null&&ie),useCollisionWorker:!c}),x=new eI(v);return await x.addMap(t,i),u.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:x.getDimensions(),collisionWorkerDisabled:c,outdoorsWorkerDisabled:f}),x},"show3dMap");function Rl(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}o(Rl,"convertCoordinateToPosition");function lve(e){return new Map(e.map(t=>{let{properties:r}=t,{id:n}=r;return[n,t]}))}o(lve,"getEntranceMap");var j6=o((e,t)=>{let r=lve(t),n={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:e[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let i of e){let a=[i.geometry.coordinates],u=(i.properties.entrances||[]).reduce((c,f)=>(r.has(f)&&c.push(r.get(f)),c),[]);if(u.length){let{entrances:c,obstructions:f}=e5(i,u);a=f.map(m=>m.geometry.coordinates),n.entrances.features.push(...c)}n.walls.geometry.coordinates.push(...a)}return n},"cutEntrancesFromLineStrings");function zW(e,t){return((t-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}o(zW,"differenceBetweenAngles");function $W(e,t){let r="Left";return e<=-Math.PI/4?r="Right":e<=-t?r="SlightRight":e<=t?r="Straight":e<=Math.PI/4?r="SlightLeft":r="Left",r}o($W,"getRelativeBearing");function TH(e){let t={};for(let r in e){let n=e[r];if(n!=null){if(n.id=r,"polygons"in n)for(let i of n.polygons)t[i]=n;else if("lineStrings"in n)for(let i of n.lineStrings)t[i]=n;else if("points"in n)for(let i of n.points)t[i]=n}}return t}o(TH,"extractStyleMap");function D3(e,t){return e.reduce((r,n)=>{let i=t[n.properties.id];if(i==null)return r;if("textures"in n.properties&&Array.isArray(n.properties.textures)&&n.properties.textures.length>0){let a=Ie(Y({},i),{id:i.id+"-textures"});r.set(a,[n])}else r.has(i)||r.set(i,[]),r.get(i).push(n);return r},new Map)}o(D3,"groupGeometryByStyle");function F0(e,t={}){var i,a,u,c,f,m,v;let r=Ie(Y({},e),{flipImageToFaceCamera:(i=t==null?void 0:t.flipImagesToFaceCamera)!=null?i:!0}),n=(u=(a=t==null?void 0:t.style)==null?void 0:a.shading)!=null?u:t==null?void 0:t.shadingAndOutlines;if(n===!0?r.shading={start:.1,end:.15,intensity:.4}:typeof n=="object"&&(r.shading={start:n.start,end:n.end,intensity:n.intensity}),r.outline=(f=(c=t==null?void 0:t.style)==null?void 0:c.outlines)!=null?f:t==null?void 0:t.shadingAndOutlines,"lineStrings"in e){let x=(v=(m=t==null?void 0:t.style)==null?void 0:m.wallTopColor)!=null?v:t==null?void 0:t.wallTopColor;x!=null&&(r.topColor=x)}return r}o(F0,"translateToCoreStyle");var OW=o((e,t)=>{var i;let n=((i=t.currentMap)==null?void 0:i.currentFloor).layers.get(Fi);switch(e){case"interior-walls":return n==null?void 0:n.layers.get(Rf);case"exterior-walls":return n==null?void 0:n.layers.get(rc);case"interior-doors":return n==null?void 0:n.layers.get(qg);case"exterior-doors":return n==null?void 0:n.layers.get(Yg);default:return typeof e=="string"?e:e.id}},"getTargetID");function W6(e){return new Promise(t=>{e.onComplete(t),e.onStop(t)})}o(W6,"tweenToPromise");function A3(e){return e.bbox?e.bbox:no(e)}o(A3,"getBoundingBox");function LW(e,t){return[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[2],t[2]),Math.max(e[3],t[3])]}o(LW,"expandBbox");function HW(e){return[...new Set(e)]}o(HW,"unique");function q6(e,t,r){return e.floorId&&t.has(e.floorId)?t.get(e.floorId):r}o(q6,"getTargetFloorObject");function A0(e){if(Vo.is(e)||Ra.is(e))return e.id}o(A0,"getAttachableGeometryId");function EH(e,t,r){var a,u;let n=e.coordinates.length===2&&e.coordinates[0].floorId!==e.coordinates[1].floorId,i=!0;if(n&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let c=t==null?void 0:t.getById("floor",e.coordinates[0].floorId),f=t==null?void 0:t.getById("floor",e.coordinates[1].floorId);if(c&&f){let m=r.getState(c),v=r.getState(f);m!=null&&v!=null&&(i=m.visible&&v.visible&&m.altitude!==v.altitude)}}else{let c=e.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",e.coordinates[0].floorId):void 0;i=c&&(u=(a=r.getState(c))==null?void 0:a.visible)!=null?u:!0}return i}o(EH,"shouldAnimatePathDrawing");function wH(e,t){let r=e.properties.path.split("/"),n=r[r.length-1].split(".")[0],i=atob(n);return"img_"+v7(i).toString()+"-"+t}o(wH,"generateImageId");g();function of(e,t){var r,n,i,a;if(Jg.is(e))return e.navigationTarget.flatMap(u=>of(u,t));if(Nf.is(e)){let u=t.Query.nearest(e,{types:["node"],lineOfSight:!0});return(r=u==null?void 0:u[0])!=null&&r.feature.id?[u[0].feature.id]:[]}else if(bt.is(e)){let u=t.Query.nearest(e,{types:["node"],lineOfSight:!0});return(n=u==null?void 0:u[0])!=null&&n.feature.id?[u[0].feature.id]:[]}else if(Ff.is(e)){let u=t.Query.nearest(e,{types:["node"],lineOfSight:!0});return(i=u==null?void 0:u[0])!=null&&i.feature.id?[u[0].feature.id]:[]}else if(tc.is(e)){let u=t==null?void 0:t.getMVFFeatureById("entrance",e.id);return u!=null&&u.properties.node?[u==null?void 0:u.properties.node]:[]}else if(Df.is(e)){let u=t==null?void 0:t.getMVFFeatureById("area",e.id);return(a=u==null?void 0:u.properties.destinationNodes)!=null?a:[]}else if(Vo.is(e)){let u=t==null?void 0:t.getMVFFeatureById("space",e.id);return u==null?[]:u.properties.destinationNodes}else{if(Sh.is(e))return e.coordinates.reduce((u,c)=>{var m;let f=t.Query.nearest(c,{types:["node"],lineOfSight:!0});return(m=f==null?void 0:f[0])!=null&&m.feature.id&&u.push(f[0].feature.id),u},[]);if(Ra.is(e)){let u=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return u!=null?u:[]}else return su.is(e)?e.spaces.flatMap(u=>{var c,f;return(f=(c=t==null?void 0:t.getMVFFeatureById("space",u.id))==null?void 0:c.properties.destinationNodes)!=null?f:[]}).filter(u=>typeof u=="string"):lp.is(e)?e.nodes.map(u=>u.id):Mf.is(e)?[e.id]:[]}}o(of,"getNodesFromTarget");var WW=Math.PI*.1,qi,Rs,Ko,sf,af,lf,Vm,q0,Bl,qW,W0,YW,PL=class PL{constructor(t,r,n,i,a){j(this,Bl);b(this,"id");j(this,qi,{});j(this,Rs);j(this,Ko);j(this,sf);j(this,af);j(this,lf);j(this,Vm);j(this,q0);var u;this.id=(u=a==null?void 0:a.id)!=null?u:an(),$(this,Rs,r),$(this,Ko,t.features),$(this,sf,n),$(this,af,i)}get path(){return d(this,Ko).map(t=>d(this,Rs).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(d(this,qi).departure)return d(this,qi).departure;if(d(this,Ko).length===0||d(this,sf).length===0)return;let t=d(this,Ko)[0].properties.id,r=d(this,sf)[0];if(d(this,sf).length>1){for(let n of d(this,sf))if(of(n,d(this,Rs)).includes(t)){r=n;break}}return d(this,qi).departure=r,r}get destination(){if(d(this,qi).destination)return d(this,qi).destination;if(d(this,Ko).length===0||d(this,af).length===0)return;let t=d(this,Ko)[d(this,Ko).length-1].properties.id,r=d(this,af)[0];if(d(this,af).length>1){for(let n of d(this,af))if(of(n,d(this,Rs)).includes(t)){r=n;break}}return d(this,qi).destination=r,r}get coordinates(){return d(this,qi).coordinates?d(this,qi).coordinates:(d(this,qi).coordinates=d(this,Ko).map(t=>new bt(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),d(this,qi).coordinates)}get distance(){return d(this,qi).distance?d(this,qi).distance:(d(this,qi).distance=d(this,Ko).reduce((t,r)=>t+(r.properties.distance||0),0),d(this,qi).distance)}get instructions(){if(d(this,Ko).length<2)return[];if(d(this,qi).instructions)return d(this,qi).instructions;let t=[],r=0;for(let n=0;n<d(this,Ko).length;n++){let i=d(this,Ko)[n],a=d(this,Ko)[n-1],u=d(this,Ko)[n+1],c=new bt(i.geometry.coordinates[1],i.geometry.coordinates[0],i.properties.groupBy),f=Re(this,Bl,qW).call(this,{prevDirection:a,direction:i,nextDirection:u});r+=(a==null?void 0:a.properties.distance)||0;for(let m of f)m&&(t.push({action:m,distance:r,coordinate:c,node:d(this,Rs).getById("node",i.properties.id)}),r=0)}return d(this,qi).instructions=t,d(this,qi).instructions}toJSON(){return{id:this.id,directions:d(this,Ko),__type:"directions",from:d(this,sf),to:d(this,af)}}};qi=new WeakMap,Rs=new WeakMap,Ko=new WeakMap,sf=new WeakMap,af=new WeakMap,lf=new WeakMap,Vm=new WeakMap,q0=new WeakMap,Bl=new WeakSet,qW=o(function(t){var T,O;let{prevDirection:r,direction:n,nextDirection:i}=t,a=r&&d(this,Rs).getById("floor",r.properties.groupBy),u=d(this,Rs).getById("floor",n.properties.groupBy),c=i&&d(this,Rs).getById("floor",i.properties.groupBy),f=[];r||f.push({type:"Departure"});let m=d(this,Rs).getMVFFeatureByNodeId("connection",n.properties.id),v=m?d(this,Rs).getById("connection",m.id):void 0,x=m&&m.nodes.length>1,I=d(this,Rs).enterpriseMode&&(!n.properties.destination||!(m!=null&&m.nodes.includes(n.properties.destination))||!(m!=null&&m.nodes.includes(n.properties.id)));if(m&&!(!x||I))if(!d(this,lf)||d(this,lf)==="exit")f.push(Re(this,Bl,W0).call(this,"TakeConnection",u,c,v,m)),$(this,lf,"take"),$(this,Vm,v),$(this,q0,m);else{let P=d(this,Rs).getMVFFeatureByNodeId("connection",(T=r==null?void 0:r.properties.id)!=null?T:""),L=d(this,Rs).getById("connection",(O=P==null?void 0:P.id)!=null?O:"");f.push(Re(this,Bl,W0).call(this,"ExitConnection",u,a,L,P)),$(this,lf,"exit"),$(this,Vm,v),$(this,q0,m)}else d(this,lf)==="take"?(f.push(Re(this,Bl,W0).call(this,"ExitConnection",u,a,d(this,Vm),d(this,q0))),$(this,lf,"exit"),$(this,Vm,v)):c&&(u==null?void 0:u.id)!==c.id?f.push(Re(this,Bl,W0).call(this,"TakeConnection",u,c,v)):a&&a.id!==(u==null?void 0:u.id)?f.push(Re(this,Bl,W0).call(this,"ExitConnection",u,a,v)):f.push(Re(this,Bl,YW).call(this,r,n));return i||f.push({type:"Arrival"}),f},"#getActions"),W0=o(function(t,r,n,i,a){var m,v;let u="none",c=r?r.elevation:0;if(c!=null&&(n==null?void 0:n.elevation)!=null){let x=c-n.elevation;x>0?u="down":x<0&&(u="up")}let f=(v=(m=i==null?void 0:i.type)!=null?m:a==null?void 0:a.type)!=null?v:"stairs";return{type:t,fromFloor:r,toFloor:n,direction:u,connection:i,connectionType:f}},"#createConnectionAction"),YW=o(function(t,r){let n=r.properties.edges;if(!n||n.filter(u=>u.destination.properties.id!==(t==null?void 0:t.properties.id)&&u.destination.properties.id!==r.properties.destination).length===0)return null;let a=t?-zW(t.properties.angle,r.properties.angle):0;return Math.abs(a)>=WW?{type:"Turn",bearing:$W(a,WW),referencePosition:"At"}:null},"#createTurnAction"),o(PL,"Directions");var Sd=PL;g();var TL=class TL{constructor({nodes:t,geojsonCollection:r,connections:n,groupBy:i,multiplicativeDistanceWeightScaling:a}){b(this,"navigator");b(this,"connections");b(this,"getDirections",o((t,r,n,i)=>{let{accessible:a,smoothing:{enabled:u,radius:c},connectionIdWeightMap:f}=n,m=t.flatMap(P=>of(P,i)),v=r.flatMap(P=>of(P,i)),x=this.getExcludedNodeIds(n.excludedConnections).filter(P=>!m.includes(P)&&!v.includes(P)),I=this.getDisabledConnectionNodeIds(a).filter(P=>!m.includes(P)&&!v.includes(P)),C=new Map;for(let P in f){let L=i.getMVFFeatureById("connection",P);if(!L)continue;let A=this.navigator.graph.edges[L.nodes[0]];if(A){let M=A.find(N=>N.destination.properties.id===L.nodes[1]);M&&C.set(M,f[P])}}let T=this.navigator.getDirections({zones:n.zones.map(P=>{var L;return{geometry:P.geometry,cost:P.cost,map:(L=P.floor)==null?void 0:L.id}}),originIds:m,destinationNodeIds:v,excludedNodeIds:x,disabledConnectionNodeIds:I,simplify:{enabled:u,bufferRadius:c},overrideEdgeWeights:C,multiplicativeDistanceWeightScaling:!i.enterpriseMode});this.addCoordinateDirections(T,t,r);let O=new Sd(T,i,t,r);if(!(O.distance===0&&new Set([...m,...v]).size===m.length+v.length))return O},"getDirections"));b(this,"getExcludedNodeIds",o(t=>{if(t.length===0)return[];let r=new Set(t.map(n=>n.id));return this.connections.reduce((n,i)=>r.has(i.id)?n.concat(i.nodes):n,[])},"getExcludedNodeIds"));b(this,"getDisabledConnectionNodeIds",o(t=>t===!1?[]:this.connections.reduce((r,n)=>n.accessible?r:r.concat(n.nodes),[]),"getDisabledConnectionNodeIds"));b(this,"addCoordinateDirections",o((t,[r],[n])=>{if(t.features.length){if(bt.is(r)){let i=this.createDirectionFeature(r,this.navigator.getAngle([r.longitude,r.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([r.longitude,r.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,i)}if(bt.is(n)){let i=this.createDirectionFeature(n,0,0),a=t.features[t.features.length-1];a.properties.distance=this.navigator.getDistance(a.geometry.coordinates,[n.longitude,n.latitude]),a.properties.angle=this.navigator.getAngle(a.geometry.coordinates,[n.longitude,n.latitude]),t.features.push(i)}}},"addCoordinateDirections"));b(this,"createDirectionFeature",o((t,r,n)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:r,distance:n,edges:[]}}),"createDirectionFeature"));this.navigator=new _0({nodes:t,geojsonCollection:this.createCollection(r),groupBy:i,multiplicativeDistanceWeightScaling:a}),this.connections=n}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((r,[n,i])=>r.concat(i.features.map(a=>(a.properties.map=n,a))),[])}}};o(TL,"DirectionsInternal");var Y0=TL;g();g();g();g();g();g();function EL(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return XW(this.cover(t,r),t,r,e)}o(EL,"default");function XW(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,a=e._root,u={data:n},c=e._x0,f=e._y0,m=e._x1,v=e._y1,x,I,C,T,O,P,L,A;if(!a)return e._root=u,e;for(;a.length;)if((O=t>=(x=(c+m)/2))?c=x:m=x,(P=r>=(I=(f+v)/2))?f=I:v=I,i=a,!(a=a[L=P<<1|O]))return i[L]=u,e;if(C=+e._x.call(null,a.data),T=+e._y.call(null,a.data),t===C&&r===T)return u.next=a,i?i[L]=u:e._root=u,e;do i=i?i[L]=new Array(4):e._root=new Array(4),(O=t>=(x=(c+m)/2))?c=x:m=x,(P=r>=(I=(f+v)/2))?f=I:v=I;while((L=P<<1|O)===(A=(T>=I)<<1|C>=x));return i[A]=a,i[L]=u,e}o(XW,"add");function ZW(e){var t,r,n=e.length,i,a,u=new Array(n),c=new Array(n),f=1/0,m=1/0,v=-1/0,x=-1/0;for(r=0;r<n;++r)isNaN(i=+this._x.call(null,t=e[r]))||isNaN(a=+this._y.call(null,t))||(u[r]=i,c[r]=a,i<f&&(f=i),i>v&&(v=i),a<m&&(m=a),a>x&&(x=a));if(f>v||m>x)return this;for(this.cover(f,m).cover(v,x),r=0;r<n;++r)XW(this,u[r],c[r],e[r]);return this}o(ZW,"addAll");g();function ML(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,a=(n=Math.floor(t))+1;else{for(var u=i-r||1,c=this._root,f,m;r>e||e>=i||n>t||t>=a;)switch(m=(t<n)<<1|e<r,f=new Array(4),f[m]=c,c=f,u*=2,m){case 0:i=r+u,a=n+u;break;case 1:r=i-u,a=n+u;break;case 2:i=r+u,n=a-u;break;case 3:r=i-u,n=a-u;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this}o(ML,"default");g();function OL(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}o(OL,"default");g();function LL(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}o(LL,"default");g();g();function wo(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}o(wo,"default");function DL(e,t,r){var n,i=this._x0,a=this._y0,u,c,f,m,v=this._x1,x=this._y1,I=[],C=this._root,T,O;for(C&&I.push(new wo(C,i,a,v,x)),r==null?r=1/0:(i=e-r,a=t-r,v=e+r,x=t+r,r*=r);T=I.pop();)if(!(!(C=T.node)||(u=T.x0)>v||(c=T.y0)>x||(f=T.x1)<i||(m=T.y1)<a))if(C.length){var P=(u+f)/2,L=(c+m)/2;I.push(new wo(C[3],P,L,f,m),new wo(C[2],u,L,P,m),new wo(C[1],P,c,f,L),new wo(C[0],u,c,P,L)),(O=(t>=L)<<1|e>=P)&&(T=I[I.length-1],I[I.length-1]=I[I.length-1-O],I[I.length-1-O]=T)}else{var A=e-+this._x.call(null,C.data),M=t-+this._y.call(null,C.data),N=A*A+M*M;if(N<r){var B=Math.sqrt(r=N);i=e-B,a=t-B,v=e+B,x=t+B,n=C.data}}return n}o(DL,"default");g();function AL(e){if(isNaN(v=+this._x.call(null,e))||isNaN(x=+this._y.call(null,e)))return this;var t,r=this._root,n,i,a,u=this._x0,c=this._y0,f=this._x1,m=this._y1,v,x,I,C,T,O,P,L;if(!r)return this;if(r.length)for(;;){if((T=v>=(I=(u+f)/2))?u=I:f=I,(O=x>=(C=(c+m)/2))?c=C:m=C,t=r,!(r=r[P=O<<1|T]))return this;if(!r.length)break;(t[P+1&3]||t[P+2&3]||t[P+3&3])&&(n=t,L=P)}for(;r.data!==e;)if(i=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,i?(a?i.next=a:delete i.next,this):t?(a?t[P]=a:delete t[P],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[L]=r:this._root=r),this):(this._root=a,this)}o(AL,"default");function KW(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}o(KW,"removeAll");g();function FL(){return this._root}o(FL,"default");g();function NL(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}o(NL,"default");g();function RL(e){var t=[],r,n=this._root,i,a,u,c,f;for(n&&t.push(new wo(n,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(n=r.node,a=r.x0,u=r.y0,c=r.x1,f=r.y1)&&n.length){var m=(a+c)/2,v=(u+f)/2;(i=n[3])&&t.push(new wo(i,m,v,c,f)),(i=n[2])&&t.push(new wo(i,a,v,m,f)),(i=n[1])&&t.push(new wo(i,m,u,c,v)),(i=n[0])&&t.push(new wo(i,a,u,m,v))}return this}o(RL,"default");g();function kL(e){var t=[],r=[],n;for(this._root&&t.push(new wo(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var i=n.node;if(i.length){var a,u=n.x0,c=n.y0,f=n.x1,m=n.y1,v=(u+f)/2,x=(c+m)/2;(a=i[0])&&t.push(new wo(a,u,c,v,x)),(a=i[1])&&t.push(new wo(a,v,c,f,x)),(a=i[2])&&t.push(new wo(a,u,x,v,m)),(a=i[3])&&t.push(new wo(a,v,x,f,m))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}o(kL,"default");g();function JW(e){return e[0]}o(JW,"defaultX");function BL(e){return arguments.length?(this._x=e,this):this._x}o(BL,"default");g();function QW(e){return e[1]}o(QW,"defaultY");function GL(e){return arguments.length?(this._y=e,this):this._y}o(GL,"default");function iI(e,t,r){var n=new jL(t==null?JW:t,r==null?QW:r,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}o(iI,"quadtree");function jL(e,t,r,n,i,a){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}o(jL,"Quadtree");function eq(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}o(eq,"leaf_copy");var oa=iI.prototype=jL.prototype;oa.copy=function(){var e=new jL(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,r,n;if(!t)return e;if(!t.length)return e._root=eq(t),e;for(r=[{source:t,target:e._root=new Array(4)}];t=r.pop();)for(var i=0;i<4;++i)(n=t.source[i])&&(n.length?r.push({source:n,target:t.target[i]=new Array(4)}):t.target[i]=eq(n));return e};oa.add=EL;oa.addAll=ZW;oa.cover=ML;oa.data=OL;oa.extent=LL;oa.find=DL;oa.remove=AL;oa.removeAll=KW;oa.root=FL;oa.size=NL;oa.visit=RL;oa.visitAfter=kL;oa.x=BL;oa.y=GL;var Du,uf,cf,X0,UL=class UL{constructor(t,r){j(this,Du,{});j(this,uf,{});j(this,cf);j(this,X0);$(this,cf,t),$(this,X0,r)}getTreeByType(t,r,n,i=[]){var m,v;d(this,Du)[t]||(d(this,Du)[t]={}),d(this,uf)[t]||(d(this,uf)[t]={}),d(this,uf)[t][r]||(d(this,uf)[t][r]={});let a=d(this,uf)[t][r][n],u=!OI(a,i);if((m=d(this,Du)[t][r])!=null&&m[n]&&!u)return d(this,Du)[t][r][n];d(this,Du)[t][r]||(d(this,Du)[t][r]={}),d(this,Du)[t][r][n]=iI();let c=d(this,Du)[t][r][n];c.x(x=>d(this,X0).call(this,x.geometry.coordinates).x),c.y(x=>d(this,X0).call(this,x.geometry.coordinates).y);let f=[];switch(t){case"node":f=((v=d(this,cf).directions.navigator.graph.nodesByGroup.get(n))==null?void 0:v.filter(x=>x.properties.neighbors.length>0))||[];break;case"point-of-interest":f=d(this,cf).mvfPoisByFloorId[n]||[];break;case"door":f=d(this,cf).mvfEntrancesByFloorId[n]||[];break;case"annotation":f=d(this,cf).mvfAnnotationsByFloorId[n]||[];break}if((i==null?void 0:i.length)>0&&(f==null?void 0:f.length)>0){let x=new Set(i);f=f.filter(I=>{let C=d(this,cf).getById(t,I.properties.id);return C&&!x.has(C)})}return(f==null?void 0:f.length)>0&&c.addAll(f),d(this,uf)[t][r][n]=i?[...i]:void 0,c}};Du=new WeakMap,uf=new WeakMap,cf=new WeakMap,X0=new WeakMap,o(UL,"QueryCache");var Y3=UL;var uve=.1,cve=5,pve=100,fve=2,tq=1e3,rq=111319.9,dve=He.object({limit:He.enum(["same-floor","same-elevation"]).optional(),radius:He.number().optional(),useLineOfSight:He.boolean().optional(),types:He.array(He.enum(["node","point-of-interest","door","annotation"])).min(1)}),sa,zm,$m,sI,X3,aI,Z3,VL=class VL{constructor(t){j(this,sa);j(this,zm);j(this,$m,o(([t,r])=>{let[n,i]=[d(this,sa).mapCenter.longitude,d(this,sa).mapCenter.latitude],a=rq,u=rq*Math.cos(r*Math.PI/180),c=(t-n)*u,f=(r-i)*a;return{x:c,y:f}},"#projectOntoCartesianPlane"));j(this,sI,new Map);j(this,X3,o((t,r)=>{var a;let n=(a=d(this,sI).get(t))==null?void 0:a.get(r);if(n)return n;let i=d(this,zm).getTreeByType(t,d(this,sa).mapName,r);if(typeof i.extent=="function")if(i.extent()){let[[u,c],[f,m]]=i.extent(),v=f-u,x=m-c;n=Math.max(v,x)}else n=tq;else n=tq;return d(this,sI).set(t,new Map([[r,n]])),n},"#getMaxRadiusForFloorId"));j(this,aI,o((t,r,n,i,a,u=[])=>{let c=[],f=0,m=d(this,X3).call(this,r,n);for(;c.length===0&&f<pve;){if(a>m)return;c=d(this,Z3).call(this,r,n,i,[t.longitude,t.latitude],a,u),c.length===0&&(a*=fve,f++)}let v=c.sort((x,I)=>{let C=qa([t.longitude,t.latitude],x.geometry.coordinates),T=qa([t.longitude,t.latitude],I.geometry.coordinates);return C-T});for(let x of v)if(u.push(x.properties.id),d(this,sa).directions.navigator.hasLineOfSight([t.longitude,t.latitude],x.geometry.coordinates,n,uve))return x;return d(this,aI).call(this,t,r,n,i,a,u)},"#searchWithLineOfSight"));j(this,Z3,o((t,r,n,i,a,u=[])=>{let{x:c,y:f}=d(this,$m).call(this,i),m=c-a,v=c+a,x=f-a,I=f+a,C=[];return d(this,zm).getTreeByType(t,d(this,sa).mapName,r,n).visit((T,O,P,L,A)=>{if(!T.length)do{if(!("data"in T))continue;let M=T.data;if(u.includes(M.properties.id))continue;let N=d(this,$m).call(this,M.geometry.coordinates);N.x>=m&&N.x<v&&N.y>=x&&N.y<I&&C.push(M)}while("next"in T&&T.next&&(T=T.next));return O>=v||P>=I||L<m||A<x}),C},"#searchWithinBounds"));$(this,sa,t),$(this,zm,new Y3(d(this,sa),d(this,$m)))}nearest(t,r){var u,c,f;try{dve.parse(r)}catch(m){ae.error(m);return}let n=J1(t);if(!n)return;let i=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let m of d(this,sa).getByType("floor-stack")){let v=m.defaultFloor;v&&i.push(v.id)}else if(r.limit==="same-elevation"){let m=d(this,sa).floorsById[n.floorId];if(m){let v=m==null?void 0:m.elevation;v&&(i=d(this,sa).getByType("floor-stack").map(x=>{var I;return(I=x.floors.find(C=>C.elevation===v))==null?void 0:I.id}).filter(Boolean))}}let a=[];for(let m of HW(r.types))for(let v of i){let x;if(((u=r.lineOfSight)==null||u)&&(x=d(this,aI).call(this,n,m,v,(c=r.exclude)!=null?c:[],(f=r.radius)!=null?f:cve)),!x){let I=d(this,$m).call(this,[n.longitude,n.latitude]);x=d(this,zm).getTreeByType(m,d(this,sa).mapName,v,r.exclude).find(I.x,I.y)}if(x){let I=d(this,sa).getById(m,x.properties.id);I&&a.push({distance:qa([n.longitude,n.latitude],x.geometry.coordinates),feature:I})}}return a.sort((m,v)=>m.distance-v.distance)}};sa=new WeakMap,zm=new WeakMap,$m=new WeakMap,sI=new WeakMap,X3=new WeakMap,aI=new WeakMap,Z3=new WeakMap,o(VL,"Query");var oI=VL;g();g();var lI,zL=class zL{constructor(t){j(this,lI);$(this,lI,t||[])}get raw(){return d(this,lI)}};lI=new WeakMap,o(zL,"OpeningHours");var K3=zL;var vs,at,zn,Hm=class Hm extends ho{constructor(r,n){super(n.mvfData.id);b(this,"__type",Hm.__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");j(this,vs);j(this,at,{});j(this,zn);$(this,vs,r),$(this,zn,n.mvfData);for(let i in n.mvfData)i==="links"?this.links=n.mvfData.links.map(a=>new lh({mvfData:a})):i==="pictures"?this.images=n.mvfData.pictures.map(a=>{var u;return a.url?new ph({mvfData:Ie(Y({},a),{url:(u=a.url)!=null?u:""}),mapData:d(this,vs)}):void 0}).filter(a=>a!=null):i==="website"?n.mvfData.website&&(this.website=new lh({mvfData:n.mvfData.website})):i==="icon"?n.mvfData.icon&&(this.icon=new ph({mvfData:{url:n.mvfData.icon},mapData:d(this,vs)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return d(this,zn)[i]}})}static is(r){return r.__type===Hm.__type}get spaces(){if(d(this,at).spaces)return d(this,at).spaces;if(d(this,zn).spaces==null)return d(this,at).spaces=[],d(this,at).spaces;d(this,at).spaces=[];for(let r=0;r<d(this,zn).spaces.length;r++){let n=d(this,vs).getById("space",d(this,zn).spaces[r].id);n&&d(this,at).spaces.push(n)}return d(this,at).spaces}get points(){if(d(this,at).points)return d(this,at).points;if(d(this,zn).spaces==null)return d(this,at).points=[],d(this,at).points;d(this,at).points=[];for(let r=0;r<d(this,zn).spaces.length;r++){let n=d(this,vs).getById("point-of-interest",d(this,zn).spaces[r].id);n&&d(this,at).points.push(n)}return d(this,at).points}get doors(){if(d(this,at).doors)return d(this,at).doors;if(d(this,zn).entrances==null)return d(this,at).doors=[],d(this,at).doors;d(this,at).doors=[];for(let r=0;r<d(this,zn).entrances.length;r++){let n=d(this,vs).getById("door",d(this,zn).entrances[r].id);n&&d(this,at).doors.push(n)}return d(this,at).doors}get connections(){var n;if(d(this,at).connections)return d(this,at).connections;if(d(this,zn).connections==null)return d(this,at).connections=[],d(this,at).connections;let r=new Set;for(let i=0;i<d(this,zn).connections.length;i++){let a=d(this,zn).connections[i],u=d(this,vs).mvfConnectionsById[a],f=(u==null?[]:u.nodes).map(m=>d(this,vs).getById("node",m)).filter(Boolean);for(let m of f){if(m==null)continue;let v=ec([m.coordinate.longitude,m.coordinate.latitude]),I=((n=d(this,vs).connectionSpaceIdsByLatLon[v])!=null?n:[]).map(C=>d(this,vs).connectionsById[C]).filter(C=>C!=null);for(let C of I)r.add(C)}}return d(this,at).connections=Array.from(r),d(this,at).connections}get annotations(){if(d(this,at).annotations)return d(this,at).annotations;if(d(this,zn).annotations==null)return d(this,at).annotations=[],d(this,at).annotations;d(this,at).annotations=[];for(let r=0;r<d(this,zn).annotations.length;r++){let n=d(this,vs).getById("annotation",d(this,zn).annotations[r].id);n&&d(this,at).annotations.push(n)}return d(this,at).annotations}get categories(){return d(this,at).categories?d(this,at).categories:d(this,zn).categories==null?(d(this,at).categories=[],d(this,at).categories):(d(this,at).categories=d(this,zn).categories.map(r=>d(this,vs).getById("location-category",r)).filter(r=>r!=null),d(this,at).categories)}get mapObjects(){return d(this,at).mapObjects?d(this,at).mapObjects:d(this,zn).obstructions==null?(d(this,at).mapObjects=[],d(this,at).mapObjects):(d(this,at).mapObjects=d(this,zn).obstructions.map(r=>d(this,vs).getById("object",r.id)).filter(r=>r!=null),d(this,at).mapObjects)}get areas(){return d(this,at).areas?d(this,at).areas:d(this,zn).areas==null?(d(this,at).areas=[],d(this,at).areas):(d(this,at).areas=d(this,zn).areas.map(r=>d(this,vs).getById("area",r.id)).filter(r=>r!=null),d(this,at).areas)}get focusTarget(){if(d(this,at).focusTarget)return d(this,at).focusTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);for(let n of this.points)r.push(n.focusTarget);for(let n of this.areas)r.push(n.focusTarget);return d(this,at).focusTarget=r,r}get openingHours(){var r;return d(this,at).openingHours?d(this,at).openingHours:(d(this,at).openingHours=new K3((r=d(this,zn).openingHoursSpecification)!=null?r:[]),d(this,at).openingHours)}get navigationTarget(){if(d(this,at).navigationTarget)return d(this,at).navigationTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);for(let n of this.points)r.push(n.focusTarget);return d(this,at).navigationTarget=r,r}toJSON(){return{__type:Hm.__type,id:this.id,name:this.name}}};vs=new WeakMap,at=new WeakMap,zn=new WeakMap,o(Hm,"LocationProfile"),b(Hm,"__type","location-profile");var $L=Hm,Jg=$L;g();var Cd,_a,qm,Wm=class Wm extends ho{constructor(r,n){super(n.mvfData.id);b(this,"__type",Wm.__type);b(this,"id","cat_");b(this,"name","");b(this,"icon","");j(this,Cd);j(this,_a,{});j(this,qm);$(this,Cd,r),$(this,qm,n.mvfData);for(let i in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return d(this,qm)[i]}})}static is(r){return r.__type===Wm.__type}get parent(){return d(this,_a).parent?d(this,_a).parent:(d(this,_a).parent=d(this,qm).parent?d(this,Cd).getById("location-category",d(this,qm).parent):void 0,d(this,_a).parent)}get children(){return d(this,_a).children?d(this,_a).children:(d(this,_a).children=d(this,Cd).locationCategoriesByParentId[this.id]||[],d(this,_a).children)}get locationProfiles(){if(d(this,_a).locationProfiles)return d(this,_a).locationProfiles;let r=[];for(let n of d(this,Cd).locationProfilesByCategoryId[this.id]||[]){let i=d(this,Cd).getById("location-profile",n.id);i&&r.push(i)}return d(this,_a).locationProfiles=r,r}toJSON(){return{__type:Wm.__type,id:this.id,name:this.name}}};Cd=new WeakMap,_a=new WeakMap,qm=new WeakMap,o(Wm,"LocationCategory"),b(Wm,"__type","location-category");var HL=Wm,K2=HL;var _t,J3,nq,Z0,WL=class WL extends Rt{constructor(r,n){var u,c,f,m,v,x;super();j(this,J3);b(this,"Analytics");j(this,_t,{});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,"navigationFlags");b(this,"binaryBundle");b(this,"envControl");b(this,"getMapDataOptions");j(this,Z0);b(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",o((r,n,i)=>this.__LEGACY_GET_DIRECTIONS_SYNC(r,n,Ie(Y({},i),{multiDestination:!0})),"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC"));b(this,"__LEGACY_GET_DIRECTIONS_SYNC",o((r,n,i)=>{let{accessible:a=!1,smoothing:u=!0,multiDestination:c=!1}=i||{},f=typeof u=="object"?u.enabled:u,m=typeof u=="object"?u.radius:void 0,v=(i==null?void 0:i.zones)||[],x={accessible:a,zones:v,smoothing:{enabled:f!=null?f:!0,radius:m!=null?m:.75},excludedConnections:(i==null?void 0:i.excludedConnections)||[],connectionIdWeightMap:(i==null?void 0:i.connectionIdWeightMap)||{}};if(c&&Array.isArray(n)){let I=Array.isArray(r)?r:[r],C=[];for(let T of n){let O=Array.isArray(T)?T:[T],P=this.directions.getDirections(I,O,x,this);if(!P){ae.error("getDirections failed due to missing directions for one of the segments");return}I=O,C.push(P)}return C}else{let I=Array.isArray(r)?r:[r],C=Array.isArray(n)?n:[n];if(Array.isArray(C[0])){ae.error("getDirections does not support multi-destination without multisegment option");return}I[0].id&&C[0].id&&this.Analytics.sendGetDirectionsEvent(I[0].id,C[0].id);try{return this.directions.getDirections(I,C,x,this)}catch(T){ae.error("Unable to get directions",T);return}}},"__LEGACY_GET_DIRECTIONS_SYNC"));b(this,"getDirections",o(async(r,n,i)=>Promise.resolve(this.__LEGACY_GET_DIRECTIONS_SYNC(r,n,i)),"getDirections"));b(this,"getDirectionsMultiDestination",o(async(r,n,i)=>Promise.resolve(this.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(r,n,i)),"getDirectionsMultiDestination"));b(this,"transformImageRequest",o(async r=>{var i;if(this.enterpriseMode||!this.getMapDataOptions)return{url:r};if(!pN(r))return{url:r};if(fN(r))return{url:r};let n=Y2(r);if(!n)return{url:r};try{let a=await((i=this.tokenManager)==null?void 0:i.getSasTokensAsync()),u=a==null?void 0:a[n.mapId];if(u==null)throw new Error("SAS token not found");let[c]=r.split("?");return{url:"".concat(c,"?").concat(u.token)}}catch(a){return ae.error("Failed to append SAS token to image request. Requests for private images may fail.",a),{url:r}}},"transformImageRequest"));let i=(u=n==null?void 0:n.env)!=null?u:Wy();if(this.envControl=i,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new Qg,this.localePacksUrls=(c=n==null?void 0:n.localePacksUrls)!=null?c:{},this.mvf=r,this.outdoorViewToken=n==null?void 0:n.outdoorViewToken,this.getMapDataOptions=n==null?void 0:n.getMapDataOptions,((f=r["tileset.json"])==null?void 0:f.default)!=null&&(this.tilesets[r["tileset.json"].default.key]=r["tileset.json"].default,i.updateTileServerBaseUrl(r["tileset.json"].default.url),r["tileset.json"].others!=null))for(let I of r["tileset.json"].others)this.tilesets[I.key]=I;this.navigationFlags=(m=r["navigationFlags.json"])!=null?m:{},this.enterpriseMode=(v=n==null?void 0:n.enterprise)!=null?v:!1,this.tokenManager=n==null?void 0:n.tokenManager;let a=xN(r,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||q3()){let I=vN(r,this);if(this.locationsById=I.locationsById,this.categoriesById=I.categoriesById,this.mvfLocationsBySpaceId=I.mvfLocationsBySpaceId,this.locationIdsByNodeId=I.locationIdsByNodeId,this.spaceIdsByNodeId=I.spaceIdsByNodeId,this.connectionsByExternalId=I.connectionsByExternalId,this.locationsByExternalId=I.locationsByExternalId,this.categoriesByExternalId=I.categoriesByExternalId,this.destinationNodesIdsBySpaceId=I.destinationNodesIdsBySpaceId,I.venue.name!=null){this.venue=new VT(this,{mvfData:I.venue});let C={};for(let T in I.mvfLocationsById)C[T]=I.mvfLocationsById[T];for(let T in I.locationInstancesById)C[T]=I.locationInstancesById[T];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":C,"enterprise-category":I.mvfCategoriesById,"floor-stack":a.mvfFloorStacksById,floor:a.mvfFloorsById}},(x=n==null?void 0:n.languagePacks)==null||x.forEach(({language:T,localePack:O})=>{this.languagePacks[T.code]=hT(O)}),this.currentLanguage=this.venue.defaultLanguage}}this.directions=new Y0({nodes:r["node.geojson"],geojsonCollection:r.enterprise?r.space:r.obstruction,connections:r["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode}),this.Query=new oI(this)}getEnv(){let r=this;return{get baseUri(){var n;return r.envControl.getBaseUri((n=r.enterpriseMode)!=null?n:!1)},get baseAuthUri(){return r.envControl.getBaseAuthUri()},get analyticsBaseUri(){return r.envControl.getAnalyticsBaseUri()},get tileServerUri(){return r.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?r:""}get mapCenter(){return new bt(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?r:0}get spaces(){return d(this,_t).spaces==null&&(d(this,_t).spaces=globalThis.Object.values(this.spacesById)),d(this,_t).spaces}get objects(){return d(this,_t).objects==null&&(d(this,_t).objects=globalThis.Object.values(this.objectsById)),d(this,_t).objects}get connections(){return d(this,_t).connections==null&&(d(this,_t).connections=globalThis.Object.values(this.connectionsById)),d(this,_t).connections}get floors(){return d(this,_t).floors==null&&(d(this,_t).floors=globalThis.Object.values(this.floorsById)),d(this,_t).floors}get floorStacks(){return d(this,_t).floorStacks==null&&(d(this,_t).floorStacks=globalThis.Object.values(this.floorStacksById)),d(this,_t).floorStacks}get facades(){return d(this,_t).facades==null&&(d(this,_t).facades=globalThis.Object.values(this.facadesById)),d(this,_t).facades}get doors(){return d(this,_t).doors==null&&(d(this,_t).doors=globalThis.Object.values(this.doorsById)),d(this,_t).doors}get pointsOfInterest(){return d(this,_t).pointsOfInterest==null&&(d(this,_t).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),d(this,_t).pointsOfInterest}get annotations(){return d(this,_t).annotations==null&&(d(this,_t).annotations=globalThis.Object.values(this.annotationsById)),d(this,_t).annotations}get areas(){return d(this,_t).areas==null&&(d(this,_t).areas=globalThis.Object.values(this.areasById)),d(this,_t).areas}get nodes(){return d(this,_t).nodes==null&&(d(this,_t).nodes=globalThis.Object.values(this.nodesById)),d(this,_t).nodes}get locations(){return d(this,_t).locations==null&&(d(this,_t).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return d(this,_t).categories==null&&(d(this,_t).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return d(this,_t).locationProfiles==null&&(d(this,_t).locationProfiles=globalThis.Object.values(this.locationProfilesById)),d(this,_t).locationProfiles}get locationCategories(){return d(this,_t).locationCategories==null&&(d(this,_t).locationCategories=globalThis.Object.values(this.locationCategoriesById)),d(this,_t).locationCategories}get mvfFloors(){return d(this,_t).mvfFloors==null&&(d(this,_t).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),d(this,_t).mvfFloors}get mvfFloorStacks(){return d(this,_t).mvfFloorStacks==null&&(d(this,_t).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),d(this,_t).mvfFloorStacks}getByType(r){switch(r){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(r,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":o(c=>Re(this,J3,nq).call(this,this.mvfConnectionsById[c]),"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=o(c=>{let f=i[c];if(f!=null)return typeof f=="function"?f(n):f[n]},"getItemFromCollection"),u=o(()=>{for(let c of Object.keys(i)){let f=a(c);if(f!=null)return f}},"getItemFromAllCollections");return r==="unknown"?u():a(r)}getByExternalId(r,n){var i,a,u,c,f,m,v,x,I,C,T,O;switch(r){case"location-profile":return(i=this.locationProfilesByExternalId[n])!=null?i:[];case"location-category":return[];case"space":return(a=this.spacesByExternalId[n])!=null?a:[];case"floor":return(u=this.floorsByExternalId[n])!=null?u:[];case"floor-stack":return(c=this.floorStacksByExternalId[n])!=null?c:[];case"node":return(f=this.nodesByExternalId[n])!=null?f:[];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(I=this.poisByExternalId[n])!=null?I:[];case"area":return(C=this.areasByExternalId[n])!=null?C:[];case"enterprise-location":return(T=this.locationsByExternalId[n])!=null?T:[];case"enterprise-category":return(O=this.categoriesByExternalId[n])!=null?O:[];default:return[]}}getMapDataById(r){var n,i,a,u,c,f,m,v,x,I;return(I=(x=(v=(m=(f=(c=(u=(a=(i=(n=this.spacesById[r])!=null?n:this.floorsById[r])!=null?i:this.floorStacksById[r])!=null?a:this.facadesById[r])!=null?u:this.nodesById[r])!=null?c:this.doorsById[r])!=null?f:this.connectionsById[r])!=null?m:this.objectsById[r])!=null?v:this.pointsOfInterestById[r])!=null?x:this.annotationsById[r])!=null?I:this.areasById[r]}getMVFFeatureById(r,n){switch(r){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(r))}}getMVFFeatureByNodeId(r,n){switch(r){case"connection":return this.mvfConnectionsByNodeId[n];default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getMVFFeatureByType(r){switch(r){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getPropTranslation(r,n,i,a){var f,m;if(!this.currentLanguage)return a;let{code:u}=this.currentLanguage,c=(m=(f=this.languagePacks[u])==null?void 0:f.optimized)==null?void 0:m[r];if(c){let v=c[i];if(v!=null&&v[n]!==void 0)return v[n]}return a}findPreferredLanguage(r){if(!this.venue)return;let n=wL(this.venue,r);return(r==null?void 0:r.languageCode)!=null&&r.languageCode.toLowerCase()!==n.code.toLowerCase()&&ae.warn('Language code "'.concat(r.languageCode,'" could not be found in the venue. Using "').concat(n.code,'" instead.')),n}async changeLanguage(r){var c;let n=r.toLowerCase();if(!n){ae.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){ae.error("Changing the language is not supported for this map.");return}let i=this.currentLanguage.code,a=(c=this.venue)==null?void 0:c.languages.find(({code:f})=>f.toLowerCase()===n.toLowerCase());if(!a){ae.warn('Language code "'.concat(n,'" could not be found in the venue.'));return}if(i===a.code)return;let u=this.languagePacks[a.code];if(!u){let f=this.localePacksUrls[a.code];if(!f){ae.error('Locale pack URL not found for language code "'.concat(a.code,'".'));return}d(this,Z0)&&d(this,Z0).abort();let m=new AbortController;$(this,Z0,m);let v;try{v=await VU(f,{signal:m.signal})}catch(x){ae.error('Failed to download language pack for language code "'.concat(a.code,'".'),x);return}if(!v||m.signal.aborted)return;u=hT(v),this.languagePacks[a.code]=u}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=a,this.publish("language-change",this.currentLanguage)}getDistance(r,n){let i=J1(r),a=J1(n);return qa([i.longitude,i.latitude],[a.longitude,a.latitude])}async toJSONBundle({downloadLanguagePacks:r=!0}={}){var i;let n=[];if(r&&this.enterpriseMode){let a=new AbortController;for(let u of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[u.code]){let c=await V4(this.localePacksUrls[u.code],{signal:a.signal}),f=await qv(c);f&&n.push({language:{code:u.code,name:u.name},localePack:f})}}catch(c){ae.warn("failed downloading language pack",c)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:r=!0}={}){var i;if(!this.binaryBundle){ae.error("binary bundle not found");return}let n=[];if(r&&this.enterpriseMode){let a=new AbortController;for(let u of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[u.code]){let c=await V4(this.localePacksUrls[u.code],{signal:a.signal});c&&n.push({language:{code:u.code,name:u.name},localePack:c})}}catch(c){ae.warn("failed downloading language pack",c)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.binaryBundle}}destroy(){for(let r of globalThis.Object.keys(d(this,_t)))d(this,_t)[r]=null}};_t=new WeakMap,J3=new WeakSet,nq=o(function(r){var c;let n=(c=r==null?void 0:r.nodes)==null?void 0:c[0],i=this.getById("node",n);if(i==null)return;let a=ec([i.coordinate.longitude,i.coordinate.latitude]),u=this.connectionSpaceIdsByLatLon[a];return u==null?void 0:u.map(f=>this.connectionsById[f]).find(f=>f!=null)},"#getConnectionFromMVFConnection"),Z0=new WeakMap,o(WL,"MapDataInternal");var nI=WL;var K0,Xm,J0,Bc,Ym=class Ym extends iu{constructor(r,n){super(n.mvfData.id,r);b(this,"__type",Ym.__type);j(this,K0);j(this,Xm);j(this,J0);j(this,Bc,{});$(this,K0,n.mvfData),$(this,Xm,r),$(this,J0,n.floorStackId)}static is(r){return r.__type===Ym.__type}get floorStack(){return d(this,Xm).getById("floor-stack",d(this,J0))}get spaces(){if(!d(this,Bc).spaces){d(this,Bc).spaces=[];for(let r of d(this,K0).spaces){let n=d(this,Xm).getById("space",r.spaceId);n&&d(this,Bc).spaces.push(n)}}return d(this,Bc).spaces}get center(){if(!d(this,Bc).center){let r={type:"FeatureCollection",features:[]};for(let i of this.spaces){let a=d(this,Xm).mvfSpacesById[i.id];a&&r.features.push(a)}if(r.features.length===0)throw new Ro("No geometry found for facade!");let n=qu(r);d(this,Bc).center=new bt({latitude:n.geometry.coordinates[1],longitude:n.geometry.coordinates[0],floorId:d(this,K0).spaces[0].floorId})}return d(this,Bc).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}toJSON(){return{id:this.id,__type:Ym.__type,floorStackId:d(this,J0),floorStack:this.floorStack,spaces:this.spaces}}};K0=new WeakMap,Xm=new WeakMap,J0=new WeakMap,Bc=new WeakMap,o(Ym,"Facade"),b(Ym,"__type","facade");var qL=Ym,su=qL;export{bt as a,Mf as b,Vo as c,q2 as d,su as e,lp as f,Z2 as g,N5 as h,y1e as i,uL as j,pL as k,Lkt as l,Dkt as m};
|