@mappedin/react-sdk 6.0.1-beta.5 → 6.0.1-beta.50
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/README.md +5 -5
- package/THIRD_PARTY_LICENSES.txt +9297 -21275
- package/lib/esm/GLTFExporter-EIH246ZN.js +1 -0
- package/lib/esm/GLTFLoader-VE3GQXID.js +1 -0
- package/lib/esm/browser-FYYPDI6C.js +1 -0
- package/lib/esm/chunk-F5UFIHXS.js +1 -0
- package/lib/esm/chunk-GVWLQYVE.js +1 -0
- package/lib/esm/chunk-I3JSHGEI.js +1 -0
- package/lib/esm/chunk-KJAUUXGW.js +1 -0
- package/lib/esm/chunk-VEDNZ2AM.js +1 -0
- package/lib/esm/{chunk-TQW6Y4JF.js → chunk-VGZGOK6C.js} +1 -1
- package/lib/esm/index.css +1 -1
- package/lib/esm/index.d.ts +12963 -5887
- package/lib/esm/index.js +1 -1
- package/lib/esm/inspector-EE243Q6Y.js +1 -0
- package/lib/esm/inspector-WWR77OPX.css +1 -0
- package/lib/esm/internal-3EBGQSTL.js +1 -0
- package/lib/esm/internal-M7DPGYMI.css +1 -0
- package/lib/esm/outdoor-context-v4-NYXT7FKP.js +1 -0
- package/lib/esm/text3d-NFTCUL32.js +1 -0
- package/package.json +7 -10
- package/lib/esm/GLTFExporter-7Y4D6ZCC.js +0 -1
- package/lib/esm/GLTFLoader-ZJM7FISZ.js +0 -1
- package/lib/esm/browser-B7ZG64S7.js +0 -1
- package/lib/esm/chunk-FO75RVA4.js +0 -1
- package/lib/esm/chunk-HE7T442G.js +0 -1
- package/lib/esm/chunk-OPKWNXJZ.js +0 -1
- package/lib/esm/chunk-WJRLWIOO.js +0 -1
- package/lib/esm/inspector-CS6JK5K3.js +0 -1
- package/lib/esm/inspector-OZDC5DPH.css +0 -1
- package/lib/esm/outdoor-context-v4-R6AN2YQ4.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as Nb,A as Tu,Aa as f0,B as yS,Ba as d0,C as vS,D as pm,E as Ho,F as ps,G as XN,H as ti,I as So,J as YN,K as po,L as KN,M as Ac,N as bS,O as Mi,P as LE,Q as Ns,R as JN,S as fm,T as Eu,U as mn,V as Ar,W as Fb,X as AE,Y as xS,Z as DE,_ as rk,a as yN,aa as nk,b as vN,ba as u0,c as bN,ca as c0,d as ce,da as ik,e as wE,ea as il,f as hS,fa as ok,g as zN,ga as sk,h as a0,ha as FE,i as mS,ia as IS,j as qN,ja as _S,k as gS,ka as ak,l as cm,la as lk,m as Oc,ma as uk,n as HN,na as SS,o as WN,oa as ck,p as ME,pa as pk,q as xn,qa as fk,r as Lt,ra as dk,s as ef,sa as Ll,t as Lc,ta as NE,u as Tn,ua as hk,v as Un,va as mk,w as Bi,wa as dm,x as er,xa as kb,y as l0,ya as p0,z as OE,za as CS}from"./chunk-VEDNZ2AM.js";import{a as ZN,b as Hse,da as tk,l as QN,w as ek}from"./chunk-I3JSHGEI.js";import{a as Al}from"./chunk-VGZGOK6C.js";import{$ as $t,A as CN,Aa as pS,B as lS,Ba as EE,C as uS,Ca as Tc,D as wN,Da as Ec,E as PN,Ea as wu,Fa as fS,G as TN,Ga as RN,H as Yt,Ha as BN,I as wt,Ja as Pu,M as EN,N as MN,O as ON,P as um,Q as pt,R as co,S as LN,T as nl,Ta as s0,U as Kp,V as Jp,W as An,Xa as dS,Y as _o,Ya as jN,Z as Qp,_ as AN,aa as Cu,ab as $N,b as oS,c as sS,ca as Fd,cb as Mc,d as xN,da as DN,db as GN,e as Yp,ea as PE,eb as UN,f as IN,g as Pc,ga as Nd,gb as VN,la as FN,oa as kd,p as _N,pa as NN,q as SN,qa as cS,r as aS,ra as TE,ta as o0,ya as kN,z as Zp,za as Rd}from"./chunk-KJAUUXGW.js";import{a as R,b as re,c as o,d as iS,e as cs,f as fe,g as wc,h as Pn,i as x,j as d,k as G,l as q,m as ke,n as V,o as gN,p as Ve,q as g,r as I}from"./chunk-F5UFIHXS.js";var PS=fe((D7e,yk)=>{"use strict";g();var gk=Object.getOwnPropertySymbols,Kse=Object.prototype.hasOwnProperty,Jse=Object.prototype.propertyIsEnumerable;function Qse(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}o(Qse,"toObject");function eae(){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(s){return t[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch(s){return!1}}o(eae,"shouldUseNative");yk.exports=eae()?Object.assign:function(e,t){for(var r,n=Qse(e),i,s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var l in r)Kse.call(r,l)&&(n[l]=r[l]);if(gk){i=gk(r);for(var c=0;c<i.length;c++)Jse.call(r,i[c])&&(n[i[c]]=r[i[c]])}}return n}});var QE=fe((KE,JE)=>{g();(function(e,t){typeof KE=="object"&&typeof JE<"u"?JE.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(KE,function(){"use strict";function e(w,O,D,A,k){o(function j(W,Y,N,Z,le){for(;Z>N;){if(Z-N>600){var se=Z-N+1,U=Y-N+1,ye=Math.log(se),ne=.5*Math.exp(2*ye/3),Ce=.5*Math.sqrt(ye*ne*(se-ne)/se)*(U-se/2<0?-1:1),Ie=Math.max(N,Math.floor(Y-U*ne/se+Ce)),Ue=Math.min(Z,Math.floor(Y+(se-U)*ne/se+Ce));j(W,Y,Ie,Ue,le)}var ve=W[Y],Te=N,Q=Z;for(t(W,N,Y),le(W[Z],ve)>0&&t(W,N,Z);Te<Q;){for(t(W,Te,Q),Te++,Q--;le(W[Te],ve)<0;)Te++;for(;le(W[Q],ve)>0;)Q--}le(W[N],ve)===0?t(W,N,Q):t(W,++Q,Z),Q<=Y&&(N=Q+1),Y<=Q&&(Z=Q-1)}},"t")(w,O,D||0,A||w.length-1,k||r)}o(e,"t");function t(w,O,D){var A=w[O];w[O]=w[D],w[D]=A}o(t,"i");function r(w,O){return w<O?-1:w>O?1:0}o(r,"n");var n=o(function(w){w===void 0&&(w=9),this._maxEntries=Math.max(4,w),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function i(w,O,D){if(!D)return O.indexOf(w);for(var A=0;A<O.length;A++)if(D(w,O[A]))return A;return-1}o(i,"e");function s(w,O){l(w,0,w.children.length,O,w)}o(s,"a");function l(w,O,D,A,k){k||(k=P(null)),k.minX=1/0,k.minY=1/0,k.maxX=-1/0,k.maxY=-1/0;for(var j=O;j<D;j++){var W=w.children[j];c(k,w.leaf?A(W):W)}return k}o(l,"h");function c(w,O){return w.minX=Math.min(w.minX,O.minX),w.minY=Math.min(w.minY,O.minY),w.maxX=Math.max(w.maxX,O.maxX),w.maxY=Math.max(w.maxY,O.maxY),w}o(c,"o");function p(w,O){return w.minX-O.minX}o(p,"s");function h(w,O){return w.minY-O.minY}o(h,"l");function y(w){return(w.maxX-w.minX)*(w.maxY-w.minY)}o(y,"f");function b(w){return w.maxX-w.minX+(w.maxY-w.minY)}o(b,"u");function _(w,O){return w.minX<=O.minX&&w.minY<=O.minY&&O.maxX<=w.maxX&&O.maxY<=w.maxY}o(_,"m");function C(w,O){return O.minX<=w.maxX&&O.minY<=w.maxY&&O.maxX>=w.minX&&O.maxY>=w.minY}o(C,"c");function P(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}o(P,"p");function E(w,O,D,A,k){for(var j=[O,D];j.length;)if(!((D=j.pop())-(O=j.pop())<=A)){var W=O+Math.ceil((D-O)/A/2)*A;e(w,W,O,D,k),j.push(O,W,W,D)}}return o(E,"d"),n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(w){var O=this.data,D=[];if(!C(w,O))return D;for(var A=this.toBBox,k=[];O;){for(var j=0;j<O.children.length;j++){var W=O.children[j],Y=O.leaf?A(W):W;C(w,Y)&&(O.leaf?D.push(W):_(w,Y)?this._all(W,D):k.push(W))}O=k.pop()}return D},n.prototype.collides=function(w){var O=this.data;if(!C(w,O))return!1;for(var D=[];O;){for(var A=0;A<O.children.length;A++){var k=O.children[A],j=O.leaf?this.toBBox(k):k;if(C(w,j)){if(O.leaf||_(w,j))return!0;D.push(k)}}O=D.pop()}return!1},n.prototype.load=function(w){if(!w||!w.length)return this;if(w.length<this._minEntries){for(var O=0;O<w.length;O++)this.insert(w[O]);return this}var D=this._build(w.slice(),0,w.length-1,0);if(this.data.children.length)if(this.data.height===D.height)this._splitRoot(this.data,D);else{if(this.data.height<D.height){var A=this.data;this.data=D,D=A}this._insert(D,this.data.height-D.height-1,!0)}else this.data=D;return this},n.prototype.insert=function(w){return w&&this._insert(w,this.data.height-1),this},n.prototype.clear=function(){return this.data=P([]),this},n.prototype.remove=function(w,O){if(!w)return this;for(var D,A,k,j=this.data,W=this.toBBox(w),Y=[],N=[];j||Y.length;){if(j||(j=Y.pop(),A=Y[Y.length-1],D=N.pop(),k=!0),j.leaf){var Z=i(w,j.children,O);if(Z!==-1)return j.children.splice(Z,1),Y.push(j),this._condense(Y),this}k||j.leaf||!_(j,W)?A?(D++,j=A.children[D],k=!1):j=null:(Y.push(j),N.push(D),D=0,A=j,j=j.children[0])}return this},n.prototype.toBBox=function(w){return w},n.prototype.compareMinX=function(w,O){return w.minX-O.minX},n.prototype.compareMinY=function(w,O){return w.minY-O.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(w){return this.data=w,this},n.prototype._all=function(w,O){for(var D=[];w;)w.leaf?O.push.apply(O,w.children):D.push.apply(D,w.children),w=D.pop();return O},n.prototype._build=function(w,O,D,A){var k,j=D-O+1,W=this._maxEntries;if(j<=W)return s(k=P(w.slice(O,D+1)),this.toBBox),k;A||(A=Math.ceil(Math.log(j)/Math.log(W)),W=Math.ceil(j/Math.pow(W,A-1))),(k=P([])).leaf=!1,k.height=A;var Y=Math.ceil(j/W),N=Y*Math.ceil(Math.sqrt(W));E(w,O,D,N,this.compareMinX);for(var Z=O;Z<=D;Z+=N){var le=Math.min(Z+N-1,D);E(w,Z,le,Y,this.compareMinY);for(var se=Z;se<=le;se+=Y){var U=Math.min(se+Y-1,le);k.children.push(this._build(w,se,U,A-1))}}return s(k,this.toBBox),k},n.prototype._chooseSubtree=function(w,O,D,A){for(;A.push(O),!O.leaf&&A.length-1!==D;){for(var k=1/0,j=1/0,W=void 0,Y=0;Y<O.children.length;Y++){var N=O.children[Y],Z=y(N),le=(se=w,U=N,(Math.max(U.maxX,se.maxX)-Math.min(U.minX,se.minX))*(Math.max(U.maxY,se.maxY)-Math.min(U.minY,se.minY))-Z);le<j?(j=le,k=Z<k?Z:k,W=N):le===j&&Z<k&&(k=Z,W=N)}O=W||O.children[0]}var se,U;return O},n.prototype._insert=function(w,O,D){var A=D?w:this.toBBox(w),k=[],j=this._chooseSubtree(A,this.data,O,k);for(j.children.push(w),c(j,A);O>=0&&k[O].children.length>this._maxEntries;)this._split(k,O),O--;this._adjustParentBBoxes(A,k,O)},n.prototype._split=function(w,O){var D=w[O],A=D.children.length,k=this._minEntries;this._chooseSplitAxis(D,k,A);var j=this._chooseSplitIndex(D,k,A),W=P(D.children.splice(j,D.children.length-j));W.height=D.height,W.leaf=D.leaf,s(D,this.toBBox),s(W,this.toBBox),O?w[O-1].children.push(W):this._splitRoot(D,W)},n.prototype._splitRoot=function(w,O){this.data=P([w,O]),this.data.height=w.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(w,O,D){for(var A,k,j,W,Y,N,Z,le=1/0,se=1/0,U=O;U<=D-O;U++){var ye=l(w,0,U,this.toBBox),ne=l(w,U,D,this.toBBox),Ce=(k=ye,j=ne,W=void 0,Y=void 0,N=void 0,Z=void 0,W=Math.max(k.minX,j.minX),Y=Math.max(k.minY,j.minY),N=Math.min(k.maxX,j.maxX),Z=Math.min(k.maxY,j.maxY),Math.max(0,N-W)*Math.max(0,Z-Y)),Ie=y(ye)+y(ne);Ce<le?(le=Ce,A=U,se=Ie<se?Ie:se):Ce===le&&Ie<se&&(se=Ie,A=U)}return A||D-O},n.prototype._chooseSplitAxis=function(w,O,D){var A=w.leaf?this.compareMinX:p,k=w.leaf?this.compareMinY:h;this._allDistMargin(w,O,D,A)<this._allDistMargin(w,O,D,k)&&w.children.sort(A)},n.prototype._allDistMargin=function(w,O,D,A){w.children.sort(A);for(var k=this.toBBox,j=l(w,0,O,k),W=l(w,D-O,D,k),Y=b(j)+b(W),N=O;N<D-O;N++){var Z=w.children[N];c(j,w.leaf?k(Z):Z),Y+=b(j)}for(var le=D-O-1;le>=O;le--){var se=w.children[le];c(W,w.leaf?k(se):se),Y+=b(W)}return Y},n.prototype._adjustParentBBoxes=function(w,O,D){for(var A=D;A>=0;A--)c(O[A],w)},n.prototype._condense=function(w){for(var O=w.length-1,D=void 0;O>=0;O--)w[O].children.length===0?O>0?(D=w[O-1].children).splice(D.indexOf(w[O]),1):this.clear():s(w[O],this.toBBox)},n})});var bk=fe((q7e,vk)=>{g();vk.exports=o(function(t,r,n,i){var s=t[0],l=t[1],c=!1;n===void 0&&(n=0),i===void 0&&(i=r.length);for(var p=(i-n)/2,h=0,y=p-1;h<p;y=h++){var b=r[n+h*2+0],_=r[n+h*2+1],C=r[n+y*2+0],P=r[n+y*2+1],E=_>l!=P>l&&s<(C-b)*(l-_)/(P-_)+b;E&&(c=!c)}return c},"pointInPolygonFlat")});var Ik=fe((X7e,xk)=>{g();xk.exports=o(function(t,r,n,i){var s=t[0],l=t[1],c=!1;n===void 0&&(n=0),i===void 0&&(i=r.length);for(var p=i-n,h=0,y=p-1;h<p;y=h++){var b=r[h+n][0],_=r[h+n][1],C=r[y+n][0],P=r[y+n][1],E=_>l!=P>l&&s<(C-b)*(l-_)/(P-_)+b;E&&(c=!c)}return c},"pointInPolygonNested")});var Ck=fe((K7e,ES)=>{g();var _k=bk(),Sk=Ik();ES.exports=o(function(t,r,n,i){return r.length>0&&Array.isArray(r[0])?Sk(t,r,n,i):_k(t,r,n,i)},"pointInPolygon");ES.exports.nested=Sk;ES.exports.flat=_k});var Pk=fe((MS,wk)=>{g();(function(e,t){typeof MS=="object"&&typeof wk<"u"?t(MS):typeof define=="function"&&define.amd?define(["exports"],t):t((e=e||self).predicates={})})(MS,function(e){"use strict";let r=33306690738754706e-32;function n(C,P,E,w,O){let D,A,k,j,W=P[0],Y=w[0],N=0,Z=0;Y>W==Y>-W?(D=W,W=P[++N]):(D=Y,Y=w[++Z]);let le=0;if(N<C&&Z<E)for(Y>W==Y>-W?(k=D-((A=W+D)-W),W=P[++N]):(k=D-((A=Y+D)-Y),Y=w[++Z]),D=A,k!==0&&(O[le++]=k);N<C&&Z<E;)Y>W==Y>-W?(k=D-((A=D+W)-(j=A-D))+(W-j),W=P[++N]):(k=D-((A=D+Y)-(j=A-D))+(Y-j),Y=w[++Z]),D=A,k!==0&&(O[le++]=k);for(;N<C;)k=D-((A=D+W)-(j=A-D))+(W-j),W=P[++N],D=A,k!==0&&(O[le++]=k);for(;Z<E;)k=D-((A=D+Y)-(j=A-D))+(Y-j),Y=w[++Z],D=A,k!==0&&(O[le++]=k);return D===0&&le!==0||(O[le++]=D),le}o(n,"r");function i(C){return new Float64Array(C)}o(i,"o");let s=33306690738754716e-32,l=22204460492503146e-32,c=11093356479670487e-47,p=i(4),h=i(8),y=i(12),b=i(16),_=i(4);e.orient2d=function(C,P,E,w,O,D){let A=(P-D)*(E-O),k=(C-O)*(w-D),j=A-k;if(A===0||k===0||A>0!=k>0)return j;let W=Math.abs(A+k);return Math.abs(j)>=s*W?j:-function(Y,N,Z,le,se,U,ye){let ne,Ce,Ie,Ue,ve,Te,Q,Qe,Ye,nt,Ae,Be,We,$e,we,H,ie,ee,Me=Y-se,Ne=Z-se,Oe=N-U,Ze=le-U;ve=(we=(Qe=Me-(Q=(Te=134217729*Me)-(Te-Me)))*(nt=Ze-(Ye=(Te=134217729*Ze)-(Te-Ze)))-(($e=Me*Ze)-Q*Ye-Qe*Ye-Q*nt))-(Ae=we-(ie=(Qe=Oe-(Q=(Te=134217729*Oe)-(Te-Oe)))*(nt=Ne-(Ye=(Te=134217729*Ne)-(Te-Ne)))-((H=Oe*Ne)-Q*Ye-Qe*Ye-Q*nt))),p[0]=we-(Ae+ve)+(ve-ie),ve=(We=$e-((Be=$e+Ae)-(ve=Be-$e))+(Ae-ve))-(Ae=We-H),p[1]=We-(Ae+ve)+(ve-H),ve=(ee=Be+Ae)-Be,p[2]=Be-(ee-ve)+(Ae-ve),p[3]=ee;let Pt=function(es,Ro){let Js=Ro[0];for(let Ri=1;Ri<es;Ri++)Js+=Ro[Ri];return Js}(4,p),Er=l*ye;if(Pt>=Er||-Pt>=Er||(ne=Y-(Me+(ve=Y-Me))+(ve-se),Ie=Z-(Ne+(ve=Z-Ne))+(ve-se),Ce=N-(Oe+(ve=N-Oe))+(ve-U),Ue=le-(Ze+(ve=le-Ze))+(ve-U),ne===0&&Ce===0&&Ie===0&&Ue===0)||(Er=c*ye+r*Math.abs(Pt),(Pt+=Me*Ue+Ze*ne-(Oe*Ie+Ne*Ce))>=Er||-Pt>=Er))return Pt;ve=(we=(Qe=ne-(Q=(Te=134217729*ne)-(Te-ne)))*(nt=Ze-(Ye=(Te=134217729*Ze)-(Te-Ze)))-(($e=ne*Ze)-Q*Ye-Qe*Ye-Q*nt))-(Ae=we-(ie=(Qe=Ce-(Q=(Te=134217729*Ce)-(Te-Ce)))*(nt=Ne-(Ye=(Te=134217729*Ne)-(Te-Ne)))-((H=Ce*Ne)-Q*Ye-Qe*Ye-Q*nt))),_[0]=we-(Ae+ve)+(ve-ie),ve=(We=$e-((Be=$e+Ae)-(ve=Be-$e))+(Ae-ve))-(Ae=We-H),_[1]=We-(Ae+ve)+(ve-H),ve=(ee=Be+Ae)-Be,_[2]=Be-(ee-ve)+(Ae-ve),_[3]=ee;let $n=n(4,p,4,_,h);ve=(we=(Qe=Me-(Q=(Te=134217729*Me)-(Te-Me)))*(nt=Ue-(Ye=(Te=134217729*Ue)-(Te-Ue)))-(($e=Me*Ue)-Q*Ye-Qe*Ye-Q*nt))-(Ae=we-(ie=(Qe=Oe-(Q=(Te=134217729*Oe)-(Te-Oe)))*(nt=Ie-(Ye=(Te=134217729*Ie)-(Te-Ie)))-((H=Oe*Ie)-Q*Ye-Qe*Ye-Q*nt))),_[0]=we-(Ae+ve)+(ve-ie),ve=(We=$e-((Be=$e+Ae)-(ve=Be-$e))+(Ae-ve))-(Ae=We-H),_[1]=We-(Ae+ve)+(ve-H),ve=(ee=Be+Ae)-Be,_[2]=Be-(ee-ve)+(Ae-ve),_[3]=ee;let ot=n($n,h,4,_,y);ve=(we=(Qe=ne-(Q=(Te=134217729*ne)-(Te-ne)))*(nt=Ue-(Ye=(Te=134217729*Ue)-(Te-Ue)))-(($e=ne*Ue)-Q*Ye-Qe*Ye-Q*nt))-(Ae=we-(ie=(Qe=Ce-(Q=(Te=134217729*Ce)-(Te-Ce)))*(nt=Ie-(Ye=(Te=134217729*Ie)-(Te-Ie)))-((H=Ce*Ie)-Q*Ye-Qe*Ye-Q*nt))),_[0]=we-(Ae+ve)+(ve-ie),ve=(We=$e-((Be=$e+Ae)-(ve=Be-$e))+(Ae-ve))-(Ae=We-H),_[1]=We-(Ae+ve)+(ve-H),ve=(ee=Be+Ae)-Be,_[2]=Be-(ee-ve)+(Ae-ve),_[3]=ee;let zt=n(ot,y,4,_,b);return b[zt-1]}(C,P,E,w,O,D,W)},e.orient2dfast=function(C,P,E,w,O,D){return(P-D)*(E-O)-(C-O)*(w-D)},Object.defineProperty(e,"__esModule",{value:!0})})});var Ak=fe((rDe,nM)=>{"use strict";g();var Tk=QE(),LS=ZN(),rae=Ck(),nae=Pk().orient2d;LS.default&&(LS=LS.default);nM.exports=Lk;nM.exports.default=Lk;function Lk(e,t,r){t=Math.max(0,t===void 0?2:t),r=r||0;var n=lae(e),i=new Tk(16);i.toBBox=function(D){return{minX:D[0],minY:D[1],maxX:D[0],maxY:D[1]}},i.compareMinX=function(D,A){return D[0]-A[0]},i.compareMinY=function(D,A){return D[1]-A[1]},i.load(e);for(var s=[],l=0,c;l<n.length;l++){var p=n[l];i.remove(p),c=Ok(p,c),s.push(c)}var h=new Tk(16);for(l=0;l<s.length;l++)h.insert(eM(s[l]));for(var y=t*t,b=r*r;s.length;){var _=s.shift(),C=_.p,P=_.next.p,E=tM(C,P);if(!(E<b)){var w=E/y;p=iae(i,_.prev.p,C,P,_.next.next.p,w,h),p&&Math.min(tM(p,C),tM(p,P))<=w&&(s.push(_),s.push(Ok(p,_)),i.remove(p),h.remove(_),h.insert(eM(_)),h.insert(eM(_.next)))}}_=c;var O=[];do O.push(_.p),_=_.next;while(_!==c);return O.push(_.p),O}o(Lk,"concaveman");function iae(e,t,r,n,i,s,l){for(var c=new LS([],oae),p=e.data;p;){for(var h=0;h<p.children.length;h++){var y=p.children[h],b=p.leaf?rM(y,r,n):sae(r,n,y);b>s||c.push({node:y,dist:b})}for(;c.length&&!c.peek().node.children;){var _=c.pop(),C=_.node,P=rM(C,t,r),E=rM(C,n,i);if(_.dist<P&&_.dist<E&&Mk(r,C,l)&&Mk(n,C,l))return C}p=c.pop(),p&&(p=p.node)}return null}o(iae,"findCandidate");function oae(e,t){return e.dist-t.dist}o(oae,"compareDist");function sae(e,t,r){if(Ek(e,r)||Ek(t,r))return 0;var n=OS(e[0],e[1],t[0],t[1],r.minX,r.minY,r.maxX,r.minY);if(n===0)return 0;var i=OS(e[0],e[1],t[0],t[1],r.minX,r.minY,r.minX,r.maxY);if(i===0)return 0;var s=OS(e[0],e[1],t[0],t[1],r.maxX,r.minY,r.maxX,r.maxY);if(s===0)return 0;var l=OS(e[0],e[1],t[0],t[1],r.minX,r.maxY,r.maxX,r.maxY);return l===0?0:Math.min(n,i,s,l)}o(sae,"sqSegBoxDist");function Ek(e,t){return e[0]>=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}o(Ek,"inside");function Mk(e,t,r){for(var n=Math.min(e[0],t[0]),i=Math.min(e[1],t[1]),s=Math.max(e[0],t[0]),l=Math.max(e[1],t[1]),c=r.search({minX:n,minY:i,maxX:s,maxY:l}),p=0;p<c.length;p++)if(aae(c[p].p,c[p].next.p,e,t))return!1;return!0}o(Mk,"noIntersections");function b0(e,t,r){return nae(e[0],e[1],t[0],t[1],r[0],r[1])}o(b0,"cross");function aae(e,t,r,n){return e!==n&&t!==r&&b0(e,t,r)>0!=b0(e,t,n)>0&&b0(r,n,e)>0!=b0(r,n,t)>0}o(aae,"intersects");function eM(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(eM,"updateBBox");function lae(e){for(var t=e[0],r=e[0],n=e[0],i=e[0],s=0;s<e.length;s++){var l=e[s];l[0]<t[0]&&(t=l),l[0]>n[0]&&(n=l),l[1]<r[1]&&(r=l),l[1]>i[1]&&(i=l)}var c=[t,r,n,i],p=c.slice();for(s=0;s<e.length;s++)rae(e[s],c)||p.push(e[s]);return cae(p)}o(lae,"fastConvexHull");function Ok(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(Ok,"insertNode");function tM(e,t){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}o(tM,"getSqDist");function rM(e,t,r){var n=t[0],i=t[1],s=r[0]-n,l=r[1]-i;if(s!==0||l!==0){var c=((e[0]-n)*s+(e[1]-i)*l)/(s*s+l*l);c>1?(n=r[0],i=r[1]):c>0&&(n+=s*c,i+=l*c)}return s=e[0]-n,l=e[1]-i,s*s+l*l}o(rM,"sqSegDist");function OS(e,t,r,n,i,s,l,c){var p=r-e,h=n-t,y=l-i,b=c-s,_=e-i,C=t-s,P=p*p+h*h,E=p*y+h*b,w=y*y+b*b,O=p*_+h*C,D=y*_+b*C,A=P*w-E*E,k,j,W,Y,N=A,Z=A;A===0?(j=0,N=1,Y=D,Z=w):(j=E*D-w*O,Y=P*D-E*O,j<0?(j=0,Y=D,Z=w):j>N&&(j=N,Y=D+E,Z=w)),Y<0?(Y=0,-O<0?j=0:-O>P?j=N:(j=-O,N=P)):Y>Z&&(Y=Z,-O+E<0?j=0:-O+E>P?j=N:(j=-O+E,N=P)),k=j===0?0:j/N,W=Y===0?0:Y/Z;var le=(1-k)*e+k*r,se=(1-k)*t+k*n,U=(1-W)*i+W*l,ye=(1-W)*s+W*c,ne=U-le,Ce=ye-se;return ne*ne+Ce*Ce}o(OS,"sqSegSegDist");function uae(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}o(uae,"compareByX");function cae(e){e.sort(uae);for(var t=[],r=0;r<e.length;r++){for(;t.length>=2&&b0(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&&b0(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(cae,"convexHull")});var Rk=fe((oM,sM)=>{g();(function(e,t){typeof oM=="object"&&typeof sM<"u"?sM.exports=t():typeof define=="function"&&define.amd?define(t):e.quickselect=t()})(oM,function(){"use strict";function e(i,s,l,c,p){t(i,s,l||0,c||i.length-1,p||n)}o(e,"quickselect");function t(i,s,l,c,p){for(;c>l;){if(c-l>600){var h=c-l+1,y=s-l+1,b=Math.log(h),_=.5*Math.exp(2*b/3),C=.5*Math.sqrt(b*_*(h-_)/h)*(y-h/2<0?-1:1),P=Math.max(l,Math.floor(s-y*_/h+C)),E=Math.min(c,Math.floor(s+(h-y)*_/h+C));t(i,s,P,E,p)}var w=i[s],O=l,D=c;for(r(i,l,s),p(i[c],w)>0&&r(i,l,c);O<D;){for(r(i,O,D),O++,D--;p(i[O],w)<0;)O++;for(;p(i[D],w)>0;)D--}p(i[l],w)===0?r(i,l,D):(D++,r(i,D,c)),D<=s&&(l=D+1),s<=D&&(c=D-1)}}o(t,"quickselectStep");function r(i,s,l){var c=i[s];i[s]=i[l],i[l]=c}o(r,"swap");function n(i,s){return i<s?-1:i>s?1:0}return o(n,"defaultCompare"),e})});var cM=fe((JNe,uM)=>{"use strict";g();uM.exports=qb;uM.exports.default=qb;var Cae=Rk();function qb(e,t){if(!(this instanceof qb))return new qb(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(qb,"rbush");qb.prototype={all:o(function(){return this._all(this.data,[])},"all"),search:o(function(e){var t=this.data,r=[],n=this.toBBox;if(!DS(e,t))return r;for(var i=[],s,l,c,p;t;){for(s=0,l=t.children.length;s<l;s++)c=t.children[s],p=t.leaf?n(c):c,DS(e,p)&&(t.leaf?r.push(c):lM(e,p)?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(!DS(e,t))return!1;for(var n=[],i,s,l,c;t;){for(i=0,s=t.children.length;i<s;i++)if(l=t.children[i],c=t.leaf?r(l):l,DS(e,c)){if(t.leaf||lM(e,c))return!0;n.push(l)}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=_0([]),this},"clear"),remove:o(function(e,t){if(!e)return this;for(var r=this.data,n=this.toBBox(e),i=[],s=[],l,c,p,h;r||i.length;){if(r||(r=i.pop(),c=i[i.length-1],l=s.pop(),h=!0),r.leaf&&(p=wae(e,r.children,t),p!==-1))return r.children.splice(p,1),i.push(r),this._condense(i),this;!h&&!r.leaf&&lM(r,n)?(i.push(r),s.push(l),l=0,c=r,r=r.children[0]):c?(l++,r=c.children[l],h=!1):r=null}return this},"remove"),toBBox:o(function(e){return e},"toBBox"),compareMinX:Bk,compareMinY:jk,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,s=this._maxEntries,l;if(i<=s)return l=_0(e.slice(t,r+1)),I0(l,this.toBBox),l;n||(n=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,n-1))),l=_0([]),l.leaf=!1,l.height=n;var c=Math.ceil(i/s),p=c*Math.ceil(Math.sqrt(s)),h,y,b,_;for($k(e,t,r,p,this.compareMinX),h=t;h<=r;h+=p)for(b=Math.min(h+p-1,r),$k(e,h,b,c,this.compareMinY),y=h;y<=b;y+=c)_=Math.min(y+c-1,b),l.children.push(this._build(e,y,_,n-1));return I0(l,this.toBBox),l},"_build"),_chooseSubtree:o(function(e,t,r,n){for(var i,s,l,c,p,h,y,b;n.push(t),!(t.leaf||n.length-1===r);){for(y=b=1/0,i=0,s=t.children.length;i<s;i++)l=t.children[i],p=aM(l),h=Pae(e,l)-p,h<b?(b=h,y=p<y?p:y,c=l):h===b&&p<y&&(y=p,c=l);t=c||t.children[0]}return t},"_chooseSubtree"),_insert:o(function(e,t,r){var n=this.toBBox,i=r?e:n(e),s=[],l=this._chooseSubtree(i,this.data,t,s);for(l.children.push(e),zb(l,i);t>=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(i,s,t)},"_insert"),_split:o(function(e,t){var r=e[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var s=this._chooseSplitIndex(r,i,n),l=_0(r.children.splice(s,r.children.length-s));l.height=r.height,l.leaf=r.leaf,I0(r,this.toBBox),I0(l,this.toBBox),t?e[t-1].children.push(l):this._splitRoot(r,l)},"_split"),_splitRoot:o(function(e,t){this.data=_0([e,t]),this.data.height=e.height+1,this.data.leaf=!1,I0(this.data,this.toBBox)},"_splitRoot"),_chooseSplitIndex:o(function(e,t,r){var n,i,s,l,c,p,h,y;for(p=h=1/0,n=t;n<=r-t;n++)i=Vb(e,0,n,this.toBBox),s=Vb(e,n,r,this.toBBox),l=Tae(i,s),c=aM(i)+aM(s),l<p?(p=l,y=n,h=c<h?c:h):l===p&&c<h&&(h=c,y=n);return y},"_chooseSplitIndex"),_chooseSplitAxis:o(function(e,t,r){var n=e.leaf?this.compareMinX:Bk,i=e.leaf?this.compareMinY:jk,s=this._allDistMargin(e,t,r,n),l=this._allDistMargin(e,t,r,i);s<l&&e.children.sort(n)},"_chooseSplitAxis"),_allDistMargin:o(function(e,t,r,n){e.children.sort(n);var i=this.toBBox,s=Vb(e,0,t,i),l=Vb(e,r-t,r,i),c=AS(s)+AS(l),p,h;for(p=t;p<r-t;p++)h=e.children[p],zb(s,e.leaf?i(h):h),c+=AS(s);for(p=r-t-1;p>=t;p--)h=e.children[p],zb(l,e.leaf?i(h):h),c+=AS(l);return c},"_allDistMargin"),_adjustParentBBoxes:o(function(e,t,r){for(var n=r;n>=0;n--)zb(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():I0(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 wae(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(wae,"findItem");function I0(e,t){Vb(e,0,e.children.length,t,e)}o(I0,"calcBBox");function Vb(e,t,r,n,i){i||(i=_0(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var s=t,l;s<r;s++)l=e.children[s],zb(i,e.leaf?n(l):l);return i}o(Vb,"distBBox");function zb(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(zb,"extend");function Bk(e,t){return e.minX-t.minX}o(Bk,"compareNodeMinX");function jk(e,t){return e.minY-t.minY}o(jk,"compareNodeMinY");function aM(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}o(aM,"bboxArea");function AS(e){return e.maxX-e.minX+(e.maxY-e.minY)}o(AS,"bboxMargin");function Pae(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(Pae,"enlargedArea");function Tae(e,t){var r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,s-n)}o(Tae,"intersectionArea");function lM(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}o(lM,"contains");function DS(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}o(DS,"intersects");function _0(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}o(_0,"createNode");function $k(e,t,r,n,i){for(var s=[t,r],l;s.length;)r=s.pop(),t=s.pop(),!(r-t<=n)&&(l=t+Math.ceil((r-t)/n/2)*n,Cae(e,l,t,r,i),s.push(t,l,l,r))}o($k,"multiSelect")});var gM=fe(Et=>{"use strict";g();Object.defineProperty(Et,"__esModule",{value:!0});Et.earthRadius=63710088e-1;Et.factors={centimeters:Et.earthRadius*100,centimetres:Et.earthRadius*100,degrees:Et.earthRadius/111325,feet:Et.earthRadius*3.28084,inches:Et.earthRadius*39.37,kilometers:Et.earthRadius/1e3,kilometres:Et.earthRadius/1e3,meters:Et.earthRadius,metres:Et.earthRadius,miles:Et.earthRadius/1609.344,millimeters:Et.earthRadius*1e3,millimetres:Et.earthRadius*1e3,nauticalmiles:Et.earthRadius/1852,radians:1,yards:Et.earthRadius*1.0936};Et.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/Et.earthRadius,yards:1.0936133};Et.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 zd(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(zd,"feature");Et.feature=zd;function $ae(e,t,r){switch(r===void 0&&(r={}),e){case"Point":return fM(t).geometry;case"LineString":return hM(t).geometry;case"Polygon":return dM(t).geometry;case"MultiPoint":return Uk(t).geometry;case"MultiLineString":return Gk(t).geometry;case"MultiPolygon":return Vk(t).geometry;default:throw new Error(e+" is invalid")}}o($ae,"geometry");Et.geometry=$ae;function fM(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(!NS(e[0])||!NS(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return zd(n,t,r)}o(fM,"point");Et.point=fM;function Gae(e,t,r){return r===void 0&&(r={}),kS(e.map(function(n){return fM(n,t)}),r)}o(Gae,"points");Et.points=Gae;function dM(e,t,r){r===void 0&&(r={});for(var n=0,i=e;n<i.length;n++){var s=i[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var l=0;l<s[s.length-1].length;l++)if(s[s.length-1][l]!==s[0][l])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:e};return zd(c,t,r)}o(dM,"polygon");Et.polygon=dM;function Uae(e,t,r){return r===void 0&&(r={}),kS(e.map(function(n){return dM(n,t)}),r)}o(Uae,"polygons");Et.polygons=Uae;function hM(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 zd(n,t,r)}o(hM,"lineString");Et.lineString=hM;function Vae(e,t,r){return r===void 0&&(r={}),kS(e.map(function(n){return hM(n,t)}),r)}o(Vae,"lineStrings");Et.lineStrings=Vae;function kS(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(kS,"featureCollection");Et.featureCollection=kS;function Gk(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return zd(n,t,r)}o(Gk,"multiLineString");Et.multiLineString=Gk;function Uk(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return zd(n,t,r)}o(Uk,"multiPoint");Et.multiPoint=Uk;function Vk(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return zd(n,t,r)}o(Vk,"multiPolygon");Et.multiPolygon=Vk;function zae(e,t,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:e};return zd(n,t,r)}o(zae,"geometryCollection");Et.geometryCollection=zae;function qae(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(qae,"round");Et.round=qae;function zk(e,t){t===void 0&&(t="kilometers");var r=Et.factors[t];if(!r)throw new Error(t+" units is invalid");return e*r}o(zk,"radiansToLength");Et.radiansToLength=zk;function mM(e,t){t===void 0&&(t="kilometers");var r=Et.factors[t];if(!r)throw new Error(t+" units is invalid");return e/r}o(mM,"lengthToRadians");Et.lengthToRadians=mM;function Hae(e,t){return qk(mM(e,t))}o(Hae,"lengthToDegrees");Et.lengthToDegrees=Hae;function Wae(e){var t=e%360;return t<0&&(t+=360),t}o(Wae,"bearingToAzimuth");Et.bearingToAzimuth=Wae;function qk(e){var t=e%(2*Math.PI);return t*180/Math.PI}o(qk,"radiansToDegrees");Et.radiansToDegrees=qk;function Xae(e){var t=e%360;return t*Math.PI/180}o(Xae,"degreesToRadians");Et.degreesToRadians=Xae;function Yae(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 zk(mM(e,t),r)}o(Yae,"convertLength");Et.convertLength=Yae;function Zae(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=Et.areaFactors[t];if(!n)throw new Error("invalid original units");var i=Et.areaFactors[r];if(!i)throw new Error("invalid final units");return e/n*i}o(Zae,"convertArea");Et.convertArea=Zae;function NS(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}o(NS,"isNumber");Et.isNumber=NS;function Kae(e){return!!e&&e.constructor===Object}o(Kae,"isObject");Et.isObject=Kae;function Jae(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(!NS(t))throw new Error("bbox must only contain numbers")})}o(Jae,"validateBBox");Et.validateBBox=Jae;function Qae(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(Qae,"validateId");Et.validateId=Qae});var vM=fe(Po=>{"use strict";g();Object.defineProperty(Po,"__esModule",{value:!0});var Rs=gM();function Wb(e,t,r){if(e!==null)for(var n,i,s,l,c,p,h,y=0,b=0,_,C=e.type,P=C==="FeatureCollection",E=C==="Feature",w=P?e.features.length:1,O=0;O<w;O++){h=P?e.features[O].geometry:E?e.geometry:e,_=h?h.type==="GeometryCollection":!1,c=_?h.geometries.length:1;for(var D=0;D<c;D++){var A=0,k=0;if(l=_?h.geometries[D]:h,l!==null){p=l.coordinates;var j=l.type;switch(y=r&&(j==="Polygon"||j==="MultiPolygon")?1:0,j){case null:break;case"Point":if(t(p,b,O,A,k)===!1)return!1;b++,A++;break;case"LineString":case"MultiPoint":for(n=0;n<p.length;n++){if(t(p[n],b,O,A,k)===!1)return!1;b++,j==="MultiPoint"&&A++}j==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(n=0;n<p.length;n++){for(i=0;i<p[n].length-y;i++){if(t(p[n][i],b,O,A,k)===!1)return!1;b++}j==="MultiLineString"&&A++,j==="Polygon"&&k++}j==="Polygon"&&A++;break;case"MultiPolygon":for(n=0;n<p.length;n++){for(k=0,i=0;i<p[n].length;i++){for(s=0;s<p[n][i].length-y;s++){if(t(p[n][i][s],b,O,A,k)===!1)return!1;b++}k++}A++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(Wb(l.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}o(Wb,"coordEach");function ele(e,t,r,n){var i=r;return Wb(e,function(s,l,c,p,h){l===0&&r===void 0?i=s:i=t(i,s,l,c,p,h)},n),i}o(ele,"coordReduce");function Hk(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(Hk,"propEach");function tle(e,t,r){var n=r;return Hk(e,function(i,s){s===0&&r===void 0?n=i:n=t(n,i,s)}),n}o(tle,"propReduce");function Wk(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(Wk,"featureEach");function rle(e,t,r){var n=r;return Wk(e,function(i,s){s===0&&r===void 0?n=i:n=t(n,i,s)}),n}o(rle,"featureReduce");function nle(e){var t=[];return Wb(e,function(r){t.push(r)}),t}o(nle,"coordAll");function yM(e,t){var r,n,i,s,l,c,p,h,y,b,_=0,C=e.type==="FeatureCollection",P=e.type==="Feature",E=C?e.features.length:1;for(r=0;r<E;r++){for(c=C?e.features[r].geometry:P?e.geometry:e,h=C?e.features[r].properties:P?e.properties:{},y=C?e.features[r].bbox:P?e.bbox:void 0,b=C?e.features[r].id:P?e.id:void 0,p=c?c.type==="GeometryCollection":!1,l=p?c.geometries.length:1,i=0;i<l;i++){if(s=p?c.geometries[i]:c,s===null){if(t(null,_,h,y,b)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,_,h,y,b)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(t(s.geometries[n],_,h,y,b)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}_++}}o(yM,"geomEach");function ile(e,t,r){var n=r;return yM(e,function(i,s,l,c,p){s===0&&r===void 0?n=i:n=t(n,i,s,l,c,p)}),n}o(ile,"geomReduce");function RS(e,t){yM(e,function(r,n,i,s,l){var c=r===null?null:r.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(Rs.feature(r,i,{bbox:s,id:l}),n,0)===!1?!1:void 0}var p;switch(c){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var h=0;h<r.coordinates.length;h++){var y=r.coordinates[h],b={type:p,coordinates:y};if(t(Rs.feature(b,i),n,h)===!1)return!1}})}o(RS,"flattenEach");function ole(e,t,r){var n=r;return RS(e,function(i,s,l){s===0&&l===0&&r===void 0?n=i:n=t(n,i,s,l)}),n}o(ole,"flattenReduce");function Xk(e,t){RS(e,function(r,n,i){var s=0;if(r.geometry){var l=r.geometry.type;if(!(l==="Point"||l==="MultiPoint")){var c,p=0,h=0,y=0;if(Wb(r,function(b,_,C,P,E){if(c===void 0||n>p||P>h||E>y){c=b,p=n,h=P,y=E,s=0;return}var w=Rs.lineString([c,b],r.properties);if(t(w,n,i,E,s)===!1)return!1;s++,c=b})===!1)return!1}}})}o(Xk,"segmentEach");function sle(e,t,r){var n=r,i=!1;return Xk(e,function(s,l,c,p,h){i===!1&&r===void 0?n=s:n=t(n,s,l,c,p,h),i=!0}),n}o(sle,"segmentReduce");function Yk(e,t){if(!e)throw new Error("geojson is required");RS(e,function(r,n,i){if(r.geometry!==null){var s=r.geometry.type,l=r.geometry.coordinates;switch(s){case"LineString":if(t(r,n,i,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<l.length;c++)if(t(Rs.lineString(l[c],r.properties),n,i,c)===!1)return!1;break}}})}o(Yk,"lineEach");function ale(e,t,r){var n=r;return Yk(e,function(i,s,l,c){s===0&&r===void 0?n=i:n=t(n,i,s,l,c)}),n}o(ale,"lineReduce");function lle(e,t){if(t=t||{},!Rs.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,s=t.segmentIndex||0,l=t.properties,c;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),l=l||e.features[r].properties,c=e.features[r].geometry;break;case"Feature":l=l||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 p=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=p.length+s-1),Rs.lineString([p[s],p[s+1]],l,t);case"Polygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s-1),Rs.lineString([p[i][s],p[i][s+1]],l,t);case"MultiLineString":return n<0&&(n=p.length+n),s<0&&(s=p[n].length+s-1),Rs.lineString([p[n][s],p[n][s+1]],l,t);case"MultiPolygon":return n<0&&(n=p.length+n),i<0&&(i=p[n].length+i),s<0&&(s=p[n][i].length-s-1),Rs.lineString([p[n][i][s],p[n][i][s+1]],l,t)}throw new Error("geojson is invalid")}o(lle,"findSegment");function ule(e,t){if(t=t||{},!Rs.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,s=t.coordIndex||0,l=t.properties,c;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),l=l||e.features[r].properties,c=e.features[r].geometry;break;case"Feature":l=l||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 p=c.coordinates;switch(c.type){case"Point":return Rs.point(p,l,t);case"MultiPoint":return n<0&&(n=p.length+n),Rs.point(p[n],l,t);case"LineString":return s<0&&(s=p.length+s),Rs.point(p[s],l,t);case"Polygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),Rs.point(p[i][s],l,t);case"MultiLineString":return n<0&&(n=p.length+n),s<0&&(s=p[n].length+s),Rs.point(p[n][s],l,t);case"MultiPolygon":return n<0&&(n=p.length+n),i<0&&(i=p[n].length+i),s<0&&(s=p[n][i].length-s),Rs.point(p[n][i][s],l,t)}throw new Error("geojson is invalid")}o(ule,"findPoint");Po.coordAll=nle;Po.coordEach=Wb;Po.coordReduce=ele;Po.featureEach=Wk;Po.featureReduce=rle;Po.findPoint=ule;Po.findSegment=lle;Po.flattenEach=RS;Po.flattenReduce=ole;Po.geomEach=yM;Po.geomReduce=ile;Po.lineEach=Yk;Po.lineReduce=ale;Po.propEach=Hk;Po.propReduce=tle;Po.segmentEach=Xk;Po.segmentReduce=sle});var Zk=fe(xM=>{"use strict";g();Object.defineProperty(xM,"__esModule",{value:!0});var cle=vM();function bM(e){var t=[1/0,1/0,-1/0,-1/0];return cle.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(bM,"bbox");bM.default=bM;xM.default=bM});var BS=fe((PBe,IM)=>{g();var Rc=QE(),Jk=gM(),Qk=vM(),C0=Zk().default,ple=Qk.featureEach,CBe=Qk.coordEach,wBe=Jk.polygon,Kk=Jk.featureCollection;function eR(e){var t=new Rc(e);return t.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:C0(r),Rc.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:C0(i),n.push(i)}):ple(r,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:C0(i),n.push(i)}),Rc.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:C0(r),Rc.prototype.remove.call(this,r,n)},t.clear=function(){return Rc.prototype.clear.call(this)},t.search=function(r){var n=Rc.prototype.search.call(this,this.toBBox(r));return Kk(n)},t.collides=function(r){return Rc.prototype.collides.call(this,this.toBBox(r))},t.all=function(){var r=Rc.prototype.all.call(this);return Kk(r)},t.toJSON=function(){return Rc.prototype.toJSON.call(this)},t.fromJSON=function(r){return Rc.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=C0(r);else if(r.type==="FeatureCollection")n=C0(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}o(eR,"geojsonRbush");IM.exports=eR;IM.exports.default=eR});var PM=fe((kGe,hR)=>{"use strict";g();var dR=Object.prototype.toString;hR.exports=o(function(t){var r=dR.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&dR.call(t.callee)==="[object Function]"),n},"isArguments")});var SR=fe((jGe,_R)=>{"use strict";g();var IR;Object.keys||(Yb=Object.prototype.hasOwnProperty,TM=Object.prototype.toString,mR=PM(),EM=Object.prototype.propertyIsEnumerable,gR=!EM.call({toString:null},"toString"),yR=EM.call(function(){},"prototype"),Zb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],GS=o(function(e){var t=e.constructor;return t&&t.prototype===e},"equalsConstructorPrototype"),vR={$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},bR=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!vR["$"+e]&&Yb.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{GS(window[e])}catch(t){return!0}}catch(t){return!0}return!1}(),xR=o(function(e){if(typeof window>"u"||!bR)return GS(e);try{return GS(e)}catch(t){return!1}},"equalsConstructorPrototypeIfNotBuggy"),IR=o(function(t){var r=t!==null&&typeof t=="object",n=TM.call(t)==="[object Function]",i=mR(t),s=r&&TM.call(t)==="[object String]",l=[];if(!r&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var c=yR&&n;if(s&&t.length>0&&!Yb.call(t,0))for(var p=0;p<t.length;++p)l.push(String(p));if(i&&t.length>0)for(var h=0;h<t.length;++h)l.push(String(h));else for(var y in t)!(c&&y==="prototype")&&Yb.call(t,y)&&l.push(String(y));if(gR)for(var b=xR(t),_=0;_<Zb.length;++_)!(b&&Zb[_]==="constructor")&&Yb.call(t,Zb[_])&&l.push(Zb[_]);return l},"keys"));var Yb,TM,mR,EM,gR,yR,Zb,GS,vR,bR,xR;_R.exports=IR});var MM=fe((UGe,PR)=>{"use strict";g();var Ple=Array.prototype.slice,Tle=PM(),CR=Object.keys,US=CR?o(function(t){return CR(t)},"keys"):SR(),wR=Object.keys;US.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 Tle(n)?wR(Ple.call(n)):wR(n)},"keys"))}else Object.keys=US;return Object.keys||US},"shimObjectKeys");PR.exports=US});var OM=fe((qGe,TR)=>{"use strict";g();TR.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 s 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 l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[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 VS=fe((XGe,ER)=>{"use strict";g();var Ele=OM();ER.exports=o(function(){return Ele()&&!!Symbol.toStringTag},"hasToStringTagShams")});var LM=fe((KGe,MR)=>{"use strict";g();MR.exports=Object});var AM=fe((QGe,OR)=>{"use strict";g();OR.exports=Error});var AR=fe((tUe,LR)=>{"use strict";g();LR.exports=EvalError});var FR=fe((nUe,DR)=>{"use strict";g();DR.exports=RangeError});var kR=fe((oUe,NR)=>{"use strict";g();NR.exports=ReferenceError});var DM=fe((aUe,RR)=>{"use strict";g();RR.exports=SyntaxError});var Dm=fe((uUe,BR)=>{"use strict";g();BR.exports=TypeError});var $R=fe((pUe,jR)=>{"use strict";g();jR.exports=URIError});var UR=fe((dUe,GR)=>{"use strict";g();GR.exports=Math.abs});var zR=fe((mUe,VR)=>{"use strict";g();VR.exports=Math.floor});var HR=fe((yUe,qR)=>{"use strict";g();qR.exports=Math.max});var XR=fe((bUe,WR)=>{"use strict";g();WR.exports=Math.min});var ZR=fe((IUe,YR)=>{"use strict";g();YR.exports=Math.pow});var JR=fe((SUe,KR)=>{"use strict";g();KR.exports=Math.round});var eB=fe((wUe,QR)=>{"use strict";g();QR.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var rB=fe((EUe,tB)=>{"use strict";g();var Mle=eB();tB.exports=o(function(t){return Mle(t)||t===0?t:t<0?-1:1},"sign")});var iB=fe((LUe,nB)=>{"use strict";g();nB.exports=Object.getOwnPropertyDescriptor});var Fm=fe((DUe,oB)=>{"use strict";g();var zS=iB();if(zS)try{zS([],"length")}catch(e){zS=null}oB.exports=zS});var Kb=fe((NUe,sB)=>{"use strict";g();var qS=Object.defineProperty||!1;if(qS)try{qS({},"a",{value:1})}catch(e){qS=!1}sB.exports=qS});var uB=fe((RUe,lB)=>{"use strict";g();var aB=typeof Symbol<"u"&&Symbol,Ole=OM();lB.exports=o(function(){return typeof aB!="function"||typeof Symbol!="function"||typeof aB("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ole()},"hasNativeSymbols")});var FM=fe(($Ue,cB)=>{"use strict";g();cB.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var NM=fe((UUe,pB)=>{"use strict";g();var Lle=LM();pB.exports=Lle.getPrototypeOf||null});var hB=fe((zUe,dB)=>{"use strict";g();var Ale="Function.prototype.bind called on incompatible ",Dle=Object.prototype.toString,Fle=Math.max,Nle="[object Function]",fB=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),kle=o(function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},"slicy"),Rle=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");dB.exports=o(function(t){var r=this;if(typeof r!="function"||Dle.apply(r)!==Nle)throw new TypeError(Ale+r);for(var n=kle(arguments,1),i,s=o(function(){if(this instanceof i){var y=r.apply(this,fB(n,arguments));return Object(y)===y?y:this}return r.apply(t,fB(n,arguments))},"binder"),l=Fle(0,r.length-n.length),c=[],p=0;p<l;p++)c[p]="$"+p;if(i=Function("binder","return function ("+Rle(c,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var P0=fe((WUe,mB)=>{"use strict";g();var Ble=hB();mB.exports=Function.prototype.bind||Ble});var HS=fe((YUe,gB)=>{"use strict";g();gB.exports=Function.prototype.call});var WS=fe((KUe,yB)=>{"use strict";g();yB.exports=Function.prototype.apply});var bB=fe((QUe,vB)=>{"use strict";g();vB.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var kM=fe((tVe,xB)=>{"use strict";g();var jle=P0(),$le=WS(),Gle=HS(),Ule=bB();xB.exports=Ule||jle.call(Gle,$le)});var XS=fe((nVe,IB)=>{"use strict";g();var Vle=P0(),zle=Dm(),qle=HS(),Hle=kM();IB.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new zle("a function is required");return Hle(Vle,qle,t)},"callBindBasic")});var TB=fe((sVe,PB)=>{"use strict";g();var Wle=XS(),_B=Fm(),CB;try{CB=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var RM=!!CB&&_B&&_B(Object.prototype,"__proto__"),wB=Object,SB=wB.getPrototypeOf;PB.exports=RM&&typeof RM.get=="function"?Wle([RM.get]):typeof SB=="function"?o(function(t){return SB(t==null?t:wB(t))},"getDunder"):!1});var BM=fe((uVe,LB)=>{"use strict";g();var EB=FM(),MB=NM(),OB=TB();LB.exports=EB?o(function(t){return EB(t)},"getProto"):MB?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return MB(t)},"getProto"):OB?o(function(t){return OB(t)},"getProto"):null});var jM=fe((fVe,AB)=>{"use strict";g();var Xle=Function.prototype.call,Yle=Object.prototype.hasOwnProperty,Zle=P0();AB.exports=Zle.call(Xle,Yle)});var UM=fe((hVe,BB)=>{"use strict";g();var Dr,Kle=LM(),Jle=AM(),Qle=AR(),eue=FR(),tue=kR(),O0=DM(),M0=Dm(),rue=$R(),nue=UR(),iue=zR(),oue=HR(),sue=XR(),aue=ZR(),lue=JR(),uue=rB(),kB=Function,$M=o(function(e){try{return kB('"use strict"; return ('+e+").constructor;")()}catch(t){}},"getEvalledConstructor"),Jb=Fm(),cue=Kb(),GM=o(function(){throw new M0},"throwTypeError"),pue=Jb?function(){try{return arguments.callee,GM}catch(e){try{return Jb(arguments,"callee").get}catch(t){return GM}}}():GM,T0=uB()(),Wo=BM(),fue=NM(),due=FM(),RB=WS(),Qb=HS(),E0={},hue=typeof Uint8Array>"u"||!Wo?Dr:Wo(Uint8Array),Nm={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Dr:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Dr:ArrayBuffer,"%ArrayIteratorPrototype%":T0&&Wo?Wo([][Symbol.iterator]()):Dr,"%AsyncFromSyncIteratorPrototype%":Dr,"%AsyncFunction%":E0,"%AsyncGenerator%":E0,"%AsyncGeneratorFunction%":E0,"%AsyncIteratorPrototype%":E0,"%Atomics%":typeof Atomics>"u"?Dr:Atomics,"%BigInt%":typeof BigInt>"u"?Dr:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Dr:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Dr:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Dr:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Jle,"%eval%":eval,"%EvalError%":Qle,"%Float16Array%":typeof Float16Array>"u"?Dr:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Dr:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Dr:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Dr:FinalizationRegistry,"%Function%":kB,"%GeneratorFunction%":E0,"%Int8Array%":typeof Int8Array>"u"?Dr:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Dr:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Dr:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T0&&Wo?Wo(Wo([][Symbol.iterator]())):Dr,"%JSON%":typeof JSON=="object"?JSON:Dr,"%Map%":typeof Map>"u"?Dr:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T0||!Wo?Dr:Wo(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Kle,"%Object.getOwnPropertyDescriptor%":Jb,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Dr:Promise,"%Proxy%":typeof Proxy>"u"?Dr:Proxy,"%RangeError%":eue,"%ReferenceError%":tue,"%Reflect%":typeof Reflect>"u"?Dr:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Dr:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T0||!Wo?Dr:Wo(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Dr:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T0&&Wo?Wo(""[Symbol.iterator]()):Dr,"%Symbol%":T0?Symbol:Dr,"%SyntaxError%":O0,"%ThrowTypeError%":pue,"%TypedArray%":hue,"%TypeError%":M0,"%Uint8Array%":typeof Uint8Array>"u"?Dr:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Dr:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Dr:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Dr:Uint32Array,"%URIError%":rue,"%WeakMap%":typeof WeakMap>"u"?Dr:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Dr:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Dr:WeakSet,"%Function.prototype.call%":Qb,"%Function.prototype.apply%":RB,"%Object.defineProperty%":cue,"%Object.getPrototypeOf%":fue,"%Math.abs%":nue,"%Math.floor%":iue,"%Math.max%":oue,"%Math.min%":sue,"%Math.pow%":aue,"%Math.round%":lue,"%Math.sign%":uue,"%Reflect.getPrototypeOf%":due};if(Wo)try{null.error}catch(e){DB=Wo(Wo(e)),Nm["%Error.prototype%"]=DB}var DB,mue=o(function e(t){var r;if(t==="%AsyncFunction%")r=$M("async function () {}");else if(t==="%GeneratorFunction%")r=$M("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=$M("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Wo&&(r=Wo(i.prototype))}return Nm[t]=r,r},"doEval"),FB={__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"]},ex=P0(),YS=jM(),gue=ex.call(Qb,Array.prototype.concat),yue=ex.call(RB,Array.prototype.splice),NB=ex.call(Qb,String.prototype.replace),ZS=ex.call(Qb,String.prototype.slice),vue=ex.call(Qb,RegExp.prototype.exec),bue=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xue=/\\(\\)?/g,Iue=o(function(t){var r=ZS(t,0,1),n=ZS(t,-1);if(r==="%"&&n!=="%")throw new O0("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new O0("invalid intrinsic syntax, expected opening `%`");var i=[];return NB(t,bue,function(s,l,c,p){i[i.length]=c?NB(p,xue,"$1"):l||s}),i},"stringToPath"),_ue=o(function(t,r){var n=t,i;if(YS(FB,n)&&(i=FB[n],n="%"+i[0]+"%"),YS(Nm,n)){var s=Nm[n];if(s===E0&&(s=mue(n)),typeof s>"u"&&!r)throw new M0("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new O0("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");BB.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new M0("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new M0('"allowMissing" argument must be a boolean');if(vue(/^%?[^%]*%?$/,t)===null)throw new O0("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Iue(t),i=n.length>0?n[0]:"",s=_ue("%"+i+"%",r),l=s.name,c=s.value,p=!1,h=s.alias;h&&(i=h[0],yue(n,gue([0,1],h)));for(var y=1,b=!0;y<n.length;y+=1){var _=n[y],C=ZS(_,0,1),P=ZS(_,-1);if((C==='"'||C==="'"||C==="`"||P==='"'||P==="'"||P==="`")&&C!==P)throw new O0("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(p=!0),i+="."+_,l="%"+i+"%",YS(Nm,l))c=Nm[l];else if(c!=null){if(!(_ in c)){if(!r)throw new M0("base intrinsic for "+t+" exists, but the property is not available.");return}if(Jb&&y+1>=n.length){var E=Jb(c,_);b=!!E,b&&"get"in E&&!("originalValue"in E.get)?c=E.get:c=c[_]}else b=YS(c,_),c=c[_];b&&!p&&(Nm[l]=c)}}return c},"GetIntrinsic")});var KS=fe((yVe,GB)=>{"use strict";g();var jB=UM(),$B=XS(),Sue=$B([jB("%String.prototype.indexOf%")]);GB.exports=o(function(t,r){var n=jB(t,!!r);return typeof n=="function"&&Sue(t,".prototype.")>-1?$B([n]):n},"callBoundIntrinsic")});var zB=fe((xVe,VB)=>{"use strict";g();var Cue=VS()(),wue=KS(),VM=wue("Object.prototype.toString"),JS=o(function(t){return Cue&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:VM(t)==="[object Arguments]"},"isArguments"),UB=o(function(t){return JS(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&VM(t)!=="[object Array]"&&"callee"in t&&VM(t.callee)==="[object Function]"},"isArguments"),Pue=function(){return JS(arguments)}();JS.isLegacyArguments=UB;VB.exports=Pue?JS:UB});var QS=fe((SVe,WB)=>{"use strict";g();var qB=Kb(),Tue=DM(),L0=Dm(),HB=Fm();WB.exports=o(function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new L0("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new L0("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new L0("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new L0("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new L0("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new L0("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,p=!!HB&&HB(t,r);if(qB)qB(t,r,{configurable:l===null&&p?p.configurable:!l,enumerable:i===null&&p?p.enumerable:!i,value:n,writable:s===null&&p?p.writable:!s});else if(c||!i&&!s&&!l)t[r]=n;else throw new Tue("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var eC=fe((PVe,YB)=>{"use strict";g();var zM=Kb(),XB=o(function(){return!!zM},"hasPropertyDescriptors");XB.hasArrayLengthDefineBug=o(function(){if(!zM)return null;try{return zM([],"length",{value:1}).length!==1}catch(t){return!0}},"hasArrayLengthDefineBug");YB.exports=XB});var A0=fe((MVe,QB)=>{"use strict";g();var Eue=MM(),Mue=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Oue=Object.prototype.toString,Lue=Array.prototype.concat,ZB=QS(),Aue=o(function(e){return typeof e=="function"&&Oue.call(e)==="[object Function]"},"isFunction"),KB=eC()(),Due=o(function(e,t,r,n){if(t in e){if(n===!0){if(e[t]===r)return}else if(!Aue(n)||!n())return}KB?ZB(e,t,r,!0):ZB(e,t,r)},"defineProperty"),JB=o(function(e,t){var r=arguments.length>2?arguments[2]:{},n=Eue(t);Mue&&(n=Lue.call(n,Object.getOwnPropertySymbols(t)));for(var i=0;i<n.length;i+=1)Due(e,n[i],t[n[i]],r[n[i]])},"defineProperties");JB.supportsDescriptors=!!KB;QB.exports=JB});var ij=fe((AVe,nj)=>{"use strict";g();var Fue=UM(),ej=QS(),Nue=eC()(),tj=Fm(),rj=Dm(),kue=Fue("%Math.floor%");nj.exports=o(function(t,r){if(typeof t!="function")throw new rj("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||kue(r)!==r)throw new rj("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&tj){var l=tj(t,"length");l&&!l.configurable&&(i=!1),l&&!l.writable&&(s=!1)}return(i||s||!n)&&(Nue?ej(t,"length",r,!0,!0):ej(t,"length",r)),t},"setFunctionLength")});var sj=fe((NVe,oj)=>{"use strict";g();var Rue=P0(),Bue=WS(),jue=kM();oj.exports=o(function(){return jue(Rue,Bue,arguments)},"applyBind")});var qM=fe((BVe,tC)=>{"use strict";g();var $ue=ij(),aj=Kb(),Gue=XS(),lj=sj();tC.exports=o(function(t){var r=Gue(arguments),n=t.length-(arguments.length-1);return $ue(r,1+(n>0?n:0),!0)},"callBind");aj?aj(tC.exports,"apply",{value:lj}):tC.exports.apply=lj});var HM=fe((GVe,cj)=>{"use strict";g();var uj=o(function(e){return e!==e},"numberIsNaN");cj.exports=o(function(t,r){return t===0&&r===0?1/t===1/r:!!(t===r||uj(t)&&uj(r))},"is")});var WM=fe((zVe,pj)=>{"use strict";g();var Uue=HM();pj.exports=o(function(){return typeof Object.is=="function"?Object.is:Uue},"getPolyfill")});var dj=fe((WVe,fj)=>{"use strict";g();var Vue=WM(),zue=A0();fj.exports=o(function(){var t=Vue();return zue(Object,{is:t},{is:o(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var yj=fe((ZVe,gj)=>{"use strict";g();var que=A0(),Hue=qM(),Wue=HM(),hj=WM(),Xue=dj(),mj=Hue(hj(),Object);que(mj,{getPolyfill:hj,implementation:Wue,shim:Xue});gj.exports=mj});var Sj=fe((JVe,_j)=>{"use strict";g();var vj=KS(),Yue=VS()(),Zue=jM(),Kue=Fm(),ZM;Yue?(bj=vj("RegExp.prototype.exec"),XM={},rC=o(function(){throw XM},"throwRegexMarker"),YM={toString:rC,valueOf:rC},typeof Symbol.toPrimitive=="symbol"&&(YM[Symbol.toPrimitive]=rC),ZM=o(function(t){if(!t||typeof t!="object")return!1;var r=Kue(t,"lastIndex"),n=r&&Zue(r,"value");if(!n)return!1;try{bj(t,YM)}catch(i){return i===XM}},"isRegex")):(xj=vj("Object.prototype.toString"),Ij="[object RegExp]",ZM=o(function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:xj(t)===Ij},"isRegex"));var bj,XM,rC,YM,xj,Ij;_j.exports=ZM});var wj=fe((tze,Cj)=>{"use strict";g();var rx=o(function(){return typeof o(function(){},"f").name=="string"},"functionsHaveNames"),tx=Object.getOwnPropertyDescriptor;if(tx)try{tx([],"length")}catch(e){tx=null}rx.functionsHaveConfigurableNames=o(function(){if(!rx()||!tx)return!1;var t=tx(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var Jue=Function.prototype.bind;rx.boundFunctionsHaveNames=o(function(){return rx()&&typeof Jue=="function"&&o(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");Cj.exports=rx});var Ej=fe((ize,Tj)=>{"use strict";g();var Pj=QS(),Que=eC()(),ece=wj().functionsHaveConfigurableNames(),tce=Dm();Tj.exports=o(function(t,r){if(typeof t!="function")throw new tce("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||ece)&&(Que?Pj(t,"name",r,!0,!0):Pj(t,"name",r)),t},"setFunctionName")});var KM=fe((aze,Mj)=>{"use strict";g();var rce=Ej(),nce=Dm(),ice=Object;Mj.exports=rce(o(function(){if(this==null||this!==ice(this))throw new nce("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 JM=fe((cze,Oj)=>{"use strict";g();var oce=KM(),sce=A0().supportsDescriptors,ace=Object.getOwnPropertyDescriptor;Oj.exports=o(function(){if(sce&&/a/mig.flags==="gim"){var t=ace(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 oce},"getPolyfill")});var Dj=fe((dze,Aj)=>{"use strict";g();var lce=A0().supportsDescriptors,uce=JM(),cce=Fm(),pce=Object.defineProperty,fce=AM(),Lj=BM(),dce=/a/;Aj.exports=o(function(){if(!lce||!Lj)throw new fce("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=uce(),r=Lj(dce),n=cce(r,"flags");return(!n||n.get!==t)&&pce(r,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var Rj=fe((gze,kj)=>{"use strict";g();var hce=A0(),mce=qM(),gce=KM(),Fj=JM(),yce=Dj(),Nj=mce(Fj());hce(Nj,{getPolyfill:Fj,implementation:gce,shim:yce});kj.exports=Nj});var $j=fe((vze,jj)=>{"use strict";g();var Bj=KS(),vce=Bj("Date.prototype.getDay"),bce=o(function(t){try{return vce(t),!0}catch(r){return!1}},"tryDateGetDayCall"),xce=Bj("Object.prototype.toString"),Ice="[object Date]",_ce=VS()();jj.exports=o(function(t){return typeof t!="object"||t===null?!1:_ce?bce(t):xce(t)===Ice},"isDateObject")});var QM=fe((Ize,Kj)=>{g();var Gj=MM(),Uj=zB(),Vj=yj(),zj=Sj(),qj=Rj(),Hj=$j(),Wj=Date.prototype.getTime;function Zj(e,t,r){var n=r||{};return(n.strict?Vj(e,t):e===t)?!0:!e||!t||typeof e!="object"&&typeof t!="object"?n.strict?Vj(e,t):e==t:Sce(e,t,n)}o(Zj,"deepEqual");function Xj(e){return e==null}o(Xj,"isUndefinedOrNull");function Yj(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(Yj,"isBuffer");function Sce(e,t,r){var n,i;if(typeof e!=typeof t||Xj(e)||Xj(t)||e.prototype!==t.prototype||Uj(e)!==Uj(t))return!1;var s=zj(e),l=zj(t);if(s!==l)return!1;if(s||l)return e.source===t.source&&qj(e)===qj(t);if(Hj(e)&&Hj(t))return Wj.call(e)===Wj.call(t);var c=Yj(e),p=Yj(t);if(c!==p)return!1;if(c||p){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 h=Gj(e),y=Gj(t)}catch(b){return!1}if(h.length!==y.length)return!1;for(h.sort(),y.sort(),n=h.length-1;n>=0;n--)if(h[n]!=y[n])return!1;for(n=h.length-1;n>=0;n--)if(i=h[n],!Zj(e[i],t[i],r))return!1;return!0}o(Sce,"objEquiv");Kj.exports=Zj});var fO=fe((gWe,o$)=>{g();var bpe=QM(),jc=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:xpe},"Equality");jc.prototype.compare=function(e,t){if(e.type!==t.type||!i$(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=n$(e),i=n$(t);return n.every(function(s){return this.some(function(l){return r.compare(s,l)})},i)}}return!1};function n$(e){return e.coordinates.map(function(t){return{type:e.type.replace("Multi",""),coordinates:t}})}o(n$,"explode");function i$(e,t){return e.hasOwnProperty("coordinates")?e.coordinates.length===t.coordinates.length:e.length===t.length}o(i$,"sameLength");jc.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};jc.prototype.compareLine=function(e,t,r,n){if(!i$(e,t))return!1;var i=this.pseudoNode?e:this.removePseudo(e),s=this.pseudoNode?t:this.removePseudo(t);if(!(n&&!this.compareCoord(i[0],s[0])&&(s=this.fixStartIndex(s,i),!s))){var l=this.compareCoord(i[r],s[r]);return this.direction||l?this.comparePath(i,s):this.compareCoord(i[r],s[s.length-(1+r)])?this.comparePath(i.slice().reverse(),s):!1}};jc.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};jc.prototype.comparePath=function(e,t){var r=this;return e.every(function(n,i){return r.compareCoord(n,this[i])},t)};jc.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(s){return this.some(function(l){return i.compareLine(s,l,1,!0)})},n)}else return!1};jc.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)};jc.prototype.compareBBox=function(e,t){return!!(!e.bbox&&!t.bbox||e.bbox&&t.bbox&&this.compareCoord(e.bbox,t.bbox))};jc.prototype.removePseudo=function(e){return e};function xpe(e,t){return bpe(e,t,{strict:!0})}o(xpe,"objectComparator");o$.exports=jc});var s$=fe((kWe,oC)=>{g();function qd(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(qd,"DBSCAN");qd.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 s=this._regionQuery(i);if(s.length<this.minPts)this.noise.push(i);else{var l=this.clusters.length;this.clusters.push([]),this._addToCluster(i,l),this._expandCluster(l,s)}}return this.clusters};qd.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)};qd.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)}};qd.prototype._addToCluster=function(e,t){this.clusters[t].push(e),this._assigned[e]=1};qd.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};qd.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};qd.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 oC<"u"&&oC.exports&&(oC.exports=qd)});var a$=fe((jWe,sC)=>{g();function Hd(e,t,r){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(e,t,r)}o(Hd,"KMEANS");Hd.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)};Hd.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 s=0;s<this.k;s++){for(var l=new Array(y),c=0,p=0;p<y;p++)l[p]=0;for(var h=0;h<r;h++){var y=this.dataset[h].length;if(s===this.assignments[h]){for(var p=0;p<y;p++)l[p]+=this.dataset[h][p];c++}}if(c>0){for(var p=0;p<y;p++)l[p]/=c;this.centroids[s]=l}else this.centroids[s]=this.randomCentroid(),i=!0}}return this.getClusters()};Hd.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};Hd.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};Hd.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};Hd.prototype.argmin=function(e,t,r){for(var n=Number.MAX_VALUE,i=0,s=t.length,l,c=0;c<s;c++)l=r(e,t[c]),l<n&&(n=l,i=c);return i};Hd.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 sC<"u"&&sC.exports&&(sC.exports=Hd)});var dO=fe((UWe,aC)=>{g();function $c(e,t,r){this._queue=[],this._priorities=[],this._sorting="desc",this._init(e,t,r)}o($c,"PriorityQueue");$c.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)};$c.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}}};$c.prototype.forEach=function(e){this._queue.forEach(e)};$c.prototype.getElements=function(){return this._queue};$c.prototype.getElementPriority=function(e){return this._priorities[e]};$c.prototype.getPriorities=function(){return this._priorities};$c.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};$c.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)};$c.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 aC<"u"&&aC.exports&&(aC.exports=$c)});var u$=fe((qWe,F0)=>{g();typeof F0<"u"&&F0.exports&&(l$=dO());var l$;function uf(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(uf,"OPTICS");uf.prototype.run=function(e,t,r,n){this._init(e,t,r,n);for(var i=0,s=this.dataset.length;i<s;i++)if(this._processed[i]!==1){this._processed[i]=1,this.clusters.push([i]);var l=this.clusters.length-1;this._orderedList.push(i);var c=new l$(null,null,"asc"),p=this._regionQuery(i);this._distanceToCore(i)!==void 0&&(this._updateQueue(i,p,c),this._expandCluster(l,c))}return this.clusters};uf.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};uf.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)};uf.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 s=n.distance(n.dataset[e],n.dataset[i]),l=Math.max(n._coreDistance,s);n._reachability[i]===void 0?(n._reachability[i]=l,r.insert(i,l)):l<n._reachability[i]&&(n._reachability[i]=l,r.remove(i),r.insert(i,l))}})};uf.prototype._expandCluster=function(e,t){for(var r=t.getElements(),n=0,i=r.length;n<i;n++){var s=r[n];if(this._processed[s]===void 0){var l=this._regionQuery(s);this._processed[s]=1,this.clusters[e].push(s),this._orderedList.push(s),this._distanceToCore(s)!==void 0&&(this._updateQueue(s,l,t),this._expandCluster(e,t))}}};uf.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}};uf.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};uf.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 F0<"u"&&F0.exports&&(F0.exports=uf)});var c$=fe((XWe,lC)=>{g();typeof lC<"u"&&lC.exports&&(lC.exports={DBSCAN:s$(),KMEANS:a$(),OPTICS:u$(),PriorityQueue:dO()})});var hO=fe((nXe,f$)=>{"use strict";g();f$.exports={eudist:o(function(t,r,n){for(var i=t.length,s=0,l=0;l<i;l++){var c=(t[l]||0)-(r[l]||0);s+=c*c}return n?Math.sqrt(s):s},"eudist"),mandist:o(function(t,r,n){for(var i=t.length,s=0,l=0;l<i;l++)s+=Math.abs((t[l]||0)-(r[l]||0));return n?Math.sqrt(s):s},"mandist"),dist:o(function(t,r,n){var i=Math.abs(t-r);return n?i:i*i},"dist")}});var m$=fe((sXe,h$)=>{"use strict";g();var d$=hO(),wpe=d$.eudist,Ppe=d$.dist;h$.exports={kmrand:o(function(t,r){for(var n={},i=[],s=r<<2,l=t.length,c=t[0].length>0;i.length<r&&s-- >0;){var p=t[Math.floor(Math.random()*l)],h=c?p.join("_"):""+p;n[h]||(n[h]=!0,i.push(p))}if(i.length<r)throw new Error("Error initializating clusters");return i},"kmrand"),kmpp:o(function(t,r){var n=t[0].length?wpe:Ppe,i=[],s=t.length,l=t[0].length>0,c={},p=t[Math.floor(Math.random()*s)],h=l?p.join("_"):""+p;for(i.push(p),c[h]=!0;i.length<r;){for(var y=[],b=i.length,_=0,C=[],P=0;P<s;P++){for(var E=1/0,w=0;w<b;w++){var O=n(t[P],i[w]);O<=E&&(E=O)}y[P]=E}for(var D=0;D<s;D++)_+=y[D];for(var A=0;A<s;A++)C[A]={i:A,v:t[A],pr:y[A]/_,cs:0};C.sort(function(Y,N){return Y.pr-N.pr}),C[0].cs=C[0].pr;for(var k=1;k<s;k++)C[k].cs=C[k-1].cs+C[k].pr;for(var j=Math.random(),W=0;W<s-1&&C[W++].cs<j;);i.push(C[W-1].v)}return i},"kmpp")}});var x$=fe((pXe,b$)=>{"use strict";g();var mO=hO(),v$=m$(),Tpe=mO.eudist,uXe=mO.mandist,cXe=mO.dist,Epe=v$.kmrand,Mpe=v$.kmpp,g$=1e4;function y$(e,t,r){r=r||[];for(var n=0;n<e;n++)r[n]=t;return r}o(y$,"init");function Ope(e,t,r,n){var i=[],s=[],l=[],c=[],p=!1,h=n||g$,y=e.length,b=e[0].length,_=b>0,C=[];if(r)r=="kmrand"?i=Epe(e,t):r=="kmpp"?i=Mpe(e,t):i=r;else for(var P={};i.length<t;){var E=Math.floor(Math.random()*y);P[E]||(P[E]=!0,i.push(e[E]))}do{y$(t,0,C);for(var w=0;w<y;w++){for(var O=1/0,D=0,A=0;A<t;A++){var c=_?Tpe(e[w],i[A]):Math.abs(e[w]-i[A]);c<=O&&(O=c,D=A)}l[w]=D,C[D]++}for(var k=[],s=[],j=0,W=0;W<t;W++)k[W]=_?y$(b,0,k[W]):0,s[W]=i[W];if(_){for(var Y=0;Y<t;Y++)i[Y]=[];for(var N=0;N<y;N++)for(var Z=l[N],le=k[Z],se=e[N],U=0;U<b;U++)le[U]+=se[U];p=!0;for(var ye=0;ye<t;ye++){for(var ne=i[ye],Ce=k[ye],Ie=s[ye],Ue=C[ye],ve=0;ve<b;ve++)ne[ve]=Ce[ve]/Ue||0;if(p){for(var Te=0;Te<b;Te++)if(Ie[Te]!=ne[Te]){p=!1;break}}}}else{for(var Q=0;Q<y;Q++){var Qe=l[Q];k[Qe]+=e[Q]}for(var Ye=0;Ye<t;Ye++)i[Ye]=k[Ye]/C[Ye]||0;p=!0;for(var nt=0;nt<t;nt++)if(s[nt]!=i[nt]){p=!1;break}}p=p||--h<=0}while(!p);return{it:g$-h,k:t,idxs:l,centroids:i}}o(Ope,"skmeans");b$.exports=Ope});var j0=fe((IO,_O)=>{g();(function(e,t){typeof IO=="object"&&typeof _O<"u"?_O.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(IO,function(){"use strict";function e(ue,F){var $={label:0,sent:o(function(){if(K[0]&1)throw K[1];return K[1]},"sent"),trys:[],ops:[]},X,J,K,Se;return Se={next:ge(0),throw:ge(1),return:ge(2)},typeof Symbol=="function"&&(Se[Symbol.iterator]=function(){return this}),Se;function ge(Pe){return function(et){return De([Pe,et])}}function De(Pe){if(X)throw new TypeError("Generator is already executing.");for(;$;)try{if(X=1,J&&(K=Pe[0]&2?J.return:Pe[0]?J.throw||((K=J.return)&&K.call(J),0):J.next)&&!(K=K.call(J,Pe[1])).done)return K;switch(J=0,K&&(Pe=[Pe[0]&2,K.value]),Pe[0]){case 0:case 1:K=Pe;break;case 4:return $.label++,{value:Pe[1],done:!1};case 5:$.label++,J=Pe[1],Pe=[0];continue;case 7:Pe=$.ops.pop(),$.trys.pop();continue;default:if(K=$.trys,!(K=K.length>0&&K[K.length-1])&&(Pe[0]===6||Pe[0]===2)){$=0;continue}if(Pe[0]===3&&(!K||Pe[1]>K[0]&&Pe[1]<K[3])){$.label=Pe[1];break}if(Pe[0]===6&&$.label<K[1]){$.label=K[1],K=Pe;break}if(K&&$.label<K[2]){$.label=K[2],$.ops.push(Pe);break}K[2]&&$.ops.pop(),$.trys.pop();continue}Pe=F.call(ue,$)}catch(et){Pe=[6,et],J=0}finally{X=K=0}if(Pe[0]&5)throw Pe[1];return{value:Pe[0]?Pe[1]:void 0,done:!0}}}o(e,"__generator");var t=function(){function ue(F,$){this.next=null,this.key=F,this.data=$,this.left=null,this.right=null}return o(ue,"Node"),ue}();function r(ue,F){return ue>F?1:ue<F?-1:0}o(r,"DEFAULT_COMPARE");function n(ue,F,$){for(var X=new t(null,null),J=X,K=X;;){var Se=$(ue,F.key);if(Se<0){if(F.left===null)break;if($(ue,F.left.key)<0){var ge=F.left;if(F.left=ge.right,ge.right=F,F=ge,F.left===null)break}K.left=F,K=F,F=F.left}else if(Se>0){if(F.right===null)break;if($(ue,F.right.key)>0){var ge=F.right;if(F.right=ge.left,ge.left=F,F=ge,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=X.right,F.right=X.left,F}o(n,"splay");function i(ue,F,$,X){var J=new t(ue,F);if($===null)return J.left=J.right=null,J;$=n(ue,$,X);var K=X(ue,$.key);return K<0?(J.left=$.left,J.right=$,$.left=null):K>=0&&(J.right=$.right,J.left=$,$.right=null),J}o(i,"insert");function s(ue,F,$){var X=null,J=null;if(F){F=n(ue,F,$);var K=$(F.key,ue);K===0?(X=F.left,J=F.right):K<0?(J=F.right,F.right=null,X=F):(X=F.left,F.left=null,J=F)}return{left:X,right:J}}o(s,"split");function l(ue,F,$){return F===null?ue:(ue===null||(F=n(ue.key,F,$),F.left=ue),F)}o(l,"merge");function c(ue,F,$,X,J){if(ue){X(""+F+($?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+J(ue)+"\n");var K=F+($?" ":"\u2502 ");ue.left&&c(ue.left,K,!1,X,J),ue.right&&c(ue.right,K,!0,X,J)}}o(c,"printRow");var p=function(){function ue(F){F===void 0&&(F=r),this._root=null,this._size=0,this._comparator=F}return o(ue,"Tree"),ue.prototype.insert=function(F,$){return this._size++,this._root=i(F,$,this._root,this._comparator)},ue.prototype.add=function(F,$){var X=new t(F,$);this._root===null&&(X.left=X.right=null,this._size++,this._root=X);var J=this._comparator,K=n(F,this._root,J),Se=J(F,K.key);return Se===0?this._root=K:(Se<0?(X.left=K.left,X.right=K,K.left=null):Se>0&&(X.right=K.right,X.left=K,K.right=null),this._size++,this._root=X),this._root},ue.prototype.remove=function(F){this._root=this._remove(F,this._root,this._comparator)},ue.prototype._remove=function(F,$,X){var J;if($===null)return null;$=n(F,$,X);var K=X(F,$.key);return K===0?($.left===null?J=$.right:(J=n(F,$.left,X),J.right=$.right),this._size--,J):$},ue.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},ue.prototype.findStatic=function(F){for(var $=this._root,X=this._comparator;$;){var J=X(F,$.key);if(J===0)return $;J<0?$=$.left:$=$.right}return null},ue.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},ue.prototype.contains=function(F){for(var $=this._root,X=this._comparator;$;){var J=X(F,$.key);if(J===0)return!0;J<0?$=$.left:$=$.right}return!1},ue.prototype.forEach=function(F,$){for(var X=this._root,J=[],K=!1;!K;)X!==null?(J.push(X),X=X.left):J.length!==0?(X=J.pop(),F.call($,X),X=X.right):K=!0;return this},ue.prototype.range=function(F,$,X,J){for(var K=[],Se=this._comparator,ge=this._root,De;K.length!==0||ge;)if(ge)K.push(ge),ge=ge.left;else{if(ge=K.pop(),De=Se(ge.key,$),De>0)break;if(Se(ge.key,F)>=0&&X.call(J,ge))return this;ge=ge.right}return this},ue.prototype.keys=function(){var F=[];return this.forEach(function($){var X=$.key;return F.push(X)}),F},ue.prototype.values=function(){var F=[];return this.forEach(function($){var X=$.data;return F.push(X)}),F},ue.prototype.min=function(){return this._root?this.minNode(this._root).key:null},ue.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},ue.prototype.minNode=function(F){if(F===void 0&&(F=this._root),F)for(;F.left;)F=F.left;return F},ue.prototype.maxNode=function(F){if(F===void 0&&(F=this._root),F)for(;F.right;)F=F.right;return F},ue.prototype.at=function(F){for(var $=this._root,X=!1,J=0,K=[];!X;)if($)K.push($),$=$.left;else if(K.length>0){if($=K.pop(),J===F)return $;J++,$=$.right}else X=!0;return null},ue.prototype.next=function(F){var $=this._root,X=null;if(F.right){for(X=F.right;X.left;)X=X.left;return X}for(var J=this._comparator;$;){var K=J(F.key,$.key);if(K===0)break;K<0?(X=$,$=$.left):$=$.right}return X},ue.prototype.prev=function(F){var $=this._root,X=null;if(F.left!==null){for(X=F.left;X.right;)X=X.right;return X}for(var J=this._comparator;$;){var K=J(F.key,$.key);if(K===0)break;K<0?$=$.left:(X=$,$=$.right)}return X},ue.prototype.clear=function(){return this._root=null,this._size=0,this},ue.prototype.toList=function(){return b(this._root)},ue.prototype.load=function(F,$,X){$===void 0&&($=[]),X===void 0&&(X=!1);var J=F.length,K=this._comparator;if(X&&P(F,$,0,J-1,K),this._root===null)this._root=h(F,$,0,J),this._size=J;else{var Se=C(this.toList(),y(F,$),K);J=this._size+J,this._root=_({head:Se},0,J)}return this},ue.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(ue.prototype,"size",{get:o(function(){return this._size},"get"),enumerable:!0,configurable:!0}),Object.defineProperty(ue.prototype,"root",{get:o(function(){return this._root},"get"),enumerable:!0,configurable:!0}),ue.prototype.toString=function(F){F===void 0&&(F=o(function(X){return String(X.key)},"printNode"));var $=[];return c(this._root,"",!0,function(X){return $.push(X)},F),$.join("")},ue.prototype.update=function(F,$,X){var J=this._comparator,K=s(F,this._root,J),Se=K.left,ge=K.right;J(F,$)<0?ge=i($,X,ge,J):Se=i($,X,Se,J),this._root=l(Se,ge,J)},ue.prototype.split=function(F){return s(F,this._root,this._comparator)},ue.prototype[Symbol.iterator]=function(){var F,$,X;return e(this,function(J){switch(J.label){case 0:F=this._root,$=[],X=!1,J.label=1;case 1:return X?[3,6]:F===null?[3,2]:($.push(F),F=F.left,[3,5]);case 2:return $.length===0?[3,4]:(F=$.pop(),[4,F]);case 3:return J.sent(),F=F.right,[3,5];case 4:X=!0,J.label=5;case 5:return[3,1];case 6:return[2]}})},ue}();function h(ue,F,$,X){var J=X-$;if(J>0){var K=$+Math.floor(J/2),Se=ue[K],ge=F[K],De=new t(Se,ge);return De.left=h(ue,F,$,K),De.right=h(ue,F,K+1,X),De}return null}o(h,"loadRecursive");function y(ue,F){for(var $=new t(null,null),X=$,J=0;J<ue.length;J++)X=X.next=new t(ue[J],F[J]);return X.next=null,$.next}o(y,"createList");function b(ue){for(var F=ue,$=[],X=!1,J=new t(null,null),K=J;!X;)F?($.push(F),F=F.left):$.length>0?(F=K=K.next=$.pop(),F=F.right):X=!0;return K.next=null,J.next}o(b,"toList");function _(ue,F,$){var X=$-F;if(X>0){var J=F+Math.floor(X/2),K=_(ue,F,J),Se=ue.head;return Se.left=K,ue.head=ue.head.next,Se.right=_(ue,J+1,$),Se}return null}o(_,"sortedListToBST");function C(ue,F,$){for(var X=new t(null,null),J=X,K=ue,Se=F;K!==null&&Se!==null;)$(K.key,Se.key)<0?(J.next=K,K=K.next):(J.next=Se,Se=Se.next),J=J.next;return K!==null?J.next=K:Se!==null&&(J.next=Se),X.next}o(C,"mergeLists");function P(ue,F,$,X,J){if(!($>=X)){for(var K=ue[$+X>>1],Se=$-1,ge=X+1;;){do Se++;while(J(ue[Se],K)<0);do ge--;while(J(ue[ge],K)>0);if(Se>=ge)break;var De=ue[Se];ue[Se]=ue[ge],ue[ge]=De,De=F[Se],F[Se]=F[ge],F[ge]=De}P(ue,F,$,ge,J),P(ue,F,ge+1,X,J)}}o(P,"sort");let E=o((ue,F)=>ue.ll.x<=F.x&&F.x<=ue.ur.x&&ue.ll.y<=F.y&&F.y<=ue.ur.y,"isInBbox"),w=o((ue,F)=>{if(F.ur.x<ue.ll.x||ue.ur.x<F.ll.x||F.ur.y<ue.ll.y||ue.ur.y<F.ll.y)return null;let $=ue.ll.x<F.ll.x?F.ll.x:ue.ll.x,X=ue.ur.x<F.ur.x?ue.ur.x:F.ur.x,J=ue.ll.y<F.ll.y?F.ll.y:ue.ll.y,K=ue.ur.y<F.ur.y?ue.ur.y:F.ur.y;return{ll:{x:$,y:J},ur:{x:X,y:K}}},"getBboxOverlap"),O=Number.EPSILON;O===void 0&&(O=Math.pow(2,-52));let D=O*O,A=o((ue,F)=>{if(-O<ue&&ue<O&&-O<F&&F<O)return 0;let $=ue-F;return $*$<D*ue*F?0:ue<F?-1:1},"cmp"),ts=class ts{constructor(){this.reset()}reset(){this.xRounder=new j,this.yRounder=new j}round(F,$){return{x:this.xRounder.round(F),y:this.yRounder.round($)}}};o(ts,"PtRounder");let k=ts,ro=class ro{constructor(){this.tree=new p,this.round(0)}round(F){let $=this.tree.add(F),X=this.tree.prev($);if(X!==null&&A($.key,X.key)===0)return this.tree.remove(F),X.key;let J=this.tree.next($);return J!==null&&A($.key,J.key)===0?(this.tree.remove(F),J.key):F}};o(ro,"CoordRounder");let j=ro,W=new k,Y=11102230246251565e-32,N=134217729,Z=(3+8*Y)*Y;function le(ue,F,$,X,J){let K,Se,ge,De,Pe=F[0],et=X[0],he=0,Fe=0;et>Pe==et>-Pe?(K=Pe,Pe=F[++he]):(K=et,et=X[++Fe]);let Le=0;if(he<ue&&Fe<$)for(et>Pe==et>-Pe?(Se=Pe+K,ge=K-(Se-Pe),Pe=F[++he]):(Se=et+K,ge=K-(Se-et),et=X[++Fe]),K=Se,ge!==0&&(J[Le++]=ge);he<ue&&Fe<$;)et>Pe==et>-Pe?(Se=K+Pe,De=Se-K,ge=K-(Se-De)+(Pe-De),Pe=F[++he]):(Se=K+et,De=Se-K,ge=K-(Se-De)+(et-De),et=X[++Fe]),K=Se,ge!==0&&(J[Le++]=ge);for(;he<ue;)Se=K+Pe,De=Se-K,ge=K-(Se-De)+(Pe-De),Pe=F[++he],K=Se,ge!==0&&(J[Le++]=ge);for(;Fe<$;)Se=K+et,De=Se-K,ge=K-(Se-De)+(et-De),et=X[++Fe],K=Se,ge!==0&&(J[Le++]=ge);return(K!==0||Le===0)&&(J[Le++]=K),Le}o(le,"sum");function se(ue,F){let $=F[0];for(let X=1;X<ue;X++)$+=F[X];return $}o(se,"estimate");function U(ue){return new Float64Array(ue)}o(U,"vec");let ye=(3+16*Y)*Y,ne=(2+12*Y)*Y,Ce=(9+64*Y)*Y*Y,Ie=U(4),Ue=U(8),ve=U(12),Te=U(16),Q=U(4);function Qe(ue,F,$,X,J,K,Se){let ge,De,Pe,et,he,Fe,Le,bt,ht,kt,xt,dn,_n,si,Sn,no,Qt,Gt,is=ue-J,Gn=$-J,Hi=F-K,Xr=X-K;si=is*Xr,Fe=N*is,Le=Fe-(Fe-is),bt=is-Le,Fe=N*Xr,ht=Fe-(Fe-Xr),kt=Xr-ht,Sn=bt*kt-(si-Le*ht-bt*ht-Le*kt),no=Hi*Gn,Fe=N*Hi,Le=Fe-(Fe-Hi),bt=Hi-Le,Fe=N*Gn,ht=Fe-(Fe-Gn),kt=Gn-ht,Qt=bt*kt-(no-Le*ht-bt*ht-Le*kt),xt=Sn-Qt,he=Sn-xt,Ie[0]=Sn-(xt+he)+(he-Qt),dn=si+xt,he=dn-si,_n=si-(dn-he)+(xt-he),xt=_n-no,he=_n-xt,Ie[1]=_n-(xt+he)+(he-no),Gt=dn+xt,he=Gt-dn,Ie[2]=dn-(Gt-he)+(xt-he),Ie[3]=Gt;let Ms=se(4,Ie),os=ne*Se;if(Ms>=os||-Ms>=os||(he=ue-is,ge=ue-(is+he)+(he-J),he=$-Gn,Pe=$-(Gn+he)+(he-J),he=F-Hi,De=F-(Hi+he)+(he-K),he=X-Xr,et=X-(Xr+he)+(he-K),ge===0&&De===0&&Pe===0&&et===0)||(os=Ce*Se+Z*Math.abs(Ms),Ms+=is*et+Xr*ge-(Hi*Pe+Gn*De),Ms>=os||-Ms>=os))return Ms;si=ge*Xr,Fe=N*ge,Le=Fe-(Fe-ge),bt=ge-Le,Fe=N*Xr,ht=Fe-(Fe-Xr),kt=Xr-ht,Sn=bt*kt-(si-Le*ht-bt*ht-Le*kt),no=De*Gn,Fe=N*De,Le=Fe-(Fe-De),bt=De-Le,Fe=N*Gn,ht=Fe-(Fe-Gn),kt=Gn-ht,Qt=bt*kt-(no-Le*ht-bt*ht-Le*kt),xt=Sn-Qt,he=Sn-xt,Q[0]=Sn-(xt+he)+(he-Qt),dn=si+xt,he=dn-si,_n=si-(dn-he)+(xt-he),xt=_n-no,he=_n-xt,Q[1]=_n-(xt+he)+(he-no),Gt=dn+xt,he=Gt-dn,Q[2]=dn-(Gt-he)+(xt-he),Q[3]=Gt;let Ka=le(4,Ie,4,Q,Ue);si=is*et,Fe=N*is,Le=Fe-(Fe-is),bt=is-Le,Fe=N*et,ht=Fe-(Fe-et),kt=et-ht,Sn=bt*kt-(si-Le*ht-bt*ht-Le*kt),no=Hi*Pe,Fe=N*Hi,Le=Fe-(Fe-Hi),bt=Hi-Le,Fe=N*Pe,ht=Fe-(Fe-Pe),kt=Pe-ht,Qt=bt*kt-(no-Le*ht-bt*ht-Le*kt),xt=Sn-Qt,he=Sn-xt,Q[0]=Sn-(xt+he)+(he-Qt),dn=si+xt,he=dn-si,_n=si-(dn-he)+(xt-he),xt=_n-no,he=_n-xt,Q[1]=_n-(xt+he)+(he-no),Gt=dn+xt,he=Gt-dn,Q[2]=dn-(Gt-he)+(xt-he),Q[3]=Gt;let Os=le(Ka,Ue,4,Q,ve);si=ge*et,Fe=N*ge,Le=Fe-(Fe-ge),bt=ge-Le,Fe=N*et,ht=Fe-(Fe-et),kt=et-ht,Sn=bt*kt-(si-Le*ht-bt*ht-Le*kt),no=De*Pe,Fe=N*De,Le=Fe-(Fe-De),bt=De-Le,Fe=N*Pe,ht=Fe-(Fe-Pe),kt=Pe-ht,Qt=bt*kt-(no-Le*ht-bt*ht-Le*kt),xt=Sn-Qt,he=Sn-xt,Q[0]=Sn-(xt+he)+(he-Qt),dn=si+xt,he=dn-si,_n=si-(dn-he)+(xt-he),xt=_n-no,he=_n-xt,Q[1]=_n-(xt+he)+(he-no),Gt=dn+xt,he=Gt-dn,Q[2]=dn-(Gt-he)+(xt-he),Q[3]=Gt;let Wy=le(Os,ve,4,Q,Te);return Te[Wy-1]}o(Qe,"orient2dadapt");function Ye(ue,F,$,X,J,K){let Se=(F-K)*($-J),ge=(ue-J)*(X-K),De=Se-ge,Pe=Math.abs(Se+ge);return Math.abs(De)>=ye*Pe?De:-Qe(ue,F,$,X,J,K,Pe)}o(Ye,"orient2d");let nt=o((ue,F)=>ue.x*F.y-ue.y*F.x,"crossProduct"),Ae=o((ue,F)=>ue.x*F.x+ue.y*F.y,"dotProduct"),Be=o((ue,F,$)=>{let X=Ye(ue.x,ue.y,F.x,F.y,$.x,$.y);return X>0?-1:X<0?1:0},"compareVectorAngles"),We=o(ue=>Math.sqrt(Ae(ue,ue)),"length"),$e=o((ue,F,$)=>{let X={x:F.x-ue.x,y:F.y-ue.y},J={x:$.x-ue.x,y:$.y-ue.y};return nt(J,X)/We(J)/We(X)},"sineOfAngle"),we=o((ue,F,$)=>{let X={x:F.x-ue.x,y:F.y-ue.y},J={x:$.x-ue.x,y:$.y-ue.y};return Ae(J,X)/We(J)/We(X)},"cosineOfAngle"),H=o((ue,F,$)=>F.y===0?null:{x:ue.x+F.x/F.y*($-ue.y),y:$},"horizontalIntersection"),ie=o((ue,F,$)=>F.x===0?null:{x:$,y:ue.y+F.y/F.x*($-ue.x)},"verticalIntersection"),ee=o((ue,F,$,X)=>{if(F.x===0)return ie($,X,ue.x);if(X.x===0)return ie(ue,F,$.x);if(F.y===0)return H($,X,ue.y);if(X.y===0)return H(ue,F,$.y);let J=nt(F,X);if(J==0)return null;let K={x:$.x-ue.x,y:$.y-ue.y},Se=nt(K,F)/J,ge=nt(K,X)/J,De=ue.x+ge*F.x,Pe=$.x+Se*X.x,et=ue.y+ge*F.y,he=$.y+Se*X.y,Fe=(De+Pe)/2,Le=(et+he)/2;return{x:Fe,y:Le}},"intersection$1"),rs=class rs{static compare(F,$){let X=rs.comparePoints(F.point,$.point);return X!==0?X:(F.point!==$.point&&F.link($),F.isLeft!==$.isLeft?F.isLeft?1:-1:Oe.compare(F.segment,$.segment))}static comparePoints(F,$){return F.x<$.x?-1:F.x>$.x?1:F.y<$.y?-1:F.y>$.y?1:0}constructor(F,$){F.events===void 0?F.events=[this]:F.events.push(this),this.point=F,this.isLeft=$}link(F){if(F.point===this.point)throw new Error("Tried to link already linked events");let $=F.point.events;for(let X=0,J=$.length;X<J;X++){let K=$[X];this.point.events.push(K),K.point=this.point}this.checkForConsuming()}checkForConsuming(){let F=this.point.events.length;for(let $=0;$<F;$++){let X=this.point.events[$];if(X.segment.consumedBy===void 0)for(let J=$+1;J<F;J++){let K=this.point.events[J];K.consumedBy===void 0&&X.otherSE.point.events===K.otherSE.point.events&&X.segment.consume(K.segment)}}}getAvailableLinkedEvents(){let F=[];for(let $=0,X=this.point.events.length;$<X;$++){let J=this.point.events[$];J!==this&&!J.segment.ringOut&&J.segment.isInResult()&&F.push(J)}return F}getLeftmostComparator(F){let $=new Map,X=o(J=>{let K=J.otherSE;$.set(J,{sine:$e(this.point,F.point,K.point),cosine:we(this.point,F.point,K.point)})},"fillCache");return(J,K)=>{$.has(J)||X(J),$.has(K)||X(K);let{sine:Se,cosine:ge}=$.get(J),{sine:De,cosine:Pe}=$.get(K);return Se>=0&&De>=0?ge<Pe?1:ge>Pe?-1:0:Se<0&&De<0?ge<Pe?-1:ge>Pe?1:0:De<Se?-1:De>Se?1:0}}};o(rs,"SweepEvent");let Me=rs,Ne=0,Za=class Za{static compare(F,$){let X=F.leftSE.point.x,J=$.leftSE.point.x,K=F.rightSE.point.x,Se=$.rightSE.point.x;if(Se<X)return 1;if(K<J)return-1;let ge=F.leftSE.point.y,De=$.leftSE.point.y,Pe=F.rightSE.point.y,et=$.rightSE.point.y;if(X<J){if(De<ge&&De<Pe)return 1;if(De>ge&&De>Pe)return-1;let he=F.comparePoint($.leftSE.point);if(he<0)return 1;if(he>0)return-1;let Fe=$.comparePoint(F.rightSE.point);return Fe!==0?Fe:-1}if(X>J){if(ge<De&&ge<et)return-1;if(ge>De&&ge>et)return 1;let he=$.comparePoint(F.leftSE.point);if(he!==0)return he;let Fe=F.comparePoint($.rightSE.point);return Fe<0?1:Fe>0?-1:1}if(ge<De)return-1;if(ge>De)return 1;if(K<Se){let he=$.comparePoint(F.rightSE.point);if(he!==0)return he}if(K>Se){let he=F.comparePoint($.rightSE.point);if(he<0)return 1;if(he>0)return-1}if(K!==Se){let he=Pe-ge,Fe=K-X,Le=et-De,bt=Se-J;if(he>Fe&&Le<bt)return 1;if(he<Fe&&Le>bt)return-1}return K>Se?1:K<Se||Pe<et?-1:Pe>et?1:F.id<$.id?-1:F.id>$.id?1:0}constructor(F,$,X,J){this.id=++Ne,this.leftSE=F,F.segment=this,F.otherSE=$,this.rightSE=$,$.segment=this,$.otherSE=F,this.rings=X,this.windings=J}static fromRing(F,$,X){let J,K,Se,ge=Me.comparePoints(F,$);if(ge<0)J=F,K=$,Se=1;else if(ge>0)J=$,K=F,Se=-1;else throw new Error("Tried to create degenerate segment at [".concat(F.x,", ").concat(F.y,"]"));let De=new Me(J,!0),Pe=new Me(K,!1);return new Za(De,Pe,[X],[Se])}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,$=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:F<$?F:$},ur:{x:this.rightSE.point.x,y:F>$?F:$}}}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 $=this.leftSE.point,X=this.rightSE.point,J=this.vector();if($.x===X.x)return F.x===$.x?0:F.x<$.x?1:-1;let K=(F.y-$.y)/J.y,Se=$.x+K*J.x;if(F.x===Se)return 0;let ge=(F.x-$.x)/J.x,De=$.y+ge*J.y;return F.y===De?0:F.y<De?-1:1}getIntersection(F){let $=this.bbox(),X=F.bbox(),J=w($,X);if(J===null)return null;let K=this.leftSE.point,Se=this.rightSE.point,ge=F.leftSE.point,De=F.rightSE.point,Pe=E($,ge)&&this.comparePoint(ge)===0,et=E(X,K)&&F.comparePoint(K)===0,he=E($,De)&&this.comparePoint(De)===0,Fe=E(X,Se)&&F.comparePoint(Se)===0;if(et&&Pe)return Fe&&!he?Se:!Fe&&he?De:null;if(et)return he&&K.x===De.x&&K.y===De.y?null:K;if(Pe)return Fe&&Se.x===ge.x&&Se.y===ge.y?null:ge;if(Fe&&he)return null;if(Fe)return Se;if(he)return De;let Le=ee(K,this.vector(),ge,F.vector());return Le===null||!E(J,Le)?null:W.round(Le.x,Le.y)}split(F){let $=[],X=F.events!==void 0,J=new Me(F,!0),K=new Me(F,!1),Se=this.rightSE;this.replaceRightSE(K),$.push(K),$.push(J);let ge=new Za(J,Se,this.rings.slice(),this.windings.slice());return Me.comparePoints(ge.leftSE.point,ge.rightSE.point)>0&&ge.swapEvents(),Me.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),X&&(J.checkForConsuming(),K.checkForConsuming()),$}swapEvents(){let F=this.rightSE;this.rightSE=this.leftSE,this.leftSE=F,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let $=0,X=this.windings.length;$<X;$++)this.windings[$]*=-1}consume(F){let $=this,X=F;for(;$.consumedBy;)$=$.consumedBy;for(;X.consumedBy;)X=X.consumedBy;let J=Za.compare($,X);if(J!==0){if(J>0){let K=$;$=X,X=K}if($.prev===X){let K=$;$=X,X=K}for(let K=0,Se=X.rings.length;K<Se;K++){let ge=X.rings[K],De=X.windings[K],Pe=$.rings.indexOf(ge);Pe===-1?($.rings.push(ge),$.windings.push(De)):$.windings[Pe]+=De}X.rings=null,X.windings=null,X.consumedBy=$,X.leftSE.consumedBy=$.leftSE,X.rightSE.consumedBy=$.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 $=this._afterState.rings,X=this._afterState.windings,J=this._afterState.multiPolys;for(let ge=0,De=this.rings.length;ge<De;ge++){let Pe=this.rings[ge],et=this.windings[ge],he=$.indexOf(Pe);he===-1?($.push(Pe),X.push(et)):X[he]+=et}let K=[],Se=[];for(let ge=0,De=$.length;ge<De;ge++){if(X[ge]===0)continue;let Pe=$[ge],et=Pe.poly;if(Se.indexOf(et)===-1)if(Pe.isExterior)K.push(et);else{Se.indexOf(et)===-1&&Se.push(et);let he=K.indexOf(Pe.poly);he!==-1&&K.splice(he,1)}}for(let ge=0,De=K.length;ge<De;ge++){let Pe=K[ge].multiPoly;J.indexOf(Pe)===-1&&J.push(Pe)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let F=this.beforeState().multiPolys,$=this.afterState().multiPolys;switch(ze.type){case"union":{let X=F.length===0,J=$.length===0;this._isInResult=X!==J;break}case"intersection":{let X,J;F.length<$.length?(X=F.length,J=$.length):(X=$.length,J=F.length),this._isInResult=J===ze.numMultiPolys&&X<J;break}case"xor":{let X=Math.abs(F.length-$.length);this._isInResult=X%2===1;break}case"difference":{let X=o(J=>J.length===1&&J[0].isSubject,"isJustSubject");this._isInResult=X(F)!==X($);break}default:throw new Error("Unrecognized operation type found ".concat(ze.type))}return this._isInResult}};o(Za,"Segment");let Oe=Za,mc=class mc{constructor(F,$,X){if(!Array.isArray(F)||F.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=$,this.isExterior=X,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=W.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 Se=1,ge=F.length;Se<ge;Se++){if(typeof F[Se][0]!="number"||typeof F[Se][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let De=W.round(F[Se][0],F[Se][1]);De.x===K.x&&De.y===K.y||(this.segments.push(Oe.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(Oe.fromRing(K,J,this))}getSweepEvents(){let F=[];for(let $=0,X=this.segments.length;$<X;$++){let J=this.segments[$];F.push(J.leftSE),F.push(J.rightSE)}return F}};o(mc,"RingIn");let Ze=mc,gc=class gc{constructor(F,$){if(!Array.isArray(F))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ze(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 X=1,J=F.length;X<J;X++){let K=new Ze(F[X],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=$}getSweepEvents(){let F=this.exteriorRing.getSweepEvents();for(let $=0,X=this.interiorRings.length;$<X;$++){let J=this.interiorRings[$].getSweepEvents();for(let K=0,Se=J.length;K<Se;K++)F.push(J[K])}return F}};o(gc,"PolyIn");let Pt=gc,yc=class yc{constructor(F,$){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(X){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let X=0,J=F.length;X<J;X++){let K=new Pt(F[X],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=$}getSweepEvents(){let F=[];for(let $=0,X=this.polys.length;$<X;$++){let J=this.polys[$].getSweepEvents();for(let K=0,Se=J.length;K<Se;K++)F.push(J[K])}return F}};o(yc,"MultiPolyIn");let Er=yc,On=class On{static factory(F){let $=[];for(let X=0,J=F.length;X<J;X++){let K=F[X];if(!K.isInResult()||K.ringOut)continue;let Se=null,ge=K.leftSE,De=K.rightSE,Pe=[ge],et=ge.point,he=[];for(;Se=ge,ge=De,Pe.push(ge),ge.point!==et;)for(;;){let Fe=ge.getAvailableLinkedEvents();if(Fe.length===0){let ht=Pe[0].point,kt=Pe[Pe.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(ht.x,",")+" ".concat(ht.y,"]. Last matching segment found ends at")+" [".concat(kt.x,", ").concat(kt.y,"]."))}if(Fe.length===1){De=Fe[0].otherSE;break}let Le=null;for(let ht=0,kt=he.length;ht<kt;ht++)if(he[ht].point===ge.point){Le=ht;break}if(Le!==null){let ht=he.splice(Le)[0],kt=Pe.splice(ht.index);kt.unshift(kt[0].otherSE),$.push(new On(kt.reverse()));continue}he.push({index:Pe.length,point:ge.point});let bt=ge.getLeftmostComparator(Se);De=Fe.sort(bt)[0].otherSE;break}$.push(new On(Pe))}return $}constructor(F){this.events=F;for(let $=0,X=F.length;$<X;$++)F[$].segment.ringOut=this;this.poly=null}getGeom(){let F=this.events[0].point,$=[F];for(let Pe=1,et=this.events.length-1;Pe<et;Pe++){let he=this.events[Pe].point,Fe=this.events[Pe+1].point;Be(he,F,Fe)!==0&&($.push(he),F=he)}if($.length===1)return null;let X=$[0],J=$[1];Be(X,F,J)===0&&$.shift(),$.push($[0]);let K=this.isExteriorRing()?1:-1,Se=this.isExteriorRing()?0:$.length-1,ge=this.isExteriorRing()?$.length:-1,De=[];for(let Pe=Se;Pe!=ge;Pe+=K)De.push([$[Pe].x,$[Pe].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 Se=this.events[J];Me.compare(F,Se)>0&&(F=Se)}let $=F.segment.prevInResult(),X=$?$.prevInResult():null;for(;;){if(!$)return null;if(!X)return $.ringOut;if(X.ringOut!==$.ringOut)return X.ringOut.enclosingRing()!==$.ringOut?$.ringOut:$.ringOut.enclosingRing();$=X.prevInResult(),X=$?$.prevInResult():null}}};o(On,"RingOut");let $n=On,vc=class vc{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 $=0,X=this.interiorRings.length;$<X;$++){let J=this.interiorRings[$].getGeom();J!==null&&F.push(J)}return F}};o(vc,"PolyOut");let ot=vc,ns=class ns{constructor(F){this.rings=F,this.polys=this._composePolys(F)}getGeom(){let F=[];for(let $=0,X=this.polys.length;$<X;$++){let J=this.polys[$].getGeom();J!==null&&F.push(J)}return F}_composePolys(F){let $=[];for(let X=0,J=F.length;X<J;X++){let K=F[X];if(!K.poly)if(K.isExteriorRing())$.push(new ot(K));else{let Se=K.enclosingRing();Se.poly||$.push(new ot(Se)),Se.poly.addInterior(K)}}return $}};o(ns,"MultiPolyOut");let zt=ns,He=class He{constructor(F){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.compare;this.queue=F,this.tree=new p($),this.segments=[]}process(F){let $=F.segment,X=[];if(F.consumedBy)return F.isLeft?this.queue.remove(F.otherSE):this.tree.remove($),X;let J=F.isLeft?this.tree.add($):this.tree.find($);if(!J)throw new Error("Unable to find segment #".concat($.id," ")+"[".concat($.leftSE.point.x,", ").concat($.leftSE.point.y,"] -> ")+"[".concat($.rightSE.point.x,", ").concat($.rightSE.point.y,"] ")+"in SweepLine tree.");let K=J,Se=J,ge,De;for(;ge===void 0;)K=this.tree.prev(K),K===null?ge=null:K.key.consumedBy===void 0&&(ge=K.key);for(;De===void 0;)Se=this.tree.next(Se),Se===null?De=null:Se.key.consumedBy===void 0&&(De=Se.key);if(F.isLeft){let Pe=null;if(ge){let he=ge.getIntersection($);if(he!==null&&($.isAnEndpoint(he)||(Pe=he),!ge.isAnEndpoint(he))){let Fe=this._splitSafely(ge,he);for(let Le=0,bt=Fe.length;Le<bt;Le++)X.push(Fe[Le])}}let et=null;if(De){let he=De.getIntersection($);if(he!==null&&($.isAnEndpoint(he)||(et=he),!De.isAnEndpoint(he))){let Fe=this._splitSafely(De,he);for(let Le=0,bt=Fe.length;Le<bt;Le++)X.push(Fe[Le])}}if(Pe!==null||et!==null){let he=null;Pe===null?he=et:et===null?he=Pe:he=Me.comparePoints(Pe,et)<=0?Pe:et,this.queue.remove($.rightSE),X.push($.rightSE);let Fe=$.split(he);for(let Le=0,bt=Fe.length;Le<bt;Le++)X.push(Fe[Le])}X.length>0?(this.tree.remove($),X.push(F)):(this.segments.push($),$.prev=ge)}else{if(ge&&De){let Pe=ge.getIntersection(De);if(Pe!==null){if(!ge.isAnEndpoint(Pe)){let et=this._splitSafely(ge,Pe);for(let he=0,Fe=et.length;he<Fe;he++)X.push(et[he])}if(!De.isAnEndpoint(Pe)){let et=this._splitSafely(De,Pe);for(let he=0,Fe=et.length;he<Fe;he++)X.push(et[he])}}}this.tree.remove($)}return X}_splitSafely(F,$){this.tree.remove(F);let X=F.rightSE;this.queue.remove(X);let J=F.split($);return J.push(X),F.consumedBy===void 0&&this.tree.add(F),J}};o(He,"SweepLine");let es=He,Ro=typeof I<"u"&&I.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Js=typeof I<"u"&&I.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,bb=class bb{run(F,$,X){ze.type=F,W.reset();let J=[new Er($,!0)];for(let he=0,Fe=X.length;he<Fe;he++)J.push(new Er(X[he],!1));if(ze.numMultiPolys=J.length,ze.type==="difference"){let he=J[0],Fe=1;for(;Fe<J.length;)w(J[Fe].bbox,he.bbox)!==null?Fe++:J.splice(Fe,1)}if(ze.type==="intersection")for(let he=0,Fe=J.length;he<Fe;he++){let Le=J[he];for(let bt=he+1,ht=J.length;bt<ht;bt++)if(w(Le.bbox,J[bt].bbox)===null)return[]}let K=new p(Me.compare);for(let he=0,Fe=J.length;he<Fe;he++){let Le=J[he].getSweepEvents();for(let bt=0,ht=Le.length;bt<ht;bt++)if(K.insert(Le[bt]),K.size>Ro)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let Se=new es(K),ge=K.size,De=K.pop();for(;De;){let he=De.key;if(K.size===ge){let Le=he.segment;throw new Error("Unable to pop() ".concat(he.isLeft?"left":"right"," SweepEvent ")+"[".concat(he.point.x,", ").concat(he.point.y,"] from segment #").concat(Le.id," ")+"[".concat(Le.leftSE.point.x,", ").concat(Le.leftSE.point.y,"] -> ")+"[".concat(Le.rightSE.point.x,", ").concat(Le.rightSE.point.y,"] from queue."))}if(K.size>Ro)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(Se.segments.length>Js)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let Fe=Se.process(he);for(let Le=0,bt=Fe.length;Le<bt;Le++){let ht=Fe[Le];ht.consumedBy===void 0&&K.insert(ht)}ge=K.size,De=K.pop()}W.reset();let Pe=$n.factory(Se.segments);return new zt(Pe).getGeom()}};o(bb,"Operation");let Ri=bb,ze=new Ri;var hc={union:o(function(ue){for(var F=arguments.length,$=new Array(F>1?F-1:0),X=1;X<F;X++)$[X-1]=arguments[X];return ze.run("union",ue,$)},"union"),intersection:o(function(ue){for(var F=arguments.length,$=new Array(F>1?F-1:0),X=1;X<F;X++)$[X-1]=arguments[X];return ze.run("intersection",ue,$)},"intersection"),xor:o(function(ue){for(var F=arguments.length,$=new Array(F>1?F-1:0),X=1;X<F;X++)$[X-1]=arguments[X];return ze.run("xor",ue,$)},"xor"),difference:o(function(ue){for(var F=arguments.length,$=new Array(F>1?F-1:0),X=1;X<F;X++)$[X-1]=arguments[X];return ze.run("difference",ue,$)},"difference")};return hc})});var j$=fe((fC,B$)=>{g();(function(e,t){typeof fC=="object"&&typeof B$<"u"?t(fC):typeof define=="function"&&define.amd?define(["exports"],t):t(e.jsts={})})(fC,function(e){"use strict";function t(){}o(t,"e");function r(a){this.message=a||""}o(r,"n");function n(a){this.message=a||""}o(n,"i");function i(a){this.message=a||""}o(i,"r");function s(){}o(s,"o");function l(a){return a===null?Pe:a.color}o(l,"s");function c(a){return a===null?null:a.parent}o(c,"a");function p(a,u){a!==null&&(a.color=u)}o(p,"u");function h(a){return a===null?null:a.left}o(h,"l");function y(a){return a===null?null:a.right}o(y,"c");function b(){this.root_=null,this.size_=0}o(b,"p");function _(){}o(_,"h");function C(){this.array_=[],arguments[0]instanceof On&&this.addAll(arguments[0])}o(C,"f");function P(){}o(P,"g");function E(a){this.message=a||""}o(E,"d");function w(){this.array_=[]}o(w,"y"),"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:o(function(a){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var u=Object(this),f=Math.max(Math.min(u.length,9007199254740991),0)||0,m=1 in arguments&&parseInt(Number(arguments[1]),10)||0;m=m<0?Math.max(f+m,0):Math.min(m,f);var v=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:f;for(v=v<0?Math.max(f+arguments[2],0):Math.min(v,f);m<v;)u[m]=a,++m;return u},"value"),writable:!0}),Number.isFinite=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Number.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(a){return a!=a},Math.trunc=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};var O=o(function(){},"_");O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.prototype.equalsWithTolerance=function(a,u,f){return Math.abs(a-u)<=f};var D=function(a){function u(f){a.call(this,f),this.name="IllegalArgumentException",this.message=f,this.stack=new a().stack}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u}(Error),A=o(function(){},"v"),k={MAX_VALUE:{configurable:!0}};A.isNaN=function(a){return Number.isNaN(a)},A.doubleToLongBits=function(a){return a},A.longBitsToDouble=function(a){return a},A.isInfinite=function(a){return!Number.isFinite(a)},k.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(A,k);var j=o(function(){},"E"),W=o(function(){},"x"),Y=o(function(){},"N"),N=o(function a(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=a.NULL_ORDINATE;else if(arguments.length===1){var u=arguments[0];this.x=u.x,this.y=u.y,this.z=u.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=a.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},"t"),Z={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};N.prototype.setOrdinate=function(a,u){switch(a){case N.X:this.x=u;break;case N.Y:this.y=u;break;case N.Z:this.z=u;break;default:throw new D("Invalid ordinate index: "+a)}},N.prototype.equals2D=function(){if(arguments.length===1){var a=arguments[0];return this.x===a.x&&this.y===a.y}if(arguments.length===2){var u=arguments[0],f=arguments[1];return!!O.equalsWithTolerance(this.x,u.x,f)&&!!O.equalsWithTolerance(this.y,u.y,f)}},N.prototype.getOrdinate=function(a){switch(a){case N.X:return this.x;case N.Y:return this.y;case N.Z:return this.z}throw new D("Invalid ordinate index: "+a)},N.prototype.equals3D=function(a){return this.x===a.x&&this.y===a.y&&(this.z===a.z||A.isNaN(this.z))&&A.isNaN(a.z)},N.prototype.equals=function(a){return a instanceof N&&this.equals2D(a)},N.prototype.equalInZ=function(a,u){return O.equalsWithTolerance(this.z,a.z,u)},N.prototype.compareTo=function(a){var u=a;return this.x<u.x?-1:this.x>u.x?1:this.y<u.y?-1:this.y>u.y?1:0},N.prototype.clone=function(){},N.prototype.copy=function(){return new N(this)},N.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},N.prototype.distance3D=function(a){var u=this.x-a.x,f=this.y-a.y,m=this.z-a.z;return Math.sqrt(u*u+f*f+m*m)},N.prototype.distance=function(a){var u=this.x-a.x,f=this.y-a.y;return Math.sqrt(u*u+f*f)},N.prototype.hashCode=function(){var a=17;return a=37*a+N.hashCode(this.x),a=37*a+N.hashCode(this.y)},N.prototype.setCoordinate=function(a){this.x=a.x,this.y=a.y,this.z=a.z},N.prototype.interfaces_=function(){return[j,W,t]},N.prototype.getClass=function(){return N},N.hashCode=function(){if(arguments.length===1){var a=arguments[0],u=A.doubleToLongBits(a);return Math.trunc((u^u)>>>32)}},Z.DimensionalComparator.get=function(){return le},Z.serialVersionUID.get=function(){return 6683108902428367e3},Z.NULL_ORDINATE.get=function(){return A.NaN},Z.X.get=function(){return 0},Z.Y.get=function(){return 1},Z.Z.get=function(){return 2},Object.defineProperties(N,Z);var le=o(function(a){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var u=arguments[0];if(u!==2&&u!==3)throw new D("only 2 or 3 dimensions may be specified");this._dimensionsToTest=u}}},"L");le.prototype.compare=function(a,u){var f=a,m=u,v=le.compare(f.x,m.x);if(v!==0)return v;var S=le.compare(f.y,m.y);return S!==0?S:this._dimensionsToTest<=2?0:le.compare(f.z,m.z)},le.prototype.interfaces_=function(){return[Y]},le.prototype.getClass=function(){return le},le.compare=function(a,u){return a<u?-1:a>u?1:A.isNaN(a)?A.isNaN(u)?0:-1:A.isNaN(u)?1:0};var se=o(function(){},"b");se.prototype.create=function(){},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se};var U=o(function(){},"w"),ye={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(a){switch(a){case U.EXTERIOR:return"e";case U.BOUNDARY:return"b";case U.INTERIOR:return"i";case U.NONE:return"-"}throw new D("Unknown location value: "+a)},ye.INTERIOR.get=function(){return 0},ye.BOUNDARY.get=function(){return 1},ye.EXTERIOR.get=function(){return 2},ye.NONE.get=function(){return-1},Object.defineProperties(U,ye);var ne=o(function(a,u){return a.interfaces_&&a.interfaces_().indexOf(u)>-1},"T"),Ce=o(function(){},"R"),Ie={LOG_10:{configurable:!0}};Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},Ce.log10=function(a){var u=Math.log(a);return A.isInfinite(u)||A.isNaN(u)?u:u/Ce.LOG_10},Ce.min=function(a,u,f,m){var v=a;return u<v&&(v=u),f<v&&(v=f),m<v&&(v=m),v},Ce.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var a=arguments[0],u=arguments[1],f=arguments[2];return a<u?u:a>f?f:a}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var m=arguments[0],v=arguments[1],S=arguments[2];return m<v?v:m>S?S:m}},Ce.wrap=function(a,u){return a<0?u- -a%u:a%u},Ce.max=function(){if(arguments.length===3){var a=arguments[0],u=arguments[1],f=arguments[2],m=a;return u>m&&(m=u),f>m&&(m=f),m}if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],B=arguments[3],z=v;return S>z&&(z=S),M>z&&(z=M),B>z&&(z=B),z}},Ce.average=function(a,u){return(a+u)/2},Ie.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Ce,Ie);var Ue=o(function(a){this.str=a},"D");Ue.prototype.append=function(a){this.str+=a},Ue.prototype.setCharAt=function(a,u){this.str=this.str.substr(0,a)+u+this.str.substr(a+1)},Ue.prototype.toString=function(a){return this.str};var ve=o(function(a){this.value=a},"M");ve.prototype.intValue=function(){return this.value},ve.prototype.compareTo=function(a){return this.value<a?-1:this.value>a?1:0},ve.isNaN=function(a){return Number.isNaN(a)};var Te=o(function(){},"A");Te.isWhitespace=function(a){return a<=32&&a>=0||a===127},Te.toUpperCase=function(a){return a.toUpperCase()};var Q=o(function a(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var u=arguments[0];this.init(u)}else if(arguments[0]instanceof a){var f=arguments[0];this.init(f)}else if(typeof arguments[0]=="string"){var m=arguments[0];a.call(this,a.parse(m))}}else if(arguments.length===2){var v=arguments[0],S=arguments[1];this.init(v,S)}},"t"),Qe={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Q.prototype.le=function(a){return(this._hi<a._hi||this._hi===a._hi)&&this._lo<=a._lo},Q.prototype.extractSignificantDigits=function(a,u){var f=this.abs(),m=Q.magnitude(f._hi),v=Q.TEN.pow(m);(f=f.divide(v)).gt(Q.TEN)?(f=f.divide(Q.TEN),m+=1):f.lt(Q.ONE)&&(f=f.multiply(Q.TEN),m-=1);for(var S=m+1,M=new Ue,B=Q.MAX_PRINT_DIGITS-1,z=0;z<=B;z++){a&&z===S&&M.append(".");var te=Math.trunc(f._hi);if(te<0)break;var pe=!1,be=0;te>9?(pe=!0,be="9"):be="0"+te,M.append(be),f=f.subtract(Q.valueOf(te)).multiply(Q.TEN),pe&&f.selfAdd(Q.TEN);var Xe=!0,Ke=Q.magnitude(f._hi);if(Ke<0&&Math.abs(Ke)>=B-z&&(Xe=!1),!Xe)break}return u[0]=m,M.toString()},Q.prototype.sqr=function(){return this.multiply(this)},Q.prototype.doubleValue=function(){return this._hi+this._lo},Q.prototype.subtract=function(){if(arguments[0]instanceof Q){var a=arguments[0];return this.add(a.negate())}if(typeof arguments[0]=="number"){var u=arguments[0];return this.add(-u)}},Q.prototype.equals=function(){if(arguments.length===1){var a=arguments[0];return this._hi===a._hi&&this._lo===a._lo}},Q.prototype.isZero=function(){return this._hi===0&&this._lo===0},Q.prototype.selfSubtract=function(){if(arguments[0]instanceof Q){var a=arguments[0];return this.isNaN()?this:this.selfAdd(-a._hi,-a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0];return this.isNaN()?this:this.selfAdd(-u,0)}},Q.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Q.prototype.min=function(a){return this.le(a)?this:a},Q.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var a=arguments[0];return this.selfDivide(a._hi,a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0];return this.selfDivide(u,0)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1],v=null,S=null,M=null,B=null,z=null,te=null,pe=null,be=null;return z=this._hi/f,te=Q.SPLIT*z,v=te-z,be=Q.SPLIT*f,v=te-v,S=z-v,M=be-f,pe=z*f,M=be-M,B=f-M,be=v*M-pe+v*B+S*M+S*B,te=(this._hi-pe-be+this._lo-z*m)/f,be=z+te,this._hi=be,this._lo=z-be+te,this}},Q.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Q.prototype.divide=function(){if(arguments[0]instanceof Q){var a=arguments[0],u=null,f=null,m=null,v=null,S=null,M=null,B=null,z=null;return f=(S=this._hi/a._hi)-(u=(M=Q.SPLIT*S)-(u=M-S)),z=u*(m=(z=Q.SPLIT*a._hi)-(m=z-a._hi))-(B=S*a._hi)+u*(v=a._hi-m)+f*m+f*v,M=(this._hi-B-z+this._lo-S*a._lo)/a._hi,new Q(z=S+M,S-z+M)}if(typeof arguments[0]=="number"){var te=arguments[0];return A.isNaN(te)?Q.createNaN():Q.copy(this).selfDivide(te,0)}},Q.prototype.ge=function(a){return(this._hi>a._hi||this._hi===a._hi)&&this._lo>=a._lo},Q.prototype.pow=function(a){if(a===0)return Q.valueOf(1);var u=new Q(this),f=Q.valueOf(1),m=Math.abs(a);if(m>1)for(;m>0;)m%2==1&&f.selfMultiply(u),(m/=2)>0&&(u=u.sqr());else f=u;return a<0?f.reciprocal():f},Q.prototype.ceil=function(){if(this.isNaN())return Q.NaN;var a=Math.ceil(this._hi),u=0;return a===this._hi&&(u=Math.ceil(this._lo)),new Q(a,u)},Q.prototype.compareTo=function(a){var u=a;return this._hi<u._hi?-1:this._hi>u._hi?1:this._lo<u._lo?-1:this._lo>u._lo?1:0},Q.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Q.prototype.setValue=function(){if(arguments[0]instanceof Q){var a=arguments[0];return this.init(a),this}if(typeof arguments[0]=="number"){var u=arguments[0];return this.init(u),this}},Q.prototype.max=function(a){return this.ge(a)?this:a},Q.prototype.sqrt=function(){if(this.isZero())return Q.valueOf(0);if(this.isNegative())return Q.NaN;var a=1/Math.sqrt(this._hi),u=this._hi*a,f=Q.valueOf(u),m=this.subtract(f.sqr())._hi*(.5*a);return f.add(m)},Q.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var a=arguments[0];return this.selfAdd(a._hi,a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0],f=null,m=null,v=null,S=null,M=null,B=null;return v=this._hi+u,M=v-this._hi,S=v-M,S=u-M+(this._hi-S),B=S+this._lo,f=v+B,m=B+(v-f),this._hi=f+m,this._lo=m+(f-this._hi),this}}else if(arguments.length===2){var z=arguments[0],te=arguments[1],pe=null,be=null,Xe=null,Ke=null,it=null,mt=null,Zr=null;Ke=this._hi+z,be=this._lo+te,it=Ke-(mt=Ke-this._hi),Xe=be-(Zr=be-this._lo);var Ii=(pe=Ke+(mt=(it=z-mt+(this._hi-it))+be))+(mt=(Xe=te-Zr+(this._lo-Xe))+(mt+(Ke-pe))),qo=mt+(pe-Ii);return this._hi=Ii,this._lo=qo,this}},Q.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var a=arguments[0];return this.selfMultiply(a._hi,a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0];return this.selfMultiply(u,0)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1],v=null,S=null,M=null,B=null,z=null,te=null;v=(z=Q.SPLIT*this._hi)-this._hi,te=Q.SPLIT*f,v=z-v,S=this._hi-v,M=te-f;var pe=(z=this._hi*f)+(te=v*(M=te-M)-z+v*(B=f-M)+S*M+S*B+(this._hi*m+this._lo*f)),be=te+(v=z-pe);return this._hi=pe,this._lo=be,this}},Q.prototype.selfSqr=function(){return this.selfMultiply(this)},Q.prototype.floor=function(){if(this.isNaN())return Q.NaN;var a=Math.floor(this._hi),u=0;return a===this._hi&&(u=Math.floor(this._lo)),new Q(a,u)},Q.prototype.negate=function(){return this.isNaN()?this:new Q(-this._hi,-this._lo)},Q.prototype.clone=function(){},Q.prototype.multiply=function(){if(arguments[0]instanceof Q){var a=arguments[0];return a.isNaN()?Q.createNaN():Q.copy(this).selfMultiply(a)}if(typeof arguments[0]=="number"){var u=arguments[0];return A.isNaN(u)?Q.createNaN():Q.copy(this).selfMultiply(u,0)}},Q.prototype.isNaN=function(){return A.isNaN(this._hi)},Q.prototype.intValue=function(){return Math.trunc(this._hi)},Q.prototype.toString=function(){var a=Q.magnitude(this._hi);return a>=-3&&a<=20?this.toStandardNotation():this.toSciNotation()},Q.prototype.toStandardNotation=function(){var a=this.getSpecialNumberString();if(a!==null)return a;var u=new Array(1).fill(null),f=this.extractSignificantDigits(!0,u),m=u[0]+1,v=f;if(f.charAt(0)===".")v="0"+f;else if(m<0)v="0."+Q.stringOfChar("0",-m)+f;else if(f.indexOf(".")===-1){var S=m-f.length;v=f+Q.stringOfChar("0",S)+".0"}return this.isNegative()?"-"+v:v},Q.prototype.reciprocal=function(){var a=null,u=null,f=null,m=null,v=null,S=null,M=null,B=null;u=(v=1/this._hi)-(a=(S=Q.SPLIT*v)-(a=S-v)),f=(B=Q.SPLIT*this._hi)-this._hi;var z=v+(S=(1-(M=v*this._hi)-(B=a*(f=B-f)-M+a*(m=this._hi-f)+u*f+u*m)-v*this._lo)/this._hi);return new Q(z,v-z+S)},Q.prototype.toSciNotation=function(){if(this.isZero())return Q.SCI_NOT_ZERO;var a=this.getSpecialNumberString();if(a!==null)return a;var u=new Array(1).fill(null),f=this.extractSignificantDigits(!1,u),m=Q.SCI_NOT_EXPONENT_CHAR+u[0];if(f.charAt(0)==="0")throw new Error("Found leading zero: "+f);var v="";f.length>1&&(v=f.substring(1));var S=f.charAt(0)+"."+v;return this.isNegative()?"-"+S+m:S+m},Q.prototype.abs=function(){return this.isNaN()?Q.NaN:this.isNegative()?this.negate():new Q(this)},Q.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},Q.prototype.lt=function(a){return(this._hi<a._hi||this._hi===a._hi)&&this._lo<a._lo},Q.prototype.add=function(){if(arguments[0]instanceof Q){var a=arguments[0];return Q.copy(this).selfAdd(a)}if(typeof arguments[0]=="number"){var u=arguments[0];return Q.copy(this).selfAdd(u)}},Q.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var a=arguments[0];this._hi=a,this._lo=0}else if(arguments[0]instanceof Q){var u=arguments[0];this._hi=u._hi,this._lo=u._lo}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this._hi=f,this._lo=m}},Q.prototype.gt=function(a){return(this._hi>a._hi||this._hi===a._hi)&&this._lo>a._lo},Q.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},Q.prototype.trunc=function(){return this.isNaN()?Q.NaN:this.isPositive()?this.floor():this.ceil()},Q.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Q.prototype.interfaces_=function(){return[t,j,W]},Q.prototype.getClass=function(){return Q},Q.sqr=function(a){return Q.valueOf(a).selfMultiply(a)},Q.valueOf=function(){if(typeof arguments[0]=="string"){var a=arguments[0];return Q.parse(a)}if(typeof arguments[0]=="number"){var u=arguments[0];return new Q(u)}},Q.sqrt=function(a){return Q.valueOf(a).sqrt()},Q.parse=function(a){for(var u=0,f=a.length;Te.isWhitespace(a.charAt(u));)u++;var m=!1;if(u<f){var v=a.charAt(u);v!=="-"&&v!=="+"||(u++,v==="-"&&(m=!0))}for(var S=new Q,M=0,B=0,z=0;!(u>=f);){var te=a.charAt(u);if(u++,Te.isDigit(te)){var pe=te-"0";S.selfMultiply(Q.TEN),S.selfAdd(pe),M++}else{if(te!=="."){if(te==="e"||te==="E"){var be=a.substring(u);try{z=ve.parseInt(be)}catch(Zr){throw Zr instanceof Error?new Error("Invalid exponent "+be+" in string "+a):Zr}break}throw new Error("Unexpected character '"+te+"' at position "+u+" in string "+a)}B=M}}var Xe=S,Ke=M-B-z;if(Ke===0)Xe=S;else if(Ke>0){var it=Q.TEN.pow(Ke);Xe=S.divide(it)}else if(Ke<0){var mt=Q.TEN.pow(-Ke);Xe=S.multiply(mt)}return m?Xe.negate():Xe},Q.createNaN=function(){return new Q(A.NaN,A.NaN)},Q.copy=function(a){return new Q(a)},Q.magnitude=function(a){var u=Math.abs(a),f=Math.log(u)/Math.log(10),m=Math.trunc(Math.floor(f));return 10*Math.pow(10,m)<=u&&(m+=1),m},Q.stringOfChar=function(a,u){for(var f=new Ue,m=0;m<u;m++)f.append(a);return f.toString()},Qe.PI.get=function(){return new Q(3.141592653589793,12246467991473532e-32)},Qe.TWO_PI.get=function(){return new Q(6.283185307179586,24492935982947064e-32)},Qe.PI_2.get=function(){return new Q(1.5707963267948966,6123233995736766e-32)},Qe.E.get=function(){return new Q(2.718281828459045,14456468917292502e-32)},Qe.NaN.get=function(){return new Q(A.NaN,A.NaN)},Qe.EPS.get=function(){return 123259516440783e-46},Qe.SPLIT.get=function(){return 134217729},Qe.MAX_PRINT_DIGITS.get=function(){return 32},Qe.TEN.get=function(){return Q.valueOf(10)},Qe.ONE.get=function(){return Q.valueOf(1)},Qe.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Qe.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Q,Qe);var Ye=o(function(){},"q"),nt={DP_SAFE_EPSILON:{configurable:!0}};Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.orientationIndex=function(a,u,f){var m=Ye.orientationIndexFilter(a,u,f);if(m<=1)return m;var v=Q.valueOf(u.x).selfAdd(-a.x),S=Q.valueOf(u.y).selfAdd(-a.y),M=Q.valueOf(f.x).selfAdd(-u.x),B=Q.valueOf(f.y).selfAdd(-u.y);return v.selfMultiply(B).selfSubtract(S.selfMultiply(M)).signum()},Ye.signOfDet2x2=function(a,u,f,m){return a.multiply(m).selfSubtract(u.multiply(f)).signum()},Ye.intersection=function(a,u,f,m){var v=Q.valueOf(m.y).selfSubtract(f.y).selfMultiply(Q.valueOf(u.x).selfSubtract(a.x)),S=Q.valueOf(m.x).selfSubtract(f.x).selfMultiply(Q.valueOf(u.y).selfSubtract(a.y)),M=v.subtract(S),B=Q.valueOf(m.x).selfSubtract(f.x).selfMultiply(Q.valueOf(a.y).selfSubtract(f.y)),z=Q.valueOf(m.y).selfSubtract(f.y).selfMultiply(Q.valueOf(a.x).selfSubtract(f.x)),te=B.subtract(z).selfDivide(M).doubleValue(),pe=Q.valueOf(a.x).selfAdd(Q.valueOf(u.x).selfSubtract(a.x).selfMultiply(te)).doubleValue(),be=Q.valueOf(u.x).selfSubtract(a.x).selfMultiply(Q.valueOf(a.y).selfSubtract(f.y)),Xe=Q.valueOf(u.y).selfSubtract(a.y).selfMultiply(Q.valueOf(a.x).selfSubtract(f.x)),Ke=be.subtract(Xe).selfDivide(M).doubleValue(),it=Q.valueOf(f.y).selfAdd(Q.valueOf(m.y).selfSubtract(f.y).selfMultiply(Ke)).doubleValue();return new N(pe,it)},Ye.orientationIndexFilter=function(a,u,f){var m=null,v=(a.x-f.x)*(u.y-f.y),S=(a.y-f.y)*(u.x-f.x),M=v-S;if(v>0){if(S<=0)return Ye.signum(M);m=v+S}else{if(!(v<0)||S>=0)return Ye.signum(M);m=-v-S}var B=Ye.DP_SAFE_EPSILON*m;return M>=B||-M>=B?Ye.signum(M):2},Ye.signum=function(a){return a>0?1:a<0?-1:0},nt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Ye,nt);var Ae=o(function(){},"V"),Be={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Be.X.get=function(){return 0},Be.Y.get=function(){return 1},Be.Z.get=function(){return 2},Be.M.get=function(){return 3},Ae.prototype.setOrdinate=function(a,u,f){},Ae.prototype.size=function(){},Ae.prototype.getOrdinate=function(a,u){},Ae.prototype.getCoordinate=function(){},Ae.prototype.getCoordinateCopy=function(a){},Ae.prototype.getDimension=function(){},Ae.prototype.getX=function(a){},Ae.prototype.clone=function(){},Ae.prototype.expandEnvelope=function(a){},Ae.prototype.copy=function(){},Ae.prototype.getY=function(a){},Ae.prototype.toCoordinateArray=function(){},Ae.prototype.interfaces_=function(){return[W]},Ae.prototype.getClass=function(){return Ae},Object.defineProperties(Ae,Be);var We=o(function(){},"z"),$e=function(a){function u(){a.call(this,"Projective point not representable on the Cartesian plane.")}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(We),we=o(function(){},"Y");we.arraycopy=function(a,u,f,m,v){for(var S=0,M=u;M<u+v;M++)f[m+S]=a[M],S++},we.getProperty=function(a){return{"line.separator":"\n"}[a]};var H=o(function a(){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 u=arguments[0];this.x=u.x,this.y=u.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var f=arguments[0],m=arguments[1];this.x=f,this.y=m,this.w=1}else if(arguments[0]instanceof a&&arguments[1]instanceof a){var v=arguments[0],S=arguments[1];this.x=v.y*S.w-S.y*v.w,this.y=S.x*v.w-v.x*S.w,this.w=v.x*S.y-S.x*v.y}else if(arguments[0]instanceof N&&arguments[1]instanceof N){var M=arguments[0],B=arguments[1];this.x=M.y-B.y,this.y=B.x-M.x,this.w=M.x*B.y-B.x*M.y}}else if(arguments.length===3){var z=arguments[0],te=arguments[1],pe=arguments[2];this.x=z,this.y=te,this.w=pe}else if(arguments.length===4){var be=arguments[0],Xe=arguments[1],Ke=arguments[2],it=arguments[3],mt=be.y-Xe.y,Zr=Xe.x-be.x,Ii=be.x*Xe.y-Xe.x*be.y,qo=Ke.y-it.y,Su=it.x-Ke.x,Xp=Ke.x*it.y-it.x*Ke.y;this.x=Zr*Xp-Su*Ii,this.y=qo*Ii-mt*Xp,this.w=mt*Su-qo*Zr}},"t");H.prototype.getY=function(){var a=this.y/this.w;if(A.isNaN(a)||A.isInfinite(a))throw new $e;return a},H.prototype.getX=function(){var a=this.x/this.w;if(A.isNaN(a)||A.isInfinite(a))throw new $e;return a},H.prototype.getCoordinate=function(){var a=new N;return a.x=this.getX(),a.y=this.getY(),a},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.intersection=function(a,u,f,m){var v=a.y-u.y,S=u.x-a.x,M=a.x*u.y-u.x*a.y,B=f.y-m.y,z=m.x-f.x,te=f.x*m.y-m.x*f.y,pe=v*z-B*S,be=(S*te-z*M)/pe,Xe=(B*M-v*te)/pe;if(A.isNaN(be)||A.isInfinite(be)||A.isNaN(Xe)||A.isInfinite(Xe))throw new $e;return new N(be,Xe)};var ie=o(function a(){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 N){var u=arguments[0];this.init(u.x,u.x,u.y,u.y)}else if(arguments[0]instanceof a){var f=arguments[0];this.init(f)}}else if(arguments.length===2){var m=arguments[0],v=arguments[1];this.init(m.x,v.x,m.y,v.y)}else if(arguments.length===4){var S=arguments[0],M=arguments[1],B=arguments[2],z=arguments[3];this.init(S,M,B,z)}},"t"),ee={serialVersionUID:{configurable:!0}};ie.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ie.prototype.equals=function(a){if(!(a instanceof ie))return!1;var u=a;return this.isNull()?u.isNull():this._maxx===u.getMaxX()&&this._maxy===u.getMaxY()&&this._minx===u.getMinX()&&this._miny===u.getMinY()},ie.prototype.intersection=function(a){if(this.isNull()||a.isNull()||!this.intersects(a))return new ie;var u=this._minx>a._minx?this._minx:a._minx,f=this._miny>a._miny?this._miny:a._miny,m=this._maxx<a._maxx?this._maxx:a._maxx,v=this._maxy<a._maxy?this._maxy:a._maxy;return new ie(u,m,f,v)},ie.prototype.isNull=function(){return this._maxx<this._minx},ie.prototype.getMaxX=function(){return this._maxx},ie.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof N){var a=arguments[0];return this.covers(a.x,a.y)}if(arguments[0]instanceof ie){var u=arguments[0];return!this.isNull()&&!u.isNull()&&u.getMinX()>=this._minx&&u.getMaxX()<=this._maxx&&u.getMinY()>=this._miny&&u.getMaxY()<=this._maxy}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return!this.isNull()&&f>=this._minx&&f<=this._maxx&&m>=this._miny&&m<=this._maxy}},ie.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof ie){var a=arguments[0];return!this.isNull()&&!a.isNull()&&!(a._minx>this._maxx||a._maxx<this._minx||a._miny>this._maxy||a._maxy<this._miny)}if(arguments[0]instanceof N){var u=arguments[0];return this.intersects(u.x,u.y)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return!this.isNull()&&!(f>this._maxx||f<this._minx||m>this._maxy||m<this._miny)}},ie.prototype.getMinY=function(){return this._miny},ie.prototype.getMinX=function(){return this._minx},ie.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof N){var a=arguments[0];this.expandToInclude(a.x,a.y)}else if(arguments[0]instanceof ie){var u=arguments[0];if(u.isNull())return null;this.isNull()?(this._minx=u.getMinX(),this._maxx=u.getMaxX(),this._miny=u.getMinY(),this._maxy=u.getMaxY()):(u._minx<this._minx&&(this._minx=u._minx),u._maxx>this._maxx&&(this._maxx=u._maxx),u._miny<this._miny&&(this._miny=u._miny),u._maxy>this._maxy&&(this._maxy=u._maxy))}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this.isNull()?(this._minx=f,this._maxx=f,this._miny=m,this._maxy=m):(f<this._minx&&(this._minx=f),f>this._maxx&&(this._maxx=f),m<this._miny&&(this._miny=m),m>this._maxy&&(this._maxy=m))}},ie.prototype.minExtent=function(){if(this.isNull())return 0;var a=this.getWidth(),u=this.getHeight();return a<u?a:u},ie.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ie.prototype.compareTo=function(a){var u=a;return this.isNull()?u.isNull()?0:-1:u.isNull()?1:this._minx<u._minx?-1:this._minx>u._minx?1:this._miny<u._miny?-1:this._miny>u._miny?1:this._maxx<u._maxx?-1:this._maxx>u._maxx?1:this._maxy<u._maxy?-1:this._maxy>u._maxy?1:0},ie.prototype.translate=function(a,u){if(this.isNull())return null;this.init(this.getMinX()+a,this.getMaxX()+a,this.getMinY()+u,this.getMaxY()+u)},ie.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ie.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ie.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ie.prototype.maxExtent=function(){if(this.isNull())return 0;var a=this.getWidth(),u=this.getHeight();return a>u?a:u},ie.prototype.expandBy=function(){if(arguments.length===1){var a=arguments[0];this.expandBy(a,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this.isNull())return null;this._minx-=u,this._maxx+=u,this._miny-=f,this._maxy+=f,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},ie.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof ie){var a=arguments[0];return this.covers(a)}if(arguments[0]instanceof N){var u=arguments[0];return this.covers(u)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return this.covers(f,m)}},ie.prototype.centre=function(){return this.isNull()?null:new N((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ie.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof N){var a=arguments[0];this.init(a.x,a.x,a.y,a.y)}else if(arguments[0]instanceof ie){var u=arguments[0];this._minx=u._minx,this._maxx=u._maxx,this._miny=u._miny,this._maxy=u._maxy}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this.init(f.x,m.x,f.y,m.y)}else if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],B=arguments[3];v<S?(this._minx=v,this._maxx=S):(this._minx=S,this._maxx=v),M<B?(this._miny=M,this._maxy=B):(this._miny=B,this._maxy=M)}},ie.prototype.getMaxY=function(){return this._maxy},ie.prototype.distance=function(a){if(this.intersects(a))return 0;var u=0;this._maxx<a._minx?u=a._minx-this._maxx:this._minx>a._maxx&&(u=this._minx-a._maxx);var f=0;return this._maxy<a._miny?f=a._miny-this._maxy:this._miny>a._maxy&&(f=this._miny-a._maxy),u===0?f:f===0?u:Math.sqrt(u*u+f*f)},ie.prototype.hashCode=function(){var a=17;return a=37*a+N.hashCode(this._minx),a=37*a+N.hashCode(this._maxx),a=37*a+N.hashCode(this._miny),a=37*a+N.hashCode(this._maxy)},ie.prototype.interfaces_=function(){return[j,t]},ie.prototype.getClass=function(){return ie},ie.intersects=function(){if(arguments.length===3){var a=arguments[0],u=arguments[1],f=arguments[2];return f.x>=(a.x<u.x?a.x:u.x)&&f.x<=(a.x>u.x?a.x:u.x)&&f.y>=(a.y<u.y?a.y:u.y)&&f.y<=(a.y>u.y?a.y:u.y)}if(arguments.length===4){var m=arguments[0],v=arguments[1],S=arguments[2],M=arguments[3],B=Math.min(S.x,M.x),z=Math.max(S.x,M.x),te=Math.min(m.x,v.x),pe=Math.max(m.x,v.x);return!(te>z)&&!(pe<B)&&(B=Math.min(S.y,M.y),z=Math.max(S.y,M.y),te=Math.min(m.y,v.y),pe=Math.max(m.y,v.y),!(te>z)&&!(pe<B))}},ee.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(ie,ee);var Me={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*$/},Ne=o(function(a){this.geometryFactory=a||new jt},"K");Ne.prototype.read=function(a){var u,f,m;a=a.replace(/[\n\r]/g," ");var v=Me.typeStr.exec(a);if(a.search("EMPTY")!==-1&&((v=Me.emptyTypeStr.exec(a))[2]=void 0),v&&(f=v[1].toLowerCase(),m=v[2],Ze[f]&&(u=Ze[f].apply(this,[m]))),u===void 0)throw new Error("Could not parse WKT "+a);return u},Ne.prototype.write=function(a){return this.extractGeometry(a)},Ne.prototype.extractGeometry=function(a){var u=a.getGeometryType().toLowerCase();if(!Oe[u])return null;var f=u.toUpperCase();return a.isEmpty()?f+" EMPTY":f+"("+Oe[u].apply(this,[a])+")"};var Oe={coordinate:o(function(a){return a.x+" "+a.y},"coordinate"),point:o(function(a){return Oe.coordinate.call(this,a._coordinates._coordinates[0])},"point"),multipoint:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push("("+Oe.point.apply(this,[a._geometries[f]])+")");return u.join(",")},"multipoint"),linestring:o(function(a){for(var u=[],f=0,m=a._points._coordinates.length;f<m;++f)u.push(Oe.coordinate.apply(this,[a._points._coordinates[f]]));return u.join(",")},"linestring"),linearring:o(function(a){for(var u=[],f=0,m=a._points._coordinates.length;f<m;++f)u.push(Oe.coordinate.apply(this,[a._points._coordinates[f]]));return u.join(",")},"linearring"),multilinestring:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push("("+Oe.linestring.apply(this,[a._geometries[f]])+")");return u.join(",")},"multilinestring"),polygon:o(function(a){var u=[];u.push("("+Oe.linestring.apply(this,[a._shell])+")");for(var f=0,m=a._holes.length;f<m;++f)u.push("("+Oe.linestring.apply(this,[a._holes[f]])+")");return u.join(",")},"polygon"),multipolygon:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push("("+Oe.polygon.apply(this,[a._geometries[f]])+")");return u.join(",")},"multipolygon"),geometrycollection:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push(this.extractGeometry(a._geometries[f]));return u.join(",")},"geometrycollection")},Ze={point:o(function(a){if(a===void 0)return this.geometryFactory.createPoint();var u=a.trim().split(Me.spaces);return this.geometryFactory.createPoint(new N(Number.parseFloat(u[0]),Number.parseFloat(u[1])))},"point"),multipoint:o(function(a){if(a===void 0)return this.geometryFactory.createMultiPoint();for(var u,f=a.trim().split(","),m=[],v=0,S=f.length;v<S;++v)u=f[v].replace(Me.trimParens,"$1"),m.push(Ze.point.apply(this,[u]));return this.geometryFactory.createMultiPoint(m)},"multipoint"),linestring:o(function(a){if(a===void 0)return this.geometryFactory.createLineString();for(var u,f=a.trim().split(","),m=[],v=0,S=f.length;v<S;++v)u=f[v].trim().split(Me.spaces),m.push(new N(Number.parseFloat(u[0]),Number.parseFloat(u[1])));return this.geometryFactory.createLineString(m)},"linestring"),linearring:o(function(a){if(a===void 0)return this.geometryFactory.createLinearRing();for(var u,f=a.trim().split(","),m=[],v=0,S=f.length;v<S;++v)u=f[v].trim().split(Me.spaces),m.push(new N(Number.parseFloat(u[0]),Number.parseFloat(u[1])));return this.geometryFactory.createLinearRing(m)},"linearring"),multilinestring:o(function(a){if(a===void 0)return this.geometryFactory.createMultiLineString();for(var u,f=a.trim().split(Me.parenComma),m=[],v=0,S=f.length;v<S;++v)u=f[v].replace(Me.trimParens,"$1"),m.push(Ze.linestring.apply(this,[u]));return this.geometryFactory.createMultiLineString(m)},"multilinestring"),polygon:o(function(a){if(a===void 0)return this.geometryFactory.createPolygon();for(var u,f,m,v,S=a.trim().split(Me.parenComma),M=[],B=0,z=S.length;B<z;++B)u=S[B].replace(Me.trimParens,"$1"),f=Ze.linestring.apply(this,[u]),m=this.geometryFactory.createLinearRing(f._points),B===0?v=m:M.push(m);return this.geometryFactory.createPolygon(v,M)},"polygon"),multipolygon:o(function(a){if(a===void 0)return this.geometryFactory.createMultiPolygon();for(var u,f=a.trim().split(Me.doubleParenComma),m=[],v=0,S=f.length;v<S;++v)u=f[v].replace(Me.trimParens,"$1"),m.push(Ze.polygon.apply(this,[u]));return this.geometryFactory.createMultiPolygon(m)},"multipolygon"),geometrycollection:o(function(a){if(a===void 0)return this.geometryFactory.createGeometryCollection();for(var u=(a=a.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),f=[],m=0,v=u.length;m<v;++m)f.push(this.read(u[m]));return this.geometryFactory.createGeometryCollection(f)},"geometrycollection")},Pt=o(function(a){this.parser=new Ne(a)},"Z");Pt.prototype.write=function(a){return this.parser.write(a)},Pt.toLineString=function(a,u){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+a.x+" "+a.y+", "+u.x+" "+u.y+" )"};var Er=function(a){function u(f){a.call(this,f),this.name="RuntimeException",this.message=f,this.stack=new a().stack}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u}(Error),$n=function(a){function u(){if(a.call(this),arguments.length===0)a.call(this);else if(arguments.length===1){var f=arguments[0];a.call(this,f)}}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Er),ot=o(function(){},"et");ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.shouldNeverReachHere=function(){if(arguments.length===0)ot.shouldNeverReachHere(null);else if(arguments.length===1){var a=arguments[0];throw new $n("Should never reach here"+(a!==null?": "+a:""))}},ot.isTrue=function(){var a,u;if(arguments.length===1)a=arguments[0],ot.isTrue(a,null);else if(arguments.length===2&&(a=arguments[0],u=arguments[1],!a))throw u===null?new $n:new $n(u)},ot.equals=function(){var a,u,f;if(arguments.length===2)a=arguments[0],u=arguments[1],ot.equals(a,u,null);else if(arguments.length===3&&(a=arguments[0],u=arguments[1],f=arguments[2],!u.equals(a)))throw new $n("Expected "+a+" but encountered "+u+(f!==null?": "+f:""))};var zt=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 N,this._intPt[1]=new N,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},"nt"),es={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};zt.prototype.getIndexAlongSegment=function(a,u){return this.computeIntLineIndex(),this._intLineIndex[a][u]},zt.prototype.getTopologySummary=function(){var a=new Ue;return this.isEndPoint()&&a.append(" endpoint"),this._isProper&&a.append(" proper"),this.isCollinear()&&a.append(" collinear"),a.toString()},zt.prototype.computeIntersection=function(a,u,f,m){this._inputLines[0][0]=a,this._inputLines[0][1]=u,this._inputLines[1][0]=f,this._inputLines[1][1]=m,this._result=this.computeIntersect(a,u,f,m)},zt.prototype.getIntersectionNum=function(){return this._result},zt.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 a=arguments[0];this.getEdgeDistance(a,0)>this.getEdgeDistance(a,1)?(this._intLineIndex[a][0]=0,this._intLineIndex[a][1]=1):(this._intLineIndex[a][0]=1,this._intLineIndex[a][1]=0)}},zt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},zt.prototype.setPrecisionModel=function(a){this._precisionModel=a},zt.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var a=arguments[0],u=0;u<this._result;u++)if(!this._intPt[u].equals2D(this._inputLines[a][0])&&!this._intPt[u].equals2D(this._inputLines[a][1]))return!0;return!1}},zt.prototype.getIntersection=function(a){return this._intPt[a]},zt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},zt.prototype.hasIntersection=function(){return this._result!==zt.NO_INTERSECTION},zt.prototype.getEdgeDistance=function(a,u){return zt.computeEdgeDistance(this._intPt[u],this._inputLines[a][0],this._inputLines[a][1])},zt.prototype.isCollinear=function(){return this._result===zt.COLLINEAR_INTERSECTION},zt.prototype.toString=function(){return Pt.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Pt.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},zt.prototype.getEndpoint=function(a,u){return this._inputLines[a][u]},zt.prototype.isIntersection=function(a){for(var u=0;u<this._result;u++)if(this._intPt[u].equals2D(a))return!0;return!1},zt.prototype.getIntersectionAlongSegment=function(a,u){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[a][u]]},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.computeEdgeDistance=function(a,u,f){var m=Math.abs(f.x-u.x),v=Math.abs(f.y-u.y),S=-1;if(a.equals(u))S=0;else if(a.equals(f))S=m>v?m:v;else{var M=Math.abs(a.x-u.x),B=Math.abs(a.y-u.y);(S=m>v?M:B)!==0||a.equals(u)||(S=Math.max(M,B))}return ot.isTrue(!(S===0&&!a.equals(u)),"Bad distance calculation"),S},zt.nonRobustComputeEdgeDistance=function(a,u,f){var m=a.x-u.x,v=a.y-u.y,S=Math.sqrt(m*m+v*v);return ot.isTrue(!(S===0&&!a.equals(u)),"Invalid distance calculation"),S},es.DONT_INTERSECT.get=function(){return 0},es.DO_INTERSECT.get=function(){return 1},es.COLLINEAR.get=function(){return 2},es.NO_INTERSECTION.get=function(){return 0},es.POINT_INTERSECTION.get=function(){return 1},es.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(zt,es);var Ro=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.isInSegmentEnvelopes=function(f){var m=new ie(this._inputLines[0][0],this._inputLines[0][1]),v=new ie(this._inputLines[1][0],this._inputLines[1][1]);return m.contains(f)&&v.contains(f)},u.prototype.computeIntersection=function(){if(arguments.length!==3)return a.prototype.computeIntersection.apply(this,arguments);var f=arguments[0],m=arguments[1],v=arguments[2];if(this._isProper=!1,ie.intersects(m,v,f)&&ze.orientationIndex(m,v,f)===0&&ze.orientationIndex(v,m,f)===0)return this._isProper=!0,(f.equals(m)||f.equals(v))&&(this._isProper=!1),this._result=a.POINT_INTERSECTION,null;this._result=a.NO_INTERSECTION},u.prototype.normalizeToMinimum=function(f,m,v,S,M){M.x=this.smallestInAbsValue(f.x,m.x,v.x,S.x),M.y=this.smallestInAbsValue(f.y,m.y,v.y,S.y),f.x-=M.x,f.y-=M.y,m.x-=M.x,m.y-=M.y,v.x-=M.x,v.y-=M.y,S.x-=M.x,S.y-=M.y},u.prototype.safeHCoordinateIntersection=function(f,m,v,S){var M=null;try{M=H.intersection(f,m,v,S)}catch(B){if(!(B instanceof $e))throw B;M=u.nearestEndpoint(f,m,v,S)}return M},u.prototype.intersection=function(f,m,v,S){var M=this.intersectionWithNormalization(f,m,v,S);return this.isInSegmentEnvelopes(M)||(M=new N(u.nearestEndpoint(f,m,v,S))),this._precisionModel!==null&&this._precisionModel.makePrecise(M),M},u.prototype.smallestInAbsValue=function(f,m,v,S){var M=f,B=Math.abs(M);return Math.abs(m)<B&&(M=m,B=Math.abs(m)),Math.abs(v)<B&&(M=v,B=Math.abs(v)),Math.abs(S)<B&&(M=S),M},u.prototype.checkDD=function(f,m,v,S,M){var B=Ye.intersection(f,m,v,S),z=this.isInSegmentEnvelopes(B);we.out.println("DD in env = "+z+" --------------------- "+B),M.distance(B)>1e-4&&we.out.println("Distance = "+M.distance(B))},u.prototype.intersectionWithNormalization=function(f,m,v,S){var M=new N(f),B=new N(m),z=new N(v),te=new N(S),pe=new N;this.normalizeToEnvCentre(M,B,z,te,pe);var be=this.safeHCoordinateIntersection(M,B,z,te);return be.x+=pe.x,be.y+=pe.y,be},u.prototype.computeCollinearIntersection=function(f,m,v,S){var M=ie.intersects(f,m,v),B=ie.intersects(f,m,S),z=ie.intersects(v,S,f),te=ie.intersects(v,S,m);return M&&B?(this._intPt[0]=v,this._intPt[1]=S,a.COLLINEAR_INTERSECTION):z&&te?(this._intPt[0]=f,this._intPt[1]=m,a.COLLINEAR_INTERSECTION):M&&z?(this._intPt[0]=v,this._intPt[1]=f,!v.equals(f)||B||te?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):M&&te?(this._intPt[0]=v,this._intPt[1]=m,!v.equals(m)||B||z?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):B&&z?(this._intPt[0]=S,this._intPt[1]=f,!S.equals(f)||M||te?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):B&&te?(this._intPt[0]=S,this._intPt[1]=m,!S.equals(m)||M||z?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):a.NO_INTERSECTION},u.prototype.normalizeToEnvCentre=function(f,m,v,S,M){var B=f.x<m.x?f.x:m.x,z=f.y<m.y?f.y:m.y,te=f.x>m.x?f.x:m.x,pe=f.y>m.y?f.y:m.y,be=v.x<S.x?v.x:S.x,Xe=v.y<S.y?v.y:S.y,Ke=v.x>S.x?v.x:S.x,it=v.y>S.y?v.y:S.y,mt=((B>be?B:be)+(te<Ke?te:Ke))/2,Zr=((z>Xe?z:Xe)+(pe<it?pe:it))/2;M.x=mt,M.y=Zr,f.x-=M.x,f.y-=M.y,m.x-=M.x,m.y-=M.y,v.x-=M.x,v.y-=M.y,S.x-=M.x,S.y-=M.y},u.prototype.computeIntersect=function(f,m,v,S){if(this._isProper=!1,!ie.intersects(f,m,v,S))return a.NO_INTERSECTION;var M=ze.orientationIndex(f,m,v),B=ze.orientationIndex(f,m,S);if(M>0&&B>0||M<0&&B<0)return a.NO_INTERSECTION;var z=ze.orientationIndex(v,S,f),te=ze.orientationIndex(v,S,m);return z>0&&te>0||z<0&&te<0?a.NO_INTERSECTION:M===0&&B===0&&z===0&&te===0?this.computeCollinearIntersection(f,m,v,S):(M===0||B===0||z===0||te===0?(this._isProper=!1,f.equals2D(v)||f.equals2D(S)?this._intPt[0]=f:m.equals2D(v)||m.equals2D(S)?this._intPt[0]=m:M===0?this._intPt[0]=new N(v):B===0?this._intPt[0]=new N(S):z===0?this._intPt[0]=new N(f):te===0&&(this._intPt[0]=new N(m))):(this._isProper=!0,this._intPt[0]=this.intersection(f,m,v,S)),a.POINT_INTERSECTION)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.nearestEndpoint=function(f,m,v,S){var M=f,B=ze.distancePointLine(f,v,S),z=ze.distancePointLine(m,v,S);return z<B&&(B=z,M=m),(z=ze.distancePointLine(v,f,m))<B&&(B=z,M=v),(z=ze.distancePointLine(S,f,m))<B&&(B=z,M=S),M},u}(zt),Js=o(function(){},"ot");Js.prototype.interfaces_=function(){return[]},Js.prototype.getClass=function(){return Js},Js.orientationIndex=function(a,u,f){var m=u.x-a.x,v=u.y-a.y,S=f.x-u.x,M=f.y-u.y;return Js.signOfDet2x2(m,v,S,M)},Js.signOfDet2x2=function(a,u,f,m){var v=null,S=null,M=null;if(v=1,a===0||m===0)return u===0||f===0?0:u>0?f>0?-v:v:f>0?v:-v;if(u===0||f===0)return m>0?a>0?v:-v:a>0?-v:v;if(u>0?m>0?u<=m||(v=-v,S=a,a=f,f=S,S=u,u=m,m=S):u<=-m?(v=-v,f=-f,m=-m):(S=a,a=-f,f=S,S=u,u=-m,m=S):m>0?-u<=m?(v=-v,a=-a,u=-u):(S=-a,a=f,f=S,S=-u,u=m,m=S):u>=m?(a=-a,u=-u,f=-f,m=-m):(v=-v,S=-a,a=-f,f=S,S=-u,u=-m,m=S),a>0){if(!(f>0)||!(a<=f))return v}else{if(f>0||!(a>=f))return-v;v=-v,a=-a,f=-f}for(;;){if(M=Math.floor(f/a),f-=M*a,(m-=M*u)<0)return-v;if(m>u)return v;if(a>f+f){if(u<m+m)return v}else{if(u>m+m)return-v;f=a-f,m=u-m,v=-v}if(m===0)return f===0?0:-v;if(f===0||(M=Math.floor(a/f),a-=M*f,(u-=M*m)<0))return v;if(u>m)return-v;if(f>a+a){if(m<u+u)return-v}else{if(m>u+u)return v;a=f-a,u=m-u,v=-v}if(u===0)return a===0?0:v;if(a===0)return-v}};var Ri=o(function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var a=arguments[0];this._p=a},"st");Ri.prototype.countSegment=function(a,u){if(a.x<this._p.x&&u.x<this._p.x)return null;if(this._p.x===u.x&&this._p.y===u.y)return this._isPointOnSegment=!0,null;if(a.y===this._p.y&&u.y===this._p.y){var f=a.x,m=u.x;return f>m&&(f=u.x,m=a.x),this._p.x>=f&&this._p.x<=m&&(this._isPointOnSegment=!0),null}if(a.y>this._p.y&&u.y<=this._p.y||u.y>this._p.y&&a.y<=this._p.y){var v=a.x-this._p.x,S=a.y-this._p.y,M=u.x-this._p.x,B=u.y-this._p.y,z=Js.signOfDet2x2(v,S,M,B);if(z===0)return this._isPointOnSegment=!0,null;B<S&&(z=-z),z>0&&this._crossingCount++}},Ri.prototype.isPointInPolygon=function(){return this.getLocation()!==U.EXTERIOR},Ri.prototype.getLocation=function(){return this._isPointOnSegment?U.BOUNDARY:this._crossingCount%2==1?U.INTERIOR:U.EXTERIOR},Ri.prototype.isOnSegment=function(){return this._isPointOnSegment},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.locatePointInRing=function(){if(arguments[0]instanceof N&&ne(arguments[1],Ae)){for(var a=arguments[0],u=arguments[1],f=new Ri(a),m=new N,v=new N,S=1;S<u.size();S++)if(u.getCoordinate(S,m),u.getCoordinate(S-1,v),f.countSegment(m,v),f.isOnSegment())return f.getLocation();return f.getLocation()}if(arguments[0]instanceof N&&arguments[1]instanceof Array){for(var M=arguments[0],B=arguments[1],z=new Ri(M),te=1;te<B.length;te++){var pe=B[te],be=B[te-1];if(z.countSegment(pe,be),z.isOnSegment())return z.getLocation()}return z.getLocation()}};var ze=o(function(){},"at"),du={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.orientationIndex=function(a,u,f){return Ye.orientationIndex(a,u,f)},ze.signedArea=function(){if(arguments[0]instanceof Array){var a=arguments[0];if(a.length<3)return 0;for(var u=0,f=a[0].x,m=1;m<a.length-1;m++){var v=a[m].x-f,S=a[m+1].y;u+=v*(a[m-1].y-S)}return u/2}if(ne(arguments[0],Ae)){var M=arguments[0],B=M.size();if(B<3)return 0;var z=new N,te=new N,pe=new N;M.getCoordinate(0,te),M.getCoordinate(1,pe);var be=te.x;pe.x-=be;for(var Xe=0,Ke=1;Ke<B-1;Ke++)z.y=te.y,te.x=pe.x,te.y=pe.y,M.getCoordinate(Ke+1,pe),pe.x-=be,Xe+=te.x*(z.y-pe.y);return Xe/2}},ze.distanceLineLine=function(a,u,f,m){if(a.equals(u))return ze.distancePointLine(a,f,m);if(f.equals(m))return ze.distancePointLine(m,a,u);var v=!1;if(ie.intersects(a,u,f,m)){var S=(u.x-a.x)*(m.y-f.y)-(u.y-a.y)*(m.x-f.x);if(S===0)v=!0;else{var M=(a.y-f.y)*(m.x-f.x)-(a.x-f.x)*(m.y-f.y),B=((a.y-f.y)*(u.x-a.x)-(a.x-f.x)*(u.y-a.y))/S,z=M/S;(z<0||z>1||B<0||B>1)&&(v=!0)}}else v=!0;return v?Ce.min(ze.distancePointLine(a,f,m),ze.distancePointLine(u,f,m),ze.distancePointLine(f,a,u),ze.distancePointLine(m,a,u)):0},ze.isPointInRing=function(a,u){return ze.locatePointInRing(a,u)!==U.EXTERIOR},ze.computeLength=function(a){var u=a.size();if(u<=1)return 0;var f=0,m=new N;a.getCoordinate(0,m);for(var v=m.x,S=m.y,M=1;M<u;M++){a.getCoordinate(M,m);var B=m.x,z=m.y,te=B-v,pe=z-S;f+=Math.sqrt(te*te+pe*pe),v=B,S=z}return f},ze.isCCW=function(a){var u=a.length-1;if(u<3)throw new D("Ring has fewer than 4 points, so orientation cannot be determined");for(var f=a[0],m=0,v=1;v<=u;v++){var S=a[v];S.y>f.y&&(f=S,m=v)}var M=m;do(M-=1)<0&&(M=u);while(a[M].equals2D(f)&&M!==m);var B=m;do B=(B+1)%u;while(a[B].equals2D(f)&&B!==m);var z=a[M],te=a[B];if(z.equals2D(f)||te.equals2D(f)||z.equals2D(te))return!1;var pe=ze.computeOrientation(z,f,te),be=!1;return be=pe===0?z.x>te.x:pe>0,be},ze.locatePointInRing=function(a,u){return Ri.locatePointInRing(a,u)},ze.distancePointLinePerpendicular=function(a,u,f){var m=(f.x-u.x)*(f.x-u.x)+(f.y-u.y)*(f.y-u.y),v=((u.y-a.y)*(f.x-u.x)-(u.x-a.x)*(f.y-u.y))/m;return Math.abs(v)*Math.sqrt(m)},ze.computeOrientation=function(a,u,f){return ze.orientationIndex(a,u,f)},ze.distancePointLine=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];if(u.length===0)throw new D("Line array must contain at least one vertex");for(var f=a.distance(u[0]),m=0;m<u.length-1;m++){var v=ze.distancePointLine(a,u[m],u[m+1]);v<f&&(f=v)}return f}if(arguments.length===3){var S=arguments[0],M=arguments[1],B=arguments[2];if(M.x===B.x&&M.y===B.y)return S.distance(M);var z=(B.x-M.x)*(B.x-M.x)+(B.y-M.y)*(B.y-M.y),te=((S.x-M.x)*(B.x-M.x)+(S.y-M.y)*(B.y-M.y))/z;if(te<=0)return S.distance(M);if(te>=1)return S.distance(B);var pe=((M.y-S.y)*(B.x-M.x)-(M.x-S.x)*(B.y-M.y))/z;return Math.abs(pe)*Math.sqrt(z)}},ze.isOnLine=function(a,u){for(var f=new Ro,m=1;m<u.length;m++){var v=u[m-1],S=u[m];if(f.computeIntersection(a,v,S),f.hasIntersection())return!0}return!1},du.CLOCKWISE.get=function(){return-1},du.RIGHT.get=function(){return ze.CLOCKWISE},du.COUNTERCLOCKWISE.get=function(){return 1},du.LEFT.get=function(){return ze.COUNTERCLOCKWISE},du.COLLINEAR.get=function(){return 0},du.STRAIGHT.get=function(){return ze.COLLINEAR},Object.defineProperties(ze,du);var Ya=o(function(){},"lt");Ya.prototype.filter=function(a){},Ya.prototype.interfaces_=function(){return[]},Ya.prototype.getClass=function(){return Ya};var vt=o(function(){var a=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=a,this._SRID=a.getSRID()},"ct"),Qs={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}};vt.prototype.isGeometryCollection=function(){return this.getSortIndex()===vt.SORTINDEX_GEOMETRYCOLLECTION},vt.prototype.getFactory=function(){return this._factory},vt.prototype.getGeometryN=function(a){return this},vt.prototype.getArea=function(){return 0},vt.prototype.isRectangle=function(){return!1},vt.prototype.equals=function(){if(arguments[0]instanceof vt){var a=arguments[0];return a!==null&&this.equalsTopo(a)}if(arguments[0]instanceof Object){var u=arguments[0];if(!(u instanceof vt))return!1;var f=u;return this.equalsExact(f)}},vt.prototype.equalsExact=function(a){return this===a||this.equalsExact(a,0)},vt.prototype.geometryChanged=function(){this.apply(vt.geometryChangedFilter)},vt.prototype.geometryChangedAction=function(){this._envelope=null},vt.prototype.equalsNorm=function(a){return a!==null&&this.norm().equalsExact(a.norm())},vt.prototype.getLength=function(){return 0},vt.prototype.getNumGeometries=function(){return 1},vt.prototype.compareTo=function(){if(arguments.length===1){var a=arguments[0],u=a;return this.getSortIndex()!==u.getSortIndex()?this.getSortIndex()-u.getSortIndex():this.isEmpty()&&u.isEmpty()?0:this.isEmpty()?-1:u.isEmpty()?1:this.compareToSameClass(a)}if(arguments.length===2){var f=arguments[0],m=arguments[1];return this.getSortIndex()!==f.getSortIndex()?this.getSortIndex()-f.getSortIndex():this.isEmpty()&&f.isEmpty()?0:this.isEmpty()?-1:f.isEmpty()?1:this.compareToSameClass(f,m)}},vt.prototype.getUserData=function(){return this._userData},vt.prototype.getSRID=function(){return this._SRID},vt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},vt.prototype.checkNotGeometryCollection=function(a){if(a.getSortIndex()===vt.SORTINDEX_GEOMETRYCOLLECTION)throw new D("This method does not support GeometryCollection arguments")},vt.prototype.equal=function(a,u,f){return f===0?a.equals(u):a.distance(u)<=f},vt.prototype.norm=function(){var a=this.copy();return a.normalize(),a},vt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},vt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new ie(this._envelope)},vt.prototype.setSRID=function(a){this._SRID=a},vt.prototype.setUserData=function(a){this._userData=a},vt.prototype.compare=function(a,u){for(var f=a.iterator(),m=u.iterator();f.hasNext()&&m.hasNext();){var v=f.next(),S=m.next(),M=v.compareTo(S);if(M!==0)return M}return f.hasNext()?1:m.hasNext()?-1:0},vt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},vt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===vt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===vt.SORTINDEX_MULTIPOINT||this.getSortIndex()===vt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===vt.SORTINDEX_MULTIPOLYGON},vt.prototype.interfaces_=function(){return[W,j,t]},vt.prototype.getClass=function(){return vt},vt.hasNonEmptyElements=function(a){for(var u=0;u<a.length;u++)if(!a[u].isEmpty())return!0;return!1},vt.hasNullElements=function(a){for(var u=0;u<a.length;u++)if(a[u]===null)return!0;return!1},Qs.serialVersionUID.get=function(){return 8763622679187377e3},Qs.SORTINDEX_POINT.get=function(){return 0},Qs.SORTINDEX_MULTIPOINT.get=function(){return 1},Qs.SORTINDEX_LINESTRING.get=function(){return 2},Qs.SORTINDEX_LINEARRING.get=function(){return 3},Qs.SORTINDEX_MULTILINESTRING.get=function(){return 4},Qs.SORTINDEX_POLYGON.get=function(){return 5},Qs.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Qs.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Qs.geometryChangedFilter.get=function(){return hc},Object.defineProperties(vt,Qs);var hc=o(function(){},"ht");hc.interfaces_=function(){return[Ya]},hc.filter=function(a){a.geometryChangedAction()};var ts=o(function(){},"ft");ts.prototype.filter=function(a){},ts.prototype.interfaces_=function(){return[]},ts.prototype.getClass=function(){return ts};var ro=o(function(){},"gt"),rs={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}};ro.prototype.isInBoundary=function(a){},ro.prototype.interfaces_=function(){return[]},ro.prototype.getClass=function(){return ro},rs.Mod2BoundaryNodeRule.get=function(){return Za},rs.EndPointBoundaryNodeRule.get=function(){return mc},rs.MultiValentEndPointBoundaryNodeRule.get=function(){return gc},rs.MonoValentEndPointBoundaryNodeRule.get=function(){return yc},rs.MOD2_BOUNDARY_RULE.get=function(){return new Za},rs.ENDPOINT_BOUNDARY_RULE.get=function(){return new mc},rs.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new gc},rs.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new yc},rs.OGC_SFS_BOUNDARY_RULE.get=function(){return ro.MOD2_BOUNDARY_RULE},Object.defineProperties(ro,rs);var Za=o(function(){},"yt");Za.prototype.isInBoundary=function(a){return a%2==1},Za.prototype.interfaces_=function(){return[ro]},Za.prototype.getClass=function(){return Za};var mc=o(function(){},"_t");mc.prototype.isInBoundary=function(a){return a>0},mc.prototype.interfaces_=function(){return[ro]},mc.prototype.getClass=function(){return mc};var gc=o(function(){},"mt");gc.prototype.isInBoundary=function(a){return a>1},gc.prototype.interfaces_=function(){return[ro]},gc.prototype.getClass=function(){return gc};var yc=o(function(){},"vt");yc.prototype.isInBoundary=function(a){return a===1},yc.prototype.interfaces_=function(){return[ro]},yc.prototype.getClass=function(){return yc};var On=o(function(){},"It");On.prototype.add=function(){},On.prototype.addAll=function(){},On.prototype.isEmpty=function(){},On.prototype.iterator=function(){},On.prototype.size=function(){},On.prototype.toArray=function(){},On.prototype.remove=function(){},(r.prototype=new Error).name="IndexOutOfBoundsException";var vc=o(function(){},"Et");vc.prototype.hasNext=function(){},vc.prototype.next=function(){},vc.prototype.remove=function(){};var ns=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.get=function(){},u.prototype.set=function(){},u.prototype.isEmpty=function(){},u}(On);(n.prototype=new Error).name="NoSuchElementException";var He=function(a){function u(){a.call(this),this.array_=[],arguments[0]instanceof On&&this.addAll(arguments[0])}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.ensureCapacity=function(){},u.prototype.interfaces_=function(){return[a,On]},u.prototype.add=function(f){return arguments.length===1?this.array_.push(f):this.array_.splice(arguments[0],arguments[1]),!0},u.prototype.clear=function(){this.array_=[]},u.prototype.addAll=function(f){for(var m=f.iterator();m.hasNext();)this.add(m.next());return!0},u.prototype.set=function(f,m){var v=this.array_[f];return this.array_[f]=m,v},u.prototype.iterator=function(){return new bb(this)},u.prototype.get=function(f){if(f<0||f>=this.size())throw new r;return this.array_[f]},u.prototype.isEmpty=function(){return this.array_.length===0},u.prototype.size=function(){return this.array_.length},u.prototype.toArray=function(){for(var f=[],m=0,v=this.array_.length;m<v;m++)f.push(this.array_[m]);return f},u.prototype.remove=function(f){for(var m=!1,v=0,S=this.array_.length;v<S;v++)if(this.array_[v]===f){this.array_.splice(v,1),m=!0;break}return m},u}(ns),bb=function(a){function u(f){a.call(this),this.arrayList_=f,this.position_=0}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new n;return this.arrayList_.get(this.position_++)},u.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},u.prototype.set=function(f){return this.arrayList_.set(this.position_-1,f)},u.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},u}(vc),ue=function(a){function u(){if(a.call(this),arguments.length!==0){if(arguments.length===1){var m=arguments[0];this.ensureCapacity(m.length),this.add(m,!0)}else if(arguments.length===2){var v=arguments[0],S=arguments[1];this.ensureCapacity(v.length),this.add(v,S)}}}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={coordArrayType:{configurable:!0}};return f.coordArrayType.get=function(){return new Array(0).fill(null)},u.prototype.getCoordinate=function(m){return this.get(m)},u.prototype.addAll=function(){if(arguments.length===2){for(var m=arguments[0],v=arguments[1],S=!1,M=m.iterator();M.hasNext();)this.add(M.next(),v),S=!0;return S}return a.prototype.addAll.apply(this,arguments)},u.prototype.clone=function(){for(var m=a.prototype.clone.call(this),v=0;v<this.size();v++)m.add(v,this.get(v).copy());return m},u.prototype.toCoordinateArray=function(){return this.toArray(u.coordArrayType)},u.prototype.add=function(){if(arguments.length===1){var m=arguments[0];a.prototype.add.call(this,m)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var v=arguments[0],S=arguments[1];return this.add(v,S,!0),!0}if(arguments[0]instanceof N&&typeof arguments[1]=="boolean"){var M=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(M))return null;a.prototype.add.call(this,M)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var B=arguments[0],z=arguments[1];return this.add(B,z),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var te=arguments[0],pe=arguments[1];if(arguments[2])for(var be=0;be<te.length;be++)this.add(te[be],pe);else for(var Xe=te.length-1;Xe>=0;Xe--)this.add(te[Xe],pe);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof N){var Ke=arguments[0],it=arguments[1];if(!arguments[2]){var mt=this.size();if(mt>0&&(Ke>0&&this.get(Ke-1).equals2D(it)||Ke<mt&&this.get(Ke).equals2D(it)))return null}a.prototype.add.call(this,Ke,it)}}else if(arguments.length===4){var Zr=arguments[0],Ii=arguments[1],qo=arguments[2],Su=arguments[3],Xp=1;qo>Su&&(Xp=-1);for(var CE=qo;CE!==Su;CE+=Xp)this.add(Zr[CE],Ii);return!0}},u.prototype.closeRing=function(){this.size()>0&&this.add(new N(this.get(0)),!1)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},Object.defineProperties(u,f),u}(He),F=o(function(){},"Lt"),$={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};$.ForwardComparator.get=function(){return X},$.BidirectionalComparator.get=function(){return J},$.coordArrayType.get=function(){return new Array(0).fill(null)},F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.isRing=function(a){return!(a.length<4)&&!!a[0].equals2D(a[a.length-1])},F.ptNotInList=function(a,u){for(var f=0;f<a.length;f++){var m=a[f];if(F.indexOf(m,u)<0)return m}return null},F.scroll=function(a,u){var f=F.indexOf(u,a);if(f<0)return null;var m=new Array(a.length).fill(null);we.arraycopy(a,f,m,0,a.length-f),we.arraycopy(a,0,m,a.length-f,f),we.arraycopy(m,0,a,0,a.length)},F.equals=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];if(a===u)return!0;if(a===null||u===null||a.length!==u.length)return!1;for(var f=0;f<a.length;f++)if(!a[f].equals(u[f]))return!1;return!0}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];if(m===v)return!0;if(m===null||v===null||m.length!==v.length)return!1;for(var M=0;M<m.length;M++)if(S.compare(m[M],v[M])!==0)return!1;return!0}},F.intersection=function(a,u){for(var f=new ue,m=0;m<a.length;m++)u.intersects(a[m])&&f.add(a[m],!0);return f.toCoordinateArray()},F.hasRepeatedPoints=function(a){for(var u=1;u<a.length;u++)if(a[u-1].equals(a[u]))return!0;return!1},F.removeRepeatedPoints=function(a){return F.hasRepeatedPoints(a)?new ue(a,!1).toCoordinateArray():a},F.reverse=function(a){for(var u=a.length-1,f=Math.trunc(u/2),m=0;m<=f;m++){var v=a[m];a[m]=a[u-m],a[u-m]=v}},F.removeNull=function(a){for(var u=0,f=0;f<a.length;f++)a[f]!==null&&u++;var m=new Array(u).fill(null);if(u===0)return m;for(var v=0,S=0;S<a.length;S++)a[S]!==null&&(m[v++]=a[S]);return m},F.copyDeep=function(){if(arguments.length===1){for(var a=arguments[0],u=new Array(a.length).fill(null),f=0;f<a.length;f++)u[f]=new N(a[f]);return u}if(arguments.length===5)for(var m=arguments[0],v=arguments[1],S=arguments[2],M=arguments[3],B=arguments[4],z=0;z<B;z++)S[M+z]=new N(m[v+z])},F.isEqualReversed=function(a,u){for(var f=0;f<a.length;f++){var m=a[f],v=u[a.length-f-1];if(m.compareTo(v)!==0)return!1}return!0},F.envelope=function(a){for(var u=new ie,f=0;f<a.length;f++)u.expandToInclude(a[f]);return u},F.toCoordinateArray=function(a){return a.toArray(F.coordArrayType)},F.atLeastNCoordinatesOrNothing=function(a,u){return u.length>=a?u:[]},F.indexOf=function(a,u){for(var f=0;f<u.length;f++)if(a.equals(u[f]))return f;return-1},F.increasingDirection=function(a){for(var u=0;u<Math.trunc(a.length/2);u++){var f=a.length-1-u,m=a[u].compareTo(a[f]);if(m!==0)return m}return 1},F.compare=function(a,u){for(var f=0;f<a.length&&f<u.length;){var m=a[f].compareTo(u[f]);if(m!==0)return m;f++}return f<u.length?-1:f<a.length?1:0},F.minCoordinate=function(a){for(var u=null,f=0;f<a.length;f++)(u===null||u.compareTo(a[f])>0)&&(u=a[f]);return u},F.extract=function(a,u,f){u=Ce.clamp(u,0,a.length);var m=(f=Ce.clamp(f,-1,a.length))-u+1;f<0&&(m=0),u>=a.length&&(m=0),f<u&&(m=0);var v=new Array(m).fill(null);if(m===0)return v;for(var S=0,M=u;M<=f;M++)v[S++]=a[M];return v},Object.defineProperties(F,$);var X=o(function(){},"wt");X.prototype.compare=function(a,u){return F.compare(a,u)},X.prototype.interfaces_=function(){return[Y]},X.prototype.getClass=function(){return X};var J=o(function(){},"Ot");J.prototype.compare=function(a,u){var f=a,m=u;if(f.length<m.length)return-1;if(f.length>m.length)return 1;if(f.length===0)return 0;var v=F.compare(f,m);return F.isEqualReversed(f,m)?0:v},J.prototype.OLDcompare=function(a,u){var f=a,m=u;if(f.length<m.length)return-1;if(f.length>m.length)return 1;if(f.length===0)return 0;for(var v=F.increasingDirection(f),S=F.increasingDirection(m),M=v>0?0:f.length-1,B=S>0?0:f.length-1,z=0;z<f.length;z++){var te=f[M].compareTo(m[B]);if(te!==0)return te;M+=v,B+=S}return 0},J.prototype.interfaces_=function(){return[Y]},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 Se=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u}(K);(i.prototype=new Error).name="OperationNotSupported",(s.prototype=new On).contains=function(){};var ge=function(a){function u(){a.call(this),this.array_=[],arguments[0]instanceof On&&this.addAll(arguments[0])}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.contains=function(f){for(var m=0,v=this.array_.length;m<v;m++)if(this.array_[m]===f)return!0;return!1},u.prototype.add=function(f){return!this.contains(f)&&(this.array_.push(f),!0)},u.prototype.addAll=function(f){for(var m=f.iterator();m.hasNext();)this.add(m.next());return!0},u.prototype.remove=function(f){throw new Error},u.prototype.size=function(){return this.array_.length},u.prototype.isEmpty=function(){return this.array_.length===0},u.prototype.toArray=function(){for(var f=[],m=0,v=this.array_.length;m<v;m++)f.push(this.array_[m]);return f},u.prototype.iterator=function(){return new De(this)},u}(s),De=function(a){function u(f){a.call(this),this.hashSet_=f,this.position_=0}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new n;return this.hashSet_.array_[this.position_++]},u.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},u.prototype.remove=function(){throw new i},u}(vc),Pe=0;(b.prototype=new Se).get=function(a){for(var u=this.root_;u!==null;){var f=a.compareTo(u.key);if(f<0)u=u.left;else{if(!(f>0))return u.value;u=u.right}}return null},b.prototype.put=function(a,u){if(this.root_===null)return this.root_={key:a,value:u,left:null,right:null,parent:null,color:Pe,getValue:o(function(){return this.value},"getValue"),getKey:o(function(){return this.key},"getKey")},this.size_=1,null;var f,m,v=this.root_;do if(f=v,(m=a.compareTo(v.key))<0)v=v.left;else{if(!(m>0)){var S=v.value;return v.value=u,S}v=v.right}while(v!==null);var M={key:a,left:null,right:null,value:u,parent:f,color:Pe,getValue:o(function(){return this.value},"getValue"),getKey:o(function(){return this.key},"getKey")};return m<0?f.left=M:f.right=M,this.fixAfterInsertion(M),this.size_++,null},b.prototype.fixAfterInsertion=function(a){for(a.color=1;a!=null&&a!==this.root_&&a.parent.color===1;)if(c(a)===h(c(c(a)))){var u=y(c(c(a)));l(u)===1?(p(c(a),Pe),p(u,Pe),p(c(c(a)),1),a=c(c(a))):(a===y(c(a))&&(a=c(a),this.rotateLeft(a)),p(c(a),Pe),p(c(c(a)),1),this.rotateRight(c(c(a))))}else{var f=h(c(c(a)));l(f)===1?(p(c(a),Pe),p(f,Pe),p(c(c(a)),1),a=c(c(a))):(a===h(c(a))&&(a=c(a),this.rotateRight(a)),p(c(a),Pe),p(c(c(a)),1),this.rotateLeft(c(c(a))))}this.root_.color=Pe},b.prototype.values=function(){var a=new He,u=this.getFirstEntry();if(u!==null)for(a.add(u.value);(u=b.successor(u))!==null;)a.add(u.value);return a},b.prototype.entrySet=function(){var a=new ge,u=this.getFirstEntry();if(u!==null)for(a.add(u);(u=b.successor(u))!==null;)a.add(u);return a},b.prototype.rotateLeft=function(a){if(a!=null){var u=a.right;a.right=u.left,u.left!=null&&(u.left.parent=a),u.parent=a.parent,a.parent===null?this.root_=u:a.parent.left===a?a.parent.left=u:a.parent.right=u,u.left=a,a.parent=u}},b.prototype.rotateRight=function(a){if(a!=null){var u=a.left;a.left=u.right,u.right!=null&&(u.right.parent=a),u.parent=a.parent,a.parent===null?this.root_=u:a.parent.right===a?a.parent.right=u:a.parent.left=u,u.right=a,a.parent=u}},b.prototype.getFirstEntry=function(){var a=this.root_;if(a!=null)for(;a.left!=null;)a=a.left;return a},b.successor=function(a){if(a===null)return null;if(a.right!==null){for(var u=a.right;u.left!==null;)u=u.left;return u}for(var f=a.parent,m=a;f!==null&&m===f.right;)m=f,f=f.parent;return f},b.prototype.size=function(){return this.size_};var et=o(function(){},"At");et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},_.prototype=new s,(C.prototype=new _).contains=function(a){for(var u=0,f=this.array_.length;u<f;u++)if(this.array_[u].compareTo(a)===0)return!0;return!1},C.prototype.add=function(a){if(this.contains(a))return!1;for(var u=0,f=this.array_.length;u<f;u++)if(this.array_[u].compareTo(a)===1)return this.array_.splice(u,0,a),!0;return this.array_.push(a),!0},C.prototype.addAll=function(a){for(var u=a.iterator();u.hasNext();)this.add(u.next());return!0},C.prototype.remove=function(a){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 a=[],u=0,f=this.array_.length;u<f;u++)a.push(this.array_[u]);return a},C.prototype.iterator=function(){return new he(this)};var he=o(function(a){this.treeSet_=a,this.position_=0},"Ft");he.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new n;return this.treeSet_.array_[this.position_++]},he.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},he.prototype.remove=function(){throw new i};var Fe=o(function(){},"Gt");Fe.sort=function(){var a,u,f,m,v=arguments[0];if(arguments.length===1)m=o(function(M,B){return M.compareTo(B)},"i"),v.sort(m);else if(arguments.length===2)f=arguments[1],m=o(function(M,B){return f.compare(M,B)},"i"),v.sort(m);else if(arguments.length===3){(u=v.slice(arguments[1],arguments[2])).sort();var S=v.slice(0,arguments[1]).concat(u,v.slice(arguments[2],v.length));for(v.splice(0,v.length),a=0;a<S.length;a++)v.push(S[a])}else if(arguments.length===4)for(u=v.slice(arguments[1],arguments[2]),f=arguments[3],m=o(function(M,B){return f.compare(M,B)},"i"),u.sort(m),S=v.slice(0,arguments[1]).concat(u,v.slice(arguments[2],v.length)),v.splice(0,v.length),a=0;a<S.length;a++)v.push(S[a])},Fe.asList=function(a){for(var u=new He,f=0,m=a.length;f<m;f++)u.add(a[f]);return u};var Le=o(function(){},"qt"),bt={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}};bt.P.get=function(){return 0},bt.L.get=function(){return 1},bt.A.get=function(){return 2},bt.FALSE.get=function(){return-1},bt.TRUE.get=function(){return-2},bt.DONTCARE.get=function(){return-3},bt.SYM_FALSE.get=function(){return"F"},bt.SYM_TRUE.get=function(){return"T"},bt.SYM_DONTCARE.get=function(){return"*"},bt.SYM_P.get=function(){return"0"},bt.SYM_L.get=function(){return"1"},bt.SYM_A.get=function(){return"2"},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.toDimensionSymbol=function(a){switch(a){case Le.FALSE:return Le.SYM_FALSE;case Le.TRUE:return Le.SYM_TRUE;case Le.DONTCARE:return Le.SYM_DONTCARE;case Le.P:return Le.SYM_P;case Le.L:return Le.SYM_L;case Le.A:return Le.SYM_A}throw new D("Unknown dimension value: "+a)},Le.toDimensionValue=function(a){switch(Te.toUpperCase(a)){case Le.SYM_FALSE:return Le.FALSE;case Le.SYM_TRUE:return Le.TRUE;case Le.SYM_DONTCARE:return Le.DONTCARE;case Le.SYM_P:return Le.P;case Le.SYM_L:return Le.L;case Le.SYM_A:return Le.A}throw new D("Unknown dimension symbol: "+a)},Object.defineProperties(Le,bt);var ht=o(function(){},"Vt");ht.prototype.filter=function(a){},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht};var kt=o(function(){},"Ut");kt.prototype.filter=function(a,u){},kt.prototype.isDone=function(){},kt.prototype.isGeometryChanged=function(){},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt};var xt=function(a){function u(m,v){if(a.call(this,v),this._geometries=m||[],a.hasNullElements(this._geometries))throw new D("geometries must not contain null elements")}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){for(var m=new ie,v=0;v<this._geometries.length;v++)m.expandToInclude(this._geometries[v].getEnvelopeInternal());return m},u.prototype.getGeometryN=function(m){return this._geometries[m]},u.prototype.getSortIndex=function(){return a.SORTINDEX_GEOMETRYCOLLECTION},u.prototype.getCoordinates=function(){for(var m=new Array(this.getNumPoints()).fill(null),v=-1,S=0;S<this._geometries.length;S++)for(var M=this._geometries[S].getCoordinates(),B=0;B<M.length;B++)m[++v]=M[B];return m},u.prototype.getArea=function(){for(var m=0,v=0;v<this._geometries.length;v++)m+=this._geometries[v].getArea();return m},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];if(!this.isEquivalentClass(m))return!1;var S=m;if(this._geometries.length!==S._geometries.length)return!1;for(var M=0;M<this._geometries.length;M++)if(!this._geometries[M].equalsExact(S._geometries[M],v))return!1;return!0}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){for(var m=0;m<this._geometries.length;m++)this._geometries[m].normalize();Fe.sort(this._geometries)},u.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},u.prototype.getBoundaryDimension=function(){for(var m=Le.FALSE,v=0;v<this._geometries.length;v++)m=Math.max(m,this._geometries[v].getBoundaryDimension());return m},u.prototype.getDimension=function(){for(var m=Le.FALSE,v=0;v<this._geometries.length;v++)m=Math.max(m,this._geometries[v].getDimension());return m},u.prototype.getLength=function(){for(var m=0,v=0;v<this._geometries.length;v++)m+=this._geometries[v].getLength();return m},u.prototype.getNumPoints=function(){for(var m=0,v=0;v<this._geometries.length;v++)m+=this._geometries[v].getNumPoints();return m},u.prototype.getNumGeometries=function(){return this._geometries.length},u.prototype.reverse=function(){for(var m=this._geometries.length,v=new Array(m).fill(null),S=0;S<this._geometries.length;S++)v[S]=this._geometries[S].reverse();return this.getFactory().createGeometryCollection(v)},u.prototype.compareToSameClass=function(){if(arguments.length===1){var m=arguments[0],v=new C(Fe.asList(this._geometries)),S=new C(Fe.asList(m._geometries));return this.compare(v,S)}if(arguments.length===2){for(var M=arguments[0],B=arguments[1],z=M,te=this.getNumGeometries(),pe=z.getNumGeometries(),be=0;be<te&&be<pe;){var Xe=this.getGeometryN(be),Ke=z.getGeometryN(be),it=Xe.compareToSameClass(Ke,B);if(it!==0)return it;be++}return be<te?1:be<pe?-1:0}},u.prototype.apply=function(){if(ne(arguments[0],ts))for(var m=arguments[0],v=0;v<this._geometries.length;v++)this._geometries[v].apply(m);else if(ne(arguments[0],kt)){var S=arguments[0];if(this._geometries.length===0)return null;for(var M=0;M<this._geometries.length&&(this._geometries[M].apply(S),!S.isDone());M++);S.isGeometryChanged()&&this.geometryChanged()}else if(ne(arguments[0],ht)){var B=arguments[0];B.filter(this);for(var z=0;z<this._geometries.length;z++)this._geometries[z].apply(B)}else if(ne(arguments[0],Ya)){var te=arguments[0];te.filter(this);for(var pe=0;pe<this._geometries.length;pe++)this._geometries[pe].apply(te)}},u.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),ot.shouldNeverReachHere(),null},u.prototype.clone=function(){var m=a.prototype.clone.call(this);m._geometries=new Array(this._geometries.length).fill(null);for(var v=0;v<this._geometries.length;v++)m._geometries[v]=this._geometries[v].clone();return m},u.prototype.getGeometryType=function(){return"GeometryCollection"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.isEmpty=function(){for(var m=0;m<this._geometries.length;m++)if(!this._geometries[m].isEmpty())return!1;return!0},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(u,f),u}(vt),dn=function(a){function u(){a.apply(this,arguments)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTILINESTRING},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&a.prototype.equalsExact.call(this,m,v)}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.getBoundaryDimension=function(){return this.isClosed()?Le.FALSE:0},u.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var m=0;m<this._geometries.length;m++)if(!this._geometries[m].isClosed())return!1;return!0},u.prototype.getDimension=function(){return 1},u.prototype.reverse=function(){for(var m=this._geometries.length,v=new Array(m).fill(null),S=0;S<this._geometries.length;S++)v[m-1-S]=this._geometries[S].reverse();return this.getFactory().createMultiLineString(v)},u.prototype.getBoundary=function(){return new _n(this).getBoundary()},u.prototype.getGeometryType=function(){return"MultiLineString"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.interfaces_=function(){return[et]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(u,f),u}(xt),_n=o(function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var a=arguments[0],u=ro.MOD2_BOUNDARY_RULE;this._geom=a,this._geomFact=a.getFactory(),this._bnRule=u}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this._geom=f,this._geomFact=f.getFactory(),this._bnRule=m}},"Yt");_n.prototype.boundaryMultiLineString=function(a){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var u=this.computeBoundaryCoordinates(a);return u.length===1?this._geomFact.createPoint(u[0]):this._geomFact.createMultiPointFromCoords(u)},_n.prototype.getBoundary=function(){return this._geom instanceof Gt?this.boundaryLineString(this._geom):this._geom instanceof dn?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},_n.prototype.boundaryLineString=function(a){return this._geom.isEmpty()?this.getEmptyMultiPoint():a.isClosed()?this._bnRule.isInBoundary(2)?a.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([a.getStartPoint(),a.getEndPoint()])},_n.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},_n.prototype.computeBoundaryCoordinates=function(a){var u=new He;this._endpointMap=new b;for(var f=0;f<a.getNumGeometries();f++){var m=a.getGeometryN(f);m.getNumPoints()!==0&&(this.addEndpoint(m.getCoordinateN(0)),this.addEndpoint(m.getCoordinateN(m.getNumPoints()-1)))}for(var v=this._endpointMap.entrySet().iterator();v.hasNext();){var S=v.next(),M=S.getValue().count;this._bnRule.isInBoundary(M)&&u.add(S.getKey())}return F.toCoordinateArray(u)},_n.prototype.addEndpoint=function(a){var u=this._endpointMap.get(a);u===null&&(u=new si,this._endpointMap.put(a,u)),u.count++},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},_n.getBoundary=function(){if(arguments.length===1){var a=arguments[0];return new _n(a).getBoundary()}if(arguments.length===2){var u=arguments[0],f=arguments[1];return new _n(u,f).getBoundary()}};var si=o(function(){this.count=null},"kt");si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var Sn=o(function(){},"jt"),no={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Sn.chars=function(a,u){for(var f=new Array(u).fill(null),m=0;m<u;m++)f[m]=a;return String(f)},Sn.getStackTrace=function(){if(arguments.length===1){var a=arguments[0],u=new function(){},f=new function(){}(u);return a.printStackTrace(f),u.toString()}if(arguments.length===2){for(var m=arguments[0],v=arguments[1],S="",M=new function(){}(new function(){}(Sn.getStackTrace(m))),B=0;B<v;B++)try{S+=M.readLine()+Sn.NEWLINE}catch(z){if(!(z instanceof P))throw z;ot.shouldNeverReachHere()}return S}},Sn.split=function(a,u){for(var f=u.length,m=new He,v=""+a,S=v.indexOf(u);S>=0;){var M=v.substring(0,S);m.add(M),S=(v=v.substring(S+f)).indexOf(u)}v.length>0&&m.add(v);for(var B=new Array(m.size()).fill(null),z=0;z<B.length;z++)B[z]=m.get(z);return B},Sn.toString=function(){if(arguments.length===1){var a=arguments[0];return Sn.SIMPLE_ORDINATE_FORMAT.format(a)}},Sn.spaces=function(a){return Sn.chars(" ",a)},no.NEWLINE.get=function(){return we.getProperty("line.separator")},no.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Sn,no);var Qt=o(function(){},"Wt");Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt},Qt.copyCoord=function(a,u,f,m){for(var v=Math.min(a.getDimension(),f.getDimension()),S=0;S<v;S++)f.setOrdinate(m,S,a.getOrdinate(u,S))},Qt.isRing=function(a){var u=a.size();return u===0||!(u<=3)&&a.getOrdinate(0,Ae.X)===a.getOrdinate(u-1,Ae.X)&&a.getOrdinate(0,Ae.Y)===a.getOrdinate(u-1,Ae.Y)},Qt.isEqual=function(a,u){var f=a.size();if(f!==u.size())return!1;for(var m=Math.min(a.getDimension(),u.getDimension()),v=0;v<f;v++)for(var S=0;S<m;S++){var M=a.getOrdinate(v,S),B=u.getOrdinate(v,S);if(a.getOrdinate(v,S)!==u.getOrdinate(v,S)&&(!A.isNaN(M)||!A.isNaN(B)))return!1}return!0},Qt.extend=function(a,u,f){var m=a.create(f,u.getDimension()),v=u.size();if(Qt.copy(u,0,m,0,v),v>0)for(var S=v;S<f;S++)Qt.copy(u,v-1,m,S,1);return m},Qt.reverse=function(a){for(var u=a.size()-1,f=Math.trunc(u/2),m=0;m<=f;m++)Qt.swap(a,m,u-m)},Qt.swap=function(a,u,f){if(u===f)return null;for(var m=0;m<a.getDimension();m++){var v=a.getOrdinate(u,m);a.setOrdinate(u,m,a.getOrdinate(f,m)),a.setOrdinate(f,m,v)}},Qt.copy=function(a,u,f,m,v){for(var S=0;S<v;S++)Qt.copyCoord(a,u+S,f,m+S)},Qt.toString=function(){if(arguments.length===1){var a=arguments[0],u=a.size();if(u===0)return"()";var f=a.getDimension(),m=new Ue;m.append("(");for(var v=0;v<u;v++){v>0&&m.append(" ");for(var S=0;S<f;S++)S>0&&m.append(","),m.append(Sn.toString(a.getOrdinate(v,S)))}return m.append(")"),m.toString()}},Qt.ensureValidRing=function(a,u){var f=u.size();return f===0?u:f<=3?Qt.createClosedRing(a,u,4):u.getOrdinate(0,Ae.X)===u.getOrdinate(f-1,Ae.X)&&u.getOrdinate(0,Ae.Y)===u.getOrdinate(f-1,Ae.Y)?u:Qt.createClosedRing(a,u,f+1)},Qt.createClosedRing=function(a,u,f){var m=a.create(f,u.getDimension()),v=u.size();Qt.copy(u,0,m,0,v);for(var S=v;S<f;S++)Qt.copy(u,0,m,S,1);return m};var Gt=function(a){function u(m,v){a.call(this,v),this._points=null,this.init(m)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new ie:this._points.expandEnvelope(new ie)},u.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},u.prototype.getSortIndex=function(){return a.SORTINDEX_LINESTRING},u.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];if(!this.isEquivalentClass(m))return!1;var S=m;if(this._points.size()!==S._points.size())return!1;for(var M=0;M<this._points.size();M++)if(!this.equal(this._points.getCoordinate(M),S._points.getCoordinate(M),v))return!1;return!0}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){for(var m=0;m<Math.trunc(this._points.size()/2);m++){var v=this._points.size()-1-m;if(!this._points.getCoordinate(m).equals(this._points.getCoordinate(v)))return this._points.getCoordinate(m).compareTo(this._points.getCoordinate(v))>0&&Qt.reverse(this._points),null}},u.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},u.prototype.getBoundaryDimension=function(){return this.isClosed()?Le.FALSE:0},u.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},u.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},u.prototype.getDimension=function(){return 1},u.prototype.getLength=function(){return ze.computeLength(this._points)},u.prototype.getNumPoints=function(){return this._points.size()},u.prototype.reverse=function(){var m=this._points.copy();return Qt.reverse(m),this.getFactory().createLineString(m)},u.prototype.compareToSameClass=function(){if(arguments.length===1){for(var m=arguments[0],v=0,S=0;v<this._points.size()&&S<m._points.size();){var M=this._points.getCoordinate(v).compareTo(m._points.getCoordinate(S));if(M!==0)return M;v++,S++}return v<this._points.size()?1:S<m._points.size()?-1:0}if(arguments.length===2){var B=arguments[0];return arguments[1].compare(this._points,B._points)}},u.prototype.apply=function(){if(ne(arguments[0],ts))for(var m=arguments[0],v=0;v<this._points.size();v++)m.filter(this._points.getCoordinate(v));else if(ne(arguments[0],kt)){var S=arguments[0];if(this._points.size()===0)return null;for(var M=0;M<this._points.size()&&(S.filter(this._points,M),!S.isDone());M++);S.isGeometryChanged()&&this.geometryChanged()}else ne(arguments[0],ht)?arguments[0].filter(this):ne(arguments[0],Ya)&&arguments[0].filter(this)},u.prototype.getBoundary=function(){return new _n(this).getBoundary()},u.prototype.isEquivalentClass=function(m){return m instanceof u},u.prototype.clone=function(){var m=a.prototype.clone.call(this);return m._points=this._points.clone(),m},u.prototype.getCoordinateN=function(m){return this._points.getCoordinate(m)},u.prototype.getGeometryType=function(){return"LineString"},u.prototype.copy=function(){return new u(this._points.copy(),this._factory)},u.prototype.getCoordinateSequence=function(){return this._points},u.prototype.isEmpty=function(){return this._points.size()===0},u.prototype.init=function(m){if(m===null&&(m=this.getFactory().getCoordinateSequenceFactory().create([])),m.size()===1)throw new D("Invalid number of points in LineString (found "+m.size()+" - must be 0 or >= 2)");this._points=m},u.prototype.isCoordinate=function(m){for(var v=0;v<this._points.size();v++)if(this._points.getCoordinate(v).equals(m))return!0;return!1},u.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},u.prototype.getPointN=function(m){return this.getFactory().createPoint(this._points.getCoordinate(m))},u.prototype.interfaces_=function(){return[et]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(u,f),u}(vt),is=o(function(){},"Jt");is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is};var Gn=function(a){function u(m,v){a.call(this,v),this._coordinates=m||null,this.init(this._coordinates)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new ie;var m=new ie;return m.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),m},u.prototype.getSortIndex=function(){return a.SORTINDEX_POINT},u.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&(!(!this.isEmpty()||!m.isEmpty())||this.isEmpty()===m.isEmpty()&&this.equal(m.getCoordinate(),this.getCoordinate(),v))}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){},u.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},u.prototype.getBoundaryDimension=function(){return Le.FALSE},u.prototype.getDimension=function(){return 0},u.prototype.getNumPoints=function(){return this.isEmpty()?0:1},u.prototype.reverse=function(){return this.copy()},u.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},u.prototype.compareToSameClass=function(){if(arguments.length===1){var m=arguments[0];return this.getCoordinate().compareTo(m.getCoordinate())}if(arguments.length===2){var v=arguments[0];return arguments[1].compare(this._coordinates,v._coordinates)}},u.prototype.apply=function(){if(ne(arguments[0],ts)){var m=arguments[0];if(this.isEmpty())return null;m.filter(this.getCoordinate())}else if(ne(arguments[0],kt)){var v=arguments[0];if(this.isEmpty())return null;v.filter(this._coordinates,0),v.isGeometryChanged()&&this.geometryChanged()}else ne(arguments[0],ht)?arguments[0].filter(this):ne(arguments[0],Ya)&&arguments[0].filter(this)},u.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},u.prototype.clone=function(){var m=a.prototype.clone.call(this);return m._coordinates=this._coordinates.clone(),m},u.prototype.getGeometryType=function(){return"Point"},u.prototype.copy=function(){return new u(this._coordinates.copy(),this._factory)},u.prototype.getCoordinateSequence=function(){return this._coordinates},u.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},u.prototype.isEmpty=function(){return this._coordinates.size()===0},u.prototype.init=function(m){m===null&&(m=this.getFactory().getCoordinateSequenceFactory().create([])),ot.isTrue(m.size()<=1),this._coordinates=m},u.prototype.isSimple=function(){return!0},u.prototype.interfaces_=function(){return[is]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(u,f),u}(vt),Hi=o(function(){},"Zt");Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi};var Xr=function(a){function u(m,v,S){if(a.call(this,S),this._shell=null,this._holes=null,m===null&&(m=this.getFactory().createLinearRing()),v===null&&(v=[]),a.hasNullElements(v))throw new D("holes must not contain null elements");if(m.isEmpty()&&a.hasNonEmptyElements(v))throw new D("shell is empty but holes are not");this._shell=m,this._holes=v}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},u.prototype.getSortIndex=function(){return a.SORTINDEX_POLYGON},u.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var m=new Array(this.getNumPoints()).fill(null),v=-1,S=this._shell.getCoordinates(),M=0;M<S.length;M++)m[++v]=S[M];for(var B=0;B<this._holes.length;B++)for(var z=this._holes[B].getCoordinates(),te=0;te<z.length;te++)m[++v]=z[te];return m},u.prototype.getArea=function(){var m=0;m+=Math.abs(ze.signedArea(this._shell.getCoordinateSequence()));for(var v=0;v<this._holes.length;v++)m-=Math.abs(ze.signedArea(this._holes[v].getCoordinateSequence()));return m},u.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var m=this._shell.getCoordinateSequence(),v=this.getEnvelopeInternal(),S=0;S<5;S++){var M=m.getX(S);if(M!==v.getMinX()&&M!==v.getMaxX())return!1;var B=m.getY(S);if(B!==v.getMinY()&&B!==v.getMaxY())return!1}for(var z=m.getX(0),te=m.getY(0),pe=1;pe<=4;pe++){var be=m.getX(pe),Xe=m.getY(pe);if(be!==z==(Xe!==te))return!1;z=be,te=Xe}return!0},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];if(!this.isEquivalentClass(m))return!1;var S=m,M=this._shell,B=S._shell;if(!M.equalsExact(B,v)||this._holes.length!==S._holes.length)return!1;for(var z=0;z<this._holes.length;z++)if(!this._holes[z].equalsExact(S._holes[z],v))return!1;return!0}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var m=0;m<this._holes.length;m++)this.normalize(this._holes[m],!1);Fe.sort(this._holes)}else if(arguments.length===2){var v=arguments[0],S=arguments[1];if(v.isEmpty())return null;var M=new Array(v.getCoordinates().length-1).fill(null);we.arraycopy(v.getCoordinates(),0,M,0,M.length);var B=F.minCoordinate(v.getCoordinates());F.scroll(M,B),we.arraycopy(M,0,v.getCoordinates(),0,M.length),v.getCoordinates()[M.length]=M[0],ze.isCCW(v.getCoordinates())===S&&F.reverse(v.getCoordinates())}},u.prototype.getCoordinate=function(){return this._shell.getCoordinate()},u.prototype.getNumInteriorRing=function(){return this._holes.length},u.prototype.getBoundaryDimension=function(){return 1},u.prototype.getDimension=function(){return 2},u.prototype.getLength=function(){var m=0;m+=this._shell.getLength();for(var v=0;v<this._holes.length;v++)m+=this._holes[v].getLength();return m},u.prototype.getNumPoints=function(){for(var m=this._shell.getNumPoints(),v=0;v<this._holes.length;v++)m+=this._holes[v].getNumPoints();return m},u.prototype.reverse=function(){var m=this.copy();m._shell=this._shell.copy().reverse(),m._holes=new Array(this._holes.length).fill(null);for(var v=0;v<this._holes.length;v++)m._holes[v]=this._holes[v].copy().reverse();return m},u.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},u.prototype.compareToSameClass=function(){if(arguments.length===1){var m=arguments[0],v=this._shell,S=m._shell;return v.compareToSameClass(S)}if(arguments.length===2){var M=arguments[0],B=arguments[1],z=M,te=this._shell,pe=z._shell,be=te.compareToSameClass(pe,B);if(be!==0)return be;for(var Xe=this.getNumInteriorRing(),Ke=z.getNumInteriorRing(),it=0;it<Xe&&it<Ke;){var mt=this.getInteriorRingN(it),Zr=z.getInteriorRingN(it),Ii=mt.compareToSameClass(Zr,B);if(Ii!==0)return Ii;it++}return it<Xe?1:it<Ke?-1:0}},u.prototype.apply=function(m){if(ne(m,ts)){this._shell.apply(m);for(var v=0;v<this._holes.length;v++)this._holes[v].apply(m)}else if(ne(m,kt)){if(this._shell.apply(m),!m.isDone())for(var S=0;S<this._holes.length&&(this._holes[S].apply(m),!m.isDone());S++);m.isGeometryChanged()&&this.geometryChanged()}else if(ne(m,ht))m.filter(this);else if(ne(m,Ya)){m.filter(this),this._shell.apply(m);for(var M=0;M<this._holes.length;M++)this._holes[M].apply(m)}},u.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var m=new Array(this._holes.length+1).fill(null);m[0]=this._shell;for(var v=0;v<this._holes.length;v++)m[v+1]=this._holes[v];return m.length<=1?this.getFactory().createLinearRing(m[0].getCoordinateSequence()):this.getFactory().createMultiLineString(m)},u.prototype.clone=function(){var m=a.prototype.clone.call(this);m._shell=this._shell.clone(),m._holes=new Array(this._holes.length).fill(null);for(var v=0;v<this._holes.length;v++)m._holes[v]=this._holes[v].clone();return m},u.prototype.getGeometryType=function(){return"Polygon"},u.prototype.copy=function(){for(var m=this._shell.copy(),v=new Array(this._holes.length).fill(null),S=0;S<v.length;S++)v[S]=this._holes[S].copy();return new u(m,v,this._factory)},u.prototype.getExteriorRing=function(){return this._shell},u.prototype.isEmpty=function(){return this._shell.isEmpty()},u.prototype.getInteriorRingN=function(m){return this._holes[m]},u.prototype.interfaces_=function(){return[Hi]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(u,f),u}(vt),Ms=function(a){function u(){a.apply(this,arguments)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTIPOINT},u.prototype.isValid=function(){return!0},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&a.prototype.equalsExact.call(this,m,v)}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.getCoordinate=function(){if(arguments.length===1){var m=arguments[0];return this._geometries[m].getCoordinate()}return a.prototype.getCoordinate.apply(this,arguments)},u.prototype.getBoundaryDimension=function(){return Le.FALSE},u.prototype.getDimension=function(){return 0},u.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},u.prototype.getGeometryType=function(){return"MultiPoint"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.interfaces_=function(){return[is]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(u,f),u}(xt),os=function(a){function u(m,v){m instanceof N&&v instanceof jt&&(m=v.getCoordinateSequenceFactory().create(m)),a.call(this,m,v),this.validateConstruction()}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_LINEARRING},u.prototype.getBoundaryDimension=function(){return Le.FALSE},u.prototype.isClosed=function(){return!!this.isEmpty()||a.prototype.isClosed.call(this)},u.prototype.reverse=function(){var m=this._points.copy();return Qt.reverse(m),this.getFactory().createLinearRing(m)},u.prototype.validateConstruction=function(){if(!this.isEmpty()&&!a.prototype.isClosed.call(this))throw new D("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<u.MINIMUM_VALID_SIZE)throw new D("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},u.prototype.getGeometryType=function(){return"LinearRing"},u.prototype.copy=function(){return new u(this._points.copy(),this._factory)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},f.MINIMUM_VALID_SIZE.get=function(){return 4},f.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(u,f),u}(Gt),Ka=function(a){function u(){a.apply(this,arguments)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTIPOLYGON},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&a.prototype.equalsExact.call(this,m,v)}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.getBoundaryDimension=function(){return 1},u.prototype.getDimension=function(){return 2},u.prototype.reverse=function(){for(var m=this._geometries.length,v=new Array(m).fill(null),S=0;S<this._geometries.length;S++)v[S]=this._geometries[S].reverse();return this.getFactory().createMultiPolygon(v)},u.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var m=new He,v=0;v<this._geometries.length;v++)for(var S=this._geometries[v].getBoundary(),M=0;M<S.getNumGeometries();M++)m.add(S.getGeometryN(M));var B=new Array(m.size()).fill(null);return this.getFactory().createMultiLineString(m.toArray(B))},u.prototype.getGeometryType=function(){return"MultiPolygon"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.interfaces_=function(){return[Hi]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(u,f),u}(xt),Os=o(function(a){this._factory=a||null,this._isUserDataCopied=!1},"ie"),Wy={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Os.prototype.setCopyUserData=function(a){this._isUserDataCopied=a},Os.prototype.edit=function(a,u){if(a===null)return null;var f=this.editInternal(a,u);return this._isUserDataCopied&&f.setUserData(a.getUserData()),f},Os.prototype.editInternal=function(a,u){return this._factory===null&&(this._factory=a.getFactory()),a instanceof xt?this.editGeometryCollection(a,u):a instanceof Xr?this.editPolygon(a,u):a instanceof Gn?u.edit(a,this._factory):a instanceof Gt?u.edit(a,this._factory):(ot.shouldNeverReachHere("Unsupported Geometry class: "+a.getClass().getName()),null)},Os.prototype.editGeometryCollection=function(a,u){for(var f=u.edit(a,this._factory),m=new He,v=0;v<f.getNumGeometries();v++){var S=this.edit(f.getGeometryN(v),u);S===null||S.isEmpty()||m.add(S)}return f.getClass()===Ms?this._factory.createMultiPoint(m.toArray([])):f.getClass()===dn?this._factory.createMultiLineString(m.toArray([])):f.getClass()===Ka?this._factory.createMultiPolygon(m.toArray([])):this._factory.createGeometryCollection(m.toArray([]))},Os.prototype.editPolygon=function(a,u){var f=u.edit(a,this._factory);if(f===null&&(f=this._factory.createPolygon(null)),f.isEmpty())return f;var m=this.edit(f.getExteriorRing(),u);if(m===null||m.isEmpty())return this._factory.createPolygon();for(var v=new He,S=0;S<f.getNumInteriorRing();S++){var M=this.edit(f.getInteriorRingN(S),u);M===null||M.isEmpty()||v.add(M)}return this._factory.createPolygon(m,v.toArray([]))},Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os},Os.GeometryEditorOperation=function(){},Wy.NoOpGeometryOperation.get=function(){return xb},Wy.CoordinateOperation.get=function(){return Ib},Wy.CoordinateSequenceOperation.get=function(){return _b},Object.defineProperties(Os,Wy);var xb=o(function(){},"oe");xb.prototype.edit=function(a,u){return a},xb.prototype.interfaces_=function(){return[Os.GeometryEditorOperation]},xb.prototype.getClass=function(){return xb};var Ib=o(function(){},"se");Ib.prototype.edit=function(a,u){var f=this.editCoordinates(a.getCoordinates(),a);return f===null?a:a instanceof os?u.createLinearRing(f):a instanceof Gt?u.createLineString(f):a instanceof Gn?f.length>0?u.createPoint(f[0]):u.createPoint():a},Ib.prototype.interfaces_=function(){return[Os.GeometryEditorOperation]},Ib.prototype.getClass=function(){return Ib};var _b=o(function(){},"ae");_b.prototype.edit=function(a,u){return a instanceof os?u.createLinearRing(this.edit(a.getCoordinateSequence(),a)):a instanceof Gt?u.createLineString(this.edit(a.getCoordinateSequence(),a)):a instanceof Gn?u.createPoint(this.edit(a.getCoordinateSequence(),a)):a},_b.prototype.interfaces_=function(){return[Os.GeometryEditorOperation]},_b.prototype.getClass=function(){return _b};var ai=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 a=arguments[0];this._coordinates=new Array(a).fill(null);for(var u=0;u<a;u++)this._coordinates[u]=new N}else if(ne(arguments[0],Ae)){var f=arguments[0];if(f===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=f.getDimension(),this._coordinates=new Array(f.size()).fill(null);for(var m=0;m<this._coordinates.length;m++)this._coordinates[m]=f.getCoordinateCopy(m)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var v=arguments[0],S=arguments[1];this._coordinates=v,this._dimension=S,v===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var M=arguments[0],B=arguments[1];this._coordinates=new Array(M).fill(null),this._dimension=B;for(var z=0;z<M;z++)this._coordinates[z]=new N}}},"ue"),WF={serialVersionUID:{configurable:!0}};ai.prototype.setOrdinate=function(a,u,f){switch(u){case Ae.X:this._coordinates[a].x=f;break;case Ae.Y:this._coordinates[a].y=f;break;case Ae.Z:this._coordinates[a].z=f;break;default:throw new D("invalid ordinateIndex")}},ai.prototype.size=function(){return this._coordinates.length},ai.prototype.getOrdinate=function(a,u){switch(u){case Ae.X:return this._coordinates[a].x;case Ae.Y:return this._coordinates[a].y;case Ae.Z:return this._coordinates[a].z}return A.NaN},ai.prototype.getCoordinate=function(){if(arguments.length===1){var a=arguments[0];return this._coordinates[a]}if(arguments.length===2){var u=arguments[0],f=arguments[1];f.x=this._coordinates[u].x,f.y=this._coordinates[u].y,f.z=this._coordinates[u].z}},ai.prototype.getCoordinateCopy=function(a){return new N(this._coordinates[a])},ai.prototype.getDimension=function(){return this._dimension},ai.prototype.getX=function(a){return this._coordinates[a].x},ai.prototype.clone=function(){for(var a=new Array(this.size()).fill(null),u=0;u<this._coordinates.length;u++)a[u]=this._coordinates[u].clone();return new ai(a,this._dimension)},ai.prototype.expandEnvelope=function(a){for(var u=0;u<this._coordinates.length;u++)a.expandToInclude(this._coordinates[u]);return a},ai.prototype.copy=function(){for(var a=new Array(this.size()).fill(null),u=0;u<this._coordinates.length;u++)a[u]=this._coordinates[u].copy();return new ai(a,this._dimension)},ai.prototype.toString=function(){if(this._coordinates.length>0){var a=new Ue(17*this._coordinates.length);a.append("("),a.append(this._coordinates[0]);for(var u=1;u<this._coordinates.length;u++)a.append(", "),a.append(this._coordinates[u]);return a.append(")"),a.toString()}return"()"},ai.prototype.getY=function(a){return this._coordinates[a].y},ai.prototype.toCoordinateArray=function(){return this._coordinates},ai.prototype.interfaces_=function(){return[Ae,t]},ai.prototype.getClass=function(){return ai},WF.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ai,WF);var hu=o(function(){},"ce"),pE={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};hu.prototype.readResolve=function(){return hu.instance()},hu.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var a=arguments[0];return new ai(a)}if(ne(arguments[0],Ae)){var u=arguments[0];return new ai(u)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return m>3&&(m=3),m<2?new ai(f):new ai(f,m)}},hu.prototype.interfaces_=function(){return[se,t]},hu.prototype.getClass=function(){return hu},hu.instance=function(){return hu.instanceObject},pE.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},pE.instanceObject.get=function(){return new hu},Object.defineProperties(hu,pE);var XF=function(a){function u(){a.call(this),this.map_=new Map}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.get=function(f){return this.map_.get(f)||null},u.prototype.put=function(f,m){return this.map_.set(f,m),m},u.prototype.values=function(){for(var f=new He,m=this.map_.values(),v=m.next();!v.done;)f.add(v.value),v=m.next();return f},u.prototype.entrySet=function(){var f=new ge;return this.map_.entries().forEach(function(m){return f.add(m)}),f},u.prototype.size=function(){return this.map_.size()},u}(K),Mr=o(function a(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=a.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Il){var u=arguments[0];this._modelType=u,u===a.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var f=arguments[0];this._modelType=a.FIXED,this.setScale(f)}else if(arguments[0]instanceof a){var m=arguments[0];this._modelType=m._modelType,this._scale=m._scale}}},"t"),fE={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Mr.prototype.equals=function(a){if(!(a instanceof Mr))return!1;var u=a;return this._modelType===u._modelType&&this._scale===u._scale},Mr.prototype.compareTo=function(a){var u=a,f=this.getMaximumSignificantDigits(),m=u.getMaximumSignificantDigits();return new ve(f).compareTo(new ve(m))},Mr.prototype.getScale=function(){return this._scale},Mr.prototype.isFloating=function(){return this._modelType===Mr.FLOATING||this._modelType===Mr.FLOATING_SINGLE},Mr.prototype.getType=function(){return this._modelType},Mr.prototype.toString=function(){var a="UNKNOWN";return this._modelType===Mr.FLOATING?a="Floating":this._modelType===Mr.FLOATING_SINGLE?a="Floating-Single":this._modelType===Mr.FIXED&&(a="Fixed (Scale="+this.getScale()+")"),a},Mr.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var a=arguments[0];return A.isNaN(a)||this._modelType===Mr.FLOATING_SINGLE?a:this._modelType===Mr.FIXED?Math.round(a*this._scale)/this._scale:a}if(arguments[0]instanceof N){var u=arguments[0];if(this._modelType===Mr.FLOATING)return null;u.x=this.makePrecise(u.x),u.y=this.makePrecise(u.y)}},Mr.prototype.getMaximumSignificantDigits=function(){var a=16;return this._modelType===Mr.FLOATING?a=16:this._modelType===Mr.FLOATING_SINGLE?a=6:this._modelType===Mr.FIXED&&(a=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),a},Mr.prototype.setScale=function(a){this._scale=Math.abs(a)},Mr.prototype.interfaces_=function(){return[t,j]},Mr.prototype.getClass=function(){return Mr},Mr.mostPrecise=function(a,u){return a.compareTo(u)>=0?a:u},fE.serialVersionUID.get=function(){return 7777263578777804e3},fE.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Mr,fE);var Il=o(function a(u){this._name=u||null,a.nameToTypeMap.put(u,this)},"t"),dE={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Il.prototype.readResolve=function(){return Il.nameToTypeMap.get(this._name)},Il.prototype.toString=function(){return this._name},Il.prototype.interfaces_=function(){return[t]},Il.prototype.getClass=function(){return Il},dE.serialVersionUID.get=function(){return-552860263173159e4},dE.nameToTypeMap.get=function(){return new XF},Object.defineProperties(Il,dE),Mr.Type=Il,Mr.FIXED=new Il("FIXED"),Mr.FLOATING=new Il("FLOATING"),Mr.FLOATING_SINGLE=new Il("FLOATING SINGLE");var jt=o(function a(){this._precisionModel=new Mr,this._SRID=0,this._coordinateSequenceFactory=a.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?ne(arguments[0],se)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Mr&&(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"),YF={serialVersionUID:{configurable:!0}};jt.prototype.toGeometry=function(a){return a.isNull()?this.createPoint(null):a.getMinX()===a.getMaxX()&&a.getMinY()===a.getMaxY()?this.createPoint(new N(a.getMinX(),a.getMinY())):a.getMinX()===a.getMaxX()||a.getMinY()===a.getMaxY()?this.createLineString([new N(a.getMinX(),a.getMinY()),new N(a.getMaxX(),a.getMaxY())]):this.createPolygon(this.createLinearRing([new N(a.getMinX(),a.getMinY()),new N(a.getMinX(),a.getMaxY()),new N(a.getMaxX(),a.getMaxY()),new N(a.getMaxX(),a.getMinY()),new N(a.getMinX(),a.getMinY())]),null)},jt.prototype.createLineString=function(a){return a?a instanceof Array?new Gt(this.getCoordinateSequenceFactory().create(a),this):ne(a,Ae)?new Gt(a,this):void 0:new Gt(this.getCoordinateSequenceFactory().create([]),this)},jt.prototype.createMultiLineString=function(){if(arguments.length===0)return new dn(null,this);if(arguments.length===1){var a=arguments[0];return new dn(a,this)}},jt.prototype.buildGeometry=function(a){for(var u=null,f=!1,m=!1,v=a.iterator();v.hasNext();){var S=v.next(),M=S.getClass();u===null&&(u=M),M!==u&&(f=!0),S.isGeometryCollectionOrDerived()&&(m=!0)}if(u===null)return this.createGeometryCollection();if(f||m)return this.createGeometryCollection(jt.toGeometryArray(a));var B=a.iterator().next();if(a.size()>1){if(B instanceof Xr)return this.createMultiPolygon(jt.toPolygonArray(a));if(B instanceof Gt)return this.createMultiLineString(jt.toLineStringArray(a));if(B instanceof Gn)return this.createMultiPoint(jt.toPointArray(a));ot.shouldNeverReachHere("Unhandled class: "+B.getClass().getName())}return B},jt.prototype.createMultiPointFromCoords=function(a){return this.createMultiPoint(a!==null?this.getCoordinateSequenceFactory().create(a):null)},jt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof N){var a=arguments[0];return this.createPoint(a!==null?this.getCoordinateSequenceFactory().create([a]):null)}if(ne(arguments[0],Ae)){var u=arguments[0];return new Gn(u,this)}}},jt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},jt.prototype.createPolygon=function(){if(arguments.length===0)return new Xr(null,null,this);if(arguments.length===1){if(ne(arguments[0],Ae)){var a=arguments[0];return this.createPolygon(this.createLinearRing(a))}if(arguments[0]instanceof Array){var u=arguments[0];return this.createPolygon(this.createLinearRing(u))}if(arguments[0]instanceof os){var f=arguments[0];return this.createPolygon(f,null)}}else if(arguments.length===2){var m=arguments[0],v=arguments[1];return new Xr(m,v,this)}},jt.prototype.getSRID=function(){return this._SRID},jt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new xt(null,this);if(arguments.length===1){var a=arguments[0];return new xt(a,this)}},jt.prototype.createGeometry=function(a){return new Os(this).edit(a,{edit:o(function(){if(arguments.length===2){var u=arguments[0];return this._coordinateSequenceFactory.create(u)}},"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 a=arguments[0];return this.createLinearRing(a!==null?this.getCoordinateSequenceFactory().create(a):null)}if(ne(arguments[0],Ae)){var u=arguments[0];return new os(u,this)}}},jt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Ka(null,this);if(arguments.length===1){var a=arguments[0];return new Ka(a,this)}},jt.prototype.createMultiPoint=function(){if(arguments.length===0)return new Ms(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var a=arguments[0];return new Ms(a,this)}if(arguments[0]instanceof Array){var u=arguments[0];return this.createMultiPoint(u!==null?this.getCoordinateSequenceFactory().create(u):null)}if(ne(arguments[0],Ae)){var f=arguments[0];if(f===null)return this.createMultiPoint(new Array(0).fill(null));for(var m=new Array(f.size()).fill(null),v=0;v<f.size();v++){var S=this.getCoordinateSequenceFactory().create(1,f.getDimension());Qt.copy(f,v,S,0,1),m[v]=this.createPoint(S)}return this.createMultiPoint(m)}}},jt.prototype.interfaces_=function(){return[t]},jt.prototype.getClass=function(){return jt},jt.toMultiPolygonArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toGeometryArray=function(a){if(a===null)return null;var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.getDefaultCoordinateSequenceFactory=function(){return hu.instance()},jt.toMultiLineStringArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toLineStringArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toMultiPointArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toLinearRingArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toPointArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.toPolygonArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},jt.createPointFromInternalCoord=function(a,u){return u.getPrecisionModel().makePrecise(a),u.getFactory().createPoint(a)},YF.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(jt,YF);var Bse=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],K_=o(function(a){this.geometryFactory=a||new jt},"Ie");K_.prototype.read=function(a){var u,f=(u=typeof a=="string"?JSON.parse(a):a).type;if(!_l[f])throw new Error("Unknown GeoJSON type: "+u.type);return Bse.indexOf(f)!==-1?_l[f].apply(this,[u.coordinates]):f==="GeometryCollection"?_l[f].apply(this,[u.geometries]):_l[f].apply(this,[u])},K_.prototype.write=function(a){var u=a.getGeometryType();if(!bc[u])throw new Error("Geometry is not supported");return bc[u].apply(this,[a])};var _l={Feature:o(function(a){var u={};for(var f in a)u[f]=a[f];if(a.geometry){var m=a.geometry.type;if(!_l[m])throw new Error("Unknown GeoJSON type: "+a.type);u.geometry=this.read(a.geometry)}return a.bbox&&(u.bbox=_l.bbox.apply(this,[a.bbox])),u},"Feature"),FeatureCollection:o(function(a){var u={};if(a.features){u.features=[];for(var f=0;f<a.features.length;++f)u.features.push(this.read(a.features[f]))}return a.bbox&&(u.bbox=this.parse.bbox.apply(this,[a.bbox])),u},"FeatureCollection"),coordinates:o(function(a){for(var u=[],f=0;f<a.length;++f){var m=a[f];u.push(new N(m[0],m[1]))}return u},"coordinates"),bbox:o(function(a){return this.geometryFactory.createLinearRing([new N(a[0],a[1]),new N(a[2],a[1]),new N(a[2],a[3]),new N(a[0],a[3]),new N(a[0],a[1])])},"bbox"),Point:o(function(a){var u=new N(a[0],a[1]);return this.geometryFactory.createPoint(u)},"Point"),MultiPoint:o(function(a){for(var u=[],f=0;f<a.length;++f)u.push(_l.Point.apply(this,[a[f]]));return this.geometryFactory.createMultiPoint(u)},"MultiPoint"),LineString:o(function(a){var u=_l.coordinates.apply(this,[a]);return this.geometryFactory.createLineString(u)},"LineString"),MultiLineString:o(function(a){for(var u=[],f=0;f<a.length;++f)u.push(_l.LineString.apply(this,[a[f]]));return this.geometryFactory.createMultiLineString(u)},"MultiLineString"),Polygon:o(function(a){for(var u=_l.coordinates.apply(this,[a[0]]),f=this.geometryFactory.createLinearRing(u),m=[],v=1;v<a.length;++v){var S=a[v],M=_l.coordinates.apply(this,[S]),B=this.geometryFactory.createLinearRing(M);m.push(B)}return this.geometryFactory.createPolygon(f,m)},"Polygon"),MultiPolygon:o(function(a){for(var u=[],f=0;f<a.length;++f){var m=a[f];u.push(_l.Polygon.apply(this,[m]))}return this.geometryFactory.createMultiPolygon(u)},"MultiPolygon"),GeometryCollection:o(function(a){for(var u=[],f=0;f<a.length;++f){var m=a[f];u.push(this.read(m))}return this.geometryFactory.createGeometryCollection(u)},"GeometryCollection")},bc={coordinate:o(function(a){return[a.x,a.y]},"coordinate"),Point:o(function(a){return{type:"Point",coordinates:bc.coordinate.apply(this,[a.getCoordinate()])}},"Point"),MultiPoint:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=bc.Point.apply(this,[m]);u.push(v.coordinates)}return{type:"MultiPoint",coordinates:u}},"MultiPoint"),LineString:o(function(a){for(var u=[],f=a.getCoordinates(),m=0;m<f.length;++m){var v=f[m];u.push(bc.coordinate.apply(this,[v]))}return{type:"LineString",coordinates:u}},"LineString"),MultiLineString:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=bc.LineString.apply(this,[m]);u.push(v.coordinates)}return{type:"MultiLineString",coordinates:u}},"MultiLineString"),Polygon:o(function(a){var u=[],f=bc.LineString.apply(this,[a._shell]);u.push(f.coordinates);for(var m=0;m<a._holes.length;++m){var v=a._holes[m],S=bc.LineString.apply(this,[v]);u.push(S.coordinates)}return{type:"Polygon",coordinates:u}},"Polygon"),MultiPolygon:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=bc.Polygon.apply(this,[m]);u.push(v.coordinates)}return{type:"MultiPolygon",coordinates:u}},"MultiPolygon"),GeometryCollection:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=m.getGeometryType();u.push(bc[v].apply(this,[m]))}return{type:"GeometryCollection",geometries:u}},"GeometryCollection")},hE=o(function(a){this.geometryFactory=a||new jt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new K_(this.geometryFactory)},"Ne");hE.prototype.read=function(a){var u=this.parser.read(a);return this.precisionModel.getType()===Mr.FIXED&&this.reducePrecision(u),u},hE.prototype.reducePrecision=function(a){var u,f;if(a.coordinate)this.precisionModel.makePrecise(a.coordinate);else if(a.points)for(u=0,f=a.points.length;u<f;u++)this.precisionModel.makePrecise(a.points[u]);else if(a.geometries)for(u=0,f=a.geometries.length;u<f;u++)this.reducePrecision(a.geometries[u])};var ZF=o(function(){this.parser=new K_(this.geometryFactory)},"Ce");ZF.prototype.write=function(a){return this.parser.write(a)};var Ge=o(function(){},"Se"),J_={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.opposite=function(a){return a===Ge.LEFT?Ge.RIGHT:a===Ge.RIGHT?Ge.LEFT:a},J_.ON.get=function(){return 0},J_.LEFT.get=function(){return 1},J_.RIGHT.get=function(){return 2},Object.defineProperties(Ge,J_),(E.prototype=new Error).name="EmptyStackException",(w.prototype=new ns).add=function(a){return this.array_.push(a),!0},w.prototype.get=function(a){if(a<0||a>=this.size())throw new Error;return this.array_[a]},w.prototype.push=function(a){return this.array_.push(a),a},w.prototype.pop=function(a){if(this.array_.length===0)throw new E;return this.array_.pop()},w.prototype.peek=function(){if(this.array_.length===0)throw new E;return this.array_[this.array_.length-1]},w.prototype.empty=function(){return this.array_.length===0},w.prototype.isEmpty=function(){return this.empty()},w.prototype.search=function(a){return this.array_.indexOf(a)},w.prototype.size=function(){return this.array_.length},w.prototype.toArray=function(){for(var a=[],u=0,f=this.array_.length;u<f;u++)a.push(this.array_[u]);return a};var Sl=o(function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null},"be");Sl.prototype.getCoordinate=function(){return this._minCoord},Sl.prototype.getRightmostSide=function(a,u){var f=this.getRightmostSideOfSegment(a,u);return f<0&&(f=this.getRightmostSideOfSegment(a,u-1)),f<0&&(this._minCoord=null,this.checkForRightmostCoordinate(a)),f},Sl.prototype.findRightmostEdgeAtVertex=function(){var a=this._minDe.getEdge().getCoordinates();ot.isTrue(this._minIndex>0&&this._minIndex<a.length,"rightmost point expected to be interior vertex of edge");var u=a[this._minIndex-1],f=a[this._minIndex+1],m=ze.computeOrientation(this._minCoord,f,u),v=!1;(u.y<this._minCoord.y&&f.y<this._minCoord.y&&m===ze.COUNTERCLOCKWISE||u.y>this._minCoord.y&&f.y>this._minCoord.y&&m===ze.CLOCKWISE)&&(v=!0),v&&(this._minIndex=this._minIndex-1)},Sl.prototype.getRightmostSideOfSegment=function(a,u){var f=a.getEdge().getCoordinates();if(u<0||u+1>=f.length||f[u].y===f[u+1].y)return-1;var m=Ge.LEFT;return f[u].y<f[u+1].y&&(m=Ge.RIGHT),m},Sl.prototype.getEdge=function(){return this._orientedDe},Sl.prototype.checkForRightmostCoordinate=function(a){for(var u=a.getEdge().getCoordinates(),f=0;f<u.length-1;f++)(this._minCoord===null||u[f].x>this._minCoord.x)&&(this._minDe=a,this._minIndex=f,this._minCoord=u[f])},Sl.prototype.findRightmostEdgeAtNode=function(){var a=this._minDe.getNode().getEdges();this._minDe=a.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Sl.prototype.findEdge=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next();f.isForward()&&this.checkForRightmostCoordinate(f)}ot.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)===Ge.LEFT&&(this._orientedDe=this._minDe.getSym())},Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl};var xc=function(a){function u(f,m){a.call(this,u.msgWithCoord(f,m)),this.pt=m?new N(m):null,this.name="TopologyException"}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.getCoordinate=function(){return this.pt},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.msgWithCoord=function(f,m){return m?f:f+" [ "+m+" ]"},u}(Er),Q_=o(function(){this.array_=[]},"Oe");Q_.prototype.addLast=function(a){this.array_.push(a)},Q_.prototype.removeFirst=function(){return this.array_.shift()},Q_.prototype.isEmpty=function(){return this.array_.length===0};var Bo=o(function(){this._finder=null,this._dirEdgeList=new He,this._nodes=new He,this._rightMostCoord=null,this._env=null,this._finder=new Sl},"Te");Bo.prototype.clearVisitedEdges=function(){for(var a=this._dirEdgeList.iterator();a.hasNext();)a.next().setVisited(!1)},Bo.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Bo.prototype.computeNodeDepth=function(a){for(var u=null,f=a.getEdges().iterator();f.hasNext();){var m=f.next();if(m.isVisited()||m.getSym().isVisited()){u=m;break}}if(u===null)throw new xc("unable to find edge to compute depths at "+a.getCoordinate());a.getEdges().computeDepths(u);for(var v=a.getEdges().iterator();v.hasNext();){var S=v.next();S.setVisited(!0),this.copySymDepths(S)}},Bo.prototype.computeDepth=function(a){this.clearVisitedEdges();var u=this._finder.getEdge();u.setEdgeDepths(Ge.RIGHT,a),this.copySymDepths(u),this.computeDepths(u)},Bo.prototype.create=function(a){this.addReachable(a),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Bo.prototype.findResultEdges=function(){for(var a=this._dirEdgeList.iterator();a.hasNext();){var u=a.next();u.getDepth(Ge.RIGHT)>=1&&u.getDepth(Ge.LEFT)<=0&&!u.isInteriorAreaEdge()&&u.setInResult(!0)}},Bo.prototype.computeDepths=function(a){var u=new ge,f=new Q_,m=a.getNode();for(f.addLast(m),u.add(m),a.setVisited(!0);!f.isEmpty();){var v=f.removeFirst();u.add(v),this.computeNodeDepth(v);for(var S=v.getEdges().iterator();S.hasNext();){var M=S.next().getSym();if(!M.isVisited()){var B=M.getNode();u.contains(B)||(f.addLast(B),u.add(B))}}}},Bo.prototype.compareTo=function(a){var u=a;return this._rightMostCoord.x<u._rightMostCoord.x?-1:this._rightMostCoord.x>u._rightMostCoord.x?1:0},Bo.prototype.getEnvelope=function(){if(this._env===null){for(var a=new ie,u=this._dirEdgeList.iterator();u.hasNext();)for(var f=u.next().getEdge().getCoordinates(),m=0;m<f.length-1;m++)a.expandToInclude(f[m]);this._env=a}return this._env},Bo.prototype.addReachable=function(a){var u=new w;for(u.add(a);!u.empty();){var f=u.pop();this.add(f,u)}},Bo.prototype.copySymDepths=function(a){var u=a.getSym();u.setDepth(Ge.LEFT,a.getDepth(Ge.RIGHT)),u.setDepth(Ge.RIGHT,a.getDepth(Ge.LEFT))},Bo.prototype.add=function(a,u){a.setVisited(!0),this._nodes.add(a);for(var f=a.getEdges().iterator();f.hasNext();){var m=f.next();this._dirEdgeList.add(m);var v=m.getSym().getNode();v.isVisited()||u.push(v)}},Bo.prototype.getNodes=function(){return this._nodes},Bo.prototype.getDirectedEdges=function(){return this._dirEdgeList},Bo.prototype.interfaces_=function(){return[j]},Bo.prototype.getClass=function(){return Bo};var Cn=o(function a(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var u=arguments[0];this.init(u.length)}else if(Number.isInteger(arguments[0])){var f=arguments[0];this.init(1),this.location[Ge.ON]=f}else if(arguments[0]instanceof a){var m=arguments[0];if(this.init(m.location.length),m!==null)for(var v=0;v<this.location.length;v++)this.location[v]=m.location[v]}}else if(arguments.length===3){var S=arguments[0],M=arguments[1],B=arguments[2];this.init(3),this.location[Ge.ON]=S,this.location[Ge.LEFT]=M,this.location[Ge.RIGHT]=B}},"t");Cn.prototype.setAllLocations=function(a){for(var u=0;u<this.location.length;u++)this.location[u]=a},Cn.prototype.isNull=function(){for(var a=0;a<this.location.length;a++)if(this.location[a]!==U.NONE)return!1;return!0},Cn.prototype.setAllLocationsIfNull=function(a){for(var u=0;u<this.location.length;u++)this.location[u]===U.NONE&&(this.location[u]=a)},Cn.prototype.isLine=function(){return this.location.length===1},Cn.prototype.merge=function(a){if(a.location.length>this.location.length){var u=new Array(3).fill(null);u[Ge.ON]=this.location[Ge.ON],u[Ge.LEFT]=U.NONE,u[Ge.RIGHT]=U.NONE,this.location=u}for(var f=0;f<this.location.length;f++)this.location[f]===U.NONE&&f<a.location.length&&(this.location[f]=a.location[f])},Cn.prototype.getLocations=function(){return this.location},Cn.prototype.flip=function(){if(this.location.length<=1)return null;var a=this.location[Ge.LEFT];this.location[Ge.LEFT]=this.location[Ge.RIGHT],this.location[Ge.RIGHT]=a},Cn.prototype.toString=function(){var a=new Ue;return this.location.length>1&&a.append(U.toLocationSymbol(this.location[Ge.LEFT])),a.append(U.toLocationSymbol(this.location[Ge.ON])),this.location.length>1&&a.append(U.toLocationSymbol(this.location[Ge.RIGHT])),a.toString()},Cn.prototype.setLocations=function(a,u,f){this.location[Ge.ON]=a,this.location[Ge.LEFT]=u,this.location[Ge.RIGHT]=f},Cn.prototype.get=function(a){return a<this.location.length?this.location[a]:U.NONE},Cn.prototype.isArea=function(){return this.location.length>1},Cn.prototype.isAnyNull=function(){for(var a=0;a<this.location.length;a++)if(this.location[a]===U.NONE)return!0;return!1},Cn.prototype.setLocation=function(){if(arguments.length===1){var a=arguments[0];this.setLocation(Ge.ON,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this.location[u]=f}},Cn.prototype.init=function(a){this.location=new Array(a).fill(null),this.setAllLocations(U.NONE)},Cn.prototype.isEqualOnSide=function(a,u){return this.location[u]===a.location[u]},Cn.prototype.allPositionsEqual=function(a){for(var u=0;u<this.location.length;u++)if(this.location[u]!==a)return!1;return!0},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn};var Yr=o(function a(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var u=arguments[0];this.elt[0]=new Cn(u),this.elt[1]=new Cn(u)}else if(arguments[0]instanceof a){var f=arguments[0];this.elt[0]=new Cn(f.elt[0]),this.elt[1]=new Cn(f.elt[1])}}else if(arguments.length===2){var m=arguments[0],v=arguments[1];this.elt[0]=new Cn(U.NONE),this.elt[1]=new Cn(U.NONE),this.elt[m].setLocation(v)}else if(arguments.length===3){var S=arguments[0],M=arguments[1],B=arguments[2];this.elt[0]=new Cn(S,M,B),this.elt[1]=new Cn(S,M,B)}else if(arguments.length===4){var z=arguments[0],te=arguments[1],pe=arguments[2],be=arguments[3];this.elt[0]=new Cn(U.NONE,U.NONE,U.NONE),this.elt[1]=new Cn(U.NONE,U.NONE,U.NONE),this.elt[z].setLocations(te,pe,be)}},"t");Yr.prototype.getGeometryCount=function(){var a=0;return this.elt[0].isNull()||a++,this.elt[1].isNull()||a++,a},Yr.prototype.setAllLocations=function(a,u){this.elt[a].setAllLocations(u)},Yr.prototype.isNull=function(a){return this.elt[a].isNull()},Yr.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var a=arguments[0];this.setAllLocationsIfNull(0,a),this.setAllLocationsIfNull(1,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this.elt[u].setAllLocationsIfNull(f)}},Yr.prototype.isLine=function(a){return this.elt[a].isLine()},Yr.prototype.merge=function(a){for(var u=0;u<2;u++)this.elt[u]===null&&a.elt[u]!==null?this.elt[u]=new Cn(a.elt[u]):this.elt[u].merge(a.elt[u])},Yr.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Yr.prototype.getLocation=function(){if(arguments.length===1){var a=arguments[0];return this.elt[a].get(Ge.ON)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return this.elt[u].get(f)}},Yr.prototype.toString=function(){var a=new Ue;return this.elt[0]!==null&&(a.append("A:"),a.append(this.elt[0].toString())),this.elt[1]!==null&&(a.append(" B:"),a.append(this.elt[1].toString())),a.toString()},Yr.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var a=arguments[0];return this.elt[a].isArea()}},Yr.prototype.isAnyNull=function(a){return this.elt[a].isAnyNull()},Yr.prototype.setLocation=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];this.elt[a].setLocation(Ge.ON,u)}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this.elt[f].setLocation(m,v)}},Yr.prototype.isEqualOnSide=function(a,u){return this.elt[0].isEqualOnSide(a.elt[0],u)&&this.elt[1].isEqualOnSide(a.elt[1],u)},Yr.prototype.allPositionsEqual=function(a,u){return this.elt[a].allPositionsEqual(u)},Yr.prototype.toLine=function(a){this.elt[a].isArea()&&(this.elt[a]=new Cn(this.elt[a].location[0]))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.toLineLabel=function(a){for(var u=new Yr(U.NONE),f=0;f<2;f++)u.setLocation(f,a.getLocation(f));return u};var vi=o(function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new He,this._pts=new He,this._label=new Yr(U.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new He,this._geometryFactory=null;var a=arguments[0],u=arguments[1];this._geometryFactory=u,this.computePoints(a),this.computeRing()},"De");vi.prototype.computeRing=function(){if(this._ring!==null)return null;for(var a=new Array(this._pts.size()).fill(null),u=0;u<this._pts.size();u++)a[u]=this._pts.get(u);this._ring=this._geometryFactory.createLinearRing(a),this._isHole=ze.isCCW(this._ring.getCoordinates())},vi.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},vi.prototype.computePoints=function(a){this._startDe=a;var u=a,f=!0;do{if(u===null)throw new xc("Found null DirectedEdge");if(u.getEdgeRing()===this)throw new xc("Directed Edge visited twice during ring-building at "+u.getCoordinate());this._edges.add(u);var m=u.getLabel();ot.isTrue(m.isArea()),this.mergeLabel(m),this.addPoints(u.getEdge(),u.isForward(),f),f=!1,this.setEdgeRing(u,this),u=this.getNext(u)}while(u!==this._startDe)},vi.prototype.getLinearRing=function(){return this._ring},vi.prototype.getCoordinate=function(a){return this._pts.get(a)},vi.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var a=this._startDe;do{var u=a.getNode().getEdges().getOutgoingDegree(this);u>this._maxNodeDegree&&(this._maxNodeDegree=u),a=this.getNext(a)}while(a!==this._startDe);this._maxNodeDegree*=2},vi.prototype.addPoints=function(a,u,f){var m=a.getCoordinates();if(u){var v=1;f&&(v=0);for(var S=v;S<m.length;S++)this._pts.add(m[S])}else{var M=m.length-2;f&&(M=m.length-1);for(var B=M;B>=0;B--)this._pts.add(m[B])}},vi.prototype.isHole=function(){return this._isHole},vi.prototype.setInResult=function(){var a=this._startDe;do a.getEdge().setInResult(!0),a=a.getNext();while(a!==this._startDe)},vi.prototype.containsPoint=function(a){var u=this.getLinearRing();if(!u.getEnvelopeInternal().contains(a)||!ze.isPointInRing(a,u.getCoordinates()))return!1;for(var f=this._holes.iterator();f.hasNext();)if(f.next().containsPoint(a))return!1;return!0},vi.prototype.addHole=function(a){this._holes.add(a)},vi.prototype.isShell=function(){return this._shell===null},vi.prototype.getLabel=function(){return this._label},vi.prototype.getEdges=function(){return this._edges},vi.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},vi.prototype.getShell=function(){return this._shell},vi.prototype.mergeLabel=function(){if(arguments.length===1){var a=arguments[0];this.mergeLabel(a,0),this.mergeLabel(a,1)}else if(arguments.length===2){var u=arguments[0],f=arguments[1],m=u.getLocation(f,Ge.RIGHT);if(m===U.NONE)return null;if(this._label.getLocation(f)===U.NONE)return this._label.setLocation(f,m),null}},vi.prototype.setShell=function(a){this._shell=a,a!==null&&a.addHole(this)},vi.prototype.toPolygon=function(a){for(var u=new Array(this._holes.size()).fill(null),f=0;f<this._holes.size();f++)u[f]=this._holes.get(f).getLinearRing();return a.createPolygon(this.getLinearRing(),u)},vi.prototype.interfaces_=function(){return[]},vi.prototype.getClass=function(){return vi};var jse=function(a){function u(){var f=arguments[0],m=arguments[1];a.call(this,f,m)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.setEdgeRing=function(f,m){f.setMinEdgeRing(m)},u.prototype.getNext=function(f){return f.getNextMin()},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(vi),$se=function(a){function u(){var f=arguments[0],m=arguments[1];a.call(this,f,m)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.buildMinimalRings=function(){var f=new He,m=this._startDe;do{if(m.getMinEdgeRing()===null){var v=new jse(m,this._geometryFactory);f.add(v)}m=m.getNext()}while(m!==this._startDe);return f},u.prototype.setEdgeRing=function(f,m){f.setEdgeRing(m)},u.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var f=this._startDe;do f.getNode().getEdges().linkMinimalDirectedEdges(this),f=f.getNext();while(f!==this._startDe)},u.prototype.getNext=function(f){return f.getNext()},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(vi),ea=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 a=arguments[0];this._label=a}}},"Fe");ea.prototype.setVisited=function(a){this._isVisited=a},ea.prototype.setInResult=function(a){this._isInResult=a},ea.prototype.isCovered=function(){return this._isCovered},ea.prototype.isCoveredSet=function(){return this._isCoveredSet},ea.prototype.setLabel=function(a){this._label=a},ea.prototype.getLabel=function(){return this._label},ea.prototype.setCovered=function(a){this._isCovered=a,this._isCoveredSet=!0},ea.prototype.updateIM=function(a){ot.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(a)},ea.prototype.isInResult=function(){return this._isInResult},ea.prototype.isVisited=function(){return this._isVisited},ea.prototype.interfaces_=function(){return[]},ea.prototype.getClass=function(){return ea};var eS=function(a){function u(){a.call(this),this._coord=null,this._edges=null;var f=arguments[0],m=arguments[1];this._coord=f,this._edges=m,this._label=new Yr(0,U.NONE)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.isIncidentEdgeInResult=function(){for(var f=this.getEdges().getEdges().iterator();f.hasNext();)if(f.next().getEdge().isInResult())return!0;return!1},u.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},u.prototype.getCoordinate=function(){return this._coord},u.prototype.print=function(f){f.println("node "+this._coord+" lbl: "+this._label)},u.prototype.computeIM=function(f){},u.prototype.computeMergedLocation=function(f,m){var v=U.NONE;if(v=this._label.getLocation(m),!f.isNull(m)){var S=f.getLocation(m);v!==U.BOUNDARY&&(v=S)}return v},u.prototype.setLabel=function(){if(arguments.length!==2)return a.prototype.setLabel.apply(this,arguments);var f=arguments[0],m=arguments[1];this._label===null?this._label=new Yr(f,m):this._label.setLocation(f,m)},u.prototype.getEdges=function(){return this._edges},u.prototype.mergeLabel=function(){if(arguments[0]instanceof u){var f=arguments[0];this.mergeLabel(f._label)}else if(arguments[0]instanceof Yr)for(var m=arguments[0],v=0;v<2;v++){var S=this.computeMergedLocation(m,v);this._label.getLocation(v)===U.NONE&&this._label.setLocation(v,S)}},u.prototype.add=function(f){this._edges.insert(f),f.setNode(this)},u.prototype.setLabelBoundary=function(f){if(this._label===null)return null;var m=U.NONE;this._label!==null&&(m=this._label.getLocation(f));var v=null;switch(m){case U.BOUNDARY:v=U.INTERIOR;break;case U.INTERIOR:default:v=U.BOUNDARY}this._label.setLocation(f,v)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(ea),Cl=o(function(){this.nodeMap=new b,this.nodeFact=null;var a=arguments[0];this.nodeFact=a},"qe");Cl.prototype.find=function(a){return this.nodeMap.get(a)},Cl.prototype.addNode=function(){if(arguments[0]instanceof N){var a=arguments[0],u=this.nodeMap.get(a);return u===null&&(u=this.nodeFact.createNode(a),this.nodeMap.put(a,u)),u}if(arguments[0]instanceof eS){var f=arguments[0],m=this.nodeMap.get(f.getCoordinate());return m===null?(this.nodeMap.put(f.getCoordinate(),f),f):(m.mergeLabel(f),m)}},Cl.prototype.print=function(a){for(var u=this.iterator();u.hasNext();)u.next().print(a)},Cl.prototype.iterator=function(){return this.nodeMap.values().iterator()},Cl.prototype.values=function(){return this.nodeMap.values()},Cl.prototype.getBoundaryNodes=function(a){for(var u=new He,f=this.iterator();f.hasNext();){var m=f.next();m.getLabel().getLocation(a)===U.BOUNDARY&&u.add(m)}return u},Cl.prototype.add=function(a){var u=a.getCoordinate();this.addNode(u).add(a)},Cl.prototype.interfaces_=function(){return[]},Cl.prototype.getClass=function(){return Cl};var hn=o(function(){},"Be"),Sb={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn},hn.isNorthern=function(a){return a===hn.NE||a===hn.NW},hn.isOpposite=function(a,u){return a===u?!1:(a-u+4)%4===2},hn.commonHalfPlane=function(a,u){if(a===u)return a;if((a-u+4)%4===2)return-1;var f=a<u?a:u;return f===0&&(a>u?a:u)===3?3:f},hn.isInHalfPlane=function(a,u){return u===hn.SE?a===hn.SE||a===hn.SW:a===u||a===u+1},hn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var a=arguments[0],u=arguments[1];if(a===0&&u===0)throw new D("Cannot compute the quadrant for point ( "+a+", "+u+" )");return a>=0?u>=0?hn.NE:hn.SE:u>=0?hn.NW:hn.SW}if(arguments[0]instanceof N&&arguments[1]instanceof N){var f=arguments[0],m=arguments[1];if(m.x===f.x&&m.y===f.y)throw new D("Cannot compute the quadrant for two identical points "+f);return m.x>=f.x?m.y>=f.y?hn.NE:hn.SE:m.y>=f.y?hn.NW:hn.SW}},Sb.NE.get=function(){return 0},Sb.NW.get=function(){return 1},Sb.SW.get=function(){return 2},Sb.SE.get=function(){return 3},Object.defineProperties(hn,Sb);var bo=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 a=arguments[0];this._edge=a}else if(arguments.length===3){var u=arguments[0],f=arguments[1],m=arguments[2];this._edge=u,this.init(f,m),this._label=null}else if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],B=arguments[3];this._edge=v,this.init(S,M),this._label=B}},"Ue");bo.prototype.compareDirection=function(a){return this._dx===a._dx&&this._dy===a._dy?0:this._quadrant>a._quadrant?1:this._quadrant<a._quadrant?-1:ze.computeOrientation(a._p0,a._p1,this._p1)},bo.prototype.getDy=function(){return this._dy},bo.prototype.getCoordinate=function(){return this._p0},bo.prototype.setNode=function(a){this._node=a},bo.prototype.print=function(a){var u=Math.atan2(this._dy,this._dx),f=this.getClass().getName(),m=f.lastIndexOf("."),v=f.substring(m+1);a.print(" "+v+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+u+" "+this._label)},bo.prototype.compareTo=function(a){var u=a;return this.compareDirection(u)},bo.prototype.getDirectedCoordinate=function(){return this._p1},bo.prototype.getDx=function(){return this._dx},bo.prototype.getLabel=function(){return this._label},bo.prototype.getEdge=function(){return this._edge},bo.prototype.getQuadrant=function(){return this._quadrant},bo.prototype.getNode=function(){return this._node},bo.prototype.toString=function(){var a=Math.atan2(this._dy,this._dx),u=this.getClass().getName(),f=u.lastIndexOf(".");return" "+u.substring(f+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+a+" "+this._label},bo.prototype.computeLabel=function(a){},bo.prototype.init=function(a,u){this._p0=a,this._p1=u,this._dx=u.x-a.x,this._dy=u.y-a.y,this._quadrant=hn.quadrant(this._dx,this._dy),ot.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},bo.prototype.interfaces_=function(){return[j]},bo.prototype.getClass=function(){return bo};var mE=function(a){function u(){var f=arguments[0],m=arguments[1];if(a.call(this,f),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=m,m)this.init(f.getCoordinate(0),f.getCoordinate(1));else{var v=f.getNumPoints()-1;this.init(f.getCoordinate(v),f.getCoordinate(v-1))}this.computeDirectedLabel()}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.getNextMin=function(){return this._nextMin},u.prototype.getDepth=function(f){return this._depth[f]},u.prototype.setVisited=function(f){this._isVisited=f},u.prototype.computeDirectedLabel=function(){this._label=new Yr(this._edge.getLabel()),this._isForward||this._label.flip()},u.prototype.getNext=function(){return this._next},u.prototype.setDepth=function(f,m){if(this._depth[f]!==-999&&this._depth[f]!==m)throw new xc("assigned depths do not match",this.getCoordinate());this._depth[f]=m},u.prototype.isInteriorAreaEdge=function(){for(var f=!0,m=0;m<2;m++)this._label.isArea(m)&&this._label.getLocation(m,Ge.LEFT)===U.INTERIOR&&this._label.getLocation(m,Ge.RIGHT)===U.INTERIOR||(f=!1);return f},u.prototype.setNextMin=function(f){this._nextMin=f},u.prototype.print=function(f){a.prototype.print.call(this,f),f.print(" "+this._depth[Ge.LEFT]+"/"+this._depth[Ge.RIGHT]),f.print(" ("+this.getDepthDelta()+")"),this._isInResult&&f.print(" inResult")},u.prototype.setMinEdgeRing=function(f){this._minEdgeRing=f},u.prototype.isLineEdge=function(){var f=this._label.isLine(0)||this._label.isLine(1),m=!this._label.isArea(0)||this._label.allPositionsEqual(0,U.EXTERIOR),v=!this._label.isArea(1)||this._label.allPositionsEqual(1,U.EXTERIOR);return f&&m&&v},u.prototype.setEdgeRing=function(f){this._edgeRing=f},u.prototype.getMinEdgeRing=function(){return this._minEdgeRing},u.prototype.getDepthDelta=function(){var f=this._edge.getDepthDelta();return this._isForward||(f=-f),f},u.prototype.setInResult=function(f){this._isInResult=f},u.prototype.getSym=function(){return this._sym},u.prototype.isForward=function(){return this._isForward},u.prototype.getEdge=function(){return this._edge},u.prototype.printEdge=function(f){this.print(f),f.print(" "),this._isForward?this._edge.print(f):this._edge.printReverse(f)},u.prototype.setSym=function(f){this._sym=f},u.prototype.setVisitedEdge=function(f){this.setVisited(f),this._sym.setVisited(f)},u.prototype.setEdgeDepths=function(f,m){var v=this.getEdge().getDepthDelta();this._isForward||(v=-v);var S=1;f===Ge.LEFT&&(S=-1);var M=Ge.opposite(f),B=m+v*S;this.setDepth(f,m),this.setDepth(M,B)},u.prototype.getEdgeRing=function(){return this._edgeRing},u.prototype.isInResult=function(){return this._isInResult},u.prototype.setNext=function(f){this._next=f},u.prototype.isVisited=function(){return this._isVisited},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.depthFactor=function(f,m){return f===U.EXTERIOR&&m===U.INTERIOR?1:f===U.INTERIOR&&m===U.EXTERIOR?-1:0},u}(bo),Xy=o(function(){},"Xe");Xy.prototype.createNode=function(a){return new eS(a,null)},Xy.prototype.interfaces_=function(){return[]},Xy.prototype.getClass=function(){return Xy};var Zn=o(function(){if(this._edges=new He,this._nodes=null,this._edgeEndList=new He,arguments.length===0)this._nodes=new Cl(new Xy);else if(arguments.length===1){var a=arguments[0];this._nodes=new Cl(a)}},"Ye");Zn.prototype.printEdges=function(a){a.println("Edges:");for(var u=0;u<this._edges.size();u++){a.println("edge "+u+":");var f=this._edges.get(u);f.print(a),f.eiList.print(a)}},Zn.prototype.find=function(a){return this._nodes.find(a)},Zn.prototype.addNode=function(){if(arguments[0]instanceof eS){var a=arguments[0];return this._nodes.addNode(a)}if(arguments[0]instanceof N){var u=arguments[0];return this._nodes.addNode(u)}},Zn.prototype.getNodeIterator=function(){return this._nodes.iterator()},Zn.prototype.linkResultDirectedEdges=function(){for(var a=this._nodes.iterator();a.hasNext();)a.next().getEdges().linkResultDirectedEdges()},Zn.prototype.debugPrintln=function(a){we.out.println(a)},Zn.prototype.isBoundaryNode=function(a,u){var f=this._nodes.find(u);if(f===null)return!1;var m=f.getLabel();return m!==null&&m.getLocation(a)===U.BOUNDARY},Zn.prototype.linkAllDirectedEdges=function(){for(var a=this._nodes.iterator();a.hasNext();)a.next().getEdges().linkAllDirectedEdges()},Zn.prototype.matchInSameDirection=function(a,u,f,m){return!!a.equals(f)&&ze.computeOrientation(a,u,m)===ze.COLLINEAR&&hn.quadrant(a,u)===hn.quadrant(f,m)},Zn.prototype.getEdgeEnds=function(){return this._edgeEndList},Zn.prototype.debugPrint=function(a){we.out.print(a)},Zn.prototype.getEdgeIterator=function(){return this._edges.iterator()},Zn.prototype.findEdgeInSameDirection=function(a,u){for(var f=0;f<this._edges.size();f++){var m=this._edges.get(f),v=m.getCoordinates();if(this.matchInSameDirection(a,u,v[0],v[1])||this.matchInSameDirection(a,u,v[v.length-1],v[v.length-2]))return m}return null},Zn.prototype.insertEdge=function(a){this._edges.add(a)},Zn.prototype.findEdgeEnd=function(a){for(var u=this.getEdgeEnds().iterator();u.hasNext();){var f=u.next();if(f.getEdge()===a)return f}return null},Zn.prototype.addEdges=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next();this._edges.add(f);var m=new mE(f,!0),v=new mE(f,!1);m.setSym(v),v.setSym(m),this.add(m),this.add(v)}},Zn.prototype.add=function(a){this._nodes.add(a),this._edgeEndList.add(a)},Zn.prototype.getNodes=function(){return this._nodes.values()},Zn.prototype.findEdge=function(a,u){for(var f=0;f<this._edges.size();f++){var m=this._edges.get(f),v=m.getCoordinates();if(a.equals(v[0])&&u.equals(v[1]))return m}return null},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Zn.linkResultDirectedEdges=function(a){for(var u=a.iterator();u.hasNext();)u.next().getEdges().linkResultDirectedEdges()};var Ls=o(function(){this._geometryFactory=null,this._shellList=new He;var a=arguments[0];this._geometryFactory=a},"ke");Ls.prototype.sortShellsAndHoles=function(a,u,f){for(var m=a.iterator();m.hasNext();){var v=m.next();v.isHole()?f.add(v):u.add(v)}},Ls.prototype.computePolygons=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next().toPolygon(this._geometryFactory);u.add(m)}return u},Ls.prototype.placeFreeHoles=function(a,u){for(var f=u.iterator();f.hasNext();){var m=f.next();if(m.getShell()===null){var v=this.findEdgeRingContaining(m,a);if(v===null)throw new xc("unable to assign hole to a shell",m.getCoordinate(0));m.setShell(v)}}},Ls.prototype.buildMinimalEdgeRings=function(a,u,f){for(var m=new He,v=a.iterator();v.hasNext();){var S=v.next();if(S.getMaxNodeDegree()>2){S.linkDirectedEdgesForMinimalEdgeRings();var M=S.buildMinimalRings(),B=this.findShell(M);B!==null?(this.placePolygonHoles(B,M),u.add(B)):f.addAll(M)}else m.add(S)}return m},Ls.prototype.containsPoint=function(a){for(var u=this._shellList.iterator();u.hasNext();)if(u.next().containsPoint(a))return!0;return!1},Ls.prototype.buildMaximalEdgeRings=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next();if(m.isInResult()&&m.getLabel().isArea()&&m.getEdgeRing()===null){var v=new $se(m,this._geometryFactory);u.add(v),v.setInResult()}}return u},Ls.prototype.placePolygonHoles=function(a,u){for(var f=u.iterator();f.hasNext();){var m=f.next();m.isHole()&&m.setShell(a)}},Ls.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ls.prototype.findEdgeRingContaining=function(a,u){for(var f=a.getLinearRing(),m=f.getEnvelopeInternal(),v=f.getCoordinateN(0),S=null,M=null,B=u.iterator();B.hasNext();){var z=B.next(),te=z.getLinearRing(),pe=te.getEnvelopeInternal();S!==null&&(M=S.getLinearRing().getEnvelopeInternal());var be=!1;pe.contains(m)&&ze.isPointInRing(v,te.getCoordinates())&&(be=!0),be&&(S===null||M.contains(pe))&&(S=z)}return S},Ls.prototype.findShell=function(a){for(var u=0,f=null,m=a.iterator();m.hasNext();){var v=m.next();v.isHole()||(f=v,u++)}return ot.isTrue(u<=1,"found two shells in MinimalEdgeRing list"),f},Ls.prototype.add=function(){if(arguments.length===1){var a=arguments[0];this.add(a.getEdgeEnds(),a.getNodes())}else if(arguments.length===2){var u=arguments[0],f=arguments[1];Zn.linkResultDirectedEdges(f);var m=this.buildMaximalEdgeRings(u),v=new He,S=this.buildMinimalEdgeRings(m,this._shellList,v);this.sortShellsAndHoles(S,this._shellList,v),this.placeFreeHoles(this._shellList,v)}},Ls.prototype.interfaces_=function(){return[]},Ls.prototype.getClass=function(){return Ls};var Yy=o(function(){},"je");Yy.prototype.getBounds=function(){},Yy.prototype.interfaces_=function(){return[]},Yy.prototype.getClass=function(){return Yy};var Ja=o(function(){this._bounds=null,this._item=null;var a=arguments[0],u=arguments[1];this._bounds=a,this._item=u},"He");Ja.prototype.getItem=function(){return this._item},Ja.prototype.getBounds=function(){return this._bounds},Ja.prototype.interfaces_=function(){return[Yy,t]},Ja.prototype.getClass=function(){return Ja};var Ic=o(function(){this._size=null,this._items=null,this._size=0,this._items=new He,this._items.add(null)},"We");Ic.prototype.poll=function(){if(this.isEmpty())return null;var a=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),a},Ic.prototype.size=function(){return this._size},Ic.prototype.reorder=function(a){for(var u=null,f=this._items.get(a);2*a<=this._size&&((u=2*a)!==this._size&&this._items.get(u+1).compareTo(this._items.get(u))<0&&u++,this._items.get(u).compareTo(f)<0);a=u)this._items.set(a,this._items.get(u));this._items.set(a,f)},Ic.prototype.clear=function(){this._size=0,this._items.clear()},Ic.prototype.isEmpty=function(){return this._size===0},Ic.prototype.add=function(a){this._items.add(null),this._size+=1;var u=this._size;for(this._items.set(0,a);a.compareTo(this._items.get(Math.trunc(u/2)))<0;u/=2)this._items.set(u,this._items.get(Math.trunc(u/2)));this._items.set(u,a)},Ic.prototype.interfaces_=function(){return[]},Ic.prototype.getClass=function(){return Ic};var Bp=o(function(){},"Ke");Bp.prototype.visitItem=function(a){},Bp.prototype.interfaces_=function(){return[]},Bp.prototype.getClass=function(){return Bp};var Jh=o(function(){},"Je");Jh.prototype.insert=function(a,u){},Jh.prototype.remove=function(a,u){},Jh.prototype.query=function(){},Jh.prototype.interfaces_=function(){return[]},Jh.prototype.getClass=function(){return Jh};var Ei=o(function(){if(this._childBoundables=new He,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var a=arguments[0];this._level=a}}},"Qe"),KF={serialVersionUID:{configurable:!0}};Ei.prototype.getLevel=function(){return this._level},Ei.prototype.size=function(){return this._childBoundables.size()},Ei.prototype.getChildBoundables=function(){return this._childBoundables},Ei.prototype.addChildBoundable=function(a){ot.isTrue(this._bounds===null),this._childBoundables.add(a)},Ei.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ei.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ei.prototype.interfaces_=function(){return[Yy,t]},Ei.prototype.getClass=function(){return Ei},KF.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ei,KF);var Qa=o(function(){},"$e");Qa.reverseOrder=function(){return{compare:o(function(a,u){return u.compareTo(a)},"compare")}},Qa.min=function(a){return Qa.sort(a),a.get(0)},Qa.sort=function(a,u){var f=a.toArray();u?Fe.sort(f,u):Fe.sort(f);for(var m=a.iterator(),v=0,S=f.length;v<S;v++)m.next(),m.set(f[v])},Qa.singletonList=function(a){var u=new He;return u.add(a),u};var bi=o(function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var a=arguments[0],u=arguments[1],f=arguments[2];this._boundable1=a,this._boundable2=u,this._itemDistance=f,this._distance=this.distance()},"tn");bi.prototype.expandToQueue=function(a,u){var f=bi.isComposite(this._boundable1),m=bi.isComposite(this._boundable2);if(f&&m)return bi.area(this._boundable1)>bi.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,a,u),null):(this.expand(this._boundable2,this._boundable1,a,u),null);if(f)return this.expand(this._boundable1,this._boundable2,a,u),null;if(m)return this.expand(this._boundable2,this._boundable1,a,u),null;throw new D("neither boundable is composite")},bi.prototype.isLeaves=function(){return!(bi.isComposite(this._boundable1)||bi.isComposite(this._boundable2))},bi.prototype.compareTo=function(a){var u=a;return this._distance<u._distance?-1:this._distance>u._distance?1:0},bi.prototype.expand=function(a,u,f,m){for(var v=a.getChildBoundables().iterator();v.hasNext();){var S=v.next(),M=new bi(S,u,this._itemDistance);M.getDistance()<m&&f.add(M)}},bi.prototype.getBoundable=function(a){return a===0?this._boundable1:this._boundable2},bi.prototype.getDistance=function(){return this._distance},bi.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},bi.prototype.interfaces_=function(){return[j]},bi.prototype.getClass=function(){return bi},bi.area=function(a){return a.getBounds().getArea()},bi.isComposite=function(a){return a instanceof Ei};var Wi=o(function a(){if(this._root=null,this._built=!1,this._itemBoundables=new He,this._nodeCapacity=null,arguments.length===0){var u=a.DEFAULT_NODE_CAPACITY;this._nodeCapacity=u}else if(arguments.length===1){var f=arguments[0];ot.isTrue(f>1,"Node capacity must be greater than 1"),this._nodeCapacity=f}},"t"),tS={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Wi.prototype.getNodeCapacity=function(){return this._nodeCapacity},Wi.prototype.lastNode=function(a){return a.get(a.size()-1)},Wi.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var a=0,u=arguments[0].getChildBoundables().iterator();u.hasNext();){var f=u.next();f instanceof Ei?a+=this.size(f):f instanceof Ja&&(a+=1)}return a}},Wi.prototype.removeItem=function(a,u){for(var f=null,m=a.getChildBoundables().iterator();m.hasNext();){var v=m.next();v instanceof Ja&&v.getItem()===u&&(f=v)}return f!==null&&(a.getChildBoundables().remove(f),!0)},Wi.prototype.itemsTree=function(){if(arguments.length===0){this.build();var a=this.itemsTree(this._root);return a===null?new He:a}if(arguments.length===1){for(var u=arguments[0],f=new He,m=u.getChildBoundables().iterator();m.hasNext();){var v=m.next();if(v instanceof Ei){var S=this.itemsTree(v);S!==null&&f.add(S)}else v instanceof Ja?f.add(v.getItem()):ot.shouldNeverReachHere()}return f.size()<=0?null:f}},Wi.prototype.insert=function(a,u){ot.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ja(a,u))},Wi.prototype.boundablesAtLevel=function(){if(arguments.length===1){var a=arguments[0],u=new He;return this.boundablesAtLevel(a,this._root,u),u}if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];if(ot.isTrue(f>-2),m.getLevel()===f)return v.add(m),null;for(var S=m.getChildBoundables().iterator();S.hasNext();){var M=S.next();M instanceof Ei?this.boundablesAtLevel(f,M,v):(ot.isTrue(M instanceof Ja),f===-1&&v.add(M))}return null}},Wi.prototype.query=function(){if(arguments.length===1){var a=arguments[0];this.build();var u=new He;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),a)&&this.query(a,this._root,u),u}if(arguments.length===2){var f=arguments[0],m=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),f)&&this.query(f,this._root,m)}else if(arguments.length===3){if(ne(arguments[2],Bp)&&arguments[0]instanceof Object&&arguments[1]instanceof Ei)for(var v=arguments[0],S=arguments[1],M=arguments[2],B=S.getChildBoundables(),z=0;z<B.size();z++){var te=B.get(z);this.getIntersectsOp().intersects(te.getBounds(),v)&&(te instanceof Ei?this.query(v,te,M):te instanceof Ja?M.visitItem(te.getItem()):ot.shouldNeverReachHere())}else if(ne(arguments[2],ns)&&arguments[0]instanceof Object&&arguments[1]instanceof Ei)for(var pe=arguments[0],be=arguments[1],Xe=arguments[2],Ke=be.getChildBoundables(),it=0;it<Ke.size();it++){var mt=Ke.get(it);this.getIntersectsOp().intersects(mt.getBounds(),pe)&&(mt instanceof Ei?this.query(pe,mt,Xe):mt instanceof Ja?Xe.add(mt.getItem()):ot.shouldNeverReachHere())}}},Wi.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},Wi.prototype.getRoot=function(){return this.build(),this._root},Wi.prototype.remove=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),a)&&this.remove(a,this._root,u)}if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2],S=this.removeItem(m,v);if(S)return!0;for(var M=null,B=m.getChildBoundables().iterator();B.hasNext();){var z=B.next();if(this.getIntersectsOp().intersects(z.getBounds(),f)&&z instanceof Ei&&(S=this.remove(f,z,v))){M=z;break}}return M!==null&&M.getChildBoundables().isEmpty()&&m.getChildBoundables().remove(M),S}},Wi.prototype.createHigherLevels=function(a,u){ot.isTrue(!a.isEmpty());var f=this.createParentBoundables(a,u+1);return f.size()===1?f.get(0):this.createHigherLevels(f,u+1)},Wi.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var a=0,u=arguments[0].getChildBoundables().iterator();u.hasNext();){var f=u.next();if(f instanceof Ei){var m=this.depth(f);m>a&&(a=m)}}return a+1}},Wi.prototype.createParentBoundables=function(a,u){ot.isTrue(!a.isEmpty());var f=new He;f.add(this.createNode(u));var m=new He(a);Qa.sort(m,this.getComparator());for(var v=m.iterator();v.hasNext();){var S=v.next();this.lastNode(f).getChildBoundables().size()===this.getNodeCapacity()&&f.add(this.createNode(u)),this.lastNode(f).addChildBoundable(S)}return f},Wi.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Wi.prototype.interfaces_=function(){return[t]},Wi.prototype.getClass=function(){return Wi},Wi.compareDoubles=function(a,u){return a>u?1:a<u?-1:0},tS.IntersectsOp.get=function(){return Gse},tS.serialVersionUID.get=function(){return-3886435814360241e3},tS.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Wi,tS);var Gse=o(function(){},"rn"),Zy=o(function(){},"on");Zy.prototype.distance=function(a,u){},Zy.prototype.interfaces_=function(){return[]},Zy.prototype.getClass=function(){return Zy};var JF=function(a){function u(m){m=m||u.DEFAULT_NODE_CAPACITY,a.call(this,m)}o(u,"n"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return u.prototype.createParentBoundablesFromVerticalSlices=function(m,v){ot.isTrue(m.length>0);for(var S=new He,M=0;M<m.length;M++)S.addAll(this.createParentBoundablesFromVerticalSlice(m[M],v));return S},u.prototype.createNode=function(m){return new QF(m)},u.prototype.size=function(){return arguments.length===0?a.prototype.size.call(this):a.prototype.size.apply(this,arguments)},u.prototype.insert=function(){if(arguments.length!==2)return a.prototype.insert.apply(this,arguments);var m=arguments[0],v=arguments[1];if(m.isNull())return null;a.prototype.insert.call(this,m,v)},u.prototype.getIntersectsOp=function(){return u.intersectsOp},u.prototype.verticalSlices=function(m,v){for(var S=Math.trunc(Math.ceil(m.size()/v)),M=new Array(v).fill(null),B=m.iterator(),z=0;z<v;z++){M[z]=new He;for(var te=0;B.hasNext()&&te<S;){var pe=B.next();M[z].add(pe),te++}}return M},u.prototype.query=function(){if(arguments.length===1){var m=arguments[0];return a.prototype.query.call(this,m)}if(arguments.length===2){var v=arguments[0],S=arguments[1];a.prototype.query.call(this,v,S)}else if(arguments.length===3){if(ne(arguments[2],Bp)&&arguments[0]instanceof Object&&arguments[1]instanceof Ei){var M=arguments[0],B=arguments[1],z=arguments[2];a.prototype.query.call(this,M,B,z)}else if(ne(arguments[2],ns)&&arguments[0]instanceof Object&&arguments[1]instanceof Ei){var te=arguments[0],pe=arguments[1],be=arguments[2];a.prototype.query.call(this,te,pe,be)}}},u.prototype.getComparator=function(){return u.yComparator},u.prototype.createParentBoundablesFromVerticalSlice=function(m,v){return a.prototype.createParentBoundables.call(this,m,v)},u.prototype.remove=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return a.prototype.remove.call(this,m,v)}return a.prototype.remove.apply(this,arguments)},u.prototype.depth=function(){return arguments.length===0?a.prototype.depth.call(this):a.prototype.depth.apply(this,arguments)},u.prototype.createParentBoundables=function(m,v){ot.isTrue(!m.isEmpty());var S=Math.trunc(Math.ceil(m.size()/this.getNodeCapacity())),M=new He(m);Qa.sort(M,u.xComparator);var B=this.verticalSlices(M,Math.trunc(Math.ceil(Math.sqrt(S))));return this.createParentBoundablesFromVerticalSlices(B,v)},u.prototype.nearestNeighbour=function(){if(arguments.length===1){if(ne(arguments[0],Zy)){var m=arguments[0],v=new bi(this.getRoot(),this.getRoot(),m);return this.nearestNeighbour(v)}if(arguments[0]instanceof bi){var S=arguments[0];return this.nearestNeighbour(S,A.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof u&&ne(arguments[1],Zy)){var M=arguments[0],B=arguments[1],z=new bi(this.getRoot(),M.getRoot(),B);return this.nearestNeighbour(z)}if(arguments[0]instanceof bi&&typeof arguments[1]=="number"){var te=arguments[0],pe=arguments[1],be=null,Xe=new Ic;for(Xe.add(te);!Xe.isEmpty()&&pe>0;){var Ke=Xe.poll(),it=Ke.getDistance();if(it>=pe)break;Ke.isLeaves()?(pe=it,be=Ke):Ke.expandToQueue(Xe,pe)}return[be.getBoundable(0).getItem(),be.getBoundable(1).getItem()]}}else if(arguments.length===3){var mt=arguments[0],Zr=arguments[1],Ii=arguments[2],qo=new Ja(mt,Zr),Su=new bi(this.getRoot(),qo,Ii);return this.nearestNeighbour(Su)[0]}},u.prototype.interfaces_=function(){return[Jh,t]},u.prototype.getClass=function(){return u},u.centreX=function(m){return u.avg(m.getMinX(),m.getMaxX())},u.avg=function(m,v){return(m+v)/2},u.centreY=function(m){return u.avg(m.getMinY(),m.getMaxY())},f.STRtreeNode.get=function(){return QF},f.serialVersionUID.get=function(){return 0x39920f7d5f261e0},f.xComparator.get=function(){return{interfaces_:o(function(){return[Y]},"interfaces_"),compare:o(function(m,v){return a.compareDoubles(u.centreX(m.getBounds()),u.centreX(v.getBounds()))},"compare")}},f.yComparator.get=function(){return{interfaces_:o(function(){return[Y]},"interfaces_"),compare:o(function(m,v){return a.compareDoubles(u.centreY(m.getBounds()),u.centreY(v.getBounds()))},"compare")}},f.intersectsOp.get=function(){return{interfaces_:o(function(){return[a.IntersectsOp]},"interfaces_"),intersects:o(function(m,v){return m.intersects(v)},"intersects")}},f.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(u,f),u}(Wi),QF=function(a){function u(){var f=arguments[0];a.call(this,f)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.computeBounds=function(){for(var f=null,m=this.getChildBoundables().iterator();m.hasNext();){var v=m.next();f===null?f=new ie(v.getBounds()):f.expandToInclude(v.getBounds())}return f},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Ei),ss=o(function(){},"un");ss.prototype.interfaces_=function(){return[]},ss.prototype.getClass=function(){return ss},ss.relativeSign=function(a,u){return a<u?-1:a>u?1:0},ss.compare=function(a,u,f){if(u.equals2D(f))return 0;var m=ss.relativeSign(u.x,f.x),v=ss.relativeSign(u.y,f.y);switch(a){case 0:return ss.compareValue(m,v);case 1:return ss.compareValue(v,m);case 2:return ss.compareValue(v,-m);case 3:return ss.compareValue(-m,v);case 4:return ss.compareValue(-m,-v);case 5:return ss.compareValue(-v,-m);case 6:return ss.compareValue(-v,m);case 7:return ss.compareValue(m,-v)}return ot.shouldNeverReachHere("invalid octant value"),0},ss.compareValue=function(a,u){return a<0?-1:a>0?1:u<0?-1:u>0?1:0};var jp=o(function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];this._segString=a,this.coord=new N(u),this.segmentIndex=f,this._segmentOctant=m,this._isInterior=!u.equals2D(a.getCoordinate(f))},"ln");jp.prototype.getCoordinate=function(){return this.coord},jp.prototype.print=function(a){a.print(this.coord),a.print(" seg # = "+this.segmentIndex)},jp.prototype.compareTo=function(a){var u=a;return this.segmentIndex<u.segmentIndex?-1:this.segmentIndex>u.segmentIndex?1:this.coord.equals2D(u.coord)?0:ss.compare(this._segmentOctant,this.coord,u.coord)},jp.prototype.isEndPoint=function(a){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===a},jp.prototype.isInterior=function(){return this._isInterior},jp.prototype.interfaces_=function(){return[j]},jp.prototype.getClass=function(){return jp};var jo=o(function(){this._nodeMap=new b,this._edge=null;var a=arguments[0];this._edge=a},"cn");jo.prototype.getSplitCoordinates=function(){var a=new ue;this.addEndpoints();for(var u=this.iterator(),f=u.next();u.hasNext();){var m=u.next();this.addEdgeCoordinates(f,m,a),f=m}return a.toCoordinateArray()},jo.prototype.addCollapsedNodes=function(){var a=new He;this.findCollapsesFromInsertedNodes(a),this.findCollapsesFromExistingVertices(a);for(var u=a.iterator();u.hasNext();){var f=u.next().intValue();this.add(this._edge.getCoordinate(f),f)}},jo.prototype.print=function(a){a.println("Intersections:");for(var u=this.iterator();u.hasNext();)u.next().print(a)},jo.prototype.findCollapsesFromExistingVertices=function(a){for(var u=0;u<this._edge.size()-2;u++){var f=this._edge.getCoordinate(u),m=this._edge.getCoordinate(u+2);f.equals2D(m)&&a.add(new ve(u+1))}},jo.prototype.addEdgeCoordinates=function(a,u,f){var m=this._edge.getCoordinate(u.segmentIndex),v=u.isInterior()||!u.coord.equals2D(m);f.add(new N(a.coord),!1);for(var S=a.segmentIndex+1;S<=u.segmentIndex;S++)f.add(this._edge.getCoordinate(S));v&&f.add(new N(u.coord))},jo.prototype.iterator=function(){return this._nodeMap.values().iterator()},jo.prototype.addSplitEdges=function(a){this.addEndpoints(),this.addCollapsedNodes();for(var u=this.iterator(),f=u.next();u.hasNext();){var m=u.next(),v=this.createSplitEdge(f,m);a.add(v),f=m}},jo.prototype.findCollapseIndex=function(a,u,f){if(!a.coord.equals2D(u.coord))return!1;var m=u.segmentIndex-a.segmentIndex;return u.isInterior()||m--,m===1&&(f[0]=a.segmentIndex+1,!0)},jo.prototype.findCollapsesFromInsertedNodes=function(a){for(var u=new Array(1).fill(null),f=this.iterator(),m=f.next();f.hasNext();){var v=f.next();this.findCollapseIndex(m,v,u)&&a.add(new ve(u[0])),m=v}},jo.prototype.getEdge=function(){return this._edge},jo.prototype.addEndpoints=function(){var a=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(a),a)},jo.prototype.createSplitEdge=function(a,u){var f=u.segmentIndex-a.segmentIndex+2,m=this._edge.getCoordinate(u.segmentIndex),v=u.isInterior()||!u.coord.equals2D(m);v||f--;var S=new Array(f).fill(null),M=0;S[M++]=new N(a.coord);for(var B=a.segmentIndex+1;B<=u.segmentIndex;B++)S[M++]=this._edge.getCoordinate(B);return v&&(S[M]=new N(u.coord)),new li(S,this._edge.getData())},jo.prototype.add=function(a,u){var f=new jp(this._edge,a,u,this._edge.getSegmentOctant(u)),m=this._nodeMap.get(f);return m!==null?(ot.isTrue(m.coord.equals2D(a),"Found equal nodes with different coordinates"),m):(this._nodeMap.put(f,f),f)},jo.prototype.checkSplitEdgesCorrectness=function(a){var u=this._edge.getCoordinates(),f=a.get(0).getCoordinate(0);if(!f.equals2D(u[0]))throw new Er("bad split edge start point at "+f);var m=a.get(a.size()-1).getCoordinates(),v=m[m.length-1];if(!v.equals2D(u[u.length-1]))throw new Er("bad split edge end point at "+v)},jo.prototype.interfaces_=function(){return[]},jo.prototype.getClass=function(){return jo};var Qh=o(function(){},"pn");Qh.prototype.interfaces_=function(){return[]},Qh.prototype.getClass=function(){return Qh},Qh.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var a=arguments[0],u=arguments[1];if(a===0&&u===0)throw new D("Cannot compute the octant for point ( "+a+", "+u+" )");var f=Math.abs(a),m=Math.abs(u);return a>=0?u>=0?f>=m?0:1:f>=m?7:6:u>=0?f>=m?3:2:f>=m?4:5}if(arguments[0]instanceof N&&arguments[1]instanceof N){var v=arguments[0],S=arguments[1],M=S.x-v.x,B=S.y-v.y;if(M===0&&B===0)throw new D("Cannot compute the octant for two identical points "+v);return Qh.octant(M,B)}};var mu=o(function(){},"hn");mu.prototype.getCoordinates=function(){},mu.prototype.size=function(){},mu.prototype.getCoordinate=function(a){},mu.prototype.isClosed=function(){},mu.prototype.setData=function(a){},mu.prototype.getData=function(){},mu.prototype.interfaces_=function(){return[]},mu.prototype.getClass=function(){return mu};var Cb=o(function(){},"fn");Cb.prototype.addIntersection=function(a,u){},Cb.prototype.interfaces_=function(){return[mu]},Cb.prototype.getClass=function(){return Cb};var li=o(function(){this._nodeList=new jo(this),this._pts=null,this._data=null;var a=arguments[0],u=arguments[1];this._pts=a,this._data=u},"gn");li.prototype.getCoordinates=function(){return this._pts},li.prototype.size=function(){return this._pts.length},li.prototype.getCoordinate=function(a){return this._pts[a]},li.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},li.prototype.getSegmentOctant=function(a){return a===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(a),this.getCoordinate(a+1))},li.prototype.setData=function(a){this._data=a},li.prototype.safeOctant=function(a,u){return a.equals2D(u)?0:Qh.octant(a,u)},li.prototype.getData=function(){return this._data},li.prototype.addIntersection=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];this.addIntersectionNode(a,u)}else if(arguments.length===4){var f=arguments[0],m=arguments[1],v=arguments[3],S=new N(f.getIntersection(v));this.addIntersection(S,m)}},li.prototype.toString=function(){return Pt.toLineString(new ai(this._pts))},li.prototype.getNodeList=function(){return this._nodeList},li.prototype.addIntersectionNode=function(a,u){var f=u,m=f+1;if(m<this._pts.length){var v=this._pts[m];a.equals2D(v)&&(f=m)}return this._nodeList.add(a,f)},li.prototype.addIntersections=function(a,u,f){for(var m=0;m<a.getIntersectionNum();m++)this.addIntersection(a,u,f,m)},li.prototype.interfaces_=function(){return[Cb]},li.prototype.getClass=function(){return li},li.getNodedSubstrings=function(){if(arguments.length===1){var a=arguments[0],u=new He;return li.getNodedSubstrings(a,u),u}if(arguments.length===2)for(var f=arguments[0],m=arguments[1],v=f.iterator();v.hasNext();)v.next().getNodeList().addSplitEdges(m)};var ct=o(function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new N,this.p1=new N;else if(arguments.length===1){var a=arguments[0];this.p0=new N(a.p0),this.p1=new N(a.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var u=arguments[0],f=arguments[1],m=arguments[2],v=arguments[3];this.p0=new N(u,f),this.p1=new N(m,v)}},"dn"),eN={serialVersionUID:{configurable:!0}};ct.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},ct.prototype.orientationIndex=function(){if(arguments[0]instanceof ct){var a=arguments[0],u=ze.orientationIndex(this.p0,this.p1,a.p0),f=ze.orientationIndex(this.p0,this.p1,a.p1);return u>=0&&f>=0||u<=0&&f<=0?Math.max(u,f):0}if(arguments[0]instanceof N){var m=arguments[0];return ze.orientationIndex(this.p0,this.p1,m)}},ct.prototype.toGeometry=function(a){return a.createLineString([this.p0,this.p1])},ct.prototype.isVertical=function(){return this.p0.x===this.p1.x},ct.prototype.equals=function(a){if(!(a instanceof ct))return!1;var u=a;return this.p0.equals(u.p0)&&this.p1.equals(u.p1)},ct.prototype.intersection=function(a){var u=new Ro;return u.computeIntersection(this.p0,this.p1,a.p0,a.p1),u.hasIntersection()?u.getIntersection(0):null},ct.prototype.project=function(){if(arguments[0]instanceof N){var a=arguments[0];if(a.equals(this.p0)||a.equals(this.p1))return new N(a);var u=this.projectionFactor(a),f=new N;return f.x=this.p0.x+u*(this.p1.x-this.p0.x),f.y=this.p0.y+u*(this.p1.y-this.p0.y),f}if(arguments[0]instanceof ct){var m=arguments[0],v=this.projectionFactor(m.p0),S=this.projectionFactor(m.p1);if(v>=1&&S>=1||v<=0&&S<=0)return null;var M=this.project(m.p0);v<0&&(M=this.p0),v>1&&(M=this.p1);var B=this.project(m.p1);return S<0&&(B=this.p0),S>1&&(B=this.p1),new ct(M,B)}},ct.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},ct.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},ct.prototype.getCoordinate=function(a){return a===0?this.p0:this.p1},ct.prototype.distancePerpendicular=function(a){return ze.distancePointLinePerpendicular(a,this.p0,this.p1)},ct.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},ct.prototype.midPoint=function(){return ct.midPoint(this.p0,this.p1)},ct.prototype.projectionFactor=function(a){if(a.equals(this.p0))return 0;if(a.equals(this.p1))return 1;var u=this.p1.x-this.p0.x,f=this.p1.y-this.p0.y,m=u*u+f*f;return m<=0?A.NaN:((a.x-this.p0.x)*u+(a.y-this.p0.y)*f)/m},ct.prototype.closestPoints=function(a){var u=this.intersection(a);if(u!==null)return[u,u];var f=new Array(2).fill(null),m=A.MAX_VALUE,v=null,S=this.closestPoint(a.p0);m=S.distance(a.p0),f[0]=S,f[1]=a.p0;var M=this.closestPoint(a.p1);(v=M.distance(a.p1))<m&&(m=v,f[0]=M,f[1]=a.p1);var B=a.closestPoint(this.p0);(v=B.distance(this.p0))<m&&(m=v,f[0]=this.p0,f[1]=B);var z=a.closestPoint(this.p1);return(v=z.distance(this.p1))<m&&(m=v,f[0]=this.p1,f[1]=z),f},ct.prototype.closestPoint=function(a){var u=this.projectionFactor(a);return u>0&&u<1?this.project(a):this.p0.distance(a)<this.p1.distance(a)?this.p0:this.p1},ct.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},ct.prototype.getLength=function(){return this.p0.distance(this.p1)},ct.prototype.compareTo=function(a){var u=a,f=this.p0.compareTo(u.p0);return f!==0?f:this.p1.compareTo(u.p1)},ct.prototype.reverse=function(){var a=this.p0;this.p0=this.p1,this.p1=a},ct.prototype.equalsTopo=function(a){return this.p0.equals(a.p0)&&(this.p1.equals(a.p1)||this.p0.equals(a.p1))&&this.p1.equals(a.p0)},ct.prototype.lineIntersection=function(a){try{return H.intersection(this.p0,this.p1,a.p0,a.p1)}catch(u){if(!(u instanceof $e))throw u}return null},ct.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},ct.prototype.pointAlongOffset=function(a,u){var f=this.p0.x+a*(this.p1.x-this.p0.x),m=this.p0.y+a*(this.p1.y-this.p0.y),v=this.p1.x-this.p0.x,S=this.p1.y-this.p0.y,M=Math.sqrt(v*v+S*S),B=0,z=0;if(u!==0){if(M<=0)throw new Error("Cannot compute offset from zero-length line segment");B=u*v/M,z=u*S/M}return new N(f-z,m+B)},ct.prototype.setCoordinates=function(){if(arguments.length===1){var a=arguments[0];this.setCoordinates(a.p0,a.p1)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this.p0.x=u.x,this.p0.y=u.y,this.p1.x=f.x,this.p1.y=f.y}},ct.prototype.segmentFraction=function(a){var u=this.projectionFactor(a);return u<0?u=0:(u>1||A.isNaN(u))&&(u=1),u},ct.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},ct.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},ct.prototype.distance=function(){if(arguments[0]instanceof ct){var a=arguments[0];return ze.distanceLineLine(this.p0,this.p1,a.p0,a.p1)}if(arguments[0]instanceof N){var u=arguments[0];return ze.distancePointLine(u,this.p0,this.p1)}},ct.prototype.pointAlong=function(a){var u=new N;return u.x=this.p0.x+a*(this.p1.x-this.p0.x),u.y=this.p0.y+a*(this.p1.y-this.p0.y),u},ct.prototype.hashCode=function(){var a=A.doubleToLongBits(this.p0.x);a^=31*A.doubleToLongBits(this.p0.y);var u=Math.trunc(a)^Math.trunc(a>>32),f=A.doubleToLongBits(this.p1.x);return f^=31*A.doubleToLongBits(this.p1.y),u^(Math.trunc(f)^Math.trunc(f>>32))},ct.prototype.interfaces_=function(){return[j,t]},ct.prototype.getClass=function(){return ct},ct.midPoint=function(a,u){return new N((a.x+u.x)/2,(a.y+u.y)/2)},eN.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(ct,eN);var wb=o(function(){this.tempEnv1=new ie,this.tempEnv2=new ie,this._overlapSeg1=new ct,this._overlapSeg2=new ct},"_n");wb.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];a.getLineSegment(u,this._overlapSeg1),f.getLineSegment(m,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},wb.prototype.interfaces_=function(){return[]},wb.prototype.getClass=function(){return wb};var As=o(function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];this._pts=a,this._start=u,this._end=f,this._context=m},"mn");As.prototype.getLineSegment=function(a,u){u.p0=this._pts[a],u.p1=this._pts[a+1]},As.prototype.computeSelect=function(a,u,f,m){var v=this._pts[u],S=this._pts[f];if(m.tempEnv1.init(v,S),f-u==1)return m.select(this,u),null;if(!a.intersects(m.tempEnv1))return null;var M=Math.trunc((u+f)/2);u<M&&this.computeSelect(a,u,M,m),M<f&&this.computeSelect(a,M,f,m)},As.prototype.getCoordinates=function(){for(var a=new Array(this._end-this._start+1).fill(null),u=0,f=this._start;f<=this._end;f++)a[u++]=this._pts[f];return a},As.prototype.computeOverlaps=function(a,u){this.computeOverlapsInternal(this._start,this._end,a,a._start,a._end,u)},As.prototype.setId=function(a){this._id=a},As.prototype.select=function(a,u){this.computeSelect(a,this._start,this._end,u)},As.prototype.getEnvelope=function(){if(this._env===null){var a=this._pts[this._start],u=this._pts[this._end];this._env=new ie(a,u)}return this._env},As.prototype.getEndIndex=function(){return this._end},As.prototype.getStartIndex=function(){return this._start},As.prototype.getContext=function(){return this._context},As.prototype.getId=function(){return this._id},As.prototype.computeOverlapsInternal=function(a,u,f,m,v,S){var M=this._pts[a],B=this._pts[u],z=f._pts[m],te=f._pts[v];if(u-a==1&&v-m==1)return S.overlap(this,a,f,m),null;if(S.tempEnv1.init(M,B),S.tempEnv2.init(z,te),!S.tempEnv1.intersects(S.tempEnv2))return null;var pe=Math.trunc((a+u)/2),be=Math.trunc((m+v)/2);a<pe&&(m<be&&this.computeOverlapsInternal(a,pe,f,m,be,S),be<v&&this.computeOverlapsInternal(a,pe,f,be,v,S)),pe<u&&(m<be&&this.computeOverlapsInternal(pe,u,f,m,be,S),be<v&&this.computeOverlapsInternal(pe,u,f,be,v,S))},As.prototype.interfaces_=function(){return[]},As.prototype.getClass=function(){return As};var wl=o(function(){},"vn");wl.prototype.interfaces_=function(){return[]},wl.prototype.getClass=function(){return wl},wl.getChainStartIndices=function(a){var u=0,f=new He;f.add(new ve(u));do{var m=wl.findChainEnd(a,u);f.add(new ve(m)),u=m}while(u<a.length-1);return wl.toIntArray(f)},wl.findChainEnd=function(a,u){for(var f=u;f<a.length-1&&a[f].equals2D(a[f+1]);)f++;if(f>=a.length-1)return a.length-1;for(var m=hn.quadrant(a[f],a[f+1]),v=u+1;v<a.length&&!(!a[v-1].equals2D(a[v])&&hn.quadrant(a[v-1],a[v])!==m);)v++;return v-1},wl.getChains=function(){if(arguments.length===1){var a=arguments[0];return wl.getChains(a,null)}if(arguments.length===2){for(var u=arguments[0],f=arguments[1],m=new He,v=wl.getChainStartIndices(u),S=0;S<v.length-1;S++){var M=new As(u,v[S],v[S+1],f);m.add(M)}return m}},wl.toIntArray=function(a){for(var u=new Array(a.size()).fill(null),f=0;f<u.length;f++)u[f]=a.get(f).intValue();return u};var wd=o(function(){},"In");wd.prototype.computeNodes=function(a){},wd.prototype.getNodedSubstrings=function(){},wd.prototype.interfaces_=function(){return[]},wd.prototype.getClass=function(){return wd};var Pb=o(function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var a=arguments[0];this.setSegmentIntersector(a)}}},"En");Pb.prototype.setSegmentIntersector=function(a){this._segInt=a},Pb.prototype.interfaces_=function(){return[wd]},Pb.prototype.getClass=function(){return Pb};var gE=function(a){function u(m){m?a.call(this,m):a.call(this),this._monoChains=new He,this._index=new JF,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={SegmentOverlapAction:{configurable:!0}};return u.prototype.getMonotoneChains=function(){return this._monoChains},u.prototype.getNodedSubstrings=function(){return li.getNodedSubstrings(this._nodedSegStrings)},u.prototype.getIndex=function(){return this._index},u.prototype.add=function(m){for(var v=wl.getChains(m.getCoordinates(),m).iterator();v.hasNext();){var S=v.next();S.setId(this._idCounter++),this._index.insert(S.getEnvelope(),S),this._monoChains.add(S)}},u.prototype.computeNodes=function(m){this._nodedSegStrings=m;for(var v=m.iterator();v.hasNext();)this.add(v.next());this.intersectChains()},u.prototype.intersectChains=function(){for(var m=new tN(this._segInt),v=this._monoChains.iterator();v.hasNext();)for(var S=v.next(),M=this._index.query(S.getEnvelope()).iterator();M.hasNext();){var B=M.next();if(B.getId()>S.getId()&&(S.computeOverlaps(B,m),this._nOverlaps++),this._segInt.isDone())return null}},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},f.SegmentOverlapAction.get=function(){return tN},Object.defineProperties(u,f),u}(Pb),tN=function(a){function u(){a.call(this),this._si=null;var f=arguments[0];this._si=f}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.overlap=function(){if(arguments.length!==4)return a.prototype.overlap.apply(this,arguments);var f=arguments[0],m=arguments[1],v=arguments[2],S=arguments[3],M=f.getContext(),B=v.getContext();this._si.processIntersections(M,m,B,S)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(wb),Or=o(function a(){if(this._quadrantSegments=a.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=a.CAP_ROUND,this._joinStyle=a.JOIN_ROUND,this._mitreLimit=a.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=a.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var u=arguments[0];this.setQuadrantSegments(u)}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this.setQuadrantSegments(f),this.setEndCapStyle(m)}else if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],B=arguments[3];this.setQuadrantSegments(v),this.setEndCapStyle(S),this.setJoinStyle(M),this.setMitreLimit(B)}}},"t"),_c={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}};Or.prototype.getEndCapStyle=function(){return this._endCapStyle},Or.prototype.isSingleSided=function(){return this._isSingleSided},Or.prototype.setQuadrantSegments=function(a){this._quadrantSegments=a,this._quadrantSegments===0&&(this._joinStyle=Or.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Or.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),a<=0&&(this._quadrantSegments=1),this._joinStyle!==Or.JOIN_ROUND&&(this._quadrantSegments=Or.DEFAULT_QUADRANT_SEGMENTS)},Or.prototype.getJoinStyle=function(){return this._joinStyle},Or.prototype.setJoinStyle=function(a){this._joinStyle=a},Or.prototype.setSimplifyFactor=function(a){this._simplifyFactor=a<0?0:a},Or.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Or.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Or.prototype.setEndCapStyle=function(a){this._endCapStyle=a},Or.prototype.getMitreLimit=function(){return this._mitreLimit},Or.prototype.setMitreLimit=function(a){this._mitreLimit=a},Or.prototype.setSingleSided=function(a){this._isSingleSided=a},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.bufferDistanceError=function(a){var u=Math.PI/2/a;return 1-Math.cos(u/2)},_c.CAP_ROUND.get=function(){return 1},_c.CAP_FLAT.get=function(){return 2},_c.CAP_SQUARE.get=function(){return 3},_c.JOIN_ROUND.get=function(){return 1},_c.JOIN_MITRE.get=function(){return 2},_c.JOIN_BEVEL.get=function(){return 3},_c.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},_c.DEFAULT_MITRE_LIMIT.get=function(){return 5},_c.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Or,_c);var ei=o(function(a){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ze.COUNTERCLOCKWISE,this._inputLine=a||null},"Ln"),Tb={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};ei.prototype.isDeletable=function(a,u,f,m){var v=this._inputLine[a],S=this._inputLine[u],M=this._inputLine[f];return!!this.isConcave(v,S,M)&&!!this.isShallow(v,S,M,m)&&this.isShallowSampled(v,S,a,f,m)},ei.prototype.deleteShallowConcavities=function(){for(var a=1,u=this.findNextNonDeletedIndex(a),f=this.findNextNonDeletedIndex(u),m=!1;f<this._inputLine.length;){var v=!1;this.isDeletable(a,u,f,this._distanceTol)&&(this._isDeleted[u]=ei.DELETE,v=!0,m=!0),a=v?f:u,u=this.findNextNonDeletedIndex(a),f=this.findNextNonDeletedIndex(u)}return m},ei.prototype.isShallowConcavity=function(a,u,f,m){return ze.computeOrientation(a,u,f)!==this._angleOrientation?!1:ze.distancePointLine(u,a,f)<m},ei.prototype.isShallowSampled=function(a,u,f,m,v){var S=Math.trunc((m-f)/ei.NUM_PTS_TO_CHECK);S<=0&&(S=1);for(var M=f;M<m;M+=S)if(!this.isShallow(a,u,this._inputLine[M],v))return!1;return!0},ei.prototype.isConcave=function(a,u,f){var m=ze.computeOrientation(a,u,f)===this._angleOrientation;return m},ei.prototype.simplify=function(a){this._distanceTol=Math.abs(a),a<0&&(this._angleOrientation=ze.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var u=!1;do u=this.deleteShallowConcavities();while(u);return this.collapseLine()},ei.prototype.findNextNonDeletedIndex=function(a){for(var u=a+1;u<this._inputLine.length&&this._isDeleted[u]===ei.DELETE;)u++;return u},ei.prototype.isShallow=function(a,u,f,m){return ze.distancePointLine(u,a,f)<m},ei.prototype.collapseLine=function(){for(var a=new ue,u=0;u<this._inputLine.length;u++)this._isDeleted[u]!==ei.DELETE&&a.add(this._inputLine[u]);return a.toCoordinateArray()},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ei.simplify=function(a,u){return new ei(a).simplify(u)},Tb.INIT.get=function(){return 0},Tb.DELETE.get=function(){return 1},Tb.KEEP.get=function(){return 1},Tb.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(ei,Tb);var ta=o(function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new He},"wn"),rN={COORDINATE_ARRAY_TYPE:{configurable:!0}};ta.prototype.getCoordinates=function(){return this._ptList.toArray(ta.COORDINATE_ARRAY_TYPE)},ta.prototype.setPrecisionModel=function(a){this._precisionModel=a},ta.prototype.addPt=function(a){var u=new N(a);if(this._precisionModel.makePrecise(u),this.isRedundant(u))return null;this._ptList.add(u)},ta.prototype.revere=function(){},ta.prototype.addPts=function(a,u){if(u)for(var f=0;f<a.length;f++)this.addPt(a[f]);else for(var m=a.length-1;m>=0;m--)this.addPt(a[m])},ta.prototype.isRedundant=function(a){if(this._ptList.size()<1)return!1;var u=this._ptList.get(this._ptList.size()-1);return a.distance(u)<this._minimimVertexDistance},ta.prototype.toString=function(){return new jt().createLineString(this.getCoordinates()).toString()},ta.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var a=new N(this._ptList.get(0)),u=this._ptList.get(this._ptList.size()-1);if(a.equals(u))return null;this._ptList.add(a)},ta.prototype.setMinimumVertexDistance=function(a){this._minimimVertexDistance=a},ta.prototype.interfaces_=function(){return[]},ta.prototype.getClass=function(){return ta},rN.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(ta,rN);var qt=o(function(){},"Tn"),em={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.toDegrees=function(a){return 180*a/Math.PI},qt.normalize=function(a){for(;a>Math.PI;)a-=qt.PI_TIMES_2;for(;a<=-Math.PI;)a+=qt.PI_TIMES_2;return a},qt.angle=function(){if(arguments.length===1){var a=arguments[0];return Math.atan2(a.y,a.x)}if(arguments.length===2){var u=arguments[0],f=arguments[1],m=f.x-u.x,v=f.y-u.y;return Math.atan2(v,m)}},qt.isAcute=function(a,u,f){var m=a.x-u.x,v=a.y-u.y;return m*(f.x-u.x)+v*(f.y-u.y)>0},qt.isObtuse=function(a,u,f){var m=a.x-u.x,v=a.y-u.y;return m*(f.x-u.x)+v*(f.y-u.y)<0},qt.interiorAngle=function(a,u,f){var m=qt.angle(u,a),v=qt.angle(u,f);return Math.abs(v-m)},qt.normalizePositive=function(a){if(a<0){for(;a<0;)a+=qt.PI_TIMES_2;a>=qt.PI_TIMES_2&&(a=0)}else{for(;a>=qt.PI_TIMES_2;)a-=qt.PI_TIMES_2;a<0&&(a=0)}return a},qt.angleBetween=function(a,u,f){var m=qt.angle(u,a),v=qt.angle(u,f);return qt.diff(m,v)},qt.diff=function(a,u){var f=null;return(f=a<u?u-a:a-u)>Math.PI&&(f=2*Math.PI-f),f},qt.toRadians=function(a){return a*Math.PI/180},qt.getTurn=function(a,u){var f=Math.sin(u-a);return f>0?qt.COUNTERCLOCKWISE:f<0?qt.CLOCKWISE:qt.NONE},qt.angleBetweenOriented=function(a,u,f){var m=qt.angle(u,a),v=qt.angle(u,f)-m;return v<=-Math.PI?v+qt.PI_TIMES_2:v>Math.PI?v-qt.PI_TIMES_2:v},em.PI_TIMES_2.get=function(){return 2*Math.PI},em.PI_OVER_2.get=function(){return Math.PI/2},em.PI_OVER_4.get=function(){return Math.PI/4},em.COUNTERCLOCKWISE.get=function(){return ze.COUNTERCLOCKWISE},em.CLOCKWISE.get=function(){return ze.CLOCKWISE},em.NONE.get=function(){return ze.COLLINEAR},Object.defineProperties(qt,em);var Ln=o(function a(){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 ct,this._seg1=new ct,this._offset0=new ct,this._offset1=new ct,this._side=0,this._hasNarrowConcaveAngle=!1;var u=arguments[0],f=arguments[1],m=arguments[2];this._precisionModel=u,this._bufParams=f,this._li=new Ro,this._filletAngleQuantum=Math.PI/2/f.getQuadrantSegments(),f.getQuadrantSegments()>=8&&f.getJoinStyle()===Or.JOIN_ROUND&&(this._closingSegLengthFactor=a.MAX_CLOSING_SEG_LEN_FACTOR),this.init(m)},"t"),Eb={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}};Ln.prototype.addNextSegment=function(a,u){if(this._s0=this._s1,this._s1=this._s2,this._s2=a,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 f=ze.computeOrientation(this._s0,this._s1,this._s2),m=f===ze.CLOCKWISE&&this._side===Ge.LEFT||f===ze.COUNTERCLOCKWISE&&this._side===Ge.RIGHT;f===0?this.addCollinear(u):m?this.addOutsideTurn(f,u):this.addInsideTurn(f,u)},Ln.prototype.addLineEndCap=function(a,u){var f=new ct(a,u),m=new ct;this.computeOffsetSegment(f,Ge.LEFT,this._distance,m);var v=new ct;this.computeOffsetSegment(f,Ge.RIGHT,this._distance,v);var S=u.x-a.x,M=u.y-a.y,B=Math.atan2(M,S);switch(this._bufParams.getEndCapStyle()){case Or.CAP_ROUND:this._segList.addPt(m.p1),this.addFilletArc(u,B+Math.PI/2,B-Math.PI/2,ze.CLOCKWISE,this._distance),this._segList.addPt(v.p1);break;case Or.CAP_FLAT:this._segList.addPt(m.p1),this._segList.addPt(v.p1);break;case Or.CAP_SQUARE:var z=new N;z.x=Math.abs(this._distance)*Math.cos(B),z.y=Math.abs(this._distance)*Math.sin(B);var te=new N(m.p1.x+z.x,m.p1.y+z.y),pe=new N(v.p1.x+z.x,v.p1.y+z.y);this._segList.addPt(te),this._segList.addPt(pe)}},Ln.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ln.prototype.addMitreJoin=function(a,u,f,m){var v=!0,S=null;try{S=H.intersection(u.p0,u.p1,f.p0,f.p1),(m<=0?1:S.distance(a)/Math.abs(m))>this._bufParams.getMitreLimit()&&(v=!1)}catch(M){if(!(M instanceof $e))throw M;S=new N(0,0),v=!1}v?this._segList.addPt(S):this.addLimitedMitreJoin(u,f,m,this._bufParams.getMitreLimit())},Ln.prototype.addFilletCorner=function(a,u,f,m,v){var S=u.x-a.x,M=u.y-a.y,B=Math.atan2(M,S),z=f.x-a.x,te=f.y-a.y,pe=Math.atan2(te,z);m===ze.CLOCKWISE?B<=pe&&(B+=2*Math.PI):B>=pe&&(B-=2*Math.PI),this._segList.addPt(u),this.addFilletArc(a,B,pe,m,v),this._segList.addPt(f)},Ln.prototype.addOutsideTurn=function(a,u){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Ln.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Or.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Or.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(u&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,a,this._distance),this._segList.addPt(this._offset1.p0))},Ln.prototype.createSquare=function(a){this._segList.addPt(new N(a.x+this._distance,a.y+this._distance)),this._segList.addPt(new N(a.x+this._distance,a.y-this._distance)),this._segList.addPt(new N(a.x-this._distance,a.y-this._distance)),this._segList.addPt(new N(a.x-this._distance,a.y+this._distance)),this._segList.closeRing()},Ln.prototype.addSegments=function(a,u){this._segList.addPts(a,u)},Ln.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Ln.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Ln.prototype.initSideSegments=function(a,u,f){this._s1=a,this._s2=u,this._side=f,this._seg1.setCoordinates(a,u),this.computeOffsetSegment(this._seg1,f,this._distance,this._offset1)},Ln.prototype.addLimitedMitreJoin=function(a,u,f,m){var v=this._seg0.p1,S=qt.angle(v,this._seg0.p0),M=qt.angleBetweenOriented(this._seg0.p0,v,this._seg1.p1)/2,B=qt.normalize(S+M),z=qt.normalize(B+Math.PI),te=m*f,pe=f-te*Math.abs(Math.sin(M)),be=v.x+te*Math.cos(z),Xe=v.y+te*Math.sin(z),Ke=new N(be,Xe),it=new ct(v,Ke),mt=it.pointAlongOffset(1,pe),Zr=it.pointAlongOffset(1,-pe);this._side===Ge.LEFT?(this._segList.addPt(mt),this._segList.addPt(Zr)):(this._segList.addPt(Zr),this._segList.addPt(mt))},Ln.prototype.computeOffsetSegment=function(a,u,f,m){var v=u===Ge.LEFT?1:-1,S=a.p1.x-a.p0.x,M=a.p1.y-a.p0.y,B=Math.sqrt(S*S+M*M),z=v*f*S/B,te=v*f*M/B;m.p0.x=a.p0.x-te,m.p0.y=a.p0.y+z,m.p1.x=a.p1.x-te,m.p1.y=a.p1.y+z},Ln.prototype.addFilletArc=function(a,u,f,m,v){var S=m===ze.CLOCKWISE?-1:1,M=Math.abs(u-f),B=Math.trunc(M/this._filletAngleQuantum+.5);if(B<1)return null;for(var z=M/B,te=0,pe=new N;te<M;){var be=u+S*te;pe.x=a.x+v*Math.cos(be),pe.y=a.y+v*Math.sin(be),this._segList.addPt(pe),te+=z}},Ln.prototype.addInsideTurn=function(a,u){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*Ln.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var f=new N((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(f);var m=new N((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(m)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Ln.prototype.createCircle=function(a){var u=new N(a.x+this._distance,a.y);this._segList.addPt(u),this.addFilletArc(a,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ln.prototype.addBevelJoin=function(a,u){this._segList.addPt(a.p1),this._segList.addPt(u.p0)},Ln.prototype.init=function(a){this._distance=a,this._maxCurveSegmentError=a*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new ta,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(a*Ln.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ln.prototype.addCollinear=function(a){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Or.JOIN_BEVEL||this._bufParams.getJoinStyle()===Or.JOIN_MITRE?(a&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,ze.CLOCKWISE,this._distance))},Ln.prototype.closeRing=function(){this._segList.closeRing()},Ln.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Eb.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Eb.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Eb.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Eb.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ln,Eb);var as=o(function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var a=arguments[0],u=arguments[1];this._precisionModel=a,this._bufParams=u},"Mn");as.prototype.getOffsetCurve=function(a,u){if(this._distance=u,u===0)return null;var f=u<0,m=Math.abs(u),v=this.getSegGen(m);a.length<=1?this.computePointCurve(a[0],v):this.computeOffsetCurve(a,f,v);var S=v.getCoordinates();return f&&F.reverse(S),S},as.prototype.computeSingleSidedBufferCurve=function(a,u,f){var m=this.simplifyTolerance(this._distance);if(u){f.addSegments(a,!0);var v=ei.simplify(a,-m),S=v.length-1;f.initSideSegments(v[S],v[S-1],Ge.LEFT),f.addFirstSegment();for(var M=S-2;M>=0;M--)f.addNextSegment(v[M],!0)}else{f.addSegments(a,!1);var B=ei.simplify(a,m),z=B.length-1;f.initSideSegments(B[0],B[1],Ge.LEFT),f.addFirstSegment();for(var te=2;te<=z;te++)f.addNextSegment(B[te],!0)}f.addLastSegment(),f.closeRing()},as.prototype.computeRingBufferCurve=function(a,u,f){var m=this.simplifyTolerance(this._distance);u===Ge.RIGHT&&(m=-m);var v=ei.simplify(a,m),S=v.length-1;f.initSideSegments(v[S-1],v[0],u);for(var M=1;M<=S;M++){var B=M!==1;f.addNextSegment(v[M],B)}f.closeRing()},as.prototype.computeLineBufferCurve=function(a,u){var f=this.simplifyTolerance(this._distance),m=ei.simplify(a,f),v=m.length-1;u.initSideSegments(m[0],m[1],Ge.LEFT);for(var S=2;S<=v;S++)u.addNextSegment(m[S],!0);u.addLastSegment(),u.addLineEndCap(m[v-1],m[v]);var M=ei.simplify(a,-f),B=M.length-1;u.initSideSegments(M[B],M[B-1],Ge.LEFT);for(var z=B-2;z>=0;z--)u.addNextSegment(M[z],!0);u.addLastSegment(),u.addLineEndCap(M[1],M[0]),u.closeRing()},as.prototype.computePointCurve=function(a,u){switch(this._bufParams.getEndCapStyle()){case Or.CAP_ROUND:u.createCircle(a);break;case Or.CAP_SQUARE:u.createSquare(a)}},as.prototype.getLineCurve=function(a,u){if(this._distance=u,u<0&&!this._bufParams.isSingleSided()||u===0)return null;var f=Math.abs(u),m=this.getSegGen(f);if(a.length<=1)this.computePointCurve(a[0],m);else if(this._bufParams.isSingleSided()){var v=u<0;this.computeSingleSidedBufferCurve(a,v,m)}else this.computeLineBufferCurve(a,m);return m.getCoordinates()},as.prototype.getBufferParameters=function(){return this._bufParams},as.prototype.simplifyTolerance=function(a){return a*this._bufParams.getSimplifyFactor()},as.prototype.getRingCurve=function(a,u,f){if(this._distance=f,a.length<=2)return this.getLineCurve(a,f);if(f===0)return as.copyCoordinates(a);var m=this.getSegGen(f);return this.computeRingBufferCurve(a,u,m),m.getCoordinates()},as.prototype.computeOffsetCurve=function(a,u,f){var m=this.simplifyTolerance(this._distance);if(u){var v=ei.simplify(a,-m),S=v.length-1;f.initSideSegments(v[S],v[S-1],Ge.LEFT),f.addFirstSegment();for(var M=S-2;M>=0;M--)f.addNextSegment(v[M],!0)}else{var B=ei.simplify(a,m),z=B.length-1;f.initSideSegments(B[0],B[1],Ge.LEFT),f.addFirstSegment();for(var te=2;te<=z;te++)f.addNextSegment(B[te],!0)}f.addLastSegment()},as.prototype.getSegGen=function(a){return new Ln(this._precisionModel,this._bufParams,a)},as.prototype.interfaces_=function(){return[]},as.prototype.getClass=function(){return as},as.copyCoordinates=function(a){for(var u=new Array(a.length).fill(null),f=0;f<u.length;f++)u[f]=new N(a[f]);return u};var tm=o(function(){this._subgraphs=null,this._seg=new ct,this._cga=new ze;var a=arguments[0];this._subgraphs=a},"An"),nN={DepthSegment:{configurable:!0}};tm.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var a=arguments[0],u=new He,f=this._subgraphs.iterator();f.hasNext();){var m=f.next(),v=m.getEnvelope();a.y<v.getMinY()||a.y>v.getMaxY()||this.findStabbedSegments(a,m.getDirectedEdges(),u)}return u}if(arguments.length===3){if(ne(arguments[2],ns)&&arguments[0]instanceof N&&arguments[1]instanceof mE){for(var S=arguments[0],M=arguments[1],B=arguments[2],z=M.getEdge().getCoordinates(),te=0;te<z.length-1;te++)if(this._seg.p0=z[te],this._seg.p1=z[te+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<S.x)&&!(this._seg.isHorizontal()||S.y<this._seg.p0.y||S.y>this._seg.p1.y||ze.computeOrientation(this._seg.p0,this._seg.p1,S)===ze.RIGHT)){var pe=M.getDepth(Ge.LEFT);this._seg.p0.equals(z[te])||(pe=M.getDepth(Ge.RIGHT));var be=new Pd(this._seg,pe);B.add(be)}}else if(ne(arguments[2],ns)&&arguments[0]instanceof N&&ne(arguments[1],ns))for(var Xe=arguments[0],Ke=arguments[1],it=arguments[2],mt=Ke.iterator();mt.hasNext();){var Zr=mt.next();Zr.isForward()&&this.findStabbedSegments(Xe,Zr,it)}}},tm.prototype.getDepth=function(a){var u=this.findStabbedSegments(a);return u.size()===0?0:Qa.min(u)._leftDepth},tm.prototype.interfaces_=function(){return[]},tm.prototype.getClass=function(){return tm},nN.DepthSegment.get=function(){return Pd},Object.defineProperties(tm,nN);var Pd=o(function(){this._upwardSeg=null,this._leftDepth=null;var a=arguments[0],u=arguments[1];this._upwardSeg=new ct(a),this._leftDepth=u},"Gn");Pd.prototype.compareTo=function(a){var u=a;if(this._upwardSeg.minX()>=u._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=u._upwardSeg.minX())return-1;var f=this._upwardSeg.orientationIndex(u._upwardSeg);return f!==0||(f=-1*u._upwardSeg.orientationIndex(this._upwardSeg))!=0?f:this._upwardSeg.compareTo(u._upwardSeg)},Pd.prototype.compareX=function(a,u){var f=a.p0.compareTo(u.p0);return f!==0?f:a.p1.compareTo(u.p1)},Pd.prototype.toString=function(){return this._upwardSeg.toString()},Pd.prototype.interfaces_=function(){return[j]},Pd.prototype.getClass=function(){return Pd};var Lr=o(function(a,u,f){this.p0=a||null,this.p1=u||null,this.p2=f||null},"qn");Lr.prototype.area=function(){return Lr.area(this.p0,this.p1,this.p2)},Lr.prototype.signedArea=function(){return Lr.signedArea(this.p0,this.p1,this.p2)},Lr.prototype.interpolateZ=function(a){if(a===null)throw new D("Supplied point is null.");return Lr.interpolateZ(a,this.p0,this.p1,this.p2)},Lr.prototype.longestSideLength=function(){return Lr.longestSideLength(this.p0,this.p1,this.p2)},Lr.prototype.isAcute=function(){return Lr.isAcute(this.p0,this.p1,this.p2)},Lr.prototype.circumcentre=function(){return Lr.circumcentre(this.p0,this.p1,this.p2)},Lr.prototype.area3D=function(){return Lr.area3D(this.p0,this.p1,this.p2)},Lr.prototype.centroid=function(){return Lr.centroid(this.p0,this.p1,this.p2)},Lr.prototype.inCentre=function(){return Lr.inCentre(this.p0,this.p1,this.p2)},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.area=function(a,u,f){return Math.abs(((f.x-a.x)*(u.y-a.y)-(u.x-a.x)*(f.y-a.y))/2)},Lr.signedArea=function(a,u,f){return((f.x-a.x)*(u.y-a.y)-(u.x-a.x)*(f.y-a.y))/2},Lr.det=function(a,u,f,m){return a*m-u*f},Lr.interpolateZ=function(a,u,f,m){var v=u.x,S=u.y,M=f.x-v,B=m.x-v,z=f.y-S,te=m.y-S,pe=M*te-B*z,be=a.x-v,Xe=a.y-S,Ke=(te*be-B*Xe)/pe,it=(-z*be+M*Xe)/pe;return u.z+Ke*(f.z-u.z)+it*(m.z-u.z)},Lr.longestSideLength=function(a,u,f){var m=a.distance(u),v=u.distance(f),S=f.distance(a),M=m;return v>M&&(M=v),S>M&&(M=S),M},Lr.isAcute=function(a,u,f){return!!qt.isAcute(a,u,f)&&!!qt.isAcute(u,f,a)&&!!qt.isAcute(f,a,u)},Lr.circumcentre=function(a,u,f){var m=f.x,v=f.y,S=a.x-m,M=a.y-v,B=u.x-m,z=u.y-v,te=2*Lr.det(S,M,B,z),pe=Lr.det(M,S*S+M*M,z,B*B+z*z),be=Lr.det(S,S*S+M*M,B,B*B+z*z);return new N(m-pe/te,v+be/te)},Lr.perpendicularBisector=function(a,u){var f=u.x-a.x,m=u.y-a.y,v=new H(a.x+f/2,a.y+m/2,1),S=new H(a.x-m+f/2,a.y+f+m/2,1);return new H(v,S)},Lr.angleBisector=function(a,u,f){var m=u.distance(a),v=m/(m+u.distance(f)),S=f.x-a.x,M=f.y-a.y;return new N(a.x+v*S,a.y+v*M)},Lr.area3D=function(a,u,f){var m=u.x-a.x,v=u.y-a.y,S=u.z-a.z,M=f.x-a.x,B=f.y-a.y,z=f.z-a.z,te=v*z-S*B,pe=S*M-m*z,be=m*B-v*M,Xe=te*te+pe*pe+be*be,Ke=Math.sqrt(Xe)/2;return Ke},Lr.centroid=function(a,u,f){var m=(a.x+u.x+f.x)/3,v=(a.y+u.y+f.y)/3;return new N(m,v)},Lr.inCentre=function(a,u,f){var m=u.distance(f),v=a.distance(f),S=a.distance(u),M=m+v+S,B=(m*a.x+v*u.x+S*f.x)/M,z=(m*a.y+v*u.y+S*f.y)/M;return new N(B,z)};var Pa=o(function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new He;var a=arguments[0],u=arguments[1],f=arguments[2];this._inputGeom=a,this._distance=u,this._curveBuilder=f},"Bn");Pa.prototype.addPoint=function(a){if(this._distance<=0)return null;var u=a.getCoordinates(),f=this._curveBuilder.getLineCurve(u,this._distance);this.addCurve(f,U.EXTERIOR,U.INTERIOR)},Pa.prototype.addPolygon=function(a){var u=this._distance,f=Ge.LEFT;this._distance<0&&(u=-this._distance,f=Ge.RIGHT);var m=a.getExteriorRing(),v=F.removeRepeatedPoints(m.getCoordinates());if(this._distance<0&&this.isErodedCompletely(m,this._distance)||this._distance<=0&&v.length<3)return null;this.addPolygonRing(v,u,f,U.EXTERIOR,U.INTERIOR);for(var S=0;S<a.getNumInteriorRing();S++){var M=a.getInteriorRingN(S),B=F.removeRepeatedPoints(M.getCoordinates());this._distance>0&&this.isErodedCompletely(M,-this._distance)||this.addPolygonRing(B,u,Ge.opposite(f),U.INTERIOR,U.EXTERIOR)}},Pa.prototype.isTriangleErodedCompletely=function(a,u){var f=new Lr(a[0],a[1],a[2]),m=f.inCentre();return ze.distancePointLine(m,f.p0,f.p1)<Math.abs(u)},Pa.prototype.addLineString=function(a){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var u=F.removeRepeatedPoints(a.getCoordinates()),f=this._curveBuilder.getLineCurve(u,this._distance);this.addCurve(f,U.EXTERIOR,U.INTERIOR)},Pa.prototype.addCurve=function(a,u,f){if(a===null||a.length<2)return null;var m=new li(a,new Yr(0,U.BOUNDARY,u,f));this._curveList.add(m)},Pa.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Pa.prototype.addPolygonRing=function(a,u,f,m,v){if(u===0&&a.length<os.MINIMUM_VALID_SIZE)return null;var S=m,M=v;a.length>=os.MINIMUM_VALID_SIZE&&ze.isCCW(a)&&(S=v,M=m,f=Ge.opposite(f));var B=this._curveBuilder.getRingCurve(a,f,u);this.addCurve(B,S,M)},Pa.prototype.add=function(a){if(a.isEmpty())return null;a instanceof Xr?this.addPolygon(a):a instanceof Gt?this.addLineString(a):a instanceof Gn?this.addPoint(a):a instanceof Ms?this.addCollection(a):a instanceof dn?this.addCollection(a):a instanceof Ka?this.addCollection(a):a instanceof xt&&this.addCollection(a)},Pa.prototype.isErodedCompletely=function(a,u){var f=a.getCoordinates();if(f.length<4)return u<0;if(f.length===4)return this.isTriangleErodedCompletely(f,u);var m=a.getEnvelopeInternal(),v=Math.min(m.getHeight(),m.getWidth());return u<0&&2*Math.abs(u)>v},Pa.prototype.addCollection=function(a){for(var u=0;u<a.getNumGeometries();u++){var f=a.getGeometryN(u);this.add(f)}},Pa.prototype.interfaces_=function(){return[]},Pa.prototype.getClass=function(){return Pa};var Ky=o(function(){},"Vn");Ky.prototype.locate=function(a){},Ky.prototype.interfaces_=function(){return[]},Ky.prototype.getClass=function(){return Ky};var gu=o(function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var a=arguments[0];this._parent=a,this._atStart=!0,this._index=0,this._max=a.getNumGeometries()},"Un");gu.prototype.next=function(){if(this._atStart)return this._atStart=!1,gu.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 a=this._parent.getGeometryN(this._index++);return a instanceof xt?(this._subcollectionIterator=new gu(a),this._subcollectionIterator.next()):a},gu.prototype.remove=function(){throw new Error(this.getClass().getName())},gu.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)},gu.prototype.interfaces_=function(){return[vc]},gu.prototype.getClass=function(){return gu},gu.isAtomic=function(a){return!(a instanceof xt)};var ra=o(function(){this._geom=null;var a=arguments[0];this._geom=a},"zn");ra.prototype.locate=function(a){return ra.locate(a,this._geom)},ra.prototype.interfaces_=function(){return[Ky]},ra.prototype.getClass=function(){return ra},ra.isPointInRing=function(a,u){return!!u.getEnvelopeInternal().intersects(a)&&ze.isPointInRing(a,u.getCoordinates())},ra.containsPointInPolygon=function(a,u){if(u.isEmpty())return!1;var f=u.getExteriorRing();if(!ra.isPointInRing(a,f))return!1;for(var m=0;m<u.getNumInteriorRing();m++){var v=u.getInteriorRingN(m);if(ra.isPointInRing(a,v))return!1}return!0},ra.containsPoint=function(a,u){if(u instanceof Xr)return ra.containsPointInPolygon(a,u);if(u instanceof xt)for(var f=new gu(u);f.hasNext();){var m=f.next();if(m!==u&&ra.containsPoint(a,m))return!0}return!1},ra.locate=function(a,u){return u.isEmpty()?U.EXTERIOR:ra.containsPoint(a,u)?U.INTERIOR:U.EXTERIOR};var xo=o(function(){this._edgeMap=new b,this._edgeList=null,this._ptInAreaLocation=[U.NONE,U.NONE]},"Xn");xo.prototype.getNextCW=function(a){this.getEdges();var u=this._edgeList.indexOf(a),f=u-1;return u===0&&(f=this._edgeList.size()-1),this._edgeList.get(f)},xo.prototype.propagateSideLabels=function(a){for(var u=U.NONE,f=this.iterator();f.hasNext();){var m=f.next().getLabel();m.isArea(a)&&m.getLocation(a,Ge.LEFT)!==U.NONE&&(u=m.getLocation(a,Ge.LEFT))}if(u===U.NONE)return null;for(var v=u,S=this.iterator();S.hasNext();){var M=S.next(),B=M.getLabel();if(B.getLocation(a,Ge.ON)===U.NONE&&B.setLocation(a,Ge.ON,v),B.isArea(a)){var z=B.getLocation(a,Ge.LEFT),te=B.getLocation(a,Ge.RIGHT);if(te!==U.NONE){if(te!==v)throw new xc("side location conflict",M.getCoordinate());z===U.NONE&&ot.shouldNeverReachHere("found single null side (at "+M.getCoordinate()+")"),v=z}else ot.isTrue(B.getLocation(a,Ge.LEFT)===U.NONE,"found single null side"),B.setLocation(a,Ge.RIGHT,v),B.setLocation(a,Ge.LEFT,v)}}},xo.prototype.getCoordinate=function(){var a=this.iterator();return a.hasNext()?a.next().getCoordinate():null},xo.prototype.print=function(a){we.out.println("EdgeEndStar: "+this.getCoordinate());for(var u=this.iterator();u.hasNext();)u.next().print(a)},xo.prototype.isAreaLabelsConsistent=function(a){return this.computeEdgeEndLabels(a.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},xo.prototype.checkAreaLabelsConsistent=function(a){var u=this.getEdges();if(u.size()<=0)return!0;var f=u.size()-1,m=u.get(f).getLabel().getLocation(a,Ge.LEFT);ot.isTrue(m!==U.NONE,"Found unlabelled area edge");for(var v=m,S=this.iterator();S.hasNext();){var M=S.next().getLabel();ot.isTrue(M.isArea(a),"Found non-area edge");var B=M.getLocation(a,Ge.LEFT),z=M.getLocation(a,Ge.RIGHT);if(B===z||z!==v)return!1;v=B}return!0},xo.prototype.findIndex=function(a){this.iterator();for(var u=0;u<this._edgeList.size();u++)if(this._edgeList.get(u)===a)return u;return-1},xo.prototype.iterator=function(){return this.getEdges().iterator()},xo.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new He(this._edgeMap.values())),this._edgeList},xo.prototype.getLocation=function(a,u,f){return this._ptInAreaLocation[a]===U.NONE&&(this._ptInAreaLocation[a]=ra.locate(u,f[a].getGeometry())),this._ptInAreaLocation[a]},xo.prototype.toString=function(){var a=new Ue;a.append("EdgeEndStar: "+this.getCoordinate()),a.append("\n");for(var u=this.iterator();u.hasNext();){var f=u.next();a.append(f),a.append("\n")}return a.toString()},xo.prototype.computeEdgeEndLabels=function(a){for(var u=this.iterator();u.hasNext();)u.next().computeLabel(a)},xo.prototype.computeLabelling=function(a){this.computeEdgeEndLabels(a[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var u=[!1,!1],f=this.iterator();f.hasNext();)for(var m=f.next().getLabel(),v=0;v<2;v++)m.isLine(v)&&m.getLocation(v)===U.BOUNDARY&&(u[v]=!0);for(var S=this.iterator();S.hasNext();)for(var M=S.next(),B=M.getLabel(),z=0;z<2;z++)if(B.isAnyNull(z)){var te=U.NONE;if(u[z])te=U.EXTERIOR;else{var pe=M.getCoordinate();te=this.getLocation(z,pe,a)}B.setAllLocationsIfNull(z,te)}},xo.prototype.getDegree=function(){return this._edgeMap.size()},xo.prototype.insertEdgeEnd=function(a,u){this._edgeMap.put(a,u),this._edgeList=null},xo.prototype.interfaces_=function(){return[]},xo.prototype.getClass=function(){return xo};var Use=function(a){function u(){a.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var f=null,m=null,v=this._SCANNING_FOR_INCOMING,S=0;S<this._resultAreaEdgeList.size();S++){var M=this._resultAreaEdgeList.get(S),B=M.getSym();if(M.getLabel().isArea())switch(f===null&&M.isInResult()&&(f=M),v){case this._SCANNING_FOR_INCOMING:if(!B.isInResult())continue;m=B,v=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!M.isInResult())continue;m.setNext(M),v=this._SCANNING_FOR_INCOMING}}if(v===this._LINKING_TO_OUTGOING){if(f===null)throw new xc("no outgoing dirEdge found",this.getCoordinate());ot.isTrue(f.isInResult(),"unable to link last incoming dirEdge"),m.setNext(f)}},u.prototype.insert=function(f){var m=f;this.insertEdgeEnd(m,m)},u.prototype.getRightmostEdge=function(){var f=this.getEdges(),m=f.size();if(m<1)return null;var v=f.get(0);if(m===1)return v;var S=f.get(m-1),M=v.getQuadrant(),B=S.getQuadrant();return hn.isNorthern(M)&&hn.isNorthern(B)?v:hn.isNorthern(M)||hn.isNorthern(B)?v.getDy()!==0?v:S.getDy()!==0?S:(ot.shouldNeverReachHere("found two horizontal edges incident on node"),null):S},u.prototype.print=function(f){we.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var m=this.iterator();m.hasNext();){var v=m.next();f.print("out "),v.print(f),f.println(),f.print("in "),v.getSym().print(f),f.println()}},u.prototype.getResultAreaEdges=function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new He;for(var f=this.iterator();f.hasNext();){var m=f.next();(m.isInResult()||m.getSym().isInResult())&&this._resultAreaEdgeList.add(m)}return this._resultAreaEdgeList},u.prototype.updateLabelling=function(f){for(var m=this.iterator();m.hasNext();){var v=m.next().getLabel();v.setAllLocationsIfNull(0,f.getLocation(0)),v.setAllLocationsIfNull(1,f.getLocation(1))}},u.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var f=null,m=null,v=this._edgeList.size()-1;v>=0;v--){var S=this._edgeList.get(v),M=S.getSym();m===null&&(m=M),f!==null&&M.setNext(f),f=S}m.setNext(f)},u.prototype.computeDepths=function(){if(arguments.length===1){var f=arguments[0],m=this.findIndex(f),v=f.getDepth(Ge.LEFT),S=f.getDepth(Ge.RIGHT),M=this.computeDepths(m+1,this._edgeList.size(),v);if(this.computeDepths(0,m,M)!==S)throw new xc("depth mismatch at "+f.getCoordinate())}else if(arguments.length===3){for(var B=arguments[0],z=arguments[1],te=arguments[2],pe=B;pe<z;pe++){var be=this._edgeList.get(pe);be.setEdgeDepths(Ge.RIGHT,te),te=be.getDepth(Ge.LEFT)}return te}},u.prototype.mergeSymLabels=function(){for(var f=this.iterator();f.hasNext();){var m=f.next();m.getLabel().merge(m.getSym().getLabel())}},u.prototype.linkMinimalDirectedEdges=function(f){for(var m=null,v=null,S=this._SCANNING_FOR_INCOMING,M=this._resultAreaEdgeList.size()-1;M>=0;M--){var B=this._resultAreaEdgeList.get(M),z=B.getSym();switch(m===null&&B.getEdgeRing()===f&&(m=B),S){case this._SCANNING_FOR_INCOMING:if(z.getEdgeRing()!==f)continue;v=z,S=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(B.getEdgeRing()!==f)continue;v.setNextMin(B),S=this._SCANNING_FOR_INCOMING}}S===this._LINKING_TO_OUTGOING&&(ot.isTrue(m!==null,"found null for first outgoing dirEdge"),ot.isTrue(m.getEdgeRing()===f,"unable to link last incoming dirEdge"),v.setNextMin(m))},u.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var f=0,m=this.iterator();m.hasNext();)m.next().isInResult()&&f++;return f}if(arguments.length===1){for(var v=arguments[0],S=0,M=this.iterator();M.hasNext();)M.next().getEdgeRing()===v&&S++;return S}},u.prototype.getLabel=function(){return this._label},u.prototype.findCoveredLineEdges=function(){for(var f=U.NONE,m=this.iterator();m.hasNext();){var v=m.next(),S=v.getSym();if(!v.isLineEdge()){if(v.isInResult()){f=U.INTERIOR;break}if(S.isInResult()){f=U.EXTERIOR;break}}}if(f===U.NONE)return null;for(var M=f,B=this.iterator();B.hasNext();){var z=B.next(),te=z.getSym();z.isLineEdge()?z.getEdge().setCovered(M===U.INTERIOR):(z.isInResult()&&(M=U.EXTERIOR),te.isInResult()&&(M=U.INTERIOR))}},u.prototype.computeLabelling=function(f){a.prototype.computeLabelling.call(this,f),this._label=new Yr(U.NONE);for(var m=this.iterator();m.hasNext();)for(var v=m.next().getEdge().getLabel(),S=0;S<2;S++){var M=v.getLocation(S);M!==U.INTERIOR&&M!==U.BOUNDARY||this._label.setLocation(S,U.INTERIOR)}},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(xo),iN=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.createNode=function(f){return new eS(f,new Use)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Xy),$p=o(function a(){this._pts=null,this._orientation=null;var u=arguments[0];this._pts=u,this._orientation=a.orientation(u)},"t");$p.prototype.compareTo=function(a){var u=a;return $p.compareOriented(this._pts,this._orientation,u._pts,u._orientation)},$p.prototype.interfaces_=function(){return[j]},$p.prototype.getClass=function(){return $p},$p.orientation=function(a){return F.increasingDirection(a)===1},$p.compareOriented=function(a,u,f,m){for(var v=u?1:-1,S=m?1:-1,M=u?a.length:-1,B=m?f.length:-1,z=u?0:a.length-1,te=m?0:f.length-1;;){var pe=a[z].compareTo(f[te]);if(pe!==0)return pe;var be=(z+=v)===M,Xe=(te+=S)===B;if(be&&!Xe)return-1;if(!be&&Xe)return 1;if(be&&Xe)return 0}};var el=o(function(){this._edges=new He,this._ocaMap=new b},"Hn");el.prototype.print=function(a){a.print("MULTILINESTRING ( ");for(var u=0;u<this._edges.size();u++){var f=this._edges.get(u);u>0&&a.print(","),a.print("(");for(var m=f.getCoordinates(),v=0;v<m.length;v++)v>0&&a.print(","),a.print(m[v].x+" "+m[v].y);a.println(")")}a.print(") ")},el.prototype.addAll=function(a){for(var u=a.iterator();u.hasNext();)this.add(u.next())},el.prototype.findEdgeIndex=function(a){for(var u=0;u<this._edges.size();u++)if(this._edges.get(u).equals(a))return u;return-1},el.prototype.iterator=function(){return this._edges.iterator()},el.prototype.getEdges=function(){return this._edges},el.prototype.get=function(a){return this._edges.get(a)},el.prototype.findEqualEdge=function(a){var u=new $p(a.getCoordinates());return this._ocaMap.get(u)},el.prototype.add=function(a){this._edges.add(a);var u=new $p(a.getCoordinates());this._ocaMap.put(u,a)},el.prototype.interfaces_=function(){return[]},el.prototype.getClass=function(){return el};var Td=o(function(){},"Wn");Td.prototype.processIntersections=function(a,u,f,m){},Td.prototype.isDone=function(){},Td.prototype.interfaces_=function(){return[]},Td.prototype.getClass=function(){return Td};var na=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 a=arguments[0];this._li=a},"Kn");na.prototype.isTrivialIntersection=function(a,u,f,m){if(a===f&&this._li.getIntersectionNum()===1){if(na.isAdjacentSegments(u,m))return!0;if(a.isClosed()){var v=a.size()-1;if(u===0&&m===v||m===0&&u===v)return!0}}return!1},na.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},na.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},na.prototype.getLineIntersector=function(){return this._li},na.prototype.hasProperIntersection=function(){return this._hasProper},na.prototype.processIntersections=function(a,u,f,m){if(a===f&&u===m)return null;this.numTests++;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],B=f.getCoordinates()[m+1];this._li.computeIntersection(v,S,M,B),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(a,u,f,m)||(this._hasIntersection=!0,a.addIntersections(this._li,u,0),f.addIntersections(this._li,m,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},na.prototype.hasIntersection=function(){return this._hasIntersection},na.prototype.isDone=function(){return!1},na.prototype.hasInteriorIntersection=function(){return this._hasInterior},na.prototype.interfaces_=function(){return[Td]},na.prototype.getClass=function(){return na},na.isAdjacentSegments=function(a,u){return Math.abs(a-u)===1};var Pl=o(function(){this.coord=null,this.segmentIndex=null,this.dist=null;var a=arguments[0],u=arguments[1],f=arguments[2];this.coord=new N(a),this.segmentIndex=u,this.dist=f},"Jn");Pl.prototype.getSegmentIndex=function(){return this.segmentIndex},Pl.prototype.getCoordinate=function(){return this.coord},Pl.prototype.print=function(a){a.print(this.coord),a.print(" seg # = "+this.segmentIndex),a.println(" dist = "+this.dist)},Pl.prototype.compareTo=function(a){var u=a;return this.compare(u.segmentIndex,u.dist)},Pl.prototype.isEndPoint=function(a){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===a},Pl.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Pl.prototype.getDistance=function(){return this.dist},Pl.prototype.compare=function(a,u){return this.segmentIndex<a?-1:this.segmentIndex>a?1:this.dist<u?-1:this.dist>u?1:0},Pl.prototype.interfaces_=function(){return[j]},Pl.prototype.getClass=function(){return Pl};var yu=o(function(){this._nodeMap=new b,this.edge=null;var a=arguments[0];this.edge=a},"Qn");yu.prototype.print=function(a){a.println("Intersections:");for(var u=this.iterator();u.hasNext();)u.next().print(a)},yu.prototype.iterator=function(){return this._nodeMap.values().iterator()},yu.prototype.addSplitEdges=function(a){this.addEndpoints();for(var u=this.iterator(),f=u.next();u.hasNext();){var m=u.next(),v=this.createSplitEdge(f,m);a.add(v),f=m}},yu.prototype.addEndpoints=function(){var a=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[a],a,0)},yu.prototype.createSplitEdge=function(a,u){var f=u.segmentIndex-a.segmentIndex+2,m=this.edge.pts[u.segmentIndex],v=u.dist>0||!u.coord.equals2D(m);v||f--;var S=new Array(f).fill(null),M=0;S[M++]=new N(a.coord);for(var B=a.segmentIndex+1;B<=u.segmentIndex;B++)S[M++]=this.edge.pts[B];return v&&(S[M]=u.coord),new rS(S,new Yr(this.edge._label))},yu.prototype.add=function(a,u,f){var m=new Pl(a,u,f),v=this._nodeMap.get(m);return v!==null?v:(this._nodeMap.put(m,m),m)},yu.prototype.isIntersection=function(a){for(var u=this.iterator();u.hasNext();)if(u.next().coord.equals(a))return!0;return!1},yu.prototype.interfaces_=function(){return[]},yu.prototype.getClass=function(){return yu};var Ed=o(function(){},"Zn");Ed.prototype.getChainStartIndices=function(a){var u=0,f=new He;f.add(new ve(u));do{var m=this.findChainEnd(a,u);f.add(new ve(m)),u=m}while(u<a.length-1);return Ed.toIntArray(f)},Ed.prototype.findChainEnd=function(a,u){for(var f=hn.quadrant(a[u],a[u+1]),m=u+1;m<a.length&&hn.quadrant(a[m-1],a[m])===f;)m++;return m-1},Ed.prototype.interfaces_=function(){return[]},Ed.prototype.getClass=function(){return Ed},Ed.toIntArray=function(a){for(var u=new Array(a.size()).fill(null),f=0;f<u.length;f++)u[f]=a.get(f).intValue();return u};var Sc=o(function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new ie,this.env2=new ie;var a=arguments[0];this.e=a,this.pts=a.getCoordinates();var u=new Ed;this.startIndex=u.getChainStartIndices(this.pts)},"$n");Sc.prototype.getCoordinates=function(){return this.pts},Sc.prototype.getMaxX=function(a){var u=this.pts[this.startIndex[a]].x,f=this.pts[this.startIndex[a+1]].x;return u>f?u:f},Sc.prototype.getMinX=function(a){var u=this.pts[this.startIndex[a]].x,f=this.pts[this.startIndex[a+1]].x;return u<f?u:f},Sc.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];this.computeIntersectsForChain(this.startIndex[a],this.startIndex[a+1],u,u.startIndex[f],u.startIndex[f+1],m)}else if(arguments.length===6){var v=arguments[0],S=arguments[1],M=arguments[2],B=arguments[3],z=arguments[4],te=arguments[5],pe=this.pts[v],be=this.pts[S],Xe=M.pts[B],Ke=M.pts[z];if(S-v==1&&z-B==1)return te.addIntersections(this.e,v,M.e,B),null;if(this.env1.init(pe,be),this.env2.init(Xe,Ke),!this.env1.intersects(this.env2))return null;var it=Math.trunc((v+S)/2),mt=Math.trunc((B+z)/2);v<it&&(B<mt&&this.computeIntersectsForChain(v,it,M,B,mt,te),mt<z&&this.computeIntersectsForChain(v,it,M,mt,z,te)),it<S&&(B<mt&&this.computeIntersectsForChain(it,S,M,B,mt,te),mt<z&&this.computeIntersectsForChain(it,S,M,mt,z,te))}},Sc.prototype.getStartIndexes=function(){return this.startIndex},Sc.prototype.computeIntersects=function(a,u){for(var f=0;f<this.startIndex.length-1;f++)for(var m=0;m<a.startIndex.length-1;m++)this.computeIntersectsForChain(f,a,m,u)},Sc.prototype.interfaces_=function(){return[]},Sc.prototype.getClass=function(){return Sc};var io=o(function a(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var u=0;u<2;u++)for(var f=0;f<3;f++)this._depth[u][f]=a.NULL_VALUE},"t"),oN={NULL_VALUE:{configurable:!0}};io.prototype.getDepth=function(a,u){return this._depth[a][u]},io.prototype.setDepth=function(a,u,f){this._depth[a][u]=f},io.prototype.isNull=function(){if(arguments.length===0){for(var a=0;a<2;a++)for(var u=0;u<3;u++)if(this._depth[a][u]!==io.NULL_VALUE)return!1;return!0}if(arguments.length===1){var f=arguments[0];return this._depth[f][1]===io.NULL_VALUE}if(arguments.length===2){var m=arguments[0],v=arguments[1];return this._depth[m][v]===io.NULL_VALUE}},io.prototype.normalize=function(){for(var a=0;a<2;a++)if(!this.isNull(a)){var u=this._depth[a][1];this._depth[a][2]<u&&(u=this._depth[a][2]),u<0&&(u=0);for(var f=1;f<3;f++){var m=0;this._depth[a][f]>u&&(m=1),this._depth[a][f]=m}}},io.prototype.getDelta=function(a){return this._depth[a][Ge.RIGHT]-this._depth[a][Ge.LEFT]},io.prototype.getLocation=function(a,u){return this._depth[a][u]<=0?U.EXTERIOR:U.INTERIOR},io.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},io.prototype.add=function(){if(arguments.length===1)for(var a=arguments[0],u=0;u<2;u++)for(var f=1;f<3;f++){var m=a.getLocation(u,f);m!==U.EXTERIOR&&m!==U.INTERIOR||(this.isNull(u,f)?this._depth[u][f]=io.depthAtLocation(m):this._depth[u][f]+=io.depthAtLocation(m))}else if(arguments.length===3){var v=arguments[0],S=arguments[1];arguments[2]===U.INTERIOR&&this._depth[v][S]++}},io.prototype.interfaces_=function(){return[]},io.prototype.getClass=function(){return io},io.depthAtLocation=function(a){return a===U.EXTERIOR?0:a===U.INTERIOR?1:io.NULL_VALUE},oN.NULL_VALUE.get=function(){return-1},Object.defineProperties(io,oN);var rS=function(a){function u(){if(a.call(this),this.pts=null,this._env=null,this.eiList=new yu(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new io,this._depthDelta=0,arguments.length===1){var f=arguments[0];u.call(this,f,null)}else if(arguments.length===2){var m=arguments[0],v=arguments[1];this.pts=m,this._label=v}}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.getDepth=function(){return this._depth},u.prototype.getCollapsedEdge=function(){var f=new Array(2).fill(null);return f[0]=this.pts[0],f[1]=this.pts[1],new u(f,Yr.toLineLabel(this._label))},u.prototype.isIsolated=function(){return this._isIsolated},u.prototype.getCoordinates=function(){return this.pts},u.prototype.setIsolated=function(f){this._isIsolated=f},u.prototype.setName=function(f){this._name=f},u.prototype.equals=function(f){if(!(f instanceof u))return!1;var m=f;if(this.pts.length!==m.pts.length)return!1;for(var v=!0,S=!0,M=this.pts.length,B=0;B<this.pts.length;B++)if(this.pts[B].equals2D(m.pts[B])||(v=!1),this.pts[B].equals2D(m.pts[--M])||(S=!1),!v&&!S)return!1;return!0},u.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var f=arguments[0];return this.pts[f]}},u.prototype.print=function(f){f.print("edge "+this._name+": "),f.print("LINESTRING (");for(var m=0;m<this.pts.length;m++)m>0&&f.print(","),f.print(this.pts[m].x+" "+this.pts[m].y);f.print(") "+this._label+" "+this._depthDelta)},u.prototype.computeIM=function(f){u.updateIM(this._label,f)},u.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},u.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},u.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},u.prototype.getDepthDelta=function(){return this._depthDelta},u.prototype.getNumPoints=function(){return this.pts.length},u.prototype.printReverse=function(f){f.print("edge "+this._name+": ");for(var m=this.pts.length-1;m>=0;m--)f.print(this.pts[m]+" ");f.println("")},u.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Sc(this)),this._mce},u.prototype.getEnvelope=function(){if(this._env===null){this._env=new ie;for(var f=0;f<this.pts.length;f++)this._env.expandToInclude(this.pts[f])}return this._env},u.prototype.addIntersection=function(f,m,v,S){var M=new N(f.getIntersection(S)),B=m,z=f.getEdgeDistance(v,S),te=B+1;if(te<this.pts.length){var pe=this.pts[te];M.equals2D(pe)&&(B=te,z=0)}this.eiList.add(M,B,z)},u.prototype.toString=function(){var f=new Ue;f.append("edge "+this._name+": "),f.append("LINESTRING (");for(var m=0;m<this.pts.length;m++)m>0&&f.append(","),f.append(this.pts[m].x+" "+this.pts[m].y);return f.append(") "+this._label+" "+this._depthDelta),f.toString()},u.prototype.isPointwiseEqual=function(f){if(this.pts.length!==f.pts.length)return!1;for(var m=0;m<this.pts.length;m++)if(!this.pts[m].equals2D(f.pts[m]))return!1;return!0},u.prototype.setDepthDelta=function(f){this._depthDelta=f},u.prototype.getEdgeIntersectionList=function(){return this.eiList},u.prototype.addIntersections=function(f,m,v){for(var S=0;S<f.getIntersectionNum();S++)this.addIntersection(f,m,v,S)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.updateIM=function(){if(arguments.length!==2)return a.prototype.updateIM.apply(this,arguments);var f=arguments[0],m=arguments[1];m.setAtLeastIfValid(f.getLocation(0,Ge.ON),f.getLocation(1,Ge.ON),1),f.isArea()&&(m.setAtLeastIfValid(f.getLocation(0,Ge.LEFT),f.getLocation(1,Ge.LEFT),2),m.setAtLeastIfValid(f.getLocation(0,Ge.RIGHT),f.getLocation(1,Ge.RIGHT),2))},u}(ea),$o=o(function(a){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new el,this._bufParams=a||null},"ii");$o.prototype.setWorkingPrecisionModel=function(a){this._workingPrecisionModel=a},$o.prototype.insertUniqueEdge=function(a){var u=this._edgeList.findEqualEdge(a);if(u!==null){var f=u.getLabel(),m=a.getLabel();u.isPointwiseEqual(a)||(m=new Yr(a.getLabel())).flip(),f.merge(m);var v=$o.depthDelta(m),S=u.getDepthDelta()+v;u.setDepthDelta(S)}else this._edgeList.add(a),a.setDepthDelta($o.depthDelta(a.getLabel()))},$o.prototype.buildSubgraphs=function(a,u){for(var f=new He,m=a.iterator();m.hasNext();){var v=m.next(),S=v.getRightmostCoordinate(),M=new tm(f).getDepth(S);v.computeDepth(M),v.findResultEdges(),f.add(v),u.add(v.getDirectedEdges(),v.getNodes())}},$o.prototype.createSubgraphs=function(a){for(var u=new He,f=a.getNodes().iterator();f.hasNext();){var m=f.next();if(!m.isVisited()){var v=new Bo;v.create(m),u.add(v)}}return Qa.sort(u,Qa.reverseOrder()),u},$o.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},$o.prototype.getNoder=function(a){if(this._workingNoder!==null)return this._workingNoder;var u=new gE,f=new Ro;return f.setPrecisionModel(a),u.setSegmentIntersector(new na(f)),u},$o.prototype.buffer=function(a,u){var f=this._workingPrecisionModel;f===null&&(f=a.getPrecisionModel()),this._geomFact=a.getFactory();var m=new as(f,this._bufParams),v=new Pa(a,u,m).getCurves();if(v.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(v,f),this._graph=new Zn(new iN),this._graph.addEdges(this._edgeList.getEdges());var S=this.createSubgraphs(this._graph),M=new Ls(this._geomFact);this.buildSubgraphs(S,M);var B=M.getPolygons();return B.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(B)},$o.prototype.computeNodedEdges=function(a,u){var f=this.getNoder(u);f.computeNodes(a);for(var m=f.getNodedSubstrings().iterator();m.hasNext();){var v=m.next(),S=v.getCoordinates();if(S.length!==2||!S[0].equals2D(S[1])){var M=v.getData(),B=new rS(v.getCoordinates(),new Yr(M));this.insertUniqueEdge(B)}}},$o.prototype.setNoder=function(a){this._workingNoder=a},$o.prototype.interfaces_=function(){return[]},$o.prototype.getClass=function(){return $o},$o.depthDelta=function(a){var u=a.getLocation(0,Ge.LEFT),f=a.getLocation(0,Ge.RIGHT);return u===U.INTERIOR&&f===U.EXTERIOR?1:u===U.EXTERIOR&&f===U.INTERIOR?-1:0},$o.convertSegStrings=function(a){for(var u=new jt,f=new He;a.hasNext();){var m=a.next(),v=u.createLineString(m.getCoordinates());f.add(v)}return u.buildGeometry(f)};var Gp=o(function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var a=arguments[0],u=arguments[1];this._noder=a,this._scaleFactor=u,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var f=arguments[0],m=arguments[1],v=arguments[2],S=arguments[3];this._noder=f,this._scaleFactor=m,this._offsetX=v,this._offsetY=S,this._isScaled=!this.isIntegerPrecision()}},"ri");Gp.prototype.rescale=function(){if(ne(arguments[0],On))for(var a=arguments[0].iterator();a.hasNext();){var u=a.next();this.rescale(u.getCoordinates())}else if(arguments[0]instanceof Array){for(var f=arguments[0],m=0;m<f.length;m++)f[m].x=f[m].x/this._scaleFactor+this._offsetX,f[m].y=f[m].y/this._scaleFactor+this._offsetY;f.length===2&&f[0].equals2D(f[1])&&we.out.println(f)}},Gp.prototype.scale=function(){if(ne(arguments[0],On)){for(var a=arguments[0],u=new He,f=a.iterator();f.hasNext();){var m=f.next();u.add(new li(this.scale(m.getCoordinates()),m.getData()))}return u}if(arguments[0]instanceof Array){for(var v=arguments[0],S=new Array(v.length).fill(null),M=0;M<v.length;M++)S[M]=new N(Math.round((v[M].x-this._offsetX)*this._scaleFactor),Math.round((v[M].y-this._offsetY)*this._scaleFactor),v[M].z);return F.removeRepeatedPoints(S)}},Gp.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},Gp.prototype.getNodedSubstrings=function(){var a=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(a),a},Gp.prototype.computeNodes=function(a){var u=a;this._isScaled&&(u=this.scale(a)),this._noder.computeNodes(u)},Gp.prototype.interfaces_=function(){return[wd]},Gp.prototype.getClass=function(){return Gp};var Tl=o(function(){this._li=new Ro,this._segStrings=null;var a=arguments[0];this._segStrings=a},"oi"),sN={fact:{configurable:!0}};Tl.prototype.checkEndPtVertexIntersections=function(){if(arguments.length===0)for(var a=this._segStrings.iterator();a.hasNext();){var u=a.next().getCoordinates();this.checkEndPtVertexIntersections(u[0],this._segStrings),this.checkEndPtVertexIntersections(u[u.length-1],this._segStrings)}else if(arguments.length===2){for(var f=arguments[0],m=arguments[1].iterator();m.hasNext();)for(var v=m.next().getCoordinates(),S=1;S<v.length-1;S++)if(v[S].equals(f))throw new Er("found endpt/interior pt intersection at index "+S+" :pt "+f)}},Tl.prototype.checkInteriorIntersections=function(){if(arguments.length===0)for(var a=this._segStrings.iterator();a.hasNext();)for(var u=a.next(),f=this._segStrings.iterator();f.hasNext();){var m=f.next();this.checkInteriorIntersections(u,m)}else if(arguments.length===2)for(var v=arguments[0],S=arguments[1],M=v.getCoordinates(),B=S.getCoordinates(),z=0;z<M.length-1;z++)for(var te=0;te<B.length-1;te++)this.checkInteriorIntersections(v,z,S,te);else if(arguments.length===4){var pe=arguments[0],be=arguments[1],Xe=arguments[2],Ke=arguments[3];if(pe===Xe&&be===Ke)return null;var it=pe.getCoordinates()[be],mt=pe.getCoordinates()[be+1],Zr=Xe.getCoordinates()[Ke],Ii=Xe.getCoordinates()[Ke+1];if(this._li.computeIntersection(it,mt,Zr,Ii),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,it,mt)||this.hasInteriorIntersection(this._li,Zr,Ii)))throw new Er("found non-noded intersection at "+it+"-"+mt+" and "+Zr+"-"+Ii)}},Tl.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Tl.prototype.checkCollapses=function(){if(arguments.length===0)for(var a=this._segStrings.iterator();a.hasNext();){var u=a.next();this.checkCollapses(u)}else if(arguments.length===1)for(var f=arguments[0].getCoordinates(),m=0;m<f.length-2;m++)this.checkCollapse(f[m],f[m+1],f[m+2])},Tl.prototype.hasInteriorIntersection=function(a,u,f){for(var m=0;m<a.getIntersectionNum();m++){var v=a.getIntersection(m);if(!v.equals(u)&&!v.equals(f))return!0}return!1},Tl.prototype.checkCollapse=function(a,u,f){if(a.equals(f))throw new Er("found non-noded collapse at "+Tl.fact.createLineString([a,u,f]))},Tl.prototype.interfaces_=function(){return[]},Tl.prototype.getClass=function(){return Tl},sN.fact.get=function(){return new jt},Object.defineProperties(Tl,sN);var ls=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 a=arguments[0],u=arguments[1],f=arguments[2];if(this._originalPt=a,this._pt=a,this._scaleFactor=u,this._li=f,u<=0)throw new D("Scale factor must be non-zero");u!==1&&(this._pt=new N(this.scale(a.x),this.scale(a.y)),this._p0Scaled=new N,this._p1Scaled=new N),this.initCorners(this._pt)},"ai"),aN={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ls.prototype.intersectsScaled=function(a,u){var f=Math.min(a.x,u.x),m=Math.max(a.x,u.x),v=Math.min(a.y,u.y),S=Math.max(a.y,u.y),M=this._maxx<f||this._minx>m||this._maxy<v||this._miny>S;if(M)return!1;var B=this.intersectsToleranceSquare(a,u);return ot.isTrue(!(M&&B),"Found bad envelope test"),B},ls.prototype.initCorners=function(a){this._minx=a.x-.5,this._maxx=a.x+.5,this._miny=a.y-.5,this._maxy=a.y+.5,this._corner[0]=new N(this._maxx,this._maxy),this._corner[1]=new N(this._minx,this._maxy),this._corner[2]=new N(this._minx,this._miny),this._corner[3]=new N(this._maxx,this._miny)},ls.prototype.intersects=function(a,u){return this._scaleFactor===1?this.intersectsScaled(a,u):(this.copyScaled(a,this._p0Scaled),this.copyScaled(u,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ls.prototype.scale=function(a){return Math.round(a*this._scaleFactor)},ls.prototype.getCoordinate=function(){return this._originalPt},ls.prototype.copyScaled=function(a,u){u.x=this.scale(a.x),u.y=this.scale(a.y)},ls.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var a=ls.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new ie(this._originalPt.x-a,this._originalPt.x+a,this._originalPt.y-a,this._originalPt.y+a)}return this._safeEnv},ls.prototype.intersectsPixelClosure=function(a,u){return this._li.computeIntersection(a,u,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(a,u,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(a,u,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(a,u,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},ls.prototype.intersectsToleranceSquare=function(a,u){var f=!1,m=!1;return this._li.computeIntersection(a,u,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(a,u,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(f=!0),this._li.computeIntersection(a,u,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(m=!0),this._li.computeIntersection(a,u,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!f||!m)||!!a.equals(this._pt)||!!u.equals(this._pt))))},ls.prototype.addSnappedNode=function(a,u){var f=a.getCoordinate(u),m=a.getCoordinate(u+1);return!!this.intersects(f,m)&&(a.addIntersection(this.getCoordinate(),u),!0)},ls.prototype.interfaces_=function(){return[]},ls.prototype.getClass=function(){return ls},aN.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(ls,aN);var Mb=o(function(){this.tempEnv1=new ie,this.selectedSegment=new ct},"li");Mb.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var a=arguments[0],u=arguments[1];a.getLineSegment(u,this.selectedSegment),this.select(this.selectedSegment)}}},Mb.prototype.interfaces_=function(){return[]},Mb.prototype.getClass=function(){return Mb};var Jy=o(function(){this._index=null;var a=arguments[0];this._index=a},"ci"),lN={HotPixelSnapAction:{configurable:!0}};Jy.prototype.snap=function(){if(arguments.length===1){var a=arguments[0];return this.snap(a,null,-1)}if(arguments.length===3){var u=arguments[0],f=arguments[1],m=arguments[2],v=u.getSafeEnvelope(),S=new uN(u,f,m);return this._index.query(v,{interfaces_:o(function(){return[Bp]},"interfaces_"),visitItem:o(function(M){M.select(v,S)},"visitItem")}),S.isNodeAdded()}},Jy.prototype.interfaces_=function(){return[]},Jy.prototype.getClass=function(){return Jy},lN.HotPixelSnapAction.get=function(){return uN},Object.defineProperties(Jy,lN);var uN=function(a){function u(){a.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var f=arguments[0],m=arguments[1],v=arguments[2];this._hotPixel=f,this._parentEdge=m,this._hotPixelVertexIndex=v}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.isNodeAdded=function(){return this._isNodeAdded},u.prototype.select=function(){if(arguments.length!==2)return a.prototype.select.apply(this,arguments);var f=arguments[0],m=arguments[1],v=f.getContext();if(this._parentEdge!==null&&v===this._parentEdge&&m===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(v,m)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Mb),rm=o(function(){this._li=null,this._interiorIntersections=null;var a=arguments[0];this._li=a,this._interiorIntersections=new He},"fi");rm.prototype.processIntersections=function(a,u,f,m){if(a===f&&u===m)return null;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],B=f.getCoordinates()[m+1];if(this._li.computeIntersection(v,S,M,B),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var z=0;z<this._li.getIntersectionNum();z++)this._interiorIntersections.add(this._li.getIntersection(z));a.addIntersections(this._li,u,0),f.addIntersections(this._li,m,1)}},rm.prototype.isDone=function(){return!1},rm.prototype.getInteriorIntersections=function(){return this._interiorIntersections},rm.prototype.interfaces_=function(){return[Td]},rm.prototype.getClass=function(){return rm};var vu=o(function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var a=arguments[0];this._pm=a,this._li=new Ro,this._li.setPrecisionModel(a),this._scaleFactor=a.getScale()},"gi");vu.prototype.checkCorrectness=function(a){var u=li.getNodedSubstrings(a),f=new Tl(u);try{f.checkValid()}catch(m){if(!(m instanceof We))throw m;m.printStackTrace()}},vu.prototype.getNodedSubstrings=function(){return li.getNodedSubstrings(this._nodedSegStrings)},vu.prototype.snapRound=function(a,u){var f=this.findInteriorIntersections(a,u);this.computeIntersectionSnaps(f),this.computeVertexSnaps(a)},vu.prototype.findInteriorIntersections=function(a,u){var f=new rm(u);return this._noder.setSegmentIntersector(f),this._noder.computeNodes(a),f.getInteriorIntersections()},vu.prototype.computeVertexSnaps=function(){if(ne(arguments[0],On))for(var a=arguments[0].iterator();a.hasNext();){var u=a.next();this.computeVertexSnaps(u)}else if(arguments[0]instanceof li)for(var f=arguments[0],m=f.getCoordinates(),v=0;v<m.length;v++){var S=new ls(m[v],this._scaleFactor,this._li);this._pointSnapper.snap(S,f,v)&&f.addIntersection(m[v],v)}},vu.prototype.computeNodes=function(a){this._nodedSegStrings=a,this._noder=new gE,this._pointSnapper=new Jy(this._noder.getIndex()),this.snapRound(a,this._li)},vu.prototype.computeIntersectionSnaps=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next(),m=new ls(f,this._scaleFactor,this._li);this._pointSnapper.snap(m)}},vu.prototype.interfaces_=function(){return[wd]},vu.prototype.getClass=function(){return vu};var oo=o(function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Or,this._resultGeometry=null,this._saveException=null,arguments.length===1){var a=arguments[0];this._argGeom=a}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this._argGeom=u,this._bufParams=f}},"di"),Qy={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};oo.prototype.bufferFixedPrecision=function(a){var u=new Gp(new vu(new Mr(1)),a.getScale()),f=new $o(this._bufParams);f.setWorkingPrecisionModel(a),f.setNoder(u),this._resultGeometry=f.buffer(this._argGeom,this._distance)},oo.prototype.bufferReducedPrecision=function(){var a=this;if(arguments.length===0){for(var u=oo.MAX_PRECISION_DIGITS;u>=0;u--){try{a.bufferReducedPrecision(u)}catch(S){if(!(S instanceof xc))throw S;a._saveException=S}if(a._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var f=arguments[0],m=oo.precisionScaleFactor(this._argGeom,this._distance,f),v=new Mr(m);this.bufferFixedPrecision(v)}},oo.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var a=this._argGeom.getFactory().getPrecisionModel();a.getType()===Mr.FIXED?this.bufferFixedPrecision(a):this.bufferReducedPrecision()},oo.prototype.setQuadrantSegments=function(a){this._bufParams.setQuadrantSegments(a)},oo.prototype.bufferOriginalPrecision=function(){try{var a=new $o(this._bufParams);this._resultGeometry=a.buffer(this._argGeom,this._distance)}catch(u){if(!(u instanceof Er))throw u;this._saveException=u}},oo.prototype.getResultGeometry=function(a){return this._distance=a,this.computeGeometry(),this._resultGeometry},oo.prototype.setEndCapStyle=function(a){this._bufParams.setEndCapStyle(a)},oo.prototype.interfaces_=function(){return[]},oo.prototype.getClass=function(){return oo},oo.bufferOp=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];return new oo(a).getResultGeometry(u)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof vt&&typeof arguments[1]=="number"){var f=arguments[0],m=arguments[1],v=arguments[2],S=new oo(f);return S.setQuadrantSegments(v),S.getResultGeometry(m)}if(arguments[2]instanceof Or&&arguments[0]instanceof vt&&typeof arguments[1]=="number"){var M=arguments[0],B=arguments[1],z=arguments[2];return new oo(M,z).getResultGeometry(B)}}else if(arguments.length===4){var te=arguments[0],pe=arguments[1],be=arguments[2],Xe=arguments[3],Ke=new oo(te);return Ke.setQuadrantSegments(be),Ke.setEndCapStyle(Xe),Ke.getResultGeometry(pe)}},oo.precisionScaleFactor=function(a,u,f){var m=a.getEnvelopeInternal(),v=Ce.max(Math.abs(m.getMaxX()),Math.abs(m.getMaxY()),Math.abs(m.getMinX()),Math.abs(m.getMinY()))+2*(u>0?u:0),S=f-Math.trunc(Math.log(v)/Math.log(10)+1);return Math.pow(10,S)},Qy.CAP_ROUND.get=function(){return Or.CAP_ROUND},Qy.CAP_BUTT.get=function(){return Or.CAP_FLAT},Qy.CAP_FLAT.get=function(){return Or.CAP_FLAT},Qy.CAP_SQUARE.get=function(){return Or.CAP_SQUARE},Qy.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(oo,Qy);var Go=o(function(){this._pt=[new N,new N],this._distance=A.NaN,this._isNull=!0},"_i");Go.prototype.getCoordinates=function(){return this._pt},Go.prototype.getCoordinate=function(a){return this._pt[a]},Go.prototype.setMinimum=function(){if(arguments.length===1){var a=arguments[0];this.setMinimum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m<this._distance&&this.initialize(u,f,m)}},Go.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var a=arguments[0],u=arguments[1];this._pt[0].setCoordinate(a),this._pt[1].setCoordinate(u),this._distance=a.distance(u),this._isNull=!1}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this._pt[0].setCoordinate(f),this._pt[1].setCoordinate(m),this._distance=v,this._isNull=!1}},Go.prototype.getDistance=function(){return this._distance},Go.prototype.setMaximum=function(){if(arguments.length===1){var a=arguments[0];this.setMaximum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m>this._distance&&this.initialize(u,f,m)}},Go.prototype.interfaces_=function(){return[]},Go.prototype.getClass=function(){return Go};var bu=o(function(){},"mi");bu.prototype.interfaces_=function(){return[]},bu.prototype.getClass=function(){return bu},bu.computeDistance=function(){if(arguments[2]instanceof Go&&arguments[0]instanceof Gt&&arguments[1]instanceof N)for(var a=arguments[0],u=arguments[1],f=arguments[2],m=a.getCoordinates(),v=new ct,S=0;S<m.length-1;S++){v.setCoordinates(m[S],m[S+1]);var M=v.closestPoint(u);f.setMinimum(M,u)}else if(arguments[2]instanceof Go&&arguments[0]instanceof Xr&&arguments[1]instanceof N){var B=arguments[0],z=arguments[1],te=arguments[2];bu.computeDistance(B.getExteriorRing(),z,te);for(var pe=0;pe<B.getNumInteriorRing();pe++)bu.computeDistance(B.getInteriorRingN(pe),z,te)}else if(arguments[2]instanceof Go&&arguments[0]instanceof vt&&arguments[1]instanceof N){var be=arguments[0],Xe=arguments[1],Ke=arguments[2];if(be instanceof Gt)bu.computeDistance(be,Xe,Ke);else if(be instanceof Xr)bu.computeDistance(be,Xe,Ke);else if(be instanceof xt)for(var it=be,mt=0;mt<it.getNumGeometries();mt++){var Zr=it.getGeometryN(mt);bu.computeDistance(Zr,Xe,Ke)}else Ke.setMinimum(be.getCoordinate(),Xe)}else if(arguments[2]instanceof Go&&arguments[0]instanceof ct&&arguments[1]instanceof N){var Ii=arguments[0],qo=arguments[1],Su=arguments[2],Xp=Ii.closestPoint(qo);Su.setMinimum(Xp,qo)}};var Md=o(function(a){this._maxPtDist=new Go,this._inputGeom=a||null},"vi"),yE={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Md.prototype.computeMaxMidpointDistance=function(a){var u=new Up(this._inputGeom);a.apply(u),this._maxPtDist.setMaximum(u.getMaxPointDistance())},Md.prototype.computeMaxVertexDistance=function(a){var u=new nm(this._inputGeom);a.apply(u),this._maxPtDist.setMaximum(u.getMaxPointDistance())},Md.prototype.findDistance=function(a){return this.computeMaxVertexDistance(a),this.computeMaxMidpointDistance(a),this._maxPtDist.getDistance()},Md.prototype.getDistancePoints=function(){return this._maxPtDist},Md.prototype.interfaces_=function(){return[]},Md.prototype.getClass=function(){return Md},yE.MaxPointDistanceFilter.get=function(){return nm},yE.MaxMidpointDistanceFilter.get=function(){return Up},Object.defineProperties(Md,yE);var nm=o(function(a){this._maxPtDist=new Go,this._minPtDist=new Go,this._geom=a||null},"Ei");nm.prototype.filter=function(a){this._minPtDist.initialize(),bu.computeDistance(this._geom,a,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},nm.prototype.getMaxPointDistance=function(){return this._maxPtDist},nm.prototype.interfaces_=function(){return[ts]},nm.prototype.getClass=function(){return nm};var Up=o(function(a){this._maxPtDist=new Go,this._minPtDist=new Go,this._geom=a||null},"xi");Up.prototype.filter=function(a,u){if(u===0)return null;var f=a.getCoordinate(u-1),m=a.getCoordinate(u),v=new N((f.x+m.x)/2,(f.y+m.y)/2);this._minPtDist.initialize(),bu.computeDistance(this._geom,v,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Up.prototype.isDone=function(){return!1},Up.prototype.isGeometryChanged=function(){return!1},Up.prototype.getMaxPointDistance=function(){return this._maxPtDist},Up.prototype.interfaces_=function(){return[kt]},Up.prototype.getClass=function(){return Up};var Cc=o(function(a){this._comps=a||null},"Ni");Cc.prototype.filter=function(a){a instanceof Xr&&this._comps.add(a)},Cc.prototype.interfaces_=function(){return[ht]},Cc.prototype.getClass=function(){return Cc},Cc.getPolygons=function(){if(arguments.length===1){var a=arguments[0];return Cc.getPolygons(a,new He)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u instanceof Xr?f.add(u):u instanceof xt&&u.apply(new Cc(f)),f}};var so=o(function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var a=arguments[0];this._lines=a}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this._lines=u,this._isForcedToLineString=f}},"Ci");so.prototype.filter=function(a){if(this._isForcedToLineString&&a instanceof os){var u=a.getFactory().createLineString(a.getCoordinateSequence());return this._lines.add(u),null}a instanceof Gt&&this._lines.add(a)},so.prototype.setForceToLineString=function(a){this._isForcedToLineString=a},so.prototype.interfaces_=function(){return[Ya]},so.prototype.getClass=function(){return so},so.getGeometry=function(){if(arguments.length===1){var a=arguments[0];return a.getFactory().buildGeometry(so.getLines(a))}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u.getFactory().buildGeometry(so.getLines(u,f))}},so.getLines=function(){if(arguments.length===1){var a=arguments[0];return so.getLines(a,!1)}if(arguments.length===2){if(ne(arguments[0],On)&&ne(arguments[1],On)){for(var u=arguments[0],f=arguments[1],m=u.iterator();m.hasNext();){var v=m.next();so.getLines(v,f)}return f}if(arguments[0]instanceof vt&&typeof arguments[1]=="boolean"){var S=arguments[0],M=arguments[1],B=new He;return S.apply(new so(B,M)),B}if(arguments[0]instanceof vt&&ne(arguments[1],On)){var z=arguments[0],te=arguments[1];return z instanceof Gt?te.add(z):z.apply(new so(te)),te}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&ne(arguments[0],On)&&ne(arguments[1],On)){for(var pe=arguments[0],be=arguments[1],Xe=arguments[2],Ke=pe.iterator();Ke.hasNext();){var it=Ke.next();so.getLines(it,be,Xe)}return be}if(typeof arguments[2]=="boolean"&&arguments[0]instanceof vt&&ne(arguments[1],On)){var mt=arguments[0],Zr=arguments[1],Ii=arguments[2];return mt.apply(new so(Zr,Ii)),Zr}}};var tl=o(function(){if(this._boundaryRule=ro.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var a=arguments[0];if(a===null)throw new D("Rule must be non-null");this._boundaryRule=a}}},"Si");tl.prototype.locateInternal=function(){if(arguments[0]instanceof N&&arguments[1]instanceof Xr){var a=arguments[0],u=arguments[1];if(u.isEmpty())return U.EXTERIOR;var f=u.getExteriorRing(),m=this.locateInPolygonRing(a,f);if(m===U.EXTERIOR)return U.EXTERIOR;if(m===U.BOUNDARY)return U.BOUNDARY;for(var v=0;v<u.getNumInteriorRing();v++){var S=u.getInteriorRingN(v),M=this.locateInPolygonRing(a,S);if(M===U.INTERIOR)return U.EXTERIOR;if(M===U.BOUNDARY)return U.BOUNDARY}return U.INTERIOR}if(arguments[0]instanceof N&&arguments[1]instanceof Gt){var B=arguments[0],z=arguments[1];if(!z.getEnvelopeInternal().intersects(B))return U.EXTERIOR;var te=z.getCoordinates();return z.isClosed()||!B.equals(te[0])&&!B.equals(te[te.length-1])?ze.isOnLine(B,te)?U.INTERIOR:U.EXTERIOR:U.BOUNDARY}if(arguments[0]instanceof N&&arguments[1]instanceof Gn){var pe=arguments[0];return arguments[1].getCoordinate().equals2D(pe)?U.INTERIOR:U.EXTERIOR}},tl.prototype.locateInPolygonRing=function(a,u){return u.getEnvelopeInternal().intersects(a)?ze.locatePointInRing(a,u.getCoordinates()):U.EXTERIOR},tl.prototype.intersects=function(a,u){return this.locate(a,u)!==U.EXTERIOR},tl.prototype.updateLocationInfo=function(a){a===U.INTERIOR&&(this._isIn=!0),a===U.BOUNDARY&&this._numBoundaries++},tl.prototype.computeLocation=function(a,u){if(u instanceof Gn&&this.updateLocationInfo(this.locateInternal(a,u)),u instanceof Gt)this.updateLocationInfo(this.locateInternal(a,u));else if(u instanceof Xr)this.updateLocationInfo(this.locateInternal(a,u));else if(u instanceof dn)for(var f=u,m=0;m<f.getNumGeometries();m++){var v=f.getGeometryN(m);this.updateLocationInfo(this.locateInternal(a,v))}else if(u instanceof Ka)for(var S=u,M=0;M<S.getNumGeometries();M++){var B=S.getGeometryN(M);this.updateLocationInfo(this.locateInternal(a,B))}else if(u instanceof xt)for(var z=new gu(u);z.hasNext();){var te=z.next();te!==u&&this.computeLocation(a,te)}},tl.prototype.locate=function(a,u){return u.isEmpty()?U.EXTERIOR:u instanceof Gt?this.locateInternal(a,u):u instanceof Xr?this.locateInternal(a,u):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(a,u),this._boundaryRule.isInBoundary(this._numBoundaries)?U.BOUNDARY:this._numBoundaries>0||this._isIn?U.INTERIOR:U.EXTERIOR)},tl.prototype.interfaces_=function(){return[]},tl.prototype.getClass=function(){return tl};var Uo=o(function a(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var u=arguments[0],f=arguments[1];a.call(this,u,a.INSIDE_AREA,f)}else if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];this._component=m,this._segIndex=v,this._pt=S}},"t"),cN={INSIDE_AREA:{configurable:!0}};Uo.prototype.isInsideArea=function(){return this._segIndex===Uo.INSIDE_AREA},Uo.prototype.getCoordinate=function(){return this._pt},Uo.prototype.getGeometryComponent=function(){return this._component},Uo.prototype.getSegmentIndex=function(){return this._segIndex},Uo.prototype.interfaces_=function(){return[]},Uo.prototype.getClass=function(){return Uo},cN.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Uo,cN);var Vp=o(function(a){this._pts=a||null},"wi");Vp.prototype.filter=function(a){a instanceof Gn&&this._pts.add(a)},Vp.prototype.interfaces_=function(){return[ht]},Vp.prototype.getClass=function(){return Vp},Vp.getPoints=function(){if(arguments.length===1){var a=arguments[0];return a instanceof Gn?Qa.singletonList(a):Vp.getPoints(a,new He)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u instanceof Gn?f.add(u):u instanceof xt&&u.apply(new Vp(f)),f}};var im=o(function(){this._locations=null;var a=arguments[0];this._locations=a},"Oi");im.prototype.filter=function(a){(a instanceof Gn||a instanceof Gt||a instanceof Xr)&&this._locations.add(new Uo(a,0,a.getCoordinate()))},im.prototype.interfaces_=function(){return[ht]},im.prototype.getClass=function(){return im},im.getLocations=function(a){var u=new He;return a.apply(new im(u)),u};var ao=o(function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new tl,this._minDistanceLocation=null,this._minDistance=A.MAX_VALUE,arguments.length===2){var a=arguments[0],u=arguments[1];this._geom=[a,u],this._terminateDistance=0}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=f,this._geom[1]=m,this._terminateDistance=v}},"Ti");ao.prototype.computeContainmentDistance=function(){if(arguments.length===0){var a=new Array(2).fill(null);if(this.computeContainmentDistance(0,a),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1],m=1-u,v=Cc.getPolygons(this._geom[u]);if(v.size()>0){var S=im.getLocations(this._geom[m]);if(this.computeContainmentDistance(S,v,f),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[m]=f[0],this._minDistanceLocation[u]=f[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&ne(arguments[0],ns)&&ne(arguments[1],ns)){for(var M=arguments[0],B=arguments[1],z=arguments[2],te=0;te<M.size();te++)for(var pe=M.get(te),be=0;be<B.size();be++)if(this.computeContainmentDistance(pe,B.get(be),z),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Uo&&arguments[1]instanceof Xr){var Xe=arguments[0],Ke=arguments[1],it=arguments[2],mt=Xe.getCoordinate();if(U.EXTERIOR!==this._ptLocator.locate(mt,Ke))return this._minDistance=0,it[0]=Xe,it[1]=new Uo(Ke,mt),null}}},ao.prototype.computeMinDistanceLinesPoints=function(a,u,f){for(var m=0;m<a.size();m++)for(var v=a.get(m),S=0;S<u.size();S++){var M=u.get(S);if(this.computeMinDistance(v,M,f),this._minDistance<=this._terminateDistance)return null}},ao.prototype.computeFacetDistance=function(){var a=new Array(2).fill(null),u=so.getLines(this._geom[0]),f=so.getLines(this._geom[1]),m=Vp.getPoints(this._geom[0]),v=Vp.getPoints(this._geom[1]);return this.computeMinDistanceLines(u,f,a),this.updateMinDistance(a,!1),this._minDistance<=this._terminateDistance?null:(a[0]=null,a[1]=null,this.computeMinDistanceLinesPoints(u,v,a),this.updateMinDistance(a,!1),this._minDistance<=this._terminateDistance?null:(a[0]=null,a[1]=null,this.computeMinDistanceLinesPoints(f,m,a),this.updateMinDistance(a,!0),this._minDistance<=this._terminateDistance?null:(a[0]=null,a[1]=null,this.computeMinDistancePoints(m,v,a),void this.updateMinDistance(a,!1))))},ao.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},ao.prototype.updateMinDistance=function(a,u){if(a[0]===null)return null;u?(this._minDistanceLocation[0]=a[1],this._minDistanceLocation[1]=a[0]):(this._minDistanceLocation[0]=a[0],this._minDistanceLocation[1]=a[1])},ao.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},ao.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 Gt&&arguments[1]instanceof Gn){var a=arguments[0],u=arguments[1],f=arguments[2];if(a.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var m=a.getCoordinates(),v=u.getCoordinate(),S=0;S<m.length-1;S++){var M=ze.distancePointLine(v,m[S],m[S+1]);if(M<this._minDistance){this._minDistance=M;var B=new ct(m[S],m[S+1]).closestPoint(v);f[0]=new Uo(a,S,B),f[1]=new Uo(u,0,v)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Gt&&arguments[1]instanceof Gt){var z=arguments[0],te=arguments[1],pe=arguments[2];if(z.getEnvelopeInternal().distance(te.getEnvelopeInternal())>this._minDistance)return null;for(var be=z.getCoordinates(),Xe=te.getCoordinates(),Ke=0;Ke<be.length-1;Ke++)for(var it=0;it<Xe.length-1;it++){var mt=ze.distanceLineLine(be[Ke],be[Ke+1],Xe[it],Xe[it+1]);if(mt<this._minDistance){this._minDistance=mt;var Zr=new ct(be[Ke],be[Ke+1]),Ii=new ct(Xe[it],Xe[it+1]),qo=Zr.closestPoints(Ii);pe[0]=new Uo(z,Ke,qo[0]),pe[1]=new Uo(te,it,qo[1])}if(this._minDistance<=this._terminateDistance)return null}}}},ao.prototype.computeMinDistancePoints=function(a,u,f){for(var m=0;m<a.size();m++)for(var v=a.get(m),S=0;S<u.size();S++){var M=u.get(S),B=v.getCoordinate().distance(M.getCoordinate());if(B<this._minDistance&&(this._minDistance=B,f[0]=new Uo(v,0,v.getCoordinate()),f[1]=new Uo(M,0,M.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},ao.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new D("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},ao.prototype.computeMinDistanceLines=function(a,u,f){for(var m=0;m<a.size();m++)for(var v=a.get(m),S=0;S<u.size();S++){var M=u.get(S);if(this.computeMinDistance(v,M,f),this._minDistance<=this._terminateDistance)return null}},ao.prototype.interfaces_=function(){return[]},ao.prototype.getClass=function(){return ao},ao.distance=function(a,u){return new ao(a,u).distance()},ao.isWithinDistance=function(a,u,f){return new ao(a,u,f).distance()<=f},ao.nearestPoints=function(a,u){return new ao(a,u).nearestPoints()};var Io=o(function(){this._pt=[new N,new N],this._distance=A.NaN,this._isNull=!0},"Ri");Io.prototype.getCoordinates=function(){return this._pt},Io.prototype.getCoordinate=function(a){return this._pt[a]},Io.prototype.setMinimum=function(){if(arguments.length===1){var a=arguments[0];this.setMinimum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m<this._distance&&this.initialize(u,f,m)}},Io.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var a=arguments[0],u=arguments[1];this._pt[0].setCoordinate(a),this._pt[1].setCoordinate(u),this._distance=a.distance(u),this._isNull=!1}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this._pt[0].setCoordinate(f),this._pt[1].setCoordinate(m),this._distance=v,this._isNull=!1}},Io.prototype.toString=function(){return Pt.toLineString(this._pt[0],this._pt[1])},Io.prototype.getDistance=function(){return this._distance},Io.prototype.setMaximum=function(){if(arguments.length===1){var a=arguments[0];this.setMaximum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m>this._distance&&this.initialize(u,f,m)}},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io};var El=o(function(){},"Pi");El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El},El.computeDistance=function(){if(arguments[2]instanceof Io&&arguments[0]instanceof Gt&&arguments[1]instanceof N)for(var a=arguments[0],u=arguments[1],f=arguments[2],m=new ct,v=a.getCoordinates(),S=0;S<v.length-1;S++){m.setCoordinates(v[S],v[S+1]);var M=m.closestPoint(u);f.setMinimum(M,u)}else if(arguments[2]instanceof Io&&arguments[0]instanceof Xr&&arguments[1]instanceof N){var B=arguments[0],z=arguments[1],te=arguments[2];El.computeDistance(B.getExteriorRing(),z,te);for(var pe=0;pe<B.getNumInteriorRing();pe++)El.computeDistance(B.getInteriorRingN(pe),z,te)}else if(arguments[2]instanceof Io&&arguments[0]instanceof vt&&arguments[1]instanceof N){var be=arguments[0],Xe=arguments[1],Ke=arguments[2];if(be instanceof Gt)El.computeDistance(be,Xe,Ke);else if(be instanceof Xr)El.computeDistance(be,Xe,Ke);else if(be instanceof xt)for(var it=be,mt=0;mt<it.getNumGeometries();mt++){var Zr=it.getGeometryN(mt);El.computeDistance(Zr,Xe,Ke)}else Ke.setMinimum(be.getCoordinate(),Xe)}else if(arguments[2]instanceof Io&&arguments[0]instanceof ct&&arguments[1]instanceof N){var Ii=arguments[0],qo=arguments[1],Su=arguments[2],Xp=Ii.closestPoint(qo);Su.setMinimum(Xp,qo)}};var Ta=o(function(){this._g0=null,this._g1=null,this._ptDist=new Io,this._densifyFrac=0;var a=arguments[0],u=arguments[1];this._g0=a,this._g1=u},"Di"),vE={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Ta.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Ta.prototype.setDensifyFraction=function(a){if(a>1||a<=0)throw new D("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=a},Ta.prototype.compute=function(a,u){this.computeOrientedDistance(a,u,this._ptDist),this.computeOrientedDistance(u,a,this._ptDist)},Ta.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ta.prototype.computeOrientedDistance=function(a,u,f){var m=new om(u);if(a.apply(m),f.setMaximum(m.getMaxPointDistance()),this._densifyFrac>0){var v=new zp(u,this._densifyFrac);a.apply(v),f.setMaximum(v.getMaxPointDistance())}},Ta.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ta.prototype.interfaces_=function(){return[]},Ta.prototype.getClass=function(){return Ta},Ta.distance=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];return new Ta(a,u).distance()}if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2],S=new Ta(f,m);return S.setDensifyFraction(v),S.distance()}},vE.MaxPointDistanceFilter.get=function(){return om},vE.MaxDensifiedByFractionDistanceFilter.get=function(){return zp},Object.defineProperties(Ta,vE);var om=o(function(){this._maxPtDist=new Io,this._minPtDist=new Io,this._euclideanDist=new El,this._geom=null;var a=arguments[0];this._geom=a},"Ai");om.prototype.filter=function(a){this._minPtDist.initialize(),El.computeDistance(this._geom,a,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},om.prototype.getMaxPointDistance=function(){return this._maxPtDist},om.prototype.interfaces_=function(){return[ts]},om.prototype.getClass=function(){return om};var zp=o(function(){this._maxPtDist=new Io,this._minPtDist=new Io,this._geom=null,this._numSubSegs=0;var a=arguments[0],u=arguments[1];this._geom=a,this._numSubSegs=Math.trunc(Math.round(1/u))},"Fi");zp.prototype.filter=function(a,u){if(u===0)return null;for(var f=a.getCoordinate(u-1),m=a.getCoordinate(u),v=(m.x-f.x)/this._numSubSegs,S=(m.y-f.y)/this._numSubSegs,M=0;M<this._numSubSegs;M++){var B=f.x+M*v,z=f.y+M*S,te=new N(B,z);this._minPtDist.initialize(),El.computeDistance(this._geom,te,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},zp.prototype.isDone=function(){return!1},zp.prototype.isGeometryChanged=function(){return!1},zp.prototype.getMaxPointDistance=function(){return this._maxPtDist},zp.prototype.interfaces_=function(){return[kt]},zp.prototype.getClass=function(){return zp};var Ds=o(function(a,u,f){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=a||null,this._bufDistance=u||null,this._result=f||null},"Gi"),bE={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Ds.prototype.checkMaximumDistance=function(a,u,f){var m=new Ta(u,a);if(m.setDensifyFraction(.25),this._maxDistanceFound=m.orientedDistance(),this._maxDistanceFound>f){this._isValid=!1;var v=m.getCoordinates();this._errorLocation=v[1],this._errorIndicator=a.getFactory().createLineString(v),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Pt.toLineString(v[0],v[1])+")"}},Ds.prototype.isValid=function(){var a=Math.abs(this._bufDistance),u=Ds.MAX_DISTANCE_DIFF_FRAC*a;return this._minValidDistance=a-u,this._maxValidDistance=a+u,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Ds.VERBOSE&&we.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Ds.prototype.checkNegativeValid=function(){if(!(this._input instanceof Xr||this._input instanceof Ka||this._input instanceof xt))return null;var a=this.getPolygonLines(this._input);if(this.checkMinimumDistance(a,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(a,this._result,this._maxValidDistance)},Ds.prototype.getErrorIndicator=function(){return this._errorIndicator},Ds.prototype.checkMinimumDistance=function(a,u,f){var m=new ao(a,u,f);if(this._minDistanceFound=m.distance(),this._minDistanceFound<f){this._isValid=!1;var v=m.nearestPoints();this._errorLocation=m.nearestPoints()[1],this._errorIndicator=a.getFactory().createLineString(v),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Pt.toLineString(v[0],v[1])+" )"}},Ds.prototype.checkPositiveValid=function(){var a=this._result.getBoundary();if(this.checkMinimumDistance(this._input,a,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,a,this._maxValidDistance)},Ds.prototype.getErrorLocation=function(){return this._errorLocation},Ds.prototype.getPolygonLines=function(a){for(var u=new He,f=new so(u),m=Cc.getPolygons(a).iterator();m.hasNext();)m.next().apply(f);return a.getFactory().buildGeometry(u)},Ds.prototype.getErrorMessage=function(){return this._errMsg},Ds.prototype.interfaces_=function(){return[]},Ds.prototype.getClass=function(){return Ds},bE.VERBOSE.get=function(){return!1},bE.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ds,bE);var lo=o(function(a,u,f){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=a||null,this._distance=u||null,this._result=f||null},"Bi"),xE={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};lo.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},lo.prototype.checkEnvelope=function(){if(this._distance<0)return null;var a=this._distance*lo.MAX_ENV_DIFF_FRAC;a===0&&(a=.001);var u=new ie(this._input.getEnvelopeInternal());u.expandBy(this._distance);var f=new ie(this._result.getEnvelopeInternal());f.expandBy(a),f.contains(u)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(f)),this.report("Envelope")},lo.prototype.checkDistance=function(){var a=new Ds(this._input,this._distance,this._result);a.isValid()||(this._isValid=!1,this._errorMsg=a.getErrorMessage(),this._errorLocation=a.getErrorLocation(),this._errorIndicator=a.getErrorIndicator()),this.report("Distance")},lo.prototype.checkArea=function(){var a=this._input.getArea(),u=this._result.getArea();this._distance>0&&a>u&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&a<u&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},lo.prototype.checkPolygonal=function(){this._result instanceof Xr||this._result instanceof Ka||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},lo.prototype.getErrorIndicator=function(){return this._errorIndicator},lo.prototype.getErrorLocation=function(){return this._errorLocation},lo.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"))},lo.prototype.report=function(a){if(!lo.VERBOSE)return null;we.out.println("Check "+a+": "+(this._isValid?"passed":"FAILED"))},lo.prototype.getErrorMessage=function(){return this._errorMsg},lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo},lo.isValidMsg=function(a,u,f){var m=new lo(a,u,f);return m.isValid()?null:m.getErrorMessage()},lo.isValid=function(a,u,f){return!!new lo(a,u,f).isValid()},xE.VERBOSE.get=function(){return!1},xE.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(lo,xE);var Ml=o(function(){this._pts=null,this._data=null;var a=arguments[0],u=arguments[1];this._pts=a,this._data=u},"Ui");Ml.prototype.getCoordinates=function(){return this._pts},Ml.prototype.size=function(){return this._pts.length},Ml.prototype.getCoordinate=function(a){return this._pts[a]},Ml.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ml.prototype.getSegmentOctant=function(a){return a===this._pts.length-1?-1:Qh.octant(this.getCoordinate(a),this.getCoordinate(a+1))},Ml.prototype.setData=function(a){this._data=a},Ml.prototype.getData=function(){return this._data},Ml.prototype.toString=function(){return Pt.toLineString(new ai(this._pts))},Ml.prototype.interfaces_=function(){return[mu]},Ml.prototype.getClass=function(){return Ml};var Xi=o(function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new He,this._intersectionCount=0,this._keepIntersections=!0;var a=arguments[0];this._li=a,this._interiorIntersection=null},"zi");Xi.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Xi.prototype.setCheckEndSegmentsOnly=function(a){this._isCheckEndSegmentsOnly=a},Xi.prototype.getIntersectionSegments=function(){return this._intSegments},Xi.prototype.count=function(){return this._intersectionCount},Xi.prototype.getIntersections=function(){return this._intersections},Xi.prototype.setFindAllIntersections=function(a){this._findAllIntersections=a},Xi.prototype.setKeepIntersections=function(a){this._keepIntersections=a},Xi.prototype.processIntersections=function(a,u,f,m){if(!this._findAllIntersections&&this.hasIntersection()||a===f&&u===m||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(a,u)||this.isEndSegment(f,m)))return null;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],B=f.getCoordinates()[m+1];this._li.computeIntersection(v,S,M,B),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=v,this._intSegments[1]=S,this._intSegments[2]=M,this._intSegments[3]=B,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Xi.prototype.isEndSegment=function(a,u){return u===0||u>=a.size()-2},Xi.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Xi.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},Xi.prototype.interfaces_=function(){return[Td]},Xi.prototype.getClass=function(){return Xi},Xi.createAllIntersectionsFinder=function(a){var u=new Xi(a);return u.setFindAllIntersections(!0),u},Xi.createAnyIntersectionFinder=function(a){return new Xi(a)},Xi.createIntersectionCounter=function(a){var u=new Xi(a);return u.setFindAllIntersections(!0),u.setKeepIntersections(!1),u};var rl=o(function(){this._li=new Ro,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var a=arguments[0];this._segStrings=a},"Xi");rl.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},rl.prototype.getIntersections=function(){return this._segInt.getIntersections()},rl.prototype.isValid=function(){return this.execute(),this._isValid},rl.prototype.setFindAllIntersections=function(a){this._findAllIntersections=a},rl.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Xi(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var a=new gE;if(a.setSegmentIntersector(this._segInt),a.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},rl.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new xc(this.getErrorMessage(),this._segInt.getInteriorIntersection())},rl.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var a=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Pt.toLineString(a[0],a[1])+" and "+Pt.toLineString(a[2],a[3])},rl.prototype.interfaces_=function(){return[]},rl.prototype.getClass=function(){return rl},rl.computeIntersections=function(a){var u=new rl(a);return u.setFindAllIntersections(!0),u.isValid(),u.getIntersections()};var Od=o(function a(){this._nv=null;var u=arguments[0];this._nv=new rl(a.toSegmentStrings(u))},"t");Od.prototype.checkValid=function(){this._nv.checkValid()},Od.prototype.interfaces_=function(){return[]},Od.prototype.getClass=function(){return Od},Od.toSegmentStrings=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next();u.add(new Ml(m.getCoordinates(),m))}return u},Od.checkValid=function(a){new Od(a).checkValid()};var sm=o(function(a){this._mapOp=a},"ki");sm.prototype.map=function(a){for(var u=new He,f=0;f<a.getNumGeometries();f++){var m=this._mapOp.map(a.getGeometryN(f));m.isEmpty()||u.add(m)}return a.getFactory().createGeometryCollection(jt.toGeometryArray(u))},sm.prototype.interfaces_=function(){return[]},sm.prototype.getClass=function(){return sm},sm.map=function(a,u){return new sm(u).map(a)};var Ol=o(function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new He,this._resultLineList=new He;var a=arguments[0],u=arguments[1],f=arguments[2];this._op=a,this._geometryFactory=u,this._ptLocator=f},"ji");Ol.prototype.collectLines=function(a){for(var u=this._op.getGraph().getEdgeEnds().iterator();u.hasNext();){var f=u.next();this.collectLineEdge(f,a,this._lineEdgesList),this.collectBoundaryTouchEdge(f,a,this._lineEdgesList)}},Ol.prototype.labelIsolatedLine=function(a,u){var f=this._ptLocator.locate(a.getCoordinate(),this._op.getArgGeometry(u));a.getLabel().setLocation(u,f)},Ol.prototype.build=function(a){return this.findCoveredLineEdges(),this.collectLines(a),this.buildLines(a),this._resultLineList},Ol.prototype.collectLineEdge=function(a,u,f){var m=a.getLabel(),v=a.getEdge();a.isLineEdge()&&(a.isVisited()||!Tt.isResultOfOp(m,u)||v.isCovered()||(f.add(v),a.setVisitedEdge(!0)))},Ol.prototype.findCoveredLineEdges=function(){for(var a=this._op.getGraph().getNodes().iterator();a.hasNext();)a.next().getEdges().findCoveredLineEdges();for(var u=this._op.getGraph().getEdgeEnds().iterator();u.hasNext();){var f=u.next(),m=f.getEdge();if(f.isLineEdge()&&!m.isCoveredSet()){var v=this._op.isCoveredByA(f.getCoordinate());m.setCovered(v)}}},Ol.prototype.labelIsolatedLines=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next(),m=f.getLabel();f.isIsolated()&&(m.isNull(0)?this.labelIsolatedLine(f,0):this.labelIsolatedLine(f,1))}},Ol.prototype.buildLines=function(a){for(var u=this._lineEdgesList.iterator();u.hasNext();){var f=u.next(),m=this._geometryFactory.createLineString(f.getCoordinates());this._resultLineList.add(m),f.setInResult(!0)}},Ol.prototype.collectBoundaryTouchEdge=function(a,u,f){var m=a.getLabel();return a.isLineEdge()||a.isVisited()||a.isInteriorAreaEdge()||a.getEdge().isInResult()?null:(ot.isTrue(!(a.isInResult()||a.getSym().isInResult())||!a.getEdge().isInResult()),void(Tt.isResultOfOp(m,u)&&u===Tt.INTERSECTION&&(f.add(a.getEdge()),a.setVisitedEdge(!0))))},Ol.prototype.interfaces_=function(){return[]},Ol.prototype.getClass=function(){return Ol};var am=o(function(){this._op=null,this._geometryFactory=null,this._resultPointList=new He;var a=arguments[0],u=arguments[1];this._op=a,this._geometryFactory=u},"Hi");am.prototype.filterCoveredNodeToPoint=function(a){var u=a.getCoordinate();if(!this._op.isCoveredByLA(u)){var f=this._geometryFactory.createPoint(u);this._resultPointList.add(f)}},am.prototype.extractNonCoveredResultNodes=function(a){for(var u=this._op.getGraph().getNodes().iterator();u.hasNext();){var f=u.next();if(!f.isInResult()&&!f.isIncidentEdgeInResult()&&(f.getEdges().getDegree()===0||a===Tt.INTERSECTION)){var m=f.getLabel();Tt.isResultOfOp(m,a)&&this.filterCoveredNodeToPoint(f)}}},am.prototype.build=function(a){return this.extractNonCoveredResultNodes(a),this._resultPointList},am.prototype.interfaces_=function(){return[]},am.prototype.getClass=function(){return am};var us=o(function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1},"Wi");us.prototype.transformPoint=function(a,u){return this._factory.createPoint(this.transformCoordinates(a.getCoordinateSequence(),a))},us.prototype.transformPolygon=function(a,u){var f=!0,m=this.transformLinearRing(a.getExteriorRing(),a);m!==null&&m instanceof os&&!m.isEmpty()||(f=!1);for(var v=new He,S=0;S<a.getNumInteriorRing();S++){var M=this.transformLinearRing(a.getInteriorRingN(S),a);M===null||M.isEmpty()||(M instanceof os||(f=!1),v.add(M))}if(f)return this._factory.createPolygon(m,v.toArray([]));var B=new He;return m!==null&&B.add(m),B.addAll(v),this._factory.buildGeometry(B)},us.prototype.createCoordinateSequence=function(a){return this._factory.getCoordinateSequenceFactory().create(a)},us.prototype.getInputGeometry=function(){return this._inputGeom},us.prototype.transformMultiLineString=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transformLineString(a.getGeometryN(m),a);v!==null&&(v.isEmpty()||f.add(v))}return this._factory.buildGeometry(f)},us.prototype.transformCoordinates=function(a,u){return this.copy(a)},us.prototype.transformLineString=function(a,u){return this._factory.createLineString(this.transformCoordinates(a.getCoordinateSequence(),a))},us.prototype.transformMultiPoint=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transformPoint(a.getGeometryN(m),a);v!==null&&(v.isEmpty()||f.add(v))}return this._factory.buildGeometry(f)},us.prototype.transformMultiPolygon=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transformPolygon(a.getGeometryN(m),a);v!==null&&(v.isEmpty()||f.add(v))}return this._factory.buildGeometry(f)},us.prototype.copy=function(a){return a.copy()},us.prototype.transformGeometryCollection=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transform(a.getGeometryN(m));v!==null&&(this._pruneEmptyGeometry&&v.isEmpty()||f.add(v))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(jt.toGeometryArray(f)):this._factory.buildGeometry(f)},us.prototype.transform=function(a){if(this._inputGeom=a,this._factory=a.getFactory(),a instanceof Gn)return this.transformPoint(a,null);if(a instanceof Ms)return this.transformMultiPoint(a,null);if(a instanceof os)return this.transformLinearRing(a,null);if(a instanceof Gt)return this.transformLineString(a,null);if(a instanceof dn)return this.transformMultiLineString(a,null);if(a instanceof Xr)return this.transformPolygon(a,null);if(a instanceof Ka)return this.transformMultiPolygon(a,null);if(a instanceof xt)return this.transformGeometryCollection(a,null);throw new D("Unknown Geometry subtype: "+a.getClass().getName())},us.prototype.transformLinearRing=function(a,u){var f=this.transformCoordinates(a.getCoordinateSequence(),a);if(f===null)return this._factory.createLinearRing(null);var m=f.size();return m>0&&m<4&&!this._preserveType?this._factory.createLineString(f):this._factory.createLinearRing(f)},us.prototype.interfaces_=function(){return[]},us.prototype.getClass=function(){return us};var xu=o(function a(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new ct,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Gt&&typeof arguments[1]=="number"){var u=arguments[0],f=arguments[1];a.call(this,u.getCoordinates(),f)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var m=arguments[0],v=arguments[1];this._srcPts=m,this._isClosed=a.isClosed(m),this._snapTolerance=v}},"t");xu.prototype.snapVertices=function(a,u){for(var f=this._isClosed?a.size()-1:a.size(),m=0;m<f;m++){var v=a.get(m),S=this.findSnapForVertex(v,u);S!==null&&(a.set(m,new N(S)),m===0&&this._isClosed&&a.set(a.size()-1,new N(S)))}},xu.prototype.findSnapForVertex=function(a,u){for(var f=0;f<u.length;f++){if(a.equals2D(u[f]))return null;if(a.distance(u[f])<this._snapTolerance)return u[f]}return null},xu.prototype.snapTo=function(a){var u=new ue(this._srcPts);return this.snapVertices(u,a),this.snapSegments(u,a),u.toCoordinateArray()},xu.prototype.snapSegments=function(a,u){if(u.length===0)return null;var f=u.length;u[0].equals2D(u[u.length-1])&&(f=u.length-1);for(var m=0;m<f;m++){var v=u[m],S=this.findSegmentIndexToSnap(v,a);S>=0&&a.add(S+1,new N(v),!1)}},xu.prototype.findSegmentIndexToSnap=function(a,u){for(var f=A.MAX_VALUE,m=-1,v=0;v<u.size()-1;v++){if(this._seg.p0=u.get(v),this._seg.p1=u.get(v+1),this._seg.p0.equals2D(a)||this._seg.p1.equals2D(a)){if(this._allowSnappingToSourceVertices)continue;return-1}var S=this._seg.distance(a);S<this._snapTolerance&&S<f&&(f=S,m=v)}return m},xu.prototype.setAllowSnappingToSourceVertices=function(a){this._allowSnappingToSourceVertices=a},xu.prototype.interfaces_=function(){return[]},xu.prototype.getClass=function(){return xu},xu.isClosed=function(a){return!(a.length<=1)&&a[0].equals2D(a[a.length-1])};var ui=o(function(a){this._srcGeom=a||null},"Ji"),pN={SNAP_PRECISION_FACTOR:{configurable:!0}};ui.prototype.snapTo=function(a,u){var f=this.extractTargetCoordinates(a);return new fN(u,f).transform(this._srcGeom)},ui.prototype.snapToSelf=function(a,u){var f=this.extractTargetCoordinates(this._srcGeom),m=new fN(a,f,!0).transform(this._srcGeom),v=m;return u&&ne(v,Hi)&&(v=m.buffer(0)),v},ui.prototype.computeSnapTolerance=function(a){return this.computeMinimumSegmentLength(a)/10},ui.prototype.extractTargetCoordinates=function(a){for(var u=new C,f=a.getCoordinates(),m=0;m<f.length;m++)u.add(f[m]);return u.toArray(new Array(0).fill(null))},ui.prototype.computeMinimumSegmentLength=function(a){for(var u=A.MAX_VALUE,f=0;f<a.length-1;f++){var m=a[f].distance(a[f+1]);m<u&&(u=m)}return u},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui},ui.snap=function(a,u,f){var m=new Array(2).fill(null),v=new ui(a);m[0]=v.snapTo(u,f);var S=new ui(u);return m[1]=S.snapTo(m[0],f),m},ui.computeOverlaySnapTolerance=function(){if(arguments.length===1){var a=arguments[0],u=ui.computeSizeBasedSnapTolerance(a),f=a.getPrecisionModel();if(f.getType()===Mr.FIXED){var m=1/f.getScale()*2/1.415;m>u&&(u=m)}return u}if(arguments.length===2){var v=arguments[0],S=arguments[1];return Math.min(ui.computeOverlaySnapTolerance(v),ui.computeOverlaySnapTolerance(S))}},ui.computeSizeBasedSnapTolerance=function(a){var u=a.getEnvelopeInternal();return Math.min(u.getHeight(),u.getWidth())*ui.SNAP_PRECISION_FACTOR},ui.snapToSelf=function(a,u,f){return new ui(a).snapToSelf(u,f)},pN.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(ui,pN);var fN=function(a){function u(f,m,v){a.call(this),this._snapTolerance=f||null,this._snapPts=m||null,this._isSelfSnap=v!==void 0&&v}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.snapLine=function(f,m){var v=new xu(f,this._snapTolerance);return v.setAllowSnappingToSourceVertices(this._isSelfSnap),v.snapTo(m)},u.prototype.transformCoordinates=function(f,m){var v=f.toCoordinateArray(),S=this.snapLine(v,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(S)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(us),Vo=o(function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},"$i");Vo.prototype.getCommon=function(){return A.longBitsToDouble(this._commonBits)},Vo.prototype.add=function(a){var u=A.doubleToLongBits(a);if(this._isFirst)return this._commonBits=u,this._commonSignExp=Vo.signExpBits(this._commonBits),this._isFirst=!1,null;if(Vo.signExpBits(u)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Vo.numCommonMostSigMantissaBits(this._commonBits,u),this._commonBits=Vo.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Vo.prototype.toString=function(){if(arguments.length===1){var a=arguments[0],u=A.longBitsToDouble(a),f="0000000000000000000000000000000000000000000000000000000000000000"+A.toBinaryString(a),m=f.substring(f.length-64);return m.substring(0,1)+" "+m.substring(1,12)+"(exp) "+m.substring(12)+" [ "+u+" ]"}},Vo.prototype.interfaces_=function(){return[]},Vo.prototype.getClass=function(){return Vo},Vo.getBit=function(a,u){return(a&1<<u)!=0?1:0},Vo.signExpBits=function(a){return a>>52},Vo.zeroLowerBits=function(a,u){return a&~((1<<u)-1)},Vo.numCommonMostSigMantissaBits=function(a,u){for(var f=0,m=52;m>=0;m--){if(Vo.getBit(a,m)!==Vo.getBit(u,m))return f;f++}return 52};var qp=o(function(){this._commonCoord=null,this._ccFilter=new lm},"tr"),IE={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};qp.prototype.addCommonBits=function(a){var u=new Hp(this._commonCoord);a.apply(u),a.geometryChanged()},qp.prototype.removeCommonBits=function(a){if(this._commonCoord.x===0&&this._commonCoord.y===0)return a;var u=new N(this._commonCoord);u.x=-u.x,u.y=-u.y;var f=new Hp(u);return a.apply(f),a.geometryChanged(),a},qp.prototype.getCommonCoordinate=function(){return this._commonCoord},qp.prototype.add=function(a){a.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},qp.prototype.interfaces_=function(){return[]},qp.prototype.getClass=function(){return qp},IE.CommonCoordinateFilter.get=function(){return lm},IE.Translater.get=function(){return Hp},Object.defineProperties(qp,IE);var lm=o(function(){this._commonBitsX=new Vo,this._commonBitsY=new Vo},"nr");lm.prototype.filter=function(a){this._commonBitsX.add(a.x),this._commonBitsY.add(a.y)},lm.prototype.getCommonCoordinate=function(){return new N(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},lm.prototype.interfaces_=function(){return[ts]},lm.prototype.getClass=function(){return lm};var Hp=o(function(){this.trans=null;var a=arguments[0];this.trans=a},"ir");Hp.prototype.filter=function(a,u){var f=a.getOrdinate(u,0)+this.trans.x,m=a.getOrdinate(u,1)+this.trans.y;a.setOrdinate(u,0,f),a.setOrdinate(u,1,m)},Hp.prototype.isDone=function(){return!1},Hp.prototype.isGeometryChanged=function(){return!0},Hp.prototype.interfaces_=function(){return[kt]},Hp.prototype.getClass=function(){return Hp};var Yi=o(function(a,u){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=a,this._geom[1]=u,this.computeSnapTolerance()},"rr");Yi.prototype.selfSnap=function(a){return new ui(a).snapTo(a,this._snapTolerance)},Yi.prototype.removeCommonBits=function(a){this._cbr=new qp,this._cbr.add(a[0]),this._cbr.add(a[1]);var u=new Array(2).fill(null);return u[0]=this._cbr.removeCommonBits(a[0].copy()),u[1]=this._cbr.removeCommonBits(a[1].copy()),u},Yi.prototype.prepareResult=function(a){return this._cbr.addCommonBits(a),a},Yi.prototype.getResultGeometry=function(a){var u=this.snap(this._geom),f=Tt.overlayOp(u[0],u[1],a);return this.prepareResult(f)},Yi.prototype.checkValid=function(a){a.isValid()||we.out.println("Snapped geometry is invalid")},Yi.prototype.computeSnapTolerance=function(){this._snapTolerance=ui.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Yi.prototype.snap=function(a){var u=this.removeCommonBits(a);return ui.snap(u[0],u[1],this._snapTolerance)},Yi.prototype.interfaces_=function(){return[]},Yi.prototype.getClass=function(){return Yi},Yi.overlayOp=function(a,u,f){return new Yi(a,u).getResultGeometry(f)},Yi.union=function(a,u){return Yi.overlayOp(a,u,Tt.UNION)},Yi.intersection=function(a,u){return Yi.overlayOp(a,u,Tt.INTERSECTION)},Yi.symDifference=function(a,u){return Yi.overlayOp(a,u,Tt.SYMDIFFERENCE)},Yi.difference=function(a,u){return Yi.overlayOp(a,u,Tt.DIFFERENCE)};var zo=o(function(a,u){this._geom=new Array(2).fill(null),this._geom[0]=a,this._geom[1]=u},"or");zo.prototype.getResultGeometry=function(a){var u=null,f=!1,m=null;try{u=Tt.overlayOp(this._geom[0],this._geom[1],a),f=!0}catch(v){if(!(v instanceof Er))throw v;m=v}if(!f)try{u=Yi.overlayOp(this._geom[0],this._geom[1],a)}catch(v){throw v instanceof Er?m:v}return u},zo.prototype.interfaces_=function(){return[]},zo.prototype.getClass=function(){return zo},zo.overlayOp=function(a,u,f){return new zo(a,u).getResultGeometry(f)},zo.union=function(a,u){return zo.overlayOp(a,u,Tt.UNION)},zo.intersection=function(a,u){return zo.overlayOp(a,u,Tt.INTERSECTION)},zo.symDifference=function(a,u){return zo.overlayOp(a,u,Tt.SYMDIFFERENCE)},zo.difference=function(a,u){return zo.overlayOp(a,u,Tt.DIFFERENCE)};var Ob=o(function(){this.mce=null,this.chainIndex=null;var a=arguments[0],u=arguments[1];this.mce=a,this.chainIndex=u},"sr");Ob.prototype.computeIntersections=function(a,u){this.mce.computeIntersectsForChain(this.chainIndex,a.mce,a.chainIndex,u)},Ob.prototype.interfaces_=function(){return[]},Ob.prototype.getClass=function(){return Ob};var Fs=o(function a(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var u=arguments[0],f=arguments[1];this._eventType=a.DELETE,this._xValue=u,this._insertEvent=f}else if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];this._eventType=a.INSERT,this._label=m,this._xValue=v,this._obj=S}},"t"),_E={INSERT:{configurable:!0},DELETE:{configurable:!0}};Fs.prototype.isDelete=function(){return this._eventType===Fs.DELETE},Fs.prototype.setDeleteEventIndex=function(a){this._deleteEventIndex=a},Fs.prototype.getObject=function(){return this._obj},Fs.prototype.compareTo=function(a){var u=a;return this._xValue<u._xValue?-1:this._xValue>u._xValue?1:this._eventType<u._eventType?-1:this._eventType>u._eventType?1:0},Fs.prototype.getInsertEvent=function(){return this._insertEvent},Fs.prototype.isInsert=function(){return this._eventType===Fs.INSERT},Fs.prototype.isSameLabel=function(a){return this._label!==null&&this._label===a._label},Fs.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Fs.prototype.interfaces_=function(){return[j]},Fs.prototype.getClass=function(){return Fs},_E.INSERT.get=function(){return 1},_E.DELETE.get=function(){return 2},Object.defineProperties(Fs,_E);var nS=o(function(){},"lr");nS.prototype.interfaces_=function(){return[]},nS.prototype.getClass=function(){return nS};var uo=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 a=arguments[0],u=arguments[1],f=arguments[2];this._li=a,this._includeProper=u,this._recordIsolated=f},"cr");uo.prototype.isTrivialIntersection=function(a,u,f,m){if(a===f&&this._li.getIntersectionNum()===1){if(uo.isAdjacentSegments(u,m))return!0;if(a.isClosed()){var v=a.getNumPoints()-1;if(u===0&&m===v||m===0&&u===v)return!0}}return!1},uo.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},uo.prototype.setIsDoneIfProperInt=function(a){this._isDoneWhenProperInt=a},uo.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},uo.prototype.isBoundaryPointInternal=function(a,u){for(var f=u.iterator();f.hasNext();){var m=f.next().getCoordinate();if(a.isIntersection(m))return!0}return!1},uo.prototype.hasProperIntersection=function(){return this._hasProper},uo.prototype.hasIntersection=function(){return this._hasIntersection},uo.prototype.isDone=function(){return this._isDone},uo.prototype.isBoundaryPoint=function(a,u){return u!==null&&(!!this.isBoundaryPointInternal(a,u[0])||!!this.isBoundaryPointInternal(a,u[1]))},uo.prototype.setBoundaryNodes=function(a,u){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=a,this._bdyNodes[1]=u},uo.prototype.addIntersections=function(a,u,f,m){if(a===f&&u===m)return null;this.numTests++;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],B=f.getCoordinates()[m+1];this._li.computeIntersection(v,S,M,B),this._li.hasIntersection()&&(this._recordIsolated&&(a.setIsolated(!1),f.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(a,u,f,m)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(a.addIntersections(this._li,u,0),f.addIntersections(this._li,m,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))))},uo.prototype.interfaces_=function(){return[]},uo.prototype.getClass=function(){return uo},uo.isAdjacentSegments=function(a,u){return Math.abs(a-u)===1};var Vse=function(a){function u(){a.call(this),this.events=new He,this.nOverlaps=null}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.prepareEvents=function(){Qa.sort(this.events);for(var f=0;f<this.events.size();f++){var m=this.events.get(f);m.isDelete()&&m.getInsertEvent().setDeleteEventIndex(f)}},u.prototype.computeIntersections=function(){if(arguments.length===1){var f=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var m=0;m<this.events.size();m++){var v=this.events.get(m);if(v.isInsert()&&this.processOverlaps(m,v.getDeleteEventIndex(),v,f),f.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof uo&&ne(arguments[0],ns)&&ne(arguments[1],ns)){var S=arguments[0],M=arguments[1],B=arguments[2];this.addEdges(S,S),this.addEdges(M,M),this.computeIntersections(B)}else if(typeof arguments[2]=="boolean"&&ne(arguments[0],ns)&&arguments[1]instanceof uo){var z=arguments[0],te=arguments[1];arguments[2]?this.addEdges(z,null):this.addEdges(z),this.computeIntersections(te)}}},u.prototype.addEdge=function(f,m){for(var v=f.getMonotoneChainEdge(),S=v.getStartIndexes(),M=0;M<S.length-1;M++){var B=new Ob(v,M),z=new Fs(m,v.getMinX(M),B);this.events.add(z),this.events.add(new Fs(v.getMaxX(M),z))}},u.prototype.processOverlaps=function(f,m,v,S){for(var M=v.getObject(),B=f;B<m;B++){var z=this.events.get(B);if(z.isInsert()){var te=z.getObject();v.isSameLabel(z)||(M.computeIntersections(te,S),this.nOverlaps++)}}},u.prototype.addEdges=function(){if(arguments.length===1)for(var f=arguments[0].iterator();f.hasNext();){var m=f.next();this.addEdge(m,m)}else if(arguments.length===2)for(var v=arguments[0],S=arguments[1],M=v.iterator();M.hasNext();){var B=M.next();this.addEdge(B,S)}},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(nS),Iu=o(function(){this._min=A.POSITIVE_INFINITY,this._max=A.NEGATIVE_INFINITY},"hr"),dN={NodeComparator:{configurable:!0}};Iu.prototype.getMin=function(){return this._min},Iu.prototype.intersects=function(a,u){return!(this._min>u||this._max<a)},Iu.prototype.getMax=function(){return this._max},Iu.prototype.toString=function(){return Pt.toLineString(new N(this._min,0),new N(this._max,0))},Iu.prototype.interfaces_=function(){return[]},Iu.prototype.getClass=function(){return Iu},dN.NodeComparator.get=function(){return Lb},Object.defineProperties(Iu,dN);var Lb=o(function(){},"gr");Lb.prototype.compare=function(a,u){var f=a,m=u,v=(f._min+f._max)/2,S=(m._min+m._max)/2;return v<S?-1:v>S?1:0},Lb.prototype.interfaces_=function(){return[Y]},Lb.prototype.getClass=function(){return Lb};var zse=function(a){function u(){a.call(this),this._item=null;var f=arguments[0],m=arguments[1],v=arguments[2];this._min=f,this._max=m,this._item=v}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.query=function(f,m,v){if(!this.intersects(f,m))return null;v.visitItem(this._item)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Iu),qse=function(a){function u(){a.call(this),this._node1=null,this._node2=null;var f=arguments[0],m=arguments[1];this._node1=f,this._node2=m,this.buildExtent(this._node1,this._node2)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.buildExtent=function(f,m){this._min=Math.min(f._min,m._min),this._max=Math.max(f._max,m._max)},u.prototype.query=function(f,m,v){if(!this.intersects(f,m))return null;this._node1!==null&&this._node1.query(f,m,v),this._node2!==null&&this._node2.query(f,m,v)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Iu),_u=o(function(){this._leaves=new He,this._root=null,this._level=0},"_r");_u.prototype.buildTree=function(){Qa.sort(this._leaves,new Iu.NodeComparator);for(var a=this._leaves,u=null,f=new He;;){if(this.buildLevel(a,f),f.size()===1)return f.get(0);u=a,a=f,f=u}},_u.prototype.insert=function(a,u,f){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new zse(a,u,f))},_u.prototype.query=function(a,u,f){this.init(),this._root.query(a,u,f)},_u.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},_u.prototype.printNode=function(a){we.out.println(Pt.toLineString(new N(a._min,this._level),new N(a._max,this._level)))},_u.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},_u.prototype.buildLevel=function(a,u){this._level++,u.clear();for(var f=0;f<a.size();f+=2){var m=a.get(f);if((f+1<a.size()?a.get(f):null)===null)u.add(m);else{var v=new qse(a.get(f),a.get(f+1));u.add(v)}}},_u.prototype.interfaces_=function(){return[]},_u.prototype.getClass=function(){return _u};var e0=o(function(){this._items=new He},"mr");e0.prototype.visitItem=function(a){this._items.add(a)},e0.prototype.getItems=function(){return this._items},e0.prototype.interfaces_=function(){return[Bp]},e0.prototype.getClass=function(){return e0};var t0=o(function(){this._index=null;var a=arguments[0];if(!ne(a,Hi))throw new D("Argument must be Polygonal");this._index=new Ld(a)},"vr"),SE={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};t0.prototype.locate=function(a){var u=new Ri(a),f=new r0(u);return this._index.query(a.y,a.y,f),u.getLocation()},t0.prototype.interfaces_=function(){return[Ky]},t0.prototype.getClass=function(){return t0},SE.SegmentVisitor.get=function(){return r0},SE.IntervalIndexedGeometry.get=function(){return Ld},Object.defineProperties(t0,SE);var r0=o(function(){this._counter=null;var a=arguments[0];this._counter=a},"Er");r0.prototype.visitItem=function(a){var u=a;this._counter.countSegment(u.getCoordinate(0),u.getCoordinate(1))},r0.prototype.interfaces_=function(){return[Bp]},r0.prototype.getClass=function(){return r0};var Ld=o(function(){this._index=new _u;var a=arguments[0];this.init(a)},"xr");Ld.prototype.init=function(a){for(var u=so.getLines(a).iterator();u.hasNext();){var f=u.next().getCoordinates();this.addLine(f)}},Ld.prototype.addLine=function(a){for(var u=1;u<a.length;u++){var f=new ct(a[u-1],a[u]),m=Math.min(f.p0.y,f.p1.y),v=Math.max(f.p0.y,f.p1.y);this._index.insert(m,v,f)}},Ld.prototype.query=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1],f=new e0;return this._index.query(a,u,f),f.getItems()}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];this._index.query(m,v,S)}},Ld.prototype.interfaces_=function(){return[]},Ld.prototype.getClass=function(){return Ld};var Ab=function(a){function u(){if(a.call(this),this._parentGeom=null,this._lineEdgeMap=new XF,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new tl,arguments.length===2){var f=arguments[0],m=arguments[1],v=ro.OGC_SFS_BOUNDARY_RULE;this._argIndex=f,this._parentGeom=m,this._boundaryNodeRule=v,m!==null&&this.add(m)}else if(arguments.length===3){var S=arguments[0],M=arguments[1],B=arguments[2];this._argIndex=S,this._parentGeom=M,this._boundaryNodeRule=B,M!==null&&this.add(M)}}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.insertBoundaryPoint=function(f,m){var v=this._nodes.addNode(m).getLabel(),S=1;U.NONE,v.getLocation(f,Ge.ON)===U.BOUNDARY&&S++;var M=u.determineBoundary(this._boundaryNodeRule,S);v.setLocation(f,M)},u.prototype.computeSelfNodes=function(){if(arguments.length===2){var f=arguments[0],m=arguments[1];return this.computeSelfNodes(f,m,!1)}if(arguments.length===3){var v=arguments[0],S=arguments[1],M=arguments[2],B=new uo(v,!0,!1);B.setIsDoneIfProperInt(M);var z=this.createEdgeSetIntersector(),te=this._parentGeom instanceof os||this._parentGeom instanceof Xr||this._parentGeom instanceof Ka,pe=S||!te;return z.computeIntersections(this._edges,B,pe),this.addSelfIntersectionNodes(this._argIndex),B}},u.prototype.computeSplitEdges=function(f){for(var m=this._edges.iterator();m.hasNext();)m.next().eiList.addSplitEdges(f)},u.prototype.computeEdgeIntersections=function(f,m,v){var S=new uo(m,v,!0);return S.setBoundaryNodes(this.getBoundaryNodes(),f.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,f._edges,S),S},u.prototype.getGeometry=function(){return this._parentGeom},u.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},u.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},u.prototype.addPoint=function(){if(arguments[0]instanceof Gn){var f=arguments[0].getCoordinate();this.insertPoint(this._argIndex,f,U.INTERIOR)}else if(arguments[0]instanceof N){var m=arguments[0];this.insertPoint(this._argIndex,m,U.INTERIOR)}},u.prototype.addPolygon=function(f){this.addPolygonRing(f.getExteriorRing(),U.EXTERIOR,U.INTERIOR);for(var m=0;m<f.getNumInteriorRing();m++){var v=f.getInteriorRingN(m);this.addPolygonRing(v,U.INTERIOR,U.EXTERIOR)}},u.prototype.addEdge=function(f){this.insertEdge(f);var m=f.getCoordinates();this.insertPoint(this._argIndex,m[0],U.BOUNDARY),this.insertPoint(this._argIndex,m[m.length-1],U.BOUNDARY)},u.prototype.addLineString=function(f){var m=F.removeRepeatedPoints(f.getCoordinates());if(m.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=m[0],null;var v=new rS(m,new Yr(this._argIndex,U.INTERIOR));this._lineEdgeMap.put(f,v),this.insertEdge(v),ot.isTrue(m.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,m[0]),this.insertBoundaryPoint(this._argIndex,m[m.length-1])},u.prototype.getInvalidPoint=function(){return this._invalidPoint},u.prototype.getBoundaryPoints=function(){for(var f=this.getBoundaryNodes(),m=new Array(f.size()).fill(null),v=0,S=f.iterator();S.hasNext();){var M=S.next();m[v++]=M.getCoordinate().copy()}return m},u.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},u.prototype.addSelfIntersectionNode=function(f,m,v){if(this.isBoundaryNode(f,m))return null;v===U.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(f,m):this.insertPoint(f,m,v)},u.prototype.addPolygonRing=function(f,m,v){if(f.isEmpty())return null;var S=F.removeRepeatedPoints(f.getCoordinates());if(S.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=S[0],null;var M=m,B=v;ze.isCCW(S)&&(M=v,B=m);var z=new rS(S,new Yr(this._argIndex,U.BOUNDARY,M,B));this._lineEdgeMap.put(f,z),this.insertEdge(z),this.insertPoint(this._argIndex,S[0],U.BOUNDARY)},u.prototype.insertPoint=function(f,m,v){var S=this._nodes.addNode(m),M=S.getLabel();M===null?S._label=new Yr(f,v):M.setLocation(f,v)},u.prototype.createEdgeSetIntersector=function(){return new Vse},u.prototype.addSelfIntersectionNodes=function(f){for(var m=this._edges.iterator();m.hasNext();)for(var v=m.next(),S=v.getLabel().getLocation(f),M=v.eiList.iterator();M.hasNext();){var B=M.next();this.addSelfIntersectionNode(f,B.coord,S)}},u.prototype.add=function(){if(arguments.length!==1)return a.prototype.add.apply(this,arguments);var f=arguments[0];if(f.isEmpty())return null;if(f instanceof Ka&&(this._useBoundaryDeterminationRule=!1),f instanceof Xr)this.addPolygon(f);else if(f instanceof Gt)this.addLineString(f);else if(f instanceof Gn)this.addPoint(f);else if(f instanceof Ms)this.addCollection(f);else if(f instanceof dn)this.addCollection(f);else if(f instanceof Ka)this.addCollection(f);else{if(!(f instanceof xt))throw new Error(f.getClass().getName());this.addCollection(f)}},u.prototype.addCollection=function(f){for(var m=0;m<f.getNumGeometries();m++){var v=f.getGeometryN(m);this.add(v)}},u.prototype.locate=function(f){return ne(this._parentGeom,Hi)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new t0(this._parentGeom)),this._areaPtLocator.locate(f)):this._ptLocator.locate(f,this._parentGeom)},u.prototype.findEdge=function(){if(arguments.length===1){var f=arguments[0];return this._lineEdgeMap.get(f)}return a.prototype.findEdge.apply(this,arguments)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.determineBoundary=function(f,m){return f.isInBoundary(m)?U.BOUNDARY:U.INTERIOR},u}(Zn),n0=o(function(){if(this._li=new Ro,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var a=arguments[0];this.setComputationPrecision(a.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ab(0,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1],m=ro.OGC_SFS_BOUNDARY_RULE;u.getPrecisionModel().compareTo(f.getPrecisionModel())>=0?this.setComputationPrecision(u.getPrecisionModel()):this.setComputationPrecision(f.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ab(0,u,m),this._arg[1]=new Ab(1,f,m)}else if(arguments.length===3){var v=arguments[0],S=arguments[1],M=arguments[2];v.getPrecisionModel().compareTo(S.getPrecisionModel())>=0?this.setComputationPrecision(v.getPrecisionModel()):this.setComputationPrecision(S.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ab(0,v,M),this._arg[1]=new Ab(1,S,M)}},"Cr");n0.prototype.getArgGeometry=function(a){return this._arg[a].getGeometry()},n0.prototype.setComputationPrecision=function(a){this._resultPrecisionModel=a,this._li.setPrecisionModel(this._resultPrecisionModel)},n0.prototype.interfaces_=function(){return[]},n0.prototype.getClass=function(){return n0};var Ad=o(function(){},"Sr");Ad.prototype.interfaces_=function(){return[]},Ad.prototype.getClass=function(){return Ad},Ad.map=function(){if(arguments[0]instanceof vt&&ne(arguments[1],Ad.MapOp)){for(var a=arguments[0],u=arguments[1],f=new He,m=0;m<a.getNumGeometries();m++){var v=u.map(a.getGeometryN(m));v!==null&&f.add(v)}return a.getFactory().buildGeometry(f)}if(ne(arguments[0],On)&&ne(arguments[1],Ad.MapOp)){for(var S=arguments[0],M=arguments[1],B=new He,z=S.iterator();z.hasNext();){var te=z.next(),pe=M.map(te);pe!==null&&B.add(pe)}return B}},Ad.MapOp=function(){};var Tt=function(a){function u(){var f=arguments[0],m=arguments[1];a.call(this,f,m),this._ptLocator=new tl,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new el,this._resultPolyList=new He,this._resultLineList=new He,this._resultPointList=new He,this._graph=new Zn(new iN),this._geomFact=f.getFactory()}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.insertUniqueEdge=function(f){var m=this._edgeList.findEqualEdge(f);if(m!==null){var v=m.getLabel(),S=f.getLabel();m.isPointwiseEqual(f)||(S=new Yr(f.getLabel())).flip();var M=m.getDepth();M.isNull()&&M.add(v),M.add(S),v.merge(S)}else this._edgeList.add(f)},u.prototype.getGraph=function(){return this._graph},u.prototype.cancelDuplicateResultEdges=function(){for(var f=this._graph.getEdgeEnds().iterator();f.hasNext();){var m=f.next(),v=m.getSym();m.isInResult()&&v.isInResult()&&(m.setInResult(!1),v.setInResult(!1))}},u.prototype.isCoveredByLA=function(f){return!!this.isCovered(f,this._resultLineList)||!!this.isCovered(f,this._resultPolyList)},u.prototype.computeGeometry=function(f,m,v,S){var M=new He;return M.addAll(f),M.addAll(m),M.addAll(v),M.isEmpty()?u.createEmptyResult(S,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(M)},u.prototype.mergeSymLabels=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();)f.next().getEdges().mergeSymLabels()},u.prototype.isCovered=function(f,m){for(var v=m.iterator();v.hasNext();){var S=v.next();if(this._ptLocator.locate(f,S)!==U.EXTERIOR)return!0}return!1},u.prototype.replaceCollapsedEdges=function(){for(var f=new He,m=this._edgeList.iterator();m.hasNext();){var v=m.next();v.isCollapsed()&&(m.remove(),f.add(v.getCollapsedEdge()))}this._edgeList.addAll(f)},u.prototype.updateNodeLabelling=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();){var m=f.next(),v=m.getEdges().getLabel();m.getLabel().merge(v)}},u.prototype.getResultGeometry=function(f){return this.computeOverlay(f),this._resultGeom},u.prototype.insertUniqueEdges=function(f){for(var m=f.iterator();m.hasNext();){var v=m.next();this.insertUniqueEdge(v)}},u.prototype.computeOverlay=function(f){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 m=new He;this._arg[0].computeSplitEdges(m),this._arg[1].computeSplitEdges(m),this.insertUniqueEdges(m),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Od.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(f),this.cancelDuplicateResultEdges();var v=new Ls(this._geomFact);v.add(this._graph),this._resultPolyList=v.getPolygons();var S=new Ol(this,this._geomFact,this._ptLocator);this._resultLineList=S.build(f);var M=new am(this,this._geomFact,this._ptLocator);this._resultPointList=M.build(f),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,f)},u.prototype.labelIncompleteNode=function(f,m){var v=this._ptLocator.locate(f.getCoordinate(),this._arg[m].getGeometry());f.getLabel().setLocation(m,v)},u.prototype.copyPoints=function(f){for(var m=this._arg[f].getNodeIterator();m.hasNext();){var v=m.next();this._graph.addNode(v.getCoordinate()).setLabel(f,v.getLabel().getLocation(f))}},u.prototype.findResultAreaEdges=function(f){for(var m=this._graph.getEdgeEnds().iterator();m.hasNext();){var v=m.next(),S=v.getLabel();S.isArea()&&!v.isInteriorAreaEdge()&&u.isResultOfOp(S.getLocation(0,Ge.RIGHT),S.getLocation(1,Ge.RIGHT),f)&&v.setInResult(!0)}},u.prototype.computeLabelsFromDepths=function(){for(var f=this._edgeList.iterator();f.hasNext();){var m=f.next(),v=m.getLabel(),S=m.getDepth();if(!S.isNull()){S.normalize();for(var M=0;M<2;M++)v.isNull(M)||!v.isArea()||S.isNull(M)||(S.getDelta(M)===0?v.toLine(M):(ot.isTrue(!S.isNull(M,Ge.LEFT),"depth of LEFT side has not been initialized"),v.setLocation(M,Ge.LEFT,S.getLocation(M,Ge.LEFT)),ot.isTrue(!S.isNull(M,Ge.RIGHT),"depth of RIGHT side has not been initialized"),v.setLocation(M,Ge.RIGHT,S.getLocation(M,Ge.RIGHT))))}}},u.prototype.computeLabelling=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();)f.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},u.prototype.labelIncompleteNodes=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();){var m=f.next(),v=m.getLabel();m.isIsolated()&&(v.isNull(0)?this.labelIncompleteNode(m,0):this.labelIncompleteNode(m,1)),m.getEdges().updateLabelling(v)}},u.prototype.isCoveredByA=function(f){return!!this.isCovered(f,this._resultPolyList)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(n0);Tt.overlayOp=function(a,u,f){return new Tt(a,u).getResultGeometry(f)},Tt.intersection=function(a,u){if(a.isEmpty()||u.isEmpty())return Tt.createEmptyResult(Tt.INTERSECTION,a,u,a.getFactory());if(a.isGeometryCollection()){var f=u;return sm.map(a,{interfaces_:o(function(){return[Ad.MapOp]},"interfaces_"),map:o(function(m){return m.intersection(f)},"map")})}return a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Tt.INTERSECTION)},Tt.symDifference=function(a,u){if(a.isEmpty()||u.isEmpty()){if(a.isEmpty()&&u.isEmpty())return Tt.createEmptyResult(Tt.SYMDIFFERENCE,a,u,a.getFactory());if(a.isEmpty())return u.copy();if(u.isEmpty())return a.copy()}return a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Tt.SYMDIFFERENCE)},Tt.resultDimension=function(a,u,f){var m=u.getDimension(),v=f.getDimension(),S=-1;switch(a){case Tt.INTERSECTION:S=Math.min(m,v);break;case Tt.UNION:S=Math.max(m,v);break;case Tt.DIFFERENCE:S=m;break;case Tt.SYMDIFFERENCE:S=Math.max(m,v)}return S},Tt.createEmptyResult=function(a,u,f,m){var v=null;switch(Tt.resultDimension(a,u,f)){case-1:v=m.createGeometryCollection(new Array(0).fill(null));break;case 0:v=m.createPoint();break;case 1:v=m.createLineString();break;case 2:v=m.createPolygon()}return v},Tt.difference=function(a,u){return a.isEmpty()?Tt.createEmptyResult(Tt.DIFFERENCE,a,u,a.getFactory()):u.isEmpty()?a.copy():(a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Tt.DIFFERENCE))},Tt.isResultOfOp=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1],f=a.getLocation(0),m=a.getLocation(1);return Tt.isResultOfOp(f,m,u)}if(arguments.length===3){var v=arguments[0],S=arguments[1],M=arguments[2];switch(v===U.BOUNDARY&&(v=U.INTERIOR),S===U.BOUNDARY&&(S=U.INTERIOR),M){case Tt.INTERSECTION:return v===U.INTERIOR&&S===U.INTERIOR;case Tt.UNION:return v===U.INTERIOR||S===U.INTERIOR;case Tt.DIFFERENCE:return v===U.INTERIOR&&S!==U.INTERIOR;case Tt.SYMDIFFERENCE:return v===U.INTERIOR&&S!==U.INTERIOR||v!==U.INTERIOR&&S===U.INTERIOR}return!1}},Tt.INTERSECTION=1,Tt.UNION=2,Tt.DIFFERENCE=3,Tt.SYMDIFFERENCE=4;var Wp=o(function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new tl,this._seg=new ct;var a=arguments[0],u=arguments[1];this._g=a,this._boundaryDistanceTolerance=u,this._linework=this.extractLinework(a)},"br");Wp.prototype.isWithinToleranceOfBoundary=function(a){for(var u=0;u<this._linework.getNumGeometries();u++)for(var f=this._linework.getGeometryN(u).getCoordinateSequence(),m=0;m<f.size()-1;m++)if(f.getCoordinate(m,this._seg.p0),f.getCoordinate(m+1,this._seg.p1),this._seg.distance(a)<=this._boundaryDistanceTolerance)return!0;return!1},Wp.prototype.getLocation=function(a){return this.isWithinToleranceOfBoundary(a)?U.BOUNDARY:this._ptLocator.locate(a,this._g)},Wp.prototype.extractLinework=function(a){var u=new i0;a.apply(u);var f=u.getLinework(),m=jt.toLineStringArray(f);return a.getFactory().createMultiLineString(m)},Wp.prototype.interfaces_=function(){return[]},Wp.prototype.getClass=function(){return Wp};var i0=o(function(){this._linework=null,this._linework=new He},"wr");i0.prototype.getLinework=function(){return this._linework},i0.prototype.filter=function(a){if(a instanceof Xr){var u=a;this._linework.add(u.getExteriorRing());for(var f=0;f<u.getNumInteriorRing();f++)this._linework.add(u.getInteriorRingN(f))}},i0.prototype.interfaces_=function(){return[ht]},i0.prototype.getClass=function(){return i0};var Dd=o(function(){this._g=null,this._doLeft=!0,this._doRight=!0;var a=arguments[0];this._g=a},"Or");Dd.prototype.extractPoints=function(a,u,f){for(var m=a.getCoordinates(),v=0;v<m.length-1;v++)this.computeOffsetPoints(m[v],m[v+1],u,f)},Dd.prototype.setSidesToGenerate=function(a,u){this._doLeft=a,this._doRight=u},Dd.prototype.getPoints=function(a){for(var u=new He,f=so.getLines(this._g).iterator();f.hasNext();){var m=f.next();this.extractPoints(m,a,u)}return u},Dd.prototype.computeOffsetPoints=function(a,u,f,m){var v=u.x-a.x,S=u.y-a.y,M=Math.sqrt(v*v+S*S),B=f*v/M,z=f*S/M,te=(u.x+a.x)/2,pe=(u.y+a.y)/2;if(this._doLeft){var be=new N(te-z,pe+B);m.add(be)}if(this._doRight){var Xe=new N(te+z,pe-B);m.add(Xe)}},Dd.prototype.interfaces_=function(){return[]},Dd.prototype.getClass=function(){return Dd};var ia=o(function a(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=a.TOLERANCE,this._testCoords=new He;var u=arguments[0],f=arguments[1],m=arguments[2];this._boundaryDistanceTolerance=a.computeBoundaryDistanceTolerance(u,f),this._geom=[u,f,m],this._locFinder=[new Wp(this._geom[0],this._boundaryDistanceTolerance),new Wp(this._geom[1],this._boundaryDistanceTolerance),new Wp(this._geom[2],this._boundaryDistanceTolerance)]},"t"),hN={TOLERANCE:{configurable:!0}};ia.prototype.reportResult=function(a,u,f){we.out.println("Overlay result invalid - A:"+U.toLocationSymbol(u[0])+" B:"+U.toLocationSymbol(u[1])+" expected:"+(f?"i":"e")+" actual:"+U.toLocationSymbol(u[2]))},ia.prototype.isValid=function(a){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var u=this.checkValid(a);return u},ia.prototype.checkValid=function(){if(arguments.length===1){for(var a=arguments[0],u=0;u<this._testCoords.size();u++){var f=this._testCoords.get(u);if(!this.checkValid(a,f))return this._invalidLocation=f,!1}return!0}if(arguments.length===2){var m=arguments[0],v=arguments[1];return this._location[0]=this._locFinder[0].getLocation(v),this._location[1]=this._locFinder[1].getLocation(v),this._location[2]=this._locFinder[2].getLocation(v),!!ia.hasLocation(this._location,U.BOUNDARY)||this.isValidResult(m,this._location)}},ia.prototype.addTestPts=function(a){var u=new Dd(a);this._testCoords.addAll(u.getPoints(5*this._boundaryDistanceTolerance))},ia.prototype.isValidResult=function(a,u){var f=Tt.isResultOfOp(u[0],u[1],a),m=!(f^u[2]===U.INTERIOR);return m||this.reportResult(a,u,f),m},ia.prototype.getInvalidLocation=function(){return this._invalidLocation},ia.prototype.interfaces_=function(){return[]},ia.prototype.getClass=function(){return ia},ia.hasLocation=function(a,u){for(var f=0;f<3;f++)if(a[f]===u)return!0;return!1},ia.computeBoundaryDistanceTolerance=function(a,u){return Math.min(ui.computeSizeBasedSnapTolerance(a),ui.computeSizeBasedSnapTolerance(u))},ia.isValid=function(a,u,f,m){return new ia(a,u,m).isValid(f)},hN.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(ia,hN);var oa=o(function a(u){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=a.extractFactory(u),this._inputGeoms=u},"t");oa.prototype.extractElements=function(a,u){if(a===null)return null;for(var f=0;f<a.getNumGeometries();f++){var m=a.getGeometryN(f);this._skipEmpty&&m.isEmpty()||u.add(m)}},oa.prototype.combine=function(){for(var a=new He,u=this._inputGeoms.iterator();u.hasNext();){var f=u.next();this.extractElements(f,a)}return a.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(a)},oa.prototype.interfaces_=function(){return[]},oa.prototype.getClass=function(){return oa},oa.combine=function(){if(arguments.length===1){var a=arguments[0];return new oa(a).combine()}if(arguments.length===2){var u=arguments[0],f=arguments[1];return new oa(oa.createList(u,f)).combine()}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];return new oa(oa.createList(m,v,S)).combine()}},oa.extractFactory=function(a){return a.isEmpty()?null:a.iterator().next().getFactory()},oa.createList=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1],f=new He;return f.add(a),f.add(u),f}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2],M=new He;return M.add(m),M.add(v),M.add(S),M}};var xi=o(function(){this._inputPolys=null,this._geomFactory=null;var a=arguments[0];this._inputPolys=a,this._inputPolys===null&&(this._inputPolys=new He)},"Dr"),mN={STRTREE_NODE_CAPACITY:{configurable:!0}};xi.prototype.reduceToGeometries=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next(),v=null;ne(m,ns)?v=this.unionTree(m):m instanceof vt&&(v=m),u.add(v)}return u},xi.prototype.extractByEnvelope=function(a,u,f){for(var m=new He,v=0;v<u.getNumGeometries();v++){var S=u.getGeometryN(v);S.getEnvelopeInternal().intersects(a)?m.add(S):f.add(S)}return this._geomFactory.buildGeometry(m)},xi.prototype.unionOptimized=function(a,u){var f=a.getEnvelopeInternal(),m=u.getEnvelopeInternal();if(!f.intersects(m))return oa.combine(a,u);if(a.getNumGeometries()<=1&&u.getNumGeometries()<=1)return this.unionActual(a,u);var v=f.intersection(m);return this.unionUsingEnvelopeIntersection(a,u,v)},xi.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 a=new JF(xi.STRTREE_NODE_CAPACITY),u=this._inputPolys.iterator();u.hasNext();){var f=u.next();a.insert(f.getEnvelopeInternal(),f)}this._inputPolys=null;var m=a.itemsTree();return this.unionTree(m)},xi.prototype.binaryUnion=function(){if(arguments.length===1){var a=arguments[0];return this.binaryUnion(a,0,a.size())}if(arguments.length===3){var u=arguments[0],f=arguments[1],m=arguments[2];if(m-f<=1){var v=xi.getGeometry(u,f);return this.unionSafe(v,null)}if(m-f==2)return this.unionSafe(xi.getGeometry(u,f),xi.getGeometry(u,f+1));var S=Math.trunc((m+f)/2),M=this.binaryUnion(u,f,S),B=this.binaryUnion(u,S,m);return this.unionSafe(M,B)}},xi.prototype.repeatedUnion=function(a){for(var u=null,f=a.iterator();f.hasNext();){var m=f.next();u=u===null?m.copy():u.union(m)}return u},xi.prototype.unionSafe=function(a,u){return a===null&&u===null?null:a===null?u.copy():u===null?a.copy():this.unionOptimized(a,u)},xi.prototype.unionActual=function(a,u){return xi.restrictToPolygons(a.union(u))},xi.prototype.unionTree=function(a){var u=this.reduceToGeometries(a);return this.binaryUnion(u)},xi.prototype.unionUsingEnvelopeIntersection=function(a,u,f){var m=new He,v=this.extractByEnvelope(f,a,m),S=this.extractByEnvelope(f,u,m),M=this.unionActual(v,S);return m.add(M),oa.combine(m)},xi.prototype.bufferUnion=function(){if(arguments.length===1){var a=arguments[0];return a.get(0).getFactory().buildGeometry(a).buffer(0)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u.getFactory().createGeometryCollection([u,f]).buffer(0)}},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi},xi.restrictToPolygons=function(a){if(ne(a,Hi))return a;var u=Cc.getPolygons(a);return u.size()===1?u.get(0):a.getFactory().createMultiPolygon(jt.toPolygonArray(u))},xi.getGeometry=function(a,u){return u>=a.size()?null:a.get(u)},xi.union=function(a){return new xi(a).union()},mN.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(xi,mN);var Db=o(function(){},"Ar");Db.prototype.interfaces_=function(){return[]},Db.prototype.getClass=function(){return Db},Db.union=function(a,u){if(a.isEmpty()||u.isEmpty()){if(a.isEmpty()&&u.isEmpty())return Tt.createEmptyResult(Tt.UNION,a,u,a.getFactory());if(a.isEmpty())return u.copy();if(u.isEmpty())return a.copy()}return a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Tt.UNION)},e.GeoJSONReader=hE,e.GeoJSONWriter=ZF,e.OverlayOp=Tt,e.UnionOp=Db,e.BufferOp=oo,Object.defineProperty(e,"__esModule",{value:!0})})});var Mx=fe(yn=>{"use strict";g();Object.defineProperty(yn,"__esModule",{value:!0});yn.regexpCode=yn.getEsmExportName=yn.getProperty=yn.safeStringify=yn.stringify=yn.strConcat=yn.addCodeArg=yn.str=yn._=yn.nil=yn._Code=yn.Name=yn.IDENTIFIER=yn._CodeOrName=void 0;var XO=class XO{};o(XO,"_CodeOrName");var Tx=XO;yn._CodeOrName=Tx;yn.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var YO=class YO extends Tx{constructor(t){if(super(),!yn.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};o(YO,"Name");var ig=YO;yn.Name=ig;var ZO=class ZO extends Tx{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>"".concat(r).concat(n),"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof ig&&(r[n.str]=(r[n.str]||0)+1),r),{})}};o(ZO,"_Code");var jl=ZO;yn._Code=jl;yn.nil=new jl("");function OG(e,...t){let r=[e[0]],n=0;for(;n<t.length;)WO(r,t[n]),r.push(e[++n]);return new jl(r)}o(OG,"_");yn._=OG;var HO=new jl("+");function LG(e,...t){let r=[Ex(e[0])],n=0;for(;n<t.length;)r.push(HO),WO(r,t[n]),r.push(HO,Ex(e[++n]));return lde(r),new jl(r)}o(LG,"str");yn.str=LG;function WO(e,t){t instanceof jl?e.push(...t._items):t instanceof ig?e.push(t):e.push(pde(t))}o(WO,"addCodeArg");yn.addCodeArg=WO;function lde(e){let t=1;for(;t<e.length-1;){if(e[t]===HO){let r=ude(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}o(lde,"optimize");function ude(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof ig||e[e.length-1]!=='"'?void 0:typeof t!="string"?"".concat(e.slice(0,-1)).concat(t,'"'):t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof ig))return'"'.concat(e).concat(t.slice(1))}o(ude,"mergeExprItems");var EG;function cde(e,t){return t.emptyStr()?e:e.emptyStr()?t:LG(EG||(EG=V(["","",""])),e,t)}o(cde,"strConcat");yn.strConcat=cde;function pde(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ex(Array.isArray(e)?e.join(","):e)}o(pde,"interpolate");function fde(e){return new jl(Ex(e))}o(fde,"stringify");yn.stringify=fde;function Ex(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Ex,"safeStringify");yn.safeStringify=Ex;var MG;function dde(e){return typeof e=="string"&&yn.IDENTIFIER.test(e)?new jl(".".concat(e)):OG(MG||(MG=V(["[","]"])),e)}o(dde,"getProperty");yn.getProperty=dde;function hde(e){if(typeof e=="string"&&yn.IDENTIFIER.test(e))return new jl("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))}o(hde,"getEsmExportName");yn.getEsmExportName=hde;function mde(e){return new jl(e.toString())}o(mde,"regexpCode");yn.regexpCode=mde});var n4=fe(Da=>{"use strict";g();Object.defineProperty(Da,"__esModule",{value:!0});Da.ValueScope=Da.ValueScopeName=Da.Scope=Da.varKinds=Da.UsedValueState=void 0;var Aa=Mx(),QO=class QO extends Error{constructor(t){super('CodeGen: "code" for '.concat(t," not defined")),this.value=t.value}};o(QO,"ValueError");var KO=QO,OC;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(OC||(Da.UsedValueState=OC={}));Da.varKinds={const:new Aa.Name("const"),let:new Aa.Name("let"),var:new Aa.Name("var")};var e4=class e4{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Aa.Name?t:this.name(t)}name(t){return new Aa.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return"".concat(t).concat(r.index++)}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error('CodeGen: prefix "'.concat(t,'" is not allowed in this scope'));return this._names[t]={prefix:t,index:0}}};o(e4,"Scope");var LC=e4;Da.Scope=LC;var AG,t4=class t4 extends Aa.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Aa._)(AG||(AG=V([".","[","]"])),new Aa.Name(r),n)}};o(t4,"ValueScopeName");var AC=t4;Da.ValueScopeName=AC;var DG,gde=(0,Aa._)(DG||(DG=V(["\n"],["\\n"]))),FG,NG,kG,r4=class r4 extends LC{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts=re(R({},t),{_n:t.lines?gde:Aa.nil})}get(){return this._scope}name(t){return new AC(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(t),{prefix:s}=i,l=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[s];if(c){let y=c.get(l);if(y)return y}else c=this._values[s]=new Map;c.set(l,i);let p=this._scope[s]||(this._scope[s]=[]),h=p.length;return p[h]=r.ref,i.setValue(r,{property:s,itemIndex:h}),i}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error('CodeGen: name "'.concat(n,'" has no value'));return(0,Aa._)(FG||(FG=V(["","",""])),t,n.scopePath)})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error('CodeGen: name "'.concat(i,'" has no value'));return i.value.code},r,n)}_reduceValues(t,r,n={},i){let s=Aa.nil;for(let l in t){let c=t[l];if(!c)continue;let p=n[l]=n[l]||new Map;c.forEach(h=>{if(p.has(h))return;p.set(h,OC.Started);let y=r(h);if(y){let b=this.opts.es5?Da.varKinds.var:Da.varKinds.const;s=(0,Aa._)(NG||(NG=V(["",""," "," = ",";",""])),s,b,h,y,this.opts._n)}else if(y=i==null?void 0:i(h))s=(0,Aa._)(kG||(kG=V(["","","",""])),s,y,this.opts._n);else throw new KO(h);p.set(h,OC.Completed)})}return s}};o(r4,"ValueScope");var JO=r4;Da.ValueScope=JO});var Wt=fe(Kt=>{"use strict";g();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.or=Kt.and=Kt.not=Kt.CodeGen=Kt.operators=Kt.varKinds=Kt.ValueScopeName=Kt.ValueScope=Kt.Scope=Kt.Name=Kt.regexpCode=Kt.stringify=Kt.getProperty=Kt.nil=Kt.strConcat=Kt.str=Kt._=void 0;var Kr=Mx(),ku=n4(),eh=Mx();Object.defineProperty(Kt,"_",{enumerable:!0,get:o(function(){return eh._},"get")});Object.defineProperty(Kt,"str",{enumerable:!0,get:o(function(){return eh.str},"get")});Object.defineProperty(Kt,"strConcat",{enumerable:!0,get:o(function(){return eh.strConcat},"get")});Object.defineProperty(Kt,"nil",{enumerable:!0,get:o(function(){return eh.nil},"get")});Object.defineProperty(Kt,"getProperty",{enumerable:!0,get:o(function(){return eh.getProperty},"get")});Object.defineProperty(Kt,"stringify",{enumerable:!0,get:o(function(){return eh.stringify},"get")});Object.defineProperty(Kt,"regexpCode",{enumerable:!0,get:o(function(){return eh.regexpCode},"get")});Object.defineProperty(Kt,"Name",{enumerable:!0,get:o(function(){return eh.Name},"get")});var kC=n4();Object.defineProperty(Kt,"Scope",{enumerable:!0,get:o(function(){return kC.Scope},"get")});Object.defineProperty(Kt,"ValueScope",{enumerable:!0,get:o(function(){return kC.ValueScope},"get")});Object.defineProperty(Kt,"ValueScopeName",{enumerable:!0,get:o(function(){return kC.ValueScopeName},"get")});Object.defineProperty(Kt,"varKinds",{enumerable:!0,get:o(function(){return kC.varKinds},"get")});Kt.operators={GT:new Kr._Code(">"),GTE:new Kr._Code(">="),LT:new Kr._Code("<"),LTE:new Kr._Code("<="),EQ:new Kr._Code("==="),NEQ:new Kr._Code("!=="),NOT:new Kr._Code("!"),OR:new Kr._Code("||"),AND:new Kr._Code("&&"),ADD:new Kr._Code("+")};var g4=class g4{optimizeNodes(){return this}optimizeNames(t,r){return this}};o(g4,"Node");var gf=g4,y4=class y4 extends gf{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?ku.varKinds.var:this.varKind,i=this.rhs===void 0?"":" = ".concat(this.rhs);return"".concat(n," ").concat(this.name).concat(i,";")+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=X0(this.rhs,t,r)),this}get names(){return this.rhs instanceof Kr._CodeOrName?this.rhs.names:{}}};o(y4,"Def");var i4=y4,v4=class v4 extends gf{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return"".concat(this.lhs," = ").concat(this.rhs,";")+t}optimizeNames(t,r){if(!(this.lhs instanceof Kr.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=X0(this.rhs,t,r),this}get names(){let t=this.lhs instanceof Kr.Name?{}:R({},this.lhs.names);return NC(t,this.rhs)}};o(v4,"Assign");var DC=v4,b4=class b4 extends DC{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return"".concat(this.lhs," ").concat(this.op,"= ").concat(this.rhs,";")+t}};o(b4,"AssignOp");var o4=b4,x4=class x4 extends gf{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return"".concat(this.label,":")+t}};o(x4,"Label");var s4=x4,I4=class I4 extends gf{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){let r=this.label?" ".concat(this.label):"";return"break".concat(r,";")+t}};o(I4,"Break");var a4=I4,_4=class _4 extends gf{constructor(t){super(),this.error=t}render({_n:t}){return"throw ".concat(this.error,";")+t}get names(){return this.error.names}};o(_4,"Throw");var l4=_4,S4=class S4 extends gf{constructor(t){super(),this.code=t}render({_n:t}){return"".concat(this.code,";")+t}optimizeNodes(){return"".concat(this.code)?this:void 0}optimizeNames(t,r){return this.code=X0(this.code,t,r),this}get names(){return this.code instanceof Kr._CodeOrName?this.code.names:{}}};o(S4,"AnyCode");var u4=S4,C4=class C4 extends gf{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(t,r)||(yde(t,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>ag(t,r.names),{})}};o(C4,"ParentNode");var Ox=C4,w4=class w4 extends Ox{render(t){return"{"+t._n+super.render(t)+"}"+t._n}};o(w4,"BlockNode");var yf=w4,P4=class P4 extends Ox{};o(P4,"Root");var c4=P4,T4=class T4 extends yf{};o(T4,"Else");var W0=T4;W0.kind="else";var H0=class H0 extends yf{constructor(t,r){super(r),this.condition=t}render(t){let r="if(".concat(this.condition,")")+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new W0(n):n}if(r)return t===!1?r instanceof H0?r:r.nodes:this.nodes.length?this:new H0(VG(t),r instanceof H0?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=X0(this.condition,t,r),this}get names(){let t=super.names;return NC(t,this.condition),this.else&&ag(t,this.else.names),t}};o(H0,"If");var og=H0;og.kind="if";var E4=class E4 extends yf{};o(E4,"For");var sg=E4;sg.kind="for";var M4=class M4 extends sg{constructor(t){super(),this.iteration=t}render(t){return"for(".concat(this.iteration,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=X0(this.iteration,t,r),this}get names(){return ag(super.names,this.iteration.names)}};o(M4,"ForLoop");var p4=M4,O4=class O4 extends sg{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?ku.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return"for(".concat(r," ").concat(n,"=").concat(i,"; ").concat(n,"<").concat(s,"; ").concat(n,"++)")+super.render(t)}get names(){let t=NC(super.names,this.from);return NC(t,this.to)}};o(O4,"ForRange");var f4=O4,L4=class L4 extends sg{constructor(t,r,n,i){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=i}render(t){return"for(".concat(this.varKind," ").concat(this.name," ").concat(this.loop," ").concat(this.iterable,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=X0(this.iterable,t,r),this}get names(){return ag(super.names,this.iterable.names)}};o(L4,"ForIter");var FC=L4,A4=class A4 extends yf{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){let r=this.async?"async ":"";return"".concat(r,"function ").concat(this.name,"(").concat(this.args,")")+super.render(t)}};o(A4,"Func");var Lx=A4;Lx.kind="func";var D4=class D4 extends Ox{render(t){return"return "+super.render(t)}};o(D4,"Return");var Ax=D4;Ax.kind="return";var F4=class F4 extends yf{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,i;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&ag(t,this.catch.names),this.finally&&ag(t,this.finally.names),t}};o(F4,"Try");var d4=F4,N4=class N4 extends yf{constructor(t){super(),this.error=t}render(t){return"catch(".concat(this.error,")")+super.render(t)}};o(N4,"Catch");var Dx=N4;Dx.kind="catch";var k4=class k4 extends yf{render(t){return"finally"+super.render(t)}};o(k4,"Finally");var Fx=k4;Fx.kind="finally";var RG,BG,jG,R4=class R4{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts=re(R({},r),{_n:r.lines?"\n":""}),this._extScope=t,this._scope=new ku.Scope({parent:t}),this._nodes=[new c4]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new i4(t,s,n)),s}const(t,r,n){return this._def(ku.varKinds.const,t,r,n)}let(t,r,n){return this._def(ku.varKinds.let,t,r,n)}var(t,r,n){return this._def(ku.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new DC(t,r,n))}add(t,r){return this._leafNode(new o4(t,Kt.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==Kr.nil&&this._leafNode(new u4(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Kr.addCodeArg)(r,i));return r.push("}"),new Kr._Code(r)}if(t,r,n){if(this._blockNode(new og(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new og(t))}else(){return this._elseNode(new W0)}endIf(){return this._endBlockNode(og,W0)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new p4(t),r)}forRange(t,r,n,i,s=this.opts.es5?ku.varKinds.var:ku.varKinds.let){let l=this._scope.toName(t);return this._for(new f4(s,l,r,n),()=>i(l))}forOf(t,r,n,i=ku.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let l=r instanceof Kr.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Kr._)(RG||(RG=V(["",".length"])),l),c=>{this.var(s,(0,Kr._)(BG||(BG=V(["","[","]"])),l,c)),n(s)})}return this._for(new FC("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?ku.varKinds.var:ku.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,Kr._)(jG||(jG=V(["Object.keys(",")"])),r),n);let s=this._scope.toName(t);return this._for(new FC("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(sg)}label(t){return this._leafNode(new s4(t))}break(t){return this._leafNode(new a4(t))}return(t){let r=new Ax;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ax)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new d4;if(this._blockNode(i),this.code(t),r){let s=this.name("e");this._currNode=i.catch=new Dx(s),r(s)}return n&&(this._currNode=i.finally=new Fx,this.code(n)),this._endBlockNode(Dx,Fx)}throw(t){return this._leafNode(new l4(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error("CodeGen: wrong number of nodes: ".concat(n," vs ").concat(t," expected"));return this._nodes.length=r,this}func(t,r=Kr.nil,n,i){return this._blockNode(new Lx(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Lx)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error('CodeGen: not in block "'.concat(r?"".concat(t.kind,"/").concat(r.kind):t.kind,'"'))}_elseNode(t){let r=this._currNode;if(!(r instanceof og))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};o(R4,"CodeGen");var h4=R4;Kt.CodeGen=h4;function ag(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}o(ag,"addNames");function NC(e,t){return t instanceof Kr._CodeOrName?ag(e,t.names):e}o(NC,"addExprNames");function X0(e,t,r){if(e instanceof Kr.Name)return n(e);if(!i(e))return e;return new Kr._Code(e._items.reduce((s,l)=>(l instanceof Kr.Name&&(l=n(l)),l instanceof Kr._Code?s.push(...l._items):s.push(l),s),[]));function n(s){let l=r[s.str];return l===void 0||t[s.str]!==1?s:(delete t[s.str],l)}function i(s){return s instanceof Kr._Code&&s._items.some(l=>l instanceof Kr.Name&&t[l.str]===1&&r[l.str]!==void 0)}}o(X0,"optimizeExpr");function yde(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}o(yde,"subtractNames");var $G;function VG(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Kr._)($G||($G=V(["!",""])),m4(e))}o(VG,"not");Kt.not=VG;var vde=zG(Kt.operators.AND);function bde(...e){return e.reduce(vde)}o(bde,"and");Kt.and=bde;var xde=zG(Kt.operators.OR);function Ide(...e){return e.reduce(xde)}o(Ide,"or");Kt.or=Ide;var GG;function zG(e){return(t,r)=>t===Kr.nil?r:r===Kr.nil?t:(0,Kr._)(GG||(GG=V([""," "," ",""])),m4(t),e,m4(r))}o(zG,"mappend");var UG;function m4(e){return e instanceof Kr.Name?e:(0,Kr._)(UG||(UG=V(["(",")"])),e)}o(m4,"par")});var vn=fe(Pr=>{"use strict";g();Object.defineProperty(Pr,"__esModule",{value:!0});Pr.checkStrictMode=Pr.getErrorPath=Pr.Type=Pr.useFunc=Pr.setEvaluated=Pr.evaluatedPropsToName=Pr.mergeEvaluated=Pr.eachItem=Pr.unescapeJsonPointer=Pr.escapeJsonPointer=Pr.escapeFragment=Pr.unescapeFragment=Pr.schemaRefOrVal=Pr.schemaHasRulesButRef=Pr.schemaHasRules=Pr.checkUnknownRules=Pr.alwaysValidSchema=Pr.toHash=void 0;var Kn=Wt(),_de=Mx();function Sde(e){let t={};for(let r of e)t[r]=!0;return t}o(Sde,"toHash");Pr.toHash=Sde;function Cde(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(pU(e,t),!fU(t,e.self.RULES.all))}o(Cde,"alwaysValidSchema");Pr.alwaysValidSchema=Cde;function pU(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let s in t)i[s]||mU(e,'unknown keyword: "'.concat(s,'"'))}o(pU,"checkUnknownRules");Pr.checkUnknownRules=pU;function fU(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}o(fU,"schemaHasRules");Pr.schemaHasRules=fU;function wde(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}o(wde,"schemaHasRulesButRef");Pr.schemaHasRulesButRef=wde;var WG,XG;function Pde({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Kn._)(WG||(WG=V(["",""])),r)}return(0,Kn._)(XG||(XG=V(["","","",""])),e,t,(0,Kn.getProperty)(n))}o(Pde,"schemaRefOrVal");Pr.schemaRefOrVal=Pde;function Tde(e){return dU(decodeURIComponent(e))}o(Tde,"unescapeFragment");Pr.unescapeFragment=Tde;function Ede(e){return encodeURIComponent(j4(e))}o(Ede,"escapeFragment");Pr.escapeFragment=Ede;function j4(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}o(j4,"escapeJsonPointer");Pr.escapeJsonPointer=j4;function dU(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o(dU,"unescapeJsonPointer");Pr.unescapeJsonPointer=dU;function Mde(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}o(Mde,"eachItem");Pr.eachItem=Mde;function qG({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,l,c)=>{let p=l===void 0?s:l instanceof Kn.Name?(s instanceof Kn.Name?e(i,s,l):t(i,s,l),l):s instanceof Kn.Name?(t(i,l,s),s):r(s,l);return c===Kn.Name&&!(p instanceof Kn.Name)?n(i,p):p}}o(qG,"makeMergeEvaluated");var YG,ZG,KG,JG,QG,eU,tU,rU,nU,iU;Pr.mergeEvaluated={props:qG({mergeNames:o((e,t,r)=>e.if((0,Kn._)(YG||(YG=V([""," !== true && "," !== undefined"])),r,t),()=>{e.if((0,Kn._)(ZG||(ZG=V([""," === true"])),t),()=>e.assign(r,!0),()=>e.assign(r,(0,Kn._)(KG||(KG=V([""," || {}"])),r)).code((0,Kn._)(JG||(JG=V(["Object.assign(",", ",")"])),r,t)))}),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,Kn._)(QG||(QG=V([""," !== true"])),r),()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Kn._)(eU||(eU=V([""," || {}"])),r)),$4(e,r,t))}),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:R(R({},e),t),"mergeValues"),resultToName:hU}),items:qG({mergeNames:o((e,t,r)=>e.if((0,Kn._)(tU||(tU=V([""," !== true && "," !== undefined"])),r,t),()=>e.assign(r,(0,Kn._)(rU||(rU=V([""," === true ? true : "," > "," ? "," : ",""])),t,r,t,r,t))),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,Kn._)(nU||(nU=V([""," !== true"])),r),()=>e.assign(r,t===!0?!0:(0,Kn._)(iU||(iU=V([""," > "," ? "," : ",""])),r,t,r,t))),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:o((e,t)=>e.var("items",t),"resultToName")})};var oU;function hU(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Kn._)(oU||(oU=V(["{}"]))));return t!==void 0&&$4(e,r,t),r}o(hU,"evaluatedPropsToName");Pr.evaluatedPropsToName=hU;var sU;function $4(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Kn._)(sU||(sU=V(["","",""])),t,(0,Kn.getProperty)(n)),!0))}o($4,"setEvaluated");Pr.setEvaluated=$4;var HG={};function Ode(e,t){return e.scopeValue("func",{ref:t,code:HG[t.code]||(HG[t.code]=new _de._Code(t.code))})}o(Ode,"useFunc");Pr.useFunc=Ode;var B4;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(B4||(Pr.Type=B4={}));var aU,lU,uU,cU;function Lde(e,t,r){if(e instanceof Kn.Name){let n=t===B4.Num;return r?n?(0,Kn._)(aU||(aU=V(['"[" + ',' + "]"'])),e):(0,Kn._)(lU||(lU=V(['"[\'" + ',' + "\']"'])),e):n?(0,Kn._)(uU||(uU=V(['"/" + ',""])),e):(0,Kn._)(cU||(cU=V(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return r?(0,Kn.getProperty)(e).toString():"/"+j4(e)}o(Lde,"getErrorPath");Pr.getErrorPath=Lde;function mU(e,t,r=e.opts.strictSchema){if(r){if(t="strict mode: ".concat(t),r===!0)throw new Error(t);e.self.logger.warn(t)}}o(mU,"checkStrictMode");Pr.checkStrictMode=mU});var vf=fe(G4=>{"use strict";g();Object.defineProperty(G4,"__esModule",{value:!0});var Bs=Wt(),Ade={data:new Bs.Name("data"),valCxt:new Bs.Name("valCxt"),instancePath:new Bs.Name("instancePath"),parentData:new Bs.Name("parentData"),parentDataProperty:new Bs.Name("parentDataProperty"),rootData:new Bs.Name("rootData"),dynamicAnchors:new Bs.Name("dynamicAnchors"),vErrors:new Bs.Name("vErrors"),errors:new Bs.Name("errors"),this:new Bs.Name("this"),self:new Bs.Name("self"),scope:new Bs.Name("scope"),json:new Bs.Name("json"),jsonPos:new Bs.Name("jsonPos"),jsonLen:new Bs.Name("jsonLen"),jsonPart:new Bs.Name("jsonPart")};G4.default=Ade});var Nx=fe(js=>{"use strict";g();Object.defineProperty(js,"__esModule",{value:!0});js.extendErrors=js.resetErrorsCount=js.reportExtraError=js.reportError=js.keyword$DataError=js.keywordError=void 0;var on=Wt(),RC=vn(),fa=vf(),gU;js.keywordError={message:o(({keyword:e})=>(0,on.str)(gU||(gU=V(['must pass "','" keyword validation'])),e),"message")};var yU,vU;js.keyword$DataError={message:o(({keyword:e,schemaType:t})=>t?(0,on.str)(yU||(yU=V(['"','" keyword must be '," ($data)"])),e,t):(0,on.str)(vU||(vU=V(['"','" keyword is invalid ($data)'])),e),"message")};var bU;function Dde(e,t=js.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:l,allErrors:c}=i,p=VU(e,t,r);(n!=null?n:l||c)?GU(s,p):UU(i,(0,on._)(bU||(bU=V(["[","]"])),p))}o(Dde,"reportError");js.reportError=Dde;function Fde(e,t=js.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:l}=n,c=VU(e,t,r);GU(i,c),s||l||UU(n,fa.default.vErrors)}o(Fde,"reportExtraError");js.reportExtraError=Fde;var xU,IU;function Nde(e,t){e.assign(fa.default.errors,t),e.if((0,on._)(xU||(xU=V([""," !== null"])),fa.default.vErrors),()=>e.if(t,()=>e.assign((0,on._)(IU||(IU=V(["",".length"])),fa.default.vErrors),t),()=>e.assign(fa.default.vErrors,null)))}o(Nde,"resetErrorsCount");js.resetErrorsCount=Nde;var _U,SU,CU,wU,PU,TU,EU;function kde({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let l=e.name("err");e.forRange("i",i,fa.default.errors,c=>{e.const(l,(0,on._)(_U||(_U=V(["","[","]"])),fa.default.vErrors,c)),e.if((0,on._)(SU||(SU=V(["",".instancePath === undefined"])),l),()=>e.assign((0,on._)(CU||(CU=V(["",".instancePath"])),l),(0,on.strConcat)(fa.default.instancePath,s.errorPath))),e.assign((0,on._)(wU||(wU=V(["",".schemaPath"])),l),(0,on.str)(PU||(PU=V(["","/",""])),s.errSchemaPath,t)),s.opts.verbose&&(e.assign((0,on._)(TU||(TU=V(["",".schema"])),l),r),e.assign((0,on._)(EU||(EU=V(["",".data"])),l),n))})}o(kde,"extendErrors");js.extendErrors=kde;var MU,OU,LU,AU;function GU(e,t){let r=e.const("err",t);e.if((0,on._)(MU||(MU=V([""," === null"])),fa.default.vErrors),()=>e.assign(fa.default.vErrors,(0,on._)(OU||(OU=V(["[","]"])),r)),(0,on._)(LU||(LU=V(["",".push(",")"])),fa.default.vErrors,r)),e.code((0,on._)(AU||(AU=V(["","++"])),fa.default.errors))}o(GU,"addError");var DU,FU;function UU(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,on._)(DU||(DU=V(["new ","(",")"])),e.ValidationError,t)):(r.assign((0,on._)(FU||(FU=V(["",".errors"])),n),t),r.return(!1))}o(UU,"returnErrors");var lg={keyword:new on.Name("keyword"),schemaPath:new on.Name("schemaPath"),params:new on.Name("params"),propertyName:new on.Name("propertyName"),message:new on.Name("message"),schema:new on.Name("schema"),parentSchema:new on.Name("parentSchema")},NU;function VU(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,on._)(NU||(NU=V(["{}"]))):Rde(e,t,r)}o(VU,"errorObjectCode");function Rde(e,t,r={}){let{gen:n,it:i}=e,s=[Bde(i,r),jde(e,r)];return $de(e,t,s),n.object(...s)}o(Rde,"errorObject");var kU;function Bde({errorPath:e},{instancePath:t}){let r=t?(0,on.str)(kU||(kU=V(["","",""])),e,(0,RC.getErrorPath)(t,RC.Type.Str)):e;return[fa.default.instancePath,(0,on.strConcat)(fa.default.instancePath,r)]}o(Bde,"errorInstancePath");var RU,BU;function jde({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,on.str)(RU||(RU=V(["","/",""])),t,e);return r&&(i=(0,on.str)(BU||(BU=V(["","",""])),i,(0,RC.getErrorPath)(r,RC.Type.Str))),[lg.schemaPath,i]}o(jde,"errorSchemaPath");var jU,$U;function $de(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:l,it:c}=e,{opts:p,propertyName:h,topSchemaRef:y,schemaPath:b}=c;n.push([lg.keyword,i],[lg.params,typeof t=="function"?t(e):t||(0,on._)(jU||(jU=V(["{}"])))]),p.messages&&n.push([lg.message,typeof r=="function"?r(e):r]),p.verbose&&n.push([lg.schema,l],[lg.parentSchema,(0,on._)($U||($U=V(["","",""])),y,b)],[fa.default.data,s]),h&&n.push([lg.propertyName,h])}o($de,"extraErrorProps")});var HU=fe(Y0=>{"use strict";g();Object.defineProperty(Y0,"__esModule",{value:!0});Y0.boolOrEmptySchema=Y0.topBoolOrEmptySchema=void 0;var Gde=Nx(),Ude=Wt(),Vde=vf(),zde={message:"boolean schema is false"},zU;function qde(e){let{gen:t,schema:r,validateName:n}=e;r===!1?qU(e,!1):typeof r=="object"&&r.$async===!0?t.return(Vde.default.data):(t.assign((0,Ude._)(zU||(zU=V(["",".errors"])),n),null),t.return(!0))}o(qde,"topBoolOrEmptySchema");Y0.topBoolOrEmptySchema=qde;function Hde(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),qU(e)):r.var(t,!0)}o(Hde,"boolOrEmptySchema");Y0.boolOrEmptySchema=Hde;function qU(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Gde.reportError)(i,zde,void 0,t)}o(qU,"falseSchemaError")});var U4=fe(Z0=>{"use strict";g();Object.defineProperty(Z0,"__esModule",{value:!0});Z0.getRules=Z0.isJSONType=void 0;var Wde=["string","number","integer","boolean","null","object","array"],Xde=new Set(Wde);function Yde(e){return typeof e=="string"&&Xde.has(e)}o(Yde,"isJSONType");Z0.isJSONType=Yde;function Zde(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:re(R({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}o(Zde,"getRules");Z0.getRules=Zde});var V4=fe(th=>{"use strict";g();Object.defineProperty(th,"__esModule",{value:!0});th.shouldUseRule=th.shouldUseGroup=th.schemaHasRulesForType=void 0;function Kde({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&WU(e,n)}o(Kde,"schemaHasRulesForType");th.schemaHasRulesForType=Kde;function WU(e,t){return t.rules.some(r=>XU(e,r))}o(WU,"shouldUseGroup");th.shouldUseGroup=WU;function XU(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}o(XU,"shouldUseRule");th.shouldUseRule=XU});var kx=fe($s=>{"use strict";g();Object.defineProperty($s,"__esModule",{value:!0});$s.reportTypeError=$s.checkDataTypes=$s.checkDataType=$s.coerceAndCheckDataType=$s.getJSONTypes=$s.getSchemaTypes=$s.DataType=void 0;var Jde=U4(),Qde=V4(),ehe=Nx(),Ht=Wt(),EV=vn(),K0;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(K0||($s.DataType=K0={}));function the(e){let t=MV(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}o(the,"getSchemaTypes");$s.getSchemaTypes=the;function MV(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Jde.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}o(MV,"getJSONTypes");$s.getJSONTypes=MV;function rhe(e,t){let{gen:r,data:n,opts:i}=e,s=nhe(t,i.coerceTypes),l=t.length>0&&!(s.length===0&&t.length===1&&(0,Qde.schemaHasRulesForType)(e,t[0]));if(l){let c=q4(t,n,i.strictNumbers,K0.Wrong);r.if(c,()=>{s.length?ihe(e,t,s):H4(e)})}return l}o(rhe,"coerceAndCheckDataType");$s.coerceAndCheckDataType=rhe;var OV=new Set(["string","number","integer","boolean","null"]);function nhe(e,t){return t?e.filter(r=>OV.has(r)||t==="array"&&r==="array"):[]}o(nhe,"coerceToTypes");var YU,ZU,KU,JU,QU,eV,tV,rV,nV,iV,oV,sV,aV,lV,uV,cV,pV,fV,dV,hV;function ihe(e,t,r){let{gen:n,data:i,opts:s}=e,l=n.let("dataType",(0,Ht._)(YU||(YU=V(["typeof ",""])),i)),c=n.let("coerced",(0,Ht._)(ZU||(ZU=V(["undefined"]))));s.coerceTypes==="array"&&n.if((0,Ht._)(KU||(KU=V([""," == 'object' && Array.isArray(",") && ",".length == 1"])),l,i,i),()=>n.assign(i,(0,Ht._)(JU||(JU=V(["","[0]"])),i)).assign(l,(0,Ht._)(QU||(QU=V(["typeof ",""])),i)).if(q4(t,i,s.strictNumbers),()=>n.assign(c,i))),n.if((0,Ht._)(eV||(eV=V([""," !== undefined"])),c));for(let h of r)(OV.has(h)||h==="array"&&s.coerceTypes==="array")&&p(h);n.else(),H4(e),n.endIf(),n.if((0,Ht._)(tV||(tV=V([""," !== undefined"])),c),()=>{n.assign(i,c),ohe(e,c)});function p(h){switch(h){case"string":n.elseIf((0,Ht._)(rV||(rV=V(["",' == "number" || ',' == "boolean"'])),l,l)).assign(c,(0,Ht._)(nV||(nV=V(['"" + ',""])),i)).elseIf((0,Ht._)(iV||(iV=V([""," === null"])),i)).assign(c,(0,Ht._)(oV||(oV=V(['""']))));return;case"number":n.elseIf((0,Ht._)(sV||(sV=V(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),l,i,l,i,i,i)).assign(c,(0,Ht._)(aV||(aV=V(["+",""])),i));return;case"integer":n.elseIf((0,Ht._)(lV||(lV=V(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),l,i,l,i,i,i,i)).assign(c,(0,Ht._)(uV||(uV=V(["+",""])),i));return;case"boolean":n.elseIf((0,Ht._)(cV||(cV=V(["",' === "false" || '," === 0 || "," === null"])),i,i,i)).assign(c,!1).elseIf((0,Ht._)(pV||(pV=V(["",' === "true" || '," === 1"])),i,i)).assign(c,!0);return;case"null":n.elseIf((0,Ht._)(fV||(fV=V(["",' === "" || '," === 0 || "," === false"])),i,i,i)),n.assign(c,null);return;case"array":n.elseIf((0,Ht._)(dV||(dV=V(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),l,l,l,i)).assign(c,(0,Ht._)(hV||(hV=V(["[","]"])),i))}}o(p,"coerceSpecificType")}o(ihe,"coerceData");var mV,gV;function ohe({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Ht._)(mV||(mV=V([""," !== undefined"])),t),()=>e.assign((0,Ht._)(gV||(gV=V(["","[","]"])),t,r),n))}o(ohe,"assignParentData");var yV,vV,bV,xV,IV,_V,SV;function z4(e,t,r,n=K0.Correct){let i=n===K0.Correct?Ht.operators.EQ:Ht.operators.NEQ,s;switch(e){case"null":return(0,Ht._)(yV||(yV=V([""," "," null"])),t,i);case"array":s=(0,Ht._)(vV||(vV=V(["Array.isArray(",")"])),t);break;case"object":s=(0,Ht._)(bV||(bV=V([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":s=l((0,Ht._)(xV||(xV=V(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":s=l();break;default:return(0,Ht._)(IV||(IV=V(["typeof "," "," ",""])),t,i,e)}return n===K0.Correct?s:(0,Ht.not)(s);function l(c=Ht.nil){return(0,Ht.and)((0,Ht._)(_V||(_V=V(["typeof ",' == "number"'])),t),c,r?(0,Ht._)(SV||(SV=V(["isFinite(",")"])),t):Ht.nil)}}o(z4,"checkDataType");$s.checkDataType=z4;var CV,wV;function q4(e,t,r,n){if(e.length===1)return z4(e[0],t,r,n);let i,s=(0,EV.toHash)(e);if(s.array&&s.object){let l=(0,Ht._)(CV||(CV=V(["typeof ",' != "object"'])),t);i=s.null?l:(0,Ht._)(wV||(wV=V(["!"," || ",""])),t,l),delete s.null,delete s.array,delete s.object}else i=Ht.nil;s.number&&delete s.integer;for(let l in s)i=(0,Ht.and)(i,z4(l,t,r,n));return i}o(q4,"checkDataTypes");$s.checkDataTypes=q4;var PV,TV,she={message:o(({schema:e})=>"must be ".concat(e),"message"),params:o(({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ht._)(PV||(PV=V(["{type: ","}"])),e):(0,Ht._)(TV||(TV=V(["{type: ","}"])),t),"params")};function H4(e){let t=ahe(e);(0,ehe.reportError)(t,she)}o(H4,"reportTypeError");$s.reportTypeError=H4;function ahe(e){let{gen:t,data:r,schema:n}=e,i=(0,EV.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}o(ahe,"getTypeErrorContext")});var kV=fe(BC=>{"use strict";g();Object.defineProperty(BC,"__esModule",{value:!0});BC.assignDefaults=void 0;var J0=Wt(),lhe=vn();function uhe(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)LV(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>LV(e,s,i.default))}o(uhe,"assignDefaults");BC.assignDefaults=uhe;var AV,DV,FV,NV;function LV(e,t,r){let{gen:n,compositeRule:i,data:s,opts:l}=e;if(r===void 0)return;let c=(0,J0._)(AV||(AV=V(["","",""])),s,(0,J0.getProperty)(t));if(i){(0,lhe.checkStrictMode)(e,"default is ignored for: ".concat(c));return}let p=(0,J0._)(DV||(DV=V([""," === undefined"])),c);l.useDefaults==="empty"&&(p=(0,J0._)(FV||(FV=V([""," || "," === null || ",' === ""'])),p,c,c)),n.if(p,(0,J0._)(NV||(NV=V([""," = ",""])),c,(0,J0.stringify)(r)))}o(LV,"assignDefault")});var $l=fe(qn=>{"use strict";g();Object.defineProperty(qn,"__esModule",{value:!0});qn.validateUnion=qn.validateArray=qn.usePattern=qn.callValidateCode=qn.schemaProperties=qn.allSchemaProperties=qn.noPropertyInData=qn.propertyInData=qn.isOwnProperty=qn.hasPropFunc=qn.reportMissingProp=qn.checkMissingProp=qn.checkReportMissingProp=void 0;var pi=Wt(),W4=vn(),rh=vf(),che=vn(),RV;function phe(e,t){let{gen:r,data:n,it:i}=e;r.if(Y4(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,pi._)(RV||(RV=V(["",""])),t)},!0),e.error()})}o(phe,"checkReportMissingProp");qn.checkReportMissingProp=phe;var BV;function fhe({gen:e,data:t,it:{opts:r}},n,i){return(0,pi.or)(...n.map(s=>(0,pi.and)(Y4(e,t,s,r.ownProperties),(0,pi._)(BV||(BV=V([""," = ",""])),i,s))))}o(fhe,"checkMissingProp");qn.checkMissingProp=fhe;function dhe(e,t){e.setParams({missingProperty:t},!0),e.error()}o(dhe,"reportMissingProp");qn.reportMissingProp=dhe;var jV;function JV(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,pi._)(jV||(jV=V(["Object.prototype.hasOwnProperty"])))})}o(JV,"hasPropFunc");qn.hasPropFunc=JV;var $V;function X4(e,t,r){return(0,pi._)($V||($V=V(["",".call(",", ",")"])),JV(e),t,r)}o(X4,"isOwnProperty");qn.isOwnProperty=X4;var GV,UV;function hhe(e,t,r,n){let i=(0,pi._)(GV||(GV=V(["",""," !== undefined"])),t,(0,pi.getProperty)(r));return n?(0,pi._)(UV||(UV=V([""," && ",""])),i,X4(e,t,r)):i}o(hhe,"propertyInData");qn.propertyInData=hhe;var VV;function Y4(e,t,r,n){let i=(0,pi._)(VV||(VV=V(["",""," === undefined"])),t,(0,pi.getProperty)(r));return n?(0,pi.or)(i,(0,pi.not)(X4(e,t,r))):i}o(Y4,"noPropertyInData");qn.noPropertyInData=Y4;function QV(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}o(QV,"allSchemaProperties");qn.allSchemaProperties=QV;function mhe(e,t){return QV(t).filter(r=>!(0,W4.alwaysValidSchema)(e,t[r]))}o(mhe,"schemaProperties");qn.schemaProperties=mhe;var zV,qV,HV,WV;function ghe({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:l},c,p,h){let y=h?(0,pi._)(zV||(zV=V(["",", ",", ","",""])),e,t,n,i):t,b=[[rh.default.instancePath,(0,pi.strConcat)(rh.default.instancePath,s)],[rh.default.parentData,l.parentData],[rh.default.parentDataProperty,l.parentDataProperty],[rh.default.rootData,rh.default.rootData]];l.opts.dynamicRef&&b.push([rh.default.dynamicAnchors,rh.default.dynamicAnchors]);let _=(0,pi._)(qV||(qV=V(["",", ",""])),y,r.object(...b));return p!==pi.nil?(0,pi._)(HV||(HV=V(["",".call(",", ",")"])),c,p,_):(0,pi._)(WV||(WV=V(["","(",")"])),c,_)}o(ghe,"callValidateCode");qn.callValidateCode=ghe;var XV,yhe=(0,pi._)(XV||(XV=V(["new RegExp"]))),YV;function vhe({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,pi._)(YV||(YV=V(["","(",", ",")"])),i.code==="new RegExp"?yhe:(0,che.useFunc)(e,i),r,n)})}o(vhe,"usePattern");qn.usePattern=vhe;var ZV;function bhe(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let c=t.let("valid",!0);return l(()=>t.assign(c,!1)),c}return t.var(s,!0),l(()=>t.break()),s;function l(c){let p=t.const("len",(0,pi._)(ZV||(ZV=V(["",".length"])),r));t.forRange("i",0,p,h=>{e.subschema({keyword:n,dataProp:h,dataPropType:W4.Type.Num},s),t.if((0,pi.not)(s),c)})}o(l,"validateItems")}o(bhe,"validateArray");qn.validateArray=bhe;var KV;function xhe(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(p=>(0,W4.alwaysValidSchema)(i,p))&&!i.opts.unevaluated)return;let l=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((p,h)=>{let y=e.subschema({keyword:n,schemaProp:h,compositeRule:!0},c);t.assign(l,(0,pi._)(KV||(KV=V([""," || ",""])),l,c)),e.mergeValidEvaluated(y,c)||t.if((0,pi.not)(l))})),e.result(l,()=>e.reset(),()=>e.error(!0))}o(xhe,"validateUnion");qn.validateUnion=xhe});var fz=fe(Xc=>{"use strict";g();Object.defineProperty(Xc,"__esModule",{value:!0});Xc.validateKeywordUsage=Xc.validSchemaType=Xc.funcKeywordCode=Xc.macroKeywordCode=void 0;var da=Wt(),ug=vf(),Ihe=$l(),_he=Nx();function She(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:l}=e,c=t.macro.call(l.self,i,s,l),p=pz(r,n,c);l.opts.validateSchema!==!1&&l.self.validateSchema(c,!0);let h=r.name("valid");e.subschema({schema:c,schemaPath:da.nil,errSchemaPath:"".concat(l.errSchemaPath,"/").concat(n),topSchemaRef:p,compositeRule:!0},h),e.pass(h,()=>e.error(!0))}o(She,"macroKeywordCode");Xc.macroKeywordCode=She;var tz,rz,nz,iz,oz,sz;function Che(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:l,$data:c,it:p}=e;Phe(p,t);let h=!c&&t.compile?t.compile.call(p.self,s,l,p):t.validate,y=pz(n,i,h),b=n.let("valid");e.block$data(b,_),e.ok((r=t.valid)!==null&&r!==void 0?r:b);function _(){if(t.errors===!1)E(),t.modifying&&ez(e),w(()=>e.error());else{let O=t.async?C():P();t.modifying&&ez(e),w(()=>whe(e,O))}}o(_,"validateKeyword");function C(){let O=n.let("ruleErrs",null);return n.try(()=>E((0,da._)(tz||(tz=V(["await "])))),D=>n.assign(b,!1).if((0,da._)(rz||(rz=V([""," instanceof ",""])),D,p.ValidationError),()=>n.assign(O,(0,da._)(nz||(nz=V(["",".errors"])),D)),()=>n.throw(D))),O}o(C,"validateAsync");function P(){let O=(0,da._)(iz||(iz=V(["",".errors"])),y);return n.assign(O,null),E(da.nil),O}o(P,"validateSync");function E(O=t.async?(0,da._)(oz||(oz=V(["await "]))):da.nil){let D=p.opts.passContext?ug.default.this:ug.default.self,A=!("compile"in t&&!c||t.schema===!1);n.assign(b,(0,da._)(sz||(sz=V(["","",""])),O,(0,Ihe.callValidateCode)(e,y,D,A)),t.modifying)}o(E,"assignValid");function w(O){var D;n.if((0,da.not)((D=t.valid)!==null&&D!==void 0?D:b),O)}o(w,"reportErrs")}o(Che,"funcKeywordCode");Xc.funcKeywordCode=Che;var az;function ez(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,da._)(az||(az=V(["","[","]"])),n.parentData,n.parentDataProperty)))}o(ez,"modifyData");var lz,uz,cz;function whe(e,t){let{gen:r}=e;r.if((0,da._)(lz||(lz=V(["Array.isArray(",")"])),t),()=>{r.assign(ug.default.vErrors,(0,da._)(uz||(uz=V([""," === null ? "," : ",".concat(",")"])),ug.default.vErrors,t,ug.default.vErrors,t)).assign(ug.default.errors,(0,da._)(cz||(cz=V(["",".length"])),ug.default.vErrors)),(0,_he.extendErrors)(e)},()=>e.error())}o(whe,"addErrs");function Phe({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}o(Phe,"checkAsyncKeyword");function pz(e,t,r){if(r===void 0)throw new Error('keyword "'.concat(t,'" failed to compile'));return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,da.stringify)(r)})}o(pz,"useKeyword");function The(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}o(The,"validSchemaType");Xc.validSchemaType=The;function Ehe({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let l=i.dependencies;if(l!=null&&l.some(c=>!Object.prototype.hasOwnProperty.call(e,c)))throw new Error("parent schema must have dependencies of ".concat(s,": ").concat(l.join(",")));if(i.validateSchema&&!i.validateSchema(e[s])){let p='keyword "'.concat(s,'" value is invalid at path "').concat(n,'": ')+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(p);else throw new Error(p)}}o(Ehe,"validateKeywordUsage");Xc.validateKeywordUsage=Ehe});var bz=fe(nh=>{"use strict";g();Object.defineProperty(nh,"__esModule",{value:!0});nh.extendSubschemaMode=nh.extendSubschemaData=nh.getSubschema=void 0;var Yc=Wt(),vz=vn(),dz,hz;function Mhe(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:l}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let c=e.schema[t];return r===void 0?{schema:c,schemaPath:(0,Yc._)(dz||(dz=V(["","",""])),e.schemaPath,(0,Yc.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:c[r],schemaPath:(0,Yc._)(hz||(hz=V(["","","",""])),e.schemaPath,(0,Yc.getProperty)(t),(0,Yc.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,vz.escapeFragment)(r))}}if(n!==void 0){if(i===void 0||s===void 0||l===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:l,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}o(Mhe,"getSubschema");nh.getSubschema=Mhe;var mz,gz,yz;function Ohe(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:l}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=t;if(r!==void 0){let{errorPath:h,dataPathArr:y,opts:b}=t,_=c.let("data",(0,Yc._)(mz||(mz=V(["","",""])),t.data,(0,Yc.getProperty)(r)),!0);p(_),e.errorPath=(0,Yc.str)(gz||(gz=V(["","",""])),h,(0,vz.getErrorPath)(r,n,b.jsPropertySyntax)),e.parentDataProperty=(0,Yc._)(yz||(yz=V(["",""])),r),e.dataPathArr=[...y,e.parentDataProperty]}if(i!==void 0){let h=i instanceof Yc.Name?i:c.let("data",i,!0);p(h),l!==void 0&&(e.propertyName=l)}s&&(e.dataTypes=s);function p(h){e.data=h,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,h]}o(p,"dataContextProps")}o(Ohe,"extendSubschemaData");nh.extendSubschemaData=Ohe;function Lhe(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}o(Lhe,"extendSubschemaMode");nh.extendSubschemaMode=Lhe});var Z4=fe((Aht,xz)=>{"use strict";g();xz.exports=o(function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var l=s[i];if(!e(t[l],r[l]))return!1}return!0}return t!==t&&r!==r},"equal")});var _z=fe((Nht,Iz)=>{"use strict";g();var ih=Iz.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};jC(t,n,i,e,"",e)};ih.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ih.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ih.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ih.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function jC(e,t,r,n,i,s,l,c,p,h){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,l,c,p,h);for(var y in n){var b=n[y];if(Array.isArray(b)){if(y in ih.arrayKeywords)for(var _=0;_<b.length;_++)jC(e,t,r,b[_],i+"/"+y+"/"+_,s,i,y,n,_)}else if(y in ih.propsKeywords){if(b&&typeof b=="object")for(var C in b)jC(e,t,r,b[C],i+"/"+y+"/"+Ahe(C),s,i,y,n,C)}else(y in ih.keywords||e.allKeys&&!(y in ih.skipKeywords))&&jC(e,t,r,b,i+"/"+y,s,i,y,n)}r(n,i,s,l,c,p,h)}}o(jC,"_traverse");function Ahe(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(Ahe,"escapeJsonPtr")});var Rx=fe(Fa=>{"use strict";g();Object.defineProperty(Fa,"__esModule",{value:!0});Fa.getSchemaRefs=Fa.resolveUrl=Fa.normalizeId=Fa._getFullPath=Fa.getFullPath=Fa.inlineRef=void 0;var Dhe=vn(),Fhe=Z4(),Nhe=_z(),khe=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Rhe(e,t=!0){return typeof e=="boolean"?!0:t===!0?!K4(e):t?Sz(e)<=t:!1}o(Rhe,"inlineRef");Fa.inlineRef=Rhe;var Bhe=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function K4(e){for(let t in e){if(Bhe.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(K4)||typeof r=="object"&&K4(r))return!0}return!1}o(K4,"hasRef");function Sz(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!khe.has(r)&&(typeof e[r]=="object"&&(0,Dhe.eachItem)(e[r],n=>t+=Sz(n)),t===1/0))return 1/0}return t}o(Sz,"countKeys");function Cz(e,t="",r){r!==!1&&(t=Q0(t));let n=e.parse(t);return wz(e,n)}o(Cz,"getFullPath");Fa.getFullPath=Cz;function wz(e,t){return e.serialize(t).split("#")[0]+"#"}o(wz,"_getFullPath");Fa._getFullPath=wz;var jhe=/#\/?$/;function Q0(e){return e?e.replace(jhe,""):""}o(Q0,"normalizeId");Fa.normalizeId=Q0;function $he(e,t,r){return r=Q0(r),e.resolve(t,r)}o($he,"resolveUrl");Fa.resolveUrl=$he;var Ghe=/^[a-z_][-a-z0-9._]*$/i;function Uhe(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Q0(e[r]||t),s={"":i},l=Cz(n,i,!1),c={},p=new Set;return Nhe(e,{allKeys:!0},(b,_,C,P)=>{if(P===void 0)return;let E=l+_,w=s[P];typeof b[r]=="string"&&(w=O.call(this,b[r])),D.call(this,b.$anchor),D.call(this,b.$dynamicAnchor),s[_]=w;function O(A){let k=this.opts.uriResolver.resolve;if(A=Q0(w?k(w,A):A),p.has(A))throw y(A);p.add(A);let j=this.refs[A];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?h(b,j.schema,A):A!==Q0(E)&&(A[0]==="#"?(h(b,c[A],A),c[A]=b):this.refs[A]=E),A}o(O,"addRef");function D(A){if(typeof A=="string"){if(!Ghe.test(A))throw new Error('invalid anchor "'.concat(A,'"'));O.call(this,"#".concat(A))}}o(D,"addAnchor")}),c;function h(b,_,C){if(_!==void 0&&!Fhe(b,_))throw y(C)}o(h,"checkAmbiguosRef");function y(b){return new Error('reference "'.concat(b,'" resolves to more than one schema'))}o(y,"ambiguos")}o(Uhe,"getSchemaRefs");Fa.getSchemaRefs=Uhe});var $x=fe(oh=>{"use strict";g();Object.defineProperty(oh,"__esModule",{value:!0});oh.getData=oh.KeywordCxt=oh.validateFunctionCode=void 0;var mq=HU(),Pz=kx(),Q4=V4(),$C=kx(),Vhe=kV(),jx=fz(),J4=bz(),It=Wt(),Rt=vf(),zhe=Rx(),bf=vn(),Bx=Nx();function qhe(e){if(vq(e)&&(bq(e),yq(e))){Xhe(e);return}gq(e,()=>(0,mq.topBoolOrEmptySchema)(e))}o(qhe,"validateFunctionCode");oh.validateFunctionCode=qhe;var Oz,Lz,Az;function gq({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){i.code.es5?e.func(t,(0,It._)(Oz||(Oz=V(["",", ",""])),Rt.default.data,Rt.default.valCxt),n.$async,()=>{e.code((0,It._)(Lz||(Lz=V(['"use strict"; ',""])),Tz(r,i))),Whe(e,i),e.code(s)}):e.func(t,(0,It._)(Az||(Az=V(["",", ",""])),Rt.default.data,Hhe(i)),n.$async,()=>e.code(Tz(r,i)).code(s))}o(gq,"validateFunction");var Dz,Fz;function Hhe(e){return(0,It._)(Fz||(Fz=V(["{",'="", ',", ",", ","=","","}={}"])),Rt.default.instancePath,Rt.default.parentData,Rt.default.parentDataProperty,Rt.default.rootData,Rt.default.data,e.dynamicRef?(0,It._)(Dz||(Dz=V([", ","={}"])),Rt.default.dynamicAnchors):It.nil)}o(Hhe,"destructureValCxt");var Nz,kz,Rz,Bz,jz,$z,Gz,Uz,Vz;function Whe(e,t){e.if(Rt.default.valCxt,()=>{e.var(Rt.default.instancePath,(0,It._)(Nz||(Nz=V(["",".",""])),Rt.default.valCxt,Rt.default.instancePath)),e.var(Rt.default.parentData,(0,It._)(kz||(kz=V(["",".",""])),Rt.default.valCxt,Rt.default.parentData)),e.var(Rt.default.parentDataProperty,(0,It._)(Rz||(Rz=V(["",".",""])),Rt.default.valCxt,Rt.default.parentDataProperty)),e.var(Rt.default.rootData,(0,It._)(Bz||(Bz=V(["",".",""])),Rt.default.valCxt,Rt.default.rootData)),t.dynamicRef&&e.var(Rt.default.dynamicAnchors,(0,It._)(jz||(jz=V(["",".",""])),Rt.default.valCxt,Rt.default.dynamicAnchors))},()=>{e.var(Rt.default.instancePath,(0,It._)($z||($z=V(['""'])))),e.var(Rt.default.parentData,(0,It._)(Gz||(Gz=V(["undefined"])))),e.var(Rt.default.parentDataProperty,(0,It._)(Uz||(Uz=V(["undefined"])))),e.var(Rt.default.rootData,Rt.default.data),t.dynamicRef&&e.var(Rt.default.dynamicAnchors,(0,It._)(Vz||(Vz=V(["{}"]))))})}o(Whe,"destructureValCxtES5");function Xhe(e){let{schema:t,opts:r,gen:n}=e;gq(e,()=>{r.$comment&&t.$comment&&Iq(e),Qhe(e),n.let(Rt.default.vErrors,null),n.let(Rt.default.errors,0),r.unevaluated&&Yhe(e),xq(e),rme(e)})}o(Xhe,"topSchemaObjCode");var zz,qz,Hz,Wz,Xz,Yz,Zz;function Yhe(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,It._)(zz||(zz=V(["",".evaluated"])),r)),t.if((0,It._)(qz||(qz=V(["",".dynamicProps"])),e.evaluated),()=>t.assign((0,It._)(Hz||(Hz=V(["",".props"])),e.evaluated),(0,It._)(Wz||(Wz=V(["undefined"]))))),t.if((0,It._)(Xz||(Xz=V(["",".dynamicItems"])),e.evaluated),()=>t.assign((0,It._)(Yz||(Yz=V(["",".items"])),e.evaluated),(0,It._)(Zz||(Zz=V(["undefined"])))))}o(Yhe,"resetEvaluated");var Kz;function Tz(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,It._)(Kz||(Kz=V(["/*# sourceURL="," */"])),r):It.nil}o(Tz,"funcSourceUrl");function Zhe(e,t){if(vq(e)&&(bq(e),yq(e))){Khe(e,t);return}(0,mq.boolOrEmptySchema)(e,t)}o(Zhe,"subschemaCode");function yq({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}o(yq,"schemaCxtHasRules");function vq(e){return typeof e.schema!="boolean"}o(vq,"isSchemaObj");var Jz;function Khe(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&Iq(e),eme(e),tme(e);let s=n.const("_errs",Rt.default.errors);xq(e,s),n.var(t,(0,It._)(Jz||(Jz=V([""," === ",""])),s,Rt.default.errors))}o(Khe,"subSchemaObjCode");function bq(e){(0,bf.checkUnknownRules)(e),Jhe(e)}o(bq,"checkKeywords");function xq(e,t){if(e.opts.jtd)return Ez(e,[],!1,t);let r=(0,Pz.getSchemaTypes)(e.schema),n=(0,Pz.coerceAndCheckDataType)(e,r);Ez(e,r,!n,t)}o(xq,"typeAndKeywords");function Jhe(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,bf.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))}o(Jhe,"checkRefsAndKeywords");function Qhe(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,bf.checkStrictMode)(e,"default is ignored in the schema root")}o(Qhe,"checkNoDefault");function eme(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,zhe.resolveUrl)(e.opts.uriResolver,e.baseId,t))}o(eme,"updateContext");function tme(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}o(tme,"checkAsyncSchema");var Qz,eq,tq;function Iq({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code((0,It._)(Qz||(Qz=V(["",".logger.log(",")"])),Rt.default.self,s));else if(typeof i.$comment=="function"){let l=(0,It.str)(eq||(eq=V(["","/$comment"])),n),c=e.scopeValue("root",{ref:t.root});e.code((0,It._)(tq||(tq=V(["",".opts.$comment(",", ",", ",".schema)"])),Rt.default.self,s,l,c))}}o(Iq,"commentKeyword");var rq,nq,iq,oq;function rme(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;r.$async?t.if((0,It._)(rq||(rq=V([""," === 0"])),Rt.default.errors),()=>t.return(Rt.default.data),()=>t.throw((0,It._)(nq||(nq=V(["new ","(",")"])),i,Rt.default.vErrors))):(t.assign((0,It._)(iq||(iq=V(["",".errors"])),n),Rt.default.vErrors),s.unevaluated&&nme(e),t.return((0,It._)(oq||(oq=V([""," === 0"])),Rt.default.errors)))}o(rme,"returnResults");var sq,aq;function nme({gen:e,evaluated:t,props:r,items:n}){r instanceof It.Name&&e.assign((0,It._)(sq||(sq=V(["",".props"])),t),r),n instanceof It.Name&&e.assign((0,It._)(aq||(aq=V(["",".items"])),t),n)}o(nme,"assignEvaluated");var lq;function Ez(e,t,r,n){let{gen:i,schema:s,data:l,allErrors:c,opts:p,self:h}=e,{RULES:y}=h;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,bf.schemaHasRulesButRef)(s,y))){i.block(()=>Sq(e,"$ref",y.all.$ref.definition));return}p.jtd||ime(e,t),i.block(()=>{for(let _ of y.rules)b(_);b(y.post)});function b(_){(0,Q4.shouldUseGroup)(s,_)&&(_.type?(i.if((0,$C.checkDataType)(_.type,l,p.strictNumbers)),Mz(e,_),t.length===1&&t[0]===_.type&&r&&(i.else(),(0,$C.reportTypeError)(e)),i.endIf()):Mz(e,_),c||i.if((0,It._)(lq||(lq=V([""," === ",""])),Rt.default.errors,n||0)))}o(b,"groupKeywords")}o(Ez,"schemaKeywords");function Mz(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Vhe.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,Q4.shouldUseRule)(n,s)&&Sq(e,s.keyword,s.definition,t.type)})}o(Mz,"iterateKeywords");function ime(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(ome(e,t),e.opts.allowUnionTypes||sme(e,t),ame(e,e.dataTypes))}o(ime,"checkStrictTypes");function ome(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{_q(e.dataTypes,r)||e5(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),ume(e,t)}}o(ome,"checkContextTypes");function sme(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&e5(e,"use allowUnionTypes to allow union type keyword")}o(sme,"checkMultipleTypes");function ame(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Q4.shouldUseRule)(e.schema,i)){let{type:s}=i.definition;s.length&&!s.some(l=>lme(t,l))&&e5(e,'missing type "'.concat(s.join(","),'" for keyword "').concat(n,'"'))}}}o(ame,"checkKeywordTypes");function lme(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}o(lme,"hasApplicableType");function _q(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}o(_q,"includesType");function ume(e,t){let r=[];for(let n of e.dataTypes)_q(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}o(ume,"narrowSchemaTypes");function e5(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,bf.checkStrictMode)(e,t,e.opts.strictTypes)}o(e5,"strictTypesError");var uq,cq,pq,fq,t5=class t5{constructor(t,r,n){if((0,jx.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,bf.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Cq(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,jx.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error("".concat(n," value must be ").concat(JSON.stringify(r.schemaType)));("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",Rt.default.errors))}result(t,r,n){this.failResult((0,It.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,It.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,It._)(uq||(uq=V([""," !== undefined && (",")"])),r,(0,It.or)(this.invalid$data(),t)))}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Bx.reportExtraError:Bx.reportError)(this,this.def.error,r)}$dataError(){(0,Bx.reportError)(this,this.def.$dataError||Bx.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Bx.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=It.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=It.nil,r=It.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:l}=this;n.if((0,It.or)((0,It._)(cq||(cq=V([""," === undefined"])),i),r)),t!==It.nil&&n.assign(t,!0),(s.length||l.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==It.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,It.or)(l(),c());function l(){if(n.length){if(!(r instanceof It.Name))throw new Error("ajv implementation error");let p=Array.isArray(n)?n:[n];return(0,It._)(pq||(pq=V(["",""])),(0,$C.checkDataTypes)(p,r,s.opts.strictNumbers,$C.DataType.Wrong))}return It.nil}function c(){if(i.validateSchema){let p=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,It._)(fq||(fq=V(["!","(",")"])),p,r)}return It.nil}}subschema(t,r){let n=(0,J4.getSubschema)(this.it,t);(0,J4.extendSubschemaData)(n,this.it,t),(0,J4.extendSubschemaMode)(n,t);let i=re(R(R({},this.it),n),{items:void 0,props:void 0});return Zhe(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=bf.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=bf.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,It.Name)),!0}};o(t5,"KeywordCxt");var GC=t5;oh.KeywordCxt=GC;function Sq(e,t,r,n){let i=new GC(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,jx.funcKeywordCode)(i,r):"macro"in r?(0,jx.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,jx.funcKeywordCode)(i,r)}o(Sq,"keywordCode");var cme=/^\/(?:[^~]|~0|~1)*$/,pme=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/,dq,hq;function Cq(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return Rt.default.rootData;if(e[0]==="/"){if(!cme.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));i=e,s=Rt.default.rootData}else{let h=pme.exec(e);if(!h)throw new Error("Invalid JSON-pointer: ".concat(e));let y=+h[1];if(i=h[2],i==="#"){if(y>=t)throw new Error(p("property/index",y));return n[t-y]}if(y>t)throw new Error(p("data",y));if(s=r[t-y],!i)return s}let l=s,c=i.split("/");for(let h of c)h&&(s=(0,It._)(dq||(dq=V(["","",""])),s,(0,It.getProperty)((0,bf.unescapeJsonPointer)(h))),l=(0,It._)(hq||(hq=V([""," && ",""])),l,s));return l;function p(h,y){return"Cannot access ".concat(h," ").concat(y," levels up, current level is ").concat(t)}}o(Cq,"getData");oh.getData=Cq});var UC=fe(n5=>{"use strict";g();Object.defineProperty(n5,"__esModule",{value:!0});var i5=class i5 extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};o(i5,"ValidationError");var r5=i5;n5.default=r5});var Gx=fe(a5=>{"use strict";g();Object.defineProperty(a5,"__esModule",{value:!0});var o5=Rx(),l5=class l5 extends Error{constructor(t,r,n,i){super(i||"can't resolve reference ".concat(n," from id ").concat(r)),this.missingRef=(0,o5.resolveUrl)(t,r,n),this.missingSchema=(0,o5.normalizeId)((0,o5.getFullPath)(t,this.missingRef))}};o(l5,"MissingRefError");var s5=l5;a5.default=s5});var zC=fe(Gl=>{"use strict";g();Object.defineProperty(Gl,"__esModule",{value:!0});Gl.resolveSchema=Gl.getCompilingSchema=Gl.resolveRef=Gl.compileSchema=Gl.SchemaEnv=void 0;var Ru=Wt(),fme=UC(),cg=vf(),Bu=Rx(),wq=vn(),dme=$x(),p5=class p5{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Bu.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};o(p5,"SchemaEnv");var e1=p5;Gl.SchemaEnv=e1;var Pq,Tq;function c5(e){let t=Eq.call(this,e);if(t)return t;let r=(0,Bu.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,l=new Ru.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),c;e.$async&&(c=l.scopeValue("Error",{ref:fme.default,code:(0,Ru._)(Pq||(Pq=V(['require("ajv/dist/runtime/validation_error").default'])))}));let p=l.scopeName("validate");e.validateName=p;let h={gen:l,allErrors:this.opts.allErrors,data:cg.default.data,parentData:cg.default.parentData,parentDataProperty:cg.default.parentDataProperty,dataNames:[cg.default.data],dataPathArr:[Ru.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Ru.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:c,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Ru.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ru._)(Tq||(Tq=V(['""']))),opts:this.opts,self:this},y;try{this._compilations.add(e),(0,dme.validateFunctionCode)(h),l.optimize(this.opts.code.optimize);let b=l.toString();y="".concat(l.scopeRefs(cg.default.scope),"return ").concat(b),this.opts.code.process&&(y=this.opts.code.process(y,e));let C=new Function("".concat(cg.default.self),"".concat(cg.default.scope),y)(this,this.scope.get());if(this.scope.value(p,{ref:C}),C.errors=null,C.schema=e.schema,C.schemaEnv=e,e.$async&&(C.$async=!0),this.opts.code.source===!0&&(C.source={validateName:p,validateCode:b,scopeValues:l._values}),this.opts.unevaluated){let{props:P,items:E}=h;C.evaluated={props:P instanceof Ru.Name?void 0:P,items:E instanceof Ru.Name?void 0:E,dynamicProps:P instanceof Ru.Name,dynamicItems:E instanceof Ru.Name},C.source&&(C.source.evaluated=(0,Ru.stringify)(C.evaluated))}return e.validate=C,e}catch(b){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),b}finally{this._compilations.delete(e)}}o(c5,"compileSchema");Gl.compileSchema=c5;function hme(e,t,r){var n;r=(0,Bu.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=yme.call(this,e,r);if(s===void 0){let l=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;l&&(s=new e1({schema:l,schemaId:c,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=mme.call(this,s)}o(hme,"resolveRef");Gl.resolveRef=hme;function mme(e){return(0,Bu.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c5.call(this,e)}o(mme,"inlineOrCompile");function Eq(e){for(let t of this._compilations)if(gme(t,e))return t}o(Eq,"getCompilingSchema");Gl.getCompilingSchema=Eq;function gme(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}o(gme,"sameSchemaEnv");function yme(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||VC.call(this,e,t)}o(yme,"resolve");function VC(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Bu._getFullPath)(this.opts.uriResolver,r),i=(0,Bu.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return u5.call(this,r,e);let s=(0,Bu.normalizeId)(n),l=this.refs[s]||this.schemas[s];if(typeof l=="string"){let c=VC.call(this,e,l);return typeof(c==null?void 0:c.schema)!="object"?void 0:u5.call(this,r,c)}if(typeof(l==null?void 0:l.schema)=="object"){if(l.validate||c5.call(this,l),s===(0,Bu.normalizeId)(t)){let{schema:c}=l,{schemaId:p}=this.opts,h=c[p];return h&&(i=(0,Bu.resolveUrl)(this.opts.uriResolver,i,h)),new e1({schema:c,schemaId:p,root:e,baseId:i})}return u5.call(this,r,l)}}o(VC,"resolveSchema");Gl.resolveSchema=VC;var vme=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function u5(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let c of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let p=r[(0,wq.unescapeFragment)(c)];if(p===void 0)return;r=p;let h=typeof r=="object"&&r[this.opts.schemaId];!vme.has(c)&&h&&(t=(0,Bu.resolveUrl)(this.opts.uriResolver,t,h))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,wq.schemaHasRulesButRef)(r,this.RULES)){let c=(0,Bu.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=VC.call(this,n,c)}let{schemaId:l}=this.opts;if(s=s||new e1({schema:r,schemaId:l,root:n,baseId:t}),s.schema!==s.root.schema)return s}o(u5,"getJsonPointer")});var Mq=fe((Qht,bme)=>{bme.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Lq=fe((emt,Oq)=>{"use strict";g();var xme={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Oq.exports={HEX:xme}});var jq=fe((rmt,Bq)=>{"use strict";g();var{HEX:Ime}=Lq(),_me=new RegExp("^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$","u");function Nq(e){if(Rq(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(_me)||[],[r]=t;return r?{host:Cme(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}o(Nq,"normalizeIPv4");function f5(e,t=!1){let r="",n=!0;for(let i of e){if(Ime[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return t&&r.length===0&&(r="0"),r}o(f5,"stringArrayToHexStripped");function Sme(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,l=!1,c=!1;function p(){if(i.length){if(s===!1){let h=f5(i);if(h!==void 0)n.push(h);else return r.error=!0,!1}i.length=0}return!0}o(p,"consume");for(let h=0;h<e.length;h++){let y=e[h];if(!(y==="["||y==="]"))if(y===":"){if(l===!0&&(c=!0),!p())break;if(t++,n.push(":"),t>7){r.error=!0;break}h-1>=0&&e[h-1]===":"&&(l=!0);continue}else if(y==="%"){if(!p())break;s=!0}else{i.push(y);continue}}return i.length&&(s?r.zone=i.join(""):c?n.push(i.join("")):n.push(f5(i))),r.address=n.join(""),r}o(Sme,"getIPV6");function kq(e){if(Rq(e,":")<2)return{host:e,isIPV6:!1};let t=Sme(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,escapedHost:n,isIPV6:!0}}}o(kq,"normalizeIPv6");function Cme(e,t){let r="",n=!0,i=e.length;for(let s=0;s<i;s++){let l=e[s];l==="0"&&n?(s+1<=i&&e[s+1]===t||s+1===i)&&(r+=l,n=!1):(l===t?n=!0:n=!1,r+=l)}return r}o(Cme,"stripLeadingZeros");function Rq(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}o(Rq,"findToken");var Aq=new RegExp("^\\.\\.?\\/","u"),Dq=new RegExp("^\\/\\.(?:\\/|$)","u"),Fq=new RegExp("^\\/\\.\\.(?:\\/|$)","u"),wme=new RegExp("^\\/?(?:.|\\n)*?(?=\\/|$)","u");function Pme(e){let t=[];for(;e.length;)if(e.match(Aq))e=e.replace(Aq,"");else if(e.match(Dq))e=e.replace(Dq,"/");else if(e.match(Fq))e=e.replace(Fq,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(wme);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}o(Pme,"removeDotSegments");function Tme(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}o(Tme,"normalizeComponentEncoding");function Eme(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=Nq(r);if(n.isIPV4)r=n.host;else{let i=kq(n.host);i.isIPV6===!0?r="[".concat(i.escapedHost,"]"):r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}o(Eme,"recomposeAuthority");Bq.exports={recomposeAuthority:Eme,normalizeComponentEncoding:Tme,removeDotSegments:Pme,normalizeIPv4:Nq,normalizeIPv6:kq,stringArrayToHexStripped:f5}});var qq=fe((omt,zq)=>{"use strict";g();var Mme=new RegExp("^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$","iu"),Ome=new RegExp("([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)","iu");function $q(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}o($q,"isSecure");function Gq(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}o(Gq,"httpParse");function Uq(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}o(Uq,"httpSerialize");function Lme(e){return e.secure=$q(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}o(Lme,"wsParse");function Ame(e){if((e.port===($q(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}o(Ame,"wsSerialize");function Dme(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(Ome);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i="".concat(n,":").concat(t.nid||e.nid),s=d5[i];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}o(Dme,"urnParse");function Fme(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i="".concat(r,":").concat(t.nid||n),s=d5[i];s&&(e=s.serialize(e,t));let l=e,c=e.nss;return l.path="".concat(n||t.nid,":").concat(c),t.skipEscape=!0,l}o(Fme,"urnSerialize");function Nme(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Mme.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}o(Nme,"urnuuidParse");function kme(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}o(kme,"urnuuidSerialize");var Vq={scheme:"http",domainHost:!0,parse:Gq,serialize:Uq},Rme={scheme:"https",domainHost:Vq.domainHost,parse:Gq,serialize:Uq},qC={scheme:"ws",domainHost:!0,parse:Lme,serialize:Ame},Bme={scheme:"wss",domainHost:qC.domainHost,parse:qC.parse,serialize:qC.serialize},jme={scheme:"urn",parse:Dme,serialize:Fme,skipNormalize:!0},$me={scheme:"urn:uuid",parse:Nme,serialize:kme,skipNormalize:!0},d5={http:Vq,https:Rme,ws:qC,wss:Bme,urn:jme,"urn:uuid":$me};zq.exports=d5});var Wq=fe((lmt,WC)=>{"use strict";g();var{normalizeIPv6:Gme,normalizeIPv4:Ume,removeDotSegments:Ux,recomposeAuthority:Vme,normalizeComponentEncoding:HC}=jq(),h5=qq();function zme(e,t){return typeof e=="string"?e=Zc(xf(e,t),t):typeof e=="object"&&(e=xf(Zc(e,t),t)),e}o(zme,"normalize");function qme(e,t,r){let n=Object.assign({scheme:"null"},r),i=Hq(xf(e,n),xf(t,n),n,!0);return Zc(i,re(R({},n),{skipEscape:!0}))}o(qme,"resolve");function Hq(e,t,r,n){let i={};return n||(e=xf(Zc(e,r),r),t=xf(Zc(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Ux(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Ux(t.path||""),i.query=t.query):(t.path?(t.path.charAt(0)==="/"?i.path=Ux(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=Ux(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}o(Hq,"resolveComponents");function Hme(e,t,r){return typeof e=="string"?(e=unescape(e),e=Zc(HC(xf(e,r),!0),re(R({},r),{skipEscape:!0}))):typeof e=="object"&&(e=Zc(HC(e,!0),re(R({},r),{skipEscape:!0}))),typeof t=="string"?(t=unescape(t),t=Zc(HC(xf(t,r),!0),re(R({},r),{skipEscape:!0}))):typeof t=="object"&&(t=Zc(HC(t,!0),re(R({},r),{skipEscape:!0}))),e.toLowerCase()===t.toLowerCase()}o(Hme,"equal");function Zc(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],s=h5[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let l=Vme(r);if(l!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(l),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(c=Ux(c)),l===void 0&&(c=c.replace(new RegExp("^\\/\\/","u"),"/%2F")),i.push(c)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}o(Zc,"serialize");var Wme=Array.from({length:127},(e,t)=>new RegExp("[^!\"$&'()*+,\\-.;=_`a-z{}~]","u").test(String.fromCharCode(t)));function Xme(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||Wme[t])return!0;return!1}o(Xme,"nonSimpleDomain");var Yme=new RegExp("^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?","u");function xf(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let l=e.match(Yme);if(l){if(n.scheme=l[1],n.userinfo=l[3],n.host=l[4],n.port=parseInt(l[5],10),n.path=l[6]||"",n.query=l[7],n.fragment=l[8],isNaN(n.port)&&(n.port=l[5]),n.host){let p=Ume(n.host);if(p.isIPV4===!1){let h=Gme(p.host);n.host=h.host.toLowerCase(),s=h.isIPV6}else n.host=p.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=h5[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&Xme(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(p){n.error=n.error||"Host's domain name can not be converted to ASCII: "+p}(!c||c&&!c.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}o(xf,"parse");var m5={SCHEMES:h5,normalize:zme,resolve:qme,resolveComponents:Hq,equal:Hme,serialize:Zc,parse:xf};WC.exports=m5;WC.exports.default=m5;WC.exports.fastUri=m5});var Yq=fe(g5=>{"use strict";g();Object.defineProperty(g5,"__esModule",{value:!0});var Xq=Wq();Xq.code='require("ajv/dist/runtime/uri").default';g5.default=Xq});var nH=fe(hs=>{"use strict";g();Object.defineProperty(hs,"__esModule",{value:!0});hs.CodeGen=hs.Name=hs.nil=hs.stringify=hs.str=hs._=hs.KeywordCxt=void 0;var Zme=$x();Object.defineProperty(hs,"KeywordCxt",{enumerable:!0,get:o(function(){return Zme.KeywordCxt},"get")});var t1=Wt();Object.defineProperty(hs,"_",{enumerable:!0,get:o(function(){return t1._},"get")});Object.defineProperty(hs,"str",{enumerable:!0,get:o(function(){return t1.str},"get")});Object.defineProperty(hs,"stringify",{enumerable:!0,get:o(function(){return t1.stringify},"get")});Object.defineProperty(hs,"nil",{enumerable:!0,get:o(function(){return t1.nil},"get")});Object.defineProperty(hs,"Name",{enumerable:!0,get:o(function(){return t1.Name},"get")});Object.defineProperty(hs,"CodeGen",{enumerable:!0,get:o(function(){return t1.CodeGen},"get")});var Kme=UC(),eH=Gx(),Jme=U4(),Vx=zC(),Qme=Wt(),zx=Rx(),XC=kx(),v5=vn(),Zq=Mq(),ege=Yq(),tH=o((e,t)=>new RegExp(e,t),"defaultRegExp");tH.code="new RegExp";var tge=["removeAdditional","useDefaults","coerceTypes"],rge=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),nge={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},ige={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Kq=200;function oge(e){var t,r,n,i,s,l,c,p,h,y,b,_,C,P,E,w,O,D,A,k,j,W,Y,N,Z;let le=e.strict,se=(t=e.code)===null||t===void 0?void 0:t.optimize,U=se===!0||se===void 0?1:se||0,ye=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:tH,ne=(i=e.uriResolver)!==null&&i!==void 0?i:ege.default;return{strictSchema:(l=(s=e.strictSchema)!==null&&s!==void 0?s:le)!==null&&l!==void 0?l:!0,strictNumbers:(p=(c=e.strictNumbers)!==null&&c!==void 0?c:le)!==null&&p!==void 0?p:!0,strictTypes:(y=(h=e.strictTypes)!==null&&h!==void 0?h:le)!==null&&y!==void 0?y:"log",strictTuples:(_=(b=e.strictTuples)!==null&&b!==void 0?b:le)!==null&&_!==void 0?_:"log",strictRequired:(P=(C=e.strictRequired)!==null&&C!==void 0?C:le)!==null&&P!==void 0?P:!1,code:e.code?re(R({},e.code),{optimize:U,regExp:ye}):{optimize:U,regExp:ye},loopRequired:(E=e.loopRequired)!==null&&E!==void 0?E:Kq,loopEnum:(w=e.loopEnum)!==null&&w!==void 0?w:Kq,meta:(O=e.meta)!==null&&O!==void 0?O:!0,messages:(D=e.messages)!==null&&D!==void 0?D:!0,inlineRefs:(A=e.inlineRefs)!==null&&A!==void 0?A:!0,schemaId:(k=e.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(j=e.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(W=e.validateSchema)!==null&&W!==void 0?W:!0,validateFormats:(Y=e.validateFormats)!==null&&Y!==void 0?Y:!0,unicodeRegExp:(N=e.unicodeRegExp)!==null&&N!==void 0?N:!0,int32range:(Z=e.int32range)!==null&&Z!==void 0?Z:!0,uriResolver:ne}}o(oge,"requiredOptions");var b5=class b5{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts=R(R({},t),oge(t));let{es5:r,lines:n}=this.opts.code;this.scope=new Qme.ValueScope({scope:{},prefixes:rge,es5:r,lines:n}),this.logger=pge(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,Jme.getRules)(),Jq.call(this,nge,t,"NOT SUPPORTED"),Jq.call(this,ige,t,"DEPRECATED","warn"),this._metaOpts=uge.call(this),t.formats&&age.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&lge.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),sge.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=Zq;n==="id"&&(i=R({},Zq),i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'.concat(t,'"'))}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(y,b){await s.call(this,y.$schema);let _=this._addSchema(y,b);return _.validate||l.call(this,_)}async function s(y){y&&!this.getSchema(y)&&await i.call(this,{$ref:y},!0)}async function l(y){try{return this._compileSchemaEnv(y)}catch(b){if(!(b instanceof eH.default))throw b;return c.call(this,b),await p.call(this,b.missingSchema),l.call(this,y)}}function c({missingSchema:y,missingRef:b}){if(this.refs[y])throw new Error("AnySchema ".concat(y," is loaded but ").concat(b," cannot be resolved"))}async function p(y){let b=await h.call(this,y);this.refs[y]||await s.call(this,b.$schema),this.refs[y]||this.addSchema(b,y,r)}async function h(y){let b=this._loading[y];if(b)return b;try{return await(this._loading[y]=n(y))}finally{delete this._loading[y]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let l of t)this.addSchema(l,void 0,n,i);return this}let s;if(typeof t=="object"){let{schemaId:l}=this.opts;if(s=t[l],s!==void 0&&typeof s!="string")throw new Error("schema ".concat(l," must be string"))}return r=(0,zx.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;for(;typeof(r=Qq.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Vx.SchemaEnv({schema:{},schemaId:n});if(r=Vx.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Qq.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,zx.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(dge.call(this,n,r),!r)return(0,v5.eachItem)(n,s=>y5.call(this,s)),this;mge.call(this,r);let i=re(R({},r),{type:(0,XC.getJSONTypes)(r.type),schemaType:(0,XC.getJSONTypes)(r.schemaType)});return(0,v5.eachItem)(n,i.type.length===0?s=>y5.call(this,s,i):s=>i.type.forEach(l=>y5.call(this,s,i,l))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>"".concat(n).concat(i.instancePath," ").concat(i.message)).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let s=i.split("/").slice(1),l=t;for(let c of s)l=l[c];for(let c in n){let p=n[c];if(typeof p!="object")continue;let{$data:h}=p.definition,y=l[c];h&&y&&(l[c]=rH(y))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let l,{schemaId:c}=this.opts;if(typeof t=="object")l=t[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let p=this._cache.get(t);if(p!==void 0)return p;n=(0,zx.normalizeId)(l||n);let h=zx.getSchemaRefs.call(this,t,n);return p=new Vx.SchemaEnv({schema:t,schemaId:c,meta:r,baseId:n,localRefs:h}),this._cache.set(p.schema,p),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=p),i&&this.validateSchema(t,!0),p}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error('schema with key or id "'.concat(t,'" already exists'))}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Vx.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Vx.compileSchema.call(this,t)}finally{this.opts=r}}};o(b5,"Ajv");var qx=b5;qx.ValidationError=Kme.default;qx.MissingRefError=eH.default;hs.default=qx;function Jq(e,t,r,n="error"){for(let i in e){let s=i;s in t&&this.logger[n]("".concat(r,": option ").concat(i,". ").concat(e[s]))}}o(Jq,"checkOptions");function Qq(e){return e=(0,zx.normalizeId)(e),this.schemas[e]||this.refs[e]}o(Qq,"getSchEnv");function sge(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}o(sge,"addInitialSchemas");function age(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}o(age,"addInitialFormats");function lge(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}o(lge,"addInitialKeywords");function uge(){let e=R({},this.opts);for(let t of tge)delete e[t];return e}o(uge,"getMetaSchemaOptions");var cge={log(){},warn(){},error(){}};function pge(e){if(e===!1)return cge;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}o(pge,"getLogger");var fge=/^[a-z_$][a-z0-9_$:-]*$/i;function dge(e,t){let{RULES:r}=this;if((0,v5.eachItem)(e,n=>{if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!fge.test(n))throw new Error("Keyword ".concat(n," has invalid name"))}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}o(dge,"checkKeyword");function y5(e,t,r){var n;let i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,l=i?s.post:s.rules.find(({type:p})=>p===r);if(l||(l={type:r,rules:[]},s.rules.push(l)),s.keywords[e]=!0,!t)return;let c={keyword:e,definition:re(R({},t),{type:(0,XC.getJSONTypes)(t.type),schemaType:(0,XC.getJSONTypes)(t.schemaType)})};t.before?hge.call(this,l,c,t.before):l.rules.push(c),s.all[e]=c,(n=t.implements)===null||n===void 0||n.forEach(p=>this.addKeyword(p))}o(y5,"addRule");function hge(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn("rule ".concat(r," is not defined")))}o(hge,"addBeforeRule");function mge(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=rH(t)),e.validateSchema=this.compile(t,!0))}o(mge,"keywordMetaschema");var gge={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function rH(e){return{anyOf:[e,gge]}}o(rH,"schemaOrData")});var iH=fe(x5=>{"use strict";g();Object.defineProperty(x5,"__esModule",{value:!0});var yge={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};x5.default=yge});var yH=fe(pg=>{"use strict";g();Object.defineProperty(pg,"__esModule",{value:!0});pg.callRef=pg.getValidate=void 0;var vge=Gx(),oH=$l(),Na=Wt(),r1=vf(),sH=zC(),YC=vn(),aH,bge={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:l,opts:c,self:p}=n,{root:h}=s;if((r==="#"||r==="#/")&&i===h.baseId)return b();let y=sH.resolveRef.call(p,h,i,r);if(y===void 0)throw new vge.default(n.opts.uriResolver,i,r);if(y instanceof sH.SchemaEnv)return _(y);return C(y);function b(){if(s===h)return ZC(e,l,s,s.$async);let P=t.scopeValue("root",{ref:h});return ZC(e,(0,Na._)(aH||(aH=V(["",".validate"])),P),h,h.$async)}function _(P){let E=gH(e,P);ZC(e,E,P,P.$async)}function C(P){let E=t.scopeValue("schema",c.code.source===!0?{ref:P,code:(0,Na.stringify)(P)}:{ref:P}),w=t.name("valid"),O=e.subschema({schema:P,dataTypes:[],schemaPath:Na.nil,topSchemaRef:E,errSchemaPath:r},w);e.mergeEvaluated(O),e.ok(w)}}},lH;function gH(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Na._)(lH||(lH=V(["",".validate"])),r.scopeValue("wrapper",{ref:t}))}o(gH,"getValidate");pg.getValidate=gH;var uH,cH,pH,fH,dH,hH,mH;function ZC(e,t,r,n){let{gen:i,it:s}=e,{allErrors:l,schemaEnv:c,opts:p}=s,h=p.passContext?r1.default.this:Na.nil;n?y():b();function y(){if(!c.$async)throw new Error("async schema referenced by sync schema");let P=i.let("valid");i.try(()=>{i.code((0,Na._)(uH||(uH=V(["await ",""])),(0,oH.callValidateCode)(e,t,h))),C(t),l||i.assign(P,!0)},E=>{i.if((0,Na._)(cH||(cH=V(["!("," instanceof ",")"])),E,s.ValidationError),()=>i.throw(E)),_(E),l||i.assign(P,!1)}),e.ok(P)}o(y,"callAsyncRef");function b(){e.result((0,oH.callValidateCode)(e,t,h),()=>C(t),()=>_(t))}o(b,"callSyncRef");function _(P){let E=(0,Na._)(pH||(pH=V(["",".errors"])),P);i.assign(r1.default.vErrors,(0,Na._)(fH||(fH=V([""," === null ? "," : ",".concat(",")"])),r1.default.vErrors,E,r1.default.vErrors,E)),i.assign(r1.default.errors,(0,Na._)(dH||(dH=V(["",".length"])),r1.default.vErrors))}o(_,"addErrorsFrom");function C(P){var E;if(!s.opts.unevaluated)return;let w=(E=r==null?void 0:r.validate)===null||E===void 0?void 0:E.evaluated;if(s.props!==!0)if(w&&!w.dynamicProps)w.props!==void 0&&(s.props=YC.mergeEvaluated.props(i,w.props,s.props));else{let O=i.var("props",(0,Na._)(hH||(hH=V(["",".evaluated.props"])),P));s.props=YC.mergeEvaluated.props(i,O,s.props,Na.Name)}if(s.items!==!0)if(w&&!w.dynamicItems)w.items!==void 0&&(s.items=YC.mergeEvaluated.items(i,w.items,s.items));else{let O=i.var("items",(0,Na._)(mH||(mH=V(["",".evaluated.items"])),P));s.items=YC.mergeEvaluated.items(i,O,s.items,Na.Name)}}o(C,"addEvaluatedFrom")}o(ZC,"callRef");pg.callRef=ZC;pg.default=bge});var vH=fe(I5=>{"use strict";g();Object.defineProperty(I5,"__esModule",{value:!0});var xge=iH(),Ige=yH(),_ge=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xge.default,Ige.default];I5.default=_ge});var _H=fe(_5=>{"use strict";g();Object.defineProperty(_5,"__esModule",{value:!0});var KC=Wt(),sh=KC.operators,JC={maximum:{okStr:"<=",ok:sh.LTE,fail:sh.GT},minimum:{okStr:">=",ok:sh.GTE,fail:sh.LT},exclusiveMaximum:{okStr:"<",ok:sh.LT,fail:sh.GTE},exclusiveMinimum:{okStr:">",ok:sh.GT,fail:sh.LTE}},bH,xH,Sge={message:o(({keyword:e,schemaCode:t})=>(0,KC.str)(bH||(bH=V(["must be "," ",""])),JC[e].okStr,t),"message"),params:o(({keyword:e,schemaCode:t})=>(0,KC._)(xH||(xH=V(["{comparison: ",", limit: ","}"])),JC[e].okStr,t),"params")},IH,Cge={keyword:Object.keys(JC),type:"number",schemaType:"number",$data:!0,error:Sge,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,KC._)(IH||(IH=V([""," "," "," || isNaN(",")"])),r,JC[t].fail,n,r))}};_5.default=Cge});var EH=fe(S5=>{"use strict";g();Object.defineProperty(S5,"__esModule",{value:!0});var Hx=Wt(),SH,CH,wge={message:o(({schemaCode:e})=>(0,Hx.str)(SH||(SH=V(["must be multiple of ",""])),e),"message"),params:o(({schemaCode:e})=>(0,Hx._)(CH||(CH=V(["{multipleOf: ","}"])),e),"params")},wH,PH,TH,Pge={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:wge,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,l=t.let("res"),c=s?(0,Hx._)(wH||(wH=V(["Math.abs(Math.round(",") - ",") > 1e-",""])),l,l,s):(0,Hx._)(PH||(PH=V([""," !== parseInt(",")"])),l,l);e.fail$data((0,Hx._)(TH||(TH=V(["("," === 0 || ("," = ","/",", ","))"])),n,l,r,n,c))}};S5.default=Pge});var OH=fe(C5=>{"use strict";g();Object.defineProperty(C5,"__esModule",{value:!0});function MH(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}o(MH,"ucs2length");C5.default=MH;MH.code='require("ajv/dist/runtime/ucs2length").default'});var kH=fe(w5=>{"use strict";g();Object.defineProperty(w5,"__esModule",{value:!0});var fg=Wt(),Tge=vn(),Ege=OH(),LH,AH,Mge={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,fg.str)(LH||(LH=V(["must NOT have "," than "," characters"])),r,t)},params:o(({schemaCode:e})=>(0,fg._)(AH||(AH=V(["{limit: ","}"])),e),"params")},DH,FH,NH,Oge={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Mge,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?fg.operators.GT:fg.operators.LT,l=i.opts.unicode===!1?(0,fg._)(DH||(DH=V(["",".length"])),r):(0,fg._)(FH||(FH=V(["","(",")"])),(0,Tge.useFunc)(e.gen,Ege.default),r);e.fail$data((0,fg._)(NH||(NH=V([""," "," ",""])),l,s,n))}};w5.default=Oge});var GH=fe(P5=>{"use strict";g();Object.defineProperty(P5,"__esModule",{value:!0});var Lge=$l(),QC=Wt(),RH,BH,Age={message:o(({schemaCode:e})=>(0,QC.str)(RH||(RH=V(['must match pattern "','"'])),e),"message"),params:o(({schemaCode:e})=>(0,QC._)(BH||(BH=V(["{pattern: ","}"])),e),"params")},jH,$H,Dge={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Age,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:s}=e,l=s.opts.unicodeRegExp?"u":"",c=r?(0,QC._)(jH||(jH=V(["(new RegExp(",", ","))"])),i,l):(0,Lge.usePattern)(e,n);e.fail$data((0,QC._)($H||($H=V(["!",".test(",")"])),c,t))}};P5.default=Dge});var qH=fe(T5=>{"use strict";g();Object.defineProperty(T5,"__esModule",{value:!0});var Wx=Wt(),UH,VH,Fge={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Wx.str)(UH||(UH=V(["must NOT have "," than "," properties"])),r,t)},params:o(({schemaCode:e})=>(0,Wx._)(VH||(VH=V(["{limit: ","}"])),e),"params")},zH,Nge={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Fge,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Wx.operators.GT:Wx.operators.LT;e.fail$data((0,Wx._)(zH||(zH=V(["Object.keys(",").length "," ",""])),r,i,n))}};T5.default=Nge});var XH=fe(E5=>{"use strict";g();Object.defineProperty(E5,"__esModule",{value:!0});var Xx=$l(),Yx=Wt(),kge=vn(),HH,WH,Rge={message:o(({params:{missingProperty:e}})=>(0,Yx.str)(HH||(HH=V(["must have required property '","'"])),e),"message"),params:o(({params:{missingProperty:e}})=>(0,Yx._)(WH||(WH=V(["{missingProperty: ","}"])),e),"params")},Bge={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Rge,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:l}=e,{opts:c}=l;if(!s&&r.length===0)return;let p=r.length>=c.loopRequired;if(l.allErrors?h():y(),c.strictRequired){let C=e.parentSchema.properties,{definedProperties:P}=e.it;for(let E of r)if((C==null?void 0:C[E])===void 0&&!P.has(E)){let w=l.schemaEnv.baseId+l.errSchemaPath,O='required property "'.concat(E,'" is not defined at "').concat(w,'" (strictRequired)');(0,kge.checkStrictMode)(l,O,l.opts.strictRequired)}}function h(){if(p||s)e.block$data(Yx.nil,b);else for(let C of r)(0,Xx.checkReportMissingProp)(e,C)}o(h,"allErrorsMode");function y(){let C=t.let("missing");if(p||s){let P=t.let("valid",!0);e.block$data(P,()=>_(C,P)),e.ok(P)}else t.if((0,Xx.checkMissingProp)(e,r,C)),(0,Xx.reportMissingProp)(e,C),t.else()}o(y,"exitOnErrorMode");function b(){t.forOf("prop",n,C=>{e.setParams({missingProperty:C}),t.if((0,Xx.noPropertyInData)(t,i,C,c.ownProperties),()=>e.error())})}o(b,"loopAllRequired");function _(C,P){e.setParams({missingProperty:C}),t.forOf(C,n,()=>{t.assign(P,(0,Xx.propertyInData)(t,i,C,c.ownProperties)),t.if((0,Yx.not)(P),()=>{e.error(),t.break()})},Yx.nil)}o(_,"loopUntilMissing")}};E5.default=Bge});var JH=fe(M5=>{"use strict";g();Object.defineProperty(M5,"__esModule",{value:!0});var Zx=Wt(),YH,ZH,jge={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Zx.str)(YH||(YH=V(["must NOT have "," than "," items"])),r,t)},params:o(({schemaCode:e})=>(0,Zx._)(ZH||(ZH=V(["{limit: ","}"])),e),"params")},KH,$ge={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:jge,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?Zx.operators.GT:Zx.operators.LT;e.fail$data((0,Zx._)(KH||(KH=V(["",".length "," ",""])),r,i,n))}};M5.default=$ge});var ew=fe(O5=>{"use strict";g();Object.defineProperty(O5,"__esModule",{value:!0});var QH=Z4();QH.code='require("ajv/dist/runtime/equal").default';O5.default=QH});var yW=fe(A5=>{"use strict";g();Object.defineProperty(A5,"__esModule",{value:!0});var L5=kx(),ms=Wt(),Gge=vn(),Uge=ew(),eW,tW,Vge={message:o(({params:{i:e,j:t}})=>(0,ms.str)(eW||(eW=V(["must NOT have duplicate items (items ## "," and "," are identical)"])),t,e),"message"),params:o(({params:{i:e,j:t}})=>(0,ms._)(tW||(tW=V(["{i: ",", j: ","}"])),e,t),"params")},rW,nW,iW,oW,sW,aW,lW,uW,cW,pW,fW,dW,hW,mW,gW,zge={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Vge,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:l,it:c}=e;if(!n&&!i)return;let p=t.let("valid"),h=s.items?(0,L5.getSchemaTypes)(s.items):[];e.block$data(p,y,(0,ms._)(rW||(rW=V([""," === false"])),l)),e.ok(p);function y(){let P=t.let("i",(0,ms._)(nW||(nW=V(["",".length"])),r)),E=t.let("j");e.setParams({i:P,j:E}),t.assign(p,!0),t.if((0,ms._)(iW||(iW=V([""," > 1"])),P),()=>(b()?_:C)(P,E))}o(y,"validateUniqueItems");function b(){return h.length>0&&!h.some(P=>P==="object"||P==="array")}o(b,"canOptimize");function _(P,E){let w=t.name("item"),O=(0,L5.checkDataTypes)(h,w,c.opts.strictNumbers,L5.DataType.Wrong),D=t.const("indices",(0,ms._)(oW||(oW=V(["{}"]))));t.for((0,ms._)(sW||(sW=V([";","--;"])),P),()=>{t.let(w,(0,ms._)(aW||(aW=V(["","[","]"])),r,P)),t.if(O,(0,ms._)(lW||(lW=V(["continue"])))),h.length>1&&t.if((0,ms._)(uW||(uW=V(["typeof ",' == "string"'])),w),(0,ms._)(cW||(cW=V(["",' += "_"'])),w)),t.if((0,ms._)(pW||(pW=V(["typeof ","[",'] == "number"'])),D,w),()=>{t.assign(E,(0,ms._)(fW||(fW=V(["","[","]"])),D,w)),e.error(),t.assign(p,!1).break()}).code((0,ms._)(dW||(dW=V(["","[","] = ",""])),D,w,P))})}o(_,"loopN");function C(P,E){let w=(0,Gge.useFunc)(t,Uge.default),O=t.name("outer");t.label(O).for((0,ms._)(hW||(hW=V([";","--;"])),P),()=>t.for((0,ms._)(mW||(mW=V([""," = ","; ","--;"])),E,P,E),()=>t.if((0,ms._)(gW||(gW=V(["","(","[","], ","[","])"])),w,r,P,r,E),()=>{e.error(),t.assign(p,!1).break(O)})))}o(C,"loopN2")}};A5.default=zge});var IW=fe(F5=>{"use strict";g();Object.defineProperty(F5,"__esModule",{value:!0});var D5=Wt(),qge=vn(),Hge=ew(),vW,Wge={message:"must be equal to constant",params:o(({schemaCode:e})=>(0,D5._)(vW||(vW=V(["{allowedValue: ","}"])),e),"params")},bW,xW,Xge={keyword:"const",$data:!0,error:Wge,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,D5._)(bW||(bW=V(["!","(",", ",")"])),(0,qge.useFunc)(t,Hge.default),r,i)):e.fail((0,D5._)(xW||(xW=V([""," !== ",""])),s,r))}};F5.default=Xge});var PW=fe(N5=>{"use strict";g();Object.defineProperty(N5,"__esModule",{value:!0});var Kx=Wt(),Yge=vn(),Zge=ew(),_W,Kge={message:"must be equal to one of the allowed values",params:o(({schemaCode:e})=>(0,Kx._)(_W||(_W=V(["{allowedValues: ","}"])),e),"params")},SW,CW,wW,Jge={keyword:"enum",schemaType:"array",$data:!0,error:Kge,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:l}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let c=i.length>=l.opts.loopEnum,p,h=o(()=>p!=null?p:p=(0,Yge.useFunc)(t,Zge.default),"getEql"),y;if(c||n)y=t.let("valid"),e.block$data(y,b);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let C=t.const("vSchema",s);y=(0,Kx.or)(...i.map((P,E)=>_(C,E)))}e.pass(y);function b(){t.assign(y,!1),t.forOf("v",s,C=>t.if((0,Kx._)(SW||(SW=V(["","(",", ",")"])),h(),r,C),()=>t.assign(y,!0).break()))}o(b,"loopEnum");function _(C,P){let E=i[P];return typeof E=="object"&&E!==null?(0,Kx._)(CW||(CW=V(["","(",", ","[","])"])),h(),r,C,P):(0,Kx._)(wW||(wW=V([""," === ",""])),r,E)}o(_,"equalCode")}};N5.default=Jge});var TW=fe(k5=>{"use strict";g();Object.defineProperty(k5,"__esModule",{value:!0});var Qge=_H(),eye=EH(),tye=kH(),rye=GH(),nye=qH(),iye=XH(),oye=JH(),sye=yW(),aye=IW(),lye=PW(),uye=[Qge.default,eye.default,tye.default,rye.default,nye.default,iye.default,oye.default,sye.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},aye.default,lye.default];k5.default=uye});var B5=fe(Jx=>{"use strict";g();Object.defineProperty(Jx,"__esModule",{value:!0});Jx.validateAdditionalItems=void 0;var dg=Wt(),R5=vn(),EW,MW,cye={message:o(({params:{len:e}})=>(0,dg.str)(EW||(EW=V(["must NOT have more than "," items"])),e),"message"),params:o(({params:{len:e}})=>(0,dg._)(MW||(MW=V(["{limit: ","}"])),e),"params")},pye={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:cye,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,R5.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}DW(e,n)}},OW,LW,AW;function DW(e,t){let{gen:r,schema:n,data:i,keyword:s,it:l}=e;l.items=!0;let c=r.const("len",(0,dg._)(OW||(OW=V(["",".length"])),i));if(n===!1)e.setParams({len:t.length}),e.pass((0,dg._)(LW||(LW=V([""," <= ",""])),c,t.length));else if(typeof n=="object"&&!(0,R5.alwaysValidSchema)(l,n)){let h=r.var("valid",(0,dg._)(AW||(AW=V([""," <= ",""])),c,t.length));r.if((0,dg.not)(h),()=>p(h)),e.ok(h)}function p(h){r.forRange("i",t.length,c,y=>{e.subschema({keyword:s,dataProp:y,dataPropType:R5.Type.Num},h),l.allErrors||r.if((0,dg.not)(h),()=>r.break())})}o(p,"validateItems")}o(DW,"validateAdditionalItems");Jx.validateAdditionalItems=DW;Jx.default=pye});var j5=fe(Qx=>{"use strict";g();Object.defineProperty(Qx,"__esModule",{value:!0});Qx.validateTuple=void 0;var FW=Wt(),tw=vn(),fye=$l(),dye={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return RW(e,"additionalItems",t);r.items=!0,!(0,tw.alwaysValidSchema)(r,t)&&e.ok((0,fye.validateArray)(e))}},NW,kW;function RW(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:l,it:c}=e;y(i),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=tw.mergeEvaluated.items(n,r.length,c.items));let p=n.name("valid"),h=n.const("len",(0,FW._)(NW||(NW=V(["",".length"])),s));r.forEach((b,_)=>{(0,tw.alwaysValidSchema)(c,b)||(n.if((0,FW._)(kW||(kW=V([""," > ",""])),h,_),()=>e.subschema({keyword:l,schemaProp:_,dataProp:_},p)),e.ok(p))});function y(b){let{opts:_,errSchemaPath:C}=c,P=r.length,E=P===b.minItems&&(P===b.maxItems||b[t]===!1);if(_.strictTuples&&!E){let w='"'.concat(l,'" is ').concat(P,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(C,'"');(0,tw.checkStrictMode)(c,w,_.strictTuples)}}o(y,"checkStrictTuple")}o(RW,"validateTuple");Qx.validateTuple=RW;Qx.default=dye});var BW=fe($5=>{"use strict";g();Object.defineProperty($5,"__esModule",{value:!0});var hye=j5(),mye={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o(e=>(0,hye.validateTuple)(e,"items"),"code")};$5.default=mye});var UW=fe(G5=>{"use strict";g();Object.defineProperty(G5,"__esModule",{value:!0});var jW=Wt(),gye=vn(),yye=$l(),vye=B5(),$W,GW,bye={message:o(({params:{len:e}})=>(0,jW.str)($W||($W=V(["must NOT have more than "," items"])),e),"message"),params:o(({params:{len:e}})=>(0,jW._)(GW||(GW=V(["{limit: ","}"])),e),"params")},xye={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:bye,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,gye.alwaysValidSchema)(n,t)&&(i?(0,vye.validateAdditionalItems)(e,i):e.ok((0,yye.validateArray)(e)))}};G5.default=xye});var tX=fe(U5=>{"use strict";g();Object.defineProperty(U5,"__esModule",{value:!0});var Ul=Wt(),rw=vn(),VW,zW,qW,HW,Iye={message:o(({params:{min:e,max:t}})=>t===void 0?(0,Ul.str)(VW||(VW=V(["must contain at least "," valid item(s)"])),e):(0,Ul.str)(zW||(zW=V(["must contain at least "," and no more than "," valid item(s)"])),e,t),"message"),params:o(({params:{min:e,max:t}})=>t===void 0?(0,Ul._)(qW||(qW=V(["{minContains: ","}"])),e):(0,Ul._)(HW||(HW=V(["{minContains: ",", maxContains: ","}"])),e,t),"params")},WW,XW,YW,ZW,KW,JW,QW,eX,_ye={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Iye,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,l,c,{minContains:p,maxContains:h}=n;s.opts.next?(l=p===void 0?1:p,c=h):l=1;let y=t.const("len",(0,Ul._)(WW||(WW=V(["",".length"])),i));if(e.setParams({min:l,max:c}),c===void 0&&l===0){(0,rw.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&l>c){(0,rw.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,rw.alwaysValidSchema)(s,r)){let E=(0,Ul._)(XW||(XW=V([""," >= ",""])),y,l);c!==void 0&&(E=(0,Ul._)(YW||(YW=V([""," && "," <= ",""])),E,y,c)),e.pass(E);return}s.items=!0;let b=t.name("valid");c===void 0&&l===1?C(b,()=>t.if(b,()=>t.break())):l===0?(t.let(b,!0),c!==void 0&&t.if((0,Ul._)(ZW||(ZW=V(["",".length > 0"])),i),_)):(t.let(b,!1),_()),e.result(b,()=>e.reset());function _(){let E=t.name("_valid"),w=t.let("count",0);C(E,()=>t.if(E,()=>P(w)))}o(_,"validateItemsWithCount");function C(E,w){t.forRange("i",0,y,O=>{e.subschema({keyword:"contains",dataProp:O,dataPropType:rw.Type.Num,compositeRule:!0},E),w()})}o(C,"validateItems");function P(E){t.code((0,Ul._)(KW||(KW=V(["","++"])),E)),c===void 0?t.if((0,Ul._)(JW||(JW=V([""," >= ",""])),E,l),()=>t.assign(b,!0).break()):(t.if((0,Ul._)(QW||(QW=V([""," > ",""])),E,c),()=>t.assign(b,!1).break()),l===1?t.assign(b,!0):t.if((0,Ul._)(eX||(eX=V([""," >= ",""])),E,l),()=>t.assign(b,!0)))}o(P,"checkLimits")}};U5.default=_ye});var aX=fe(Kc=>{"use strict";g();Object.defineProperty(Kc,"__esModule",{value:!0});Kc.validateSchemaDeps=Kc.validatePropertyDeps=Kc.error=void 0;var V5=Wt(),Sye=vn(),eI=$l(),rX,nX;Kc.error={message:o(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,V5.str)(rX||(rX=V(["must have "," "," when property "," is present"])),n,r,e)},"message"),params:o(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,V5._)(nX||(nX=V(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),e,n,t,r),"params")};var Cye={keyword:"dependencies",type:"object",schemaType:"object",error:Kc.error,code(e){let[t,r]=wye(e);oX(e,t),sX(e,r)}};function wye({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}o(wye,"splitDependencies");var iX;function oX(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let l in t){let c=t[l];if(c.length===0)continue;let p=(0,eI.propertyInData)(r,n,l,i.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),i.allErrors?r.if(p,()=>{for(let h of c)(0,eI.checkReportMissingProp)(e,h)}):(r.if((0,V5._)(iX||(iX=V([""," && (",")"])),p,(0,eI.checkMissingProp)(e,c,s))),(0,eI.reportMissingProp)(e,s),r.else())}}o(oX,"validatePropertyDeps");Kc.validatePropertyDeps=oX;function sX(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,l=r.name("valid");for(let c in t)(0,Sye.alwaysValidSchema)(s,t[c])||(r.if((0,eI.propertyInData)(r,n,c,s.opts.ownProperties),()=>{let p=e.subschema({keyword:i,schemaProp:c},l);e.mergeValidEvaluated(p,l)},()=>r.var(l,!0)),e.ok(l))}o(sX,"validateSchemaDeps");Kc.validateSchemaDeps=sX;Kc.default=Cye});var cX=fe(z5=>{"use strict";g();Object.defineProperty(z5,"__esModule",{value:!0});var uX=Wt(),Pye=vn(),lX,Tye={message:"property name must be valid",params:o(({params:e})=>(0,uX._)(lX||(lX=V(["{propertyName: ","}"])),e.propertyName),"params")},Eye={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Tye,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,Pye.alwaysValidSchema)(i,r))return;let s=t.name("valid");t.forIn("key",n,l=>{e.setParams({propertyName:l}),e.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},s),t.if((0,uX.not)(s),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(s)}};z5.default=Eye});var H5=fe(q5=>{"use strict";g();Object.defineProperty(q5,"__esModule",{value:!0});var nw=$l(),ju=Wt(),Mye=vf(),iw=vn(),pX,Oye={message:"must NOT have additional properties",params:o(({params:e})=>(0,ju._)(pX||(pX=V(["{additionalProperty: ","}"])),e.additionalProperty),"params")},fX,dX,hX,mX,Lye={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Oye,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:l}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:c,opts:p}=l;if(l.props=!0,p.removeAdditional!=="all"&&(0,iw.alwaysValidSchema)(l,r))return;let h=(0,nw.allSchemaProperties)(n.properties),y=(0,nw.allSchemaProperties)(n.patternProperties);b(),e.ok((0,ju._)(fX||(fX=V([""," === ",""])),s,Mye.default.errors));function b(){t.forIn("key",i,w=>{!h.length&&!y.length?P(w):t.if(_(w),()=>P(w))})}o(b,"checkAdditionalProperties");function _(w){let O;if(h.length>8){let D=(0,iw.schemaRefOrVal)(l,n.properties,"properties");O=(0,nw.isOwnProperty)(t,D,w)}else h.length?O=(0,ju.or)(...h.map(D=>(0,ju._)(dX||(dX=V([""," === ",""])),w,D))):O=ju.nil;return y.length&&(O=(0,ju.or)(O,...y.map(D=>(0,ju._)(hX||(hX=V(["",".test(",")"])),(0,nw.usePattern)(e,D),w)))),(0,ju.not)(O)}o(_,"isAdditional");function C(w){t.code((0,ju._)(mX||(mX=V(["delete ","[","]"])),i,w))}o(C,"deleteAdditional");function P(w){if(p.removeAdditional==="all"||p.removeAdditional&&r===!1){C(w);return}if(r===!1){e.setParams({additionalProperty:w}),e.error(),c||t.break();return}if(typeof r=="object"&&!(0,iw.alwaysValidSchema)(l,r)){let O=t.name("valid");p.removeAdditional==="failing"?(E(w,O,!1),t.if((0,ju.not)(O),()=>{e.reset(),C(w)})):(E(w,O),c||t.if((0,ju.not)(O),()=>t.break()))}}o(P,"additionalPropertyCode");function E(w,O,D){let A={keyword:"additionalProperties",dataProp:w,dataPropType:iw.Type.Str};D===!1&&Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(A,O)}o(E,"applyAdditionalSchema")}};q5.default=Lye});var vX=fe(X5=>{"use strict";g();Object.defineProperty(X5,"__esModule",{value:!0});var Aye=$x(),gX=$l(),W5=vn(),yX=H5(),Dye={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&yX.default.code(new Aye.KeywordCxt(s,yX.default,"additionalProperties"));let l=(0,gX.allSchemaProperties)(r);for(let b of l)s.definedProperties.add(b);s.opts.unevaluated&&l.length&&s.props!==!0&&(s.props=W5.mergeEvaluated.props(t,(0,W5.toHash)(l),s.props));let c=l.filter(b=>!(0,W5.alwaysValidSchema)(s,r[b]));if(c.length===0)return;let p=t.name("valid");for(let b of c)h(b)?y(b):(t.if((0,gX.propertyInData)(t,i,b,s.opts.ownProperties)),y(b),s.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(b),e.ok(p);function h(b){return s.opts.useDefaults&&!s.compositeRule&&r[b].default!==void 0}o(h,"hasDefault");function y(b){e.subschema({keyword:"properties",schemaProp:b,dataProp:b},p)}o(y,"applyPropertySchema")}};X5.default=Dye});var CX=fe(Y5=>{"use strict";g();Object.defineProperty(Y5,"__esModule",{value:!0});var bX=$l(),ow=Wt(),xX=vn(),IX=vn(),_X,SX,Fye={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:l}=s,c=(0,bX.allSchemaProperties)(r),p=c.filter(E=>(0,xX.alwaysValidSchema)(s,r[E]));if(c.length===0||p.length===c.length&&(!s.opts.unevaluated||s.props===!0))return;let h=l.strictSchema&&!l.allowMatchingProperties&&i.properties,y=t.name("valid");s.props!==!0&&!(s.props instanceof ow.Name)&&(s.props=(0,IX.evaluatedPropsToName)(t,s.props));let{props:b}=s;_();function _(){for(let E of c)h&&C(E),s.allErrors?P(E):(t.var(y,!0),P(E),t.if(y))}o(_,"validatePatternProperties");function C(E){for(let w in h)new RegExp(E).test(w)&&(0,xX.checkStrictMode)(s,"property ".concat(w," matches pattern ").concat(E," (use allowMatchingProperties)"))}o(C,"checkMatchingProperties");function P(E){t.forIn("key",n,w=>{t.if((0,ow._)(_X||(_X=V(["",".test(",")"])),(0,bX.usePattern)(e,E),w),()=>{let O=p.includes(E);O||e.subschema({keyword:"patternProperties",schemaProp:E,dataProp:w,dataPropType:IX.Type.Str},y),s.opts.unevaluated&&b!==!0?t.assign((0,ow._)(SX||(SX=V(["","[","]"])),b,w),!0):!O&&!s.allErrors&&t.if((0,ow.not)(y),()=>t.break())})})}o(P,"validateProperties")}};Y5.default=Fye});var wX=fe(Z5=>{"use strict";g();Object.defineProperty(Z5,"__esModule",{value:!0});var Nye=vn(),kye={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,Nye.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Z5.default=kye});var PX=fe(K5=>{"use strict";g();Object.defineProperty(K5,"__esModule",{value:!0});var Rye=$l(),Bye={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Rye.validateUnion,error:{message:"must match a schema in anyOf"}};K5.default=Bye});var OX=fe(J5=>{"use strict";g();Object.defineProperty(J5,"__esModule",{value:!0});var sw=Wt(),jye=vn(),TX,$ye={message:"must match exactly one schema in oneOf",params:o(({params:e})=>(0,sw._)(TX||(TX=V(["{passingSchemas: ","}"])),e.passing),"params")},EX,MX,Gye={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:$ye,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,l=t.let("valid",!1),c=t.let("passing",null),p=t.name("_valid");e.setParams({passing:c}),t.block(h),e.result(l,()=>e.reset(),()=>e.error(!0));function h(){s.forEach((y,b)=>{let _;(0,jye.alwaysValidSchema)(i,y)?t.var(p,!0):_=e.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},p),b>0&&t.if((0,sw._)(EX||(EX=V([""," && ",""])),p,l)).assign(l,!1).assign(c,(0,sw._)(MX||(MX=V(["[",", ","]"])),c,b)).else(),t.if(p,()=>{t.assign(l,!0),t.assign(c,b),_&&e.mergeEvaluated(_,sw.Name)})})}o(h,"validateOneOf")}};J5.default=Gye});var LX=fe(Q5=>{"use strict";g();Object.defineProperty(Q5,"__esModule",{value:!0});var Uye=vn(),Vye={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((s,l)=>{if((0,Uye.alwaysValidSchema)(n,s))return;let c=e.subschema({keyword:"allOf",schemaProp:l},i);e.ok(i),e.mergeEvaluated(c)})}};Q5.default=Vye});var RX=fe(e6=>{"use strict";g();Object.defineProperty(e6,"__esModule",{value:!0});var aw=Wt(),kX=vn(),DX,FX,zye={message:o(({params:e})=>(0,aw.str)(DX||(DX=V(['must match "','" schema'])),e.ifClause),"message"),params:o(({params:e})=>(0,aw._)(FX||(FX=V(["{failingKeyword: ","}"])),e.ifClause),"params")},NX,qye={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:zye,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,kX.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=AX(n,"then"),s=AX(n,"else");if(!i&&!s)return;let l=t.let("valid",!0),c=t.name("_valid");if(p(),e.reset(),i&&s){let y=t.let("ifClause");e.setParams({ifClause:y}),t.if(c,h("then",y),h("else",y))}else i?t.if(c,h("then")):t.if((0,aw.not)(c),h("else"));e.pass(l,()=>e.error(!0));function p(){let y=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);e.mergeEvaluated(y)}o(p,"validateIf");function h(y,b){return()=>{let _=e.subschema({keyword:y},c);t.assign(l,c),e.mergeValidEvaluated(_,l),b?t.assign(b,(0,aw._)(NX||(NX=V(["",""])),y)):e.setParams({ifClause:y})}}o(h,"validateClause")}};function AX(e,t){let r=e.schema[t];return r!==void 0&&!(0,kX.alwaysValidSchema)(e,r)}o(AX,"hasSchema");e6.default=qye});var BX=fe(t6=>{"use strict";g();Object.defineProperty(t6,"__esModule",{value:!0});var Hye=vn(),Wye={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Hye.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};t6.default=Wye});var jX=fe(r6=>{"use strict";g();Object.defineProperty(r6,"__esModule",{value:!0});var Xye=B5(),Yye=BW(),Zye=j5(),Kye=UW(),Jye=tX(),Qye=aX(),e0e=cX(),t0e=H5(),r0e=vX(),n0e=CX(),i0e=wX(),o0e=PX(),s0e=OX(),a0e=LX(),l0e=RX(),u0e=BX();function c0e(e=!1){let t=[i0e.default,o0e.default,s0e.default,a0e.default,l0e.default,u0e.default,e0e.default,t0e.default,Qye.default,r0e.default,n0e.default];return e?t.push(Yye.default,Kye.default):t.push(Xye.default,Zye.default),t.push(Jye.default),t}o(c0e,"getApplicator");r6.default=c0e});var nY=fe(n6=>{"use strict";g();Object.defineProperty(n6,"__esModule",{value:!0});var Ki=Wt(),$X,GX,p0e={message:o(({schemaCode:e})=>(0,Ki.str)($X||($X=V(['must match format "','"'])),e),"message"),params:o(({schemaCode:e})=>(0,Ki._)(GX||(GX=V(["{format: ","}"])),e),"params")},UX,VX,zX,qX,HX,WX,XX,YX,ZX,KX,JX,QX,eY,tY,rY,f0e={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:p0e,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:l,it:c}=e,{opts:p,errSchemaPath:h,schemaEnv:y,self:b}=c;if(!p.validateFormats)return;i?_():C();function _(){let P=r.scopeValue("formats",{ref:b.formats,code:p.code.formats}),E=r.const("fDef",(0,Ki._)(UX||(UX=V(["","[","]"])),P,l)),w=r.let("fType"),O=r.let("format");r.if((0,Ki._)(VX||(VX=V(["typeof ",' == "object" && !('," instanceof RegExp)"])),E,E),()=>r.assign(w,(0,Ki._)(zX||(zX=V(["",'.type || "string"'])),E)).assign(O,(0,Ki._)(qX||(qX=V(["",".validate"])),E)),()=>r.assign(w,(0,Ki._)(HX||(HX=V(['"string"'])))).assign(O,E)),e.fail$data((0,Ki.or)(D(),A()));function D(){return p.strictSchema===!1?Ki.nil:(0,Ki._)(WX||(WX=V([""," && !",""])),l,O)}o(D,"unknownFmt");function A(){let k=y.$async?(0,Ki._)(XX||(XX=V(["(",".async ? await ","(",") : ","(","))"])),E,O,n,O,n):(0,Ki._)(YX||(YX=V(["","(",")"])),O,n),j=(0,Ki._)(ZX||(ZX=V(["(typeof ",' == "function" ? '," : ",".test(","))"])),O,k,O,n);return(0,Ki._)(KX||(KX=V([""," && "," !== true && "," === "," && !",""])),O,O,w,t,j)}o(A,"invalidFmt")}o(_,"validate$DataFormat");function C(){let P=b.formats[s];if(!P){D();return}if(P===!0)return;let[E,w,O]=A(P);E===t&&e.pass(k());function D(){if(p.strictSchema===!1){b.logger.warn(j());return}throw new Error(j());function j(){return'unknown format "'.concat(s,'" ignored in schema at path "').concat(h,'"')}}o(D,"unknownFormat");function A(j){let W=j instanceof RegExp?(0,Ki.regexpCode)(j):p.code.formats?(0,Ki._)(JX||(JX=V(["","",""])),p.code.formats,(0,Ki.getProperty)(s)):void 0,Y=r.scopeValue("formats",{key:s,ref:j,code:W});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,Ki._)(QX||(QX=V(["",".validate"])),Y)]:["string",j,Y]}o(A,"getFormat");function k(){if(typeof P=="object"&&!(P instanceof RegExp)&&P.async){if(!y.$async)throw new Error("async format in sync schema");return(0,Ki._)(eY||(eY=V(["await ","(",")"])),O,n)}return typeof w=="function"?(0,Ki._)(tY||(tY=V(["","(",")"])),O,n):(0,Ki._)(rY||(rY=V(["",".test(",")"])),O,n)}o(k,"validCondition")}o(C,"validateFormat")}};n6.default=f0e});var iY=fe(i6=>{"use strict";g();Object.defineProperty(i6,"__esModule",{value:!0});var d0e=nY(),h0e=[d0e.default];i6.default=h0e});var oY=fe(n1=>{"use strict";g();Object.defineProperty(n1,"__esModule",{value:!0});n1.contentVocabulary=n1.metadataVocabulary=void 0;n1.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];n1.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var aY=fe(o6=>{"use strict";g();Object.defineProperty(o6,"__esModule",{value:!0});var m0e=vH(),g0e=TW(),y0e=jX(),v0e=iY(),sY=oY(),b0e=[m0e.default,g0e.default,(0,y0e.default)(),v0e.default,sY.metadataVocabulary,sY.contentVocabulary];o6.default=b0e});var uY=fe(lw=>{"use strict";g();Object.defineProperty(lw,"__esModule",{value:!0});lw.DiscrError=void 0;var lY;(function(e){e.Tag="tag",e.Mapping="mapping"})(lY||(lw.DiscrError=lY={}))});var mY=fe(a6=>{"use strict";g();Object.defineProperty(a6,"__esModule",{value:!0});var i1=Wt(),s6=uY(),cY=zC(),x0e=Gx(),I0e=vn(),pY,_0e={message:o(({params:{discrError:e,tagName:t}})=>e===s6.DiscrError.Tag?'tag "'.concat(t,'" must be string'):'value of tag "'.concat(t,'" must be in oneOf'),"message"),params:o(({params:{discrError:e,tag:t,tagName:r}})=>(0,i1._)(pY||(pY=V(["{error: ",", tag: ",", tagValue: ","}"])),e,r,t),"params")},fY,dY,hY,S0e={keyword:"discriminator",type:"object",schemaType:"object",error:_0e,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:l}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=n.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");let p=t.let("valid",!1),h=t.const("tag",(0,i1._)(fY||(fY=V(["","",""])),r,(0,i1.getProperty)(c)));t.if((0,i1._)(dY||(dY=V(["typeof ",' == "string"'])),h),()=>y(),()=>e.error(!1,{discrError:s6.DiscrError.Tag,tag:h,tagName:c})),e.ok(p);function y(){let C=_();t.if(!1);for(let P in C)t.elseIf((0,i1._)(hY||(hY=V([""," === ",""])),h,P)),t.assign(p,b(C[P]));t.else(),e.error(!1,{discrError:s6.DiscrError.Mapping,tag:h,tagName:c}),t.endIf()}o(y,"validateMapping");function b(C){let P=t.name("valid"),E=e.subschema({keyword:"oneOf",schemaProp:C},P);return e.mergeEvaluated(E,i1.Name),P}o(b,"applyTagSchema");function _(){var C;let P={},E=O(i),w=!0;for(let k=0;k<l.length;k++){let j=l[k];if(j!=null&&j.$ref&&!(0,I0e.schemaHasRulesButRef)(j,s.self.RULES)){let Y=j.$ref;if(j=cY.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,Y),j instanceof cY.SchemaEnv&&(j=j.schema),j===void 0)throw new x0e.default(s.opts.uriResolver,s.baseId,Y)}let W=(C=j==null?void 0:j.properties)===null||C===void 0?void 0:C[c];if(typeof W!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(c,'"'));w=w&&(E||O(j)),D(W,k)}if(!w)throw new Error('discriminator: "'.concat(c,'" must be required'));return P;function O({required:k}){return Array.isArray(k)&&k.includes(c)}function D(k,j){if(k.const)A(k.const,j);else if(k.enum)for(let W of k.enum)A(W,j);else throw new Error('discriminator: "properties/'.concat(c,'" must have "const" or "enum"'))}function A(k,j){if(typeof k!="string"||k in P)throw new Error('discriminator: "'.concat(c,'" values must be unique strings'));P[k]=j}}o(_,"getMapping")}};a6.default=S0e});var gY=fe((dyt,C0e)=>{C0e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var c6=fe((fi,l6)=>{"use strict";g();Object.defineProperty(fi,"__esModule",{value:!0});fi.MissingRefError=fi.ValidationError=fi.CodeGen=fi.Name=fi.nil=fi.stringify=fi.str=fi._=fi.KeywordCxt=fi.Ajv=void 0;var w0e=nH(),P0e=aY(),T0e=mY(),yY=gY(),E0e=["/properties"],uw="http://json-schema.org/draft-07/schema",u6=class u6 extends w0e.default{_addVocabularies(){super._addVocabularies(),P0e.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(T0e.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(yY,E0e):yY;this.addMetaSchema(t,uw,!1),this.refs["http://json-schema.org/schema"]=uw}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(uw)?uw:void 0)}};o(u6,"Ajv");var o1=u6;fi.Ajv=o1;l6.exports=fi=o1;l6.exports.Ajv=o1;Object.defineProperty(fi,"__esModule",{value:!0});fi.default=o1;var M0e=$x();Object.defineProperty(fi,"KeywordCxt",{enumerable:!0,get:o(function(){return M0e.KeywordCxt},"get")});var s1=Wt();Object.defineProperty(fi,"_",{enumerable:!0,get:o(function(){return s1._},"get")});Object.defineProperty(fi,"str",{enumerable:!0,get:o(function(){return s1.str},"get")});Object.defineProperty(fi,"stringify",{enumerable:!0,get:o(function(){return s1.stringify},"get")});Object.defineProperty(fi,"nil",{enumerable:!0,get:o(function(){return s1.nil},"get")});Object.defineProperty(fi,"Name",{enumerable:!0,get:o(function(){return s1.Name},"get")});Object.defineProperty(fi,"CodeGen",{enumerable:!0,get:o(function(){return s1.CodeGen},"get")});var O0e=UC();Object.defineProperty(fi,"ValidationError",{enumerable:!0,get:o(function(){return O0e.default},"get")});var L0e=Gx();Object.defineProperty(fi,"MissingRefError",{enumerable:!0,get:o(function(){return L0e.default},"get")})});var SY=fe(Jc=>{"use strict";g();Object.defineProperty(Jc,"__esModule",{value:!0});Jc.formatNames=Jc.fastFormats=Jc.fullFormats=void 0;function a1(e,t){return{validate:e,compare:t}}o(a1,"fmtDef");Jc.fullFormats={date:a1(xY,d6),time:a1(IY,h6),"date-time":a1(N0e,_Y),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:B0e,"uri-reference":/^(?:[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,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:new RegExp("^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$","iu"),email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:q0e,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:j0e,int32:{type:"number",validate:U0e},int64:{type:"number",validate:V0e},float:{type:"number",validate:bY},double:{type:"number",validate:bY},password:!0,binary:!0};Jc.fastFormats=re(R({},Jc.fullFormats),{date:a1(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,d6),time:a1(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h6),"date-time":a1(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_Y),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i});Jc.formatNames=Object.keys(Jc.fullFormats);function A0e(e){return e%4===0&&(e%100!==0||e%400===0)}o(A0e,"isLeapYear");var D0e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,F0e=[0,31,28,31,30,31,30,31,31,30,31,30,31];function xY(e){let t=D0e.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&&A0e(r)?29:F0e[n])}o(xY,"date");function d6(e,t){if(e&&t)return e>t?1:e<t?-1:0}o(d6,"compareDate");var p6=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function IY(e,t){let r=p6.exec(e);if(!r)return!1;let n=+r[1],i=+r[2],s=+r[3],l=r[5];return(n<=23&&i<=59&&s<=59||n===23&&i===59&&s===60)&&(!t||l!=="")}o(IY,"time");function h6(e,t){if(!(e&&t))return;let r=p6.exec(e),n=p6.exec(t);if(r&&n)return e=r[1]+r[2]+r[3]+(r[4]||""),t=n[1]+n[2]+n[3]+(n[4]||""),e>t?1:e<t?-1:0}o(h6,"compareTime");var f6=/t|\s/i;function N0e(e){let t=e.split(f6);return t.length===2&&xY(t[0])&&IY(t[1],!0)}o(N0e,"date_time");function _Y(e,t){if(!(e&&t))return;let[r,n]=e.split(f6),[i,s]=t.split(f6),l=d6(r,i);if(l!==void 0)return l||h6(n,s)}o(_Y,"compareDateTime");var k0e=/\/|:/,R0e=/^(?:[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;function B0e(e){return k0e.test(e)&&R0e.test(e)}o(B0e,"uri");var vY=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function j0e(e){return vY.lastIndex=0,vY.test(e)}o(j0e,"byte");var $0e=-(2**31),G0e=2**31-1;function U0e(e){return Number.isInteger(e)&&e<=G0e&&e>=$0e}o(U0e,"validateInt32");function V0e(e){return Number.isInteger(e)}o(V0e,"validateInt64");function bY(){return!0}o(bY,"validateNumber");var z0e=/[^\\]\\Z/;function q0e(e){if(z0e.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}o(q0e,"regex")});var AY=fe(l1=>{"use strict";g();Object.defineProperty(l1,"__esModule",{value:!0});l1.formatLimitDefinition=void 0;var H0e=c6(),$u=Wt(),ah=$u.operators,cw={formatMaximum:{okStr:"<=",ok:ah.LTE,fail:ah.GT},formatMinimum:{okStr:">=",ok:ah.GTE,fail:ah.LT},formatExclusiveMaximum:{okStr:"<",ok:ah.LT,fail:ah.GTE},formatExclusiveMinimum:{okStr:">",ok:ah.GT,fail:ah.LTE}},CY,wY,W0e={message:o(({keyword:e,schemaCode:t})=>$u.str(CY||(CY=V(["should be "," ",""])),cw[e].okStr,t),"message"),params:o(({keyword:e,schemaCode:t})=>$u._(wY||(wY=V(["{comparison: ",", limit: ","}"])),cw[e].okStr,t),"params")},PY,TY,EY,MY,OY,LY;l1.formatLimitDefinition={keyword:Object.keys(cw),type:"string",schemaType:"string",$data:!0,error:W0e,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:s}=e,{opts:l,self:c}=s;if(!l.validateFormats)return;let p=new H0e.KeywordCxt(s,c.RULES.all.format.definition,"format");p.$data?h():y();function h(){let _=t.scopeValue("formats",{ref:c.formats,code:l.code.formats}),C=t.const("fmt",$u._(PY||(PY=V(["","[","]"])),_,p.schemaCode));e.fail$data($u.or($u._(TY||(TY=V(["typeof ",' != "object"'])),C),$u._(EY||(EY=V([""," instanceof RegExp"])),C),$u._(MY||(MY=V(["typeof ",'.compare != "function"'])),C),b(C)))}o(h,"validate$DataFormat");function y(){let _=p.schema,C=c.formats[_];if(!C||C===!0)return;if(typeof C!="object"||C instanceof RegExp||typeof C.compare!="function")throw new Error('"'.concat(i,'": format "').concat(_,'" does not define "compare" function'));let P=t.scopeValue("formats",{key:_,ref:C,code:l.code.formats?$u._(OY||(OY=V(["","",""])),l.code.formats,$u.getProperty(_)):void 0});e.fail$data(b(P))}o(y,"validateFormat");function b(_){return $u._(LY||(LY=V(["",".compare(",", ",") "," 0"])),_,r,n,cw[i].fail)}o(b,"compareCode")},dependencies:["format"]};var X0e=o(e=>(e.addKeyword(l1.formatLimitDefinition),e),"formatLimitPlugin");l1.default=X0e});var RY=fe((tI,kY)=>{"use strict";g();Object.defineProperty(tI,"__esModule",{value:!0});var u1=SY(),Y0e=AY(),m6=Wt(),DY=new m6.Name("fullFormats"),Z0e=new m6.Name("fastFormats"),g6=o((e,t={keywords:!0})=>{if(Array.isArray(t))return FY(e,t,u1.fullFormats,DY),e;let[r,n]=t.mode==="fast"?[u1.fastFormats,Z0e]:[u1.fullFormats,DY],i=t.formats||u1.formatNames;return FY(e,i,r,n),t.keywords&&Y0e.default(e),e},"formatsPlugin");g6.get=(e,t="full")=>{let n=(t==="fast"?u1.fastFormats:u1.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};var NY;function FY(e,t,r,n){var i,s;(i=(s=e.opts.code).formats)!==null&&i!==void 0||(s.formats=m6._(NY||(NY=V(['require("ajv-formats/dist/formats").',""])),n));for(let l of t)e.addFormat(l,r[l])}o(FY,"addFormats");kY.exports=tI=g6;Object.defineProperty(tI,"__esModule",{value:!0});tI.default=g6});var _te=fe((kRt,h9)=>{"use strict";g();var WP=ZN();WP.default&&(WP=WP.default);h9.exports=Ite;h9.exports.default=Ite;function Ite(e,t,r){t=t||1;for(var n,i,s,l,c=0;c<e[0].length;c++){var p=e[0][c];(!c||p[0]<n)&&(n=p[0]),(!c||p[1]<i)&&(i=p[1]),(!c||p[0]>s)&&(s=p[0]),(!c||p[1]>l)&&(l=p[1])}var h=s-n,y=l-i,b=Math.min(h,y),_=b/2;if(b===0){var C=[n,i];return C.distance=0,C}for(var P=new WP(void 0,HPe),E=n;E<s;E+=b)for(var w=i;w<l;w+=b)P.push(new vh(E+_,w+_,_,e));var O=XPe(e),D=new vh(n+h/2,i+y/2,0,e);D.d>O.d&&(O=D);for(var A=P.length;P.length;){var k=P.pop();k.d>O.d&&(O=k,r&&console.log("found best %d after %d probes",Math.round(1e4*k.d)/1e4,A)),!(k.max-O.d<=t)&&(_=k.h/2,P.push(new vh(k.x-_,k.y-_,_,e)),P.push(new vh(k.x+_,k.y-_,_,e)),P.push(new vh(k.x-_,k.y+_,_,e)),P.push(new vh(k.x+_,k.y+_,_,e)),A+=4)}r&&(console.log("num probes: "+A),console.log("best distance: "+O.d));var j=[O.x,O.y];return j.distance=O.d,j}o(Ite,"polylabel");function HPe(e,t){return t.max-e.max}o(HPe,"compareMax");function vh(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=WPe(e,t,n),this.max=this.d+this.h*Math.SQRT2}o(vh,"Cell");function WPe(e,t,r){for(var n=!1,i=1/0,s=0;s<r.length;s++)for(var l=r[s],c=0,p=l.length,h=p-1;c<p;h=c++){var y=l[c],b=l[h];y[1]>t!=b[1]>t&&e<(b[0]-y[0])*(t-y[1])/(b[1]-y[1])+y[0]&&(n=!n),i=Math.min(i,YPe(e,t,y,b))}return i===0?0:(n?1:-1)*Math.sqrt(i)}o(WPe,"pointToPolygonDist");function XPe(e){for(var t=0,r=0,n=0,i=e[0],s=0,l=i.length,c=l-1;s<l;c=s++){var p=i[s],h=i[c],y=p[0]*h[1]-h[0]*p[1];r+=(p[0]+h[0])*y,n+=(p[1]+h[1])*y,t+=y*3}return t===0?new vh(i[0][0],i[0][1],0,e):new vh(r/t,n/t,0,e)}o(XPe,"getCentroidCell");function YPe(e,t,r,n){var i=r[0],s=r[1],l=n[0]-i,c=n[1]-s;if(l!==0||c!==0){var p=((e-i)*l+(t-s)*c)/(l*l+c*c);p>1?(i=n[0],s=n[1]):p>0&&(i+=l*p,s+=c*p)}return l=e-i,c=t-s,l*l+c*c}o(YPe,"getSegDistSq")});var S7=fe((KI,fv)=>{g();var HTe=200,Pre="__lodash_hash_undefined__",WTe=800,XTe=16,Tre=9007199254740991,Ere="[object Arguments]",YTe="[object Array]",ZTe="[object AsyncFunction]",KTe="[object Boolean]",JTe="[object Date]",QTe="[object Error]",Mre="[object Function]",eEe="[object GeneratorFunction]",tEe="[object Map]",rEe="[object Number]",nEe="[object Null]",Ore="[object Object]",iEe="[object Proxy]",oEe="[object RegExp]",sEe="[object Set]",aEe="[object String]",lEe="[object Undefined]",uEe="[object WeakMap]",cEe="[object ArrayBuffer]",pEe="[object DataView]",fEe="[object Float32Array]",dEe="[object Float64Array]",hEe="[object Int8Array]",mEe="[object Int16Array]",gEe="[object Int32Array]",yEe="[object Uint8Array]",vEe="[object Uint8ClampedArray]",bEe="[object Uint16Array]",xEe="[object Uint32Array]",IEe=/[\\^$.*+?()[\]{}|]/g,_Ee=/^\[object .+?Constructor\]$/,SEe=/^(?:0|[1-9]\d*)$/,gi={};gi[fEe]=gi[dEe]=gi[hEe]=gi[mEe]=gi[gEe]=gi[yEe]=gi[vEe]=gi[bEe]=gi[xEe]=!0;gi[Ere]=gi[YTe]=gi[cEe]=gi[KTe]=gi[pEe]=gi[JTe]=gi[QTe]=gi[Mre]=gi[tEe]=gi[rEe]=gi[Ore]=gi[oEe]=gi[sEe]=gi[aEe]=gi[uEe]=!1;var Lre=typeof global=="object"&&global&&global.Object===Object&&global,CEe=typeof self=="object"&&self&&self.Object===Object&&self,e2=Lre||CEe||Function("return this")(),Are=typeof KI=="object"&&KI&&!KI.nodeType&&KI,JI=Are&&typeof fv=="object"&&fv&&!fv.nodeType&&fv,Dre=JI&&JI.exports===Are,d7=Dre&&Lre.process,yre=function(){try{var e=JI&&JI.require&&JI.require("util").types;return e||d7&&d7.binding&&d7.binding("util")}catch(t){}}(),vre=yre&&yre.isTypedArray;function wEe(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(wEe,"apply");function PEe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}o(PEe,"baseTimes");function TEe(e){return function(t){return e(t)}}o(TEe,"baseUnary");function EEe(e,t){return e==null?void 0:e[t]}o(EEe,"getValue");function MEe(e,t){return function(r){return e(t(r))}}o(MEe,"overArg");var OEe=Array.prototype,LEe=Function.prototype,v3=Object.prototype,h7=e2["__core-js_shared__"],b3=LEe.toString,Hf=v3.hasOwnProperty,bre=function(){var e=/[^.]+$/.exec(h7&&h7.keys&&h7.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Fre=v3.toString,AEe=b3.call(Object),DEe=RegExp("^"+b3.call(Hf).replace(IEe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g3=Dre?e2.Buffer:void 0,xre=e2.Symbol,Ire=e2.Uint8Array,_re=g3?g3.allocUnsafe:void 0,Nre=MEe(Object.getPrototypeOf,Object),Sre=Object.create,FEe=v3.propertyIsEnumerable,NEe=OEe.splice,ty=xre?xre.toStringTag:void 0,y3=function(){try{var e=x7(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),kEe=g3?g3.isBuffer:void 0,Cre=Math.max,REe=Date.now,kre=x7(e2,"Map"),QI=x7(Object,"create"),BEe=function(){function e(){}return o(e,"object"),function(t){if(!ny(t))return{};if(Sre)return Sre(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ry(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(ry,"Hash");function jEe(){this.__data__=QI?QI(null):{},this.size=0}o(jEe,"hashClear");function $Ee(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}o($Ee,"hashDelete");function GEe(e){var t=this.__data__;if(QI){var r=t[e];return r===Pre?void 0:r}return Hf.call(t,e)?t[e]:void 0}o(GEe,"hashGet");function UEe(e){var t=this.__data__;return QI?t[e]!==void 0:Hf.call(t,e)}o(UEe,"hashHas");function VEe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=QI&&t===void 0?Pre:t,this}o(VEe,"hashSet");ry.prototype.clear=jEe;ry.prototype.delete=$Ee;ry.prototype.get=GEe;ry.prototype.has=UEe;ry.prototype.set=VEe;function Wf(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(Wf,"ListCache");function zEe(){this.__data__=[],this.size=0}o(zEe,"listCacheClear");function qEe(e){var t=this.__data__,r=x3(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():NEe.call(t,r,1),--this.size,!0}o(qEe,"listCacheDelete");function HEe(e){var t=this.__data__,r=x3(t,e);return r<0?void 0:t[r][1]}o(HEe,"listCacheGet");function WEe(e){return x3(this.__data__,e)>-1}o(WEe,"listCacheHas");function XEe(e,t){var r=this.__data__,n=x3(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}o(XEe,"listCacheSet");Wf.prototype.clear=zEe;Wf.prototype.delete=qEe;Wf.prototype.get=HEe;Wf.prototype.has=WEe;Wf.prototype.set=XEe;function dv(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(dv,"MapCache");function YEe(){this.size=0,this.__data__={hash:new ry,map:new(kre||Wf),string:new ry}}o(YEe,"mapCacheClear");function ZEe(e){var t=_3(this,e).delete(e);return this.size-=t?1:0,t}o(ZEe,"mapCacheDelete");function KEe(e){return _3(this,e).get(e)}o(KEe,"mapCacheGet");function JEe(e){return _3(this,e).has(e)}o(JEe,"mapCacheHas");function QEe(e,t){var r=_3(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}o(QEe,"mapCacheSet");dv.prototype.clear=YEe;dv.prototype.delete=ZEe;dv.prototype.get=KEe;dv.prototype.has=JEe;dv.prototype.set=QEe;function hv(e){var t=this.__data__=new Wf(e);this.size=t.size}o(hv,"Stack");function eMe(){this.__data__=new Wf,this.size=0}o(eMe,"stackClear");function tMe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}o(tMe,"stackDelete");function rMe(e){return this.__data__.get(e)}o(rMe,"stackGet");function nMe(e){return this.__data__.has(e)}o(nMe,"stackHas");function iMe(e,t){var r=this.__data__;if(r instanceof Wf){var n=r.__data__;if(!kre||n.length<HTe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new dv(n)}return r.set(e,t),this.size=r.size,this}o(iMe,"stackSet");hv.prototype.clear=eMe;hv.prototype.delete=tMe;hv.prototype.get=rMe;hv.prototype.has=nMe;hv.prototype.set=iMe;function oMe(e,t){var r=v7(e),n=!r&&y7(e),i=!r&&!n&&$re(e),s=!r&&!n&&!i&&Ure(e),l=r||n||i||s,c=l?PEe(e.length,String):[],p=c.length;for(var h in e)(t||Hf.call(e,h))&&!(l&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Bre(h,p)))&&c.push(h);return c}o(oMe,"arrayLikeKeys");function m7(e,t,r){(r!==void 0&&!S3(e[t],r)||r===void 0&&!(t in e))&&b7(e,t,r)}o(m7,"assignMergeValue");function sMe(e,t,r){var n=e[t];(!(Hf.call(e,t)&&S3(n,r))||r===void 0&&!(t in e))&&b7(e,t,r)}o(sMe,"assignValue");function x3(e,t){for(var r=e.length;r--;)if(S3(e[r][0],t))return r;return-1}o(x3,"assocIndexOf");function b7(e,t,r){t=="__proto__"&&y3?y3(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}o(b7,"baseAssignValue");var aMe=xMe();function I3(e){return e==null?e===void 0?lEe:nEe:ty&&ty in Object(e)?IMe(e):TMe(e)}o(I3,"baseGetTag");function wre(e){return t2(e)&&I3(e)==Ere}o(wre,"baseIsArguments");function lMe(e){if(!ny(e)||wMe(e))return!1;var t=_7(e)?DEe:_Ee;return t.test(LMe(e))}o(lMe,"baseIsNative");function uMe(e){return t2(e)&&Gre(e.length)&&!!gi[I3(e)]}o(uMe,"baseIsTypedArray");function cMe(e){if(!ny(e))return PMe(e);var t=jre(e),r=[];for(var n in e)n=="constructor"&&(t||!Hf.call(e,n))||r.push(n);return r}o(cMe,"baseKeysIn");function Rre(e,t,r,n,i){e!==t&&aMe(t,function(s,l){if(i||(i=new hv),ny(s))pMe(e,t,l,r,Rre,n,i);else{var c=n?n(g7(e,l),s,l+"",e,t,i):void 0;c===void 0&&(c=s),m7(e,l,c)}},Vre)}o(Rre,"baseMerge");function pMe(e,t,r,n,i,s,l){var c=g7(e,r),p=g7(t,r),h=l.get(p);if(h){m7(e,r,h);return}var y=s?s(c,p,r+"",e,t,l):void 0,b=y===void 0;if(b){var _=v7(p),C=!_&&$re(p),P=!_&&!C&&Ure(p);y=p,_||C||P?v7(c)?y=c:AMe(c)?y=yMe(c):C?(b=!1,y=hMe(p,!0)):P?(b=!1,y=gMe(p,!0)):y=[]:DMe(p)||y7(p)?(y=c,y7(c)?y=FMe(c):(!ny(c)||_7(c))&&(y=_Me(p))):b=!1}b&&(l.set(p,y),i(y,p,n,s,l),l.delete(p)),m7(e,r,y)}o(pMe,"baseMergeDeep");function fMe(e,t){return MMe(EMe(e,t,zre),e+"")}o(fMe,"baseRest");var dMe=y3?function(e,t){return y3(e,"toString",{configurable:!0,enumerable:!1,value:kMe(t),writable:!0})}:zre;function hMe(e,t){if(t)return e.slice();var r=e.length,n=_re?_re(r):new e.constructor(r);return e.copy(n),n}o(hMe,"cloneBuffer");function mMe(e){var t=new e.constructor(e.byteLength);return new Ire(t).set(new Ire(e)),t}o(mMe,"cloneArrayBuffer");function gMe(e,t){var r=t?mMe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}o(gMe,"cloneTypedArray");function yMe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}o(yMe,"copyArray");function vMe(e,t,r,n){var i=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var c=t[s],p=n?n(r[c],e[c],c,r,e):void 0;p===void 0&&(p=e[c]),i?b7(r,c,p):sMe(r,c,p)}return r}o(vMe,"copyObject");function bMe(e){return fMe(function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,l=i>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,l&&SMe(r[0],r[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,s)}return t})}o(bMe,"createAssigner");function xMe(e){return function(t,r,n){for(var i=-1,s=Object(t),l=n(t),c=l.length;c--;){var p=l[e?c:++i];if(r(s[p],p,s)===!1)break}return t}}o(xMe,"createBaseFor");function _3(e,t){var r=e.__data__;return CMe(t)?r[typeof t=="string"?"string":"hash"]:r.map}o(_3,"getMapData");function x7(e,t){var r=EEe(e,t);return lMe(r)?r:void 0}o(x7,"getNative");function IMe(e){var t=Hf.call(e,ty),r=e[ty];try{e[ty]=void 0;var n=!0}catch(s){}var i=Fre.call(e);return n&&(t?e[ty]=r:delete e[ty]),i}o(IMe,"getRawTag");function _Me(e){return typeof e.constructor=="function"&&!jre(e)?BEe(Nre(e)):{}}o(_Me,"initCloneObject");function Bre(e,t){var r=typeof e;return t=t==null?Tre:t,!!t&&(r=="number"||r!="symbol"&&SEe.test(e))&&e>-1&&e%1==0&&e<t}o(Bre,"isIndex");function SMe(e,t,r){if(!ny(r))return!1;var n=typeof t;return(n=="number"?I7(r)&&Bre(t,r.length):n=="string"&&t in r)?S3(r[t],e):!1}o(SMe,"isIterateeCall");function CMe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}o(CMe,"isKeyable");function wMe(e){return!!bre&&bre in e}o(wMe,"isMasked");function jre(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||v3;return e===r}o(jre,"isPrototype");function PMe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}o(PMe,"nativeKeysIn");function TMe(e){return Fre.call(e)}o(TMe,"objectToString");function EMe(e,t,r){return t=Cre(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=Cre(n.length-t,0),l=Array(s);++i<s;)l[i]=n[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=n[i];return c[t]=r(l),wEe(e,this,c)}}o(EMe,"overRest");function g7(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}o(g7,"safeGet");var MMe=OMe(dMe);function OMe(e){var t=0,r=0;return function(){var n=REe(),i=XTe-(n-r);if(r=n,i>0){if(++t>=WTe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}o(OMe,"shortOut");function LMe(e){if(e!=null){try{return b3.call(e)}catch(t){}try{return e+""}catch(t){}}return""}o(LMe,"toSource");function S3(e,t){return e===t||e!==e&&t!==t}o(S3,"eq");var y7=wre(function(){return arguments}())?wre:function(e){return t2(e)&&Hf.call(e,"callee")&&!FEe.call(e,"callee")},v7=Array.isArray;function I7(e){return e!=null&&Gre(e.length)&&!_7(e)}o(I7,"isArrayLike");function AMe(e){return t2(e)&&I7(e)}o(AMe,"isArrayLikeObject");var $re=kEe||RMe;function _7(e){if(!ny(e))return!1;var t=I3(e);return t==Mre||t==eEe||t==ZTe||t==iEe}o(_7,"isFunction");function Gre(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Tre}o(Gre,"isLength");function ny(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}o(ny,"isObject");function t2(e){return e!=null&&typeof e=="object"}o(t2,"isObjectLike");function DMe(e){if(!t2(e)||I3(e)!=Ore)return!1;var t=Nre(e);if(t===null)return!0;var r=Hf.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&b3.call(r)==AEe}o(DMe,"isPlainObject");var Ure=vre?TEe(vre):uMe;function FMe(e){return vMe(e,Vre(e))}o(FMe,"toPlainObject");function Vre(e){return I7(e)?oMe(e,!0):cMe(e)}o(Vre,"keysIn");var NMe=bMe(function(e,t,r){Rre(e,t,r)});function kMe(e){return function(){return e}}o(kMe,"constant");function zre(e){return e}o(zre,"identity");function RMe(){return!1}o(RMe,"stubFalse");fv.exports=NMe});var B7=fe((i2,gv)=>{g();var pOe=200,pne="__lodash_hash_undefined__",fOe=800,dOe=16,fne=9007199254740991,dne="[object Arguments]",hOe="[object Array]",mOe="[object AsyncFunction]",gOe="[object Boolean]",yOe="[object Date]",vOe="[object Error]",hne="[object Function]",bOe="[object GeneratorFunction]",xOe="[object Map]",IOe="[object Number]",_Oe="[object Null]",mne="[object Object]",SOe="[object Proxy]",COe="[object RegExp]",wOe="[object Set]",POe="[object String]",TOe="[object Undefined]",EOe="[object WeakMap]",MOe="[object ArrayBuffer]",OOe="[object DataView]",LOe="[object Float32Array]",AOe="[object Float64Array]",DOe="[object Int8Array]",FOe="[object Int16Array]",NOe="[object Int32Array]",kOe="[object Uint8Array]",ROe="[object Uint8ClampedArray]",BOe="[object Uint16Array]",jOe="[object Uint32Array]",$Oe=/[\\^$.*+?()[\]{}|]/g,GOe=/^\[object .+?Constructor\]$/,UOe=/^(?:0|[1-9]\d*)$/,yi={};yi[LOe]=yi[AOe]=yi[DOe]=yi[FOe]=yi[NOe]=yi[kOe]=yi[ROe]=yi[BOe]=yi[jOe]=!0;yi[dne]=yi[hOe]=yi[MOe]=yi[gOe]=yi[OOe]=yi[yOe]=yi[vOe]=yi[hne]=yi[xOe]=yi[IOe]=yi[mne]=yi[COe]=yi[wOe]=yi[POe]=yi[EOe]=!1;var gne=typeof global=="object"&&global&&global.Object===Object&&global,VOe=typeof self=="object"&&self&&self.Object===Object&&self,a2=gne||VOe||Function("return this")(),yne=typeof i2=="object"&&i2&&!i2.nodeType&&i2,o2=yne&&typeof gv=="object"&&gv&&!gv.nodeType&&gv,vne=o2&&o2.exports===yne,T7=vne&&gne.process,rne=function(){try{var e=o2&&o2.require&&o2.require("util").types;return e||T7&&T7.binding&&T7.binding("util")}catch(t){}}(),nne=rne&&rne.isTypedArray;function bne(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(bne,"apply");function zOe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}o(zOe,"baseTimes");function qOe(e){return function(t){return e(t)}}o(qOe,"baseUnary");function HOe(e,t){return e==null?void 0:e[t]}o(HOe,"getValue");function WOe(e,t){return function(r){return e(t(r))}}o(WOe,"overArg");var XOe=Array.prototype,YOe=Function.prototype,E3=Object.prototype,E7=a2["__core-js_shared__"],M3=YOe.toString,Zf=E3.hasOwnProperty,ine=function(){var e=/[^.]+$/.exec(E7&&E7.keys&&E7.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),xne=E3.toString,ZOe=M3.call(Object),KOe=RegExp("^"+M3.call(Zf).replace($Oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P3=vne?a2.Buffer:void 0,one=a2.Symbol,sne=a2.Uint8Array,ane=P3?P3.allocUnsafe:void 0,Ine=WOe(Object.getPrototypeOf,Object),lne=Object.create,JOe=E3.propertyIsEnumerable,QOe=XOe.splice,oy=one?one.toStringTag:void 0,T3=function(){try{var e=N7(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),e4e=P3?P3.isBuffer:void 0,une=Math.max,t4e=Date.now,_ne=N7(a2,"Map"),s2=N7(Object,"create"),r4e=function(){function e(){}return o(e,"object"),function(t){if(!Yf(t))return{};if(lne)return lne(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function sy(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(sy,"Hash");function n4e(){this.__data__=s2?s2(null):{},this.size=0}o(n4e,"hashClear");function i4e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}o(i4e,"hashDelete");function o4e(e){var t=this.__data__;if(s2){var r=t[e];return r===pne?void 0:r}return Zf.call(t,e)?t[e]:void 0}o(o4e,"hashGet");function s4e(e){var t=this.__data__;return s2?t[e]!==void 0:Zf.call(t,e)}o(s4e,"hashHas");function a4e(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=s2&&t===void 0?pne:t,this}o(a4e,"hashSet");sy.prototype.clear=n4e;sy.prototype.delete=i4e;sy.prototype.get=o4e;sy.prototype.has=s4e;sy.prototype.set=a4e;function Kf(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(Kf,"ListCache");function l4e(){this.__data__=[],this.size=0}o(l4e,"listCacheClear");function u4e(e){var t=this.__data__,r=O3(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():QOe.call(t,r,1),--this.size,!0}o(u4e,"listCacheDelete");function c4e(e){var t=this.__data__,r=O3(t,e);return r<0?void 0:t[r][1]}o(c4e,"listCacheGet");function p4e(e){return O3(this.__data__,e)>-1}o(p4e,"listCacheHas");function f4e(e,t){var r=this.__data__,n=O3(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}o(f4e,"listCacheSet");Kf.prototype.clear=l4e;Kf.prototype.delete=u4e;Kf.prototype.get=c4e;Kf.prototype.has=p4e;Kf.prototype.set=f4e;function yv(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(yv,"MapCache");function d4e(){this.size=0,this.__data__={hash:new sy,map:new(_ne||Kf),string:new sy}}o(d4e,"mapCacheClear");function h4e(e){var t=A3(this,e).delete(e);return this.size-=t?1:0,t}o(h4e,"mapCacheDelete");function m4e(e){return A3(this,e).get(e)}o(m4e,"mapCacheGet");function g4e(e){return A3(this,e).has(e)}o(g4e,"mapCacheHas");function y4e(e,t){var r=A3(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}o(y4e,"mapCacheSet");yv.prototype.clear=d4e;yv.prototype.delete=h4e;yv.prototype.get=m4e;yv.prototype.has=g4e;yv.prototype.set=y4e;function vv(e){var t=this.__data__=new Kf(e);this.size=t.size}o(vv,"Stack");function v4e(){this.__data__=new Kf,this.size=0}o(v4e,"stackClear");function b4e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}o(b4e,"stackDelete");function x4e(e){return this.__data__.get(e)}o(x4e,"stackGet");function I4e(e){return this.__data__.has(e)}o(I4e,"stackHas");function _4e(e,t){var r=this.__data__;if(r instanceof Kf){var n=r.__data__;if(!_ne||n.length<pOe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new yv(n)}return r.set(e,t),this.size=r.size,this}o(_4e,"stackSet");vv.prototype.clear=v4e;vv.prototype.delete=b4e;vv.prototype.get=x4e;vv.prototype.has=I4e;vv.prototype.set=_4e;function S4e(e,t){var r=A7(e),n=!r&&L7(e),i=!r&&!n&&Tne(e),s=!r&&!n&&!i&&Mne(e),l=r||n||i||s,c=l?zOe(e.length,String):[],p=c.length;for(var h in e)(t||Zf.call(e,h))&&!(l&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||wne(h,p)))&&c.push(h);return c}o(S4e,"arrayLikeKeys");function M7(e,t,r){(r!==void 0&&!D3(e[t],r)||r===void 0&&!(t in e))&&D7(e,t,r)}o(M7,"assignMergeValue");function C4e(e,t,r){var n=e[t];(!(Zf.call(e,t)&&D3(n,r))||r===void 0&&!(t in e))&&D7(e,t,r)}o(C4e,"assignValue");function O3(e,t){for(var r=e.length;r--;)if(D3(e[r][0],t))return r;return-1}o(O3,"assocIndexOf");function D7(e,t,r){t=="__proto__"&&T3?T3(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}o(D7,"baseAssignValue");var w4e=R4e();function L3(e){return e==null?e===void 0?TOe:_Oe:oy&&oy in Object(e)?B4e(e):z4e(e)}o(L3,"baseGetTag");function cne(e){return l2(e)&&L3(e)==dne}o(cne,"baseIsArguments");function P4e(e){if(!Yf(e)||U4e(e))return!1;var t=R7(e)?KOe:GOe;return t.test(X4e(e))}o(P4e,"baseIsNative");function T4e(e){return l2(e)&&Ene(e.length)&&!!yi[L3(e)]}o(T4e,"baseIsTypedArray");function E4e(e){if(!Yf(e))return V4e(e);var t=Pne(e),r=[];for(var n in e)n=="constructor"&&(t||!Zf.call(e,n))||r.push(n);return r}o(E4e,"baseKeysIn");function F7(e,t,r,n,i){e!==t&&w4e(t,function(s,l){if(i||(i=new vv),Yf(s))M4e(e,t,l,r,F7,n,i);else{var c=n?n(O7(e,l),s,l+"",e,t,i):void 0;c===void 0&&(c=s),M7(e,l,c)}},One)}o(F7,"baseMerge");function M4e(e,t,r,n,i,s,l){var c=O7(e,r),p=O7(t,r),h=l.get(p);if(h){M7(e,r,h);return}var y=s?s(c,p,r+"",e,t,l):void 0,b=y===void 0;if(b){var _=A7(p),C=!_&&Tne(p),P=!_&&!C&&Mne(p);y=p,_||C||P?A7(c)?y=c:Y4e(c)?y=F4e(c):C?(b=!1,y=L4e(p,!0)):P?(b=!1,y=D4e(p,!0)):y=[]:Z4e(p)||L7(p)?(y=c,L7(c)?y=K4e(c):(!Yf(c)||R7(c))&&(y=j4e(p))):b=!1}b&&(l.set(p,y),i(y,p,n,s,l),l.delete(p)),M7(e,r,y)}o(M4e,"baseMergeDeep");function Sne(e,t){return H4e(q4e(e,t,Lne),e+"")}o(Sne,"baseRest");var O4e=T3?function(e,t){return T3(e,"toString",{configurable:!0,enumerable:!1,value:e5e(t),writable:!0})}:Lne;function L4e(e,t){if(t)return e.slice();var r=e.length,n=ane?ane(r):new e.constructor(r);return e.copy(n),n}o(L4e,"cloneBuffer");function A4e(e){var t=new e.constructor(e.byteLength);return new sne(t).set(new sne(e)),t}o(A4e,"cloneArrayBuffer");function D4e(e,t){var r=t?A4e(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}o(D4e,"cloneTypedArray");function F4e(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}o(F4e,"copyArray");function N4e(e,t,r,n){var i=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var c=t[s],p=n?n(r[c],e[c],c,r,e):void 0;p===void 0&&(p=e[c]),i?D7(r,c,p):C4e(r,c,p)}return r}o(N4e,"copyObject");function k4e(e){return Sne(function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,l=i>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,l&&$4e(r[0],r[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,s)}return t})}o(k4e,"createAssigner");function R4e(e){return function(t,r,n){for(var i=-1,s=Object(t),l=n(t),c=l.length;c--;){var p=l[e?c:++i];if(r(s[p],p,s)===!1)break}return t}}o(R4e,"createBaseFor");function Cne(e,t,r,n,i,s){return Yf(e)&&Yf(t)&&(s.set(t,e),F7(e,t,void 0,Cne,s),s.delete(t)),e}o(Cne,"customDefaultsMerge");function A3(e,t){var r=e.__data__;return G4e(t)?r[typeof t=="string"?"string":"hash"]:r.map}o(A3,"getMapData");function N7(e,t){var r=HOe(e,t);return P4e(r)?r:void 0}o(N7,"getNative");function B4e(e){var t=Zf.call(e,oy),r=e[oy];try{e[oy]=void 0;var n=!0}catch(s){}var i=xne.call(e);return n&&(t?e[oy]=r:delete e[oy]),i}o(B4e,"getRawTag");function j4e(e){return typeof e.constructor=="function"&&!Pne(e)?r4e(Ine(e)):{}}o(j4e,"initCloneObject");function wne(e,t){var r=typeof e;return t=t==null?fne:t,!!t&&(r=="number"||r!="symbol"&&UOe.test(e))&&e>-1&&e%1==0&&e<t}o(wne,"isIndex");function $4e(e,t,r){if(!Yf(r))return!1;var n=typeof t;return(n=="number"?k7(r)&&wne(t,r.length):n=="string"&&t in r)?D3(r[t],e):!1}o($4e,"isIterateeCall");function G4e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}o(G4e,"isKeyable");function U4e(e){return!!ine&&ine in e}o(U4e,"isMasked");function Pne(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||E3;return e===r}o(Pne,"isPrototype");function V4e(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}o(V4e,"nativeKeysIn");function z4e(e){return xne.call(e)}o(z4e,"objectToString");function q4e(e,t,r){return t=une(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=une(n.length-t,0),l=Array(s);++i<s;)l[i]=n[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=n[i];return c[t]=r(l),bne(e,this,c)}}o(q4e,"overRest");function O7(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}o(O7,"safeGet");var H4e=W4e(O4e);function W4e(e){var t=0,r=0;return function(){var n=t4e(),i=dOe-(n-r);if(r=n,i>0){if(++t>=fOe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}o(W4e,"shortOut");function X4e(e){if(e!=null){try{return M3.call(e)}catch(t){}try{return e+""}catch(t){}}return""}o(X4e,"toSource");function D3(e,t){return e===t||e!==e&&t!==t}o(D3,"eq");var L7=cne(function(){return arguments}())?cne:function(e){return l2(e)&&Zf.call(e,"callee")&&!JOe.call(e,"callee")},A7=Array.isArray;function k7(e){return e!=null&&Ene(e.length)&&!R7(e)}o(k7,"isArrayLike");function Y4e(e){return l2(e)&&k7(e)}o(Y4e,"isArrayLikeObject");var Tne=e4e||t5e;function R7(e){if(!Yf(e))return!1;var t=L3(e);return t==hne||t==bOe||t==mOe||t==SOe}o(R7,"isFunction");function Ene(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=fne}o(Ene,"isLength");function Yf(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}o(Yf,"isObject");function l2(e){return e!=null&&typeof e=="object"}o(l2,"isObjectLike");function Z4e(e){if(!l2(e)||L3(e)!=mne)return!1;var t=Ine(e);if(t===null)return!0;var r=Zf.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&M3.call(r)==ZOe}o(Z4e,"isPlainObject");var Mne=nne?qOe(nne):T4e;function K4e(e){return N4e(e,One(e))}o(K4e,"toPlainObject");var J4e=Sne(function(e){return e.push(void 0,Cne),bne(Q4e,void 0,e)});function One(e){return k7(e)?S4e(e,!0):E4e(e)}o(One,"keysIn");var Q4e=k4e(function(e,t,r,n){F7(e,t,r,n)});function e5e(e){return function(){return e}}o(e5e,"constant");function Lne(e){return e}o(Lne,"identity");function t5e(){return!1}o(t5e,"stubFalse");gv.exports=J4e});var _ie=fe((Jzt,y2)=>{"use strict";g();var y5e=!1,cy=!1,mie=!0,gie=!1,T={},yie=!1;typeof y2<"u"&&y2.exports?(y2.exports=T,yie=!0):typeof document<"u"?window.ClipperLib=T:self.ClipperLib=T;var z3;yie?(Ao="chrome",z3="Netscape"):(Ao=navigator.userAgent.toString().toLowerCase(),z3=navigator.appName);var Ao,qr={};Ao.indexOf("chrome")!=-1&&Ao.indexOf("chromium")==-1?qr.chrome=1:qr.chrome=0;Ao.indexOf("chromium")!=-1?qr.chromium=1:qr.chromium=0;Ao.indexOf("safari")!=-1&&Ao.indexOf("chrome")==-1&&Ao.indexOf("chromium")==-1?qr.safari=1:qr.safari=0;Ao.indexOf("firefox")!=-1?qr.firefox=1:qr.firefox=0;Ao.indexOf("firefox/17")!=-1?qr.firefox17=1:qr.firefox17=0;Ao.indexOf("firefox/15")!=-1?qr.firefox15=1:qr.firefox15=0;Ao.indexOf("firefox/3")!=-1?qr.firefox3=1:qr.firefox3=0;Ao.indexOf("opera")!=-1?qr.opera=1:qr.opera=0;Ao.indexOf("msie 10")!=-1?qr.msie10=1:qr.msie10=0;Ao.indexOf("msie 9")!=-1?qr.msie9=1:qr.msie9=0;Ao.indexOf("msie 8")!=-1?qr.msie8=1:qr.msie8=0;Ao.indexOf("msie 7")!=-1?qr.msie7=1:qr.msie7=0;Ao.indexOf("msie ")!=-1?qr.msie=1:qr.msie=0;T.biginteger_used=null;var Th,v5e=0xdeadbeefcafe,die=(v5e&16777215)==15715070;function je(e,t,r){T.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(je,"BigInteger");function nn(){return new je(null)}o(nn,"nbi");function b5e(e,t,r,n,i,s){for(;--s>=0;){var l=t*this[e++]+r[n]+i;i=Math.floor(l/67108864),r[n++]=l&67108863}return i}o(b5e,"am1");function x5e(e,t,r,n,i,s){for(var l=t&32767,c=t>>15;--s>=0;){var p=this[e]&32767,h=this[e++]>>15,y=c*p+h*l;p=l*p+((y&32767)<<15)+r[n]+(i&1073741823),i=(p>>>30)+(y>>>15)+c*h+(i>>>30),r[n++]=p&1073741823}return i}o(x5e,"am2");function I5e(e,t,r,n,i,s){for(var l=t&16383,c=t>>14;--s>=0;){var p=this[e]&16383,h=this[e++]>>14,y=c*p+h*l;p=l*p+((y&16383)<<14)+r[n]+i,i=(p>>28)+(y>>14)+c*h,r[n++]=p&268435455}return i}o(I5e,"am3");die&&z3=="Microsoft Internet Explorer"?(je.prototype.am=x5e,Th=30):die&&z3!="Netscape"?(je.prototype.am=b5e,Th=26):(je.prototype.am=I5e,Th=28);je.prototype.DB=Th;je.prototype.DM=(1<<Th)-1;je.prototype.DV=1<<Th;var uD=52;je.prototype.FV=Math.pow(2,uD);je.prototype.F1=uD-Th;je.prototype.F2=2*Th-uD;var _5e="0123456789abcdefghijklmnopqrstuvwxyz",H3=new Array,Cv,au;Cv=48;for(au=0;au<=9;++au)H3[Cv++]=au;Cv=97;for(au=10;au<36;++au)H3[Cv++]=au;Cv=65;for(au=10;au<36;++au)H3[Cv++]=au;function hie(e){return _5e.charAt(e)}o(hie,"int2char");function vie(e,t){var r=H3[e.charCodeAt(t)];return r==null?-1:r}o(vie,"intAt");function S5e(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}o(S5e,"bnpCopyTo");function C5e(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(C5e,"bnpFromInt");function Ph(e){var t=nn();return t.fromInt(e),t}o(Ph,"nbv");function w5e(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,s=0;--n>=0;){var l=r==8?e[n]&255:vie(e,n);if(l<0){e.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this[this.t++]=l:s+r>this.DB?(this[this.t-1]|=(l&(1<<this.DB-s)-1)<<s,this[this.t++]=l>>this.DB-s):this[this.t-1]|=l<<s,s+=r,s>=this.DB&&(s-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&je.ZERO.subTo(this,this)}o(w5e,"bnpFromString");function P5e(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}o(P5e,"bnpClamp");function T5e(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,s="",l=this.t,c=this.DB-l*this.DB%t;if(l-- >0)for(c<this.DB&&(n=this[l]>>c)>0&&(i=!0,s=hie(n));l>=0;)c<t?(n=(this[l]&(1<<c)-1)<<t-c,n|=this[--l]>>(c+=this.DB-t)):(n=this[l]>>(c-=t)&r,c<=0&&(c+=this.DB,--l)),n>0&&(i=!0),i&&(s+=hie(n));return i?s:"0"}o(T5e,"bnToString");function E5e(){var e=nn();return je.ZERO.subTo(this,e),e}o(E5e,"bnNegate");function M5e(){return this.s<0?this.negate():this}o(M5e,"bnAbs");function O5e(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(O5e,"bnCompareTo");function W3(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(W3,"nbits");function L5e(){return this.t<=0?0:this.DB*(this.t-1)+W3(this[this.t-1]^this.s&this.DM)}o(L5e,"bnBitLength");function A5e(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(A5e,"bnpDLShiftTo");function D5e(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(D5e,"bnpDRShiftTo");function F5e(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,s=Math.floor(e/this.DB),l=this.s<<r&this.DM,c;for(c=this.t-1;c>=0;--c)t[c+s+1]=this[c]>>n|l,l=(this[c]&i)<<r;for(c=s-1;c>=0;--c)t[c]=0;t[s]=l,t.t=this.t+s+1,t.s=this.s,t.clamp()}o(F5e,"bnpLShiftTo");function N5e(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,s=(1<<n)-1;t[0]=this[r]>>n;for(var l=r+1;l<this.t;++l)t[l-r-1]|=(this[l]&s)<<i,t[l-r]=this[l]>>n;n>0&&(t[this.t-r-1]|=(this.s&s)<<i),t.t=this.t-r,t.clamp()}o(N5e,"bnpRShiftTo");function k5e(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(k5e,"bnpSubTo");function R5e(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&&je.ZERO.subTo(t,t)}o(R5e,"bnpMultiplyTo");function B5e(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(B5e,"bnpSquareTo");function j5e(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=nn());var s=nn(),l=this.s,c=e.s,p=this.DB-W3(n[n.t-1]);p>0?(n.lShiftTo(p,s),i.lShiftTo(p,r)):(n.copyTo(s),i.copyTo(r));var h=s.t,y=s[h-1];if(y!=0){var b=y*(1<<this.F1)+(h>1?s[h-2]>>this.F2:0),_=this.FV/b,C=(1<<this.F1)/b,P=1<<this.F2,E=r.t,w=E-h,O=t==null?nn():t;for(s.dlShiftTo(w,O),r.compareTo(O)>=0&&(r[r.t++]=1,r.subTo(O,r)),je.ONE.dlShiftTo(h,O),O.subTo(s,s);s.t<h;)s[s.t++]=0;for(;--w>=0;){var D=r[--E]==y?this.DM:Math.floor(r[E]*_+(r[E-1]+P)*C);if((r[E]+=s.am(0,D,r,w,0,h))<D)for(s.dlShiftTo(w,O),r.subTo(O,r);r[E]<--D;)r.subTo(O,r)}t!=null&&(r.drShiftTo(h,t),l!=c&&je.ZERO.subTo(t,t)),r.t=h,r.clamp(),p>0&&r.rShiftTo(p,r),l<0&&je.ZERO.subTo(r,r)}}}o(j5e,"bnpDivRemTo");function $5e(e){var t=nn();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(je.ZERO)>0&&e.subTo(t,t),t}o($5e,"bnMod");function py(e){this.m=e}o(py,"Classic");function G5e(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}o(G5e,"cConvert");function U5e(e){return e}o(U5e,"cRevert");function V5e(e){e.divRemTo(this.m,null,e)}o(V5e,"cReduce");function z5e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(z5e,"cMulTo");function q5e(e,t){e.squareTo(t),this.reduce(t)}o(q5e,"cSqrTo");py.prototype.convert=G5e;py.prototype.revert=U5e;py.prototype.reduce=V5e;py.prototype.mulTo=z5e;py.prototype.sqrTo=q5e;function H5e(){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(H5e,"bnpInvDigit");function fy(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(fy,"Montgomery");function W5e(e){var t=nn();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(je.ZERO)>0&&this.m.subTo(t,t),t}o(W5e,"montConvert");function X5e(e){var t=nn();return e.copyTo(t),this.reduce(t),t}o(X5e,"montRevert");function Y5e(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(Y5e,"montReduce");function Z5e(e,t){e.squareTo(t),this.reduce(t)}o(Z5e,"montSqrTo");function K5e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(K5e,"montMulTo");fy.prototype.convert=W5e;fy.prototype.revert=X5e;fy.prototype.reduce=Y5e;fy.prototype.mulTo=K5e;fy.prototype.sqrTo=Z5e;function J5e(){return(this.t>0?this[0]&1:this.s)==0}o(J5e,"bnpIsEven");function Q5e(e,t){if(e>4294967295||e<1)return je.ONE;var r=nn(),n=nn(),i=t.convert(this),s=W3(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<<s)>0)t.mulTo(n,i,r);else{var l=r;r=n,n=l}return t.revert(r)}o(Q5e,"bnpExp");function e6e(e,t){var r;return e<256||t.isEven()?r=new py(t):r=new fy(t),this.exp(e,r)}o(e6e,"bnModPowInt");je.prototype.copyTo=S5e;je.prototype.fromInt=C5e;je.prototype.fromString=w5e;je.prototype.clamp=P5e;je.prototype.dlShiftTo=A5e;je.prototype.drShiftTo=D5e;je.prototype.lShiftTo=F5e;je.prototype.rShiftTo=N5e;je.prototype.subTo=k5e;je.prototype.multiplyTo=R5e;je.prototype.squareTo=B5e;je.prototype.divRemTo=j5e;je.prototype.invDigit=H5e;je.prototype.isEven=J5e;je.prototype.exp=Q5e;je.prototype.toString=T5e;je.prototype.negate=E5e;je.prototype.abs=M5e;je.prototype.compareTo=O5e;je.prototype.bitLength=L5e;je.prototype.mod=$5e;je.prototype.modPowInt=e6e;je.ZERO=Ph(0);je.ONE=Ph(1);function t6e(){var e=nn();return this.copyTo(e),e}o(t6e,"bnClone");function r6e(){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(r6e,"bnIntValue");function n6e(){return this.t==0?this.s:this[0]<<24>>24}o(n6e,"bnByteValue");function i6e(){return this.t==0?this.s:this[0]<<16>>16}o(i6e,"bnShortValue");function o6e(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}o(o6e,"bnpChunkSize");function s6e(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}o(s6e,"bnSigNum");function a6e(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=Ph(r),i=nn(),s=nn(),l="";for(this.divRemTo(n,i,s);i.signum()>0;)l=(r+s.intValue()).toString(e).substr(1)+l,i.divRemTo(n,i,s);return s.intValue().toString(e)+l}o(a6e,"bnpToRadix");function l6e(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,s=0,l=0,c=0;c<e.length;++c){var p=vie(e,c);if(p<0){e.charAt(c)=="-"&&this.signum()==0&&(i=!0);continue}l=t*l+p,++s>=r&&(this.dMultiply(n),this.dAddOffset(l,0),s=0,l=0)}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(l,0)),i&&je.ZERO.subTo(this,this)}o(l6e,"bnpFromRadix");function u6e(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(je.ONE.shiftLeft(e-1),cD,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(je.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(u6e,"bnpFromNumber");function c6e(){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(c6e,"bnToByteArray");function p6e(e){return this.compareTo(e)==0}o(p6e,"bnEquals");function f6e(e){return this.compareTo(e)<0?this:e}o(f6e,"bnMin");function d6e(e){return this.compareTo(e)>0?this:e}o(d6e,"bnMax");function h6e(e,t,r){var n,i,s=Math.min(e.t,this.t);for(n=0;n<s;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=s;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=s;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}o(h6e,"bnpBitwiseTo");function m6e(e,t){return e&t}o(m6e,"op_and");function g6e(e){var t=nn();return this.bitwiseTo(e,m6e,t),t}o(g6e,"bnAnd");function cD(e,t){return e|t}o(cD,"op_or");function y6e(e){var t=nn();return this.bitwiseTo(e,cD,t),t}o(y6e,"bnOr");function bie(e,t){return e^t}o(bie,"op_xor");function v6e(e){var t=nn();return this.bitwiseTo(e,bie,t),t}o(v6e,"bnXor");function xie(e,t){return e&~t}o(xie,"op_andnot");function b6e(e){var t=nn();return this.bitwiseTo(e,xie,t),t}o(b6e,"bnAndNot");function x6e(){for(var e=nn(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}o(x6e,"bnNot");function I6e(e){var t=nn();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}o(I6e,"bnShiftLeft");function _6e(e){var t=nn();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}o(_6e,"bnShiftRight");function S6e(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(S6e,"lbit");function C6e(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+S6e(this[e]);return this.s<0?this.t*this.DB:-1}o(C6e,"bnGetLowestSetBit");function w6e(e){for(var t=0;e!=0;)e&=e-1,++t;return t}o(w6e,"cbit");function P6e(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=w6e(this[r]^t);return e}o(P6e,"bnBitCount");function T6e(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}o(T6e,"bnTestBit");function E6e(e,t){var r=je.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}o(E6e,"bnpChangeBit");function M6e(e){return this.changeBit(e,cD)}o(M6e,"bnSetBit");function O6e(e){return this.changeBit(e,xie)}o(O6e,"bnClearBit");function L6e(e){return this.changeBit(e,bie)}o(L6e,"bnFlipBit");function A6e(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(A6e,"bnpAddTo");function D6e(e){var t=nn();return this.addTo(e,t),t}o(D6e,"bnAdd");function F6e(e){var t=nn();return this.subTo(e,t),t}o(F6e,"bnSubtract");function N6e(e){var t=nn();return this.multiplyTo(e,t),t}o(N6e,"bnMultiply");function k6e(){var e=nn();return this.squareTo(e),e}o(k6e,"bnSquare");function R6e(e){var t=nn();return this.divRemTo(e,t,null),t}o(R6e,"bnDivide");function B6e(e){var t=nn();return this.divRemTo(e,null,t),t}o(B6e,"bnRemainder");function j6e(e){var t=nn(),r=nn();return this.divRemTo(e,t,r),new Array(t,r)}o(j6e,"bnDivideAndRemainder");function $6e(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}o($6e,"bnpDMultiply");function G6e(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(G6e,"bnpDAddOffset");function v2(){}o(v2,"NullExp");function Iie(e){return e}o(Iie,"nNop");function U6e(e,t,r){e.multiplyTo(t,r)}o(U6e,"nMulTo");function V6e(e,t){e.squareTo(t)}o(V6e,"nSqrTo");v2.prototype.convert=Iie;v2.prototype.revert=Iie;v2.prototype.mulTo=U6e;v2.prototype.sqrTo=V6e;function z6e(e){return this.exp(e,new v2)}o(z6e,"bnPow");function q6e(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(q6e,"bnpMultiplyLowerTo");function H6e(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(H6e,"bnpMultiplyUpperTo");function wv(e){this.r2=nn(),this.q3=nn(),je.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}o(wv,"Barrett");function W6e(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=nn();return e.copyTo(t),this.reduce(t),t}o(W6e,"barrettConvert");function X6e(e){return e}o(X6e,"barrettRevert");function Y6e(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(Y6e,"barrettReduce");function Z6e(e,t){e.squareTo(t),this.reduce(t)}o(Z6e,"barrettSqrTo");function K6e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(K6e,"barrettMulTo");wv.prototype.convert=W6e;wv.prototype.revert=X6e;wv.prototype.reduce=Y6e;wv.prototype.mulTo=K6e;wv.prototype.sqrTo=Z6e;function J6e(e,t){var r=e.bitLength(),n,i=Ph(1),s;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?s=new py(t):t.isEven()?s=new wv(t):s=new fy(t);var l=new Array,c=3,p=n-1,h=(1<<n)-1;if(l[1]=s.convert(this),n>1){var y=nn();for(s.sqrTo(l[1],y);c<=h;)l[c]=nn(),s.mulTo(y,l[c-2],l[c]),c+=2}var b=e.t-1,_,C=!0,P=nn(),E;for(r=W3(e[b])-1;b>=0;){for(r>=p?_=e[b]>>r-p&h:(_=(e[b]&(1<<r+1)-1)<<p-r,b>0&&(_|=e[b-1]>>this.DB+r-p)),c=n;(_&1)==0;)_>>=1,--c;if((r-=c)<0&&(r+=this.DB,--b),C)l[_].copyTo(i),C=!1;else{for(;c>1;)s.sqrTo(i,P),s.sqrTo(P,i),c-=2;c>0?s.sqrTo(i,P):(E=i,i=P,P=E),s.mulTo(P,l[_],i)}for(;b>=0&&(e[b]&1<<r)==0;)s.sqrTo(i,P),E=i,i=P,P=E,--r<0&&(r=this.DB-1,--b)}return s.revert(i)}o(J6e,"bnModPow");function Q6e(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(),s=r.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,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 s>0&&r.lShiftTo(s,r),r}o(Q6e,"bnGCD");function eLe(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(eLe,"bnpModInt");function tLe(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return je.ZERO;for(var r=e.clone(),n=this.clone(),i=Ph(1),s=Ph(0),l=Ph(0),c=Ph(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(e,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),t?((!l.isEven()||!c.isEven())&&(l.addTo(this,l),c.subTo(e,c)),l.rShiftTo(1,l)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(l,i),s.subTo(c,s)):(n.subTo(r,n),t&&l.subTo(i,l),c.subTo(s,c))}if(n.compareTo(je.ONE)!=0)return je.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(tLe,"bnModInverse");var ba=[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],rLe=(1<<26)/ba[ba.length-1];function nLe(e){var t,r=this.abs();if(r.t==1&&r[0]<=ba[ba.length-1]){for(t=0;t<ba.length;++t)if(r[0]==ba[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<ba.length;){for(var n=ba[t],i=t+1;i<ba.length&&n<rLe;)n*=ba[i++];for(n=r.modInt(n);t<i;)if(n%ba[t++]==0)return!1}return r.millerRabin(e)}o(nLe,"bnIsProbablePrime");function iLe(e){var t=this.subtract(je.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>ba.length&&(e=ba.length);for(var i=nn(),s=0;s<e;++s){i.fromInt(ba[Math.floor(Math.random()*ba.length)]);var l=i.modPow(n,this);if(l.compareTo(je.ONE)!=0&&l.compareTo(t)!=0){for(var c=1;c++<r&&l.compareTo(t)!=0;)if(l=l.modPowInt(2,this),l.compareTo(je.ONE)==0)return!1;if(l.compareTo(t)!=0)return!1}}return!0}o(iLe,"bnpMillerRabin");je.prototype.chunkSize=o6e;je.prototype.toRadix=a6e;je.prototype.fromRadix=l6e;je.prototype.fromNumber=u6e;je.prototype.bitwiseTo=h6e;je.prototype.changeBit=E6e;je.prototype.addTo=A6e;je.prototype.dMultiply=$6e;je.prototype.dAddOffset=G6e;je.prototype.multiplyLowerTo=q6e;je.prototype.multiplyUpperTo=H6e;je.prototype.modInt=eLe;je.prototype.millerRabin=iLe;je.prototype.clone=t6e;je.prototype.intValue=r6e;je.prototype.byteValue=n6e;je.prototype.shortValue=i6e;je.prototype.signum=s6e;je.prototype.toByteArray=c6e;je.prototype.equals=p6e;je.prototype.min=f6e;je.prototype.max=d6e;je.prototype.and=g6e;je.prototype.or=y6e;je.prototype.xor=v6e;je.prototype.andNot=b6e;je.prototype.not=x6e;je.prototype.shiftLeft=I6e;je.prototype.shiftRight=_6e;je.prototype.getLowestSetBit=C6e;je.prototype.bitCount=P6e;je.prototype.testBit=T6e;je.prototype.setBit=M6e;je.prototype.clearBit=O6e;je.prototype.flipBit=L6e;je.prototype.add=D6e;je.prototype.subtract=F6e;je.prototype.multiply=N6e;je.prototype.divide=R6e;je.prototype.remainder=B6e;je.prototype.divideAndRemainder=j6e;je.prototype.modPow=J6e;je.prototype.modInverse=tLe;je.prototype.pow=z6e;je.prototype.gcd=Q6e;je.prototype.isProbablePrime=nLe;je.prototype.square=k6e;var Tr=je;Tr.prototype.IsNegative=function(){return this.compareTo(Tr.ZERO)==-1};Tr.op_Equality=function(e,t){return e.compareTo(t)==0};Tr.op_Inequality=function(e,t){return e.compareTo(t)!=0};Tr.op_GreaterThan=function(e,t){return e.compareTo(t)>0};Tr.op_LessThan=function(e,t){return e.compareTo(t)<0};Tr.op_Addition=function(e,t){return new Tr(e).add(new Tr(t))};Tr.op_Subtraction=function(e,t){return new Tr(e).subtract(new Tr(t))};Tr.Int128Mul=function(e,t){return new Tr(e).multiply(new Tr(t))};Tr.op_Division=function(e,t){return e.divide(t)};Tr.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof q3>"u"&&(q3=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 q3;T.Path=function(){return[]};T.Paths=function(){return[]};T.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])};T.DoublePoint0=function(){this.X=0,this.Y=0};T.DoublePoint1=function(e){this.X=e.X,this.Y=e.Y};T.DoublePoint2=function(e,t){this.X=e,this.Y=t};T.PolyNode=function(){this.m_Parent=null,this.m_polygon=new T.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};T.PolyNode.prototype.IsHoleNode=function(){for(var e=!0,t=this.m_Parent;t!==null;)e=!e,t=t.m_Parent;return e};T.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};T.PolyNode.prototype.Contour=function(){return this.m_polygon};T.PolyNode.prototype.AddChild=function(e){var t=this.m_Childs.length;this.m_Childs.push(e),e.m_Parent=this,e.m_Index=t};T.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};T.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]};T.PolyNode.prototype.Childs=function(){return this.m_Childs};T.PolyNode.prototype.Parent=function(){return this.m_Parent};T.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};T.PolyTree=function(){this.m_AllPolys=[],T.PolyNode.call(this)};T.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};T.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};T.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};q3(T.PolyTree,T.PolyNode);T.Math_Abs_Int64=T.Math_Abs_Int32=T.Math_Abs_Double=function(e){return Math.abs(e)};T.Math_Max_Int32_Int32=function(e,t){return Math.max(e,t)};qr.msie||qr.opera||qr.safari?T.Cast_Int32=function(e){return e|0}:T.Cast_Int32=function(e){return~~e};qr.chrome?T.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:qr.firefox&&typeof Number.toInteger=="function"?T.Cast_Int64=function(e){return Number.toInteger(e)}:qr.msie7||qr.msie8?T.Cast_Int64=function(e){return parseInt(e,10)}:qr.msie?T.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):e|0}:T.Cast_Int64=function(e){return e<0?Math.ceil(e):Math.floor(e)};T.Clear=function(e){e.length=0};T.PI=3.141592653589793;T.PI2=2*3.141592653589793;T.IntPoint=function(){var e=arguments,t=e.length;if(this.X=0,this.Y=0,cy)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 T.DoublePoint){var r=e[0];this.X=T.Clipper.Round(r.X),this.Y=T.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 T.DoublePoint){var r=e[0];this.X=T.Clipper.Round(r.X),this.Y=T.Clipper.Round(r.Y)}else{var n=e[0];this.X=n.X,this.Y=n.Y}else this.X=0,this.Y=0};T.IntPoint.op_Equality=function(e,t){return e.X==t.X&&e.Y==t.Y};T.IntPoint.op_Inequality=function(e,t){return e.X!=t.X||e.Y!=t.Y};cy?(T.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},T.IntPoint1=function(e){this.X=e.X,this.Y=e.Y,this.Z=e.Z},T.IntPoint1dp=function(e){this.X=T.Clipper.Round(e.X),this.Y=T.Clipper.Round(e.Y),this.Z=0},T.IntPoint2=function(e,t){this.X=e,this.Y=t,this.Z=0},T.IntPoint3=function(e,t,r){this.X=e,this.Y=t,this.Z=r}):(T.IntPoint0=function(){this.X=0,this.Y=0},T.IntPoint1=function(e){this.X=e.X,this.Y=e.Y},T.IntPoint1dp=function(e){this.X=T.Clipper.Round(e.X),this.Y=T.Clipper.Round(e.Y)},T.IntPoint2=function(e,t){this.X=e,this.Y=t});T.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)};T.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};T.IntRect1=function(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom};T.IntRect4=function(e,t,r,n){this.left=e,this.top=t,this.right=r,this.bottom=n};T.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};T.PolyType={ptSubject:0,ptClip:1};T.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};T.JoinType={jtSquare:0,jtRound:1,jtMiter:2};T.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};gie&&(T.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});T.EdgeSide={esLeft:0,esRight:1};T.Direction={dRightToLeft:0,dLeftToRight:1};T.TEdge=function(){this.Bot=new T.IntPoint,this.Curr=new T.IntPoint,this.Top=new T.IntPoint,this.Delta=new T.IntPoint,this.Dx=0,this.PolyTyp=T.PolyType.ptSubject,this.Side=T.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};T.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new T.IntPoint};T.MyIntersectNodeSort=function(){};T.MyIntersectNodeSort.Compare=function(e,t){return t.Pt.Y-e.Pt.Y};T.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};T.Scanbeam=function(){this.Y=0,this.Next=null};T.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};T.OutPt=function(){this.Idx=0,this.Pt=new T.IntPoint,this.Next=null,this.Prev=null};T.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new T.IntPoint};T.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};T.ClipperBase.horizontal=-9007199254740992;T.ClipperBase.Skip=-2;T.ClipperBase.Unassigned=-1;T.ClipperBase.tolerance=1e-20;y5e?(T.ClipperBase.loRange=46340,T.ClipperBase.hiRange=46340):(T.ClipperBase.loRange=47453132,T.ClipperBase.hiRange=0xfffffffffffff);T.ClipperBase.near_zero=function(e){return e>-T.ClipperBase.tolerance&&e<T.ClipperBase.tolerance};T.ClipperBase.IsHorizontal=function(e){return e.Delta.Y===0};T.ClipperBase.prototype.PointIsVertex=function(e,t){var r=t;do{if(T.IntPoint.op_Equality(r.Pt,e))return!0;r=r.Next}while(r!=t);return!1};T.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&&Tr.op_Equality(Tr.Int128Mul(e.X-t.X,r.Y-t.Y),Tr.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)};T.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};T.ClipperBase.prototype.SlopesEqual=T.ClipperBase.SlopesEqual=function(){var e=arguments,t=e.length,r,n,i,s,l,c,p;return t==3?(r=e[0],n=e[1],p=e[2],p?Tr.op_Equality(Tr.Int128Mul(r.Delta.Y,n.Delta.X),Tr.Int128Mul(r.Delta.X,n.Delta.Y)):T.Cast_Int64(r.Delta.Y*n.Delta.X)==T.Cast_Int64(r.Delta.X*n.Delta.Y)):t==4?(i=e[0],s=e[1],l=e[2],p=e[3],p?Tr.op_Equality(Tr.Int128Mul(i.Y-s.Y,s.X-l.X),Tr.Int128Mul(i.X-s.X,s.Y-l.Y)):T.Cast_Int64((i.Y-s.Y)*(s.X-l.X))-T.Cast_Int64((i.X-s.X)*(s.Y-l.Y))===0):(i=e[0],s=e[1],l=e[2],c=e[3],p=e[4],p?Tr.op_Equality(Tr.Int128Mul(i.Y-s.Y,l.X-c.X),Tr.Int128Mul(i.X-s.X,l.Y-c.Y)):T.Cast_Int64((i.Y-s.Y)*(l.X-c.X))-T.Cast_Int64((i.X-s.X)*(l.Y-c.Y))===0)};T.ClipperBase.SlopesEqual3=function(e,t,r){return r?Tr.op_Equality(Tr.Int128Mul(e.Delta.Y,t.Delta.X),Tr.Int128Mul(e.Delta.X,t.Delta.Y)):T.Cast_Int64(e.Delta.Y*t.Delta.X)==T.Cast_Int64(e.Delta.X*t.Delta.Y)};T.ClipperBase.SlopesEqual4=function(e,t,r,n){return n?Tr.op_Equality(Tr.Int128Mul(e.Y-t.Y,t.X-r.X),Tr.Int128Mul(e.X-t.X,t.Y-r.Y)):T.Cast_Int64((e.Y-t.Y)*(t.X-r.X))-T.Cast_Int64((e.X-t.X)*(t.Y-r.Y))===0};T.ClipperBase.SlopesEqual5=function(e,t,r,n,i){return i?Tr.op_Equality(Tr.Int128Mul(e.Y-t.Y,r.X-n.X),Tr.Int128Mul(e.X-t.X,r.Y-n.Y)):T.Cast_Int64((e.Y-t.Y)*(r.X-n.X))-T.Cast_Int64((e.X-t.X)*(r.Y-n.Y))===0};T.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;T.Clear(this.m_edges[e])}T.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};T.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};T.ClipperBase.prototype.RangeTest=function(e,t){t.Value?(e.X>T.ClipperBase.hiRange||e.Y>T.ClipperBase.hiRange||-e.X>T.ClipperBase.hiRange||-e.Y>T.ClipperBase.hiRange)&&T.Error("Coordinate outside allowed range in RangeTest()."):(e.X>T.ClipperBase.loRange||e.Y>T.ClipperBase.loRange||-e.X>T.ClipperBase.loRange||-e.Y>T.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(e,t))};T.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};T.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};T.ClipperBase.prototype.FindNextLocMin=function(e){for(var t;;){for(;T.IntPoint.op_Inequality(e.Bot,e.Prev.Bot)||T.IntPoint.op_Equality(e.Curr,e.Top);)e=e.Next;if(e.Dx!=T.ClipperBase.horizontal&&e.Prev.Dx!=T.ClipperBase.horizontal)break;for(;e.Prev.Dx==T.ClipperBase.horizontal;)e=e.Prev;for(t=e;e.Dx==T.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};T.ClipperBase.prototype.ProcessBound=function(e,t){var r=e,n=e,i,s;if(e.Dx==T.ClipperBase.horizontal&&(t?s=e.Prev.Bot.X:s=e.Next.Bot.X,e.Bot.X!=s&&this.ReverseHorizontal(e)),n.OutIdx!=T.ClipperBase.Skip)if(t){for(;n.Top.Y==n.Next.Bot.Y&&n.Next.OutIdx!=T.ClipperBase.Skip;)n=n.Next;if(n.Dx==T.ClipperBase.horizontal&&n.Next.OutIdx!=T.ClipperBase.Skip){for(i=n;i.Prev.Dx==T.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==T.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),e=e.Next;e.Dx==T.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!=T.ClipperBase.Skip;)n=n.Prev;if(n.Dx==T.ClipperBase.horizontal&&n.Prev.OutIdx!=T.ClipperBase.Skip){for(i=n;i.Next.Dx==T.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==T.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),e=e.Prev;e.Dx==T.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),n=n.Prev}if(n.OutIdx==T.ClipperBase.Skip){if(e=n,t){for(;e.Top.Y==e.Next.Bot.Y;)e=e.Next;for(;e!=n&&e.Dx==T.ClipperBase.horizontal;)e=e.Prev}else{for(;e.Top.Y==e.Prev.Bot.Y;)e=e.Prev;for(;e!=n&&e.Dx==T.ClipperBase.horizontal;)e=e.Next}if(e==n)t?n=e.Next:n=e.Prev;else{t?e=n.Next:e=n.Prev;var l=new T.LocalMinima;l.Next=null,l.Y=e.Bot.Y,l.LeftBound=null,l.RightBound=e,l.RightBound.WindDelta=0,n=this.ProcessBound(l.RightBound,t),this.InsertLocalMinima(l)}}return n};T.ClipperBase.prototype.AddPath=function(e,t,r){mie?!r&&t==T.PolyType.ptClip&&T.Error("AddPath: Open paths must be subject."):r||T.Error("AddPath: Open paths have been disabled.");var n=e.length-1;if(r)for(;n>0&&T.IntPoint.op_Equality(e[n],e[0]);)--n;for(;n>0&&T.IntPoint.op_Equality(e[n],e[n-1]);)--n;if(r&&n<2||!r&&n<1)return!1;for(var i=new Array,s=0;s<=n;s++)i.push(new T.TEdge);var l=!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 s=n-1;s>=1;--s)c.Value=this.m_UseFullRange,this.RangeTest(e[s],c),this.m_UseFullRange=c.Value,this.InitEdge(i[s],i[s+1],i[s-1],e[s]);for(var p=i[0],h=p,y=p;;){if(T.IntPoint.op_Equality(h.Curr,h.Next.Curr)){if(h==h.Next)break;h==p&&(p=h.Next),h=this.RemoveEdge(h),y=h;continue}if(h.Prev==h.Next)break;if(r&&T.ClipperBase.SlopesEqual(h.Prev.Curr,h.Curr,h.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(h.Prev.Curr,h.Curr,h.Next.Curr))){h==p&&(p=h.Next),h=this.RemoveEdge(h),h=h.Prev,y=h;continue}if(h=h.Next,h==y)break}if(!r&&h==h.Next||r&&h.Prev==h.Next)return!1;r||(this.m_HasOpenPaths=!0,p.Prev.OutIdx=T.ClipperBase.Skip);var b=p;h=p;do this.InitEdge2(h,t),h=h.Next,l&&h.Curr.Y!=p.Curr.Y&&(l=!1);while(h!=p);if(l){if(r)return!1;h.Prev.OutIdx=T.ClipperBase.Skip,h.Prev.Bot.X<h.Prev.Top.X&&this.ReverseHorizontal(h.Prev);var _=new T.LocalMinima;for(_.Next=null,_.Y=h.Bot.Y,_.LeftBound=null,_.RightBound=h,_.RightBound.Side=T.EdgeSide.esRight,_.RightBound.WindDelta=0;h.Next.OutIdx!=T.ClipperBase.Skip;)h.NextInLML=h.Next,h.Bot.X!=h.Prev.Top.X&&this.ReverseHorizontal(h),h=h.Next;return this.InsertLocalMinima(_),this.m_edges.push(i),!0}this.m_edges.push(i);for(var C,P=null;h=this.FindNextLocMin(h),h!=P;){P==null&&(P=h);var _=new T.LocalMinima;_.Next=null,_.Y=h.Bot.Y,h.Dx<h.Prev.Dx?(_.LeftBound=h.Prev,_.RightBound=h,C=!1):(_.LeftBound=h,_.RightBound=h.Prev,C=!0),_.LeftBound.Side=T.EdgeSide.esLeft,_.RightBound.Side=T.EdgeSide.esRight,r?_.LeftBound.Next==_.RightBound?_.LeftBound.WindDelta=-1:_.LeftBound.WindDelta=1:_.LeftBound.WindDelta=0,_.RightBound.WindDelta=-_.LeftBound.WindDelta,h=this.ProcessBound(_.LeftBound,C);var E=this.ProcessBound(_.RightBound,!C);_.LeftBound.OutIdx==T.ClipperBase.Skip?_.LeftBound=null:_.RightBound.OutIdx==T.ClipperBase.Skip&&(_.RightBound=null),this.InsertLocalMinima(_),C||(h=E)}return!0};T.ClipperBase.prototype.AddPaths=function(e,t,r){for(var n=!1,i=0,s=e.length;i<s;++i)this.AddPath(e[i],t,r)&&(n=!0);return n};T.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(e,t,r){return T.IntPoint.op_Equality(e,r)||T.IntPoint.op_Equality(e,t)||T.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};T.ClipperBase.prototype.RemoveEdge=function(e){e.Prev.Next=e.Next,e.Next.Prev=e.Prev;var t=e.Next;return e.Prev=null,t};T.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=T.ClipperBase.horizontal:e.Dx=e.Delta.X/e.Delta.Y};T.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}};T.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};T.ClipperBase.prototype.ReverseHorizontal=function(e){var t=e.Top.X;e.Top.X=e.Bot.X,e.Bot.X=t,cy&&(t=e.Top.Z,e.Top.Z=e.Bot.Z,e.Bot.Z=t)};T.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=T.EdgeSide.esLeft,t.OutIdx=T.ClipperBase.Unassigned),t=e.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=T.EdgeSide.esRight,t.OutIdx=T.ClipperBase.Unassigned),e=e.Next}};T.Clipper=function(e){typeof e>"u"&&(e=0),this.m_PolyOuts=null,this.m_ClipType=T.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=T.PolyFillType.pftEvenOdd,this.m_SubjFillType=T.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,T.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=T.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,cy&&(this.ZFillFunction=null)};T.Clipper.ioReverseSolution=1;T.Clipper.ioStrictlySimple=2;T.Clipper.ioPreserveCollinear=4;T.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),T.ClipperBase.prototype.Clear.call(this))};T.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var e=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=e}};T.Clipper.prototype.Reset=function(){T.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};T.Clipper.prototype.InsertScanbeam=function(e){if(this.m_Scanbeam===null)this.m_Scanbeam=new T.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=e;else if(e>this.m_Scanbeam.Y){var t=new T.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 T.Scanbeam;t.Y=e,t.Next=r.Next,r.Next=t}};T.Clipper.prototype.Execute=function(){var e=arguments,t=e.length,r=e[1]instanceof T.PolyTree;if(t==4&&!r){var n=e[0],i=e[1],s=e[2],l=e[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&T.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,T.Clear(i),this.m_SubjFillType=s,this.m_ClipFillType=l,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],p=e[1],s=e[2],l=e[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=s,this.m_ClipFillType=l,this.m_ClipType=n,this.m_UsingPolyTree=!0;try{var c=this.ExecuteInternal();c&&this.BuildResult2(p)}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,T.PolyFillType.pftEvenOdd,T.PolyFillType.pftEvenOdd)}else if(t==2&&r){var n=e[0],p=e[1];return this.Execute(n,p,T.PolyFillType.pftEvenOdd,T.PolyFillType.pftEvenOdd)}};T.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}};T.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var e=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(e),T.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{T.Clear(this.m_Joins),T.Clear(this.m_GhostJoins)}};T.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};T.Clipper.prototype.DisposeAllPolyPts=function(){for(var e=0,t=this.m_PolyOuts.length;e<t;++e)this.DisposeOutRec(e);T.Clear(this.m_PolyOuts)};T.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};T.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}};T.Clipper.prototype.AddJoin=function(e,t,r){var n=new T.Join;n.OutPt1=e,n.OutPt2=t,n.OffPt.X=r.X,n.OffPt.Y=r.Y,this.m_Joins.push(n)};T.Clipper.prototype.AddGhostJoin=function(e,t){var r=new T.Join;r.OutPt1=e,r.OffPt.X=t.X,r.OffPt.Y=t.Y,this.m_GhostJoins.push(r)};cy&&(T.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))});T.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&&(T.ClipperBase.IsHorizontal(r)?this.AddEdgeToSEL(r):this.InsertScanbeam(r.Top.Y)),!(t==null||r==null)){if(n!==null&&T.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var i=0,s=this.m_GhostJoins.length;i<s;i++){var l=this.m_GhostJoins[i];this.HorzSegmentsOverlap(l.OutPt1.Pt,l.OffPt,r.Bot,r.Top)&&this.AddJoin(l.OutPt1,n,l.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&T.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&&T.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 p=t.NextInAEL;if(p!==null)for(;p!=r;)this.IntersectEdges(r,p,t.Curr,!1),p=p.NextInAEL}}}};T.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}};T.Clipper.prototype.E2InsertsBeforeE1=function(e,t){return t.Curr.X==e.Curr.X?t.Top.Y>e.Top.Y?t.Top.X<T.Clipper.TopX(e,t.Top.Y):e.Top.X>T.Clipper.TopX(t,e.Top.Y):t.Curr.X<e.Curr.X};T.Clipper.prototype.IsEvenOddFillType=function(e){return e.PolyTyp==T.PolyType.ptSubject?this.m_SubjFillType==T.PolyFillType.pftEvenOdd:this.m_ClipFillType==T.PolyFillType.pftEvenOdd};T.Clipper.prototype.IsEvenOddAltFillType=function(e){return e.PolyTyp==T.PolyType.ptSubject?this.m_ClipFillType==T.PolyFillType.pftEvenOdd:this.m_SubjFillType==T.PolyFillType.pftEvenOdd};T.Clipper.prototype.IsContributing=function(e){var t,r;switch(e.PolyTyp==T.PolyType.ptSubject?(t=this.m_SubjFillType,r=this.m_ClipFillType):(t=this.m_ClipFillType,r=this.m_SubjFillType),t){case T.PolyFillType.pftEvenOdd:if(e.WindDelta===0&&e.WindCnt!=1)return!1;break;case T.PolyFillType.pftNonZero:if(Math.abs(e.WindCnt)!=1)return!1;break;case T.PolyFillType.pftPositive:if(e.WindCnt!=1)return!1;break;default:if(e.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case T.ClipType.ctIntersection:switch(r){case T.PolyFillType.pftEvenOdd:case T.PolyFillType.pftNonZero:return e.WindCnt2!==0;case T.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case T.ClipType.ctUnion:switch(r){case T.PolyFillType.pftEvenOdd:case T.PolyFillType.pftNonZero:return e.WindCnt2===0;case T.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}case T.ClipType.ctDifference:if(e.PolyTyp==T.PolyType.ptSubject)switch(r){case T.PolyFillType.pftEvenOdd:case T.PolyFillType.pftNonZero:return e.WindCnt2===0;case T.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else switch(r){case T.PolyFillType.pftEvenOdd:case T.PolyFillType.pftNonZero:return e.WindCnt2!==0;case T.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case T.ClipType.ctXor:if(e.WindDelta===0)switch(r){case T.PolyFillType.pftEvenOdd:case T.PolyFillType.pftNonZero:return e.WindCnt2===0;case T.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else return!0}return!0};T.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!=T.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};T.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)};T.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};T.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)}};T.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)}};T.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)};T.Clipper.prototype.AddLocalMinPoly=function(e,t,r){var n,i,s;if(T.ClipperBase.IsHorizontal(t)||e.Dx>t.Dx?(n=this.AddOutPt(e,r),t.OutIdx=e.OutIdx,e.Side=T.EdgeSide.esLeft,t.Side=T.EdgeSide.esRight,i=e,i.PrevInAEL==t?s=t.PrevInAEL:s=i.PrevInAEL):(n=this.AddOutPt(t,r),e.OutIdx=t.OutIdx,e.Side=T.EdgeSide.esRight,t.Side=T.EdgeSide.esLeft,i=t,i.PrevInAEL==e?s=e.PrevInAEL:s=i.PrevInAEL),s!==null&&s.OutIdx>=0&&T.Clipper.TopX(s,r.Y)==T.Clipper.TopX(i,r.Y)&&T.ClipperBase.SlopesEqual(i,s,this.m_UseFullRange)&&i.WindDelta!==0&&s.WindDelta!==0){var l=this.AddOutPt(s,r);this.AddJoin(n,l,i.Top)}return n};T.Clipper.prototype.CreateOutRec=function(){var e=new T.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};T.Clipper.prototype.AddOutPt=function(e,t){var r=e.Side==T.EdgeSide.esLeft;if(e.OutIdx<0){var n=this.CreateOutRec();n.IsOpen=e.WindDelta===0;var i=new T.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),cy&&(T.IntPoint.op_Equality(t,e.Bot)?(i.Pt.X=e.Bot.X,i.Pt.Y=e.Bot.Y,i.Pt.Z=e.Bot.Z):T.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],s=n.Pts;if(r&&T.IntPoint.op_Equality(t,s.Pt))return s;if(!r&&T.IntPoint.op_Equality(t,s.Prev.Pt))return s.Prev;var i=new T.OutPt;return i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=s,i.Prev=s.Prev,i.Prev.Next=i,s.Prev=i,r&&(n.Pts=i),cy&&(T.IntPoint.op_Equality(t,e.Bot)?(i.Pt.X=e.Bot.X,i.Pt.Y=e.Bot.Y,i.Pt.Z=e.Bot.Z):T.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}};T.Clipper.prototype.SwapPoints=function(e,t){var r=new T.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};T.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};T.Clipper.prototype.InsertPolyPtBetween=function(e,t,r){var n=new T.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};T.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)};T.Clipper.prototype.GetDx=function(e,t){return e.Y==t.Y?T.ClipperBase.horizontal:(t.X-e.X)/(t.Y-e.Y)};T.Clipper.prototype.FirstIsBottomPt=function(e,t){for(var r=e.Prev;T.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;T.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;T.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Prev;var s=Math.abs(this.GetDx(t.Pt,r.Pt));for(r=t.Next;T.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Next;var l=Math.abs(this.GetDx(t.Pt,r.Pt));return n>=s&&n>=l||i>=s&&i>=l};T.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;T.IntPoint.op_Inequality(t.Pt,e.Pt);)t=t.Next;return e};T.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};T.Clipper.prototype.Param1RightOfParam2=function(e,t){do if(e=e.FirstLeft,e==t)return!0;while(e!==null);return!1};T.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};T.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 s=r.Pts,l=s.Prev,c=n.Pts,p=c.Prev,h;e.Side==T.EdgeSide.esLeft?(t.Side==T.EdgeSide.esLeft?(this.ReversePolyPtLinks(c),c.Next=s,s.Prev=c,l.Next=p,p.Prev=l,r.Pts=p):(p.Next=s,s.Prev=p,c.Prev=l,l.Next=c,r.Pts=c),h=T.EdgeSide.esLeft):(t.Side==T.EdgeSide.esRight?(this.ReversePolyPtLinks(c),l.Next=p,p.Prev=l,c.Next=s,s.Prev=c):(l.Next=c,c.Prev=l,s.Prev=p,p.Next=s),h=T.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 y=e.OutIdx,b=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var _=this.m_ActiveEdges;_!==null;){if(_.OutIdx==b){_.OutIdx=y,_.Side=h;break}_=_.NextInAEL}n.Idx=r.Idx};T.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)}};T.Clipper.SwapSides=function(e,t){var r=e.Side;e.Side=t.Side,t.Side=r};T.Clipper.SwapPolyIndexes=function(e,t){var r=e.OutIdx;e.OutIdx=t.OutIdx,t.OutIdx=r};T.Clipper.prototype.IntersectEdges=function(e,t,r,n){var i=!n&&e.NextInLML===null&&e.Top.X==r.X&&e.Top.Y==r.Y,s=!n&&t.NextInLML===null&&t.Top.X==r.X&&t.Top.Y==r.Y,l=e.OutIdx>=0,c=t.OutIdx>=0;if(mie&&(e.WindDelta===0||t.WindDelta===0)){e.WindDelta===0&&t.WindDelta===0?(i||s)&&l&&c&&this.AddLocalMaxPoly(e,t,r):e.PolyTyp==t.PolyTyp&&e.WindDelta!=t.WindDelta&&this.m_ClipType==T.ClipType.ctUnion?e.WindDelta===0?c&&(this.AddOutPt(e,r),l&&(e.OutIdx=-1)):l&&(this.AddOutPt(t,r),c&&(t.OutIdx=-1)):e.PolyTyp!=t.PolyTyp&&(e.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=T.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(e,r),l&&(e.OutIdx=-1)):t.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=T.ClipType.ctUnion||e.WindCnt2===0)&&(this.AddOutPt(t,r),c&&(t.OutIdx=-1))),i&&(e.OutIdx<0?this.DeleteFromAEL(e):T.Error("Error intersecting polylines")),s&&(t.OutIdx<0?this.DeleteFromAEL(t):T.Error("Error intersecting polylines"));return}if(e.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(e)){var p=e.WindCnt;e.WindCnt=t.WindCnt,t.WindCnt=p}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 h,y,b,_;e.PolyTyp==T.PolyType.ptSubject?(h=this.m_SubjFillType,b=this.m_ClipFillType):(h=this.m_ClipFillType,b=this.m_SubjFillType),t.PolyTyp==T.PolyType.ptSubject?(y=this.m_SubjFillType,_=this.m_ClipFillType):(y=this.m_ClipFillType,_=this.m_SubjFillType);var C,P;switch(h){case T.PolyFillType.pftPositive:C=e.WindCnt;break;case T.PolyFillType.pftNegative:C=-e.WindCnt;break;default:C=Math.abs(e.WindCnt);break}switch(y){case T.PolyFillType.pftPositive:P=t.WindCnt;break;case T.PolyFillType.pftNegative:P=-t.WindCnt;break;default:P=Math.abs(t.WindCnt);break}if(l&&c)i||s||C!==0&&C!=1||P!==0&&P!=1||e.PolyTyp!=t.PolyTyp&&this.m_ClipType!=T.ClipType.ctXor?this.AddLocalMaxPoly(e,t,r):(this.AddOutPt(e,r),this.AddOutPt(t,r),T.Clipper.SwapSides(e,t),T.Clipper.SwapPolyIndexes(e,t));else if(l)(P===0||P==1)&&(this.AddOutPt(e,r),T.Clipper.SwapSides(e,t),T.Clipper.SwapPolyIndexes(e,t));else if(c)(C===0||C==1)&&(this.AddOutPt(t,r),T.Clipper.SwapSides(e,t),T.Clipper.SwapPolyIndexes(e,t));else if((C===0||C==1)&&(P===0||P==1)&&!i&&!s){var E,w;switch(b){case T.PolyFillType.pftPositive:E=e.WindCnt2;break;case T.PolyFillType.pftNegative:E=-e.WindCnt2;break;default:E=Math.abs(e.WindCnt2);break}switch(_){case T.PolyFillType.pftPositive:w=t.WindCnt2;break;case T.PolyFillType.pftNegative:w=-t.WindCnt2;break;default:w=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(C==1&&P==1)switch(this.m_ClipType){case T.ClipType.ctIntersection:E>0&&w>0&&this.AddLocalMinPoly(e,t,r);break;case T.ClipType.ctUnion:E<=0&&w<=0&&this.AddLocalMinPoly(e,t,r);break;case T.ClipType.ctDifference:(e.PolyTyp==T.PolyType.ptClip&&E>0&&w>0||e.PolyTyp==T.PolyType.ptSubject&&E<=0&&w<=0)&&this.AddLocalMinPoly(e,t,r);break;case T.ClipType.ctXor:this.AddLocalMinPoly(e,t,r);break}else T.Clipper.SwapSides(e,t)}i!=s&&(i&&e.OutIdx>=0||s&&t.OutIdx>=0)&&(T.Clipper.SwapSides(e,t),T.Clipper.SwapPolyIndexes(e,t)),i&&this.DeleteFromAEL(e),s&&this.DeleteFromAEL(t)};T.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)};T.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)};T.Clipper.prototype.UpdateEdgeIntoAEL=function(e){e.NextInLML===null&&T.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,T.ClipperBase.IsHorizontal(e)||this.InsertScanbeam(e.Top.Y),e};T.Clipper.prototype.ProcessHorizontals=function(e){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,e),t=this.m_SortedEdges};T.Clipper.prototype.GetHorzDirection=function(e,t){e.Bot.X<e.Top.X?(t.Left=e.Bot.X,t.Right=e.Top.X,t.Dir=T.Direction.dLeftToRight):(t.Left=e.Top.X,t.Right=e.Bot.X,t.Dir=T.Direction.dRightToLeft)};T.Clipper.prototype.PrepareHorzJoins=function(e,t){var r=this.m_PolyOuts[e.OutIdx].Pts;e.Side!=T.EdgeSide.esLeft&&(r=r.Prev),t&&(T.IntPoint.op_Equality(r.Pt,e.Top)?this.AddGhostJoin(r,e.Bot):this.AddGhostJoin(r,e.Top))};T.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,s=r.Right,l=e,c=null;l.NextInLML!==null&&T.ClipperBase.IsHorizontal(l.NextInLML);)l=l.NextInLML;for(l.NextInLML===null&&(c=this.GetMaximaPair(l));;){for(var p=e==l,h=this.GetNextInAEL(e,n);h!==null&&!(h.Curr.X==e.Top.X&&e.NextInLML!==null&&h.Dx<e.NextInLML.Dx);){var y=this.GetNextInAEL(h,n);if(n==T.Direction.dLeftToRight&&h.Curr.X<=s||n==T.Direction.dRightToLeft&&h.Curr.X>=i){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),h==c&&p){n==T.Direction.dLeftToRight?this.IntersectEdges(e,h,h.Top,!1):this.IntersectEdges(h,e,h.Top,!1),c.OutIdx>=0&&T.Error("ProcessHorizontal error");return}else if(n==T.Direction.dLeftToRight){var b=new T.IntPoint(h.Curr.X,e.Curr.Y);this.IntersectEdges(e,h,b,!0)}else{var b=new T.IntPoint(h.Curr.X,e.Curr.Y);this.IntersectEdges(h,e,b,!0)}this.SwapPositionsInAEL(e,h)}else if(n==T.Direction.dLeftToRight&&h.Curr.X>=s||n==T.Direction.dRightToLeft&&h.Curr.X<=i)break;h=y}if(e.OutIdx>=0&&e.WindDelta!==0&&this.PrepareHorzJoins(e,t),e.NextInLML!==null&&T.ClipperBase.IsHorizontal(e.NextInLML)){e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot);var r={Dir:n,Left:i,Right:s};this.GetHorzDirection(e,r),n=r.Dir,i=r.Left,s=r.Right}else break}if(e.NextInLML!==null)if(e.OutIdx>=0){var _=this.AddOutPt(e,e.Top);if(e=this.UpdateEdgeIntoAEL(e),e.WindDelta===0)return;var C=e.PrevInAEL,y=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&&T.ClipperBase.SlopesEqual(e,C,this.m_UseFullRange)){var P=this.AddOutPt(C,e.Bot);this.AddJoin(_,P,e.Top)}else if(y!==null&&y.Curr.X==e.Bot.X&&y.Curr.Y==e.Bot.Y&&y.WindDelta!==0&&y.OutIdx>=0&&y.Curr.Y>y.Top.Y&&T.ClipperBase.SlopesEqual(e,y,this.m_UseFullRange)){var P=this.AddOutPt(y,e.Bot);this.AddJoin(_,P,e.Top)}}else e=this.UpdateEdgeIntoAEL(e);else c!==null?c.OutIdx>=0?(n==T.Direction.dLeftToRight?this.IntersectEdges(e,c,e.Top,!1):this.IntersectEdges(c,e,e.Top,!1),c.OutIdx>=0&&T.Error("ProcessHorizontal error")):(this.DeleteFromAEL(e),this.DeleteFromAEL(c)):(e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e))};T.Clipper.prototype.GetNextInAEL=function(e,t){return t==T.Direction.dLeftToRight?e.NextInAEL:e.PrevInAEL};T.Clipper.prototype.IsMinima=function(e){return e!==null&&e.Prev.NextInLML!=e&&e.Next.NextInLML!=e};T.Clipper.prototype.IsMaxima=function(e,t){return e!==null&&e.Top.Y==t&&e.NextInLML===null};T.Clipper.prototype.IsIntermediate=function(e,t){return e.Top.Y==t&&e.NextInLML!==null};T.Clipper.prototype.GetMaximaPair=function(e){var t=null;return T.IntPoint.op_Equality(e.Next.Top,e.Top)&&e.Next.NextInLML===null?t=e.Next:T.IntPoint.op_Equality(e.Prev.Top,e.Top)&&e.Prev.NextInLML===null&&(t=e.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!T.ClipperBase.IsHorizontal(t))?null:t};T.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,T.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};T.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=T.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,s=new T.IntPoint;if(r.Curr.X>i.Curr.X){!this.IntersectPoint(r,i,s)&&r.Curr.X>i.Curr.X+1&&T.Error("Intersection error"),s.Y>e&&(s.Y=e,Math.abs(r.Dx)>Math.abs(i.Dx)?s.X=T.Clipper.TopX(i,e):s.X=T.Clipper.TopX(r,e));var l=new T.IntersectNode;l.Edge1=r,l.Edge2=i,l.Pt.X=s.X,l.Pt.Y=s.Y,this.m_IntersectList.push(l),this.SwapPositionsInSEL(r,i),n=!0}else r=i}if(r.PrevInSEL!==null)r.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};T.Clipper.prototype.EdgesAdjacent=function(e){return e.Edge1.NextInSEL==e.Edge2||e.Edge1.PrevInSEL==e.Edge2};T.Clipper.IntersectNodeSort=function(e,t){return t.Pt.Y-e.Pt.Y};T.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};T.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 oLe=o(function(e){return e<0?Math.ceil(e-.5):Math.round(e)},"R1"),sLe=o(function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},"R2"),aLe=o(function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},"R3"),lLe=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");qr.msie?T.Clipper.Round=oLe:qr.chromium?T.Clipper.Round=aLe:qr.safari?T.Clipper.Round=lLe:T.Clipper.Round=sLe;T.Clipper.TopX=function(e,t){return t==e.Top.Y?e.Top.X:e.Bot.X+T.Clipper.Round(e.Dx*(t-e.Bot.Y))};T.Clipper.prototype.IntersectPoint=function(e,t,r){r.X=0,r.Y=0;var n,i;if(T.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,T.ClipperBase.IsHorizontal(t)?r.Y=t.Bot.Y:(i=t.Bot.Y-t.Bot.X/t.Dx,r.Y=T.Clipper.Round(r.X/t.Dx+i));else if(t.Delta.X===0)r.X=t.Bot.X,T.ClipperBase.IsHorizontal(e)?r.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,r.Y=T.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 s=(i-n)/(e.Dx-t.Dx);r.Y=T.Clipper.Round(s),Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=T.Clipper.Round(e.Dx*s+n):r.X=T.Clipper.Round(t.Dx*s+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=T.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=T.Clipper.TopX(e,r.Y):r.X=T.Clipper.TopX(t,r.Y)}return!0};T.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||!T.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)&&T.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=T.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 s=this.AddOutPt(i,t.Curr),l=this.AddOutPt(t,t.Curr);this.AddJoin(s,l,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,e)){var s=null;t.OutIdx>=0&&(s=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&&s!==null&&i.OutIdx>=0&&i.Curr.Y>i.Top.Y&&T.ClipperBase.SlopesEqual(t,i,this.m_UseFullRange)&&t.WindDelta!==0&&i.WindDelta!==0){var l=this.AddOutPt(i,t.Bot);this.AddJoin(s,l,t.Top)}else if(c!==null&&c.Curr.X==t.Bot.X&&c.Curr.Y==t.Bot.Y&&s!==null&&c.OutIdx>=0&&c.Curr.Y>c.Top.Y&&T.ClipperBase.SlopesEqual(t,c,this.m_UseFullRange)&&t.WindDelta!==0&&c.WindDelta!==0){var l=this.AddOutPt(c,t.Bot);this.AddJoin(s,l,t.Top)}}t=t.NextInAEL}};T.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)):T.Error("DoMaxima error")};T.Clipper.ReversePaths=function(e){for(var t=0,r=e.length;t<r;t++)e[t].reverse()};T.Clipper.Orientation=function(e){return T.Clipper.Area(e)>=0};T.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};T.Clipper.prototype.BuildResult=function(e){T.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,s=this.PointCount(i);if(!(s<2)){for(var l=new Array(s),c=0;c<s;c++)l[c]=i.Pt,i=i.Prev;e.push(l)}}}};T.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 s=new T.PolyNode;e.m_AllPolys.push(s),n.PolyNode=s,s.m_polygon.length=i;for(var l=n.Pts.Prev,c=0;c<i;c++)s.m_polygon[c]=l.Pt,l=l.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))}};T.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(T.IntPoint.op_Equality(r.Pt,r.Next.Pt)||T.IntPoint.op_Equality(r.Pt,r.Prev.Pt)||T.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};T.Clipper.prototype.DupOutPt=function(e,t){var r=new T.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};T.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};T.Clipper.prototype.JoinHorz=function(e,t,r,n,i,s){var l=e.Pt.X>t.Pt.X?T.Direction.dRightToLeft:T.Direction.dLeftToRight,c=r.Pt.X>n.Pt.X?T.Direction.dRightToLeft:T.Direction.dLeftToRight;if(l==c)return!1;if(l==T.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;s&&e.Pt.X!=i.X&&(e=e.Next),t=this.DupOutPt(e,!s),T.IntPoint.op_Inequality(t.Pt,i)&&(e=t,e.Pt.X=i.X,e.Pt.Y=i.Y,t=this.DupOutPt(e,!s))}else{for(;e.Next.Pt.X>=i.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;!s&&e.Pt.X!=i.X&&(e=e.Next),t=this.DupOutPt(e,s),T.IntPoint.op_Inequality(t.Pt,i)&&(e=t,e.Pt.X=i.X,e.Pt.Y=i.Y,t=this.DupOutPt(e,s))}if(c==T.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;s&&r.Pt.X!=i.X&&(r=r.Next),n=this.DupOutPt(r,!s),T.IntPoint.op_Inequality(n.Pt,i)&&(r=n,r.Pt.X=i.X,r.Pt.Y=i.Y,n=this.DupOutPt(r,!s))}else{for(;r.Next.Pt.X>=i.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==i.Y;)r=r.Next;!s&&r.Pt.X!=i.X&&(r=r.Next),n=this.DupOutPt(r,s),T.IntPoint.op_Inequality(n.Pt,i)&&(r=n,r.Pt.X=i.X,r.Pt.Y=i.Y,n=this.DupOutPt(r,s))}return l==T.Direction.dLeftToRight==s?(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};T.Clipper.prototype.JoinPoints=function(e,t,r){var n=e.OutPt1,i=new T.OutPt,s=e.OutPt2,l=new T.OutPt,c=e.OutPt1.Pt.Y==e.OffPt.Y;if(c&&T.IntPoint.op_Equality(e.OffPt,e.OutPt1.Pt)&&T.IntPoint.op_Equality(e.OffPt,e.OutPt2.Pt)){for(i=e.OutPt1.Next;i!=n&&T.IntPoint.op_Equality(i.Pt,e.OffPt);)i=i.Next;var p=i.Pt.Y>e.OffPt.Y;for(l=e.OutPt2.Next;l!=s&&T.IntPoint.op_Equality(l.Pt,e.OffPt);)l=l.Next;var h=l.Pt.Y>e.OffPt.Y;return p==h?!1:p?(i=this.DupOutPt(n,!1),l=this.DupOutPt(s,!0),n.Prev=s,s.Next=n,i.Next=l,l.Prev=i,e.OutPt1=n,e.OutPt2=i,!0):(i=this.DupOutPt(n,!0),l=this.DupOutPt(s,!1),n.Next=s,s.Prev=n,i.Prev=l,l.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!=s;)n=n.Prev;for(;i.Next.Pt.Y==i.Pt.Y&&i.Next!=n&&i.Next!=s;)i=i.Next;if(i.Next==n||i.Next==s)return!1;for(l=s;s.Prev.Pt.Y==s.Pt.Y&&s.Prev!=l&&s.Prev!=i;)s=s.Prev;for(;l.Next.Pt.Y==l.Pt.Y&&l.Next!=s&&l.Next!=n;)l=l.Next;if(l.Next==s||l.Next==n)return!1;var y={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,i.Pt.X,s.Pt.X,l.Pt.X,y))return!1;var b=y.Left,_=y.Right,C=new T.IntPoint,P;return n.Pt.X>=b&&n.Pt.X<=_?(C.X=n.Pt.X,C.Y=n.Pt.Y,P=n.Pt.X>i.Pt.X):s.Pt.X>=b&&s.Pt.X<=_?(C.X=s.Pt.X,C.Y=s.Pt.Y,P=s.Pt.X>l.Pt.X):i.Pt.X>=b&&i.Pt.X<=_?(C.X=i.Pt.X,C.Y=i.Pt.Y,P=i.Pt.X>n.Pt.X):(C.X=l.Pt.X,C.Y=l.Pt.Y,P=l.Pt.X>s.Pt.X),e.OutPt1=n,e.OutPt2=s,this.JoinHorz(n,i,s,l,C,P)}else{for(i=n.Next;T.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Next;var E=i.Pt.Y>n.Pt.Y||!T.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange);if(E){for(i=n.Prev;T.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Prev;if(i.Pt.Y>n.Pt.Y||!T.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange))return!1}for(l=s.Next;T.IntPoint.op_Equality(l.Pt,s.Pt)&&l!=s;)l=l.Next;var w=l.Pt.Y>s.Pt.Y||!T.ClipperBase.SlopesEqual(s.Pt,l.Pt,e.OffPt,this.m_UseFullRange);if(w){for(l=s.Prev;T.IntPoint.op_Equality(l.Pt,s.Pt)&&l!=s;)l=l.Prev;if(l.Pt.Y>s.Pt.Y||!T.ClipperBase.SlopesEqual(s.Pt,l.Pt,e.OffPt,this.m_UseFullRange))return!1}return i==n||l==s||i==l||t==r&&E==w?!1:E?(i=this.DupOutPt(n,!1),l=this.DupOutPt(s,!0),n.Prev=s,s.Next=n,i.Next=l,l.Prev=i,e.OutPt1=n,e.OutPt2=i,!0):(i=this.DupOutPt(n,!0),l=this.DupOutPt(s,!1),n.Next=s,s.Prev=n,i.Prev=l,l.Next=i,e.OutPt1=n,e.OutPt2=i,!0)}};T.Clipper.GetBounds=function(e){for(var t=0,r=e.length;t<r&&e[t].length==0;)t++;if(t==r)return new T.IntRect(0,0,0,0);var n=new T.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,s=e[t].length;i<s;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};T.Clipper.prototype.GetBounds2=function(e){var t=e,r=new T.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};T.Clipper.PointInPolygon=function(e,t){var r=0,n=t.length;if(n<3)return 0;for(var i=t[0],s=1;s<=n;++s){var l=s==n?t[0]:t[s];if(l.Y==e.Y&&(l.X==e.X||i.Y==e.Y&&l.X>e.X==i.X<e.X))return-1;if(i.Y<e.Y!=l.Y<e.Y){if(i.X>=e.X)if(l.X>e.X)r=1-r;else{var c=(i.X-e.X)*(l.Y-e.Y)-(l.X-e.X)*(i.Y-e.Y);if(c==0)return-1;c>0==l.Y>i.Y&&(r=1-r)}else if(l.X>e.X){var c=(i.X-e.X)*(l.Y-e.Y)-(l.X-e.X)*(i.Y-e.Y);if(c==0)return-1;c>0==l.Y>i.Y&&(r=1-r)}}i=l}return r};T.Clipper.prototype.PointInPolygon=function(e,t){for(var r=0,n=t;;){var i=t.Pt.X,s=t.Pt.Y,l=t.Next.Pt.X,c=t.Next.Pt.Y;if(c==e.Y&&(l==e.X||s==e.Y&&l>e.X==i<e.X))return-1;if(s<e.Y!=c<e.Y){if(i>=e.X)if(l>e.X)r=1-r;else{var p=(i-e.X)*(c-e.Y)-(l-e.X)*(s-e.Y);if(p==0)return-1;p>0==c>s&&(r=1-r)}else if(l>e.X){var p=(i-e.X)*(c-e.Y)-(l-e.X)*(s-e.Y);if(p==0)return-1;p>0==c>s&&(r=1-r)}}if(t=t.Next,n==t)break}return r};T.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};T.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)}};T.Clipper.prototype.FixupFirstLefts2=function(e,t){for(var r=0,n=this.m_PolyOuts,i=n.length,s=n[r];r<i;r++,s=n[r])s.FirstLeft==e&&(s.FirstLeft=t)};T.Clipper.ParseFirstLeft=function(e){for(;e!=null&&e.Pts==null;)e=e.FirstLeft;return e};T.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 s;if(n==i?s=n:this.Param1RightOfParam2(n,i)?s=i:this.Param1RightOfParam2(i,n)?s=n:s=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 l=0,c=this.m_PolyOuts.length;l<c-1;l++){var p=this.m_PolyOuts[l];p.Pts==null||T.Clipper.ParseFirstLeft(p.FirstLeft)!=n||p.IsHole==n.IsHole||this.Poly2ContainsPoly1(p.Pts,r.OutPt2)&&(p.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=s.IsHole,s==i&&(n.FirstLeft=i.FirstLeft),i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n)}}};T.Clipper.prototype.UpdateOutPtIdxs=function(e){var t=e.Pts;do t.Idx=e.Idx,t=t.Prev;while(t!=e.Pts)};T.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(T.IntPoint.op_Equality(r.Pt,n.Pt)&&n.Next!=r&&n.Prev!=r){var i=r.Prev,s=n.Prev;r.Prev=s,s.Next=r,n.Prev=i,i.Next=n,t.Pts=r;var l=this.CreateOutRec();l.Pts=n,this.UpdateOutPtIdxs(l),this.Poly2ContainsPoly1(l.Pts,t.Pts)?(l.IsHole=!t.IsHole,l.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,l.Pts)?(l.IsHole=t.IsHole,t.IsHole=!l.IsHole,l.FirstLeft=t.FirstLeft,t.FirstLeft=l):(l.IsHole=t.IsHole,l.FirstLeft=t.FirstLeft),n=r}n=n.Next}r=r.Next}while(r!=t.Pts)}};T.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};T.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};gie&&(T.Clipper.OffsetPaths=function(e,t,r,n,i){var s=new T.Paths,l=new T.ClipperOffset(i,i);return l.AddPaths(e,r,n),l.Execute(s,t),s});T.Clipper.SimplifyPolygon=function(e,t){var r=new Array,n=new T.Clipper(0);return n.StrictlySimple=!0,n.AddPath(e,T.PolyType.ptSubject,!0),n.Execute(T.ClipType.ctUnion,r,t,t),r};T.Clipper.SimplifyPolygons=function(e,t){typeof t>"u"&&(t=T.PolyFillType.pftEvenOdd);var r=new Array,n=new T.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(e,T.PolyType.ptSubject,!0),n.Execute(T.ClipType.ctUnion,r,t,t),r};T.Clipper.DistanceSqrd=function(e,t){var r=e.X-t.X,n=e.Y-t.Y;return r*r+n*n};T.Clipper.DistanceFromLineSqrd=function(e,t,r){var n=t.Y-r.Y,i=r.X-t.X,s=n*t.X+i*t.Y;return s=n*e.X+i*e.Y-s,s*s/(n*n+i*i)};T.Clipper.SlopesNearCollinear=function(e,t,r,n){return T.Clipper.DistanceFromLineSqrd(t,e,r)<n};T.Clipper.PointsAreClose=function(e,t,r){var n=e.X-t.X,i=e.Y-t.Y;return n*n+i*i<=r};T.Clipper.ExcludeOp=function(e){var t=e.Prev;return t.Next=e.Next,e.Next.Prev=t,t.Idx=0,t};T.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 T.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 s=t*t,l=n[0];l.Idx==0&&l.Next!=l.Prev;)T.Clipper.PointsAreClose(l.Pt,l.Prev.Pt,s)?(l=T.Clipper.ExcludeOp(l),r--):T.Clipper.PointsAreClose(l.Prev.Pt,l.Next.Pt,s)?(T.Clipper.ExcludeOp(l.Next),l=T.Clipper.ExcludeOp(l),r-=2):T.Clipper.SlopesNearCollinear(l.Prev.Pt,l.Pt,l.Next.Pt,s)?(l=T.Clipper.ExcludeOp(l),r--):(l.Idx=1,l=l.Next);r<3&&(r=0);for(var c=new Array(r),i=0;i<r;++i)c[i]=new T.IntPoint(l.Pt),l=l.Next;return n=null,c};T.Clipper.CleanPolygons=function(e,t){for(var r=new Array(e.length),n=0,i=e.length;n<i;n++)r[n]=T.Clipper.CleanPolygon(e[n],t);return r};T.Clipper.Minkowski=function(e,t,r,n){var i=n?1:0,s=e.length,l=t.length,c=new Array;if(r)for(var p=0;p<l;p++){for(var h=new Array(s),y=0,b=e.length,_=e[y];y<b;y++,_=e[y])h[y]=new T.IntPoint(t[p].X+_.X,t[p].Y+_.Y);c.push(h)}else for(var p=0;p<l;p++){for(var h=new Array(s),y=0,b=e.length,_=e[y];y<b;y++,_=e[y])h[y]=new T.IntPoint(t[p].X-_.X,t[p].Y-_.Y);c.push(h)}for(var C=new Array,p=0;p<l-1+i;p++)for(var y=0;y<s;y++){var P=new Array;P.push(c[p%l][y%s]),P.push(c[(p+1)%l][y%s]),P.push(c[(p+1)%l][(y+1)%s]),P.push(c[p%l][(y+1)%s]),T.Clipper.Orientation(P)||P.reverse(),C.push(P)}var E=new T.Clipper(0);return E.AddPaths(C,T.PolyType.ptSubject,!0),E.Execute(T.ClipType.ctUnion,c,T.PolyFillType.pftNonZero,T.PolyFillType.pftNonZero),c};T.Clipper.MinkowskiSum=function(){var e=arguments,t=e.length;if(t==3){var r=e[0],n=e[1],i=e[2];return T.Clipper.Minkowski(r,n,!0,i)}else if(t==4){for(var r=e[0],s=e[1],l=e[2],i=e[3],c=new T.Clipper,p,h=0,y=s.length;h<y;++h){var p=T.Clipper.Minkowski(r,s[h],!0,i);c.AddPaths(p,T.PolyType.ptSubject,!0)}i&&c.AddPaths(s,T.PolyType.ptClip,!0);var b=new T.Paths;return c.Execute(T.ClipType.ctUnion,b,l,l),b}};T.Clipper.MinkowskiDiff=function(e,t,r){return T.Clipper.Minkowski(e,t,!1,r)};T.Clipper.PolyTreeToPaths=function(e){var t=new Array;return T.Clipper.AddPolyNodeToPaths(e,T.Clipper.NodeType.ntAny,t),t};T.Clipper.AddPolyNodeToPaths=function(e,t,r){var n=!0;switch(t){case T.Clipper.NodeType.ntOpen:return;case T.Clipper.NodeType.ntClosed:n=!e.IsOpen;break;default:break}e.m_polygon.length>0&&n&&r.push(e.m_polygon);for(var i=0,s=e.Childs(),l=s.length,c=s[i];i<l;i++,c=s[i])T.Clipper.AddPolyNodeToPaths(c,t,r)};T.Clipper.OpenPathsFromPolyTree=function(e){for(var t=new T.Paths,r=0,n=e.ChildCount();r<n;r++)e.Childs()[r].IsOpen&&t.push(e.Childs()[r].m_polygon);return t};T.Clipper.ClosedPathsFromPolyTree=function(e){var t=new T.Paths;return T.Clipper.AddPolyNodeToPaths(e,T.Clipper.NodeType.ntClosed,t),t};q3(T.Clipper,T.ClipperBase);T.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};T.ClipperOffset=function(e,t){typeof e>"u"&&(e=2),typeof t>"u"&&(t=T.ClipperOffset.def_arc_tolerance),this.m_destPolys=new T.Paths,this.m_srcPoly=new T.Path,this.m_destPoly=new T.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 T.IntPoint,this.m_polyNodes=new T.PolyNode,this.MiterLimit=e,this.ArcTolerance=t,this.m_lowest.X=-1};T.ClipperOffset.two_pi=6.28318530717959;T.ClipperOffset.def_arc_tolerance=.25;T.ClipperOffset.prototype.Clear=function(){T.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};T.ClipperOffset.Round=T.Clipper.Round;T.ClipperOffset.prototype.AddPath=function(e,t,r){var n=e.length-1;if(!(n<0)){var i=new T.PolyNode;if(i.m_jointype=t,i.m_endtype=r,r==T.EndType.etClosedLine||r==T.EndType.etClosedPolygon)for(;n>0&&T.IntPoint.op_Equality(e[0],e[n]);)n--;i.m_polygon.push(e[0]);for(var s=0,l=0,c=1;c<=n;c++)T.IntPoint.op_Inequality(i.m_polygon[s],e[c])&&(s++,i.m_polygon.push(e[c]),(e[c].Y>i.m_polygon[l].Y||e[c].Y==i.m_polygon[l].Y&&e[c].X<i.m_polygon[l].X)&&(l=s));if(!(r==T.EndType.etClosedPolygon&&s<2||r!=T.EndType.etClosedPolygon&&s<0)&&(this.m_polyNodes.AddChild(i),r==T.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new T.IntPoint(0,l);else{var p=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(i.m_polygon[l].Y>p.Y||i.m_polygon[l].Y==p.Y&&i.m_polygon[l].X<p.X)&&(this.m_lowest=new T.IntPoint(this.m_polyNodes.ChildCount()-1,l))}}};T.ClipperOffset.prototype.AddPaths=function(e,t,r){for(var n=0,i=e.length;n<i;n++)this.AddPath(e[n],t,r)};T.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!T.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==T.EndType.etClosedPolygon||t.m_endtype==T.EndType.etClosedLine&&T.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==T.EndType.etClosedLine&&!T.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};T.ClipperOffset.GetUnitNormal=function(e,t){var r=t.X-e.X,n=t.Y-e.Y;if(r==0&&n==0)return new T.DoublePoint(0,0);var i=1/Math.sqrt(r*r+n*n);return r*=i,n*=i,new T.DoublePoint(n,-r)};T.ClipperOffset.prototype.DoOffset=function(e){if(this.m_destPolys=new Array,this.m_delta=e,T.ClipperBase.near_zero(e)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];r.m_endtype==T.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=T.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(e)*T.ClipperOffset.def_arc_tolerance?n=Math.abs(e)*T.ClipperOffset.def_arc_tolerance:n=this.ArcTolerance;var i=3.14159265358979/Math.acos(1-n/Math.abs(e));this.m_sin=Math.sin(T.ClipperOffset.two_pi/i),this.m_cos=Math.cos(T.ClipperOffset.two_pi/i),this.m_StepsPerRad=i/T.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 s=this.m_srcPoly.length;if(!(s==0||e<=0&&(s<3||r.m_endtype!=T.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,s==1){if(r.m_jointype==T.JoinType.jtRound)for(var l=1,c=0,p=1;p<=i;p++){this.m_destPoly.push(new T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[0].X+l*e),T.ClipperOffset.Round(this.m_srcPoly[0].Y+c*e)));var h=l;l=l*this.m_cos-this.m_sin*c,c=h*this.m_sin+c*this.m_cos}else for(var l=-1,c=-1,p=0;p<4;++p)this.m_destPoly.push(new T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[0].X+l*e),T.ClipperOffset.Round(this.m_srcPoly[0].Y+c*e))),l<0?l=1:c<0?c=1:l=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var p=0;p<s-1;p++)this.m_normals.push(T.ClipperOffset.GetUnitNormal(this.m_srcPoly[p],this.m_srcPoly[p+1]));if(r.m_endtype==T.EndType.etClosedLine||r.m_endtype==T.EndType.etClosedPolygon?this.m_normals.push(T.ClipperOffset.GetUnitNormal(this.m_srcPoly[s-1],this.m_srcPoly[0])):this.m_normals.push(new T.DoublePoint(this.m_normals[s-2])),r.m_endtype==T.EndType.etClosedPolygon){for(var y=s-1,p=0;p<s;p++)y=this.OffsetPoint(p,y,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==T.EndType.etClosedLine){for(var y=s-1,p=0;p<s;p++)y=this.OffsetPoint(p,y,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var b=this.m_normals[s-1],p=s-1;p>0;p--)this.m_normals[p]=new T.DoublePoint(-this.m_normals[p-1].X,-this.m_normals[p-1].Y);this.m_normals[0]=new T.DoublePoint(-b.X,-b.Y),y=0;for(var p=s-1;p>=0;p--)y=this.OffsetPoint(p,y,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var y=0,p=1;p<s-1;++p)y=this.OffsetPoint(p,y,r.m_jointype);var _;if(r.m_endtype==T.EndType.etOpenButt){var p=s-1;_=new T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[p].X+this.m_normals[p].X*e),T.ClipperOffset.Round(this.m_srcPoly[p].Y+this.m_normals[p].Y*e)),this.m_destPoly.push(_),_=new T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[p].X-this.m_normals[p].X*e),T.ClipperOffset.Round(this.m_srcPoly[p].Y-this.m_normals[p].Y*e)),this.m_destPoly.push(_)}else{var p=s-1;y=s-2,this.m_sinA=0,this.m_normals[p]=new T.DoublePoint(-this.m_normals[p].X,-this.m_normals[p].Y),r.m_endtype==T.EndType.etOpenSquare?this.DoSquare(p,y):this.DoRound(p,y)}for(var p=s-1;p>0;p--)this.m_normals[p]=new T.DoublePoint(-this.m_normals[p-1].X,-this.m_normals[p-1].Y);this.m_normals[0]=new T.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),y=s-1;for(var p=y-1;p>0;--p)y=this.OffsetPoint(p,y,r.m_jointype);r.m_endtype==T.EndType.etOpenButt?(_=new T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*e),T.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*e)),this.m_destPoly.push(_),_=new T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*e),T.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*e)),this.m_destPoly.push(_)):(y=1,this.m_sinA=0,r.m_endtype==T.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};T.ClipperOffset.prototype.Execute=function(){var e=arguments,t=e[0]instanceof T.PolyTree;if(t){var r=e[0],n=e[1];r.Clear(),this.FixOrientations(),this.DoOffset(n);var i=new T.Clipper(0);if(i.AddPaths(this.m_destPolys,T.PolyType.ptSubject,!0),n>0)i.Execute(T.ClipType.ctUnion,r,T.PolyFillType.pftPositive,T.PolyFillType.pftPositive);else{var s=T.Clipper.GetBounds(this.m_destPolys),l=new T.Path;if(l.push(new T.IntPoint(s.left-10,s.bottom+10)),l.push(new T.IntPoint(s.right+10,s.bottom+10)),l.push(new T.IntPoint(s.right+10,s.top-10)),l.push(new T.IntPoint(s.left-10,s.top-10)),i.AddPath(l,T.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(T.ClipType.ctUnion,r,T.PolyFillType.pftNegative,T.PolyFillType.pftNegative),r.ChildCount()==1&&r.Childs()[0].ChildCount()>0){var c=r.Childs()[0];r.Childs()[0]=c.Childs()[0];for(var p=1;p<c.ChildCount();p++)r.AddChild(c.Childs()[p])}else r.Clear()}}else{var r=e[0],n=e[1];T.Clear(r),this.FixOrientations(),this.DoOffset(n);var i=new T.Clipper(0);if(i.AddPaths(this.m_destPolys,T.PolyType.ptSubject,!0),n>0)i.Execute(T.ClipType.ctUnion,r,T.PolyFillType.pftPositive,T.PolyFillType.pftPositive);else{var s=T.Clipper.GetBounds(this.m_destPolys),l=new T.Path;l.push(new T.IntPoint(s.left-10,s.bottom+10)),l.push(new T.IntPoint(s.right+10,s.bottom+10)),l.push(new T.IntPoint(s.right+10,s.top-10)),l.push(new T.IntPoint(s.left-10,s.top-10)),i.AddPath(l,T.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(T.ClipType.ctUnion,r,T.PolyFillType.pftNegative,T.PolyFillType.pftNegative),r.length>0&&r.splice(0,1)}}};T.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 T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[t].X*this.m_delta),T.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new T.IntPoint(this.m_srcPoly[e])),this.m_destPoly.push(new T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),T.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)));else switch(r){case T.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 T.JoinType.jtSquare:this.DoSquare(e,t);break;case T.JoinType.jtRound:this.DoRound(e,t);break}return t=e,t};T.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 T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*r)),T.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 T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[e].X+this.m_normals[e].Y*r)),T.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[e].Y-this.m_normals[e].X*r))))};T.ClipperOffset.prototype.DoMiter=function(e,t,r){var n=this.m_delta/r;this.m_destPoly.push(new T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[e].X+(this.m_normals[t].X+this.m_normals[e].X)*n),T.ClipperOffset.Round(this.m_srcPoly[e].Y+(this.m_normals[t].Y+this.m_normals[e].Y)*n)))};T.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=T.Cast_Int32(T.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),i=this.m_normals[t].X,s=this.m_normals[t].Y,l,c=0;c<n;++c)this.m_destPoly.push(new T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[e].X+i*this.m_delta),T.ClipperOffset.Round(this.m_srcPoly[e].Y+s*this.m_delta))),l=i,i=i*this.m_cos-this.m_sin*s,s=l*this.m_sin+s*this.m_cos;this.m_destPoly.push(new T.IntPoint(T.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),T.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)))};T.Error=function(e){try{throw new Error(e)}catch(t){alert(t.message)}};T.JS={};T.JS.AreaOfPolygon=function(e,t){return t||(t=1),T.Clipper.Area(e)/(t*t)};T.JS.AreaOfPolygons=function(e,t){t||(t=1);for(var r=0,n=0;n<e.length;n++)r+=T.Clipper.Area(e[n]);return r/(t*t)};T.JS.BoundsOfPath=function(e,t){return T.JS.BoundsOfPaths([e],t)};T.JS.BoundsOfPaths=function(e,t){t||(t=1);var r=T.Clipper.GetBounds(e);return r.left/=t,r.bottom/=t,r.right/=t,r.top/=t,r};T.JS.Clean=function(n,t){if(!(n instanceof Array))return[];var r=n[0]instanceof Array,n=T.JS.Clone(n);if(typeof t!="number"||t===null)return T.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,s,l,c,p,h,y,b,_=[],C=0;C<i;C++)if(l=n[C],s=l.length,s!==0){if(s<3){c=l,_.push(c);continue}for(c=l,p=t*t,h=l[0],y=1,b=1;b<s;b++)(l[b].X-h.X)*(l[b].X-h.X)+(l[b].Y-h.Y)*(l[b].Y-h.Y)<=p||(c[y]=l[b],h=l[b],y++);h=l[y-1],(l[0].X-h.X)*(l[0].X-h.X)+(l[0].Y-h.Y)*(l[0].Y-h.Y)<=p&&y--,y<s&&c.splice(y,s-y),c.length&&_.push(c)}return!r&&_.length?_=_[0]:!r&&_.length===0?_=[]:r&&_.length===0&&(_=[[]]),_};T.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,s,l,c=new Array(r);for(i=0;i<r;i++){for(n=e[i].length,l=new Array(n),s=0;s<n;s++)l[s]={X:e[i][s].X,Y:e[i][s].Y};c[i]=l}return t||(c=c[0]),c};T.JS.Lighten=function(e,t){if(!(e instanceof Array))return[];if(typeof t!="number"||t===null)return T.Error("Tolerance is not a number in Lighten()."),T.JS.Clone(e);if(e.length===0||e.length==1&&e[0].length===0||t<0)return T.JS.Clone(e);e[0]instanceof Array||(e=[e]);var r,n,i,s,l,c,p,h,y,b,_,C,P,E,w,O,D,A=e.length,k=t*t,j=[];for(r=0;r<A;r++)if(i=e[r],c=i.length,c!=0){for(s=0;s<1e6;s++){for(l=[],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,_=[],n=0;n<c-2;n++)p=i[n],y=i[n+1],h=i[n+2],O=p.X,D=p.Y,P=h.X-O,E=h.Y-D,(P!==0||E!==0)&&(w=((y.X-O)*P+(y.Y-D)*E)/(P*P+E*E),w>1?(O=h.X,D=h.Y):w>0&&(O+=P*w,D+=E*w)),P=y.X-O,E=y.Y-D,b=P*P+E*E,b<=k&&(_[n+1]=1,n++);for(l.push({X:i[0].X,Y:i[0].Y}),n=1;n<c-1;n++)_[n]||l.push({X:i[n].X,Y:i[n].Y});if(l.push({X:i[c-1].X,Y:i[c-1].Y}),C&&i.pop(),_.length)i=l;else break}c=l.length,l[c-1].X==l[0].X&&l[c-1].Y==l[0].Y&&l.pop(),l.length>2&&j.push(l)}return!e[0]instanceof Array&&(j=j[0]),typeof j>"u"&&(j=[[]]),j};T.JS.PerimeterOfPath=function(e,t,r){if(typeof e>"u")return 0;var n=Math.sqrt,i=0,s,l,c=0,p=0,h=0,y=0,b=e.length;if(b<2)return 0;for(t&&(e[b]=e[0],b++);--b;)s=e[b],c=s.X,p=s.Y,l=e[b-1],h=l.X,y=l.Y,i+=n((c-h)*(c-h)+(p-y)*(p-y));return t&&e.pop(),i/r};T.JS.PerimeterOfPaths=function(e,t,r){r||(r=1);for(var n=0,i=0;i<e.length;i++)n+=T.JS.PerimeterOfPath(e[i],t,r);return n};T.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};T.JS.ScaleDownPaths=function(e,t){var r,n,i,s=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};T.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)};T.JS.ScaleUpPaths=function(e,t){var r,n,i,s=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)i=e[r][n],i.X=s(i.X*t),i.Y=s(i.Y*t)};T.ExPolygons=function(){return[]};T.ExPolygon=function(){this.outer=null,this.holes=null};T.JS.AddOuterPolyNodeToExPolygons=function(e,t){var r=new T.ExPolygon;r.outer=e.Contour();var n=e.Childs(),i=n.length;r.holes=new Array(i);var s,l,c,p,h,y;for(c=0;c<i;c++)for(s=n[c],r.holes[c]=s.Contour(),p=0,h=s.Childs(),y=h.length;p<y;p++)l=h[p],T.JS.AddOuterPolyNodeToExPolygons(l,t);t.push(r)};T.JS.ExPolygonsToPaths=function(e){var t,r,n,i,s=new T.Paths;for(t=0,n=e.length;t<n;t++)for(s.push(e[t].outer),r=0,i=e[t].holes.length;r<i;r++)s.push(e[t].holes[r]);return s};T.JS.PolyTreeToExPolygons=function(e){var t=new T.ExPolygons,r,n,i,s;for(n=0,i=e.Childs(),s=i.length;n<s;n++)r=i[n],T.JS.AddOuterPolyNodeToExPolygons(r,t);return t};y2.exports=T});var Zoe=fe((enr,JT)=>{g();(function(){"use strict";function e(l,c){var p=l.x-c.x,h=l.y-c.y;return p*p+h*h}o(e,"getSqDist");function t(l,c,p){var h=c.x,y=c.y,b=p.x-h,_=p.y-y;if(b!==0||_!==0){var C=((l.x-h)*b+(l.y-y)*_)/(b*b+_*_);C>1?(h=p.x,y=p.y):C>0&&(h+=b*C,y+=_*C)}return b=l.x-h,_=l.y-y,b*b+_*_}o(t,"getSqSegDist");function r(l,c){for(var p=l[0],h=[p],y,b=1,_=l.length;b<_;b++)y=l[b],e(y,p)>c&&(h.push(y),p=y);return p!==y&&h.push(y),h}o(r,"simplifyRadialDist");function n(l,c,p,h,y){for(var b=h,_,C=c+1;C<p;C++){var P=t(l[C],l[c],l[p]);P>b&&(_=C,b=P)}b>h&&(_-c>1&&n(l,c,_,h,y),y.push(l[_]),p-_>1&&n(l,_,p,h,y))}o(n,"simplifyDPStep");function i(l,c){var p=l.length-1,h=[l[0]];return n(l,0,p,c,h),h.push(l[p]),h}o(i,"simplifyDouglasPeucker");function s(l,c,p){if(l.length<=2)return l;var h=c!==void 0?c*c:1;return l=p?l:r(l,h),l=i(l,h),l}o(s,"simplify"),typeof define=="function"&&define.amd?define(function(){return s}):typeof JT<"u"?(JT.exports=s,JT.exports.default=s):typeof self<"u"?self.simplify=s:window.simplify=s})()});g();g();var hm=class hm{constructor(t,r,n){x(this,"__type",hm.__type);x(this,"id",xn());x(this,"latitude");x(this,"longitude");x(this,"floorId");x(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===hm.__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:hm.__type,latitude:this.latitude,longitude:this.longitude,floor:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};o(hm,"Coordinate"),x(hm,"__type","coordinate");var kE=hm,St=kE;g();var RE=class RE{constructor(t){x(this,"id");this.id=t}};o(RE,"BaseMetaData");var Co=RE;var Dc,sa,gm,Bd,mm=class mm extends Co{constructor(r,n){super(n.mvfData.properties.id);x(this,"__type",mm.__type);G(this,Dc);G(this,sa,{});G(this,gm);G(this,Bd);q(this,Dc,r),q(this,gm,n.floorId),q(this,Bd,n.mvfData)}static is(r){return r.__type===mm.__type}get locations(){return d(this,sa).locations?d(this,sa).locations:(d(this,sa).locations=(d(this,Dc).locationIdsByNodeId[this.id]||[]).map(r=>d(this,Dc).getById("enterprise-location",r)).filter(Boolean),d(this,sa).locations)}get space(){var r;return d(this,Dc).getById("space",(r=d(this,Dc).spaceIdsByNodeId[this.id])==null?void 0:r[0])}get floor(){let r=d(this,Dc).getById("floor",d(this,gm));if(r==null)throw new Error("Floor ".concat(d(this,gm)," not found!"));return r}get coordinate(){if(d(this,sa).coordinate==null){let[r,n]=d(this,Bd).geometry.coordinates;d(this,sa).coordinate=new St(n,r,d(this,gm))}return d(this,sa).coordinate}get externalId(){var r;return(r=d(this,Bd).properties.externalId)!=null?r:""}get neighbors(){if(d(this,sa).neighbours==null){let r=d(this,Bd).properties.neighbors.map(n=>{let i=d(this,Dc).getById("node",n.id);if(i==null)throw new Error("Node ".concat(n.id," not found!"));return i});d(this,sa).neighbours=r}return d(this,sa).neighbours}get geoJSON(){return re(R({},d(this,Bd)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:mm.__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,sa)))delete d(this,sa)[r]}};Dc=new WeakMap,sa=new WeakMap,gm=new WeakMap,Bd=new WeakMap,o(mm,"Node"),x(mm,"__type","node");var BE=mm,tf=BE;g();g();var ym,jE=class jE{constructor(t,r){x(this,"id");G(this,ym);this.id=t}get geoJSONBoundingBox(){return d(this,ym)?d(this,ym):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(q(this,ym,po(this.geoJSON)),d(this,ym))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};ym=new WeakMap,o(jE,"BaseMapData");var Mu=jE;var jd,Dl,Ou,h0,Rb,GE,vm=class vm extends Mu{constructor(r,n){super(n.mvfData.id,r);G(this,Rb);x(this,"__type",vm.__type);G(this,jd);G(this,Dl,{});G(this,Ou);G(this,h0);q(this,jd,r),q(this,Ou,n.mvfData),q(this,h0,n.facadeId)}static is(r){return r.__type===vm.__type}get type(){return d(this,Ou).type}get name(){var r;return(r=ke(this,Rb,GE).call(this,"name"))!=null?r:""}get shortName(){var r;return(r=ke(this,Rb,GE).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,Dl).floors==null){let i=((n=(r=d(this,Ou).floors)!=null?r:d(this,Ou).maps)!=null?n:[]).reduce((s,l)=>{let c=d(this,jd).floorsById[l];return c&&s.push(c),s},[]);i.length===0&&ce.error("Floor stack ".concat(this.id," has no floors")),d(this,Dl).floors=i}return d(this,Dl).floors}get defaultFloor(){if(d(this,Dl).defaultFloor!=null)return d(this,Dl).defaultFloor;let r=d(this,Ou).defaultFloor?d(this,jd).getById("floor",d(this,Ou).defaultFloor):void 0;return d(this,Dl).defaultFloor=r||this.floors.reduce((n,i)=>Math.abs(i.elevation)<Math.abs(n.elevation)?i:n),d(this,Dl).defaultFloor}get facade(){return d(this,h0)?d(this,jd).facadesById[d(this,h0)]:void 0}toJSON(){return{__type:vm.__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,Dl)))delete d(this,Dl)[r]}};jd=new WeakMap,Dl=new WeakMap,Ou=new WeakMap,h0=new WeakMap,Rb=new WeakSet,GE=o(function(r){return d(this,jd).getPropTranslation(this.__type,r,this.id,d(this,Ou)[r])},"#translate"),o(vm,"FloorStack"),x(vm,"__type","floor-stack");var $E=vm,Bb=$E;g();g();g();g();g();g();var jb,rf,bm=class bm extends Co{constructor(r){super(String(xn()));x(this,"__type",bm.__type);G(this,jb,{});G(this,rf);q(this,rf,r.mvfData)}static is(r){return r.__type===bm.__type}get url(){return d(this,rf).url}get name(){if("displayName"in d(this,rf))return d(this,rf).displayName;if("label"in d(this,rf))return d(this,rf).label}toJSON(){return{__type:bm.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(d(this,jb)))delete d(this,jb)[r]}};jb=new WeakMap,rf=new WeakMap,o(bm,"Hyperlink"),x(bm,"__type","hyperlink");var UE=bm,$d=UE;g();g();function $b(e){return typeof e=="string"?e:e.id}o($b,"getId");function zE(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}o(zE,"isPosition");var VE=8,Fc=o(e=>typeof e=="number"?e.toFixed(VE):zE(e)?e[1].toFixed(VE)+"-"+e[0].toFixed(VE):e.map(t=>Fc(t)).join("-"),"serializeCoords"),Wse=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"),wS=o(e=>{if(!Wse(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 Gb,Gd,Im,xm=class xm extends Co{constructor(r){super(String(xn()));x(this,"__type",xm.__type);G(this,Gb,{});G(this,Gd);G(this,Im);q(this,Gd,r.mvfData),q(this,Im,r.mapData)}static is(r){return r.__type===xm.__type}get url(){let r=d(this,Gd).url;if(d(this,Im).tokenManager==null)return r;let n=wS(d(this,Gd).url);if(n==null)return r;let i=n.mapId;try{if(d(this,Im).tokenManager.isEnterpriseMode())return r;let s=d(this,Im).tokenManager.getSasToken(i).token;if(s==null||s==="")throw new Error("SAS token empty!");return"".concat(r,"?").concat(s)}catch(s){return ce.error("Error getting SAS token for image",{error:s,url:r}),r}}get name(){return d(this,Gd).altText}get altText(){return d(this,Gd).altText}toJSON(){return{__type:xm.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(d(this,Gb)))delete d(this,Gb)[r]}};Gb=new WeakMap,Gd=new WeakMap,Im=new WeakMap,o(xm,"ImageMetaData"),x(xm,"__type","image");var qE=xm,Ud=qE;var m0,Lu,nf,HE=class HE extends Mu{constructor(r,n){super(n.properties.id,r);G(this,m0);G(this,Lu);G(this,nf,{});q(this,m0,r),q(this,Lu,n)}get externalId(){var r;return(r=d(this,Lu).properties.externalId)!=null?r:""}get name(){var n,i,s,l,c;let r="";return"details"in d(this,Lu).properties||(r=(n=d(this,Lu).properties.externalId)!=null?n:""),r===""&&(r=(s=(i=d(this,Lu).properties.details)==null?void 0:i.name)!=null?s:""),r===""&&(r=(c=(l=this.locationProfiles.find(p=>p.name&&p.name.length>0))==null?void 0:l.name)!=null?c:""),r}get description(){var n,i,s,l;let r=(i=(n=d(this,Lu).properties.details)==null?void 0:n.description)!=null?i:"";return r===""&&(r=(l=(s=this.locationProfiles.find(c=>c.description&&c.description.length>0))==null?void 0:s.description)!=null?l:""),r}get images(){var n,i,s,l,c;if(d(this,nf).images!=null)return d(this,nf).images;let r=(s=(i=(n=d(this,Lu).properties.details)==null?void 0:n.images)==null?void 0:i.map(p=>new Ud({mvfData:p,mapData:d(this,m0)})))!=null?s:[];return(r==null||r.length===0)&&(r=(c=(l=this.locationProfiles.find(p=>p.images.length>0))==null?void 0:l.images)!=null?c:[]),d(this,nf).images=r,r}get links(){var n,i,s,l,c;if(d(this,nf).links!=null)return d(this,nf).links;let r=(s=(i=(n=d(this,Lu).properties.details)==null?void 0:n.links)==null?void 0:i.map(p=>new $d({mvfData:p})))!=null?s:[];return(r==null||r.length===0)&&(r=(c=(l=this.locationProfiles.find(p=>p.links.length>0))==null?void 0:l.links)!=null?c:[]),d(this,nf).links=r,r}get locationProfiles(){var r;return(r=d(this,m0).locationProfilesByAttachedFeatureId[this.id])!=null?r:[]}};m0=new WeakMap,Lu=new WeakMap,nf=new WeakMap,o(HE,"DetailedMapData");var fs=HE;var Ub,Sm,g0,y0,_m=class _m extends fs{constructor(r,n){super(r,n.mvfData);x(this,"__type",_m.__type);G(this,Ub);G(this,Sm);G(this,g0,{});G(this,y0);q(this,Ub,r),q(this,Sm,n.floorId),q(this,y0,n.mvfData)}static is(r){return r.__type===_m.__type}get center(){var r;if(d(this,g0).center==null){let[n,i]=(r=d(this,y0).properties.center)!=null?r:[0,0];d(this,g0).center=new St(i,n,d(this,Sm))}return d(this,g0).center}get floor(){let r=d(this,Ub).getById("floor",d(this,Sm));if(r==null)throw new Error("Floor ".concat(d(this,Sm)," not found!"));return r}get geoJSON(){return re(R({},d(this,y0)),{properties:null})}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{__type:_m.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Ub=new WeakMap,Sm=new WeakMap,g0=new WeakMap,y0=new WeakMap,o(_m,"Area"),x(_m,"__type","area");var WE=_m,of=WE;g();var wm,sf,Pm,v0,Cm=class Cm extends fs{constructor(r,n){super(r,n.mvfData);x(this,"__type",Cm.__type);G(this,wm);G(this,sf);G(this,Pm);G(this,v0);q(this,sf,{}),q(this,v0,n.mvfData),q(this,wm,r),q(this,Pm,n.floorId)}static is(r){return r.__type===Cm.__type}get floor(){let r=d(this,wm).getById("floor",d(this,Pm));if(r==null)throw new Error("Floor ".concat(d(this,Pm)," not found!"));return r}get center(){if(d(this,sf).center==null){let[[r,n],[i,s]]=d(this,v0).geometry.coordinates,l=(r+i)/2,c=(n+s)/2;d(this,sf).center=new St(c,l,d(this,Pm))}return d(this,sf).center}get isExterior(){var i;let r=d(this,wm).obstructionIdByEntranceId[this.id],n=d(this,wm).getMVFFeatureById("obstruction",r);return(i=n==null?void 0:n.properties.footprintComponent)!=null?i:!1}get geoJSON(){return re(R({},d(this,v0)),{properties:null})}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Cm.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(d(this,sf)))delete d(this,sf)[r]}};wm=new WeakMap,sf=new WeakMap,Pm=new WeakMap,v0=new WeakMap,o(Cm,"Door"),x(Cm,"__type","door");var XE=Cm,Au=XE;g();var Vd,Em,ol,Nc,Tm=class Tm extends fs{constructor(r,n){super(r,n.mvfData);x(this,"__type",Tm.__type);G(this,Vd);G(this,Em);G(this,ol,{});G(this,Nc);q(this,Vd,r),q(this,Em,n.floorId),q(this,Nc,n.mvfData)}getMvfData(){return d(this,Nc)}static is(r){return r.__type===Tm.__type}get type(){return Yse(d(this,Nc).properties.kind)}get locations(){if(d(this,ol).locations)return d(this,ol).locations;d(this,ol).locations=[];let r=d(this,Vd).mvfLocationsBySpaceId[d(this,Nc).properties.id];if((r==null?void 0:r.length)>0)for(let n of r){let i=d(this,Vd).getById("enterprise-location",n.id);i&&d(this,ol).locations.push(i)}return d(this,ol).locations}get floor(){let r=d(this,Vd).getById("floor",d(this,Em));if(r==null)throw new Error("Floor ".concat(d(this,Em)," not found!"));return r}get doors(){return d(this,Nc).properties.destinationNodes.reduce((r,n)=>{let i=d(this,Vd).doorsByNodeId[n];return i&&r.push(i),r},[])}get center(){var r;if(d(this,ol).center==null){let[n,i]=(r=d(this,Nc).properties.center)!=null?r:[0,0];d(this,ol).center=new St(i,n,d(this,Em))}return d(this,ol).center}get geoJSON(){return re(R({},d(this,Nc)),{properties:null})}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Tm.__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,ol)))delete d(this,ol)[r]}};Vd=new WeakMap,Em=new WeakMap,ol=new WeakMap,Nc=new WeakMap,o(Tm,"Space"),x(Tm,"__type","space");var YE=Tm,Xse=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function Yse(e){if(e==null||e==="default")return"room";let t=e.toLowerCase();return Xse.includes(t)?t:"room"}o(Yse,"validateSpaceType");var wo=YE;g();g();g();g();function Oi(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(Oi,"getCoord");function Vn(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(Vn,"getCoords");function ZE(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(ZE,"featureOf");function fo(e){return e.type==="Feature"?e.geometry:e}o(fo,"getGeom");function sl(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}o(sl,"getType");var tae=Pn(PS(),1);g();var pae=Pn(Ak(),1);g();g();function ci(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=Oi(e),i=fo(t),s=i.type,l=t.bbox,c=i.coordinates;if(l&&fae(n,l)===!1)return!1;s==="Polygon"&&(c=[c]);for(var p=!1,h=0;h<c.length&&!p;h++)if(Dk(n,c[h][0],r.ignoreBoundary)){for(var y=!1,b=1;b<c[h].length&&!y;)Dk(n,c[h][b],!r.ignoreBoundary)&&(y=!0),b++;y||(p=!0)}return p}o(ci,"booleanPointInPolygon");function Dk(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,s=t.length-1;i<t.length;s=i++){var l=t[i][0],c=t[i][1],p=t[s][0],h=t[s][1],y=e[1]*(l-p)+c*(p-e[0])+h*(e[0]-l)===0&&(l-e[0])*(p-e[0])<=0&&(c-e[1])*(h-e[1])<=0;if(y)return!r;var b=c>e[1]!=h>e[1]&&e[0]<(p-l)*(e[1]-c)/(h-c)+l;b&&(n=!n)}return n}o(Dk,"inRing");function fae(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}o(fae,"inBBox");g();g();function dae(e,t,r){r===void 0&&(r={});var n=Oi(e),i=Oi(t),s=Ho(i[1]-n[1]),l=Ho(i[0]-n[0]),c=Ho(n[1]),p=Ho(i[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(c)*Math.cos(p);return yS(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),r.units)}o(dae,"distance");var _i=dae;g();var PDe=function(){function e(t,r,n){this.a=t,this.b=r,this.c=n;var i=r.x-t.x,s=r.y-t.y,l=n.x-t.x,c=n.y-t.y,p=i*(t.x+r.x)+s*(t.y+r.y),h=l*(t.x+n.x)+c*(t.y+n.y),y=2*(i*(n.y-r.y)-s*(n.x-r.x)),b,_;this.x=(c*p-s*h)/y,this.y=(i*h-l*p)/y,b=this.x-t.x,_=this.y-t.y,this.r=b*b+_*_}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 Nk=new ArrayBuffer(16),hFe=new Float64Array(Nk),mFe=new Uint32Array(Nk);g();g();g();g();g();g();var Eae=Pn(cM(),1);g();g();g();g();g();var Cke=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 s=this.points[r+1].x-(this.centers[r].x+this.centers[r+1].x)/2,l=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+s),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r].y+l),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+s),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r+1].y+l),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 s=this.pos(i),l=Math.sqrt((s.x-n.x)*(s.x-n.x)+(s.y-n.y)*(s.y-n.y)+(s.z-n.z)*(s.z-n.z));l>t&&(r.push(i),n=s)}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),s=(this.length-1)*n-i;return Mae(s,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},e}();function Mae(e,t,r,n,i){var s=Oae(e),l={x:i.x*s[0]+n.x*s[1]+r.x*s[2]+t.x*s[3],y:i.y*s[0]+n.y*s[1]+r.y*s[2]+t.y*s[3],z:i.z*s[0]+n.z*s[1]+r.z*s[2]+t.z*s[3]};return l}o(Mae,"bezier");function Oae(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(Oae,"B");g();g();g();g();function Hb(e,t){t===void 0&&(t={});var r=Number(e[0]),n=Number(e[1]),i=Number(e[2]),s=Number(e[3]);if(e.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var l=[r,n],c=[r,s],p=[i,s],h=[i,n];return Un([[l,h,p,c,l]],t.properties,{bbox:e,id:t.id})}o(Hb,"bboxPolygon");function Lae(e){return Hb(po(e))}o(Lae,"envelope");var pM=Lae;g();g();g();function al(e,t,r,n){n===void 0&&(n={});var i=Oi(e),s=Ho(i[0]),l=Ho(i[1]),c=Ho(r),p=vS(t,n.units),h=Math.asin(Math.sin(l)*Math.cos(p)+Math.cos(l)*Math.sin(p)*Math.cos(c)),y=s+Math.atan2(Math.sin(c)*Math.sin(p)*Math.cos(l),Math.cos(p)-Math.sin(l)*Math.sin(h)),b=pm(y),_=pm(h);return Tn([b,_],n.properties)}o(al,"destination");g();g();function af(e,t,r){if(r===void 0&&(r={}),r.final===!0)return Aae(e,t);var n=Oi(e),i=Oi(t),s=Ho(n[0]),l=Ho(i[0]),c=Ho(n[1]),p=Ho(i[1]),h=Math.sin(l-s)*Math.cos(p),y=Math.cos(c)*Math.sin(p)-Math.sin(c)*Math.cos(p)*Math.cos(l-s);return pm(Math.atan2(h,y))}o(af,"bearing");function Aae(e,t){var r=af(t,e);return r=(r+180)%360,r}o(Aae,"calculateFinalBearing");g();function Dae(e,t){t===void 0&&(t={});var r=po(e),n=(r[0]+r[2])/2,i=(r[1]+r[3])/2;return Tn([n,i],t.properties,t)}o(Dae,"center");var kc=Dae;g();g();g();g();g();var Nae=Pn(Hse(),1);g();g();g();g();function kae(e){if(!e)throw new Error("geojson is required");var t=[];return So(e,function(r){Rae(r,t)}),er(t)}o(kae,"lineSegment");function Rae(e,t){var r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=Vn(n);break;case"LineString":r=[Vn(n)]}r.forEach(function(i){var s=Bae(i,e.properties);s.forEach(function(l){l.id=t.length,t.push(l)})})}}o(Rae,"lineSegmentFeature");function Bae(e,t){var r=[];return e.reduce(function(n,i){var s=Bi([n,i],t);return s.bbox=jae(n,i),r.push(s),i}),r}o(Bae,"createSegments");function jae(e,t){var r=e[0],n=e[1],i=t[0],s=t[1],l=r<i?r:i,c=n<s?n:s,p=r>i?r:i,h=n>s?n:s;return[l,c,p,h]}o(jae,"bbox");var Om=kae;var rR=Pn(BS(),1);function fle(e,t){var r={},n=[];if(e.type==="LineString"&&(e=Lc(e)),t.type==="LineString"&&(t=Lc(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=tR(e,t);return i&&n.push(i),er(n)}var s=(0,rR.default)();return s.load(Om(t)),ti(Om(e),function(l){ti(s.search(l),function(c){var p=tR(l,c);if(p){var h=Vn(p).join(",");r[h]||(r[h]=!0,n.push(p))}})}),er(n)}o(fle,"lineIntersect");function tR(e,t){var r=Vn(e),n=Vn(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],s=r[0][1],l=r[1][0],c=r[1][1],p=n[0][0],h=n[0][1],y=n[1][0],b=n[1][1],_=(b-h)*(l-i)-(y-p)*(c-s),C=(y-p)*(s-h)-(b-h)*(i-p),P=(l-i)*(s-h)-(c-s)*(i-p);if(_===0)return null;var E=C/_,w=P/_;if(E>=0&&E<=1&&w>=0&&w<=1){var O=i+E*(l-i),D=s+E*(c-s);return Tn([O,D])}return null}o(tR,"intersects");var Bc=fle;function dle(e,t,r){r===void 0&&(r={});var n=Tn([1/0,1/0],{dist:1/0}),i=0;return So(e,function(s){for(var l=Vn(s),c=0;c<l.length-1;c++){var p=Tn(l[c]);p.properties.dist=_i(t,p,r);var h=Tn(l[c+1]);h.properties.dist=_i(t,h,r);var y=_i(p,h,r),b=Math.max(p.properties.dist,h.properties.dist),_=af(p,h),C=al(t,b,_+90,r),P=al(t,b,_-90,r),E=Bc(Bi([C.geometry.coordinates,P.geometry.coordinates]),Bi([p.geometry.coordinates,h.geometry.coordinates])),w=null;E.features.length>0&&(w=E.features[0],w.properties.dist=_i(t,w,r),w.properties.location=i+_i(p,w,r)),p.properties.dist<n.properties.dist&&(n=p,n.properties.index=c,n.properties.location=i),h.properties.dist<n.properties.dist&&(n=h,n.properties.index=c+1,n.properties.location=i+y),w&&w.properties.dist<n.properties.dist&&(n=w,n.properties.index=c),i+=y}}),n}o(dle,"nearestPointOnLine");var lf=dle;g();g();g();var mle=Pn(PS(),1);g();g();g();g();g();g();function Lm(e,t){return t===void 0&&(t={}),YN(e,function(r,n){var i=n.geometry.coordinates;return r+_i(i[0],i[1],t)},0)}o(Lm,"length");g();function gle(e,t,r){var n=Vn(r);if(sl(r)!=="LineString")throw new Error("line must be a LineString");var i=lf(r,e),s=lf(r,t),l;i.properties.index<=s.properties.index?l=[i,s]:l=[s,i];for(var c=[l[0].geometry.coordinates],p=l[0].properties.index+1;p<l[1].properties.index+1;p++)c.push(n[p]);return c.push(l[1].geometry.coordinates),Bi(c,r.properties)}o(gle,"lineSlice");var $S=gle;g();g();g();g();function yle(e,t,r){r===void 0&&(r={});for(var n=Oi(e),i=Vn(t),s=0;s<i.length-1;s++){var l=!1;if(r.ignoreEndVertices&&(s===0&&(l="start"),s===i.length-2&&(l="end"),s===0&&s+1===i.length-1&&(l="both")),vle(i[s],i[s+1],n,l,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}o(yle,"booleanPointOnLine");function vle(e,t,r,n,i){var s=r[0],l=r[1],c=e[0],p=e[1],h=t[0],y=t[1],b=r[0]-c,_=r[1]-p,C=h-c,P=y-p,E=b*P-_*C;if(i!==null){if(Math.abs(E)>i)return!1}else if(E!==0)return!1;if(n){if(n==="start")return Math.abs(C)>=Math.abs(P)?C>0?c<s&&s<=h:h<=s&&s<c:P>0?p<l&&l<=y:y<=l&&l<p;if(n==="end")return Math.abs(C)>=Math.abs(P)?C>0?c<=s&&s<h:h<s&&s<=c:P>0?p<=l&&l<y:y<l&&l<=p;if(n==="both")return Math.abs(C)>=Math.abs(P)?C>0?c<s&&s<h:h<s&&s<c:P>0?p<l&&l<y:y<l&&l<p}else return Math.abs(C)>=Math.abs(P)?C>0?c<=s&&s<=h:h<=s&&s<=c:P>0?p<=l&&l<=y:y<=l&&l<=p;return!1}o(vle,"isPointOnLineSegment");var w0=yle;g();g();g();g();var Ile=Pn(cM(),1);g();var sR=Math.PI/180,aR=180/Math.PI,Xb=o(function(e,t){this.lon=e,this.lat=t,this.x=sR*e,this.y=sR*t},"Coord");Xb.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};Xb.prototype.antipode=function(){var e=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new Xb(t,e)};var lR=o(function(){this.coords=[],this.length=0},"LineString");lR.prototype.move_to=function(e){this.length++,this.coords.push(e)};var wM=o(function(e){this.properties=e||{},this.geometries=[]},"Arc");wM.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}};wM.prototype.wkt=function(){for(var e="",t="LINESTRING(",r=o(function(s){t+=s[0]+" "+s[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 uR=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 Xb(e.x,e.y),this.end=new Xb(t.x,t.y),this.properties=r||{};var n=this.start.x-this.end.x,i=this.start.y-this.end.y,s=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(s)),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");uR.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),s=t*Math.sin(this.start.y)+r*Math.sin(this.end.y),l=aR*Math.atan2(s,Math.sqrt(Math.pow(n,2)+Math.pow(i,2))),c=aR*Math.atan2(i,n);return[c,l]};uR.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 s=n*i,l=this.interpolate(s);r.push(l)}for(var c=!1,p=0,h=t&&t.offset?t.offset:10,y=180-h,b=-180+h,_=360-h,C=1;C<r.length;++C){var P=r[C-1][0],E=r[C][0],w=Math.abs(E-P);w>_&&(E>y&&P<b||P>y&&E<b)?c=!0:w>p&&(p=w)}var O=[];if(c&&p<h){var D=[];O.push(D);for(var A=0;A<r.length;++A){var k=parseFloat(r[A][0]);if(A>0&&Math.abs(k-r[A-1][0])>_){var j=parseFloat(r[A-1][0]),W=parseFloat(r[A-1][1]),Y=parseFloat(r[A][0]),N=parseFloat(r[A][1]);if(j>-180&&j<b&&Y===180&&A+1<r.length&&r[A-1][0]>-180&&r[A-1][0]<b){D.push([-180,r[A][1]]),A++,D.push([r[A][0],r[A][1]]);continue}else if(j>y&&j<180&&Y===-180&&A+1<r.length&&r[A-1][0]>y&&r[A-1][0]<180){D.push([180,r[A][1]]),A++,D.push([r[A][0],r[A][1]]);continue}if(j<b&&Y>y){var Z=j;j=Y,Y=Z;var le=W;W=N,N=le}if(j>y&&Y<b&&(Y+=360),j<=180&&Y>=180&&j<Y){var se=(180-j)/(Y-j),U=se*N+(1-se)*W;D.push([r[A-1][0]>y?180:-180,U]),D=[],D.push([r[A-1][0]>y?-180:180,U]),O.push(D)}else D=[],O.push(D);D.push([k,r[A][1]])}else D.push([r[A][0],r[A][1]])}}else{var ye=[];O.push(ye);for(var ne=0;ne<r.length;++ne)ye.push([r[ne][0],r[ne][1]])}for(var Ce=new wM(this.properties),Ie=0;Ie<O.length;++Ie){var Ue=new lR;Ce.geometries.push(Ue);for(var ve=O[Ie],Te=0;Te<ve.length;++Te)Ue.move_to(ve[Te])}return Ce};g();var Cle=Pn(BS(),1);g();g();function Am(e,t){t===void 0&&(t={});var r=fo(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return pR(r,t);case"MultiPolygon":return wle(r,t);default:throw new Error("invalid poly")}}o(Am,"default");function pR(e,t){t===void 0&&(t={});var r=fo(e),n=r.coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{};return fR(n,i)}o(pR,"polygonToLine");function wle(e,t){t===void 0&&(t={});var r=fo(e),n=r.coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{},s=[];return n.forEach(function(l){s.push(fR(l,i))}),er(s)}o(wle,"multiPolygonToLine");function fR(e,t){return e.length>1?l0(e,t):Bi(e[0],t)}o(fR,"coordsToLine");g();g();g();g();var Cce=Pn(BS(),1);var wce=Pn(QM(),1);g();g();g();g();g();g();g();var Ece=Pn(PS(),1);var tr=[],rr=[],nr=[],or=[],sr=[],ar=[],lr=[],ur=[],cr=[],pr=[],fr=[],dr=[],hr=[],mr=[],gr=[],yr=[],vr=[],br=[],xr=[],Ir=[],_r=[],Sr=[],Cr=[],wr=[];lr[85]=pr[85]=-1;ur[85]=fr[85]=0;cr[85]=dr[85]=1;xr[85]=Sr[85]=1;Ir[85]=Cr[85]=0;_r[85]=wr[85]=1;tr[85]=or[85]=0;rr[85]=sr[85]=-1;nr[85]=gr[85]=0;yr[85]=hr[85]=0;vr[85]=mr[85]=1;ar[85]=br[85]=1;Sr[1]=Sr[169]=0;Cr[1]=Cr[169]=-1;wr[1]=wr[169]=0;hr[1]=hr[169]=-1;mr[1]=mr[169]=0;gr[1]=gr[169]=0;pr[4]=pr[166]=0;fr[4]=fr[166]=-1;dr[4]=dr[166]=1;yr[4]=yr[166]=1;vr[4]=vr[166]=0;br[4]=br[166]=0;lr[16]=lr[154]=0;ur[16]=ur[154]=1;cr[16]=cr[154]=1;or[16]=or[154]=1;sr[16]=sr[154]=0;ar[16]=ar[154]=1;xr[64]=xr[106]=0;Ir[64]=Ir[106]=1;_r[64]=_r[106]=0;tr[64]=tr[106]=-1;rr[64]=rr[106]=0;nr[64]=nr[106]=1;xr[2]=xr[168]=0;Ir[2]=Ir[168]=-1;_r[2]=_r[168]=1;Sr[2]=Sr[168]=0;Cr[2]=Cr[168]=-1;wr[2]=wr[168]=0;hr[2]=hr[168]=-1;mr[2]=mr[168]=0;gr[2]=gr[168]=0;yr[2]=yr[168]=-1;vr[2]=vr[168]=0;br[2]=br[168]=1;lr[8]=lr[162]=0;ur[8]=ur[162]=-1;cr[8]=cr[162]=0;pr[8]=pr[162]=0;fr[8]=fr[162]=-1;dr[8]=dr[162]=1;hr[8]=hr[162]=1;mr[8]=mr[162]=0;gr[8]=gr[162]=1;yr[8]=yr[162]=1;vr[8]=vr[162]=0;br[8]=br[162]=0;lr[32]=lr[138]=0;ur[32]=ur[138]=1;cr[32]=cr[138]=1;pr[32]=pr[138]=0;fr[32]=fr[138]=1;dr[32]=dr[138]=0;tr[32]=tr[138]=1;rr[32]=rr[138]=0;nr[32]=nr[138]=0;or[32]=or[138]=1;sr[32]=sr[138]=0;ar[32]=ar[138]=1;Sr[128]=Sr[42]=0;Cr[128]=Cr[42]=1;wr[128]=wr[42]=1;xr[128]=xr[42]=0;Ir[128]=Ir[42]=1;_r[128]=_r[42]=0;tr[128]=tr[42]=-1;rr[128]=rr[42]=0;nr[128]=nr[42]=1;or[128]=or[42]=-1;sr[128]=sr[42]=0;ar[128]=ar[42]=0;pr[5]=pr[165]=-1;fr[5]=fr[165]=0;dr[5]=dr[165]=0;Sr[5]=Sr[165]=1;Cr[5]=Cr[165]=0;wr[5]=wr[165]=0;yr[20]=yr[150]=0;vr[20]=vr[150]=1;br[20]=br[150]=1;or[20]=or[150]=0;sr[20]=sr[150]=-1;ar[20]=ar[150]=1;lr[80]=lr[90]=-1;ur[80]=ur[90]=0;cr[80]=cr[90]=1;xr[80]=xr[90]=1;Ir[80]=Ir[90]=0;_r[80]=_r[90]=1;hr[65]=hr[105]=0;mr[65]=mr[105]=1;gr[65]=gr[105]=0;tr[65]=tr[105]=0;rr[65]=rr[105]=-1;nr[65]=nr[105]=0;lr[160]=lr[10]=-1;ur[160]=ur[10]=0;cr[160]=cr[10]=1;pr[160]=pr[10]=-1;fr[160]=fr[10]=0;dr[160]=dr[10]=0;Sr[160]=Sr[10]=1;Cr[160]=Cr[10]=0;wr[160]=wr[10]=0;xr[160]=xr[10]=1;Ir[160]=Ir[10]=0;_r[160]=_r[10]=1;yr[130]=yr[40]=0;vr[130]=vr[40]=1;br[130]=br[40]=1;hr[130]=hr[40]=0;mr[130]=mr[40]=1;gr[130]=gr[40]=0;tr[130]=tr[40]=0;rr[130]=rr[40]=-1;nr[130]=nr[40]=0;or[130]=or[40]=0;sr[130]=sr[40]=-1;ar[130]=ar[40]=1;pr[37]=pr[133]=0;fr[37]=fr[133]=1;dr[37]=dr[133]=1;Sr[37]=Sr[133]=0;Cr[37]=Cr[133]=1;wr[37]=wr[133]=0;tr[37]=tr[133]=-1;rr[37]=rr[133]=0;nr[37]=nr[133]=0;or[37]=or[133]=1;sr[37]=sr[133]=0;ar[37]=ar[133]=0;yr[148]=yr[22]=-1;vr[148]=vr[22]=0;br[148]=br[22]=0;Sr[148]=Sr[22]=0;Cr[148]=Cr[22]=-1;wr[148]=wr[22]=1;xr[148]=xr[22]=0;Ir[148]=Ir[22]=1;_r[148]=_r[22]=1;or[148]=or[22]=-1;sr[148]=sr[22]=0;ar[148]=ar[22]=1;lr[82]=lr[88]=0;ur[82]=ur[88]=-1;cr[82]=cr[88]=1;yr[82]=yr[88]=1;vr[82]=vr[88]=0;br[82]=br[88]=1;hr[82]=hr[88]=-1;mr[82]=mr[88]=0;gr[82]=gr[88]=1;xr[82]=xr[88]=0;Ir[82]=Ir[88]=-1;_r[82]=_r[88]=0;lr[73]=lr[97]=0;ur[73]=ur[97]=1;cr[73]=cr[97]=0;pr[73]=pr[97]=0;fr[73]=fr[97]=-1;dr[73]=dr[97]=0;hr[73]=hr[97]=1;mr[73]=mr[97]=0;gr[73]=gr[97]=0;tr[73]=tr[97]=1;rr[73]=rr[97]=0;nr[73]=nr[97]=1;lr[145]=lr[25]=0;ur[145]=ur[25]=-1;cr[145]=cr[25]=0;hr[145]=hr[25]=1;mr[145]=mr[25]=0;gr[145]=gr[25]=1;Sr[145]=Sr[25]=0;Cr[145]=Cr[25]=1;wr[145]=wr[25]=1;or[145]=or[25]=-1;sr[145]=sr[25]=0;ar[145]=ar[25]=0;pr[70]=pr[100]=0;fr[70]=fr[100]=1;dr[70]=dr[100]=0;yr[70]=yr[100]=-1;vr[70]=vr[100]=0;br[70]=br[100]=1;xr[70]=xr[100]=0;Ir[70]=Ir[100]=-1;_r[70]=_r[100]=1;tr[70]=tr[100]=1;rr[70]=rr[100]=0;nr[70]=nr[100]=0;pr[101]=pr[69]=0;fr[101]=fr[69]=1;dr[101]=dr[69]=0;tr[101]=tr[69]=1;rr[101]=rr[69]=0;nr[101]=nr[69]=0;Sr[149]=Sr[21]=0;Cr[149]=Cr[21]=1;wr[149]=wr[21]=1;or[149]=or[21]=-1;sr[149]=sr[21]=0;ar[149]=ar[21]=0;yr[86]=yr[84]=-1;vr[86]=vr[84]=0;br[86]=br[84]=1;xr[86]=xr[84]=0;Ir[86]=Ir[84]=-1;_r[86]=_r[84]=1;lr[89]=lr[81]=0;ur[89]=ur[81]=-1;cr[89]=cr[81]=0;hr[89]=hr[81]=1;mr[89]=mr[81]=0;gr[89]=gr[81]=1;lr[96]=lr[74]=0;ur[96]=ur[74]=1;cr[96]=cr[74]=0;pr[96]=pr[74]=-1;fr[96]=fr[74]=0;dr[96]=dr[74]=1;xr[96]=xr[74]=1;Ir[96]=Ir[74]=0;_r[96]=_r[74]=0;tr[96]=tr[74]=1;rr[96]=rr[74]=0;nr[96]=nr[74]=1;lr[24]=lr[146]=0;ur[24]=ur[146]=-1;cr[24]=cr[146]=1;yr[24]=yr[146]=1;vr[24]=vr[146]=0;br[24]=br[146]=1;hr[24]=hr[146]=0;mr[24]=mr[146]=1;gr[24]=gr[146]=1;or[24]=or[146]=0;sr[24]=sr[146]=-1;ar[24]=ar[146]=0;pr[6]=pr[164]=-1;fr[6]=fr[164]=0;dr[6]=dr[164]=1;yr[6]=yr[164]=-1;vr[6]=vr[164]=0;br[6]=br[164]=0;Sr[6]=Sr[164]=0;Cr[6]=Cr[164]=-1;wr[6]=wr[164]=1;xr[6]=xr[164]=1;Ir[6]=Ir[164]=0;_r[6]=_r[164]=0;hr[129]=hr[41]=0;mr[129]=mr[41]=1;gr[129]=gr[41]=1;Sr[129]=Sr[41]=0;Cr[129]=Cr[41]=1;wr[129]=wr[41]=0;tr[129]=tr[41]=-1;rr[129]=rr[41]=0;nr[129]=nr[41]=0;or[129]=or[41]=0;sr[129]=sr[41]=-1;ar[129]=ar[41]=0;yr[66]=yr[104]=0;vr[66]=vr[104]=1;br[66]=br[104]=0;hr[66]=hr[104]=-1;mr[66]=mr[104]=0;gr[66]=gr[104]=1;xr[66]=xr[104]=0;Ir[66]=Ir[104]=-1;_r[66]=_r[104]=0;tr[66]=tr[104]=0;rr[66]=rr[104]=-1;nr[66]=nr[104]=1;lr[144]=lr[26]=-1;ur[144]=ur[26]=0;cr[144]=cr[26]=0;Sr[144]=Sr[26]=1;Cr[144]=Cr[26]=0;wr[144]=wr[26]=1;xr[144]=xr[26]=0;Ir[144]=Ir[26]=1;_r[144]=_r[26]=1;or[144]=or[26]=-1;sr[144]=sr[26]=0;ar[144]=ar[26]=1;pr[36]=pr[134]=0;fr[36]=fr[134]=1;dr[36]=dr[134]=1;yr[36]=yr[134]=0;vr[36]=vr[134]=1;br[36]=br[134]=0;tr[36]=tr[134]=0;rr[36]=rr[134]=-1;nr[36]=nr[134]=1;or[36]=or[134]=1;sr[36]=sr[134]=0;ar[36]=ar[134]=0;lr[9]=lr[161]=-1;ur[9]=ur[161]=0;cr[9]=cr[161]=0;pr[9]=pr[161]=0;fr[9]=fr[161]=-1;dr[9]=dr[161]=0;hr[9]=hr[161]=1;mr[9]=mr[161]=0;gr[9]=gr[161]=0;Sr[9]=Sr[161]=1;Cr[9]=Cr[161]=0;wr[9]=wr[161]=1;lr[136]=0;ur[136]=1;cr[136]=1;pr[136]=0;fr[136]=1;dr[136]=0;yr[136]=-1;vr[136]=0;br[136]=1;hr[136]=-1;mr[136]=0;gr[136]=0;Sr[136]=0;Cr[136]=-1;wr[136]=0;xr[136]=0;Ir[136]=-1;_r[136]=1;tr[136]=1;rr[136]=0;nr[136]=0;or[136]=1;sr[136]=0;ar[136]=1;lr[34]=0;ur[34]=-1;cr[34]=0;pr[34]=0;fr[34]=-1;dr[34]=1;yr[34]=1;vr[34]=0;br[34]=0;hr[34]=1;mr[34]=0;gr[34]=1;Sr[34]=0;Cr[34]=1;wr[34]=1;xr[34]=0;Ir[34]=1;_r[34]=0;tr[34]=-1;rr[34]=0;nr[34]=1;or[34]=-1;sr[34]=0;ar[34]=0;lr[35]=0;ur[35]=1;cr[35]=1;pr[35]=0;fr[35]=-1;dr[35]=1;yr[35]=1;vr[35]=0;br[35]=0;hr[35]=-1;mr[35]=0;gr[35]=0;Sr[35]=0;Cr[35]=-1;wr[35]=0;xr[35]=0;Ir[35]=1;_r[35]=0;tr[35]=-1;rr[35]=0;nr[35]=1;or[35]=1;sr[35]=0;ar[35]=1;lr[153]=0;ur[153]=1;cr[153]=1;hr[153]=-1;mr[153]=0;gr[153]=0;Sr[153]=0;Cr[153]=-1;wr[153]=0;or[153]=1;sr[153]=0;ar[153]=1;pr[102]=0;fr[102]=-1;dr[102]=1;yr[102]=1;vr[102]=0;br[102]=0;xr[102]=0;Ir[102]=1;_r[102]=0;tr[102]=-1;rr[102]=0;nr[102]=1;lr[155]=0;ur[155]=-1;cr[155]=0;hr[155]=1;mr[155]=0;gr[155]=1;Sr[155]=0;Cr[155]=1;wr[155]=1;or[155]=-1;sr[155]=0;ar[155]=0;pr[103]=0;fr[103]=1;dr[103]=0;yr[103]=-1;vr[103]=0;br[103]=1;xr[103]=0;Ir[103]=-1;_r[103]=1;tr[103]=1;rr[103]=0;nr[103]=0;lr[152]=0;ur[152]=1;cr[152]=1;yr[152]=-1;vr[152]=0;br[152]=1;hr[152]=-1;mr[152]=0;gr[152]=0;Sr[152]=0;Cr[152]=-1;wr[152]=0;xr[152]=0;Ir[152]=-1;_r[152]=1;or[152]=1;sr[152]=0;ar[152]=1;lr[156]=0;ur[156]=-1;cr[156]=1;yr[156]=1;vr[156]=0;br[156]=1;hr[156]=-1;mr[156]=0;gr[156]=0;Sr[156]=0;Cr[156]=-1;wr[156]=0;xr[156]=0;Ir[156]=1;_r[156]=1;or[156]=-1;sr[156]=0;ar[156]=1;lr[137]=0;ur[137]=1;cr[137]=1;pr[137]=0;fr[137]=1;dr[137]=0;hr[137]=-1;mr[137]=0;gr[137]=0;Sr[137]=0;Cr[137]=-1;wr[137]=0;tr[137]=1;rr[137]=0;nr[137]=0;or[137]=1;sr[137]=0;ar[137]=1;lr[139]=0;ur[139]=1;cr[139]=1;pr[139]=0;fr[139]=-1;dr[139]=0;hr[139]=1;mr[139]=0;gr[139]=0;Sr[139]=0;Cr[139]=1;wr[139]=0;tr[139]=-1;rr[139]=0;nr[139]=0;or[139]=1;sr[139]=0;ar[139]=1;lr[98]=0;ur[98]=-1;cr[98]=0;pr[98]=0;fr[98]=-1;dr[98]=1;yr[98]=1;vr[98]=0;br[98]=0;hr[98]=1;mr[98]=0;gr[98]=1;xr[98]=0;Ir[98]=1;_r[98]=0;tr[98]=-1;rr[98]=0;nr[98]=1;lr[99]=0;ur[99]=1;cr[99]=0;pr[99]=0;fr[99]=-1;dr[99]=1;yr[99]=1;vr[99]=0;br[99]=0;hr[99]=-1;mr[99]=0;gr[99]=1;xr[99]=0;Ir[99]=-1;_r[99]=0;tr[99]=1;rr[99]=0;nr[99]=1;pr[38]=0;fr[38]=-1;dr[38]=1;yr[38]=1;vr[38]=0;br[38]=0;Sr[38]=0;Cr[38]=1;wr[38]=1;xr[38]=0;Ir[38]=1;_r[38]=0;tr[38]=-1;rr[38]=0;nr[38]=1;or[38]=-1;sr[38]=0;ar[38]=0;pr[39]=0;fr[39]=1;dr[39]=1;yr[39]=-1;vr[39]=0;br[39]=0;Sr[39]=0;Cr[39]=-1;wr[39]=1;xr[39]=0;Ir[39]=1;_r[39]=0;tr[39]=-1;rr[39]=0;nr[39]=1;or[39]=1;sr[39]=0;ar[39]=0;var eO=o(function(e){return[[e.bottomleft,0],[0,0],[0,e.leftbottom]]},"p00"),tO=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0]]},"p01"),rO=o(function(e){return[[e.topright,1],[1,1],[1,e.righttop]]},"p02"),nO=o(function(e){return[[0,e.lefttop],[0,1],[e.topleft,1]]},"p03"),iO=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop]]},"p04"),oO=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[1,e.righttop],[1,e.rightbottom]]},"p05"),sO=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.topleft,1],[e.topright,1]]},"p06"),aO=o(function(e){return[[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},"p07"),Mce=o(function(e){return[[0,0],[0,e.leftbottom],[1,e.rightbottom],[1,0]]},"p08"),Oce=o(function(e){return[[1,0],[e.bottomright,0],[e.topright,1],[1,1]]},"p09"),Lce=o(function(e){return[[1,1],[1,e.righttop],[0,e.lefttop],[0,1]]},"p10"),Ace=o(function(e){return[[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},"p11"),Dce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.leftbottom],[0,e.lefttop]]},"p12"),Fce=o(function(e){return[[e.topleft,1],[e.topright,1],[e.bottomright,0],[e.bottomleft,0]]},"p13"),Nce=o(function(){return[[0,0],[0,1],[1,1],[1,0]]},"p14"),kce=o(function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,1],[e.topleft,1]]},"p15"),Rce=o(function(e){return[[e.topright,1],[1,1],[1,0],[0,0],[0,e.leftbottom]]},"p16"),Bce=o(function(e){return[[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[1,1]]},"p17"),jce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,1]]},"p18"),$ce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.lefttop],[0,1],[e.topleft,1]]},"p19"),Gce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[e.topright,1]]},"p20"),Uce=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop]]},"p21"),Vce=o(function(e){return[[e.topright,1],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1]]},"p22"),zce=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p23"),qce=o(function(e){return[[1,1],[1,e.righttop],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p24"),Hce=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[e.topleft,1],[e.topright,1]]},"p25"),Wce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom]]},"p26"),Xce=o(function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},"p27"),Yce=o(function(e){return[[1,1],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p28"),Zce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1]]},"p29"),Kce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},"p30"),Jce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},"p31"),Qce=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p32"),epe=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"),tpe=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},"p34"),rpe=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p35"),npe=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"),ipe=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"),ope=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"),spe=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"),Fr=[],Nr=[],kr=[],Rr=[],Br=[],jr=[],$r=[],Gr=[];Rr[1]=Br[1]=18;Rr[169]=Br[169]=18;kr[4]=Nr[4]=12;kr[166]=Nr[166]=12;Fr[16]=Gr[16]=4;Fr[154]=Gr[154]=4;jr[64]=$r[64]=22;jr[106]=$r[106]=22;kr[2]=jr[2]=17;Rr[2]=Br[2]=18;kr[168]=jr[168]=17;Rr[168]=Br[168]=18;Fr[8]=Rr[8]=9;Nr[8]=kr[8]=12;Fr[162]=Rr[162]=9;Nr[162]=kr[162]=12;Fr[32]=Gr[32]=4;Nr[32]=$r[32]=1;Fr[138]=Gr[138]=4;Nr[138]=$r[138]=1;Br[128]=Gr[128]=21;jr[128]=$r[128]=22;Br[42]=Gr[42]=21;jr[42]=$r[42]=22;Nr[5]=Br[5]=14;Nr[165]=Br[165]=14;kr[20]=Gr[20]=6;kr[150]=Gr[150]=6;Fr[80]=jr[80]=11;Fr[90]=jr[90]=11;Rr[65]=$r[65]=3;Rr[105]=$r[105]=3;Fr[160]=jr[160]=11;Nr[160]=Br[160]=14;Fr[10]=jr[10]=11;Nr[10]=Br[10]=14;kr[130]=Gr[130]=6;Rr[130]=$r[130]=3;kr[40]=Gr[40]=6;Rr[40]=$r[40]=3;Nr[101]=$r[101]=1;Nr[69]=$r[69]=1;Br[149]=Gr[149]=21;Br[21]=Gr[21]=21;kr[86]=jr[86]=17;kr[84]=jr[84]=17;Fr[89]=Rr[89]=9;Fr[81]=Rr[81]=9;Fr[96]=$r[96]=0;Nr[96]=jr[96]=15;Fr[74]=$r[74]=0;Nr[74]=jr[74]=15;Fr[24]=kr[24]=8;Rr[24]=Gr[24]=7;Fr[146]=kr[146]=8;Rr[146]=Gr[146]=7;Nr[6]=jr[6]=15;kr[6]=Br[6]=16;Nr[164]=jr[164]=15;kr[164]=Br[164]=16;Rr[129]=Gr[129]=7;Br[129]=$r[129]=20;Rr[41]=Gr[41]=7;Br[41]=$r[41]=20;kr[66]=$r[66]=2;Rr[66]=jr[66]=19;kr[104]=$r[104]=2;Rr[104]=jr[104]=19;Fr[144]=Br[144]=10;jr[144]=Gr[144]=23;Fr[26]=Br[26]=10;jr[26]=Gr[26]=23;Nr[36]=Gr[36]=5;kr[36]=$r[36]=2;Nr[134]=Gr[134]=5;kr[134]=$r[134]=2;Fr[9]=Br[9]=10;Nr[9]=Rr[9]=13;Fr[161]=Br[161]=10;Nr[161]=Rr[161]=13;Nr[37]=Gr[37]=5;Br[37]=$r[37]=20;Nr[133]=Gr[133]=5;Br[133]=$r[133]=20;kr[148]=Br[148]=16;jr[148]=Gr[148]=23;kr[22]=Br[22]=16;jr[22]=Gr[22]=23;Fr[82]=kr[82]=8;Rr[82]=jr[82]=19;Fr[88]=kr[88]=8;Rr[88]=jr[88]=19;Fr[73]=$r[73]=0;Nr[73]=Rr[73]=13;Fr[97]=$r[97]=0;Nr[97]=Rr[97]=13;Fr[145]=Rr[145]=9;Br[145]=Gr[145]=21;Fr[25]=Rr[25]=9;Br[25]=Gr[25]=21;Nr[70]=$r[70]=1;kr[70]=jr[70]=17;Nr[100]=$r[100]=1;kr[100]=jr[100]=17;Fr[34]=Rr[34]=9;Nr[34]=kr[34]=12;Br[34]=Gr[34]=21;jr[34]=$r[34]=22;Fr[136]=Gr[136]=4;Nr[136]=$r[136]=1;kr[136]=jr[136]=17;Rr[136]=Br[136]=18;Fr[35]=Gr[35]=4;Nr[35]=kr[35]=12;Rr[35]=Br[35]=18;jr[35]=$r[35]=22;Fr[153]=Gr[153]=4;Rr[153]=Br[153]=18;Nr[102]=kr[102]=12;jr[102]=$r[102]=22;Fr[155]=Rr[155]=9;Br[155]=Gr[155]=23;Nr[103]=$r[103]=1;kr[103]=jr[103]=17;Fr[152]=Gr[152]=4;kr[152]=jr[152]=17;Rr[152]=Br[152]=18;Fr[156]=kr[156]=8;Rr[156]=Br[156]=18;jr[156]=Gr[156]=23;Fr[137]=Gr[137]=4;Nr[137]=$r[137]=1;Rr[137]=Br[137]=18;Fr[139]=Gr[139]=4;Nr[139]=Rr[139]=13;Br[139]=$r[139]=20;Fr[98]=Rr[98]=9;Nr[98]=kr[98]=12;jr[98]=$r[98]=22;Fr[99]=$r[99]=0;Nr[99]=kr[99]=12;Rr[99]=jr[99]=19;Nr[38]=kr[38]=12;Br[38]=Gr[38]=21;jr[38]=$r[38]=22;Nr[39]=Gr[39]=5;kr[39]=Br[39]=16;jr[39]=$r[39]=22;var Je=[];Je[1]=Je[169]=eO;Je[4]=Je[166]=tO;Je[16]=Je[154]=rO;Je[64]=Je[106]=nO;Je[168]=Je[2]=iO;Je[162]=Je[8]=oO;Je[138]=Je[32]=sO;Je[42]=Je[128]=aO;Je[5]=Je[165]=Mce;Je[20]=Je[150]=Oce;Je[80]=Je[90]=Lce;Je[65]=Je[105]=Ace;Je[160]=Je[10]=Dce;Je[130]=Je[40]=Fce;Je[85]=Nce;Je[101]=Je[69]=kce;Je[149]=Je[21]=Rce;Je[86]=Je[84]=Bce;Je[89]=Je[81]=jce;Je[96]=Je[74]=$ce;Je[24]=Je[146]=Gce;Je[6]=Je[164]=Uce;Je[129]=Je[41]=Vce;Je[66]=Je[104]=zce;Je[144]=Je[26]=qce;Je[36]=Je[134]=Hce;Je[9]=Je[161]=Wce;Je[37]=Je[133]=Xce;Je[148]=Je[22]=Yce;Je[82]=Je[88]=Zce;Je[73]=Je[97]=Kce;Je[145]=Je[25]=Jce;Je[70]=Je[100]=Qce;Je[34]=function(e){return[aO(e),oO(e)]};Je[35]=epe;Je[136]=function(e){return[sO(e),iO(e)]};Je[153]=function(e){return[rO(e),eO(e)]};Je[102]=function(e){return[tO(e),nO(e)]};Je[155]=tpe;Je[103]=rpe;Je[152]=function(e){return[rO(e),iO(e)]};Je[156]=npe;Je[137]=function(e){return[sO(e),eO(e)]};Je[139]=ipe;Je[98]=function(e){return[oO(e),nO(e)]};Je[99]=ope;Je[38]=function(e){return[tO(e),aO(e)]};Je[39]=spe;g();g();g();g();g();g();g();g();function lpe(e){return(e>0)-(e<0)||+e}o(lpe,"mathSign");function D0(e,t,r){var n=t[0]-e[0],i=t[1]-e[1],s=r[0]-t[0],l=r[1]-t[1];return lpe(n*l-s*i)}o(D0,"orientationIndex");function Jj(e,t){var r=e.geometry.coordinates[0].map(function(l){return l[0]}),n=e.geometry.coordinates[0].map(function(l){return l[1]}),i=t.geometry.coordinates[0].map(function(l){return l[0]}),s=t.geometry.coordinates[0].map(function(l){return l[1]});return Math.max.apply(null,r)===Math.max.apply(null,i)&&Math.max.apply(null,n)===Math.max.apply(null,s)&&Math.min.apply(null,r)===Math.min.apply(null,i)&&Math.min.apply(null,n)===Math.min.apply(null,s)}o(Jj,"envelopeIsEqual");function lO(e,t){return t.geometry.coordinates[0].every(function(r){return ci(Tn(r),e)})}o(lO,"envelopeContains");function Qj(e,t){return e[0]===t[0]&&e[1]===t[1]}o(Qj,"coordinatesEqual");var upe=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,s=n.to;if(i.coordinates[0]-t.coordinates[0]>=0&&s.coordinates[0]-t.coordinates[0]<0)return 1;if(i.coordinates[0]-t.coordinates[0]<0&&s.coordinates[0]-t.coordinates[0]>=0)return-1;if(i.coordinates[0]-t.coordinates[0]===0&&s.coordinates[0]-t.coordinates[0]===0)return i.coordinates[1]-t.coordinates[1]>=0||s.coordinates[1]-t.coordinates[1]>=0?i.coordinates[1]-s.coordinates[1]:s.coordinates[1]-i.coordinates[1];var l=D0(t.coordinates,i.coordinates,s.coordinates);if(l<0)return 1;if(l>0)return-1;var c=Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2),p=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2);return c-p}),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}(),uO=upe;g();var cpe=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 Bi([this.from.coordinates,this.to.coordinates])},e.prototype.compareTo=function(t){return D0(t.from.coordinates,t.to.coordinates,this.to.coordinates)},e}(),e$=cpe;g();var ppe=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(l,c,p){return c.from.coordinates[1]>t.edges[l].from.coordinates[1]&&(l=p),l},0),n=(r===0?this.length:r)-1,i=(r+1)%this.length,s=D0(this.edges[n].from.coordinates,this.edges[r].from.coordinates,this.edges[i].from.coordinates);return s===0?this.edges[n].from.coordinates[0]>this.edges[i].from.coordinates[0]:s>0},e.prototype.toMultiPoint=function(){return OE(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=Un([t])},e.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=pM(this.toPolygon())},e.findEdgeRingContaining=function(t,r){var n=t.getEnvelope(),i,s;return r.forEach(function(l){var c=l.getEnvelope();if(s&&(i=s.getEnvelope()),!Jj(c,n)&&lO(c,n)){for(var p=t.map(function(P){return P.from.coordinates}),h=void 0,y=o(function(P){l.some(function(E){return Qj(P,E.from.coordinates)})||(h=P)},"_loop_1"),b=0,_=p;b<_.length;b++){var C=_[b];y(C)}h&&l.inside(Tn(h))&&(!s||lO(i,c))&&(s=l)}}),s},e.prototype.inside=function(t){return ci(t,this.toPolygon())},e}(),cO=ppe;function fpe(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(fpe,"validateGeoJson");var RHe=function(){function e(){this.edges=[],this.nodes={}}return o(e,"Graph"),e.fromGeoJson=function(t){fpe(t);var r=new e;return So(t,function(n){ZE(n,"LineString","Graph::fromGeoJson"),XN(n,function(i,s){if(i){var l=r.getNode(i),c=r.getNode(s);r.addEdge(l,c)}return s})}),r},e.prototype.getNode=function(t){var r=uO.buildId(t),n=this.nodes[r];return n||(n=this.nodes[r]=new uO(t)),n},e.prototype.addEdge=function(t,r){var n=new e$(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,s,l=n.length-1;l>=0;--l){var c=n[l],p=c.symetric,h=void 0,y=void 0;c.label===r&&(h=c),p.label===r&&(y=p),!(!h||!y)&&(y&&(s=y),h&&(s&&(s.next=h,s=void 0),i||(i=h)))}s&&(s.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 s=0;n.from.getOuterEdges().forEach(function(l){l.label===t.label&&++s}),s>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 cO;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 dpe(e,t){var r=!0;return So(e,function(n){So(t,function(i){if(r===!1)return!1;r=hpe(n.geometry,i.geometry)})}),r}o(dpe,"booleanDisjoint");function hpe(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return!vpe(e.coordinates,t.coordinates);case"LineString":return!t$(t,e);case"Polygon":return!ci(e,t)}break;case"LineString":switch(t.type){case"Point":return!t$(e,t);case"LineString":return!mpe(e,t);case"Polygon":return!r$(t,e)}break;case"Polygon":switch(t.type){case"Point":return!ci(t,e);case"LineString":return!r$(e,t);case"Polygon":return!gpe(t,e)}}return!1}o(hpe,"disjoint");function t$(e,t){for(var r=0;r<e.coordinates.length-1;r++)if(ype(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}o(t$,"isPointOnLine");function mpe(e,t){var r=Bc(e,t);return r.features.length>0}o(mpe,"isLineOnLine");function r$(e,t){for(var r=0,n=t.coordinates;r<n.length;r++){var i=n[r];if(ci(i,e))return!0}var s=Bc(t,Am(e));return s.features.length>0}o(r$,"isLineInPoly");function gpe(e,t){for(var r=0,n=e.coordinates[0];r<n.length;r++){var i=n[r];if(ci(i,t))return!0}for(var s=0,l=t.coordinates[0];s<l.length;s++){var c=l[s];if(ci(c,e))return!0}var p=Bc(Am(e),Am(t));return p.features.length>0}o(gpe,"isPolyInPoly");function ype(e,t,r){var n=r[0]-e[0],i=r[1]-e[1],s=t[0]-e[0],l=t[1]-e[1],c=n*l-i*s;return c!==0?!1:Math.abs(s)>=Math.abs(l)?s>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:l>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}o(ype,"isPointOnLineSegment");function vpe(e,t){return e[0]===t[0]&&e[1]===t[1]}o(vpe,"compareCoords");var pO=dpe;g();g();g();var _pe=Pn(fO(),1);g();var Spe=Pn(fO(),1);g();function nx(e,t){var r=!1;return So(e,function(n){So(t,function(i){if(r===!0)return!0;r=!pO(n.geometry,i.geometry)})}),r}o(nx,"booleanIntersects");g();var Cpe=Pn(c$(),1);g();var Lpe=Pn(x$(),1);g();g();function _$(e){for(var t=e,r=[];t.parent;)r.unshift(t),t=t.parent;return r}o(_$,"pathTo");function Dpe(){return new S$(function(e){return e.f})}o(Dpe,"getHeap");var gO={search:o(function(e,t,r,n){e.cleanDirty(),n=n||{};var i=n.heuristic||gO.heuristics.manhattan,s=n.closest||!1,l=Dpe(),c=t;for(t.h=i(t,r),l.push(t);l.size()>0;){var p=l.pop();if(p===r)return _$(p);p.closed=!0;for(var h=e.neighbors(p),y=0,b=h.length;y<b;++y){var _=h[y];if(!(_.closed||_.isWall())){var C=p.g+_.getCost(p),P=_.visited;(!P||C<_.g)&&(_.visited=!0,_.parent=p,_.h=_.h||i(_,r),_.g=C,_.f=_.g+_.h,e.markDirty(_),s&&(_.h<c.h||_.h===c.h&&_.g<c.g)&&(c=_),P?l.rescoreElement(_):l.push(_))}}}return s?_$(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),s=Math.abs(t.y-e.y);return r*(i+s)+(n-2*r)*Math.min(i,s)},"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 ix(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 s=new uC(r,n,i[n]);this.grid[r][n]=s,this.nodes.push(s)}}this.init()}o(ix,"Graph");ix.prototype.init=function(){this.dirtyNodes=[];for(var e=0;e<this.nodes.length;e++)gO.cleanNode(this.nodes[e])};ix.prototype.cleanDirty=function(){for(var e=0;e<this.dirtyNodes.length;e++)gO.cleanNode(this.dirtyNodes[e]);this.dirtyNodes=[]};ix.prototype.markDirty=function(e){this.dirtyNodes.push(e)};ix.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};ix.prototype.toString=function(){for(var e=[],t=this.grid,r,n,i,s,l=0,c=t.length;l<c;l++){for(r=[],n=t[l],i=0,s=n.length;i<s;i++)r.push(n[i].weight);e.push(r.join(" "))}return e.join("\n")};function uC(e,t,r){this.x=e,this.y=t,this.weight=r}o(uC,"GridNode");uC.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};uC.prototype.getCost=function(e){return e&&e.x!==this.x&&e.y!==this.y?this.weight*1.41421:this.weight};uC.prototype.isWall=function(){return this.weight===0};function S$(e){this.content=[],this.scoreFunction=e}o(S$,"BinaryHeap");S$.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,s=i-1,l=null,c;if(s<t){var p=this.content[s];c=this.scoreFunction(p),c<n&&(l=s)}if(i<t){var h=this.content[i],y=this.scoreFunction(h);y<(l===null?n:c)&&(l=i)}if(l!==null)this.content[e]=this.content[l],this.content[l]=r,e=l;else break}},"bubbleUp")};g();g();g();g();g();g();g();g();function yO(){this._=null}o(yO,"RedBlackTree");function N0(e){e.U=e.C=e.L=e.R=e.P=e.N=null}o(N0,"RedBlackNode");yO.prototype={constructor:yO,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=C$(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&&(ox(this,r),e=r,r=e.U),r.C=!1,n.C=!0,sx(this,n))):(i=n.L,i&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.L&&(sx(this,r),e=r,r=e.U),r.C=!1,n.C=!0,ox(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,s,l;if(n?i?s=C$(i):s=n:s=i,t?t.L===e?t.L=s:t.R=s:this._=s,n&&i?(l=s.C,s.C=e.C,s.L=n,n.U=s,s!==i?(t=s.U,s.U=e.U,e=s.R,t.L=e,s.R=i,i.U=s):(s.U=t,t=s,e=s.R)):(l=e.C,e=s),e&&(e.U=t),!l){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,ox(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,sx(this,r),r=t.R),r.C=t.C,t.C=r.R.C=!1,ox(this,t),e=this._;break}}else if(r=t.L,r.C&&(r.C=!1,t.C=!0,sx(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,ox(this,r),r=t.L),r.C=t.C,t.C=r.L.C=!1,sx(this,t),e=this._;break}r.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}},"remove")};function ox(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(ox,"RedBlackRotateLeft");function sx(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(sx,"RedBlackRotateRight");function C$(e){for(;e.L;)e=e.L;return e}o(C$,"RedBlackFirst");var vO=yO;g();g();function k0(e,t,r,n){var i=[null,null],s=Xo.push(i)-1;return i.left=e,i.right=t,r&&ax(i,e,t,r),n&&ax(i,t,e,n),aa[e.index].halfedges.push(s),aa[t.index].halfedges.push(s),i}o(k0,"createEdge");function R0(e,t,r){var n=[t,r];return n.left=e,n}o(R0,"createBorderEdge");function ax(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(ax,"setEdgeEnd");function Fpe(e,t,r,n,i){var s=e[0],l=e[1],c=s[0],p=s[1],h=l[0],y=l[1],b=0,_=1,C=h-c,P=y-p,E;if(E=t-c,!(!C&&E>0)){if(E/=C,C<0){if(E<b)return;E<_&&(_=E)}else if(C>0){if(E>_)return;E>b&&(b=E)}if(E=n-c,!(!C&&E<0)){if(E/=C,C<0){if(E>_)return;E>b&&(b=E)}else if(C>0){if(E<b)return;E<_&&(_=E)}if(E=r-p,!(!P&&E>0)){if(E/=P,P<0){if(E<b)return;E<_&&(_=E)}else if(P>0){if(E>_)return;E>b&&(b=E)}if(E=i-p,!(!P&&E<0)){if(E/=P,P<0){if(E>_)return;E>b&&(b=E)}else if(P>0){if(E<b)return;E<_&&(_=E)}return!(b>0)&&!(_<1)||(b>0&&(e[0]=[c+b*C,p+b*P]),_<1&&(e[1]=[c+_*C,p+_*P])),!0}}}}}o(Fpe,"clipEdge");function Npe(e,t,r,n,i){var s=e[1];if(s)return!0;var l=e[0],c=e.left,p=e.right,h=c[0],y=c[1],b=p[0],_=p[1],C=(h+b)/2,P=(y+_)/2,E,w;if(_===y){if(C<t||C>=n)return;if(h>b){if(!l)l=[C,r];else if(l[1]>=i)return;s=[C,i]}else{if(!l)l=[C,i];else if(l[1]<r)return;s=[C,r]}}else if(E=(h-b)/(_-y),w=P-E*C,E<-1||E>1)if(h>b){if(!l)l=[(r-w)/E,r];else if(l[1]>=i)return;s=[(i-w)/E,i]}else{if(!l)l=[(i-w)/E,i];else if(l[1]<r)return;s=[(r-w)/E,r]}else if(y<_){if(!l)l=[t,E*t+w];else if(l[0]>=n)return;s=[n,E*n+w]}else{if(!l)l=[n,E*n+w];else if(l[0]<t)return;s=[t,E*t+w]}return e[0]=l,e[1]=s,!0}o(Npe,"connectEdge");function w$(e,t,r,n){for(var i=Xo.length,s;i--;)(!Npe(s=Xo[i],e,t,r,n)||!Fpe(s,e,t,r,n)||!(Math.abs(s[0][0]-s[1][0])>zn||Math.abs(s[0][1]-s[1][1])>zn))&&delete Xo[i]}o(w$,"clipEdges");function P$(e){return aa[e.index]={site:e,halfedges:[]}}o(P$,"createCell");function kpe(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(kpe,"cellHalfedgeAngle");function bO(e,t){return t[+(t.left!==e.site)]}o(bO,"cellHalfedgeStart");function Rpe(e,t){return t[+(t.left===e.site)]}o(Rpe,"cellHalfedgeEnd");function T$(){for(var e=0,t=aa.length,r,n,i,s;e<t;++e)if((r=aa[e])&&(s=(n=r.halfedges).length)){var l=new Array(s),c=new Array(s);for(i=0;i<s;++i)l[i]=i,c[i]=kpe(r,Xo[n[i]]);for(l.sort(function(p,h){return c[h]-c[p]}),i=0;i<s;++i)c[i]=n[l[i]];for(i=0;i<s;++i)n[i]=c[i]}}o(T$,"sortCellHalfedges");function E$(e,t,r,n){var i=aa.length,s,l,c,p,h,y,b,_,C,P,E,w,O=!0;for(s=0;s<i;++s)if(l=aa[s]){for(c=l.site,h=l.halfedges,p=h.length;p--;)Xo[h[p]]||h.splice(p,1);for(p=0,y=h.length;p<y;)P=Rpe(l,Xo[h[p]]),E=P[0],w=P[1],b=bO(l,Xo[h[++p%y]]),_=b[0],C=b[1],(Math.abs(E-_)>zn||Math.abs(w-C)>zn)&&(h.splice(p,0,Xo.push(R0(c,P,Math.abs(E-e)<zn&&n-w>zn?[e,Math.abs(_-e)<zn?C:n]:Math.abs(w-n)<zn&&r-E>zn?[Math.abs(C-n)<zn?_:r,n]:Math.abs(E-r)<zn&&w-t>zn?[r,Math.abs(_-r)<zn?C:t]:Math.abs(w-t)<zn&&E-e>zn?[Math.abs(C-t)<zn?_:e,t]:null))-1),++y);y&&(O=!1)}if(O){var D,A,k,j=1/0;for(s=0,O=null;s<i;++s)(l=aa[s])&&(c=l.site,D=c[0]-e,A=c[1]-t,k=D*D+A*A,k<j&&(j=k,O=l));if(O){var W=[e,t],Y=[e,n],N=[r,n],Z=[r,t];O.halfedges.push(Xo.push(R0(c=O.site,W,Y))-1,Xo.push(R0(c,Y,N))-1,Xo.push(R0(c,N,Z))-1,Xo.push(R0(c,Z,W))-1)}}for(s=0;s<i;++s)(l=aa[s])&&(l.halfedges.length||delete aa[s])}o(E$,"clipCells");g();var M$=[],cC;function Bpe(){N0(this),this.x=this.y=this.arc=this.site=this.cy=null}o(Bpe,"Circle");function km(e){var t=e.P,r=e.N;if(!(!t||!r)){var n=t.site,i=e.site,s=r.site;if(n!==s){var l=i[0],c=i[1],p=n[0]-l,h=n[1]-c,y=s[0]-l,b=s[1]-c,_=2*(p*b-h*y);if(!(_>=-O$)){var C=p*p+h*h,P=y*y+b*b,E=(b*C-h*P)/_,w=(p*P-y*C)/_,O=M$.pop()||new Bpe;O.arc=e,O.site=i,O.x=E+l,O.y=(O.cy=w+c)+Math.sqrt(E*E+w*w),e.circle=O;for(var D=null,A=B0._;A;)if(O.y<A.y||O.y===A.y&&O.x<=A.x)if(A.L)A=A.L;else{D=A.P;break}else if(A.R)A=A.R;else{D=A;break}B0.insert(D,O),D||(cC=O)}}}}o(km,"attachCircle");function Rm(e){var t=e.circle;t&&(t.P||(cC=t.N),B0.remove(t),M$.push(t),N0(t),e.circle=null)}o(Rm,"detachCircle");var A$=[];function jpe(){N0(this),this.edge=this.site=this.circle=null}o(jpe,"Beach");function L$(e){var t=A$.pop()||new jpe;return t.site=e,t}o(L$,"createBeach");function xO(e){Rm(e),Bm.remove(e),A$.push(e),N0(e)}o(xO,"detachBeach");function D$(e){var t=e.circle,r=t.x,n=t.cy,i=[r,n],s=e.P,l=e.N,c=[e];xO(e);for(var p=s;p.circle&&Math.abs(r-p.circle.x)<zn&&Math.abs(n-p.circle.cy)<zn;)s=p.P,c.unshift(p),xO(p),p=s;c.unshift(p),Rm(p);for(var h=l;h.circle&&Math.abs(r-h.circle.x)<zn&&Math.abs(n-h.circle.cy)<zn;)l=h.N,c.push(h),xO(h),h=l;c.push(h),Rm(h);var y=c.length,b;for(b=1;b<y;++b)h=c[b],p=c[b-1],ax(h.edge,p.site,h.site,i);p=c[0],h=c[y-1],h.edge=k0(p.site,h.site,null,i),km(p),km(h)}o(D$,"removeBeach");function F$(e){for(var t=e[0],r=e[1],n,i,s,l,c=Bm._;c;)if(s=N$(c,r)-t,s>zn)c=c.L;else if(l=t-$pe(c,r),l>zn){if(!c.R){n=c;break}c=c.R}else{s>-zn?(n=c.P,i=c):l>-zn?(n=c,i=c.N):n=i=c;break}P$(e);var p=L$(e);if(Bm.insert(n,p),!(!n&&!i)){if(n===i){Rm(n),i=L$(n.site),Bm.insert(p,i),p.edge=i.edge=k0(n.site,p.site),km(n),km(i);return}if(!i){p.edge=k0(n.site,p.site);return}Rm(n),Rm(i);var h=n.site,y=h[0],b=h[1],_=e[0]-y,C=e[1]-b,P=i.site,E=P[0]-y,w=P[1]-b,O=2*(_*w-C*E),D=_*_+C*C,A=E*E+w*w,k=[(w*D-C*A)/O+y,(_*A-E*D)/O+b];ax(i.edge,h,P,k),p.edge=k0(h,e,null,k),i.edge=k0(e,P,null,k),km(n),km(i)}}o(F$,"addBeach");function N$(e,t){var r=e.site,n=r[0],i=r[1],s=i-t;if(!s)return n;var l=e.P;if(!l)return-1/0;r=l.site;var c=r[0],p=r[1],h=p-t;if(!h)return c;var y=c-n,b=1/s-1/h,_=y/h;return b?(-_+Math.sqrt(_*_-2*b*(y*y/(-2*h)-p+h/2+i-s/2)))/b+n:(n+c)/2}o(N$,"leftBreakPoint");function $pe(e,t){var r=e.N;if(r)return N$(r,t);var n=e.site;return n[1]===t?n[0]:1/0}o($pe,"rightBreakPoint");var zn=1e-6,O$=1e-12,Bm,aa,B0,Xo;function Gpe(e,t,r){return(e[0]-r[0])*(t[1]-e[1])-(e[0]-t[0])*(r[1]-e[1])}o(Gpe,"triangleArea");function Upe(e,t){return t[1]-e[1]||t[0]-e[0]}o(Upe,"lexicographic");function pC(e,t){var r=e.sort(Upe).pop(),n,i,s;for(Xo=[],aa=new Array(e.length),Bm=new vO,B0=new vO;;)if(s=cC,r&&(!s||r[1]<s.y||r[1]===s.y&&r[0]<s.x))(r[0]!==n||r[1]!==i)&&(F$(r),n=r[0],i=r[1]),r=e.pop();else if(s)D$(s.arc);else break;if(T$(),t){var l=+t[0][0],c=+t[0][1],p=+t[1][0],h=+t[1][1];w$(l,c,p,h),E$(l,c,p,h)}this.edges=Xo,this.cells=aa,Bm=B0=Xo=aa=null}o(pC,"Diagram");pC.prototype={constructor:pC,polygons:o(function(){var e=this.edges;return this.cells.map(function(t){var r=t.halfedges.map(function(n){return bO(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=(s=r.halfedges).length)for(var i=r.site,s,l=-1,c,p,h=t[s[c-1]],y=h.left===i?h.right:h.left;++l<c;)p=y,h=t[s[l]],y=h.left===i?h.right:h.left,p&&y&&n<p.index&&n<y.index&&Gpe(i,p,y)<0&&e.push([i.data,p.data,y.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,s=n._found||0,l=n.cells.length,c;!(c=n.cells[s]);)if(++s>=l)return null;var p=e-c.site[0],h=t-c.site[1],y=p*p+h*h;do c=n.cells[i=s],s=null,c.halfedges.forEach(function(b){var _=n.edges[b],C=_.left;if(!((C===c.site||!C)&&!(C=_.right))){var P=e-C[0],E=t-C[1],w=P*P+E*E;w<y&&(y=w,s=C.index)}});while(s!==null);return n._found=i,r==null||y<=r*r?c.site:null},"find")};g();g();g();g();g();g();g();g();g();g();g();g();var Zpe=Pn(j0(),1);g();var MO=Pn(j$(),1);g();g();g();function la(){return new hC}o(la,"default");function hC(){this.reset()}o(hC,"Adder");hC.prototype={constructor:hC,reset:o(function(){this.s=this.t=0},"reset"),add:o(function(e){$$(dC,e,this.t),$$(this,dC.s,this.s),this.s?this.t+=dC.t:this.s=dC.t},"add"),valueOf:o(function(){return this.s},"valueOf")};var dC=new hC;function $$(e,t,r){var n=e.s=t+r,i=n-t,s=n-i;e.t=t-s+(r-i)}o($$,"add");g();var gn=1e-6;var Dn=Math.PI,To=Dn/2,mC=Dn/4,Gc=Dn*2,jm=180/Dn,Ea=Dn/180,$i=Math.abs,Du=Math.atan,Ma=Math.atan2,Hr=Math.cos;var gC=Math.exp;var lx=Math.log;var Zt=Math.sin;var ds=Math.sqrt,ux=Math.tan;function SO(e){return e>1?0:e<-1?Dn:Math.acos(e)}o(SO,"acos");function ua(e){return e>1?To:e<-1?-To:Math.asin(e)}o(ua,"asin");g();function Fu(){}o(Fu,"noop");g();var Kpe=la(),xKe=la();g();g();function $m(e){var t=e[0],r=e[1],n=Hr(r);return[n*Hr(t),n*Zt(t),Zt(r)]}o($m,"cartesian");function cx(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(cx,"cartesianCross");function px(e){var t=ds(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}o(px,"cartesianNormalizeInPlace");var FKe=la();g();g();g();g();g();function U$(e,t){return[e>Dn?e-Gc:e<-Dn?e+Gc:e,t]}o(U$,"rotationIdentity");U$.invert=U$;g();g();function yC(){var e=[],t;return{point:o(function(r,n){t.push([r,n])},"point"),lineStart:o(function(){e.push(t=[])},"lineStart"),lineEnd:Fu,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(yC,"default");g();g();g();function vC(e,t){return $i(e[0]-t[0])<gn&&$i(e[1]-t[1])<gn}o(vC,"default");function bC(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(bC,"Intersection");function xC(e,t,r,n,i){var s=[],l=[],c,p;if(e.forEach(function(P){if(!((E=P.length-1)<=0)){var E,w=P[0],O=P[E],D;if(vC(w,O)){for(i.lineStart(),c=0;c<E;++c)i.point((w=P[c])[0],w[1]);i.lineEnd();return}s.push(D=new bC(w,P,null,!0)),l.push(D.o=new bC(w,null,D,!1)),s.push(D=new bC(O,P,null,!1)),l.push(D.o=new bC(O,null,D,!0))}}),!!s.length){for(l.sort(t),V$(s),V$(l),c=0,p=l.length;c<p;++c)l[c].e=r=!r;for(var h=s[0],y,b;;){for(var _=h,C=!0;_.v;)if((_=_.n)===h)return;y=_.z,i.lineStart();do{if(_.v=_.o.v=!0,_.e){if(C)for(c=0,p=y.length;c<p;++c)i.point((b=y[c])[0],b[1]);else n(_.x,_.n.x,1,i);_=_.n}else{if(C)for(y=_.p.z,c=y.length-1;c>=0;--c)i.point((b=y[c])[0],b[1]);else n(_.x,_.p.x,-1,i);_=_.p}_=_.o,y=_.z,C=!C}while(!_.v);i.lineEnd()}}}o(xC,"default");function V$(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(V$,"link");g();g();g();function cf(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(cf,"default");g();function IC(e){return e.length===1&&(e=efe(e)),{left:o(function(t,r,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var s=n+i>>>1;e(t[s],r)<0?n=s+1:i=s}return n},"left"),right:o(function(t,r,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var s=n+i>>>1;e(t[s],r)>0?i=s:n=s+1}return n},"right")}}o(IC,"default");function efe(e){return function(t,r){return cf(e(t),r)}}o(efe,"ascendingComparator");var z$=IC(cf),tfe=z$.right,rfe=z$.left;g();g();g();g();g();g();g();g();g();var q$=Array.prototype,ife=q$.slice,ofe=q$.map;g();g();g();g();var vQe=Math.sqrt(50),bQe=Math.sqrt(10),xQe=Math.sqrt(2);g();g();g();g();g();g();g();g();function fx(e){for(var t=e.length,r,n=-1,i=0,s,l;++n<t;)i+=e[n].length;for(s=new Array(i);--t>=0;)for(l=e[t],r=l.length;--r>=0;)s[--i]=l[r];return s}o(fx,"default");g();g();g();g();g();g();g();var dfe=1e9,$tt=-dfe;g();g();var CO=la();function SC(e,t){var r=t[0],n=t[1],i=[Zt(r),-Hr(r),0],s=0,l=0;CO.reset();for(var c=0,p=e.length;c<p;++c)if(y=(h=e[c]).length)for(var h,y,b=h[y-1],_=b[0],C=b[1]/2+mC,P=Zt(C),E=Hr(C),w=0;w<y;++w,_=D,P=k,E=j,b=O){var O=h[w],D=O[0],A=O[1]/2+mC,k=Zt(A),j=Hr(A),W=D-_,Y=W>=0?1:-1,N=Y*W,Z=N>Dn,le=P*k;if(CO.add(Ma(le*Y*Zt(N),E*j+le*Hr(N))),s+=Z?W+Y*Gc:W,Z^_>=r^D>=r){var se=cx($m(b),$m(O));px(se);var U=cx(i,se);px(U);var ye=(Z^W>=0?-1:1)*ua(U[2]);(n>ye||n===ye&&(se[0]||se[1]))&&(l+=Z^W>=0?1:-1)}}return(s<-gn||s<gn&&CO<-gn)^l&1}o(SC,"default");g();g();var ert=la();g();g();g();g();g();var Lrt=la(),Art=la();g();var gfe=1/0;var Rrt=-gfe;g();g();function wO(e){this._context=e}o(wO,"PathContext");wO.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,Gc);break}}},"point"),result:Fu};g();var Qrt=la();g();function PO(){this._string=[]}o(PO,"PathString");PO.prototype={_radius:4.5,_circle:X$(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=X$(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 X$(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}o(X$,"circle");g();g();g();g();g();g();function CC(e,t,r,n){return function(i,s){var l=t(s),c=i.invert(n[0],n[1]),p=yC(),h=t(p),y=!1,b,_,C,P={point:E,lineStart:O,lineEnd:D,polygonStart:o(function(){P.point=A,P.lineStart=k,P.lineEnd=j,_=[],b=[]},"polygonStart"),polygonEnd:o(function(){P.point=E,P.lineStart=O,P.lineEnd=D,_=fx(_);var W=SC(b,c);_.length?(y||(s.polygonStart(),y=!0),xC(_,bfe,W,r,s)):W&&(y||(s.polygonStart(),y=!0),s.lineStart(),r(null,null,1,s),s.lineEnd()),y&&(s.polygonEnd(),y=!1),_=b=null},"polygonEnd"),sphere:o(function(){s.polygonStart(),s.lineStart(),r(null,null,1,s),s.lineEnd(),s.polygonEnd()},"sphere")};function E(W,Y){var N=i(W,Y);e(W=N[0],Y=N[1])&&s.point(W,Y)}o(E,"point");function w(W,Y){var N=i(W,Y);l.point(N[0],N[1])}o(w,"pointLine");function O(){P.point=w,l.lineStart()}o(O,"lineStart");function D(){P.point=E,l.lineEnd()}o(D,"lineEnd");function A(W,Y){C.push([W,Y]);var N=i(W,Y);h.point(N[0],N[1])}o(A,"pointRing");function k(){h.lineStart(),C=[]}o(k,"ringStart");function j(){A(C[0][0],C[0][1]),h.lineEnd();var W=h.clean(),Y=p.result(),N,Z=Y.length,le,se,U;if(C.pop(),b.push(C),C=null,!!Z){if(W&1){if(se=Y[0],(le=se.length-1)>0){for(y||(s.polygonStart(),y=!0),s.lineStart(),N=0;N<le;++N)s.point((U=se[N])[0],U[1]);s.lineEnd()}return}Z>1&&W&2&&Y.push(Y.pop().concat(Y.shift())),_.push(Y.filter(vfe))}}return o(j,"ringEnd"),P}}o(CC,"default");function vfe(e){return e.length>1}o(vfe,"validSegment");function bfe(e,t){return((e=e.x)[0]<0?e[1]-To-gn:To-e[1])-((t=t.x)[0]<0?t[1]-To-gn:To-t[1])}o(bfe,"compareIntersection");var xfe=CC(function(){return!0},Ife,Sfe,[-Dn,-To]);function Ife(e){var t=NaN,r=NaN,n=NaN,i;return{lineStart:o(function(){e.lineStart(),i=1},"lineStart"),point:o(function(s,l){var c=s>0?Dn:-Dn,p=$i(s-t);$i(p-Dn)<gn?(e.point(t,r=(r+l)/2>0?To:-To),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(c,r),e.point(s,r),i=0):n!==c&&p>=Dn&&($i(t-n)<gn&&(t-=n*gn),$i(s-c)<gn&&(s-=c*gn),r=_fe(t,r,s,l),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(c,r),i=0),e.point(t=s,r=l),n=c},"point"),lineEnd:o(function(){e.lineEnd(),t=r=NaN},"lineEnd"),clean:o(function(){return 2-i},"clean")}}o(Ife,"clipAntimeridianLine");function _fe(e,t,r,n){var i,s,l=Zt(e-r);return $i(l)>gn?Du((Zt(t)*(s=Hr(n))*Zt(r)-Zt(n)*(i=Hr(t))*Zt(e))/(i*s*l)):(t+n)/2}o(_fe,"clipAntimeridianIntersect");function Sfe(e,t,r,n){var i;if(e==null)i=r*To,n.point(-Dn,i),n.point(0,i),n.point(Dn,i),n.point(Dn,0),n.point(Dn,-i),n.point(0,-i),n.point(-Dn,-i),n.point(-Dn,0),n.point(-Dn,i);else if($i(e[0]-t[0])>gn){var s=e[0]<t[0]?Dn:-Dn;i=r*s/2,n.point(-s,i),n.point(0,i),n.point(s,i)}else n.point(t[0],t[1])}o(Sfe,"clipAntimeridianInterpolate");g();g();function wC(e){return function(t){var r=new TO;for(var n in e)r[n]=e[n];return r.stream=t,r}}o(wC,"transformer");function TO(){}o(TO,"TransformStream");TO.prototype={constructor:TO,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 rit=Hr(30*Ea);var vit=wC({point:o(function(e,t){this.stream.point(e*Ea,t*Ea)},"point")});g();g();g();g();function PC(e){return function(t,r){var n=Hr(t),i=Hr(r),s=e(n*i);return[s*i*Zt(t),s*Zt(r)]}}o(PC,"azimuthalRaw");function Uc(e){return function(t,r){var n=ds(t*t+r*r),i=e(n),s=Zt(i),l=Hr(i);return[Ma(t*s,n*l),ua(n&&r*s/n)]}}o(Uc,"azimuthalInvert");var tG=PC(function(e){return ds(2/(1+e))});tG.invert=Uc(function(e){return 2*ua(e/2)});g();var rG=PC(function(e){return(e=SO(e))&&e/Zt(e)});rG.invert=Uc(function(e){return e});g();g();function EO(e,t){return[e,lx(ux((To+t)/2))]}o(EO,"mercatorRaw");EO.invert=function(e,t){return[e,2*Du(gC(t))-To]};g();g();function TC(e,t){return[e,t]}o(TC,"equirectangularRaw");TC.invert=TC;g();function nG(e,t){var r=Hr(t),n=Hr(e)*r;return[r*Zt(e)/n,Zt(t)/n]}o(nG,"gnomonicRaw");nG.invert=Uc(Du);g();g();function iG(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(iG,"naturalEarth1Raw");iG.invert=function(e,t){var r=t,n=25,i;do{var s=r*r,l=s*s;r-=i=(r*(1.007226+s*(.015085+l*(-.044475+.028874*s-.005916*l)))-t)/(1.007226+s*(.015085*3+l*(-.044475*7+.028874*9*s-.005916*11*l)))}while($i(i)>gn&&--n>0);return[e/(.8707+(s=r*r)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),r]};g();function oG(e,t){return[Hr(t)*Zt(e),Zt(t)]}o(oG,"orthographicRaw");oG.invert=Uc(ua);g();function sG(e,t){var r=Hr(t),n=1+Hr(e)*r;return[r*Zt(e)/n,Zt(t)/n]}o(sG,"stereographicRaw");sG.invert=Uc(function(e){return 2*Du(e)});g();function aG(e,t){return[lx(ux((To+t)/2)),-e]}o(aG,"transverseMercatorRaw");aG.invert=function(e,t){return[-t,2*Du(gC(e))-To]};g();var Mfe=Pn(j0(),1);g();var Ofe=Pn(j0(),1);g();var Afe=Pn(j0(),1);g();g();var Dfe=Pn(j0(),1);g();g();g();g();var Fl,En,ll,dx,LO,Gm=class Gm extends Mu{constructor(r,n){super(n.mvfData.properties.id,r);G(this,dx);x(this,"__type",Gm.__type);G(this,Fl);G(this,En,{});G(this,ll);q(this,Fl,r),q(this,ll,n.mvfData)}static is(r){return r.__type===Gm.__type}get focusTarget(){return this}get name(){var r,n;return"name"in d(this,ll).properties?(n=ke(this,dx,LO).call(this,"name"))!=null?n:"":(r=d(this,ll).properties.externalId)!=null?r:""}get shortName(){var r,n;return"shortName"in d(this,ll).properties?(n=ke(this,dx,LO).call(this,"shortName"))!=null?n:"":(r=d(this,ll).properties.externalId)!=null?r:""}get externalId(){var r;return(r=d(this,ll).properties.externalId)!=null?r:""}get elevation(){return d(this,ll).properties.elevation}get spaces(){if(d(this,En).spaces==null){let r=d(this,Fl).spaces.filter(n=>n.floor.id===this.id);d(this,En).spaces=r}return d(this,En).spaces}get geoJSON(){var r;return{type:"Feature",properties:null,geometry:(r=d(this,ll).geometry)!=null?r:{type:"Polygon",coordinates:[]}}}get objects(){if(d(this,En).objects==null){let r=d(this,Fl).objects.filter(n=>n.floor.id===this.id);d(this,En).objects=r}return d(this,En).objects}get connections(){if(d(this,En).connections==null){let r=d(this,Fl).connections.filter(n=>n.floors.includes(this));d(this,En).connections=r}return d(this,En).connections}get doors(){if(d(this,En).doors==null){let r=d(this,Fl).doors.filter(n=>n.floor.id===this.id);d(this,En).doors=r}return d(this,En).doors}get annotations(){if(d(this,En).annotations==null){let r=d(this,Fl).annotations.filter(n=>n.floor.id===this.id);d(this,En).annotations=r}return d(this,En).annotations}get pois(){if(d(this,En).pois==null){let r=d(this,Fl).pointsOfInterest.filter(n=>n.floor.id===this.id);d(this,En).pois=r}return d(this,En).pois}get floorStack(){if(d(this,En).floorStack==null){let r=d(this,Fl).floorStacks.find(n=>n.floors.includes(this));d(this,En).floorStack=r}return d(this,En).floorStack}get center(){if(d(this,En).center==null){let r=d(this,ll).geometry;if(r==null)d(this,En).center=new St({latitude:0,longitude:0,floorId:this.id});else{let n=kc(r);d(this,En).center=new St({latitude:n.geometry.coordinates[1],longitude:n.geometry.coordinates[0],floorId:this.id})}}return d(this,En).center}toJSON(){return{__type:Gm.__type,id:this.id,name:this.name,shortName:this.shortName,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,En)))delete d(this,En)[r]}};Fl=new WeakMap,En=new WeakMap,ll=new WeakMap,dx=new WeakSet,LO=o(function(r){let n=d(this,ll).properties[r];return d(this,Fl).getPropTranslation(this.__type,r,this.id,n)},"#translate"),o(Gm,"Floor"),x(Gm,"__type","floor");var OO=Gm,ca=OO;g();g();g();var hx=o(e=>e!=null,"notNull");g();function mx(e){let t;if(wo.is(e)||Au.is(e)||Oa.is(e)||of.is(e)||Nl.is(e))t=e.center;else if(pf.is(e)||ff.is(e))t=e.coordinate;else if(St.is(e))t=e;else if(tf.is(e))t=e.coordinate;else if(Vc.is(e))t=e.coordinates[0];else return;return t}o(mx,"getCoordinateFromStuffs");g();g();var Um={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!1,floorHeight:10}},zc="ExteriorWalls",Xd="Walls",uG=0,G0="InteriorDoors",U0="ExteriorDoors",Zi="GeometryLayer",df="LabelsLayer",qc="MarkersLayer",gx="FootprintLayer",V0="OcclusionLayer",cG="ImagesLayer",Vm="FacadesLayer";var pG=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],fG={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function AO(e){var t,r;(t=e.outdoorView)!=null&&t.enabled&&!((r=e.outdoorView)!=null&&r.token)&&ce.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}o(AO,"validateOptions");function DO(e,t){var i,s,l,c,p,h;let r=((i=e==null?void 0:e.outdoorView)==null?void 0:i.token)||t.outdoorViewToken,n=re(R(R({},Um),e),{outdoorView:R({enabled:((s=e==null?void 0:e.outdoorView)==null?void 0:s.enabled)===void 0?!!r:(l=e==null?void 0:e.outdoorView)==null?void 0:l.enabled,layersHiddenByGeometry:(c=Um.outdoorView)==null?void 0:c.layersHiddenByGeometry},e==null?void 0:e.outdoorView),bearing:(h=(p=e==null?void 0:e.bearing)!=null?p:t.naturalBearing)!=null?h:0,imagePlacementOptions:R(R({},Um.imagePlacementOptions),e==null?void 0:e.imagePlacementOptions),multiFloorView:R(R({},Um.multiFloorView),e==null?void 0:e.multiFloorView)});return r&&n.outdoorView&&(n.outdoorView.token=r),n}o(DO,"handleShow3DMapOptionDefault");function dG(e){let t={remove_watermark:!1};if(e)try{let r=hS(e);Object.assign(t,r.capabilities)}catch(r){ce.error("Error decoding capabilities from token",r)}return t}o(dG,"handleTokenCapabilities");var Yd,kl,hf,zm=class zm extends fs{constructor(r,n){let i=Object.values(n.mvfDataByFloorId)[0];super(r,i);x(this,"__type",zm.__type);G(this,Yd);G(this,kl);G(this,hf);q(this,kl,{}),q(this,Yd,r),q(this,hf,n.mvfDataByFloorId)}static is(r){return r.__type===zm.__type}get accessible(){var r;return(r=Object.values(d(this,hf))[0].properties.accessible)!=null?r:!1}get type(){var r,n;return(n=(r=Object.values(d(this,hf))[0].properties.kind)==null?void 0:r.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(d(this,hf))[0].properties.extra}get coordinates(){return d(this,kl).coordinates==null&&(d(this,kl).coordinates=Object.entries(d(this,hf)).map(([r,n])=>new St(n.geometry.coordinates[1],n.geometry.coordinates[0],r))),d(this,kl).coordinates}get nodes(){return Object.values(d(this,hf))[0].properties.nodes.map(r=>d(this,Yd).getById("node",r))}get floors(){return this.coordinates.map(r=>r.floorId?d(this,Yd).getById("floor",r.floorId):void 0).filter(hx)}get locationProfiles(){var n,i,s,l,c;if(d(this,kl).locationProfiles!=null)return d(this,kl).locationProfiles;let r=super.locationProfiles;if(r==null||r.length===0){let p=[(i=(n=this.coordinates[0])==null?void 0:n.longitude)!=null?i:0,(l=(s=this.coordinates[0])==null?void 0:s.latitude)!=null?l:0],h=Fc(p),y=(c=d(this,Yd).mvfConnectionIdsByLatLon[h])!=null?c:[];for(let b of y){let _=d(this,Yd).locationProfilesByAttachedFeatureId[b];if(_!=null){r=_;break}}}return d(this,kl).locationProfiles=r!=null?r:[],r}get focusTarget(){return this.coordinates}toJSON(){return{__type:zm.__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,kl)))delete d(this,kl)[r]}};Yd=new WeakMap,kl=new WeakMap,hf=new WeakMap,o(zm,"Connection"),x(zm,"__type","connection");var FO=zm,Zd=FO;g();var yx,Hm,Kd,Wm,qm=class qm extends fs{constructor(r,n){super(r,n.mvfData);x(this,"__type",qm.__type);G(this,yx);G(this,Hm);G(this,Kd,{});G(this,Wm);q(this,yx,r),q(this,Hm,n.floorId),q(this,Wm,n.mvfData)}static is(r){return r.__type===qm.__type}get type(){let r=d(this,Wm).properties.kind;return r==null&&(r="object"),r==="Desks"&&(r="desk"),r.toLowerCase()}get floor(){let r=d(this,yx).getById("floor",d(this,Hm));if(r==null)throw new Error("Floor ".concat(d(this,Hm)," not found!"));return r}get center(){var r;if(d(this,Kd).center==null){let[n,i]=(r=d(this,Wm).properties.center)!=null?r:[0,0];d(this,Kd).center=new St(i,n,d(this,Hm))}return d(this,Kd).center}get geoJSON(){return re(R({},d(this,Wm)),{properties:null})}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{__type:qm.__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,Kd)))d(this,Kd)[r]=null}};yx=new WeakMap,Hm=new WeakMap,Kd=new WeakMap,Wm=new WeakMap,o(qm,"MapObject"),x(qm,"__type","object");var NO=qm,Oa=NO;g();var vx,Ym,Jd,z0,Xm=class Xm extends fs{constructor(r,n){super(r,n.mvfData);x(this,"__type",Xm.__type);G(this,vx);G(this,Ym);G(this,Jd,{});G(this,z0);q(this,vx,r),q(this,z0,n.mvfData),q(this,Ym,n.floorId)}static is(r){return r.__type===Xm.__type}get floor(){let r=d(this,vx).getById("floor",d(this,Ym));if(r==null)throw new Error("Floor ".concat(d(this,Ym)," not found!"));return r}get coordinate(){var r;if(d(this,Jd).coordinate==null){let[n,i]=(r=d(this,z0).geometry.coordinates)!=null?r:[0,0];d(this,Jd).coordinate=new St(i,n,d(this,Ym))}return d(this,Jd).coordinate}get geoJSON(){return re(R({},d(this,z0)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Xm.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let r in d(this,Jd))d(this,Jd)[r]=null}};vx=new WeakMap,Ym=new WeakMap,Jd=new WeakMap,z0=new WeakMap,o(Xm,"PointOfInterest"),x(Xm,"__type","point-of-interest");var kO=Xm,pf=kO;g();var bx,Km,Qd,Jm,xx,BO,Zm=class Zm extends fs{constructor(r,n){super(r,n.mvfData);G(this,xx);x(this,"__type",Zm.__type);G(this,bx);G(this,Km);G(this,Qd,{});G(this,Jm);q(this,bx,r),q(this,Km,n.floorId),q(this,Jm,n.mvfData)}static is(r){return r.__type===Zm.__type}get group(){return ke(this,xx,BO).call(this).group}get type(){return ke(this,xx,BO).call(this).type}get coordinate(){if(d(this,Qd).coordinate==null){let[r,n]=d(this,Jm).geometry.coordinates;d(this,Qd).coordinate=new St(n,r,d(this,Km))}return d(this,Qd).coordinate}get floor(){let r=d(this,bx).getById("floor",d(this,Km));if(r==null)throw new Error("Floor ".concat(d(this,Km)," not found!"));return r}get geoJSON(){return re(R({},d(this,Jm)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Zm.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let r of Object.keys(d(this,Qd)))delete d(this,Qd)[r]}};bx=new WeakMap,Km=new WeakMap,Qd=new WeakMap,Jm=new WeakMap,xx=new WeakSet,BO=o(function(){let[r,n]=d(this,Jm).properties.symbolId.split("--");return{group:r,type:n}},"#getGroupAndTypeFromSymbolId"),o(Zm,"Annotation"),x(Zm,"__type","annotation");var RO=Zm,ff=RO;g();var Gfe=o((e,t)=>{var p,h,y,b,_,C,P,E,w,O,D;let r={},n={},i={},s={},l={},c={};for(let A of e["location.json"]||[]){let k=new Qm(t,{mvfData:A});if(r[A.id]=k,A.externalId&&(s[A.externalId]==null&&(s[A.externalId]=[]),s[A.externalId].push(k)),A.categories)for(let W of A.categories)l[W]==null&&(l[W]=[]),l[W].push(k);let j=[...(h=(p=A.obstructions)==null?void 0:p.map(W=>W.id))!=null?h:[],...(b=(y=A.spaces)==null?void 0:y.map(W=>W.id))!=null?b:[],...(C=(_=A.annotations)==null?void 0:_.map(W=>W.id))!=null?C:[],...(P=A.connections)!=null?P:[],...(w=(E=A.entrances)==null?void 0:E.map(W=>W.id))!=null?w:[],...(D=(O=A.areas)==null?void 0:O.map(W=>W.id))!=null?D:[]];for(let W of j)W&&(c[W]==null&&(c[W]=[]),c[W].push(k))}for(let A of e["category.json"]||[]){let k=new _x(t,{mvfData:A});n[A.id]=k,A.parent&&(i[A.parent]==null&&(i[A.parent]=[]),i[A.parent].push(k))}return{locationCategoriesByParentId:i,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:s,locationProfilesByCategoryId:l,locationProfilesByAttachedFeatureId:c}},"processMVFLocationProfilesAndCategories"),Ufe=o((e,t,r)=>{var w,O;let n={},i={},s={},l={},c={},p={},h={},y={},b={},_={},C={},P={},E=globalThis.Object.keys(e.space);for(let D of E){let A=e.space[D];if(A!=null)for(let k of A.features){P[k.properties.id]=D,h[k.properties.id]=k;for(let j of k.properties.destinationNodes)c[j]==null&&(c[j]=[]),c[j].push(k.properties.id);if(k.properties.kind==="desk-entrance"&&(p[k.properties.externalId]==null&&(p[k.properties.externalId]=[]),p[k.properties.externalId].push(...k.properties.destinationNodes)),!["void","desk-entrance"].includes((w=k.properties.kind)!=null?w:"")){if((O=k.properties.kind)!=null&&O.includes("connection")){let j=Fc(k.geometry.coordinates);_[j]==null&&(_[j]=[]),_[j].push(k.properties.id);continue}if(k.properties.kind==="poi"){let j=new pf(r,{floorId:D,mvfData:k});s[k.properties.id]=j,b[D]||(b[D]=[]),b[D].push(k),k.properties.externalId&&(l[k.properties.externalId]==null&&(l[k.properties.externalId]=[]),l[k.properties.externalId].push(j))}else{let j=new wo(r,{floorId:D,mvfData:k});n[k.properties.id]=j,k.properties.externalId&&(i[k.properties.externalId]==null&&(i[k.properties.externalId]=[]),i[k.properties.externalId].push(j)),y[D]||(y[D]=[]),y[D].push(k)}}}}for(let D in _){let A=_[D],k={};for(let W of A){let Y=P[W],N=h[W],Z=t==null?void 0:t["n_"+N.properties.id.split("s_")[1]];k[Y]=re(R({},N),{properties:re(R({},N.properties),{accessible:(Z==null?void 0:Z.accessible)===!0})})}let j=new Zd(r,{mvfDataByFloorId:k});C[j.id]=j}return{spacesById:n,spacesByExternalId:i,poisById:s,poisByExternalId:l,connectionsById:C,spaceIdsByDestinationNodeId:c,objectEntranceNodeIdsByObstructionId:p,mvfSpacesById:h,connectionIdsByLatLon:_,mvfSpacesByFloorId:y,mvfPoisByFloorId:b}},"processMVFSpaces"),Vfe=o((e,t)=>{var l,c;let r={},n={},i={},s={};for(let p of e["node.geojson"].features){i[p.properties.id]=p;let h=new tf(t,{mvfData:p,floorId:(l=p.properties.floor)!=null?l:p.properties.map});r[p.properties.id]=h,p.properties.externalId&&(n[p.properties.externalId]==null&&(n[p.properties.externalId]=[]),n[p.properties.externalId].push(h));let y=(c=p.properties.floor)!=null?c:p.properties.map;s[y]||(s[y]=[]),s[y].push(p)}return{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:s}},"processMVFNodes"),zfe=o((e,t)=>{var c;let r={},n={},i={},s={},l=globalThis.Object.keys(e.obstruction);for(let p of l){let h=e.obstruction[p];if(h!=null)for(let y of h.features){i[y.properties.id]=y;for(let _ of y.properties.entrances)s[_]=y.properties.id;if(((c=y.properties.kind)==null?void 0:c.toLowerCase())==="wall")continue;let b=new Oa(t,{floorId:p,mvfData:y});r[y.properties.id]=b,y.properties.externalId&&(n[y.properties.externalId]==null&&(n[y.properties.externalId]=[]),n[y.properties.externalId].push(b))}}return{objectsById:r,objectsByExternalId:n,mvfObstructionById:i,obstructionIdByEntranceId:s}},"processMVFObstructions"),qfe=o((e,t)=>{let r={},n={},i={};if("floor.geojson"in e&&e["floor.geojson"]!=null)for(let s of e["floor.geojson"].features){i[s.properties.id]=s.properties;let l=new ca(t,{mvfData:s});r[s.properties.id]=l,s.properties.externalId&&(n[s.properties.externalId]==null&&(n[s.properties.externalId]=[]),n[s.properties.externalId].push(l))}else for(let s of e["map.geojson"]){i[s.id]=s;let l=new ca(t,{mvfData:{properties:s}});r[s.id]=l}return{floorsById:r,floorsByExternalId:n,mvfFloorsById:i}},"processMVFFloors"),Hfe=o((e,t)=>{var p;let r={},n={},i={},s={},l={},c=e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"];if(c!=null)for(let h of c){let y=(p=e.facade)==null?void 0:p[h.id],b=new Bb(t,{mvfData:h,facadeId:y==null?void 0:y.id});if(r[h.id]=b,h.externalId&&(n[h.externalId]==null&&(n[h.externalId]=[]),n[h.externalId].push(b)),i[h.id]=h,y){let _=new Nl(t,{mvfData:y,floorStackId:h.id});s[y.id]=_;for(let C of y.spaces)l[C.spaceId]=_}}return{floorStacksById:r,floorStacksByExternalId:n,mvfFloorStacksById:i,facadesById:s,facadesBySpaceId:l}},"processMVFFloorStacks"),Wfe=o((e,t)=>{let r={},n={},i=e["connection.json"].reduce((s,l)=>{l.nodes.forEach(p=>s[p]=l),r[l.id]=l;let c=t==null?void 0:t[l.nodes[0]];if(c!=null){let p=Fc(c.geometry.coordinates);n[p]==null&&(n[p]=[]),n[p].push(l.id)}return s},{});return{mvfConnectionsById:r,mvfConnectionsByNodeId:i,mvfConnectionIdsByLatLon:n}},"processMVFConnections"),Xfe=o((e,t)=>{let r={},n={},i={},s={},l={},c=globalThis.Object.keys(e.entrance);for(let p of c){let h=e.entrance[p];if(h!=null)for(let y of h.features){s[y.properties.id]=y;let b=new Au(t,{floorId:p,mvfData:y});y.properties.node&&(i[y.properties.node]=b),r[y.properties.id]=b,y.properties.externalId&&(n[y.properties.externalId]==null&&(n[y.properties.externalId]=[]),n[y.properties.externalId].push(b)),l[p]||(l[p]=[]),l[p].push(y)}}return{doorsById:r,doorsByExternalId:n,doorsByNodeId:i,mvfEntrancesById:s,mvfEntrancesByFloorId:l}},"processMVFEntrances"),Yfe=o((e,t,r)=>{var n;if(e.textAreas!=null)for(let i in e.textAreas){let s=(n=e.textAreas[i])==null?void 0:n.features;if(s!=null){for(let l of s)if("anchorId"in l.properties){let c=l==null?void 0:l.properties,p=t[c.anchorId]||r[c.anchorId];if(p!=null&&c!=null){let h=p.properties;h.textArea=c,h.textArea&&(h.textArea.position=l.geometry.coordinates)}}}}},"processMVFTextAreas"),Zfe=o((e,t,r)=>{var n;if(e.floorImages!=null)for(let i in e.floorImages){let s=(n=e.floorImages[i])==null?void 0:n.features;if(s!=null){for(let l of s)if("anchorId"in l.properties){let c=l==null?void 0:l.properties,p=t[c.anchorId]||r[c.anchorId];if(p!=null&&c!=null){let h=p.properties;h.image=c,h.image&&(h.image.position=l.geometry.coordinates)}}}}},"processMVFPolygonImages"),Kfe=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 s in r){let l=r[s];l.geometryAnchors.forEach(c=>{let p=t[c.geometryId];if(p!=null){let h=p.properties;h.style={styleId:s,edgeOffset:l.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),Jfe=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 s=t[i.geometryId]||r[i.geometryId];if(s!=null){let l=s.properties;l.textures==null&&(l.textures=[]),l.textures.push(n)}}},"processMVFEnterpriseTextures"),Qfe=o((e,t)=>{let r={},n={},i={};if(e.annotation==null)return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i};let s=globalThis.Object.keys(e.annotation);for(let l of s){let c=e.annotation[l];if(c!=null)for(let p of c.features){n[p.properties.id]=p;let h=new ff(t,{floorId:l,mvfData:p});r[p.properties.id]=h,i[l]||(i[l]=[]),i[l].push(p)}}return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i}},"processMVFAnnotations"),ede=o((e,t)=>{let r={},n={},i={};if(e.area==null)return{areasById:r,areasByExternalId:n,mvfAreasById:i};let s=globalThis.Object.keys(e.area);for(let l of s){let c=e.area[l];if(c!=null)for(let p of c.features){i[p.properties.id]=p;let h=new of(t,{floorId:l,mvfData:p});r[p.properties.id]=h,p.properties.externalId&&(n[p.properties.externalId]==null&&(n[p.properties.externalId]=[]),n[p.properties.externalId].push(h))}}return{areasById:r,areasByExternalId:n,mvfAreasById:i}},"processMVFAreas"),hG=o((e,t)=>{var O,D,A,k,j,W,Y,N,Z,le,se,U,ye;let r={},n={},i={},s={},l=((D=(O=e.enterprise)==null?void 0:O.locations)!=null?D:[]).reduce((ne,Ce)=>(ne[Ce.id]=Ce,ne),{}),c={},p={},h={},y={},b={},_={},C=((A=e.enterprise)==null?void 0:A.venue)||{},P={},E={};for(let ne of(j=(k=e.enterprise)==null?void 0:k.categories)!=null?j:[]){let Ce=new Ix(t,{mvfData:ne});c[ne.id]=Ce,ne.externalId&&(p[ne.externalId]==null&&(p[ne.externalId]=[]),p[ne.externalId].push(Ce)),h[ne.id]=ne,ne.locations.forEach(Ie=>{b[Ie]==null&&(b[Ie]=[]),b[Ie].push(ne.id)})}let w={};for(let ne of(Y=(W=e.enterprise)==null?void 0:W.locationInstances)!=null?Y:[]){let Ce=l[ne.parent],Ie=Object.keys(Ce),Ue={};for(let Te of Ie)Ue[Te]=void 0;let ve=R(re(R({},Ue),{polygons:[],nodes:[]}),ne);w[ve.parent]==null&&(w[ve.parent]=[]),w[ve.parent].push(new Vc(t,{mvfData:ve,categoryIds:((Z=(N=e.enterprise)==null?void 0:N.categoryPriorities)==null?void 0:Z[ve.id])||b[ve.id],parentId:ne.parent})),P[ve.id]=ne}for(let ne in e.space){let Ce=e.space[ne];if(Ce!=null)for(let Ie of Ce.features)for(let Ue of Ie.properties.destinationNodes)E[Ue]==null&&(E[Ue]=[]),E[Ue].push(Ie.properties.id)}for(let ne of(se=(le=e.enterprise)==null?void 0:le.locations)!=null?se:[]){let Ce=new Vc(t,{mvfData:ne,categoryIds:((ye=(U=e.enterprise)==null?void 0:U.categoryPriorities)==null?void 0:ye[ne.id])||b[ne.id],locationInstances:w[ne.id]});i[ne.id]=Ce,ne.externalId&&(s[ne.externalId]==null&&(s[ne.externalId]=[]),s[ne.externalId].push(Ce)),ne.nodes.forEach(Ie=>{_[Ie.id]==null&&(_[Ie.id]=[]),_[Ie.id].push(ne.id)});for(let Ie of ne.polygons)y[Ie.id]==null&&(y[Ie.id]=[]),y[Ie.id].push(ne)}if(t.enterpriseMode===!0){for(let ne in t.mvfConnectionsById){let Ce={},Ie=t.mvfConnectionsById[ne];for(let Ue of t.mvfConnectionsById[ne].nodes){let ve=t.nodesById[Ue];ve!=null&&(Ce[ve.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[ve.coordinate.longitude,ve.coordinate.latitude]},properties:{id:ne,externalId:Ie.externalId,kind:"enterprise."+Ie.type,destinationNodes:[],flags:"",type:Ie.type,nodes:Ie.nodes,accessible:Ie.accessible,extra:Ie.extra,details:Ie.details}})}Object.keys(Ce).length>0&&(r[ne]=new Zd(t,{mvfDataByFloorId:Ce}),Ie.externalId&&(n[Ie.externalId]==null&&(n[Ie.externalId]=[]),n[Ie.externalId].push(r[ne])))}t.connectionsById=r}return{spaceIdsByNodeId:E,connectionsByExternalId:n,locationIdsByNodeId:_,mvfLocationsBySpaceId:y,mvfLocationsById:l,mvfCategoriesById:h,locationsById:i,locationsByExternalId:s,locationInstancesById:P,categoriesById:c,categoriesByExternalId:p,venue:C}},"createEnterpriseDataFromMVF"),mG=o((e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:s}=Vfe(e,t),{mvfConnectionsById:l,mvfConnectionsByNodeId:c,mvfConnectionIdsByLatLon:p}=Wfe(e,i),{spacesById:h,spacesByExternalId:y,spaceIdsByDestinationNodeId:b,poisById:_,poisByExternalId:C,mvfSpacesById:P,objectEntranceNodeIdsByObstructionId:E,connectionsById:w,connectionIdsByLatLon:O,mvfSpacesByFloorId:D,mvfPoisByFloorId:A}=Ufe(e,c,t),{objectsById:k,objectsByExternalId:j,mvfObstructionById:W,obstructionIdByEntranceId:Y}=zfe(e,t),{floorsById:N,floorsByExternalId:Z,mvfFloorsById:le}=qfe(e,t),{floorStacksById:se,floorStacksByExternalId:U,mvfFloorStacksById:ye,facadesById:ne,facadesBySpaceId:Ce}=Hfe(e,t),{doorsById:Ie,doorsByExternalId:Ue,doorsByNodeId:ve,mvfEntrancesById:Te,mvfEntrancesByFloorId:Q}=Xfe(e,t),{annotationsById:Qe,mvfAnnotationsById:Ye,mvfAnnotationsByFloorId:nt}=Qfe(e,t),{areasById:Ae,areasByExternalId:Be,mvfAreasById:We}=ede(e,t);Zfe(e,P,W),Yfe(e,P,W),Kfe(e,P),Jfe(e,P,W);let{locationCategoriesByParentId:$e,locationProfilesById:we,locationCategoriesById:H,locationProfilesByExternalId:ie,locationProfilesByCategoryId:ee,locationProfilesByAttachedFeatureId:Me}=Gfe(e,t);return{spacesById:h,spacesByExternalId:y,nodesById:r,nodesByExternalId:n,objectsById:k,objectsByExternalId:j,floorsById:N,floorsByExternalId:Z,floorStacksById:se,floorStacksByExternalId:U,facadesById:ne,facadesBySpaceId:Ce,connectionsById:w,doorsById:Ie,doorsByExternalId:Ue,doorsByNodeId:ve,poisById:_,poisByExternalId:C,annotationsById:Qe,areasById:Ae,areasByExternalId:Be,spaceIdsByDestinationNodeId:b,objectEntranceNodeIdsByObstructionId:E,obstructionIdByEntranceId:Y,connectionIdsByLatLon:O,locationProfilesById:we,locationCategoriesById:H,locationProfilesByExternalId:ie,locationProfilesByCategoryId:ee,locationCategoriesByParentId:$e,mvfSpacesById:P,mvfNodesById:i,mvfObstructionById:W,mvfFloorsById:le,mvfFloorStacksById:ye,mvfConnectionsById:l,mvfConnectionsByNodeId:c,mvfEntrancesById:Te,mvfAnnotationsById:Ye,mvfNodesByFloorId:s,mvfSpacesByFloorId:D,mvfPoisByFloorId:A,mvfAreasById:We,mvfEntrancesByFloorId:Q,mvfAnnotationsByFloorId:nt,locationProfilesByAttachedFeatureId:Me,mvfConnectionIdsByLatLon:p}},"createDataFromMVF");g();g();g();var tde=o(function(){let t=globalThis.fetch;return{fetch(...r){if(!hx(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")(),gG=tde.fetch;var IG=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],yG=IG[0],_G="https://api-gateway.mappedin.com/track-analytics/a/",SG="deny-watchposition",CG="load-mapview",wG="load-mapdata",PG="change-language",TG="query-directions";var Hc,Rl,mf,$O,EC,GO=class GO{constructor(){G(this,mf);G(this,Hc,Object.freeze({}));G(this,Rl);x(this,"oneTimeEventsSent",new Set);x(this,"sendGetDirectionsEvent",WN((t,r)=>this.sendAnalyticEvent(TG,{start:t,end:r,type:"location_to_location"}),2500));q(this,Rl,ke(this,mf,EC).call(this,d(this,Hc)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){q(this,Hc,{}),q(this,Rl,ke(this,mf,EC).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return q(this,Hc,Object.freeze(Object.assign({},d(this,Hc),t))),q(this,Rl,ke(this,mf,EC).call(this,t)),ke(this,mf,$O).call(this,d(this,Rl)),d(this,Rl)}updateState(t){let r=R({},t);r.mapId&&(r.analyticsBaseUrl=jO(re(R({},d(this,Rl)),{mapId:r.mapId}))),r.context&&(r.context=xG(r.context)),r.baseUri&&(r.analyticsBaseUrl=jO({baseUri:r.baseUri,mapId:d(this,Rl).mapId})),Object.assign(d(this,Rl),r),this.handleStateUpdate(t),ke(this,mf,$O).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,Rl)}getContext(){return this.getState().context||d(this,Hc).context||yG}getSessionId(){return this.getState().sessionId||d(this,Hc).sessionId||bG()}getDeviceId(){return this.getState().deviceId||d(this,Hc).deviceId||vG()}sendAnalyticEvent(t,r={}){let n=this.getState(),i=rde(n.analyticsBaseUrl,t),s={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(n.logEvents&&ce.log("Analytics.track",i,s),!n.sendEvents)return Promise.resolve();if(!this.authReady)return ce.warn("Auth needs to be ready to send analytics.");let l=re(R({},r),{g:n.geolocationMode,sdk_version:n.version});return n.userPosition&&Object.assign(l,n.userPosition),s["Content-Type"]="application/json",n.accessToken?s.Authorization="Bearer ".concat(n.accessToken):n.noAuth||n.secret&&n.key&&(s["x-mappedin-key"]=btoa(n.key),s["x-mappedin-secret"]=btoa(n.secret)),gG(i,{method:"POST",mode:"cors",headers:s,body:JSON.stringify(l)})}capture(t,r){if(ide.includes(t))return ce.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=nde.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,r)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(wG,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(PG,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(SG)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:r}){return this.sendAnalyticEvent(CG,{type:"3d",firstRenderDuration:t,width:r.width,height:r.height,devicePixelRatio:globalThis.devicePixelRatio||1})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};Hc=new WeakMap,Rl=new WeakMap,mf=new WeakSet,$O=o(function(t){t.sessionId&&ef.getInstance().saveSessionData("id",t.sessionId),t.deviceId&&ef.getInstance().saveLocalData("deviceId",t.deviceId)},"#saveStateToStorage"),EC=o(function(t){var n,i,s,l;let r=(n=t.baseUri)!=null?n:_G;return{baseUri:r,analyticsBaseUrl:jO(re(R({},t),{baseUri:r})),version:((i=I==null?void 0:I.env)==null?void 0:i.npm_package_version)||"v6",deviceId:t.deviceId||vG(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||bG(),platformString:t.platformString||"",context:xG(t.context)||yG,geolocationMode:!1,sendEvents:(s=t.sendEvents)!=null?s:!0,logEvents:(l=t.logEvents)!=null?l:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),o(GO,"AnalyticsInternal");var q0=GO;function jO({mapId:e,baseUri:t=_G}){return"".concat(t).concat(e,"/")}o(jO,"getBaseUrl");function vG(){return ef.getInstance().loadLocalData("deviceId")}o(vG,"getDeviceIDFromStorage");function bG(){return ef.getInstance().loadSessionData("id")}o(bG,"getSessionIDFromStorage");function rde(e,t){return e+t}o(rde,"buildUrl");function xG(e){return IG.find(t=>t===e)}o(xG,"getValidContext");var nde=["$select-location","$select-category","$query-suggest","$query-search"],ide=[CG,wG,TG,SG,PG],Aft=new q0,Bl,UO=class UO{constructor(t){G(this,Bl);x(this,"capture");x(this,"updateState");q(this,Bl,t),this.capture=d(this,Bl).capture.bind(d(this,Bl)),this.updateState=d(this,Bl).updateState.bind(d(this,Bl))}getState(){let i=d(this,Bl).getState(),{sessionId:t,deviceId:r}=i;return cs(i,["sessionId","deviceId"])}getContext(){return d(this,Bl).getContext()}getSessionId(){return d(this,Bl).getSessionId()}getDeviceId(){return d(this,Bl).getDeviceId()}};Bl=new WeakMap,o(UO,"Analytics");var Sx=UO;g();var ode=new Set(["polygons"]),Nu,Si,La,Cx,eg=class eg extends Co{constructor(r,n){super(n.mvfData.externalId);x(this,"__type",eg.__type);x(this,"description");x(this,"name","");x(this,"amenity");x(this,"externalId","");x(this,"extra");x(this,"gallery");x(this,"instances");x(this,"logo");x(this,"operationHours");x(this,"phone");x(this,"picture");x(this,"shortName");x(this,"showFloatingLabelWhenImagePresent");x(this,"showLogo");x(this,"siblingGroups");x(this,"social");x(this,"sortOrder",-1);x(this,"states");x(this,"tags");x(this,"type","");x(this,"hidden",!1);G(this,Nu);G(this,Si,{});G(this,La);G(this,Cx);q(this,Nu,r),q(this,La,n.mvfData),q(this,Cx,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let i in n.mvfData)!ode.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{enumerable:!0,get(){if(n.parentId){let s=d(this,Nu).locationsById[n.parentId];return d(this,La)[i]!=null?d(this,Nu).getPropTranslation(this.__type,i,d(this,La).id,d(this,La)[i]):d(this,Nu).getPropTranslation(this.__type,i,d(this,La).id,s[i])}return d(this,Nu).getPropTranslation(this.__type,i,d(this,La).id,d(this,La)[i])}})}static is(r){return r.__type===eg.__type}get focusTarget(){return this.spaces}get categories(){return d(this,Si).categories?d(this,Si).categories:(d(this,Si).categories=(d(this,Cx).map(r=>d(this,Nu).getById("enterprise-category",r))||[]).filter(Boolean),d(this,Si).categories)}get coordinates(){if(d(this,Si).coordinates)return d(this,Si).coordinates;d(this,Si).coordinates=[];for(let r=0;r<this.nodes.length;r++)d(this,Si).coordinates.push(this.nodes[r].coordinate);return d(this,Si).coordinates}get nodes(){if(d(this,Si).nodes)return d(this,Si).nodes;d(this,Si).nodes=[];for(let r=0;r<d(this,La).nodes.length;r++){let n=d(this,Nu).getById("node",d(this,La).nodes[r].id);n&&d(this,Si).nodes.push(n)}return d(this,Si).nodes}get spaces(){if(d(this,Si).spaces)return d(this,Si).spaces;d(this,Si).spaces=[];for(let r=0;r<d(this,La).polygons.length;r++){let n=d(this,Nu).getById("space",d(this,La).polygons[r].id);n&&d(this,Si).spaces.push(n)}return d(this,Si).spaces}toJSON(){return{__type:eg.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,Si)))delete d(this,Si)[r]}};Nu=new WeakMap,Si=new WeakMap,La=new WeakMap,Cx=new WeakMap,o(eg,"EnterpriseLocation"),x(eg,"__type","enterprise-location");var VO=eg,Vc=VO;g();var sde=new Set,rg,pa,Wc,tg=class tg extends Co{constructor(r,n){super(n.mvfData.externalId);x(this,"__type",tg.__type);x(this,"name","");x(this,"color");x(this,"externalId","");x(this,"extra");x(this,"icon");x(this,"iconFromDefaultList");x(this,"sortOrder",-1);x(this,"picture");G(this,rg);G(this,pa,{});G(this,Wc);q(this,rg,r),q(this,Wc,n.mvfData);for(let i in n.mvfData)!sde.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{get(){return d(this,rg).getPropTranslation(this.__type,i,d(this,Wc).id,d(this,Wc)[i])}})}static is(r){return r.__type===tg.__type}get children(){if(d(this,pa).children)return d(this,pa).children;d(this,pa).children=[];for(let r=0;r<d(this,Wc).children.length;r++){let n=d(this,rg).getById("enterprise-category",d(this,Wc).children[r]);n&&d(this,pa).children.push(n)}return d(this,pa).children}get locations(){if(d(this,pa).locations)return d(this,pa).locations;d(this,pa).locations=[];for(let r=0;r<d(this,Wc).locations.length;r++){let n=d(this,rg).getById("enterprise-location",d(this,Wc).locations[r]);n&&d(this,pa).locations.push(n)}return d(this,pa).locations}toJSON(){return{__type:tg.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,pa)))delete d(this,pa)[r]}};rg=new WeakMap,pa=new WeakMap,Wc=new WeakMap,o(tg,"EnterpriseCategory"),x(tg,"__type","enterprise-category");var zO=tg,Ix=zO;g();var ade=new Set,wx,Px,ng=class ng extends Co{constructor(r,n){super(n.mvfData.externalId);x(this,"__type",ng.__type);x(this,"countrycode");x(this,"externalId","");x(this,"defaultLanguage",{code:"en",name:"English"});x(this,"defaultMap");x(this,"extra");x(this,"icon");x(this,"languages",[]);x(this,"links",[]);x(this,"logo");x(this,"mappedinWebUrl");x(this,"slug","");x(this,"topLocations");x(this,"tzid");G(this,wx,{});G(this,Px);q(this,Px,n.mvfData);for(let i in n.mvfData)!ade.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&(this[i]=n.mvfData[i])}static is(r){return r.__type===ng.__type}get name(){var r;return(r=d(this,Px).name)!=null?r:""}toJSON(){return{__type:ng.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,wx)))delete d(this,wx)[r]}};wx=new WeakMap,Px=new WeakMap,o(ng,"EnterpriseVenue"),x(ng,"__type","enterprise-venue");var qO=ng,MC=qO;g();g();g();g();g();g();var jY=Pn(c6(),1),$Y=Pn(RY(),1);g();var K0e=o(e=>{var r;let t=e;return((r=t==null?void 0:t.allOf)==null?void 0:r.length)===2},"isPotentiallyBadSchema");function pw(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(pw);let t=R({},e);for(let[r,n]of Object.entries(t))if(typeof n=="object"&&n!==null){let i=pw(n);if(K0e(i)){let s=i.allOf.findIndex(c=>c.type==="array"),l=i.allOf.findIndex(c=>c.type==="object");if(s!==-1&&l!==-1){t[r]=re(R({},i),{allOf:[i.allOf[s]]});continue}}t[r]=i}return t}o(pw,"cleanupInvalidArrayAllOf");var BY={$ref:"#/definitions/ParsedMVF",$schema:"http://json-schema.org/draft-07/schema#",definitions:{AnchoredFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},geometryId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text belongs. It will be displayed on top of it."},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","geometryId","rotation","text","visible"],type:"object"},AnchoredImageProperties:{additionalProperties:!1,properties:{anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this image belongs. It will be displayed on top of it."},height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["anchorId","height","path","rotation","width"],type:"object"},AnchoredTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text area belongs. It will be displayed on top of it."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"}},required:["align","anchorId","maxHeight","maxWidth","rotation"],type:"object"},AnnotationCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/AnnotationProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AnnotationId:{pattern:"^a_[A-Za-z0-9_-]{8,}$",type:"string"},AnnotationProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},id:{$ref:"#/definitions/AnnotationId"},symbolId:{type:"string"}},required:["id","symbolId"],type:"object"},Area:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/AreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},AreaCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Area"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AreaId:{pattern:"^ar_[A-Za-z0-9_-]{8,}$",type:"string"},AreaProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this area."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this area.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/AreaId"}},required:["id"],type:"object"},Category:{additionalProperties:!1,properties:{icon:{description:"The category's icon",format:"uri",type:"string"},id:{$ref:"#/definitions/CategoryId"},name:{type:"string"},parent:{$ref:"#/definitions/CategoryId"}},required:["id","name","icon"],type:"object"},CategoryId:{description:"A category ID",pattern:"^cat_[A-Za-z0-9_-]{8,}$",type:"string"},Connection:{additionalProperties:!1,properties:{accessible:{type:"boolean"},details:{additionalProperties:!1,properties:{name:{type:"string"}},type:"object"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},id:{$ref:"#/definitions/ConnectionId"},metadata:{$ref:"#/definitions/Metadata"},nodes:{description:"A list of node IDs corresponding to nodes that are a part of this connection.",items:{$ref:"#/definitions/NodeId"},type:"array"},type:{type:"string"}},required:["id","type","nodes","externalId"],type:"object"},ConnectionId:{pattern:"^c_[A-Za-z0-9_-]{8,}$",type:"string"},Connections:{items:{$ref:"#/definitions/Connection"},type:"array"},Day:{enum:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],type:"string"},DayOrPublicHoliday:{anyOf:[{$ref:"#/definitions/Day"},{const:"PublicHolidays",type:"string"}]},Details:{additionalProperties:!1,description:"Additional information about a given entity.",properties:{description:{type:"string"},images:{items:{$ref:"#/definitions/Image"},type:"array"},links:{items:{$ref:"#/definitions/Hyperlink"},type:"array"},name:{type:"string"}},type:"object"},EnterpriseCategory:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},color:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The category's icon",format:"uri",type:"string"},iconFromDefaultList:{type:["string","null"]},id:{$ref:"#/definitions/EnterpriseCategoryId"},locations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},name:{type:"string"},picture:{description:"The category's picture",format:"uri",type:"string"},sortOrder:{type:"number"}},required:["children","externalId","id","locations","name","sortOrder"],type:"object"},EnterpriseCategoryId:{description:"An ID for an enterprise category",pattern:"^ec_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseCategoryPriority:{additionalProperties:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},description:"The ordered list of category ids that this location belongs to The order here determines the priority of the categories, with the first category being the highest priority for determining application logic like icon and color preference.",propertyNames:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$"},type:"object"},EnterpriseCollection:{additionalProperties:!1,properties:{categories:{items:{$ref:"#/definitions/EnterpriseCategory"},type:"array"},categoryPriorities:{$ref:"#/definitions/EnterpriseCategoryPriority"},enterpriseStyles:{$ref:"#/definitions/EnterpriseStyles"},floorText:{$ref:"#/definitions/EnterpriseFloorText"},layers:{items:{$ref:"#/definitions/EnterpriseLayer"},type:"array"},locationInstances:{items:{$ref:"#/definitions/EnterpriseLocationInstance"},type:"array"},locations:{items:{$ref:"#/definitions/EnterpriseLocation"},type:"array"},textures:{items:{$ref:"#/definitions/EnterpriseTexture"},type:"array"},venue:{$ref:"#/definitions/EnterpriseVenue"}},required:["locations","categories","venue","locationInstances","layers"],type:"object"},EnterpriseFloorText:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorTextFeatureCollection"},{not:{}}]},description:"The text to display on a map, split into feature collection per floor.",type:"object"},EnterpriseLayer:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/EnterpriseLayerId"},name:{type:"string"},spaces:{items:{$ref:"#/definitions/EnterpriseLayerSpace"},minItems:1,type:"array"}},required:["id","name","spaces"],type:"object"},EnterpriseLayerId:{pattern:"^ely_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLayerSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},EnterpriseLocation:{additionalProperties:!1,properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{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",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["externalId","id","name","nodes","polygons","sortOrder","spaces","type"],type:"object"},EnterpriseLocationId:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLocationInstance:{additionalProperties:!1,description:"A locationInstance is a particular instace of an Enterprise Location that has some properties different from the parent. Eg, it may have different hours, or a slightly different name.\n\nA LocationInstance:\n- MUST have a parent, referring to an Enterprise Location.\n- MUST have a unique ID, for localization to work.\n- SHOULD have AT LEAST ONE polygon or node to anchor it in space.\n- SHOULD have AT LEAST ONE other Enterprise Location property set.\n\nIt is otherwise a Partial<EnterpriseLocation>\n\nUsage examples:\n- A locationInstance for a location with a different externalId so a customer can identify them individually.\n- A locationInstance with different operationHours, that might indicate different hours for that particular entrace.",properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationInstanceId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},parent:{$ref:"#/definitions/EnterpriseLocationId"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{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",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["id","parent"],type:"object"},EnterpriseLocationInstanceId:{description:"An ID for an enterprise location instance",pattern:"^eli_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseStyles:{additionalProperties:{additionalProperties:!1,properties:{edgeOffset:{type:"number"},geometryAnchors:{items:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},type:"array"}},required:["geometryAnchors"],type:"object"},type:"object"},EnterpriseTexture:{additionalProperties:!1,properties:{bounds:{description:"Coordinates of the texture's bounding box in format: [minLon, minLat, maxLon, maxLat].",items:{type:"number"},maxItems:4,minItems:4,type:"array"},face:{$ref:"#/definitions/EnterpriseTextureFace",description:"Face of the polygon that the texture will be applied to.\n\n'top' means that the texture will be applied to the upward-pointing face of the polygon.\n\n'side' means that the texture will be applied to every side face of the polygon."},geometryAnchors:{description:"Anchors for the texture on the geometry of the polygon.",items:{$ref:"#/definitions/EnterpriseTextureGeometryAnchor"},minItems:1,type:"array"},offset:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls the starting position of the texture on the surface. The u value shifts the texture horizontally and v shifts vertically."},path:{description:"Path to the texture image. Must be either a PNG or JPG format.",type:"string"},repeat:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls how many times the texture repeats across the surface. The u value controls horizontal repetition and v controls vertical repetition."},rotation:{description:"Rotation of the texture in degrees clockwise.\n\nFor top textures this is relative to north. North is 0, east is 90.\n\nFor side textures this is relative to the upward direction, with 0 degrees being upright.",maximum:360,minimum:0,type:"number"},surface:{$ref:"#/definitions/EnterpriseTextureSurface",description:"Surface of the polygon that the texture will be applied to.\n\n'inside' means that the texture will only be applied to the interior surface of the polygon.\n\n'outside' means that the texture will only be applied to the exterior surface of the polygon.\n\n'both' means that the texture will be applied to both interior and exterior surfaces of the polygon."}},required:["repeat","offset","rotation","path","face","surface","bounds","geometryAnchors"],type:"object"},EnterpriseTextureFace:{enum:["top","side"],type:"string"},EnterpriseTextureGeometryAnchor:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},EnterpriseTextureSurface:{enum:["inside","outside","both"],type:"string"},EnterpriseTextureUV:{additionalProperties:!1,properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},EnterpriseVenue:{additionalProperties:!1,properties:{countrycode:{description:"The ISO 3166-1 alpha-2 country code of the venue, if known\n\nEg. `US` or `GB`",type:"string"},coverImage:{description:"The venue's cover image",format:"uri",type:"string"},defaultFloor:{$ref:"#/definitions/FloorId",description:"The venue's default floor"},defaultLanguage:{$ref:"#/definitions/Language"},defaultMap:{$ref:"#/definitions/FloorId",deprecated:"Use `defaultFloor` instead"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The venue's icon",format:"uri",type:"string"},languages:{items:{$ref:"#/definitions/Language"},type:"array"},logo:{description:"The venue's logo",format:"uri",type:"string"},mappedinWebUrl:{description:"The base URL for Mappedin Web for this venue\n\nBetter name?",type:"string"},name:{type:"string"},operationHours:{description:"When this venue is open.",items:{$ref:"#/definitions/OperationHours"},type:"array"},slug:{type:"string"},topLocations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},tzid:{description:"The venue's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",pattern:"^[A-Za-z0-9\\/_-]+$",type:"string"}},required:["defaultLanguage","externalId","languages","name","slug"],type:"object"},EntranceCollection:{$ref:"#/definitions/FeatureCollection%3CLineString%2CEntranceProperties%3E"},EntranceId:{pattern:"^e_[A-Za-z0-9_-]{8,}$",type:"string"},EntranceProperties:{additionalProperties:!1,properties:{details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/EntranceId"},isExterior:{type:"boolean"},metadata:{$ref:"#/definitions/Metadata"},node:{$ref:"#/definitions/NodeId"}},required:["id","externalId"],type:"object"},Facade:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/FacadeId"},spaces:{items:{$ref:"#/definitions/FacadeSpace"},minItems:1,type:"array"}},required:["id","spaces"],type:"object"},FacadeId:{pattern:"^fc_[A-Za-z0-9_-]{8,}$",type:"string"},FacadeSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},"Feature<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"}]},properties:{$ref:"#/definitions/ObstructionProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"},{$ref:"#/definitions/Point"}]},properties:{$ref:"#/definitions/SpaceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/MultiPolygon"},{type:"null"}]},properties:{$ref:"#/definitions/FloorProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<LineString,EntranceProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/EntranceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorImageProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorImageProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorTextProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorTextProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,NodeProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/NodeProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,TextAreaProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/TextAreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/FloorStackFootprintProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"FeatureCollection<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<LineString,EntranceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CLineString%2CEntranceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorImageProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorImageProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorTextProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorTextProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,NodeProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CNodeProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,TextAreaProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CTextAreaProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPolygon%2CFloorStackFootprintProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},FeatureCollectionType:{const:"FeatureCollection",description:"The type field used for a collection of GeoJSON features.",type:"string"},FeatureType:{const:"Feature",description:"The type field used for individual GeoJSON features.",type:"string"},FloatingFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},verticalOffset:{description:"The vertical offset of the text, in meters.",type:"number"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","rotation","text","verticalOffset","visible"],type:"object"},FloatingImageProperties:{additionalProperties:!1,properties:{height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the image, in meters, relative to the ground plane.",minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["height","path","rotation","verticalOffset","width"],type:"object"},FloatingTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the text area, in meters, relative to the ground plane.",minimum:0,type:"number"}},required:["align","maxHeight","maxWidth","rotation","verticalOffset"],type:"object"},FloorCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},FloorId:{description:"The m_ prefix is deprecated, from when floors were previously called maps. Use f_ as the prefix instead.",pattern:"^[mf]_[A-Za-z0-9_-]{8,}$",type:"string"},FloorImageFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorImageProperties%3E",description:"A collection of images to be displayed on a map. They are either attached to a polygon or are floating in space."},FloorImageProperties:{anyOf:[{$ref:"#/definitions/AnchoredImageProperties"},{$ref:"#/definitions/FloatingImageProperties"}]},FloorProperties:{additionalProperties:!1,properties:{elevation:{description:"The elevation of this map relative to other maps in the stack. Must be an integer.",type:"integer"},externalId:{description:"Use of this property as the name of the map is deprecated. Use the name property instead.",type:"string"},id:{$ref:"#/definitions/FloorId"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map, if it exists. Usually one or two characters (eg, 3, F1, L, etc.) For display in very small spaces, like a floor selector dropdown. Might line up with what is shown on elevator buttons in the physical world.",type:"string"},subtitle:{description:'A subtitle for the map, for display in larger spaces, usually beneath the full name. Provides additional context for what is actually on the map, if the name is not clear. For example, if the full name is "Level 1", the subtitle might be "Arrivals and Baggage Claim".\n\nShould be no more than a few words.',type:"string"}},required:["id","externalId","elevation"],type:"object"},FloorStack:{additionalProperties:!1,properties:{defaultFloor:{$ref:"#/definitions/FloorId",description:"The default floor to use when a floor is not specified."},externalId:{type:"string"},floors:{description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},footprint:{$ref:"#/definitions/FeatureCollection%3CPolygon%2CFloorStackFootprintProperties%3E",description:"Provides a footprint for the map stack based on the geometry of the maps it contains. This is useful for rendering a map stack without loading all of its maps."},id:{$ref:"#/definitions/FloorStackId"},maps:{deprecated:"Use `floors` instead.",description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map stack, if it exists. For display in small spaces, like a floor selector dropdown.",type:"string"},type:{description:"The type of MapStack, e.g. Building, Outdoor. Defaults to Building.",enum:["Building","Outdoor"],type:"string"}},required:["id","externalId","name","maps"],type:"object"},FloorStackFootprintProperties:{additionalProperties:{not:{}},type:"object"},FloorStackId:{description:"The mg_ prefix is deprecated, from when floor stacks were previously called map groups. Use fs_ as the prefix instead.",pattern:"^fs_[A-Za-z0-9_-]{8,}$",type:"string"},FloorStacks:{items:{$ref:"#/definitions/FloorStack"},type:"array"},FloorTextFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorTextProperties%3E",description:"A collection of text to be displayed on a map. They are either attached to a space or are floating."},FloorTextProperties:{anyOf:[{$ref:"#/definitions/AnchoredFloorTextProperties"},{$ref:"#/definitions/FloatingFloorTextProperties"}]},Hyperlink:{additionalProperties:!1,properties:{displayName:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Image:{additionalProperties:!1,properties:{altText:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Language:{additionalProperties:!1,properties:{code:{type:"string"},name:{type:"string"}},required:["name","code"],type:"object"},Latitude:{description:"A WGS 84-compatible latitude coordinate value.",maximum:90,minimum:-90,type:"number"},LineString:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON LineString geometry.",properties:{coordinates:{items:{$ref:"#/definitions/Position"},minItems:2,type:"array"},type:{const:"LineString",type:"string"}},required:["coordinates","type"],type:"object"},LineStringStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},lineStrings:{description:"The line strings which this style applies to.",items:{anyOf:[{$ref:"#/definitions/EntranceId"},{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},opacity:{maximum:1,minimum:0,type:"number"},width:{description:"The thickness of the line when rendered, in meters, measured from the center to the edge.",exclusiveMinimum:0,type:"number"}},required:["altitude","color","height","lineStrings","opacity","width"],type:"object"},LocalPosition:{description:"A position for a local coordinate system, measured in metres.",items:{type:"number"},maxItems:2,minItems:2,type:"array"},Location:{additionalProperties:!1,properties:{annotations:{items:{$ref:"#/definitions/LocationAnnotationMapping"},type:"array"},areas:{items:{$ref:"#/definitions/LocationAreaMapping"},type:"array"},categories:{items:{$ref:"#/definitions/CategoryId"},type:"array"},connections:{items:{$ref:"#/definitions/ConnectionId"},type:"array"},description:{type:"string"},entrances:{items:{$ref:"#/definitions/LocationEntranceMapping"},type:"array"},externalId:{type:"string"},icon:{description:"The location's icon, one of picture/category/logo",format:"uri",type:"string"},id:{$ref:"#/definitions/LocationId"},links:{description:"Web links for the location",items:{$ref:"#/definitions/LocationLink"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},obstructions:{items:{$ref:"#/definitions/LocationObstructionMapping"},type:"array"},openingHoursSpecification:{description:"The location's opening hours",items:{$ref:"#/definitions/OpeningHoursSpecification"},type:"array"},phone:{type:"string"},pictures:{description:"The location's pictures",items:{$ref:"#/definitions/LocationPicture"},type:"array"},social:{description:"The location's social media links.",items:{$ref:"#/definitions/LocationSocial"},type:"array"},spaces:{items:{$ref:"#/definitions/LocationSpaceMapping"},type:"array"},website:{$ref:"#/definitions/LocationLink",description:"The location's website"}},required:["id","name","categories","spaces","obstructions","entrances","connections","annotations","areas","social","pictures","links","openingHoursSpecification"],type:"object"},LocationAnnotationMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AnnotationId"}},required:["floor","id"],type:"object"},LocationAreaMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AreaId"}},required:["floor","id"],type:"object"},LocationEntranceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/EntranceId"}},required:["floor","id"],type:"object"},LocationId:{description:"An ID for a location",pattern:"^loc_[A-Za-z0-9_-]{8,}$",type:"string"},LocationLink:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},LocationObstructionMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/ObstructionId"}},required:["floor","id"],type:"object"},LocationPicture:{additionalProperties:!1,description:"The location's pictures Single-field object, because it's plausible we might add captions or comments in the future",properties:{url:{format:"uri",type:"string"}},type:"object"},LocationSocial:{additionalProperties:!1,properties:{name:{description:"The name of the social media platform.",type:"string"},url:{description:"The URL of the social media profile",format:"uri",type:"string"}},required:["name","url"],type:"object"},LocationSpaceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},LocationState:{additionalProperties:!1,description:"The state of a location. Start and end dates are optional.",properties:{end:{description:"The start date of the state",format:"date",type:"string"},start:{description:"The start date of the state",format:"date",type:"string"},type:{description:"The type of the location state. Technically not limited, but should be one of the following:\n- closed-temporarily\n- new\n- pop-up\n- coming-soon\n- relocated",type:"string"}},required:["type"],type:"object"},Longitude:{description:"A WGS 84-compatible longitude coordinate value.",maximum:180,minimum:-180,type:"number"},ManifestCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/ManifestFeature"},maxItems:1,minItems:1,type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},ManifestFeature:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/ManifestProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},ManifestFile:{additionalProperties:!1,properties:{name:{type:"string"},type:{const:"file",type:"string"}},required:["type","name"],type:"object"},ManifestFolder:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/ManifestFile"},minItems:1,type:"array"},name:{type:"string"},type:{const:"folder",type:"string"}},required:["type","name","children"],type:"object"},ManifestProperties:{additionalProperties:!1,properties:{folder_struct:{items:{anyOf:[{$ref:"#/definitions/ManifestFolder"},{$ref:"#/definitions/ManifestFile"}]},type:"array"},language:{description:"The RFC 5646 language tag of the MVF. https://datatracker.ietf.org/doc/html/rfc5646",examples:["en-US"],type:"string"},map:{description:"The identifier of the map that this MVF is for.",type:"string"},name:{type:"string"},naturalBearing:{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"',maximum:360,minimum:0,type:"number"},org_id:{type:"string"},time:{description:"An ISO 8601 date-time string, including timezone offset.",format:"date-time",type:"string"},tzid:{description:"The map's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",examples:["America/New_York"],pattern:"^[A-Za-z0-9_-]+\\/[A-Za-z0-9_-]+$",type:"string"},version:{const:"2.0.0",type:"string"}},required:["name","folder_struct","version","time"],type:"object"},Maps:{deprecated:"This is only present on `map.geojson` which is deprecated. Use\nthe collection on `floor.geojson` instead.",items:{$ref:"#/definitions/FloorProperties"},type:"array"},Material:{additionalProperties:!1,description:"The color and/or texture that should be applied to an instance of a Shape.\n\nIf both a color and a texture are provided, the color will be applied to the texture via a multiply operation. If neither are provided, the shape will be white.",properties:{color:{description:"The color of this mateial as a hex code.",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},texture:{$ref:"#/definitions/Texture"}},type:"object"},Metadata:{additionalProperties:{},description:"Can be any extra metadata that is not part of the main MVF spec. Presence of any key or value is not guaranteed. Values are expected to be JSON-serializable.",type:"object"},ModelInstance:{additionalProperties:!1,description:"An instance of a 3D model.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},path:{description:"The path to this asset, relative to the MVF's models folder. Supports GLTF and OBJ.",minLength:1,type:"string"},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","path","position","rotation","scale"],type:"object"},ModelInstanceCollection:{additionalProperties:{$ref:"#/definitions/ModelInstance"},description:"A map of model instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},MultiPolygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry.",properties:{coordinates:{items:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:"array"},type:{const:"MultiPolygon",type:"string"}},required:["coordinates","type"],type:"object"},NodeCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CNodeProperties%3E"},NodeId:{pattern:"^n_[A-Za-z0-9_-]{8,}$",type:"string"},NodeProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},floor:{$ref:"#/definitions/FloorId",description:"The ID of the floor this node is found on."},id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId",deprecated:"use `floor` instead.",description:"The ID of the floor this node is found on."},neighbors:{description:"A list of nodes that can be navigated to from this node.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},weight:{description:"The cost of navigating to this node.",minimum:0,type:"number"}},required:["id","weight"],type:"object"},type:"array"},preventSmoothing:{description:"Flag that may optionally indicate that a node is part of a custom path network rather than auto generated and should not be removed during smoothing/simplifcation.",type:"boolean"},space:{description:"The IDs of any spaces this node may be contained within.",items:{$ref:"#/definitions/SpaceId"},type:"array"}},required:["id","externalId","map","space","neighbors"],type:"object"},ObstructionCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},ObstructionId:{pattern:"^o_[A-Za-z0-9_-]{8,}$",type:"string"},ObstructionProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this obstruction, if it is a polygon. This is undefined for line strings as this can be trivially derived."},details:{$ref:"#/definitions/Details"},entrances:{description:"A list of entrance IDs corresponding to entrances that can be used to navigate through this obstruction.",items:{$ref:"#/definitions/EntranceId"},type:"array"},externalId:{type:"string"},footprintComponent:{description:"Indicates whether this obstruction is considered part of the footprint of the building it is a part of. For example, an exterior wall would be considered part of the building footprint.",type:"boolean"},id:{$ref:"#/definitions/ObstructionId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"}},required:["id","externalId","entrances"],type:"object"},OpeningHoursSpecification:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.\n\nBehavioral notes:\n- if the \"opens\" property is not present, the location is closed, and the closes property is ignored (Schema.org style)\n- if opens/closes are both set to 00:00, the location is closed (Google style)\n- If special hours do not specifiy certain weekdays being open, those weekdays are closed.\n- Not specifying dayOfWeek is equivalent to specifying every day of the week.\n- we will omit the '@type' property when producing MVFs. But we won't reject 3rd party MVFs that include it.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of opening hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the opening hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the opening hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the opening hours start"},validFrom:{description:"The date the opening hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the opening hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},OperationHours:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of operation hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the operation hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the operation hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the operation hours start"},validFrom:{description:"The date the operation hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the operation hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},ParsedMVF:{additionalProperties:!1,properties:{annotation:{additionalProperties:{anyOf:[{$ref:"#/definitions/AnnotationCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},area:{additionalProperties:{anyOf:[{$ref:"#/definitions/AreaCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"category.json":{items:{$ref:"#/definitions/Category"},type:"array"},"connection.json":{$ref:"#/definitions/Connections"},enterprise:{$ref:"#/definitions/EnterpriseCollection"},entrance:{additionalProperties:{anyOf:[{$ref:"#/definitions/EntranceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},facade:{additionalProperties:{anyOf:[{$ref:"#/definitions/Facade"},{not:{}}]},propertyNames:{pattern:"^fs_[A-Za-z0-9_-]{8,}$"},type:"object"},"floor.geojson":{$ref:"#/definitions/FloorCollection"},floorImages:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorImageFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"floorstack.json":{$ref:"#/definitions/FloorStacks"},"location.json":{items:{$ref:"#/definitions/Location"},type:"array"},"manifest.geojson":{$ref:"#/definitions/ManifestCollection"},"map.geojson":{$ref:"#/definitions/Maps",deprecated:"Use `floor.geojson` instead."},"mapstack.geojson":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},"mapstack.json":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},modelInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ModelInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"node.geojson":{$ref:"#/definitions/NodeCollection"},obstruction:{additionalProperties:{anyOf:[{$ref:"#/definitions/ObstructionCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},shapeInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ShapeInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"shapes.json":{$ref:"#/definitions/ShapeCollection"},space:{additionalProperties:{anyOf:[{$ref:"#/definitions/SpaceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"styles.json":{$ref:"#/definitions/StyleCollection"},textAreas:{additionalProperties:{anyOf:[{$ref:"#/definitions/TextAreaFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"tileset.json":{$ref:"#/definitions/TilesetCollection"},window:{additionalProperties:{anyOf:[{$ref:"#/definitions/WindowCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"}},required:["manifest.geojson","mapstack.geojson","map.geojson","space","obstruction","connection.json","node.geojson","entrance"],type:"object"},Point:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Point geometry.",properties:{coordinates:{$ref:"#/definitions/Position"},type:{const:"Point",type:"string"}},required:["coordinates","type"],type:"object"},PointStyle:{additionalProperties:!1,properties:{points:{description:"The points which this style applies to.",items:{$ref:"#/definitions/SpaceId"},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the point.",type:"boolean"}},required:["points"],type:"object"},Polygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Polygon geometry.",properties:{coordinates:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:{const:"Polygon",type:"string"}},required:["coordinates","type"],type:"object"},PolygonStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},opacity:{maximum:1,minimum:0,type:"number"},polygons:{description:"The polygons which this style applies to.",items:{anyOf:[{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the polygon.",type:"boolean"}},required:["altitude","color","height","opacity","polygons"],type:"object"},Position:{description:"A valid WGS 84 position consisting of a longitude coodinate, followed by a latitude coordinate.",items:[{$ref:"#/definitions/Longitude"},{$ref:"#/definitions/Latitude"}],maxItems:2,minItems:2,type:"array"},Ring:{description:"A simple shape for part of a complex polygon",items:{$ref:"#/definitions/LocalPosition"},minItems:3,type:"array"},Shape:{description:"A 3D object made from extruded 2D polygons, that can be rendered to the map as a ShapeInstance.",items:{$ref:"#/definitions/ShapeComponent"},minItems:1,type:"array"},ShapeCollection:{additionalProperties:{$ref:"#/definitions/Shape"},description:"A group of Shapes, without any information as to how they will be placed in a scene.",propertyNames:{pattern:"^sh_[A-Za-z0-9_-]{8,}$"},type:"object"},ShapeComponent:{additionalProperties:!1,description:"A single extruded 2D polygon.",properties:{altitude:{description:"In metres.",type:"number"},geometry:{description:"Can contain holes, like GeoJSON.",items:{$ref:"#/definitions/Ring"},minItems:1,type:"array"},height:{description:"In metres.",exclusiveMinimum:0,type:"number"}},required:["geometry","altitude","height"],type:"object"},ShapeId:{pattern:"^sh_[A-Za-z0-9_-]{8,}$",type:"string"},ShapeInstance:{additionalProperties:!1,description:"An instance of a Shape.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},id:{$ref:"#/definitions/ShapeId",description:"The identifier of the Shape to be placed."},material:{$ref:"#/definitions/Material",description:"The color and/or texture to apply to this shape instance."},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","id","material","position","rotation","scale"],type:"object"},ShapeInstanceCollection:{additionalProperties:{$ref:"#/definitions/ShapeInstance"},description:"A map of shape instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},SiblingGroup:{additionalProperties:!1,properties:{label:{type:"string"},siblings:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"}},required:["label","siblings"],type:"object"},SpaceCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},SpaceId:{pattern:"^s_[A-Za-z0-9_-]{8,}$",type:"string"},SpaceProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this space, if it is a polygon. This is undefined for line string and point spaces as these can be trivially derived."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this space.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/SpaceId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"},tags:{description:"A list of tags that may apply to categorize the space, e.g. Void",items:{type:"string"},type:"array"}},required:["id","externalId","destinationNodes"],type:"object"},StyleCollection:{additionalProperties:{anyOf:[{$ref:"#/definitions/PolygonStyle"},{$ref:"#/definitions/LineStringStyle"},{$ref:"#/definitions/PointStyle"},{not:{}}]},description:"A map of layer styles, where keys represent the group IDs of each style.",type:"object"},TextAreaAlignment:{enum:["near","center"],type:"string"},TextAreaFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CTextAreaProperties%3E",description:"A collection of text areas to be displayed on a map. They are either attached to a polygon or are floating in space."},TextAreaProperties:{anyOf:[{$ref:"#/definitions/AnchoredTextAreaProperties"},{$ref:"#/definitions/FloatingTextAreaProperties"}]},Texture:{additionalProperties:!1,description:"A reference to an image texture and how it should be applied to a Component.",properties:{path:{description:"The path to this asset, relative to the MVF's images folder.",minLength:1,type:"string"},repeat:{$ref:"#/definitions/TextureRepeat"}},required:["path"],type:"object"},TextureRepeat:{additionalProperties:!1,description:"How a texture should be placed on a Component.",properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},TilesetCollection:{additionalProperties:!1,description:"Collection of tileset styles",properties:{default:{$ref:"#/definitions/TilesetStyle",description:"Default tileset style that should be used"},others:{description:"Additional tileset styles that can be used",items:{$ref:"#/definitions/TilesetStyle"},type:"array"}},required:["default"],type:"object"},TilesetStyle:{additionalProperties:!1,description:"A tileset style definition",properties:{key:{description:"Unique identifier for this tileset style",minLength:1,type:"string"},name:{description:"Display name for this tileset style",minLength:1,type:"string"},url:{description:"URL to the tileset style definition. This should be a JSON file matching the MapLibre style specification.",format:"uri",type:"string"}},required:["key","name","url"],type:"object"},Time:{description:"A time in the format of HH:MM:SS",pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",type:"string"},Vector3:{description:"A three-number tuple.",items:{type:"number"},maxItems:3,minItems:3,type:"array"},WindowCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/WindowProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},WindowId:{pattern:"^w_[A-Za-z0-9_-]{8,}$",type:"string"},WindowProperties:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/WindowId"}},required:["id"],type:"object"}}};var Oyt=$Y.default.default(new jY.default.default).compile(pw(BY));g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();var Jr={};wc(Jr,{HasPropertyKey:()=>Q0e,IsArray:()=>Gs,IsAsyncIterator:()=>y6,IsBigInt:()=>rI,IsBoolean:()=>lh,IsDate:()=>hg,IsFunction:()=>v6,IsIterator:()=>b6,IsNull:()=>x6,IsNumber:()=>Gu,IsObject:()=>Hn,IsRegExp:()=>nI,IsString:()=>ri,IsSymbol:()=>I6,IsUint8Array:()=>If,IsUndefined:()=>Li});g();function Q0e(e,t){return t in e}o(Q0e,"HasPropertyKey");function y6(e){return Hn(e)&&!Gs(e)&&!If(e)&&Symbol.asyncIterator in e}o(y6,"IsAsyncIterator");function Gs(e){return Array.isArray(e)}o(Gs,"IsArray");function rI(e){return typeof e=="bigint"}o(rI,"IsBigInt");function lh(e){return typeof e=="boolean"}o(lh,"IsBoolean");function hg(e){return e instanceof globalThis.Date}o(hg,"IsDate");function v6(e){return typeof e=="function"}o(v6,"IsFunction");function b6(e){return Hn(e)&&!Gs(e)&&!If(e)&&Symbol.iterator in e}o(b6,"IsIterator");function x6(e){return e===null}o(x6,"IsNull");function Gu(e){return typeof e=="number"}o(Gu,"IsNumber");function Hn(e){return typeof e=="object"&&e!==null}o(Hn,"IsObject");function nI(e){return e instanceof globalThis.RegExp}o(nI,"IsRegExp");function ri(e){return typeof e=="string"}o(ri,"IsString");function I6(e){return typeof e=="symbol"}o(I6,"IsSymbol");function If(e){return e instanceof globalThis.Uint8Array}o(If,"IsUint8Array");function Li(e){return e===void 0}o(Li,"IsUndefined");function e1e(e){return e.map(t=>fw(t))}o(e1e,"ArrayType");function t1e(e){return new Date(e.getTime())}o(t1e,"DateType");function r1e(e){return new Uint8Array(e)}o(r1e,"Uint8ArrayType");function n1e(e){return new RegExp(e.source,e.flags)}o(n1e,"RegExpType");function i1e(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=fw(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=fw(e[r]);return t}o(i1e,"ObjectType");function fw(e){return Gs(e)?e1e(e):hg(e)?t1e(e):If(e)?r1e(e):nI(e)?n1e(e):Hn(e)?i1e(e):e}o(fw,"Visit");function di(e){return fw(e)}o(di,"Clone");function GY(e){return e.map(t=>iI(t))}o(GY,"CloneRest");function iI(e,t){return t===void 0?di(e):di(R(R({},t),e))}o(iI,"CloneType");g();g();g();function dw(e){return Ut(e)&&Symbol.asyncIterator in e}o(dw,"IsAsyncIterator");function hw(e){return Ut(e)&&Symbol.iterator in e}o(hw,"IsIterator");function _6(e){return Ut(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}o(_6,"IsStandardObject");function mw(e){return e instanceof Promise}o(mw,"IsPromise");function ha(e){return e instanceof Date&&Number.isFinite(e.getTime())}o(ha,"IsDate");function UY(e){return e instanceof globalThis.Map}o(UY,"IsMap");function VY(e){return e instanceof globalThis.Set}o(VY,"IsSet");function Vl(e){return ArrayBuffer.isView(e)}o(Vl,"IsTypedArray");function c1(e){return e instanceof globalThis.Uint8Array}o(c1,"IsUint8Array");function At(e,t){return t in e}o(At,"HasPropertyKey");function Ut(e){return e!==null&&typeof e=="object"}o(Ut,"IsObject");function Bt(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}o(Bt,"IsArray");function Ai(e){return e===void 0}o(Ai,"IsUndefined");function _f(e){return e===null}o(_f,"IsNull");function Qc(e){return typeof e=="boolean"}o(Qc,"IsBoolean");function _t(e){return typeof e=="number"}o(_t,"IsNumber");function gw(e){return Number.isInteger(e)}o(gw,"IsInteger");function gs(e){return typeof e=="bigint"}o(gs,"IsBigInt");function Qr(e){return typeof e=="string"}o(Qr,"IsString");function uh(e){return typeof e=="function"}o(uh,"IsFunction");function Sf(e){return typeof e=="symbol"}o(Sf,"IsSymbol");function ys(e){return gs(e)||Qc(e)||_f(e)||_t(e)||Qr(e)||Sf(e)||Ai(e)}o(ys,"IsValueType");var Mn;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(l,c){return e.ExactOptionalPropertyTypes?c in l:l[c]!==void 0}o(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(l){let c=Ut(l);return e.AllowArrayObject?c:c&&!Bt(l)}o(r,"IsObjectLike"),e.IsObjectLike=r;function n(l){return r(l)&&!(l instanceof Date)&&!(l instanceof Uint8Array)}o(n,"IsRecordLike"),e.IsRecordLike=n;function i(l){return e.AllowNaN?_t(l):Number.isFinite(l)}o(i,"IsNumberLike"),e.IsNumberLike=i;function s(l){let c=Ai(l);return e.AllowNullVoid?c||l===null:c}o(s,"IsVoidLike"),e.IsVoidLike=s})(Mn||(Mn={}));g();function o1e(e){return globalThis.Object.freeze(e).map(t=>oI(t))}o(o1e,"ImmutableArray");function s1e(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=oI(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=oI(e[r]);return globalThis.Object.freeze(t)}o(s1e,"ImmutableObject");function oI(e){return Gs(e)?o1e(e):hg(e)?e:If(e)?e:nI(e)?e:Hn(e)?s1e(e):e}o(oI,"Immutable");function Re(e,t){let r=t!==void 0?R(R({},t),e):e;switch(Mn.InstanceMode){case"freeze":return oI(r);case"clone":return di(r);default:return r}}o(Re,"CreateType");g();var S6=class S6 extends Error{constructor(t){super(t)}};o(S6,"TypeBoxError");var Mt=S6;g();g();g();var hi=Symbol.for("TypeBox.Transform"),Cf=Symbol.for("TypeBox.Readonly"),ma=Symbol.for("TypeBox.Optional"),zl=Symbol.for("TypeBox.Hint"),xe=Symbol.for("TypeBox.Kind");function zY(e){return Hn(e)&&e[Cf]==="Readonly"}o(zY,"IsReadonly");function ep(e){return Hn(e)&&e[ma]==="Optional"}o(ep,"IsOptional");function C6(e){return sn(e,"Any")}o(C6,"IsAny");function wf(e){return sn(e,"Array")}o(wf,"IsArray");function sI(e){return sn(e,"AsyncIterator")}o(sI,"IsAsyncIterator");function w6(e){return sn(e,"BigInt")}o(w6,"IsBigInt");function P6(e){return sn(e,"Boolean")}o(P6,"IsBoolean");function aI(e){return sn(e,"Constructor")}o(aI,"IsConstructor");function a1e(e){return sn(e,"Date")}o(a1e,"IsDate");function lI(e){return sn(e,"Function")}o(lI,"IsFunction");function mg(e){return sn(e,"Integer")}o(mg,"IsInteger");function Ji(e){return sn(e,"Intersect")}o(Ji,"IsIntersect");function uI(e){return sn(e,"Iterator")}o(uI,"IsIterator");function sn(e,t){return Hn(e)&&xe in e&&e[xe]===t}o(sn,"IsKindOf");function Pf(e){return sn(e,"Literal")}o(Pf,"IsLiteral");function ul(e){return sn(e,"MappedKey")}o(ul,"IsMappedKey");function mi(e){return sn(e,"MappedResult")}o(mi,"IsMappedResult");function ch(e){return sn(e,"Never")}o(ch,"IsNever");function l1e(e){return sn(e,"Not")}o(l1e,"IsNot");function u1e(e){return sn(e,"Null")}o(u1e,"IsNull");function gg(e){return sn(e,"Number")}o(gg,"IsNumber");function Eo(e){return sn(e,"Object")}o(Eo,"IsObject");function yg(e){return sn(e,"Promise")}o(yg,"IsPromise");function T6(e){return sn(e,"Record")}o(T6,"IsRecord");function E6(e){return sn(e,"Ref")}o(E6,"IsRef");function M6(e){return sn(e,"RegExp")}o(M6,"IsRegExp");function cI(e){return sn(e,"String")}o(cI,"IsString");function c1e(e){return sn(e,"Symbol")}o(c1e,"IsSymbol");function cl(e){return sn(e,"TemplateLiteral")}o(cl,"IsTemplateLiteral");function p1e(e){return sn(e,"This")}o(p1e,"IsThis");function p1(e){return Hn(e)&&hi in e}o(p1,"IsTransform");function Uu(e){return sn(e,"Tuple")}o(Uu,"IsTuple");function f1e(e){return sn(e,"Undefined")}o(f1e,"IsUndefined");function bn(e){return sn(e,"Union")}o(bn,"IsUnion");function d1e(e){return sn(e,"Uint8Array")}o(d1e,"IsUint8Array");function h1e(e){return sn(e,"Unknown")}o(h1e,"IsUnknown");function m1e(e){return sn(e,"Unsafe")}o(m1e,"IsUnsafe");function g1e(e){return sn(e,"Void")}o(g1e,"IsVoid");function ph(e){return Hn(e)&&xe in e&&ri(e[xe])}o(ph,"IsKind");function Vu(e){return C6(e)||wf(e)||P6(e)||w6(e)||sI(e)||aI(e)||a1e(e)||lI(e)||mg(e)||Ji(e)||uI(e)||Pf(e)||ul(e)||mi(e)||ch(e)||l1e(e)||u1e(e)||gg(e)||Eo(e)||yg(e)||T6(e)||E6(e)||M6(e)||cI(e)||c1e(e)||cl(e)||p1e(e)||Uu(e)||f1e(e)||bn(e)||d1e(e)||h1e(e)||m1e(e)||g1e(e)||ph(e)}o(Vu,"IsSchema");var oe={};wc(oe,{IsAny:()=>XY,IsArray:()=>YY,IsAsyncIterator:()=>ZY,IsBigInt:()=>KY,IsBoolean:()=>JY,IsConstructor:()=>QY,IsDate:()=>eZ,IsFunction:()=>tZ,IsInteger:()=>rZ,IsIntersect:()=>nZ,IsIterator:()=>iZ,IsKind:()=>EZ,IsKindOf:()=>tn,IsLiteral:()=>fI,IsLiteralBoolean:()=>_1e,IsLiteralNumber:()=>sZ,IsLiteralString:()=>oZ,IsLiteralValue:()=>aZ,IsMappedKey:()=>lZ,IsMappedResult:()=>uZ,IsNever:()=>cZ,IsNot:()=>pZ,IsNull:()=>fZ,IsNumber:()=>dZ,IsObject:()=>hZ,IsOptional:()=>I1e,IsPromise:()=>mZ,IsProperties:()=>D6,IsReadonly:()=>x1e,IsRecord:()=>gZ,IsRecursive:()=>S1e,IsRef:()=>yZ,IsRegExp:()=>vZ,IsSchema:()=>en,IsString:()=>bZ,IsSymbol:()=>xZ,IsTemplateLiteral:()=>IZ,IsThis:()=>_Z,IsTransform:()=>ni,IsTuple:()=>SZ,IsUint8Array:()=>CZ,IsUndefined:()=>f1,IsUnion:()=>F6,IsUnionLiteral:()=>C1e,IsUnknown:()=>wZ,IsUnsafe:()=>PZ,IsVoid:()=>TZ,TypeGuardUnknownTypeError:()=>O6});g();var N6=class N6 extends Mt{};o(N6,"TypeGuardUnknownTypeError");var O6=N6,y1e=["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 qY(e){try{return new RegExp(e),!0}catch(t){return!1}}o(qY,"IsPattern");function L6(e){if(!ri(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(L6,"IsControlCharacterFree");function HY(e){return A6(e)||en(e)}o(HY,"IsAdditionalProperties");function pI(e){return Li(e)||rI(e)}o(pI,"IsOptionalBigInt");function Jn(e){return Li(e)||Gu(e)}o(Jn,"IsOptionalNumber");function A6(e){return Li(e)||lh(e)}o(A6,"IsOptionalBoolean");function Fn(e){return Li(e)||ri(e)}o(Fn,"IsOptionalString");function v1e(e){return Li(e)||ri(e)&&L6(e)&&qY(e)}o(v1e,"IsOptionalPattern");function b1e(e){return Li(e)||ri(e)&&L6(e)}o(b1e,"IsOptionalFormat");function WY(e){return Li(e)||en(e)}o(WY,"IsOptionalSchema");function x1e(e){return Hn(e)&&e[Cf]==="Readonly"}o(x1e,"IsReadonly");function I1e(e){return Hn(e)&&e[ma]==="Optional"}o(I1e,"IsOptional");function XY(e){return tn(e,"Any")&&Fn(e.$id)}o(XY,"IsAny");function YY(e){return tn(e,"Array")&&e.type==="array"&&Fn(e.$id)&&en(e.items)&&Jn(e.minItems)&&Jn(e.maxItems)&&A6(e.uniqueItems)&&WY(e.contains)&&Jn(e.minContains)&&Jn(e.maxContains)}o(YY,"IsArray");function ZY(e){return tn(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Fn(e.$id)&&en(e.items)}o(ZY,"IsAsyncIterator");function KY(e){return tn(e,"BigInt")&&e.type==="bigint"&&Fn(e.$id)&&pI(e.exclusiveMaximum)&&pI(e.exclusiveMinimum)&&pI(e.maximum)&&pI(e.minimum)&&pI(e.multipleOf)}o(KY,"IsBigInt");function JY(e){return tn(e,"Boolean")&&e.type==="boolean"&&Fn(e.$id)}o(JY,"IsBoolean");function QY(e){return tn(e,"Constructor")&&e.type==="Constructor"&&Fn(e.$id)&&Gs(e.parameters)&&e.parameters.every(t=>en(t))&&en(e.returns)}o(QY,"IsConstructor");function eZ(e){return tn(e,"Date")&&e.type==="Date"&&Fn(e.$id)&&Jn(e.exclusiveMaximumTimestamp)&&Jn(e.exclusiveMinimumTimestamp)&&Jn(e.maximumTimestamp)&&Jn(e.minimumTimestamp)&&Jn(e.multipleOfTimestamp)}o(eZ,"IsDate");function tZ(e){return tn(e,"Function")&&e.type==="Function"&&Fn(e.$id)&&Gs(e.parameters)&&e.parameters.every(t=>en(t))&&en(e.returns)}o(tZ,"IsFunction");function rZ(e){return tn(e,"Integer")&&e.type==="integer"&&Fn(e.$id)&&Jn(e.exclusiveMaximum)&&Jn(e.exclusiveMinimum)&&Jn(e.maximum)&&Jn(e.minimum)&&Jn(e.multipleOf)}o(rZ,"IsInteger");function D6(e){return Hn(e)&&Object.entries(e).every(([t,r])=>L6(t)&&en(r))}o(D6,"IsProperties");function nZ(e){return tn(e,"Intersect")&&!(ri(e.type)&&e.type!=="object")&&Gs(e.allOf)&&e.allOf.every(t=>en(t)&&!ni(t))&&Fn(e.type)&&(A6(e.unevaluatedProperties)||WY(e.unevaluatedProperties))&&Fn(e.$id)}o(nZ,"IsIntersect");function iZ(e){return tn(e,"Iterator")&&e.type==="Iterator"&&Fn(e.$id)&&en(e.items)}o(iZ,"IsIterator");function tn(e,t){return Hn(e)&&xe in e&&e[xe]===t}o(tn,"IsKindOf");function oZ(e){return fI(e)&&ri(e.const)}o(oZ,"IsLiteralString");function sZ(e){return fI(e)&&Gu(e.const)}o(sZ,"IsLiteralNumber");function _1e(e){return fI(e)&&lh(e.const)}o(_1e,"IsLiteralBoolean");function fI(e){return tn(e,"Literal")&&Fn(e.$id)&&aZ(e.const)}o(fI,"IsLiteral");function aZ(e){return lh(e)||Gu(e)||ri(e)}o(aZ,"IsLiteralValue");function lZ(e){return tn(e,"MappedKey")&&Gs(e.keys)&&e.keys.every(t=>Gu(t)||ri(t))}o(lZ,"IsMappedKey");function uZ(e){return tn(e,"MappedResult")&&D6(e.properties)}o(uZ,"IsMappedResult");function cZ(e){return tn(e,"Never")&&Hn(e.not)&&Object.getOwnPropertyNames(e.not).length===0}o(cZ,"IsNever");function pZ(e){return tn(e,"Not")&&en(e.not)}o(pZ,"IsNot");function fZ(e){return tn(e,"Null")&&e.type==="null"&&Fn(e.$id)}o(fZ,"IsNull");function dZ(e){return tn(e,"Number")&&e.type==="number"&&Fn(e.$id)&&Jn(e.exclusiveMaximum)&&Jn(e.exclusiveMinimum)&&Jn(e.maximum)&&Jn(e.minimum)&&Jn(e.multipleOf)}o(dZ,"IsNumber");function hZ(e){return tn(e,"Object")&&e.type==="object"&&Fn(e.$id)&&D6(e.properties)&&HY(e.additionalProperties)&&Jn(e.minProperties)&&Jn(e.maxProperties)}o(hZ,"IsObject");function mZ(e){return tn(e,"Promise")&&e.type==="Promise"&&Fn(e.$id)&&en(e.item)}o(mZ,"IsPromise");function gZ(e){return tn(e,"Record")&&e.type==="object"&&Fn(e.$id)&&HY(e.additionalProperties)&&Hn(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&qY(r[0])&&Hn(t.patternProperties)&&en(t.patternProperties[r[0]])})(e)}o(gZ,"IsRecord");function S1e(e){return Hn(e)&&zl in e&&e[zl]==="Recursive"}o(S1e,"IsRecursive");function yZ(e){return tn(e,"Ref")&&Fn(e.$id)&&ri(e.$ref)}o(yZ,"IsRef");function vZ(e){return tn(e,"RegExp")&&Fn(e.$id)&&ri(e.source)&&ri(e.flags)&&Jn(e.maxLength)&&Jn(e.minLength)}o(vZ,"IsRegExp");function bZ(e){return tn(e,"String")&&e.type==="string"&&Fn(e.$id)&&Jn(e.minLength)&&Jn(e.maxLength)&&v1e(e.pattern)&&b1e(e.format)}o(bZ,"IsString");function xZ(e){return tn(e,"Symbol")&&e.type==="symbol"&&Fn(e.$id)}o(xZ,"IsSymbol");function IZ(e){return tn(e,"TemplateLiteral")&&e.type==="string"&&ri(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}o(IZ,"IsTemplateLiteral");function _Z(e){return tn(e,"This")&&Fn(e.$id)&&ri(e.$ref)}o(_Z,"IsThis");function ni(e){return Hn(e)&&hi in e}o(ni,"IsTransform");function SZ(e){return tn(e,"Tuple")&&e.type==="array"&&Fn(e.$id)&&Gu(e.minItems)&&Gu(e.maxItems)&&e.minItems===e.maxItems&&(Li(e.items)&&Li(e.additionalItems)&&e.minItems===0||Gs(e.items)&&e.items.every(t=>en(t)))}o(SZ,"IsTuple");function f1(e){return tn(e,"Undefined")&&e.type==="undefined"&&Fn(e.$id)}o(f1,"IsUndefined");function C1e(e){return F6(e)&&e.anyOf.every(t=>oZ(t)||sZ(t))}o(C1e,"IsUnionLiteral");function F6(e){return tn(e,"Union")&&Fn(e.$id)&&Hn(e)&&Gs(e.anyOf)&&e.anyOf.every(t=>en(t))}o(F6,"IsUnion");function CZ(e){return tn(e,"Uint8Array")&&e.type==="Uint8Array"&&Fn(e.$id)&&Jn(e.minByteLength)&&Jn(e.maxByteLength)}o(CZ,"IsUint8Array");function wZ(e){return tn(e,"Unknown")&&Fn(e.$id)}o(wZ,"IsUnknown");function PZ(e){return tn(e,"Unsafe")}o(PZ,"IsUnsafe");function TZ(e){return tn(e,"Void")&&e.type==="void"&&Fn(e.$id)}o(TZ,"IsVoid");function EZ(e){return Hn(e)&&xe in e&&ri(e[xe])&&!y1e.includes(e[xe])}o(EZ,"IsKind");function en(e){return Hn(e)&&(XY(e)||YY(e)||JY(e)||KY(e)||ZY(e)||QY(e)||eZ(e)||tZ(e)||rZ(e)||nZ(e)||iZ(e)||fI(e)||lZ(e)||uZ(e)||cZ(e)||pZ(e)||fZ(e)||dZ(e)||hZ(e)||mZ(e)||gZ(e)||yZ(e)||vZ(e)||bZ(e)||xZ(e)||IZ(e)||_Z(e)||SZ(e)||f1(e)||F6(e)||CZ(e)||wZ(e)||PZ(e)||TZ(e)||EZ(e))}o(en,"IsSchema");g();var k6="(true|false)",dI="(0|[1-9][0-9]*)",R6="(.*)",w1e="(?!.*)",Q0t="^".concat(k6,"$"),Tf="^".concat(dI,"$"),Ef="^".concat(R6,"$"),MZ="^".concat(w1e,"$");g();var ga={};wc(ga,{Clear:()=>T1e,Delete:()=>E1e,Entries:()=>P1e,Get:()=>L1e,Has:()=>M1e,Set:()=>O1e});g();var d1=new Map;function P1e(){return new Map(d1)}o(P1e,"Entries");function T1e(){return d1.clear()}o(T1e,"Clear");function E1e(e){return d1.delete(e)}o(E1e,"Delete");function M1e(e){return d1.has(e)}o(M1e,"Has");function O1e(e,t){d1.set(e,t)}o(O1e,"Set");function L1e(e){return d1.get(e)}o(L1e,"Get");var Mo={};wc(Mo,{Clear:()=>D1e,Delete:()=>F1e,Entries:()=>A1e,Get:()=>R1e,Has:()=>N1e,Set:()=>k1e});g();var h1=new Map;function A1e(){return new Map(h1)}o(A1e,"Entries");function D1e(){return h1.clear()}o(D1e,"Clear");function F1e(e){return h1.delete(e)}o(F1e,"Delete");function N1e(e){return h1.has(e)}o(N1e,"Has");function k1e(e,t){h1.set(e,t)}o(k1e,"Set");function R1e(e){return h1.get(e)}o(R1e,"Get");g();function OZ(e,t){return e.includes(t)}o(OZ,"SetIncludes");function LZ(e){return[...new Set(e)]}o(LZ,"SetDistinct");function B1e(e,t){return e.filter(r=>t.includes(r))}o(B1e,"SetIntersect");function j1e(e,t){return e.reduce((r,n)=>B1e(r,n),t)}o(j1e,"SetIntersectManyResolve");function AZ(e){return e.length===1?e[0]:e.length>1?j1e(e.slice(1),e[0]):[]}o(AZ,"SetIntersectMany");function DZ(e){let t=[];for(let r of e)t.push(...r);return t}o(DZ,"SetUnionMany");g();function fh(e){return Re({[xe]:"Any"},e)}o(fh,"Any");g();function yw(e,t){return Re({[xe]:"Array",type:"array",items:e},t)}o(yw,"Array");g();function vw(e,t){return Re({[xe]:"AsyncIterator",type:"AsyncIterator",items:e},t)}o(vw,"AsyncIterator");g();g();g();function $1e(e,t){let i=e,{[t]:r}=i;return cs(i,[iS(t)])}o($1e,"DiscardKey");function Gi(e,t){return t.reduce((r,n)=>$1e(r,n),e)}o(Gi,"Discard");g();function Nn(e){return Re({[xe]:"Never",not:{}},e)}o(Nn,"Never");g();g();function an(e){return Re({[xe]:"MappedResult",properties:e})}o(an,"MappedResult");g();g();function bw(e,t,r){return Re({[xe]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}o(bw,"Constructor");g();function dh(e,t,r){return Re({[xe]:"Function",type:"Function",parameters:e,returns:t},r)}o(dh,"Function");g();g();g();g();function hI(e,t){return Re({[xe]:"Union",anyOf:e},t)}o(hI,"UnionCreate");function G1e(e){return e.some(t=>ep(t))}o(G1e,"IsUnionOptional");function FZ(e){return e.map(t=>ep(t)?U1e(t):t)}o(FZ,"RemoveOptionalFromRest");function U1e(e){return Gi(e,[ma])}o(U1e,"RemoveOptionalFromType");function V1e(e,t){return G1e(e)?ka(hI(FZ(e),t)):hI(FZ(e),t)}o(V1e,"ResolveUnion");function tp(e,t){return e.length===0?Nn(t):e.length===1?Re(e[0],t):V1e(e,t)}o(tp,"UnionEvaluated");g();function kn(e,t){return e.length===0?Nn(t):e.length===1?Re(e[0],t):hI(e,t)}o(kn,"Union");g();g();g();var j6=class j6 extends Mt{};o(j6,"TemplateLiteralParserError");var xw=j6;function z1e(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}o(z1e,"Unescape");function B6(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}o(B6,"IsNonEscaped");function Mf(e,t){return B6(e,t,"(")}o(Mf,"IsOpenParen");function mI(e,t){return B6(e,t,")")}o(mI,"IsCloseParen");function NZ(e,t){return B6(e,t,"|")}o(NZ,"IsSeparator");function q1e(e){if(!(Mf(e,0)&&mI(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Mf(e,r)&&(t+=1),mI(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}o(q1e,"IsGroup");function H1e(e){return e.slice(1,e.length-1)}o(H1e,"InGroup");function W1e(e){let t=0;for(let r=0;r<e.length;r++)if(Mf(e,r)&&(t+=1),mI(e,r)&&(t-=1),NZ(e,r)&&t===0)return!0;return!1}o(W1e,"IsPrecedenceOr");function X1e(e){for(let t=0;t<e.length;t++)if(Mf(e,t))return!0;return!1}o(X1e,"IsPrecedenceAnd");function Y1e(e){let[t,r]=[0,0],n=[];for(let s=0;s<e.length;s++)if(Mf(e,s)&&(t+=1),mI(e,s)&&(t-=1),NZ(e,s)&&t===0){let l=e.slice(r,s);l.length>0&&n.push(m1(l)),r=s+1}let i=e.slice(r);return i.length>0&&n.push(m1(i)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}o(Y1e,"Or");function Z1e(e){function t(i,s){if(!Mf(i,s))throw new xw("TemplateLiteralParser: Index must point to open parens");let l=0;for(let c=s;c<i.length;c++)if(Mf(i,c)&&(l+=1),mI(i,c)&&(l-=1),l===0)return[s,c];throw new xw("TemplateLiteralParser: Unclosed group parens in expression")}o(t,"Group");function r(i,s){for(let l=s;l<i.length;l++)if(Mf(i,l))return[s,l];return[s,i.length]}o(r,"Range");let n=[];for(let i=0;i<e.length;i++)if(Mf(e,i)){let[s,l]=t(e,i),c=e.slice(s,l+1);n.push(m1(c)),i=l}else{let[s,l]=r(e,i),c=e.slice(s,l);c.length>0&&n.push(m1(c)),i=l-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}o(Z1e,"And");function m1(e){return q1e(e)?m1(H1e(e)):W1e(e)?Y1e(e):X1e(e)?Z1e(e):{type:"const",const:z1e(e)}}o(m1,"TemplateLiteralParse");function g1(e){return m1(e.slice(1,e.length-1))}o(g1,"TemplateLiteralParseExact");var G6=class G6 extends Mt{};o(G6,"TemplateLiteralFiniteError");var $6=G6;function K1e(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(K1e,"IsNumberExpression");function J1e(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(J1e,"IsBooleanExpression");function Q1e(e){return e.type==="const"&&e.const===".*"}o(Q1e,"IsStringExpression");function vg(e){return K1e(e)||Q1e(e)?!1:J1e(e)?!0:e.type==="and"?e.expr.every(t=>vg(t)):e.type==="or"?e.expr.every(t=>vg(t)):e.type==="const"?!0:(()=>{throw new $6("Unknown expression type")})()}o(vg,"IsTemplateLiteralExpressionFinite");function Iw(e){let t=g1(e.pattern);return vg(t)}o(Iw,"IsTemplateLiteralFinite");g();var V6=class V6 extends Mt{};o(V6,"TemplateLiteralGenerateError");var U6=V6;function*kZ(e){if(e.length===1)return yield*Ve(e[0]);for(let t of e[0])for(let r of kZ(e.slice(1)))yield"".concat(t).concat(r)}o(kZ,"GenerateReduce");function*eve(e){return yield*Ve(kZ(e.expr.map(t=>[...gI(t)])))}o(eve,"GenerateAnd");function*tve(e){for(let t of e.expr)yield*Ve(gI(t))}o(tve,"GenerateOr");function*rve(e){return yield e.const}o(rve,"GenerateConst");function*gI(e){return e.type==="and"?yield*Ve(eve(e)):e.type==="or"?yield*Ve(tve(e)):e.type==="const"?yield*Ve(rve(e)):(()=>{throw new U6("Unknown expression")})()}o(gI,"TemplateLiteralExpressionGenerate");function y1(e){let t=g1(e.pattern);return vg(t)?[...gI(t)]:[]}o(y1,"TemplateLiteralGenerate");g();g();function In(e,t){return Re({[xe]:"Literal",const:e,type:typeof e},t)}o(In,"Literal");g();function _w(e){return Re({[xe]:"Boolean",type:"boolean"},e)}o(_w,"Boolean");g();function v1(e){return Re({[xe]:"BigInt",type:"bigint"},e)}o(v1,"BigInt");g();function rp(e){return Re({[xe]:"Number",type:"number"},e)}o(rp,"Number");g();function ql(e){return Re({[xe]:"String",type:"string"},e)}o(ql,"String");function*nve(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield _w():t==="number"?yield rp():t==="bigint"?yield v1():t==="string"?yield ql():yield(()=>{let r=t.split("|").map(n=>In(n.trim()));return r.length===0?Nn():r.length===1?r[0]:tp(r)})()}o(nve,"FromUnion");function*ive(e){if(e[1]!=="{"){let t=In("$"),r=z6(e.slice(1));return yield*Ve([t,...r])}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=nve(e.slice(2,t)),n=z6(e.slice(t+1));return yield*Ve([...r,...n])}yield In(e)}o(ive,"FromTerminal");function*z6(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=In(e.slice(0,t)),n=ive(e.slice(t));return yield*Ve([r,...n])}yield In(e)}o(z6,"FromSyntax");function RZ(e){return[...z6(e)]}o(RZ,"TemplateLiteralSyntax");g();var W6=class W6 extends Mt{};o(W6,"TemplateLiteralPatternError");var q6=W6;function ove(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(ove,"Escape");function BZ(e,t){return cl(e)?e.pattern.slice(1,e.pattern.length-1):bn(e)?"(".concat(e.anyOf.map(r=>BZ(r,t)).join("|"),")"):gg(e)?"".concat(t).concat(dI):mg(e)?"".concat(t).concat(dI):w6(e)?"".concat(t).concat(dI):cI(e)?"".concat(t).concat(R6):Pf(e)?"".concat(t).concat(ove(e.const.toString())):P6(e)?"".concat(t).concat(k6):(()=>{throw new q6("Unexpected Kind '".concat(e[xe],"'"))})()}o(BZ,"Visit");function H6(e){return"^".concat(e.map(t=>BZ(t,"")).join(""),"$")}o(H6,"TemplateLiteralPattern");g();function bg(e){let r=y1(e).map(n=>In(n));return tp(r)}o(bg,"TemplateLiteralToUnion");g();function Sw(e,t){let r=ri(e)?H6(RZ(e)):H6(e);return Re({[xe]:"TemplateLiteral",type:"string",pattern:r},t)}o(Sw,"TemplateLiteral");function sve(e){return y1(e).map(r=>r.toString())}o(sve,"FromTemplateLiteral");function ave(e){let t=[];for(let r of e)t.push(...Ra(r));return t}o(ave,"FromUnion");function lve(e){return[e.toString()]}o(lve,"FromLiteral");function Ra(e){return[...new Set(cl(e)?sve(e):bn(e)?ave(e.anyOf):Pf(e)?lve(e.const):gg(e)?["[number]"]:mg(e)?["[number]"]:[])]}o(Ra,"IndexPropertyKeys");g();function uve(e,t,r){let n={};for(let i of Object.getOwnPropertyNames(t))n[i]=b1(e,Ra(t[i]),r);return n}o(uve,"FromProperties");function cve(e,t,r){return uve(e,t.properties,r)}o(cve,"FromMappedResult");function jZ(e,t,r){let n=cve(e,t,r);return an(n)}o(jZ,"IndexFromMappedResult");function GZ(e,t){return e.map(r=>UZ(r,t))}o(GZ,"FromRest");function pve(e){return e.filter(t=>!ch(t))}o(pve,"FromIntersectRest");function fve(e,t){return Cw(pve(GZ(e,t)))}o(fve,"FromIntersect");function dve(e){return e.some(t=>ch(t))?[]:e}o(dve,"FromUnionRest");function hve(e,t){return tp(dve(GZ(e,t)))}o(hve,"FromUnion");function mve(e,t){return t in e?e[t]:t==="[number]"?tp(e):Nn()}o(mve,"FromTuple");function gve(e,t){return t==="[number]"?e:Nn()}o(gve,"FromArray");function yve(e,t){return t in e?e[t]:Nn()}o(yve,"FromProperty");function UZ(e,t){var r;return Ji(e)?fve(e.allOf,t):bn(e)?hve(e.anyOf,t):Uu(e)?mve((r=e.items)!=null?r:[],t):wf(e)?gve(e.items,t):Eo(e)?yve(e.properties,t):Nn()}o(UZ,"IndexFromPropertyKey");function yI(e,t){return t.map(r=>UZ(e,r))}o(yI,"IndexFromPropertyKeys");function $Z(e,t){return tp(yI(e,t))}o($Z,"FromSchema");function b1(e,t,r){return mi(t)?jZ(e,t,r):ul(t)?VZ(e,t,r):Re(Vu(t)?$Z(e,Ra(t)):$Z(e,t),r)}o(b1,"Index");function vve(e,t,r){return{[t]:b1(e,[t],di(r))}}o(vve,"MappedIndexPropertyKey");function bve(e,t,r){return t.reduce((n,i)=>R(R({},n),vve(e,i,r)),{})}o(bve,"MappedIndexPropertyKeys");function xve(e,t,r){return bve(e,t.keys,r)}o(xve,"MappedIndexProperties");function VZ(e,t,r){let n=xve(e,t,r);return an(n)}o(VZ,"IndexFromMappedKey");g();function ww(e,t){return Re({[xe]:"Iterator",type:"Iterator",items:e},t)}o(ww,"Iterator");g();function Ive(e){let t=[];for(let r in e)ep(e[r])||t.push(r);return t}o(Ive,"RequiredKeys");function _ve(e,t){let r=Ive(e),n=r.length>0?{[xe]:"Object",type:"object",properties:e,required:r}:{[xe]:"Object",type:"object",properties:e};return Re(n,t)}o(_ve,"_Object");var Wn=_ve;g();function Pw(e,t){return Re({[xe]:"Promise",type:"Promise",item:e},t)}o(Pw,"Promise");g();g();function Sve(e){return Re(Gi(e,[Cf]))}o(Sve,"RemoveReadonly");function Cve(e){return Re(re(R({},e),{[Cf]:"Readonly"}))}o(Cve,"AddReadonly");function wve(e,t){return t===!1?Sve(e):Cve(e)}o(wve,"ReadonlyWithFlag");function Hl(e,t){let r=t!=null?t:!0;return mi(e)?zZ(e,r):wve(e,r)}o(Hl,"Readonly");function Pve(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Hl(e[n],t);return r}o(Pve,"FromProperties");function Tve(e,t){return Pve(e.properties,t)}o(Tve,"FromMappedResult");function zZ(e,t){let r=Tve(e,t);return an(r)}o(zZ,"ReadonlyFromMappedResult");g();function np(e,t){return Re(e.length>0?{[xe]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[xe]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}o(np,"Tuple");function qZ(e,t){return e in t?Wl(e,t[e]):an(t)}o(qZ,"FromMappedResult");function Eve(e){return{[e]:In(e)}}o(Eve,"MappedKeyToKnownMappedResultProperties");function Mve(e){let t={};for(let r of e)t[r]=In(r);return t}o(Mve,"MappedKeyToUnknownMappedResultProperties");function Ove(e,t){return OZ(t,e)?Eve(e):Mve(t)}o(Ove,"MappedKeyToMappedResultProperties");function Lve(e,t){let r=Ove(e,t);return qZ(e,r)}o(Lve,"FromMappedKey");function vI(e,t){return t.map(r=>Wl(e,r))}o(vI,"FromRest");function Ave(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Wl(e,t[n]);return r}o(Ave,"FromProperties");function Wl(e,t){var n;let r=R({},t);return ep(t)?ka(Wl(e,Gi(t,[ma]))):zY(t)?Hl(Wl(e,Gi(t,[Cf]))):mi(t)?qZ(e,t.properties):ul(t)?Lve(e,t.keys):aI(t)?bw(vI(e,t.parameters),Wl(e,t.returns),r):lI(t)?dh(vI(e,t.parameters),Wl(e,t.returns),r):sI(t)?vw(Wl(e,t.items),r):uI(t)?ww(Wl(e,t.items),r):Ji(t)?Ba(vI(e,t.allOf),r):bn(t)?kn(vI(e,t.anyOf),r):Uu(t)?np(vI(e,(n=t.items)!=null?n:[]),r):Eo(t)?Wn(Ave(e,t.properties),r):wf(t)?yw(Wl(e,t.items),r):yg(t)?Pw(Wl(e,t.item),r):t}o(Wl,"FromSchemaType");function Dve(e,t){let r={};for(let n of e)r[n]=Wl(n,t);return r}o(Dve,"MappedFunctionReturnType");function HZ(e,t,r){let n=Vu(e)?Ra(e):e,i=t({[xe]:"MappedKey",keys:n}),s=Dve(n,i);return Wn(s,r)}o(HZ,"Mapped");g();function Fve(e){return Re(Gi(e,[ma]))}o(Fve,"RemoveOptional");function Nve(e){return Re(re(R({},e),{[ma]:"Optional"}))}o(Nve,"AddOptional");function kve(e,t){return t===!1?Fve(e):Nve(e)}o(kve,"OptionalWithFlag");function ka(e,t){let r=t!=null?t:!0;return mi(e)?WZ(e,r):kve(e,r)}o(ka,"Optional");function Rve(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ka(e[n],t);return r}o(Rve,"FromProperties");function Bve(e,t){return Rve(e.properties,t)}o(Bve,"FromMappedResult");function WZ(e,t){let r=Bve(e,t);return an(r)}o(WZ,"OptionalFromMappedResult");g();function bI(e,t={}){let r=e.every(i=>Eo(i)),n=Vu(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return Re(t.unevaluatedProperties===!1||Vu(t.unevaluatedProperties)||r?re(R({},n),{[xe]:"Intersect",type:"object",allOf:e}):re(R({},n),{[xe]:"Intersect",allOf:e}),t)}o(bI,"IntersectCreate");function jve(e){return e.every(t=>ep(t))}o(jve,"IsIntersectOptional");function $ve(e){return Gi(e,[ma])}o($ve,"RemoveOptionalFromType");function XZ(e){return e.map(t=>ep(t)?$ve(t):t)}o(XZ,"RemoveOptionalFromRest");function Gve(e,t){return jve(e)?ka(bI(XZ(e),t)):bI(XZ(e),t)}o(Gve,"ResolveIntersect");function Cw(e,t={}){if(e.length===0)return Nn(t);if(e.length===1)return Re(e[0],t);if(e.some(r=>p1(r)))throw new Error("Cannot intersect transform types");return Gve(e,t)}o(Cw,"IntersectEvaluated");g();function Ba(e,t){if(e.length===0)return Nn(t);if(e.length===1)return Re(e[0],t);if(e.some(r=>p1(r)))throw new Error("Cannot intersect transform types");return bI(e,t)}o(Ba,"Intersect");function YZ(e){return e.map(t=>X6(t))}o(YZ,"FromRest");function Uve(e){return Ba(YZ(e))}o(Uve,"FromIntersect");function Vve(e){return kn(YZ(e))}o(Vve,"FromUnion");function zve(e){return X6(e)}o(zve,"FromPromise");function X6(e){return Ji(e)?Uve(e.allOf):bn(e)?Vve(e.anyOf):yg(e)?zve(e.item):e}o(X6,"AwaitedResolve");function ZZ(e,t){return Re(X6(e),t)}o(ZZ,"Awaited");g();g();g();g();function KZ(e){let t=[];for(let r of e)t.push(Yo(r));return t}o(KZ,"FromRest");function qve(e){let t=KZ(e);return DZ(t)}o(qve,"FromIntersect");function Hve(e){let t=KZ(e);return AZ(t)}o(Hve,"FromUnion");function Wve(e){return e.map((t,r)=>r.toString())}o(Wve,"FromTuple");function Xve(e){return["[number]"]}o(Xve,"FromArray");function Yve(e){return globalThis.Object.getOwnPropertyNames(e)}o(Yve,"FromProperties");function Zve(e){return Y6?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}o(Zve,"FromPatternProperties");function Yo(e){var t;return Ji(e)?qve(e.allOf):bn(e)?Hve(e.anyOf):Uu(e)?Wve((t=e.items)!=null?t:[]):wf(e)?Xve(e.items):Eo(e)?Yve(e.properties):T6(e)?Zve(e.patternProperties):[]}o(Yo,"KeyOfPropertyKeys");var Y6=!1;function Of(e){Y6=!0;let t=Yo(e);Y6=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}o(Of,"KeyOfPattern");function Kve(e){return e.map(t=>t==="[number]"?rp():In(t))}o(Kve,"KeyOfPropertyKeysToRest");function Tw(e,t){if(mi(e))return JZ(e,t);{let r=Yo(e),n=Kve(r),i=tp(n);return Re(i,t)}}o(Tw,"KeyOf");function Jve(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Tw(e[n],di(t));return r}o(Jve,"FromProperties");function Qve(e,t){return Jve(e.properties,t)}o(Qve,"FromMappedResult");function JZ(e,t){let r=Qve(e,t);return an(r)}o(JZ,"KeyOfFromMappedResult");g();function hh(e){let t=Yo(e),r=yI(e,t);return t.map((n,i)=>[t[i],r[i]])}o(hh,"KeyOfPropertyEntries");function ebe(e){let t=[];for(let r of e)t.push(...Yo(r));return LZ(t)}o(ebe,"CompositeKeys");function tbe(e){return e.filter(t=>!ch(t))}o(tbe,"FilterNever");function rbe(e,t){let r=[];for(let n of e)r.push(...yI(n,[t]));return tbe(r)}o(rbe,"CompositeProperty");function nbe(e,t){let r={};for(let n of t)r[n]=Cw(rbe(e,n));return r}o(nbe,"CompositeProperties");function QZ(e,t){let r=ebe(e),n=nbe(e,r);return Wn(n,t)}o(QZ,"Composite");g();g();function Ew(e){return Re({[xe]:"Date",type:"Date"},e)}o(Ew,"Date");g();function Mw(e){return Re({[xe]:"Null",type:"null"},e)}o(Mw,"Null");g();function Ow(e){return Re({[xe]:"Symbol",type:"symbol"},e)}o(Ow,"Symbol");g();function Lw(e){return Re({[xe]:"Undefined",type:"undefined"},e)}o(Lw,"Undefined");g();function Aw(e){return Re({[xe]:"Uint8Array",type:"Uint8Array"},e)}o(Aw,"Uint8Array");g();function Lf(e){return Re({[xe]:"Unknown"},e)}o(Lf,"Unknown");function ibe(e){return e.map(t=>Z6(t,!1))}o(ibe,"FromArray");function obe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Hl(Z6(e[r],!1));return t}o(obe,"FromProperties");function Dw(e,t){return t===!0?e:Hl(e)}o(Dw,"ConditionalReadonly");function Z6(e,t){return y6(e)?Dw(fh(),t):b6(e)?Dw(fh(),t):Gs(e)?Hl(np(ibe(e))):If(e)?Aw():hg(e)?Ew():Hn(e)?Dw(Wn(obe(e)),t):v6(e)?Dw(dh([],Lf()),t):Li(e)?Lw():x6(e)?Mw():I6(e)?Ow():rI(e)?v1():Gu(e)?In(e):lh(e)?In(e):ri(e)?In(e):Wn({})}o(Z6,"FromValue");function eK(e,t){return Re(Z6(e,!0),t)}o(eK,"Const");g();function tK(e,t){return np(e.parameters,t)}o(tK,"ConstructorParameters");g();function xI(e,t){return e.map(r=>zu(r,t))}o(xI,"FromRest");function sbe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=zu(e[n],t);return r}o(sbe,"FromProperties");function abe(e,t){return e.parameters=xI(e.parameters,t),e.returns=zu(e.returns,t),e}o(abe,"FromConstructor");function lbe(e,t){return e.parameters=xI(e.parameters,t),e.returns=zu(e.returns,t),e}o(lbe,"FromFunction");function ube(e,t){return e.allOf=xI(e.allOf,t),e}o(ube,"FromIntersect");function cbe(e,t){return e.anyOf=xI(e.anyOf,t),e}o(cbe,"FromUnion");function pbe(e,t){return Li(e.items)||(e.items=xI(e.items,t)),e}o(pbe,"FromTuple");function fbe(e,t){return e.items=zu(e.items,t),e}o(fbe,"FromArray");function dbe(e,t){return e.properties=sbe(e.properties,t),e}o(dbe,"FromObject");function hbe(e,t){return e.item=zu(e.item,t),e}o(hbe,"FromPromise");function mbe(e,t){return e.items=zu(e.items,t),e}o(mbe,"FromAsyncIterator");function gbe(e,t){return e.items=zu(e.items,t),e}o(gbe,"FromIterator");function ybe(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=Gi(r,["$id"]);return zu(n,t)}o(ybe,"FromRef");function vbe(e,t){return aI(e)?abe(e,t):lI(e)?lbe(e,t):Ji(e)?ube(e,t):bn(e)?cbe(e,t):Uu(e)?pbe(e,t):wf(e)?fbe(e,t):Eo(e)?dbe(e,t):yg(e)?hbe(e,t):sI(e)?mbe(e,t):uI(e)?gbe(e,t):E6(e)?ybe(e,t):e}o(vbe,"DerefResolve");function zu(e,t){return vbe(iI(e),GY(t))}o(zu,"Deref");g();function rK(e,t){if(Li(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(s=>isNaN(s)).map(s=>e[s]),i=[...new Set(r)].map(s=>In(s));return kn(i,re(R({},t),{[zl]:"Enum"}))}o(rK,"Enum");g();g();g();var nL=class nL extends Mt{};o(nL,"ExtendsResolverError");var J6=nL,Ee;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(Ee||(Ee={}));function Xl(e){return e===Ee.False?e:Ee.True}o(Xl,"IntoBooleanResult");function x1(e){throw new J6(e)}o(x1,"Throw");function ho(e){return oe.IsNever(e)||oe.IsIntersect(e)||oe.IsUnion(e)||oe.IsUnknown(e)||oe.IsAny(e)}o(ho,"IsStructuralRight");function mo(e,t){return oe.IsNever(t)?uK(e,t):oe.IsIntersect(t)?Fw(e,t):oe.IsUnion(t)?rL(e,t):oe.IsUnknown(t)?dK(e,t):oe.IsAny(t)?tL(e,t):x1("StructuralRight")}o(mo,"StructuralRight");function tL(e,t){return Ee.True}o(tL,"FromAnyRight");function bbe(e,t){return oe.IsIntersect(t)?Fw(e,t):oe.IsUnion(t)&&t.anyOf.some(r=>oe.IsAny(r)||oe.IsUnknown(r))?Ee.True:oe.IsUnion(t)?Ee.Union:oe.IsUnknown(t)||oe.IsAny(t)?Ee.True:Ee.Union}o(bbe,"FromAny");function xbe(e,t){return oe.IsUnknown(e)?Ee.False:oe.IsAny(e)?Ee.Union:oe.IsNever(e)?Ee.True:Ee.False}o(xbe,"FromArrayRight");function Ibe(e,t){return oe.IsObject(t)&&Nw(t)?Ee.True:ho(t)?mo(e,t):oe.IsArray(t)?Xl(Rn(e.items,t.items)):Ee.False}o(Ibe,"FromArray");function _be(e,t){return ho(t)?mo(e,t):oe.IsAsyncIterator(t)?Xl(Rn(e.items,t.items)):Ee.False}o(_be,"FromAsyncIterator");function Sbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsBigInt(t)?Ee.True:Ee.False}o(Sbe,"FromBigInt");function aK(e,t){return oe.IsLiteralBoolean(e)||oe.IsBoolean(e)?Ee.True:Ee.False}o(aK,"FromBooleanRight");function Cbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsBoolean(t)?Ee.True:Ee.False}o(Cbe,"FromBoolean");function wbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsConstructor(t)?e.parameters.length>t.parameters.length?Ee.False:e.parameters.every((r,n)=>Xl(Rn(t.parameters[n],r))===Ee.True)?Xl(Rn(e.returns,t.returns)):Ee.False:Ee.False}o(wbe,"FromConstructor");function Pbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsDate(t)?Ee.True:Ee.False}o(Pbe,"FromDate");function Tbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsFunction(t)?e.parameters.length>t.parameters.length?Ee.False:e.parameters.every((r,n)=>Xl(Rn(t.parameters[n],r))===Ee.True)?Xl(Rn(e.returns,t.returns)):Ee.False:Ee.False}o(Tbe,"FromFunction");function lK(e,t){return oe.IsLiteral(e)&&Jr.IsNumber(e.const)||oe.IsNumber(e)||oe.IsInteger(e)?Ee.True:Ee.False}o(lK,"FromIntegerRight");function Ebe(e,t){return oe.IsInteger(t)||oe.IsNumber(t)?Ee.True:ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):Ee.False}o(Ebe,"FromInteger");function Fw(e,t){return t.allOf.every(r=>Rn(e,r)===Ee.True)?Ee.True:Ee.False}o(Fw,"FromIntersectRight");function Mbe(e,t){return e.allOf.some(r=>Rn(r,t)===Ee.True)?Ee.True:Ee.False}o(Mbe,"FromIntersect");function Obe(e,t){return ho(t)?mo(e,t):oe.IsIterator(t)?Xl(Rn(e.items,t.items)):Ee.False}o(Obe,"FromIterator");function Lbe(e,t){return oe.IsLiteral(t)&&t.const===e.const?Ee.True:ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsString(t)?fK(e,t):oe.IsNumber(t)?cK(e,t):oe.IsInteger(t)?lK(e,t):oe.IsBoolean(t)?aK(e,t):Ee.False}o(Lbe,"FromLiteral");function uK(e,t){return Ee.False}o(uK,"FromNeverRight");function Abe(e,t){return Ee.True}o(Abe,"FromNever");function nK(e){let[t,r]=[e,0];for(;oe.IsNot(t);)t=t.not,r+=1;return r%2===0?t:Lf()}o(nK,"UnwrapTNot");function Dbe(e,t){return oe.IsNot(e)?Rn(nK(e),t):oe.IsNot(t)?Rn(e,nK(t)):x1("Invalid fallthrough for Not")}o(Dbe,"FromNot");function Fbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsNull(t)?Ee.True:Ee.False}o(Fbe,"FromNull");function cK(e,t){return oe.IsLiteralNumber(e)||oe.IsNumber(e)||oe.IsInteger(e)?Ee.True:Ee.False}o(cK,"FromNumberRight");function Nbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsInteger(t)||oe.IsNumber(t)?Ee.True:Ee.False}o(Nbe,"FromNumber");function ja(e,t){return Object.getOwnPropertyNames(e.properties).length===t}o(ja,"IsObjectPropertyCount");function iK(e){return Nw(e)}o(iK,"IsObjectStringLike");function oK(e){return ja(e,0)||ja(e,1)&&"description"in e.properties&&oe.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(oe.IsString(e.properties.description.anyOf[0])&&oe.IsUndefined(e.properties.description.anyOf[1])||oe.IsString(e.properties.description.anyOf[1])&&oe.IsUndefined(e.properties.description.anyOf[0]))}o(oK,"IsObjectSymbolLike");function K6(e){return ja(e,0)}o(K6,"IsObjectNumberLike");function sK(e){return ja(e,0)}o(sK,"IsObjectBooleanLike");function kbe(e){return ja(e,0)}o(kbe,"IsObjectBigIntLike");function Rbe(e){return ja(e,0)}o(Rbe,"IsObjectDateLike");function Bbe(e){return Nw(e)}o(Bbe,"IsObjectUint8ArrayLike");function jbe(e){let t=rp();return ja(e,0)||ja(e,1)&&"length"in e.properties&&Xl(Rn(e.properties.length,t))===Ee.True}o(jbe,"IsObjectFunctionLike");function $be(e){return ja(e,0)}o($be,"IsObjectConstructorLike");function Nw(e){let t=rp();return ja(e,0)||ja(e,1)&&"length"in e.properties&&Xl(Rn(e.properties.length,t))===Ee.True}o(Nw,"IsObjectArrayLike");function Gbe(e){let t=dh([fh()],fh());return ja(e,0)||ja(e,1)&&"then"in e.properties&&Xl(Rn(e.properties.then,t))===Ee.True}o(Gbe,"IsObjectPromiseLike");function pK(e,t){return Rn(e,t)===Ee.False||oe.IsOptional(e)&&!oe.IsOptional(t)?Ee.False:Ee.True}o(pK,"Property");function Us(e,t){return oe.IsUnknown(e)?Ee.False:oe.IsAny(e)?Ee.Union:oe.IsNever(e)||oe.IsLiteralString(e)&&iK(t)||oe.IsLiteralNumber(e)&&K6(t)||oe.IsLiteralBoolean(e)&&sK(t)||oe.IsSymbol(e)&&oK(t)||oe.IsBigInt(e)&&kbe(t)||oe.IsString(e)&&iK(t)||oe.IsSymbol(e)&&oK(t)||oe.IsNumber(e)&&K6(t)||oe.IsInteger(e)&&K6(t)||oe.IsBoolean(e)&&sK(t)||oe.IsUint8Array(e)&&Bbe(t)||oe.IsDate(e)&&Rbe(t)||oe.IsConstructor(e)&&$be(t)||oe.IsFunction(e)&&jbe(t)?Ee.True:oe.IsRecord(e)&&oe.IsString(Q6(e))?t[zl]==="Record"?Ee.True:Ee.False:oe.IsRecord(e)&&oe.IsNumber(Q6(e))?ja(t,0)?Ee.True:Ee.False:Ee.False}o(Us,"FromObjectRight");function Ube(e,t){return ho(t)?mo(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!oe.IsOptional(t.properties[r]))return Ee.False;if(oe.IsOptional(t.properties[r]))return Ee.True;if(pK(e.properties[r],t.properties[r])===Ee.False)return Ee.False}return Ee.True})():Ee.False}o(Ube,"FromObject");function Vbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)&&Gbe(t)?Ee.True:oe.IsPromise(t)?Xl(Rn(e.item,t.item)):Ee.False}o(Vbe,"FromPromise");function Q6(e){return Tf in e.patternProperties?rp():Ef in e.patternProperties?ql():x1("Unknown record key pattern")}o(Q6,"RecordKey");function eL(e){return Tf in e.patternProperties?e.patternProperties[Tf]:Ef in e.patternProperties?e.patternProperties[Ef]:x1("Unable to get record value schema")}o(eL,"RecordValue");function Yl(e,t){let[r,n]=[Q6(t),eL(t)];return oe.IsLiteralString(e)&&oe.IsNumber(r)&&Xl(Rn(e,n))===Ee.True?Ee.True:oe.IsUint8Array(e)&&oe.IsNumber(r)||oe.IsString(e)&&oe.IsNumber(r)||oe.IsArray(e)&&oe.IsNumber(r)?Rn(e,n):oe.IsObject(e)?(()=>{for(let i of Object.getOwnPropertyNames(e.properties))if(pK(n,e.properties[i])===Ee.False)return Ee.False;return Ee.True})():Ee.False}o(Yl,"FromRecordRight");function zbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Rn(eL(e),eL(t)):Ee.False}o(zbe,"FromRecord");function qbe(e,t){let r=oe.IsRegExp(e)?ql():e,n=oe.IsRegExp(t)?ql():t;return Rn(r,n)}o(qbe,"FromRegExp");function fK(e,t){return oe.IsLiteral(e)&&Jr.IsString(e.const)||oe.IsString(e)?Ee.True:Ee.False}o(fK,"FromStringRight");function Hbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsString(t)?Ee.True:Ee.False}o(Hbe,"FromString");function Wbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsSymbol(t)?Ee.True:Ee.False}o(Wbe,"FromSymbol");function Xbe(e,t){return oe.IsTemplateLiteral(e)?Rn(bg(e),t):oe.IsTemplateLiteral(t)?Rn(e,bg(t)):x1("Invalid fallthrough for TemplateLiteral")}o(Xbe,"FromTemplateLiteral");function Ybe(e,t){return oe.IsArray(t)&&e.items!==void 0&&e.items.every(r=>Rn(r,t.items)===Ee.True)}o(Ybe,"IsArrayOfTuple");function Zbe(e,t){return oe.IsNever(e)?Ee.True:oe.IsUnknown(e)?Ee.False:oe.IsAny(e)?Ee.Union:Ee.False}o(Zbe,"FromTupleRight");function Kbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)&&Nw(t)||oe.IsArray(t)&&Ybe(e,t)?Ee.True:oe.IsTuple(t)?Jr.IsUndefined(e.items)&&!Jr.IsUndefined(t.items)||!Jr.IsUndefined(e.items)&&Jr.IsUndefined(t.items)?Ee.False:Jr.IsUndefined(e.items)&&!Jr.IsUndefined(t.items)||e.items.every((r,n)=>Rn(r,t.items[n])===Ee.True)?Ee.True:Ee.False:Ee.False}o(Kbe,"FromTuple");function Jbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsUint8Array(t)?Ee.True:Ee.False}o(Jbe,"FromUint8Array");function Qbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Us(e,t):oe.IsRecord(t)?Yl(e,t):oe.IsVoid(t)?rxe(e,t):oe.IsUndefined(t)?Ee.True:Ee.False}o(Qbe,"FromUndefined");function rL(e,t){return t.anyOf.some(r=>Rn(e,r)===Ee.True)?Ee.True:Ee.False}o(rL,"FromUnionRight");function exe(e,t){return e.anyOf.every(r=>Rn(r,t)===Ee.True)?Ee.True:Ee.False}o(exe,"FromUnion");function dK(e,t){return Ee.True}o(dK,"FromUnknownRight");function txe(e,t){return oe.IsNever(t)?uK(e,t):oe.IsIntersect(t)?Fw(e,t):oe.IsUnion(t)?rL(e,t):oe.IsAny(t)?tL(e,t):oe.IsString(t)?fK(e,t):oe.IsNumber(t)?cK(e,t):oe.IsInteger(t)?lK(e,t):oe.IsBoolean(t)?aK(e,t):oe.IsArray(t)?xbe(e,t):oe.IsTuple(t)?Zbe(e,t):oe.IsObject(t)?Us(e,t):oe.IsUnknown(t)?Ee.True:Ee.False}o(txe,"FromUnknown");function rxe(e,t){return oe.IsUndefined(e)||oe.IsUndefined(e)?Ee.True:Ee.False}o(rxe,"FromVoidRight");function nxe(e,t){return oe.IsIntersect(t)?Fw(e,t):oe.IsUnion(t)?rL(e,t):oe.IsUnknown(t)?dK(e,t):oe.IsAny(t)?tL(e,t):oe.IsObject(t)?Us(e,t):oe.IsVoid(t)?Ee.True:Ee.False}o(nxe,"FromVoid");function Rn(e,t){return oe.IsTemplateLiteral(e)||oe.IsTemplateLiteral(t)?Xbe(e,t):oe.IsRegExp(e)||oe.IsRegExp(t)?qbe(e,t):oe.IsNot(e)||oe.IsNot(t)?Dbe(e,t):oe.IsAny(e)?bbe(e,t):oe.IsArray(e)?Ibe(e,t):oe.IsBigInt(e)?Sbe(e,t):oe.IsBoolean(e)?Cbe(e,t):oe.IsAsyncIterator(e)?_be(e,t):oe.IsConstructor(e)?wbe(e,t):oe.IsDate(e)?Pbe(e,t):oe.IsFunction(e)?Tbe(e,t):oe.IsInteger(e)?Ebe(e,t):oe.IsIntersect(e)?Mbe(e,t):oe.IsIterator(e)?Obe(e,t):oe.IsLiteral(e)?Lbe(e,t):oe.IsNever(e)?Abe(e,t):oe.IsNull(e)?Fbe(e,t):oe.IsNumber(e)?Nbe(e,t):oe.IsObject(e)?Ube(e,t):oe.IsRecord(e)?zbe(e,t):oe.IsString(e)?Hbe(e,t):oe.IsSymbol(e)?Wbe(e,t):oe.IsTuple(e)?Kbe(e,t):oe.IsPromise(e)?Vbe(e,t):oe.IsUint8Array(e)?Jbe(e,t):oe.IsUndefined(e)?Qbe(e,t):oe.IsUnion(e)?exe(e,t):oe.IsUnknown(e)?txe(e,t):oe.IsVoid(e)?nxe(e,t):x1("Unknown left type operand '".concat(e[xe],"'"))}o(Rn,"Visit");function mh(e,t){return Rn(e,t)}o(mh,"ExtendsCheck");g();g();g();function ixe(e,t,r,n,i){let s={};for(let l of globalThis.Object.getOwnPropertyNames(e))s[l]=I1(e[l],t,r,n,di(i));return s}o(ixe,"FromProperties");function oxe(e,t,r,n,i){return ixe(e.properties,t,r,n,i)}o(oxe,"FromMappedResult");function hK(e,t,r,n,i){let s=oxe(e,t,r,n,i);return an(s)}o(hK,"ExtendsFromMappedResult");function sxe(e,t,r,n){let i=mh(e,t);return i===Ee.Union?kn([r,n]):i===Ee.True?r:n}o(sxe,"ExtendsResolve");function I1(e,t,r,n,i){return mi(e)?hK(e,t,r,n,i):ul(e)?Re(mK(e,t,r,n,i)):Re(sxe(e,t,r,n),i)}o(I1,"Extends");function axe(e,t,r,n,i){return{[e]:I1(In(e),t,r,n,di(i))}}o(axe,"FromPropertyKey");function lxe(e,t,r,n,i){return e.reduce((s,l)=>R(R({},s),axe(l,t,r,n,i)),{})}o(lxe,"FromPropertyKeys");function uxe(e,t,r,n,i){return lxe(e.keys,t,r,n,i)}o(uxe,"FromMappedKey");function mK(e,t,r,n,i){let s=uxe(e,t,r,n,i);return an(s)}o(mK,"ExtendsFromMappedKey");g();function cxe(e){return e.allOf.every(t=>Af(t))}o(cxe,"Intersect");function pxe(e){return e.anyOf.some(t=>Af(t))}o(pxe,"Union");function fxe(e){return!Af(e.not)}o(fxe,"Not");function Af(e){return e[xe]==="Intersect"?cxe(e):e[xe]==="Union"?pxe(e):e[xe]==="Not"?fxe(e):e[xe]==="Undefined"}o(Af,"ExtendsUndefinedCheck");g();function gK(e,t){return _1(bg(e),t)}o(gK,"ExcludeFromTemplateLiteral");function dxe(e,t){let r=e.filter(n=>mh(n,t)===Ee.False);return r.length===1?r[0]:kn(r)}o(dxe,"ExcludeRest");function _1(e,t,r={}){return cl(e)?Re(gK(e,t),r):mi(e)?Re(yK(e,t),r):Re(bn(e)?dxe(e.anyOf,t):mh(e,t)!==Ee.False?Nn():e,r)}o(_1,"Exclude");function hxe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=_1(e[n],t);return r}o(hxe,"FromProperties");function mxe(e,t){return hxe(e.properties,t)}o(mxe,"FromMappedResult");function yK(e,t){let r=mxe(e,t);return an(r)}o(yK,"ExcludeFromMappedResult");g();g();g();function vK(e,t){return S1(bg(e),t)}o(vK,"ExtractFromTemplateLiteral");function gxe(e,t){let r=e.filter(n=>mh(n,t)!==Ee.False);return r.length===1?r[0]:kn(r)}o(gxe,"ExtractRest");function S1(e,t,r){return cl(e)?Re(vK(e,t),r):mi(e)?Re(bK(e,t),r):Re(bn(e)?gxe(e.anyOf,t):mh(e,t)!==Ee.False?e:Nn(),r)}o(S1,"Extract");function yxe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=S1(e[n],t);return r}o(yxe,"FromProperties");function vxe(e,t){return yxe(e.properties,t)}o(vxe,"FromMappedResult");function bK(e,t){let r=vxe(e,t);return an(r)}o(bK,"ExtractFromMappedResult");g();function xK(e,t){return Re(e.returns,t)}o(xK,"InstanceType");g();function IK(e){return Re({[xe]:"Integer",type:"integer"},e)}o(IK,"Integer");g();g();g();function bxe(e,t,r){return{[e]:qu(In(e),t,di(r))}}o(bxe,"MappedIntrinsicPropertyKey");function xxe(e,t,r){return e.reduce((i,s)=>R(R({},i),bxe(s,t,r)),{})}o(xxe,"MappedIntrinsicPropertyKeys");function Ixe(e,t,r){return xxe(e.keys,t,r)}o(Ixe,"MappedIntrinsicProperties");function _K(e,t,r){let n=Ixe(e,t,r);return an(n)}o(_K,"IntrinsicFromMappedKey");function _xe(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}o(_xe,"ApplyUncapitalize");function Sxe(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}o(Sxe,"ApplyCapitalize");function Cxe(e){return e.toUpperCase()}o(Cxe,"ApplyUppercase");function wxe(e){return e.toLowerCase()}o(wxe,"ApplyLowercase");function Pxe(e,t,r){let n=g1(e.pattern);if(!vg(n))return re(R({},e),{pattern:SK(e.pattern,t)});let l=[...gI(n)].map(h=>In(h)),c=CK(l,t),p=kn(c);return Sw([p],r)}o(Pxe,"FromTemplateLiteral");function SK(e,t){return typeof e=="string"?t==="Uncapitalize"?_xe(e):t==="Capitalize"?Sxe(e):t==="Uppercase"?Cxe(e):t==="Lowercase"?wxe(e):e:e.toString()}o(SK,"FromLiteralValue");function CK(e,t){return e.map(r=>qu(r,t))}o(CK,"FromRest");function qu(e,t,r={}){return ul(e)?_K(e,t,r):cl(e)?Pxe(e,t,r):bn(e)?kn(CK(e.anyOf,t),r):Pf(e)?In(SK(e.const,t),r):Re(e,r)}o(qu,"Intrinsic");function wK(e,t={}){return qu(e,"Capitalize",t)}o(wK,"Capitalize");g();function PK(e,t={}){return qu(e,"Lowercase",t)}o(PK,"Lowercase");g();function TK(e,t={}){return qu(e,"Uncapitalize",t)}o(TK,"Uncapitalize");g();function EK(e,t={}){return qu(e,"Uppercase",t)}o(EK,"Uppercase");g();function MK(e,t){return Re({[xe]:"Not",not:e},t)}o(MK,"Not");g();g();g();function Txe(e,t,r){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=C1(e[i],t,di(r));return n}o(Txe,"FromProperties");function Exe(e,t,r){return Txe(e.properties,t,r)}o(Exe,"FromMappedResult");function OK(e,t,r){let n=Exe(e,t,r);return an(n)}o(OK,"OmitFromMappedResult");function Mxe(e,t){return e.map(r=>iL(r,t))}o(Mxe,"FromIntersect");function Oxe(e,t){return e.map(r=>iL(r,t))}o(Oxe,"FromUnion");function Lxe(e,t){let i=e,{[t]:r}=i;return cs(i,[iS(t)])}o(Lxe,"FromProperty");function Axe(e,t){return t.reduce((r,n)=>Lxe(r,n),e)}o(Axe,"FromProperties");function Dxe(e,t){let r=Gi(e,[hi,"$id","required","properties"]),n=Axe(e.properties,t);return Wn(n,r)}o(Dxe,"FromObject");function iL(e,t){return Ji(e)?Ba(Mxe(e.allOf,t)):bn(e)?kn(Oxe(e.anyOf,t)):Eo(e)?Dxe(e,t):Wn({})}o(iL,"OmitResolve");function C1(e,t,r){if(ul(t))return LK(e,t,r);if(mi(e))return OK(e,t,r);let n=Vu(t)?Ra(t):t;return Re(R(R({},iL(e,n)),r))}o(C1,"Omit");function Fxe(e,t,r){return{[t]:C1(e,[t],di(r))}}o(Fxe,"FromPropertyKey");function Nxe(e,t,r){return t.reduce((n,i)=>R(R({},n),Fxe(e,i,r)),{})}o(Nxe,"FromPropertyKeys");function kxe(e,t,r){return Nxe(e,t.keys,r)}o(kxe,"FromMappedKey");function LK(e,t,r){let n=kxe(e,t,r);return an(n)}o(LK,"OmitFromMappedKey");g();function AK(e,t){return np(e.parameters,t)}o(AK,"Parameters");g();g();function DK(e){return e.map(t=>FK(t))}o(DK,"FromRest");function Rxe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=ka(e[r]);return t}o(Rxe,"FromProperties");function Bxe(e){let t=Gi(e,[hi,"$id","required","properties"]),r=Rxe(e.properties);return Wn(r,t)}o(Bxe,"FromObject");function FK(e){return Ji(e)?Ba(DK(e.allOf)):bn(e)?kn(DK(e.anyOf)):Eo(e)?Bxe(e):Wn({})}o(FK,"PartialResolve");function kw(e,t){return mi(e)?NK(e,t):Re(R(R({},FK(e)),t))}o(kw,"Partial");function jxe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=kw(e[n],di(t));return r}o(jxe,"FromProperties");function $xe(e,t){return jxe(e.properties,t)}o($xe,"FromMappedResult");function NK(e,t){let r=$xe(e,t);return an(r)}o(NK,"PartialFromMappedResult");g();g();g();function Gxe(e,t,r){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=w1(e[i],t,di(r));return n}o(Gxe,"FromProperties");function Uxe(e,t,r){return Gxe(e.properties,t,r)}o(Uxe,"FromMappedResult");function kK(e,t,r){let n=Uxe(e,t,r);return an(n)}o(kK,"PickFromMappedResult");function Vxe(e,t){return e.map(r=>oL(r,t))}o(Vxe,"FromIntersect");function zxe(e,t){return e.map(r=>oL(r,t))}o(zxe,"FromUnion");function qxe(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}o(qxe,"FromProperties");function Hxe(e,t){let r=Gi(e,[hi,"$id","required","properties"]),n=qxe(e.properties,t);return Wn(n,r)}o(Hxe,"FromObject");function oL(e,t){return Ji(e)?Ba(Vxe(e.allOf,t)):bn(e)?kn(zxe(e.anyOf,t)):Eo(e)?Hxe(e,t):Wn({})}o(oL,"PickResolve");function w1(e,t,r){if(ul(t))return RK(e,t,r);if(mi(e))return kK(e,t,r);let n=Vu(t)?Ra(t):t;return Re(R(R({},oL(e,n)),r))}o(w1,"Pick");function Wxe(e,t,r){return{[t]:w1(e,[t],di(r))}}o(Wxe,"FromPropertyKey");function Xxe(e,t,r){return t.reduce((n,i)=>R(R({},n),Wxe(e,i,r)),{})}o(Xxe,"FromPropertyKeys");function Yxe(e,t,r){return Xxe(e,t.keys,r)}o(Yxe,"FromMappedKey");function RK(e,t,r){let n=Yxe(e,t,r);return an(n)}o(RK,"PickFromMappedKey");g();function BK(e){return Hl(ka(e))}o(BK,"ReadonlyOptional");g();function xg(e,t,r){return Re({[xe]:"Record",type:"object",patternProperties:{[e]:t}},r)}o(xg,"RecordCreateFromPattern");function sL(e,t,r){let n={};for(let i of e)n[i]=t;return Wn(n,re(R({},r),{[zl]:"Record"}))}o(sL,"RecordCreateFromKeys");function Zxe(e,t,r){return Iw(e)?sL(Ra(e),t,r):xg(e.pattern,t,r)}o(Zxe,"FromTemplateLiteralKey");function Kxe(e,t,r){return sL(Ra(kn(e)),t,r)}o(Kxe,"FromUnionKey");function Jxe(e,t,r){return sL([e.toString()],t,r)}o(Jxe,"FromLiteralKey");function Qxe(e,t,r){return xg(e.source,t,r)}o(Qxe,"FromRegExpKey");function eIe(e,t,r){let n=Li(e.pattern)?Ef:e.pattern;return xg(n,t,r)}o(eIe,"FromStringKey");function tIe(e,t,r){return xg(Ef,t,r)}o(tIe,"FromAnyKey");function rIe(e,t,r){return xg(MZ,t,r)}o(rIe,"FromNeverKey");function nIe(e,t,r){return xg(Tf,t,r)}o(nIe,"FromIntegerKey");function iIe(e,t,r){return xg(Tf,t,r)}o(iIe,"FromNumberKey");function jK(e,t,r={}){return bn(e)?Kxe(e.anyOf,t,r):cl(e)?Zxe(e,t,r):Pf(e)?Jxe(e.const,t,r):mg(e)?nIe(e,t,r):gg(e)?iIe(e,t,r):M6(e)?Qxe(e,t,r):cI(e)?eIe(e,t,r):C6(e)?tIe(e,t,r):ch(e)?rIe(e,t,r):Nn(r)}o(jK,"Record");g();var oIe=0;function $K(e,t={}){Li(t.$id)&&(t.$id="T".concat(oIe++));let r=iI(e({[xe]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,Re(R({[zl]:"Recursive"},r),t)}o($K,"Recursive");g();function GK(e,t){if(ri(e))return Re({[xe]:"Ref",$ref:e},t);if(Li(e.$id))throw new Error("Reference target type must specify an $id");return Re({[xe]:"Ref",$ref:e.$id},t)}o(GK,"Ref");g();function UK(e,t){let r=ri(e)?new globalThis.RegExp(e):e;return Re({[xe]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}o(UK,"RegExp");g();g();function VK(e){return e.map(t=>zK(t))}o(VK,"FromRest");function sIe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Gi(e[r],[ma]);return t}o(sIe,"FromProperties");function aIe(e){let t=Gi(e,[hi,"$id","required","properties"]),r=sIe(e.properties);return Wn(r,t)}o(aIe,"FromObject");function zK(e){return Ji(e)?Ba(VK(e.allOf)):bn(e)?kn(VK(e.anyOf)):Eo(e)?aIe(e):Wn({})}o(zK,"RequiredResolve");function Rw(e,t){return mi(e)?qK(e,t):Re(R(R({},zK(e)),t))}o(Rw,"Required");function lIe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Rw(e[n],t);return r}o(lIe,"FromProperties");function uIe(e,t){return lIe(e.properties,t)}o(uIe,"FromMappedResult");function qK(e,t){let r=uIe(e,t);return an(r)}o(qK,"RequiredFromMappedResult");g();function cIe(e){var t;return Ji(e)?e.allOf:bn(e)?e.anyOf:Uu(e)?(t=e.items)!=null?t:[]:[]}o(cIe,"RestResolve");function HK(e){return cIe(e)}o(HK,"Rest");g();function WK(e,t){return Re(e.returns,t)}o(WK,"ReturnType");g();function XK(e){return JSON.parse(JSON.stringify(e))}o(XK,"Strict");g();var uL=class uL{constructor(t){this.schema=t}Decode(t){return new lL(this.schema,t)}};o(uL,"TransformDecodeBuilder");var aL=uL,cL=class cL{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let s={Encode:o(l=>r[hi].Encode(t(l)),"Encode"),Decode:o(l=>this.decode(r[hi].Decode(l)),"Decode")};return re(R({},r),{[hi]:s})}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return re(R({},r),{[hi]:n})}Encode(t){return p1(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};o(cL,"TransformEncodeBuilder");var lL=cL;function YK(e){return new aL(e)}o(YK,"Transform");g();function Bw(e={}){var t;return Re({[xe]:(t=e[xe])!=null?t:"Unsafe"},e)}o(Bw,"Unsafe");g();function ZK(e){return Re({[xe]:"Void",type:"void"},e)}o(ZK,"Void");g();var pL={};wc(pL,{Any:()=>fh,Array:()=>yw,AsyncIterator:()=>vw,Awaited:()=>ZZ,BigInt:()=>v1,Boolean:()=>_w,Capitalize:()=>wK,Composite:()=>QZ,Const:()=>eK,Constructor:()=>bw,ConstructorParameters:()=>tK,Date:()=>Ew,Deref:()=>zu,Enum:()=>rK,Exclude:()=>_1,Extends:()=>I1,Extract:()=>S1,Function:()=>dh,Index:()=>b1,InstanceType:()=>xK,Integer:()=>IK,Intersect:()=>Ba,Iterator:()=>ww,KeyOf:()=>Tw,Literal:()=>In,Lowercase:()=>PK,Mapped:()=>HZ,Never:()=>Nn,Not:()=>MK,Null:()=>Mw,Number:()=>rp,Object:()=>Wn,Omit:()=>C1,Optional:()=>ka,Parameters:()=>AK,Partial:()=>kw,Pick:()=>w1,Promise:()=>Pw,Readonly:()=>Hl,ReadonlyOptional:()=>BK,Record:()=>jK,Recursive:()=>$K,Ref:()=>GK,RegExp:()=>UK,Required:()=>Rw,Rest:()=>HK,ReturnType:()=>WK,Strict:()=>XK,String:()=>ql,Symbol:()=>Ow,TemplateLiteral:()=>Sw,Transform:()=>YK,Tuple:()=>np,Uint8Array:()=>Aw,Uncapitalize:()=>TK,Undefined:()=>Lw,Union:()=>kn,Unknown:()=>Lf,Unsafe:()=>Bw,Uppercase:()=>EK,Void:()=>ZK});g();var L=pL;var Ci=o((e,t)=>L.Unsafe(L.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]{8,}$")})),"Ident"),Vs=Ci("g","GeometryId"),ln=Ci("f","FloorId"),fL=[Vs,ln];g();g();var II=L.Object({externalId:L.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:L.String({description:"The name of the entity."}),shortName:L.String({description:"A short name for the entity."}),description:L.String({description:"A description of the entity."}),icon:L.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),dL=L.Partial(II,{$id:"Details",description:"Additional information about a given entity."}),Hu=L.Object({details:L.Optional(L.Ref(dL))},{$id:"WithDetails"}),Ig=o(e=>{let t=[...e].sort(),r=L.Pick(II,e),n=L.Omit(II,e);return L.Object({details:L.Intersect([r,L.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},"WithRequiredDetails"),hL=[II,dL];g();g();var mL=L.Record(L.String(),L.Unknown(),{$id:"Extra"}),Wu=L.Object({extra:L.Optional(L.Ref(mL))}),gL=[mL];g();g();var P1=L.Object({geometryId:L.Ref(Vs),floorId:L.Ref(ln)},{$id:"GeometryAnchor"}),pIe=L.Object({geometryAnchor:L.Ref(P1)}),_g=o((e,t)=>L.Object({geometryAnchors:L.Array(L.Ref(P1),e)},t),"WithGeometryAnchors"),yL=[P1];g();g();g();g();g();var T1=L.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),E1=L.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),Sg=L.Tuple([L.Ref(T1),L.Ref(E1)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),zs=L.Object({type:L.Literal("Point"),coordinates:L.Ref(Sg)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),jw=L.Object({type:L.Literal("MultiPoint"),coordinates:L.Array(L.Ref(Sg))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),$w=L.Object({type:L.Literal("LineString"),coordinates:L.Array(L.Ref(Sg),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),Gw=L.Object({type:L.Literal("MultiLineString"),coordinates:L.Array(L.Array(L.Ref(Sg),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),KK=L.Array(L.Ref(Sg),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),vL=L.Array(L.Ref(KK),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),M1=L.Object({type:L.Literal("Polygon"),coordinates:L.Ref(vL)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),O1=L.Object({type:L.Literal("MultiPolygon"),coordinates:L.Array(L.Ref(vL))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),vs=o((e,t,r)=>L.Object({type:L.Literal("Feature"),geometry:e,properties:t},r),"Feature"),ya=o((e,t,r)=>L.Object({type:L.Literal("FeatureCollection"),features:L.Array(e,r)},t),"FeatureCollection"),bL=[T1,E1,Sg,zs,jw,$w,Gw,KK,vL,M1,O1];var JK=L.Intersect([L.Object({id:L.Ref(ln),elevation:L.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:L.Optional(L.String({description:"The subtitle of the floor."}))}),Hu],{$id:"FloorProperties"}),QK=vs(L.Union([L.Ref(M1),L.Ref(O1),L.Null()]),L.Ref(JK),{$id:"FloorFeature"}),eJ=ya(L.Ref(QK),{$id:"FloorCollection"}),fIe=L.Object({floors:L.Ref(eJ)}),tJ={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"),schema:fIe,references:[JK,QK,eJ]};g();g();g();var xL=class xL{constructor(t){x(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(xL,"OptionIterator");var Uw=xL,IL=class IL{constructor(t){x(this,"_tag","Some");x(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 rJ(t(this.value))}mapAsync(t){return t(this.value).then(r=>rJ(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:gh()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?gh():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return st(this.value)}okOrElse(t){return st(this.value)}iter(){return new Uw(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?L1([this.value,t.value]):gh()}zipWith(t,r){return t.isSome()?L1(r(this.value,t.value)):gh()}get[Symbol.toStringTag](){return"Some"}};o(IL,"Some");var Vw=IL,_L=class _L{constructor(){x(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 ut(t)}okOrElse(t){return ut(t())}iter(){return new Uw(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}get[Symbol.toStringTag](){return"None"}};o(_L,"None");var zw=_L,L1=o(e=>new Vw(e),"some"),gh=o(()=>new zw,"none"),rJ=o(e=>e instanceof Vw||e instanceof zw?e:e==null?gh():L1(e),"option");var wL=class wL{constructor(t){x(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(wL,"ResultIterator");var qw=wL,PL=class PL{constructor(t){x(this,"_tag","Ok");x(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 L1(this.value)}err(){return gh()}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 st(t(this.value))}async mapAsync(t){return t(this.value).then(st)}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 qw(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(PL,"Ok");var SL=PL,Hw=class Hw{constructor(t){x(this,"_tag","Err");x(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 gh()}err(){return L1(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 qw(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 Hw(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(Hw,"Err");var CL=Hw,st=o(e=>new SL(e),"ok"),ut=o(e=>new CL(e),"err");g();var ip;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError"})(ip||(ip={}));var dIe=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"),Df=o(e=>{let t=dIe(e);return o(n=>{let i=t.get(n);return i==null?ut({kind:ip.UnknownFloorError,properties:{floorId:n}}):st(i)},"floorLookup")},"createFloorLookup");g();g();g();g();var Ui=o(e=>L.Unsafe(e),"PartialRecord");g();var rn=o(e=>Object.keys(e),"typedKeys");g();var nJ=o(e=>{if(e.floors==null)return ut({kind:ip.FloorMissingError,properties:null});if(e.geometry==null)return ut({kind:ip.GeometryMissingError,properties:null});let t=Df(e);for(let r of rn(e.geometry)){let n=t(r);if(n.isErr())return n}return st(!0)},"validateGeometry");var iJ=L.Intersect([L.Object({id:L.Ref(Vs)}),Hu],{$id:"GeometryProperties"}),oJ=vs(L.Union([L.Ref(zs),L.Ref(jw),L.Ref($w),L.Ref(Gw),L.Ref(M1),L.Ref(O1)]),L.Ref(iJ),{$id:"GeometryFeature"}),sJ=ya(L.Ref(oJ),{$id:"GeometryCollection"}),hIe=L.Object({geometry:Ui(L.Record(ln,L.Ref(sJ),{additionalProperties:!1}))},{$id:"GeometrySchema"}),mIe=/^geometry\/(.*)\.geojson$/,aJ={name:"core:geometry",schema:hIe,intoBundle:o(function*(e){if(e.geometry!=null)for(let t of rn(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(mIe))==null?void 0:i[1];if(n)return{geometry:{[n]:r(t)}}},"fromBundle"),references:[iJ,oJ,sJ],integrityCheck:nJ};g();g();var un=o(e=>Object.entries(e),"typedEntries");var gIe=o(e=>{var r;let t=new Map;for(let[n,i]of un((r=e.geometry)!=null?r:{}))t.set(n,new Map(i==null?void 0:i.features.map(s=>[s.properties.id,s])));return t},"createLookupMap"),Oo=o(e=>{let t=gIe(e);return o((n,i)=>{let s=t.get(n);if(s==null)return ut({kind:ip.UnknownFloorError,properties:{floorId:n}});let l=s.get(i);return l==null?ut({kind:ip.UnknownGeometryError,properties:{floorId:n,geometryId:i}}):st(l)},"geometryLookup")},"createGeometryLookup");g();var TL=L.Object({type:L.Literal("file"),name:L.String({description:"The name of the file."})},{$id:"ManifestFile"}),lJ=L.Recursive(e=>L.Object({type:L.Literal("folder"),name:L.String({description:"The name of the folder."}),children:L.Array(L.Union([e,L.Ref(TL)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),uJ=L.Object({name:L.String({description:"The name of the map."}),version:L.Literal("3.0.0",{description:"The version of the manifest."}),orgId:L.Optional(L.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:L.Optional(L.String({description:"The identifier of the map that this MVF is for."})),contents:L.Array(L.Union([L.Ref(lJ),L.Ref(TL)]),{minItems:1,description:"The contents of the MVF bundle."}),time:L.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:L.Optional(L.Unsafe(L.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:L.Optional(L.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:L.Optional(L.Ref(ln,{description:"The default floor ID of the map."})),language:L.Optional(L.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),cJ=ya(vs(zs,L.Ref(uJ)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),yIe=L.Object({manifest:L.Ref(cJ)}),pJ={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:yIe,references:[TL,lJ,uJ,cJ]};var Zl=L.Object({geometryId:L.Ref(Vs)},{$id:"WithGeometryId"}),Ww=L.Object({geometryIds:L.Array(L.Ref(Vs))},{$id:"WithGeometryIds"}),EL=[Zl,Ww];g();g();var fJ=o((e,t)=>L.Unsafe(L.Transform(L.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),"SafeStringEnumSchema"),$a=o((e,t)=>{let r=fJ(e,t),n=[...e,"unknown"],i=Object.freeze(Object.fromEntries([...e,"unknown"].map(s=>[s,s])));return{schema:r,values:n,record:i}},"SafeStringEnum");g();g();g();var _I;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(_I||(_I={}));var dJ=o(e=>{var n;if(e.annotations==null)return st(!0);let t=Oo(e),r=new Set(rn((n=e.annotationSymbols)!=null?n:{}));for(let i of rn(e.annotations)){let s=e.annotations[i];if(s!=null)for(let l of s){if(!r.has(l.symbolKey))return ut({kind:_I.AnnotationUnknownSymbolError,properties:{annotationId:l.id,symbolKey:l.symbolKey}});let c=t(i,l.geometryId);if(c.isErr())return c;if(c.value.geometry.type!=="Point")return ut({kind:_I.AnnotationNonPointGeometryError,properties:{annotationId:l.id,floorId:i,geometryId:l.geometryId}})}}return st(!0)},"validateAnnotations");var hJ=Ci("a","AnnotationId"),ML=L.Intersect([Zl,L.Object({id:L.Ref(hJ,{description:"The unique identifier for the annotation."}),externalId:L.Optional(L.String({description:"The external identifier for the annotation."})),symbolKey:L.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),mJ=L.Object({url:L.String({format:"uri",description:"The URL for the symbol."}),name:L.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),vIe=L.Object({annotations:Ui(L.Record(ln,L.Array(L.Ref(ML)),{additionalProperties:!1})),annotationSymbols:Ui(L.Record(L.Index(ML,["symbolKey"]),L.Ref(mJ)))},{$id:"AnnotationsSchema"}),bIe=/^annotations\/(.*)\.json$/,gJ={name:"ext:mvf-annotations",schema:vIe,intoBundle:o(function*(e){if(e.annotations!=null)for(let t of rn(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(bIe))==null?void 0:i[1];if(n)return{annotations:{[n]:r(t)}}},"fromBundle"),references:[hJ,ML,mJ],integrityCheck:dJ};g();g();g();g();g();g();g();g();var LL=class LL extends Mt{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}};o(LL,"TypeSystemDuplicateTypeKind");var OL=LL,AL=class AL extends Mt{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}};o(AL,"TypeSystemDuplicateFormat");var SI=AL,Xw;(function(e){function t(n,i){if(Mo.Has(n))throw new OL(n);return Mo.Set(n,i),(s={})=>Bw(re(R({},s),{[xe]:n}))}o(t,"Type"),e.Type=t;function r(n,i){if(ga.Has(n))throw new SI(n);return ga.Set(n,i),n}o(r,"Format"),e.Format=r})(Xw||(Xw={}));g();g();g();function xIe(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[xe],"'");default:return"Unknown error type"}}o(xIe,"DefaultErrorFunction");var IIe=xIe;function yJ(){return IIe}o(yJ,"GetErrorFunction");g();var FL=class FL extends Mt{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};o(FL,"TypeDereferenceError");var DL=FL;function _Ie(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new DL(e);return cn(r,t)}o(_Ie,"Resolve");function Kl(e,t){return!Qr(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}o(Kl,"Pushref");function cn(e,t){return e[xe]==="This"||e[xe]==="Ref"?_Ie(e,t):e}o(cn,"Deref");g();var kL=class kL extends Mt{constructor(t){super("Unable to hash value"),this.value=t}};o(kL,"ValueHashError");var NL=kL,pl;(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"})(pl||(pl={}));var A1=BigInt("14695981039346656037"),[SIe,CIe]=[BigInt("1099511628211"),BigInt("18446744073709551616")],wIe=Array.from({length:256}).map((e,t)=>BigInt(t)),vJ=new Float64Array(1),bJ=new DataView(vJ.buffer),xJ=new Uint8Array(vJ.buffer);function*PIe(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(PIe,"NumberToBytes");function TIe(e){qs(pl.Array);for(let t of e)D1(t)}o(TIe,"ArrayType");function EIe(e){qs(pl.Boolean),qs(e?1:0)}o(EIe,"BooleanType");function MIe(e){qs(pl.BigInt),bJ.setBigInt64(0,e);for(let t of xJ)qs(t)}o(MIe,"BigIntType");function OIe(e){qs(pl.Date),D1(e.getTime())}o(OIe,"DateType");function LIe(e){qs(pl.Null)}o(LIe,"NullType");function AIe(e){qs(pl.Number),bJ.setFloat64(0,e);for(let t of xJ)qs(t)}o(AIe,"NumberType");function DIe(e){qs(pl.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())D1(t),D1(e[t])}o(DIe,"ObjectType");function FIe(e){qs(pl.String);for(let t=0;t<e.length;t++)for(let r of PIe(e.charCodeAt(t)))qs(r)}o(FIe,"StringType");function NIe(e){qs(pl.Symbol),D1(e.description)}o(NIe,"SymbolType");function kIe(e){qs(pl.Uint8Array);for(let t=0;t<e.length;t++)qs(e[t])}o(kIe,"Uint8ArrayType");function RIe(e){return qs(pl.Undefined)}o(RIe,"UndefinedType");function D1(e){if(Bt(e))return TIe(e);if(Qc(e))return EIe(e);if(gs(e))return MIe(e);if(ha(e))return OIe(e);if(_f(e))return LIe(e);if(_t(e))return AIe(e);if(Ut(e))return DIe(e);if(Qr(e))return FIe(e);if(Sf(e))return NIe(e);if(c1(e))return kIe(e);if(Ai(e))return RIe(e);throw new NL(e)}o(D1,"Visit");function qs(e){A1=A1^wIe[e],A1=A1*SIe%CIe}o(qs,"FNV1A64");function yh(e){return A1=BigInt("14695981039346656037"),D1(e),A1}o(yh,"Hash");g();var BL=class BL extends Mt{constructor(t){super("Unknown type"),this.schema=t}};o(BL,"ValueCheckUnknownTypeError");var RL=BL;function BIe(e){return e[xe]==="Any"||e[xe]==="Unknown"}o(BIe,"IsAnyOrUnknown");function Ur(e){return e!==void 0}o(Ur,"IsDefined");function jIe(e,t,r){return!0}o(jIe,"FromAny");function $Ie(e,t,r){if(!Bt(r)||Ur(e.minItems)&&!(r.length>=e.minItems)||Ur(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(s=>bs(e.items,t,s))||e.uniqueItems===!0&&!function(){let s=new Set;for(let l of r){let c=yh(l);if(s.has(c))return!1;s.add(c)}return!0}())return!1;if(!(Ur(e.contains)||_t(e.minContains)||_t(e.maxContains)))return!0;let n=Ur(e.contains)?e.contains:Nn(),i=r.reduce((s,l)=>bs(n,t,l)?s+1:s,0);return!(i===0||_t(e.minContains)&&i<e.minContains||_t(e.maxContains)&&i>e.maxContains)}o($Ie,"FromArray");function GIe(e,t,r){return dw(r)}o(GIe,"FromAsyncIterator");function UIe(e,t,r){return!(!gs(r)||Ur(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ur(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ur(e.maximum)&&!(r<=e.maximum)||Ur(e.minimum)&&!(r>=e.minimum)||Ur(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}o(UIe,"FromBigInt");function VIe(e,t,r){return Qc(r)}o(VIe,"FromBoolean");function zIe(e,t,r){return bs(e.returns,t,r.prototype)}o(zIe,"FromConstructor");function qIe(e,t,r){return!(!ha(r)||Ur(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||Ur(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||Ur(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||Ur(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||Ur(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}o(qIe,"FromDate");function HIe(e,t,r){return uh(r)}o(HIe,"FromFunction");function WIe(e,t,r){return!(!gw(r)||Ur(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ur(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ur(e.maximum)&&!(r<=e.maximum)||Ur(e.minimum)&&!(r>=e.minimum)||Ur(e.multipleOf)&&r%e.multipleOf!==0)}o(WIe,"FromInteger");function XIe(e,t,r){let n=e.allOf.every(i=>bs(i,t,r));if(e.unevaluatedProperties===!1){let i=new RegExp(Of(e)),s=Object.getOwnPropertyNames(r).every(l=>i.test(l));return n&&s}else if(en(e.unevaluatedProperties)){let i=new RegExp(Of(e)),s=Object.getOwnPropertyNames(r).every(l=>i.test(l)||bs(e.unevaluatedProperties,t,r[l]));return n&&s}else return n}o(XIe,"FromIntersect");function YIe(e,t,r){return hw(r)}o(YIe,"FromIterator");function ZIe(e,t,r){return r===e.const}o(ZIe,"FromLiteral");function KIe(e,t,r){return!1}o(KIe,"FromNever");function JIe(e,t,r){return!bs(e.not,t,r)}o(JIe,"FromNot");function QIe(e,t,r){return _f(r)}o(QIe,"FromNull");function e2e(e,t,r){return!(!Mn.IsNumberLike(r)||Ur(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ur(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ur(e.minimum)&&!(r>=e.minimum)||Ur(e.maximum)&&!(r<=e.maximum)||Ur(e.multipleOf)&&r%e.multipleOf!==0)}o(e2e,"FromNumber");function t2e(e,t,r){if(!Mn.IsObjectLike(r)||Ur(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||Ur(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let n=Object.getOwnPropertyNames(e.properties);for(let i of n){let s=e.properties[i];if(e.required&&e.required.includes(i)){if(!bs(s,t,r[i])||(Af(s)||BIe(s))&&!(i in r))return!1}else if(Mn.IsExactOptionalProperty(r,i)&&!bs(s,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(s=>n.includes(s))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||bs(e.additionalProperties,t,r[s])):!0}o(t2e,"FromObject");function r2e(e,t,r){return mw(r)}o(r2e,"FromPromise");function n2e(e,t,r){if(!Mn.IsRecordLike(r)||Ur(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||Ur(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[n,i]=Object.entries(e.patternProperties)[0],s=new RegExp(n),l=Object.entries(r).every(([h,y])=>s.test(h)?bs(i,t,y):!0),c=typeof e.additionalProperties=="object"?Object.entries(r).every(([h,y])=>s.test(h)?!0:bs(e.additionalProperties,t,y)):!0,p=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(h=>s.test(h)):!0;return l&&c&&p}o(n2e,"FromRecord");function i2e(e,t,r){return bs(cn(e,t),t,r)}o(i2e,"FromRef");function o2e(e,t,r){let n=new RegExp(e.source,e.flags);return Ur(e.minLength)&&!(r.length>=e.minLength)||Ur(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}o(o2e,"FromRegExp");function s2e(e,t,r){return!Qr(r)||Ur(e.minLength)&&!(r.length>=e.minLength)||Ur(e.maxLength)&&!(r.length<=e.maxLength)||Ur(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:Ur(e.format)?ga.Has(e.format)?ga.Get(e.format)(r):!1:!0}o(s2e,"FromString");function a2e(e,t,r){return Sf(r)}o(a2e,"FromSymbol");function l2e(e,t,r){return Qr(r)&&new RegExp(e.pattern).test(r)}o(l2e,"FromTemplateLiteral");function u2e(e,t,r){return bs(cn(e,t),t,r)}o(u2e,"FromThis");function c2e(e,t,r){if(!Bt(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(!bs(e.items[n],t,r[n]))return!1;return!0}o(c2e,"FromTuple");function p2e(e,t,r){return Ai(r)}o(p2e,"FromUndefined");function f2e(e,t,r){return e.anyOf.some(n=>bs(n,t,r))}o(f2e,"FromUnion");function d2e(e,t,r){return!(!c1(r)||Ur(e.maxByteLength)&&!(r.length<=e.maxByteLength)||Ur(e.minByteLength)&&!(r.length>=e.minByteLength))}o(d2e,"FromUint8Array");function h2e(e,t,r){return!0}o(h2e,"FromUnknown");function m2e(e,t,r){return Mn.IsVoidLike(r)}o(m2e,"FromVoid");function g2e(e,t,r){return Mo.Has(e[xe])?Mo.Get(e[xe])(e,r):!1}o(g2e,"FromKind");function bs(e,t,r){let n=Ur(e.$id)?[...t,e]:t,i=e;switch(i[xe]){case"Any":return jIe(i,n,r);case"Array":return $Ie(i,n,r);case"AsyncIterator":return GIe(i,n,r);case"BigInt":return UIe(i,n,r);case"Boolean":return VIe(i,n,r);case"Constructor":return zIe(i,n,r);case"Date":return qIe(i,n,r);case"Function":return HIe(i,n,r);case"Integer":return WIe(i,n,r);case"Intersect":return XIe(i,n,r);case"Iterator":return YIe(i,n,r);case"Literal":return ZIe(i,n,r);case"Never":return KIe(i,n,r);case"Not":return JIe(i,n,r);case"Null":return QIe(i,n,r);case"Number":return e2e(i,n,r);case"Object":return t2e(i,n,r);case"Promise":return r2e(i,n,r);case"Record":return n2e(i,n,r);case"Ref":return i2e(i,n,r);case"RegExp":return o2e(i,n,r);case"String":return s2e(i,n,r);case"Symbol":return a2e(i,n,r);case"TemplateLiteral":return l2e(i,n,r);case"This":return u2e(i,n,r);case"Tuple":return c2e(i,n,r);case"Undefined":return p2e(i,n,r);case"Union":return f2e(i,n,r);case"Uint8Array":return d2e(i,n,r);case"Unknown":return h2e(i,n,r);case"Void":return m2e(i,n,r);default:if(!Mo.Has(i[xe]))throw new RL(i);return g2e(i,n,r)}}o(bs,"Visit");function Jt(...e){return e.length===3?bs(e[0],e[1],e[2]):bs(e[0],[],e[1])}o(Jt,"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 $L=class $L extends Mt{constructor(t){super("Unknown type"),this.schema=t}};o($L,"ValueErrorsUnknownTypeError");var jL=$L;function Ff(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(Ff,"EscapeKey");function Vr(e){return e!==void 0}o(Vr,"IsDefined");var GL=class GL{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};o(GL,"ValueErrorIterator");var Jl=GL;function rt(e,t,r,n,i=[]){return{type:e,schema:t,path:r,value:n,message:yJ()({errorType:e,path:r,schema:t,value:n,errors:i}),errors:i}}o(rt,"Create");function*y2e(e,t,r,n){}o(y2e,"FromAny");function*v2e(e,t,r,n){if(!Bt(n))return yield rt(_e.Array,e,r,n);Vr(e.minItems)&&!(n.length>=e.minItems)&&(yield rt(_e.ArrayMinItems,e,r,n)),Vr(e.maxItems)&&!(n.length<=e.maxItems)&&(yield rt(_e.ArrayMaxItems,e,r,n));for(let l=0;l<n.length;l++)yield*Ve(xs(e.items,t,"".concat(r,"/").concat(l),n[l]));if(e.uniqueItems===!0&&!function(){let l=new Set;for(let c of n){let p=yh(c);if(l.has(p))return!1;l.add(p)}return!0}()&&(yield rt(_e.ArrayUniqueItems,e,r,n)),!(Vr(e.contains)||Vr(e.minContains)||Vr(e.maxContains)))return;let i=Vr(e.contains)?e.contains:Nn(),s=n.reduce((l,c,p)=>xs(i,t,"".concat(r).concat(p),c).next().done===!0?l+1:l,0);s===0&&(yield rt(_e.ArrayContains,e,r,n)),_t(e.minContains)&&s<e.minContains&&(yield rt(_e.ArrayMinContains,e,r,n)),_t(e.maxContains)&&s>e.maxContains&&(yield rt(_e.ArrayMaxContains,e,r,n))}o(v2e,"FromArray");function*b2e(e,t,r,n){dw(n)||(yield rt(_e.AsyncIterator,e,r,n))}o(b2e,"FromAsyncIterator");function*x2e(e,t,r,n){if(!gs(n))return yield rt(_e.BigInt,e,r,n);Vr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield rt(_e.BigIntExclusiveMaximum,e,r,n)),Vr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield rt(_e.BigIntExclusiveMinimum,e,r,n)),Vr(e.maximum)&&!(n<=e.maximum)&&(yield rt(_e.BigIntMaximum,e,r,n)),Vr(e.minimum)&&!(n>=e.minimum)&&(yield rt(_e.BigIntMinimum,e,r,n)),Vr(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield rt(_e.BigIntMultipleOf,e,r,n))}o(x2e,"FromBigInt");function*I2e(e,t,r,n){Qc(n)||(yield rt(_e.Boolean,e,r,n))}o(I2e,"FromBoolean");function*_2e(e,t,r,n){yield*Ve(xs(e.returns,t,r,n.prototype))}o(_2e,"FromConstructor");function*S2e(e,t,r,n){if(!ha(n))return yield rt(_e.Date,e,r,n);Vr(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield rt(_e.DateExclusiveMaximumTimestamp,e,r,n)),Vr(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield rt(_e.DateExclusiveMinimumTimestamp,e,r,n)),Vr(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield rt(_e.DateMaximumTimestamp,e,r,n)),Vr(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield rt(_e.DateMinimumTimestamp,e,r,n)),Vr(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield rt(_e.DateMultipleOfTimestamp,e,r,n))}o(S2e,"FromDate");function*C2e(e,t,r,n){uh(n)||(yield rt(_e.Function,e,r,n))}o(C2e,"FromFunction");function*w2e(e,t,r,n){if(!gw(n))return yield rt(_e.Integer,e,r,n);Vr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield rt(_e.IntegerExclusiveMaximum,e,r,n)),Vr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield rt(_e.IntegerExclusiveMinimum,e,r,n)),Vr(e.maximum)&&!(n<=e.maximum)&&(yield rt(_e.IntegerMaximum,e,r,n)),Vr(e.minimum)&&!(n>=e.minimum)&&(yield rt(_e.IntegerMinimum,e,r,n)),Vr(e.multipleOf)&&n%e.multipleOf!==0&&(yield rt(_e.IntegerMultipleOf,e,r,n))}o(w2e,"FromInteger");function*P2e(e,t,r,n){let i=!1;for(let s of e.allOf)for(let l of xs(s,t,r,n))i=!0,yield l;if(i)return yield rt(_e.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let s=new RegExp(Of(e));for(let l of Object.getOwnPropertyNames(n))s.test(l)||(yield rt(_e.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(l),n))}if(typeof e.unevaluatedProperties=="object"){let s=new RegExp(Of(e));for(let l of Object.getOwnPropertyNames(n))if(!s.test(l)){let c=xs(e.unevaluatedProperties,t,"".concat(r,"/").concat(l),n[l]).next();c.done||(yield c.value)}}}o(P2e,"FromIntersect");function*T2e(e,t,r,n){hw(n)||(yield rt(_e.Iterator,e,r,n))}o(T2e,"FromIterator");function*E2e(e,t,r,n){n!==e.const&&(yield rt(_e.Literal,e,r,n))}o(E2e,"FromLiteral");function*M2e(e,t,r,n){yield rt(_e.Never,e,r,n)}o(M2e,"FromNever");function*O2e(e,t,r,n){xs(e.not,t,r,n).next().done===!0&&(yield rt(_e.Not,e,r,n))}o(O2e,"FromNot");function*L2e(e,t,r,n){_f(n)||(yield rt(_e.Null,e,r,n))}o(L2e,"FromNull");function*A2e(e,t,r,n){if(!Mn.IsNumberLike(n))return yield rt(_e.Number,e,r,n);Vr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield rt(_e.NumberExclusiveMaximum,e,r,n)),Vr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield rt(_e.NumberExclusiveMinimum,e,r,n)),Vr(e.maximum)&&!(n<=e.maximum)&&(yield rt(_e.NumberMaximum,e,r,n)),Vr(e.minimum)&&!(n>=e.minimum)&&(yield rt(_e.NumberMinimum,e,r,n)),Vr(e.multipleOf)&&n%e.multipleOf!==0&&(yield rt(_e.NumberMultipleOf,e,r,n))}o(A2e,"FromNumber");function*D2e(e,t,r,n){if(!Mn.IsObjectLike(n))return yield rt(_e.Object,e,r,n);Vr(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield rt(_e.ObjectMinProperties,e,r,n)),Vr(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield rt(_e.ObjectMaxProperties,e,r,n));let i=Array.isArray(e.required)?e.required:[],s=Object.getOwnPropertyNames(e.properties),l=Object.getOwnPropertyNames(n);for(let c of i)l.includes(c)||(yield rt(_e.ObjectRequiredProperty,e.properties[c],"".concat(r,"/").concat(Ff(c)),void 0));if(e.additionalProperties===!1)for(let c of l)s.includes(c)||(yield rt(_e.ObjectAdditionalProperties,e,"".concat(r,"/").concat(Ff(c)),n[c]));if(typeof e.additionalProperties=="object")for(let c of l)s.includes(c)||(yield*Ve(xs(e.additionalProperties,t,"".concat(r,"/").concat(Ff(c)),n[c])));for(let c of s){let p=e.properties[c];e.required&&e.required.includes(c)?(yield*Ve(xs(p,t,"".concat(r,"/").concat(Ff(c)),n[c])),Af(e)&&!(c in n)&&(yield rt(_e.ObjectRequiredProperty,p,"".concat(r,"/").concat(Ff(c)),void 0))):Mn.IsExactOptionalProperty(n,c)&&(yield*Ve(xs(p,t,"".concat(r,"/").concat(Ff(c)),n[c])))}}o(D2e,"FromObject");function*F2e(e,t,r,n){mw(n)||(yield rt(_e.Promise,e,r,n))}o(F2e,"FromPromise");function*N2e(e,t,r,n){if(!Mn.IsRecordLike(n))return yield rt(_e.Object,e,r,n);Vr(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield rt(_e.ObjectMinProperties,e,r,n)),Vr(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield rt(_e.ObjectMaxProperties,e,r,n));let[i,s]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let[c,p]of Object.entries(n))l.test(c)&&(yield*Ve(xs(s,t,"".concat(r,"/").concat(Ff(c)),p)));if(typeof e.additionalProperties=="object")for(let[c,p]of Object.entries(n))l.test(c)||(yield*Ve(xs(e.additionalProperties,t,"".concat(r,"/").concat(Ff(c)),p)));if(e.additionalProperties===!1){for(let[c,p]of Object.entries(n))if(!l.test(c))return yield rt(_e.ObjectAdditionalProperties,e,"".concat(r,"/").concat(Ff(c)),p)}}o(N2e,"FromRecord");function*k2e(e,t,r,n){yield*Ve(xs(cn(e,t),t,r,n))}o(k2e,"FromRef");function*R2e(e,t,r,n){if(!Qr(n))return yield rt(_e.String,e,r,n);if(Vr(e.minLength)&&!(n.length>=e.minLength)&&(yield rt(_e.StringMinLength,e,r,n)),Vr(e.maxLength)&&!(n.length<=e.maxLength)&&(yield rt(_e.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield rt(_e.RegExp,e,r,n)}o(R2e,"FromRegExp");function*B2e(e,t,r,n){if(!Qr(n))return yield rt(_e.String,e,r,n);Vr(e.minLength)&&!(n.length>=e.minLength)&&(yield rt(_e.StringMinLength,e,r,n)),Vr(e.maxLength)&&!(n.length<=e.maxLength)&&(yield rt(_e.StringMaxLength,e,r,n)),Qr(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield rt(_e.StringPattern,e,r,n))),Qr(e.format)&&(ga.Has(e.format)?ga.Get(e.format)(n)||(yield rt(_e.StringFormat,e,r,n)):yield rt(_e.StringFormatUnknown,e,r,n))}o(B2e,"FromString");function*j2e(e,t,r,n){Sf(n)||(yield rt(_e.Symbol,e,r,n))}o(j2e,"FromSymbol");function*$2e(e,t,r,n){if(!Qr(n))return yield rt(_e.String,e,r,n);new RegExp(e.pattern).test(n)||(yield rt(_e.StringPattern,e,r,n))}o($2e,"FromTemplateLiteral");function*G2e(e,t,r,n){yield*Ve(xs(cn(e,t),t,r,n))}o(G2e,"FromThis");function*U2e(e,t,r,n){if(!Bt(n))return yield rt(_e.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield rt(_e.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield rt(_e.TupleLength,e,r,n);if(e.items)for(let i=0;i<e.items.length;i++)yield*Ve(xs(e.items[i],t,"".concat(r,"/").concat(i),n[i]))}o(U2e,"FromTuple");function*V2e(e,t,r,n){Ai(n)||(yield rt(_e.Undefined,e,r,n))}o(V2e,"FromUndefined");function*z2e(e,t,r,n){if(Jt(e,t,n))return;let i=e.anyOf.map(s=>new Jl(xs(s,t,r,n)));yield rt(_e.Union,e,r,n,i)}o(z2e,"FromUnion");function*q2e(e,t,r,n){if(!c1(n))return yield rt(_e.Uint8Array,e,r,n);Vr(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield rt(_e.Uint8ArrayMaxByteLength,e,r,n)),Vr(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield rt(_e.Uint8ArrayMinByteLength,e,r,n))}o(q2e,"FromUint8Array");function*H2e(e,t,r,n){}o(H2e,"FromUnknown");function*W2e(e,t,r,n){Mn.IsVoidLike(n)||(yield rt(_e.Void,e,r,n))}o(W2e,"FromVoid");function*X2e(e,t,r,n){Mo.Get(e[xe])(e,n)||(yield rt(_e.Kind,e,r,n))}o(X2e,"FromKind");function*xs(e,t,r,n){let i=Vr(e.$id)?[...t,e]:t,s=e;switch(s[xe]){case"Any":return yield*Ve(y2e(s,i,r,n));case"Array":return yield*Ve(v2e(s,i,r,n));case"AsyncIterator":return yield*Ve(b2e(s,i,r,n));case"BigInt":return yield*Ve(x2e(s,i,r,n));case"Boolean":return yield*Ve(I2e(s,i,r,n));case"Constructor":return yield*Ve(_2e(s,i,r,n));case"Date":return yield*Ve(S2e(s,i,r,n));case"Function":return yield*Ve(C2e(s,i,r,n));case"Integer":return yield*Ve(w2e(s,i,r,n));case"Intersect":return yield*Ve(P2e(s,i,r,n));case"Iterator":return yield*Ve(T2e(s,i,r,n));case"Literal":return yield*Ve(E2e(s,i,r,n));case"Never":return yield*Ve(M2e(s,i,r,n));case"Not":return yield*Ve(O2e(s,i,r,n));case"Null":return yield*Ve(L2e(s,i,r,n));case"Number":return yield*Ve(A2e(s,i,r,n));case"Object":return yield*Ve(D2e(s,i,r,n));case"Promise":return yield*Ve(F2e(s,i,r,n));case"Record":return yield*Ve(N2e(s,i,r,n));case"Ref":return yield*Ve(k2e(s,i,r,n));case"RegExp":return yield*Ve(R2e(s,i,r,n));case"String":return yield*Ve(B2e(s,i,r,n));case"Symbol":return yield*Ve(j2e(s,i,r,n));case"TemplateLiteral":return yield*Ve($2e(s,i,r,n));case"This":return yield*Ve(G2e(s,i,r,n));case"Tuple":return yield*Ve(U2e(s,i,r,n));case"Undefined":return yield*Ve(V2e(s,i,r,n));case"Union":return yield*Ve(z2e(s,i,r,n));case"Uint8Array":return yield*Ve(q2e(s,i,r,n));case"Unknown":return yield*Ve(H2e(s,i,r,n));case"Void":return yield*Ve(W2e(s,i,r,n));default:if(!Mo.Has(s[xe]))throw new jL(e);return yield*Ve(X2e(s,i,r,n))}}o(xs,"Visit");function op(...e){let t=e.length===3?xs(e[0],e[1],"",e[2]):xs(e[0],[],"",e[1]);return new Jl(t)}o(op,"Errors");g();var Y2e=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},_J=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)},UL,Yw,SJ,zL=class zL extends Mt{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),UL.add(this),Yw.set(this,void 0),Y2e(this,Yw,t,"f"),this.error=r}Errors(){return new Jl(_J(this,UL,"m",SJ).call(this))}};o(zL,"AssertError");var VL=zL;Yw=new WeakMap,UL=new WeakSet,SJ=o(function*(){this.error&&(yield this.error),yield*Ve(_J(this,Yw,"f"))},"_AssertError_Iterator");function IJ(e,t,r){if(!Jt(e,t,r))throw new VL(op(e,t,r))}o(IJ,"AssertValue");function Zw(...e){return e.length===3?IJ(e[0],e[1],e[2]):IJ(e[0],[],e[1])}o(Zw,"Assert");g();g();g();function Z2e(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=pn(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=pn(e[r]);return t}o(Z2e,"FromObject");function K2e(e){return e.map(t=>pn(t))}o(K2e,"FromArray");function J2e(e){return e.slice()}o(J2e,"FromTypedArray");function Q2e(e){return new Map(pn([...e.entries()]))}o(Q2e,"FromMap");function e_e(e){return new Set(pn([...e.entries()]))}o(e_e,"FromSet");function t_e(e){return new Date(e.toISOString())}o(t_e,"FromDate");function pn(e){if(Bt(e))return K2e(e);if(ha(e))return t_e(e);if(Vl(e))return J2e(e);if(UY(e))return Q2e(e);if(VY(e))return e_e(e);if(Ut(e))return Z2e(e);if(ys(e))return e;throw new Error("ValueClone: Unable to clone value")}o(pn,"Clone");var qL=class qL extends Mt{constructor(t,r){super(r),this.schema=t}};o(qL,"ValueCreateError");var fl=qL;function fn(e){return uh(e)?e():pn(e)}o(fn,"FromDefault");function r_e(e,t){return At(e,"default")?fn(e.default):{}}o(r_e,"FromAny");function n_e(e,t){if(e.uniqueItems===!0&&!At(e,"default"))throw new fl(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!At(e,"default"))throw new fl(e,"Array with the contains constraint requires a default value");return"default"in e?fn(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>dl(e.items,t)):[]}o(n_e,"FromArray");function i_e(e,t){return At(e,"default")?fn(e.default):function(){return gN(this,null,function*(){})}()}o(i_e,"FromAsyncIterator");function o_e(e,t){return At(e,"default")?fn(e.default):BigInt(0)}o(o_e,"FromBigInt");function s_e(e,t){return At(e,"default")?fn(e.default):!1}o(s_e,"FromBoolean");function a_e(e,t){if(At(e,"default"))return fn(e.default);{let r=dl(e.returns,t);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,i]of Object.entries(r)){let s=this;s[n]=i}}}:class{}}}o(a_e,"FromConstructor");function l_e(e,t){return At(e,"default")?fn(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}o(l_e,"FromDate");function u_e(e,t){return At(e,"default")?fn(e.default):()=>dl(e.returns,t)}o(u_e,"FromFunction");function c_e(e,t){return At(e,"default")?fn(e.default):e.minimum!==void 0?e.minimum:0}o(c_e,"FromInteger");function p_e(e,t){if(At(e,"default"))return fn(e.default);{let r=e.allOf.reduce((n,i)=>{let s=dl(i,t);return typeof s=="object"?R(R({},n),s):s},{});if(!Jt(e,t,r))throw new fl(e,"Intersect produced invalid value. Consider using a default value.");return r}}o(p_e,"FromIntersect");function f_e(e,t){return At(e,"default")?fn(e.default):function*(){}()}o(f_e,"FromIterator");function d_e(e,t){return At(e,"default")?fn(e.default):e.const}o(d_e,"FromLiteral");function h_e(e,t){if(At(e,"default"))return fn(e.default);throw new fl(e,"Never types cannot be created. Consider using a default value.")}o(h_e,"FromNever");function m_e(e,t){if(At(e,"default"))return fn(e.default);throw new fl(e,"Not types must have a default value")}o(m_e,"FromNot");function g_e(e,t){return At(e,"default")?fn(e.default):null}o(g_e,"FromNull");function y_e(e,t){return At(e,"default")?fn(e.default):e.minimum!==void 0?e.minimum:0}o(y_e,"FromNumber");function v_e(e,t){if(At(e,"default"))return fn(e.default);{let r=new Set(e.required),n={};for(let[i,s]of Object.entries(e.properties))r.has(i)&&(n[i]=dl(s,t));return n}}o(v_e,"FromObject");function b_e(e,t){return At(e,"default")?fn(e.default):Promise.resolve(dl(e.item,t))}o(b_e,"FromPromise");function x_e(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(At(e,"default"))return fn(e.default);if(r===Ef||r===Tf)return{};{let i=r.slice(1,r.length-1).split("|"),s={};for(let l of i)s[l]=dl(n,t);return s}}o(x_e,"FromRecord");function I_e(e,t){return At(e,"default")?fn(e.default):dl(cn(e,t),t)}o(I_e,"FromRef");function __e(e,t){if(At(e,"default"))return fn(e.default);throw new fl(e,"RegExp types cannot be created. Consider using a default value.")}o(__e,"FromRegExp");function S_e(e,t){if(e.pattern!==void 0){if(At(e,"default"))return fn(e.default);throw new fl(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(At(e,"default"))return fn(e.default);throw new fl(e,"String types with formats must specify a default value")}else return At(e,"default")?fn(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}o(S_e,"FromString");function C_e(e,t){return At(e,"default")?fn(e.default):"value"in e?Symbol.for(e.value):Symbol()}o(C_e,"FromSymbol");function w_e(e,t){if(At(e,"default"))return fn(e.default);if(!Iw(e))throw new fl(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return y1(e)[0]}o(w_e,"FromTemplateLiteral");function P_e(e,t){if(CJ++>F_e)throw new fl(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return At(e,"default")?fn(e.default):dl(cn(e,t),t)}o(P_e,"FromThis");function T_e(e,t){return At(e,"default")?fn(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>dl(e.items[n],t))}o(T_e,"FromTuple");function E_e(e,t){if(At(e,"default"))return fn(e.default)}o(E_e,"FromUndefined");function M_e(e,t){if(At(e,"default"))return fn(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return dl(e.anyOf[0],t)}o(M_e,"FromUnion");function O_e(e,t){return At(e,"default")?fn(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}o(O_e,"FromUint8Array");function L_e(e,t){return At(e,"default")?fn(e.default):{}}o(L_e,"FromUnknown");function A_e(e,t){if(At(e,"default"))return fn(e.default)}o(A_e,"FromVoid");function D_e(e,t){if(At(e,"default"))return fn(e.default);throw new Error("User defined types must specify a default value")}o(D_e,"FromKind");function dl(e,t){let r=Kl(e,t),n=e;switch(n[xe]){case"Any":return r_e(n,r);case"Array":return n_e(n,r);case"AsyncIterator":return i_e(n,r);case"BigInt":return o_e(n,r);case"Boolean":return s_e(n,r);case"Constructor":return a_e(n,r);case"Date":return l_e(n,r);case"Function":return u_e(n,r);case"Integer":return c_e(n,r);case"Intersect":return p_e(n,r);case"Iterator":return f_e(n,r);case"Literal":return d_e(n,r);case"Never":return h_e(n,r);case"Not":return m_e(n,r);case"Null":return g_e(n,r);case"Number":return y_e(n,r);case"Object":return v_e(n,r);case"Promise":return b_e(n,r);case"Record":return x_e(n,r);case"Ref":return I_e(n,r);case"RegExp":return __e(n,r);case"String":return S_e(n,r);case"Symbol":return C_e(n,r);case"TemplateLiteral":return w_e(n,r);case"This":return P_e(n,r);case"Tuple":return T_e(n,r);case"Undefined":return E_e(n,r);case"Union":return M_e(n,r);case"Uint8Array":return O_e(n,r);case"Unknown":return L_e(n,r);case"Void":return A_e(n,r);default:if(!Mo.Has(n[xe]))throw new fl(n,"Unknown type");return D_e(n,r)}}o(dl,"Visit");var F_e=512,CJ=0;function Ql(...e){return CJ=0,e.length===2?dl(e[0],e[1]):dl(e[0],[])}o(Ql,"Create");var WL=class WL extends Mt{constructor(t,r){super(r),this.schema=t}};o(WL,"ValueCastError");var Kw=WL;function N_e(e,t,r){if(e[xe]==="Object"&&typeof r=="object"&&!_f(r)){let n=e,i=Object.getOwnPropertyNames(r),s=Object.entries(n.properties),[l,c]=[1/s.length,s.length];return s.reduce((p,[h,y])=>{let b=y[xe]==="Literal"&&y.const===r[h]?c:0,_=Jt(y,t,r[h])?l:0,C=i.includes(h)?l:0;return p+(b+_+C)},0)}else return Jt(e,t,r)?1:0}o(N_e,"ScoreUnion");function k_e(e,t,r){let n=e.anyOf.map(l=>cn(l,t)),[i,s]=[n[0],0];for(let l of n){let c=N_e(l,t,r);c>s&&(i=l,s=c)}return i}o(k_e,"SelectUnion");function R_e(e,t,r){if("default"in e)return typeof r=="function"?e.default:pn(e.default);{let n=k_e(e,t,r);return HL(n,t,r)}}o(R_e,"CastUnion");function B_e(e,t,r){return Jt(e,t,r)?pn(r):Ql(e,t)}o(B_e,"DefaultClone");function j_e(e,t,r){return Jt(e,t,r)?r:Ql(e,t)}o(j_e,"Default");function $_e(e,t,r){if(Jt(e,t,r))return pn(r);let n=Bt(r)?pn(r):Ql(e,t),i=_t(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,l=(_t(e.maxItems)&&i.length>e.maxItems?i.slice(0,e.maxItems):i).map(p=>sp(e.items,t,p));if(e.uniqueItems!==!0)return l;let c=[...new Set(l)];if(!Jt(e,t,c))throw new Kw(e,"Array cast produced invalid data due to uniqueItems constraint");return c}o($_e,"FromArray");function G_e(e,t,r){if(Jt(e,t,r))return Ql(e,t);let n=new Set(e.returns.required||[]),i=o(function(){},"result");for(let[s,l]of Object.entries(e.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(i.prototype[s]=sp(l,t,r.prototype[s]));return i}o(G_e,"FromConstructor");function U_e(e,t,r){let n=Ql(e,t),i=Ut(n)&&Ut(r)?R(R({},n),r):r;return Jt(e,t,i)?i:Ql(e,t)}o(U_e,"FromIntersect");function V_e(e,t,r){throw new Kw(e,"Never types cannot be cast")}o(V_e,"FromNever");function z_e(e,t,r){if(Jt(e,t,r))return r;if(r===null||typeof r!="object")return Ql(e,t);let n=new Set(e.required||[]),i={};for(let[s,l]of Object.entries(e.properties))!n.has(s)&&r[s]===void 0||(i[s]=sp(l,t,r[s]));if(typeof e.additionalProperties=="object"){let s=Object.getOwnPropertyNames(e.properties);for(let l of Object.getOwnPropertyNames(r))s.includes(l)||(i[l]=sp(e.additionalProperties,t,r[l]))}return i}o(z_e,"FromObject");function q_e(e,t,r){if(Jt(e,t,r))return pn(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return Ql(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[n],s={};for(let[l,c]of Object.entries(r))s[l]=sp(i,t,c);return s}o(q_e,"FromRecord");function H_e(e,t,r){return sp(cn(e,t),t,r)}o(H_e,"FromRef");function W_e(e,t,r){return sp(cn(e,t),t,r)}o(W_e,"FromThis");function X_e(e,t,r){return Jt(e,t,r)?pn(r):Bt(r)?e.items===void 0?[]:e.items.map((n,i)=>sp(n,t,r[i])):Ql(e,t)}o(X_e,"FromTuple");function Y_e(e,t,r){return Jt(e,t,r)?pn(r):R_e(e,t,r)}o(Y_e,"FromUnion");function sp(e,t,r){let n=Qr(e.$id)?[...t,e]:t,i=e;switch(e[xe]){case"Array":return $_e(i,n,r);case"Constructor":return G_e(i,n,r);case"Intersect":return U_e(i,n,r);case"Never":return V_e(i,n,r);case"Object":return z_e(i,n,r);case"Record":return q_e(i,n,r);case"Ref":return H_e(i,n,r);case"This":return W_e(i,n,r);case"Tuple":return X_e(i,n,r);case"Union":return Y_e(i,n,r);case"Date":case"Symbol":case"Uint8Array":return B_e(e,t,r);default:return j_e(i,n,r)}}o(sp,"Visit");function HL(...e){return e.length===3?sp(e[0],e[1],e[2]):sp(e[0],[],e[1])}o(HL,"Cast");g();function Z_e(e){return ph(e)&&e[xe]!=="Unsafe"}o(Z_e,"IsCheckable");function K_e(e,t,r){return Bt(r)?r.map(n=>hl(e.items,t,n)):r}o(K_e,"FromArray");function J_e(e,t,r){let n=e.unevaluatedProperties,s=e.allOf.map(c=>hl(c,t,pn(r))).reduce((c,p)=>Ut(p)?R(R({},c),p):p,{});if(!Ut(r)||!Ut(s)||!ph(n))return s;let l=Yo(e);for(let c of Object.getOwnPropertyNames(r))l.includes(c)||Jt(n,t,r[c])&&(s[c]=hl(n,t,r[c]));return s}o(J_e,"FromIntersect");function Q_e(e,t,r){if(!Ut(r)||Bt(r))return r;let n=e.additionalProperties;for(let i of Object.getOwnPropertyNames(r)){if(At(e.properties,i)){r[i]=hl(e.properties[i],t,r[i]);continue}if(ph(n)&&Jt(n,t,r[i])){r[i]=hl(n,t,r[i]);continue}delete r[i]}return r}o(Q_e,"FromObject");function eSe(e,t,r){if(!Ut(r))return r;let n=e.additionalProperties,i=Object.getOwnPropertyNames(r),[s,l]=Object.entries(e.patternProperties)[0],c=new RegExp(s);for(let p of i){if(c.test(p)){r[p]=hl(l,t,r[p]);continue}if(ph(n)&&Jt(n,t,r[p])){r[p]=hl(n,t,r[p]);continue}delete r[p]}return r}o(eSe,"FromRecord");function tSe(e,t,r){return hl(cn(e,t),t,r)}o(tSe,"FromRef");function rSe(e,t,r){return hl(cn(e,t),t,r)}o(rSe,"FromThis");function nSe(e,t,r){if(!Bt(r))return r;if(Ai(e.items))return[];let n=Math.min(r.length,e.items.length);for(let i=0;i<n;i++)r[i]=hl(e.items[i],t,r[i]);return r.length>n?r.slice(0,n):r}o(nSe,"FromTuple");function iSe(e,t,r){for(let n of e.anyOf)if(Z_e(n)&&Jt(n,t,r))return hl(n,t,r);return r}o(iSe,"FromUnion");function hl(e,t,r){let n=Qr(e.$id)?[...t,e]:t,i=e;switch(i[xe]){case"Array":return K_e(i,n,r);case"Intersect":return J_e(i,n,r);case"Object":return Q_e(i,n,r);case"Record":return eSe(i,n,r);case"Ref":return tSe(i,n,r);case"This":return rSe(i,n,r);case"Tuple":return nSe(i,n,r);case"Union":return iSe(i,n,r);default:return r}}o(hl,"Visit");function Jw(...e){return e.length===3?hl(e[0],e[1],e[2]):hl(e[0],[],e[1])}o(Jw,"Clean");g();function Qw(e){return Qr(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}o(Qw,"IsStringNumeric");function oSe(e){return gs(e)||Qc(e)||_t(e)}o(oSe,"IsValueToString");function CI(e){return e===!0||_t(e)&&e===1||gs(e)&&e===BigInt("1")||Qr(e)&&(e.toLowerCase()==="true"||e==="1")}o(CI,"IsValueTrue");function wI(e){return e===!1||_t(e)&&(e===0||Object.is(e,-0))||gs(e)&&e===BigInt("0")||Qr(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}o(wI,"IsValueFalse");function sSe(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(sSe,"IsTimeStringWithTimeZone");function aSe(e){return Qr(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}o(aSe,"IsTimeStringWithoutTimeZone");function lSe(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(lSe,"IsDateTimeStringWithTimeZone");function uSe(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(uSe,"IsDateTimeStringWithoutTimeZone");function cSe(e){return Qr(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}o(cSe,"IsDateString");function pSe(e,t){let r=PJ(e);return r===t?r:e}o(pSe,"TryConvertLiteralString");function fSe(e,t){let r=TJ(e);return r===t?r:e}o(fSe,"TryConvertLiteralNumber");function dSe(e,t){let r=wJ(e);return r===t?r:e}o(dSe,"TryConvertLiteralBoolean");function hSe(e,t){return Qr(e.const)?pSe(t,e.const):_t(e.const)?fSe(t,e.const):Qc(e.const)?dSe(t,e.const):t}o(hSe,"TryConvertLiteral");function wJ(e){return CI(e)?!0:wI(e)?!1:e}o(wJ,"TryConvertBoolean");function mSe(e){let t=o(r=>r.split(".")[0],"truncateInteger");return Qw(e)?BigInt(t(e)):_t(e)?BigInt(Math.trunc(e)):wI(e)?BigInt(0):CI(e)?BigInt(1):e}o(mSe,"TryConvertBigInt");function PJ(e){return oSe(e)?e.toString():Sf(e)&&e.description!==void 0?e.description.toString():e}o(PJ,"TryConvertString");function TJ(e){return Qw(e)?parseFloat(e):CI(e)?1:wI(e)?0:e}o(TJ,"TryConvertNumber");function gSe(e){return Qw(e)?parseInt(e):_t(e)?e|0:CI(e)?1:wI(e)?0:e}o(gSe,"TryConvertInteger");function ySe(e){return Qr(e)&&e.toLowerCase()==="null"?null:e}o(ySe,"TryConvertNull");function vSe(e){return Qr(e)&&e==="undefined"?void 0:e}o(vSe,"TryConvertUndefined");function bSe(e){return ha(e)?e:_t(e)?new Date(e):CI(e)?new Date(1):wI(e)?new Date(0):Qw(e)?new Date(parseInt(e)):aSe(e)?new Date("1970-01-01T".concat(e,".000Z")):sSe(e)?new Date("1970-01-01T".concat(e)):uSe(e)?new Date("".concat(e,".000Z")):lSe(e)?new Date(e):cSe(e)?new Date("".concat(e,"T00:00:00.000Z")):e}o(bSe,"TryConvertDate");function xSe(e,t,r){return(Bt(r)?r:[r]).map(i=>ap(e.items,t,i))}o(xSe,"FromArray");function ISe(e,t,r){return mSe(r)}o(ISe,"FromBigInt");function _Se(e,t,r){return wJ(r)}o(_Se,"FromBoolean");function SSe(e,t,r){return bSe(r)}o(SSe,"FromDate");function CSe(e,t,r){return gSe(r)}o(CSe,"FromInteger");function wSe(e,t,r){return e.allOf.reduce((n,i)=>ap(i,t,n),r)}o(wSe,"FromIntersect");function PSe(e,t,r){return hSe(e,r)}o(PSe,"FromLiteral");function TSe(e,t,r){return ySe(r)}o(TSe,"FromNull");function ESe(e,t,r){return TJ(r)}o(ESe,"FromNumber");function MSe(e,t,r){if(!Ut(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))At(r,n)&&(r[n]=ap(e.properties[n],t,r[n]));return r}o(MSe,"FromObject");function OSe(e,t,r){if(!Ut(r))return r;let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=e.patternProperties[i];for(let[l,c]of Object.entries(r))r[l]=ap(s,t,c);return r}o(OSe,"FromRecord");function LSe(e,t,r){return ap(cn(e,t),t,r)}o(LSe,"FromRef");function ASe(e,t,r){return PJ(r)}o(ASe,"FromString");function DSe(e,t,r){return Qr(r)||_t(r)?Symbol(r):r}o(DSe,"FromSymbol");function FSe(e,t,r){return ap(cn(e,t),t,r)}o(FSe,"FromThis");function NSe(e,t,r){return Bt(r)&&!Ai(e.items)?r.map((i,s)=>s<e.items.length?ap(e.items[s],t,i):i):r}o(NSe,"FromTuple");function kSe(e,t,r){return vSe(r)}o(kSe,"FromUndefined");function RSe(e,t,r){for(let n of e.anyOf){let i=ap(n,t,pn(r));if(Jt(n,t,i))return i}return r}o(RSe,"FromUnion");function ap(e,t,r){let n=Kl(e,t),i=e;switch(e[xe]){case"Array":return xSe(i,n,r);case"BigInt":return ISe(i,n,r);case"Boolean":return _Se(i,n,r);case"Date":return SSe(i,n,r);case"Integer":return CSe(i,n,r);case"Intersect":return wSe(i,n,r);case"Literal":return PSe(i,n,r);case"Null":return TSe(i,n,r);case"Number":return ESe(i,n,r);case"Object":return MSe(i,n,r);case"Record":return OSe(i,n,r);case"Ref":return LSe(i,n,r);case"String":return ASe(i,n,r);case"Symbol":return DSe(i,n,r);case"This":return FSe(i,n,r);case"Tuple":return NSe(i,n,r);case"Undefined":return kSe(i,n,r);case"Union":return RSe(i,n,r);default:return r}}o(ap,"Visit");function eP(...e){return e.length===3?ap(e[0],e[1],e[2]):ap(e[0],[],e[1])}o(eP,"Convert");g();g();var XL=class XL extends Mt{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(XL,"TransformDecodeCheckError");var F1=XL,YL=class YL extends Mt{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(YL,"TransformDecodeError");var Cg=YL;function Di(e,t,r){try{return ni(e)?e[hi].Decode(r):r}catch(n){throw new Cg(e,t,r,n)}}o(Di,"Default");function BSe(e,t,r,n){return Bt(n)?Di(e,r,n.map((i,s)=>lp(e.items,t,"".concat(r,"/").concat(s),i))):Di(e,r,n)}o(BSe,"FromArray");function jSe(e,t,r,n){if(!Ut(n)||ys(n))return Di(e,r,n);let i=hh(e),s=i.map(y=>y[0]),l=R({},n);for(let[y,b]of i)y in l&&(l[y]=lp(b,t,"".concat(r,"/").concat(y),l[y]));if(!ni(e.unevaluatedProperties))return Di(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,h=R({},l);for(let y of c)s.includes(y)||(h[y]=Di(p,"".concat(r,"/").concat(y),h[y]));return Di(e,r,h)}o(jSe,"FromIntersect");function $Se(e,t,r,n){return Di(e,r,lp(e.not,t,r,n))}o($Se,"FromNot");function GSe(e,t,r,n){if(!Ut(n))return Di(e,r,n);let i=Yo(e),s=R({},n);for(let h of i)At(s,h)&&(Ai(s[h])&&(!f1(e.properties[h])||Mn.IsExactOptionalProperty(s,h))||(s[h]=lp(e.properties[h],t,"".concat(r,"/").concat(h),s[h])));if(!en(e.additionalProperties))return Di(e,r,s);let l=Object.getOwnPropertyNames(s),c=e.additionalProperties,p=R({},s);for(let h of l)i.includes(h)||(p[h]=Di(c,"".concat(r,"/").concat(h),p[h]));return Di(e,r,p)}o(GSe,"FromObject");function USe(e,t,r,n){if(!Ut(n))return Di(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),l=R({},n);for(let y of Object.getOwnPropertyNames(n))s.test(y)&&(l[y]=lp(e.patternProperties[i],t,"".concat(r,"/").concat(y),l[y]));if(!en(e.additionalProperties))return Di(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,h=R({},l);for(let y of c)s.test(y)||(h[y]=Di(p,"".concat(r,"/").concat(y),h[y]));return Di(e,r,h)}o(USe,"FromRecord");function VSe(e,t,r,n){let i=cn(e,t);return Di(e,r,lp(i,t,r,n))}o(VSe,"FromRef");function zSe(e,t,r,n){let i=cn(e,t);return Di(e,r,lp(i,t,r,n))}o(zSe,"FromThis");function qSe(e,t,r,n){return Bt(n)&&Bt(e.items)?Di(e,r,e.items.map((i,s)=>lp(i,t,"".concat(r,"/").concat(s),n[s]))):Di(e,r,n)}o(qSe,"FromTuple");function HSe(e,t,r,n){for(let i of e.anyOf){if(!Jt(i,t,n))continue;let s=lp(i,t,r,n);return Di(e,r,s)}return Di(e,r,n)}o(HSe,"FromUnion");function lp(e,t,r,n){let i=Kl(e,t),s=e;switch(e[xe]){case"Array":return BSe(s,i,r,n);case"Intersect":return jSe(s,i,r,n);case"Not":return $Se(s,i,r,n);case"Object":return GSe(s,i,r,n);case"Record":return USe(s,i,r,n);case"Ref":return VSe(s,i,r,n);case"Symbol":return Di(s,r,n);case"This":return zSe(s,i,r,n);case"Tuple":return qSe(s,i,r,n);case"Union":return HSe(s,i,r,n);default:return Di(s,r,n)}}o(lp,"Visit");function N1(e,t,r){return lp(e,t,"",r)}o(N1,"TransformDecode");g();var ZL=class ZL extends Mt{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};o(ZL,"TransformEncodeCheckError");var k1=ZL,KL=class KL extends Mt{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(KL,"TransformEncodeError");var wg=KL;function Hs(e,t,r){try{return ni(e)?e[hi].Encode(r):r}catch(n){throw new wg(e,t,r,n)}}o(Hs,"Default");function WSe(e,t,r,n){let i=Hs(e,r,n);return Bt(i)?i.map((s,l)=>up(e.items,t,"".concat(r,"/").concat(l),s)):i}o(WSe,"FromArray");function XSe(e,t,r,n){let i=Hs(e,r,n);if(!Ut(n)||ys(n))return i;let s=hh(e),l=s.map(b=>b[0]),c=R({},i);for(let[b,_]of s)b in c&&(c[b]=up(_,t,"".concat(r,"/").concat(b),c[b]));if(!ni(e.unevaluatedProperties))return c;let p=Object.getOwnPropertyNames(c),h=e.unevaluatedProperties,y=R({},c);for(let b of p)l.includes(b)||(y[b]=Hs(h,"".concat(r,"/").concat(b),y[b]));return y}o(XSe,"FromIntersect");function YSe(e,t,r,n){return Hs(e.not,r,Hs(e,r,n))}o(YSe,"FromNot");function ZSe(e,t,r,n){let i=Hs(e,r,n);if(!Ut(i))return i;let s=Yo(e),l=R({},i);for(let y of s)At(l,y)&&(Ai(l[y])&&(!f1(e.properties[y])||Mn.IsExactOptionalProperty(l,y))||(l[y]=up(e.properties[y],t,"".concat(r,"/").concat(y),l[y])));if(!en(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,h=R({},l);for(let y of c)s.includes(y)||(h[y]=Hs(p,"".concat(r,"/").concat(y),h[y]));return h}o(ZSe,"FromObject");function KSe(e,t,r,n){let i=Hs(e,r,n);if(!Ut(n))return i;let s=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(s),c=R({},i);for(let b of Object.getOwnPropertyNames(n))l.test(b)&&(c[b]=up(e.patternProperties[s],t,"".concat(r,"/").concat(b),c[b]));if(!en(e.additionalProperties))return c;let p=Object.getOwnPropertyNames(c),h=e.additionalProperties,y=R({},c);for(let b of p)l.test(b)||(y[b]=Hs(h,"".concat(r,"/").concat(b),y[b]));return y}o(KSe,"FromRecord");function JSe(e,t,r,n){let i=cn(e,t),s=up(i,t,r,n);return Hs(e,r,s)}o(JSe,"FromRef");function QSe(e,t,r,n){let i=cn(e,t),s=up(i,t,r,n);return Hs(e,r,s)}o(QSe,"FromThis");function eCe(e,t,r,n){let i=Hs(e,r,n);return Bt(e.items)?e.items.map((s,l)=>up(s,t,"".concat(r,"/").concat(l),i[l])):[]}o(eCe,"FromTuple");function tCe(e,t,r,n){for(let i of e.anyOf){if(!Jt(i,t,n))continue;let s=up(i,t,r,n);return Hs(e,r,s)}for(let i of e.anyOf){let s=up(i,t,r,n);if(Jt(e,t,s))return Hs(e,r,s)}return Hs(e,r,n)}o(tCe,"FromUnion");function up(e,t,r,n){let i=Kl(e,t),s=e;switch(e[xe]){case"Array":return WSe(s,i,r,n);case"Intersect":return XSe(s,i,r,n);case"Not":return YSe(s,i,r,n);case"Object":return ZSe(s,i,r,n);case"Record":return KSe(s,i,r,n);case"Ref":return JSe(s,i,r,n);case"This":return QSe(s,i,r,n);case"Tuple":return eCe(s,i,r,n);case"Union":return tCe(s,i,r,n);default:return Hs(s,r,n)}}o(up,"Visit");function tP(e,t,r){return up(e,t,"",r)}o(tP,"TransformEncode");g();function rCe(e,t){return ni(e)||Zo(e.items,t)}o(rCe,"FromArray");function nCe(e,t){return ni(e)||Zo(e.items,t)}o(nCe,"FromAsyncIterator");function iCe(e,t){return ni(e)||Zo(e.returns,t)||e.parameters.some(r=>Zo(r,t))}o(iCe,"FromConstructor");function oCe(e,t){return ni(e)||Zo(e.returns,t)||e.parameters.some(r=>Zo(r,t))}o(oCe,"FromFunction");function sCe(e,t){return ni(e)||ni(e.unevaluatedProperties)||e.allOf.some(r=>Zo(r,t))}o(sCe,"FromIntersect");function aCe(e,t){return ni(e)||Zo(e.items,t)}o(aCe,"FromIterator");function lCe(e,t){return ni(e)||Zo(e.not,t)}o(lCe,"FromNot");function uCe(e,t){return ni(e)||Object.values(e.properties).some(r=>Zo(r,t))||en(e.additionalProperties)&&Zo(e.additionalProperties,t)}o(uCe,"FromObject");function cCe(e,t){return ni(e)||Zo(e.item,t)}o(cCe,"FromPromise");function pCe(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return ni(e)||Zo(n,t)||en(e.additionalProperties)&&ni(e.additionalProperties)}o(pCe,"FromRecord");function fCe(e,t){return ni(e)?!0:Zo(cn(e,t),t)}o(fCe,"FromRef");function dCe(e,t){return ni(e)?!0:Zo(cn(e,t),t)}o(dCe,"FromThis");function hCe(e,t){return ni(e)||!Ai(e.items)&&e.items.some(r=>Zo(r,t))}o(hCe,"FromTuple");function mCe(e,t){return ni(e)||e.anyOf.some(r=>Zo(r,t))}o(mCe,"FromUnion");function Zo(e,t){let r=Kl(e,t),n=e;if(e.$id&&JL.has(e.$id))return!1;switch(e.$id&&JL.add(e.$id),e[xe]){case"Array":return rCe(n,r);case"AsyncIterator":return nCe(n,r);case"Constructor":return iCe(n,r);case"Function":return oCe(n,r);case"Intersect":return sCe(n,r);case"Iterator":return aCe(n,r);case"Not":return lCe(n,r);case"Object":return uCe(n,r);case"Promise":return cCe(n,r);case"Record":return pCe(n,r);case"Ref":return fCe(n,r);case"This":return dCe(n,r);case"Tuple":return hCe(n,r);case"Union":return mCe(n,r);default:return ni(e)}}o(Zo,"Visit");var JL=new Set;function cp(e,t){return JL.clear(),Zo(e,t)}o(cp,"HasTransform");function EJ(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!Jt(t,r,n))throw new F1(t,n,op(t,r,n).First());return cp(t,r)?N1(t,r,n):n}o(EJ,"Decode");g();function Nf(e,t){let r=At(e,"default")?e.default:void 0,n=uh(r)?r():pn(r);return Ai(t)?n:Ut(t)&&Ut(n)?Object.assign(n,t):t}o(Nf,"ValueOrDefault");function QL(e){return ph(e)&&"default"in e}o(QL,"HasDefaultProperty");function gCe(e,t,r){let n=Nf(e,r);if(!Bt(n))return n;for(let i=0;i<n.length;i++)n[i]=ml(e.items,t,n[i]);return n}o(gCe,"FromArray");function yCe(e,t,r){return ha(r)?r:Nf(e,r)}o(yCe,"FromDate");function vCe(e,t,r){let n=Nf(e,r);return e.allOf.reduce((i,s)=>{let l=ml(s,t,n);return Ut(l)?R(R({},i),l):l},{})}o(vCe,"FromIntersect");function bCe(e,t,r){let n=Nf(e,r);if(!Ut(n))return n;let i=Object.getOwnPropertyNames(e.properties);for(let s of i){let l=ml(e.properties[s],t,n[s]);Ai(l)||(n[s]=ml(e.properties[s],t,n[s]))}if(!QL(e.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))i.includes(s)||(n[s]=ml(e.additionalProperties,t,n[s]));return n}o(bCe,"FromObject");function xCe(e,t,r){let n=Nf(e,r);if(!Ut(n))return n;let i=e.additionalProperties,[s,l]=Object.entries(e.patternProperties)[0],c=new RegExp(s);for(let p of Object.getOwnPropertyNames(n))c.test(p)&&QL(l)&&(n[p]=ml(l,t,n[p]));if(!QL(i))return n;for(let p of Object.getOwnPropertyNames(n))c.test(p)||(n[p]=ml(i,t,n[p]));return n}o(xCe,"FromRecord");function ICe(e,t,r){return ml(cn(e,t),t,Nf(e,r))}o(ICe,"FromRef");function _Ce(e,t,r){return ml(cn(e,t),t,r)}o(_Ce,"FromThis");function SCe(e,t,r){let n=Nf(e,r);if(!Bt(n)||Ai(e.items))return n;let[i,s]=[e.items,Math.max(e.items.length,n.length)];for(let l=0;l<s;l++)l<i.length&&(n[l]=ml(i[l],t,n[l]));return n}o(SCe,"FromTuple");function CCe(e,t,r){let n=Nf(e,r);for(let i of e.anyOf){let s=ml(i,t,pn(n));if(Jt(i,t,s))return s}return n}o(CCe,"FromUnion");function ml(e,t,r){let n=Kl(e,t),i=e;switch(i[xe]){case"Array":return gCe(i,n,r);case"Date":return yCe(i,n,r);case"Intersect":return vCe(i,n,r);case"Object":return bCe(i,n,r);case"Record":return xCe(i,n,r);case"Ref":return ICe(i,n,r);case"This":return _Ce(i,n,r);case"Tuple":return SCe(i,n,r);case"Union":return CCe(i,n,r);default:return Nf(i,r)}}o(ml,"Visit");function rP(...e){return e.length===3?ml(e[0],e[1],e[2]):ml(e[0],[],e[1])}o(rP,"Default");g();g();var eu={};wc(eu,{Delete:()=>PCe,Format:()=>PI,Get:()=>ECe,Has:()=>TCe,Set:()=>wCe,ValuePointerRootDeleteError:()=>iP,ValuePointerRootSetError:()=>nP});g();var eA=class eA extends Mt{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}};o(eA,"ValuePointerRootSetError");var nP=eA,tA=class tA extends Mt{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};o(tA,"ValuePointerRootDeleteError");var iP=tA;function MJ(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}o(MJ,"Escape");function*PI(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 MJ(e.slice(t,r))),t=n+1):r=n;yield MJ(e.slice(t))}o(PI,"Format");function wCe(e,t,r){if(t==="")throw new nP(e,t,r);let[n,i,s]=[null,e,""];for(let l of PI(t))i[l]===void 0&&(i[l]={}),n=i,i=i[l],s=l;n[s]=r}o(wCe,"Set");function PCe(e,t){if(t==="")throw new iP(e,t);let[r,n,i]=[null,e,""];for(let s of PI(t)){if(n[s]===void 0||n[s]===null)return;r=n,n=n[s],i=s}if(Array.isArray(r)){let s=parseInt(i);r.splice(s,1)}else delete r[i]}o(PCe,"Delete");function TCe(e,t){if(t==="")return!0;let[r,n,i]=[null,e,""];for(let s of PI(t)){if(n[s]===void 0)return!1;r=n,n=n[s],i=s}return Object.getOwnPropertyNames(r).includes(i)}o(TCe,"Has");function ECe(e,t){if(t==="")return e;let r=e;for(let n of PI(t)){if(r[n]===void 0)return;r=r[n]}return r}o(ECe,"Get");g();function MCe(e,t){if(!Ut(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=>Pg(e[i],t[i]))}o(MCe,"ObjectType");function OCe(e,t){return ha(t)&&e.getTime()===t.getTime()}o(OCe,"DateType");function LCe(e,t){return!Bt(t)||e.length!==t.length?!1:e.every((r,n)=>Pg(r,t[n]))}o(LCe,"ArrayType");function ACe(e,t){return!Vl(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>Pg(r,t[n]))}o(ACe,"TypedArrayType");function DCe(e,t){return e===t}o(DCe,"ValueType");function Pg(e,t){if(ha(e))return OCe(e,t);if(Vl(e))return ACe(e,t);if(Bt(e))return LCe(e,t);if(Ut(e))return MCe(e,t);if(ys(e))return DCe(e,t);throw new Error("ValueEquals: Unable to compare value")}o(Pg,"Equal");var FCe=Wn({type:In("insert"),path:ql(),value:Lf()}),NCe=Wn({type:In("update"),path:ql(),value:Lf()}),kCe=Wn({type:In("delete"),path:ql()}),LJ=kn([FCe,NCe,kCe]),rA=class rA extends Mt{constructor(t,r){super(r),this.value=t}};o(rA,"ValueDiffError");var oP=rA;function sP(e,t){return{type:"update",path:e,value:t}}o(sP,"CreateUpdate");function AJ(e,t){return{type:"insert",path:e,value:t}}o(AJ,"CreateInsert");function DJ(e){return{type:"delete",path:e}}o(DJ,"CreateDelete");function OJ(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new oP(e,"Cannot diff objects with symbols")}o(OJ,"AssertDiffable");function*RCe(e,t,r){if(OJ(t),OJ(r),!_6(r))return yield sP(e,r);let n=globalThis.Object.getOwnPropertyNames(t),i=globalThis.Object.getOwnPropertyNames(r);for(let s of i)At(t,s)||(yield AJ("".concat(e,"/").concat(s),r[s]));for(let s of n)At(r,s)&&(Pg(t,r)||(yield*Ve(aP("".concat(e,"/").concat(s),t[s],r[s]))));for(let s of n)At(r,s)||(yield DJ("".concat(e,"/").concat(s)))}o(RCe,"ObjectType");function*BCe(e,t,r){if(!Bt(r))return yield sP(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*Ve(aP("".concat(e,"/").concat(n),t[n],r[n]));for(let n=0;n<r.length;n++)n<t.length||(yield AJ("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield DJ("".concat(e,"/").concat(n)))}o(BCe,"ArrayType");function*jCe(e,t,r){if(!Vl(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield sP(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*Ve(aP("".concat(e,"/").concat(n),t[n],r[n]))}o(jCe,"TypedArrayType");function*$Ce(e,t,r){t!==r&&(yield sP(e,r))}o($Ce,"ValueType");function*aP(e,t,r){if(_6(t))return yield*Ve(RCe(e,t,r));if(Bt(t))return yield*Ve(BCe(e,t,r));if(Vl(t))return yield*Ve(jCe(e,t,r));if(ys(t))return yield*Ve($Ce(e,t,r));throw new oP(t,"Unable to diff value")}o(aP,"Visit");function FJ(e,t){return[...aP("",e,t)]}o(FJ,"Diff");function GCe(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}o(GCe,"IsRootUpdate");function UCe(e){return e.length===0}o(UCe,"IsIdentity");function NJ(e,t){if(GCe(t))return pn(t[0].value);if(UCe(t))return pn(e);let r=pn(e);for(let n of t)switch(n.type){case"insert":{eu.Set(r,n.path,n.value);break}case"update":{eu.Set(r,n.path,n.value);break}case"delete":{eu.Delete(r,n.path);break}}return r}o(NJ,"Patch");g();function kJ(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],i=cp(t,r)?tP(t,r,n):n;if(!Jt(t,r,i))throw new k1(t,i,op(t,r,i).First());return i}o(kJ,"Encode");g();var iA=class iA extends Mt{constructor(t){super(t)}};o(iA,"ValueMutateError");var lP=iA;function VCe(e,t,r,n){if(!Ut(r))eu.Set(e,t,pn(n));else{let i=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let l of i)s.includes(l)||delete r[l];for(let l of s)i.includes(l)||(r[l]=null);for(let l of s)nA(e,"".concat(t,"/").concat(l),r[l],n[l])}}o(VCe,"ObjectType");function zCe(e,t,r,n){if(!Bt(r))eu.Set(e,t,pn(n));else{for(let i=0;i<n.length;i++)nA(e,"".concat(t,"/").concat(i),r[i],n[i]);r.splice(n.length)}}o(zCe,"ArrayType");function qCe(e,t,r,n){if(Vl(r)&&r.length===n.length)for(let i=0;i<r.length;i++)r[i]=n[i];else eu.Set(e,t,pn(n))}o(qCe,"TypedArrayType");function HCe(e,t,r,n){r!==n&&eu.Set(e,t,n)}o(HCe,"ValueType");function nA(e,t,r,n){if(Bt(n))return zCe(e,t,r,n);if(Vl(n))return qCe(e,t,r,n);if(Ut(n))return VCe(e,t,r,n);if(ys(n))return HCe(e,t,r,n)}o(nA,"Visit");function RJ(e){return Vl(e)||ys(e)}o(RJ,"IsNonMutableValue");function WCe(e,t){return Ut(e)&&Bt(t)||Bt(e)&&Ut(t)}o(WCe,"IsMismatchedValue");function BJ(e,t){if(RJ(e)||RJ(t))throw new lP("Only object and array types can be mutated at the root level");if(WCe(e,t))throw new lP("Cannot assign due type mismatch of assignable values");nA(e,"",e,t)}o(BJ,"Mutate");g();var XCe=[(e,t,r)=>pn(r),(e,t,r)=>rP(e,t,r),(e,t,r)=>Jw(e,t,r),(e,t,r)=>eP(e,t,r),(e,t,r)=>(Zw(e,t,r),r),(e,t,r)=>cp(e,t)?N1(e,t,r):r];function jJ(e,t,r){return XCe.reduce((n,i)=>i(e,t,n),r)}o(jJ,"ParseValue");function $J(...e){return e.length===3?jJ(e[0],e[1],e[2]):jJ(e[0],[],e[1])}o($J,"Parse");g();var kf={};wc(kf,{Assert:()=>Zw,Cast:()=>HL,Check:()=>Jt,Clean:()=>Jw,Clone:()=>pn,Convert:()=>eP,Create:()=>Ql,Decode:()=>EJ,Default:()=>rP,Diff:()=>FJ,Edit:()=>LJ,Encode:()=>kJ,Equal:()=>Pg,Errors:()=>op,Hash:()=>yh,Mutate:()=>BJ,Parse:()=>$J,Patch:()=>NJ,ValueErrorIterator:()=>Jl});g();g();var sA=class sA extends Mt{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));x(this,"schema");this.schema=r}};o(sA,"TypeDereferenceError");var oA=sA;function YCe(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new oA(e);return Tg(r,t)}o(YCe,"Resolve");function uP(e,t){return!Jr.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}o(uP,"Pushref");function Tg(e,t){return e[xe]==="This"||e[xe]==="Ref"?YCe(e,t):e}o(Tg,"Deref");g();function ZCe(e,t,r){let n=e.get(t);if(n!==void 0)return n;let i=cp(t,r);return e.set(t,i),i}o(ZCe,"HasTransformCached");function cP(){let e=new WeakMap;return{HasTransform:o((t,r)=>ZCe(e,t,r),"HasTransform")}}o(cP,"CreateTransformCache");function Fi(e,t,r){try{return oe.IsTransform(e)?e[hi].Decode(r):r}catch(n){throw new Cg(e,t,r,n)}}o(Fi,"Default");function KCe(e,t,r,n,i){return Jr.IsArray(n)?Fi(e,r,n.map((s,l)=>pp(e.items,t,"".concat(r,"/").concat(l),s,i))):Fi(e,r,n)}o(KCe,"FromArray");function JCe(e,t,r,n,i){if(!Jr.IsObject(n)||ys(n))return Fi(e,r,n);let s=hh(e),l=s.map(b=>b[0]),c=R({},n);for(let[b,_]of s)b in c&&(c[b]=pp(_,t,"".concat(r,"/").concat(b),c[b],i));if(!oe.IsTransform(e.unevaluatedProperties))return Fi(e,r,c);let p=Object.getOwnPropertyNames(c),h=e.unevaluatedProperties,y=R({},c);for(let b of p)l.includes(b)||(y[b]=Fi(h,"".concat(r,"/").concat(b),y[b]));return Fi(e,r,y)}o(JCe,"FromIntersect");function QCe(e,t,r,n,i){return Fi(e,r,pp(e.not,t,r,n,i))}o(QCe,"FromNot");function ewe(e,t,r,n,i){if(!Jr.IsObject(n))return Fi(e,r,n);let s=Yo(e),l=R({},n);for(let y of s)Jr.HasPropertyKey(l,y)&&(Jr.IsUndefined(l[y])&&(!oe.IsUndefined(e.properties[y])||Mn.IsExactOptionalProperty(l,y))||(l[y]=pp(e.properties[y],t,"".concat(r,"/").concat(y),l[y],i)));if(!oe.IsSchema(e.additionalProperties))return Fi(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,h=R({},l);for(let y of c)s.includes(y)||(h[y]=Fi(p,"".concat(r,"/").concat(y),h[y]));return Fi(e,r,h)}o(ewe,"FromObject");function twe(e,t,r,n,i){if(!Jr.IsObject(n))return Fi(e,r,n);let s=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(s),c=R({},n);for(let b of Object.getOwnPropertyNames(n))l.test(b)&&(c[b]=pp(e.patternProperties[s],t,"".concat(r,"/").concat(b),c[b],i));if(!oe.IsSchema(e.additionalProperties))return Fi(e,r,c);let p=Object.getOwnPropertyNames(c),h=e.additionalProperties,y=R({},c);for(let b of p)l.test(b)||(y[b]=Fi(h,"".concat(r,"/").concat(b),y[b]));return Fi(e,r,y)}o(twe,"FromRecord");function rwe(e,t,r,n,i){let s=Tg(e,t);return Fi(e,r,pp(s,t,r,n,i))}o(rwe,"FromRef");function nwe(e,t,r,n,i){let s=Tg(e,t);return Fi(e,r,pp(s,t,r,n,i))}o(nwe,"FromThis");function iwe(e,t,r,n,i){return Jr.IsArray(n)&&Jr.IsArray(e.items)?Fi(e,r,e.items.map((s,l)=>pp(s,t,"".concat(r,"/").concat(l),n[l],i))):Fi(e,r,n)}o(iwe,"FromTuple");function owe(e,t,r,n,i){for(let s of e.anyOf){if(!kf.Check(s,t,n))continue;let l=pp(s,t,r,n,i);return Fi(e,r,l)}return Fi(e,r,n)}o(owe,"FromUnion");function pp(e,t,r,n,i){if(!i.HasTransform(e,t))return n;let s=uP(e,t),l=e;switch(e[xe]){case"Array":return KCe(l,s,r,n,i);case"Intersect":return JCe(l,s,r,n,i);case"Not":return QCe(l,s,r,n,i);case"Object":return ewe(l,s,r,n,i);case"Record":return twe(l,s,r,n,i);case"Ref":return rwe(l,s,r,n,i);case"Symbol":return Fi(l,r,n);case"This":return nwe(l,s,r,n,i);case"Tuple":return iwe(l,s,r,n,i);case"Union":return owe(l,s,r,n,i);default:return Fi(l,r,n)}}o(pp,"Visit");function GJ(e,t,r){let n=cP();return pp(e,t,"",r,n)}o(GJ,"FastTransformDecode");g();function Ws(e,t,r){try{return oe.IsTransform(e)?e[hi].Encode(r):r}catch(n){throw new wg(e,t,r,n)}}o(Ws,"Default");function swe(e,t,r,n,i){let s=Ws(e,r,n);return Jr.IsArray(s)?s.map((l,c)=>fp(e.items,t,"".concat(r,"/").concat(c),l,i)):s}o(swe,"FromArray");function awe(e,t,r,n,i){let s=Ws(e,r,n);if(!Jr.IsObject(n)||ys(n))return s;let l=hh(e),c=l.map(_=>_[0]),p=R({},s);for(let[_,C]of l)_ in p&&(p[_]=fp(C,t,"".concat(r,"/").concat(_),p[_],i));if(!oe.IsTransform(e.unevaluatedProperties))return p;let h=Object.getOwnPropertyNames(p),y=e.unevaluatedProperties,b=R({},p);for(let _ of h)c.includes(_)||(b[_]=Ws(y,"".concat(r,"/").concat(_),b[_]));return b}o(awe,"FromIntersect");function lwe(e,t,r,n){return Ws(e.not,r,Ws(e,r,n))}o(lwe,"FromNot");function uwe(e,t,r,n,i){let s=Ws(e,r,n);if(!Jr.IsObject(s))return s;let l=Yo(e),c=R({},s);for(let b of l)Jr.HasPropertyKey(c,b)&&(Jr.IsUndefined(c[b])&&(!oe.IsUndefined(e.properties[b])||Mn.IsExactOptionalProperty(c,b))||(c[b]=fp(e.properties[b],t,"".concat(r,"/").concat(b),c[b],i)));if(!oe.IsSchema(e.additionalProperties))return c;let p=Object.getOwnPropertyNames(c),h=e.additionalProperties,y=R({},c);for(let b of p)l.includes(b)||(y[b]=Ws(h,"".concat(r,"/").concat(b),y[b]));return y}o(uwe,"FromObject");function cwe(e,t,r,n,i){let s=Ws(e,r,n);if(!Jr.IsObject(n))return s;let l=Object.getOwnPropertyNames(e.patternProperties)[0],c=new RegExp(l),p=R({},s);for(let _ of Object.getOwnPropertyNames(n))c.test(_)&&(p[_]=fp(e.patternProperties[l],t,"".concat(r,"/").concat(_),p[_],i));if(!oe.IsSchema(e.additionalProperties))return p;let h=Object.getOwnPropertyNames(p),y=e.additionalProperties,b=R({},p);for(let _ of h)c.test(_)||(b[_]=Ws(y,"".concat(r,"/").concat(_),b[_]));return b}o(cwe,"FromRecord");function pwe(e,t,r,n,i){let s=Tg(e,t),l=fp(s,t,r,n,i);return Ws(e,r,l)}o(pwe,"FromRef");function fwe(e,t,r,n,i){let s=Tg(e,t),l=fp(s,t,r,n,i);return Ws(e,r,l)}o(fwe,"FromThis");function dwe(e,t,r,n,i){let s=Ws(e,r,n);return Jr.IsArray(e.items)?e.items.map((l,c)=>fp(l,t,"".concat(r,"/").concat(c),s[c],i)):[]}o(dwe,"FromTuple");function hwe(e,t,r,n,i){for(let s of e.anyOf){if(!kf.Check(s,t,n))continue;let l=fp(s,t,r,n,i);return Ws(e,r,l)}for(let s of e.anyOf){let l=fp(s,t,r,n,i);if(kf.Check(e,t,l))return Ws(e,r,l)}return Ws(e,r,n)}o(hwe,"FromUnion");function fp(e,t,r,n,i){if(!i.HasTransform(e,t))return n;let s=uP(e,t),l=e;switch(e[xe]){case"Array":return swe(l,s,r,n,i);case"Intersect":return awe(l,s,r,n,i);case"Not":return lwe(l,s,r,n);case"Object":return uwe(l,s,r,n,i);case"Record":return cwe(l,s,r,n,i);case"Ref":return pwe(l,s,r,n,i);case"This":return fwe(l,s,r,n,i);case"Tuple":return dwe(l,s,r,n,i);case"Union":return hwe(l,s,r,n,i);default:return Ws(l,r,n)}}o(fp,"Visit");function UJ(e,t,r){let n=cP();return fp(e,t,"",r,n)}o(UJ,"FastTransformEncode");g();var pA=class pA{constructor(t,r,n,i){this.schema=t,this.references=r,this.checkFunc=n,this.code=i,this.hasTransform=cp(t,r)}Code(){return this.code}Errors(t){return op(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new F1(this.schema,t,this.Errors(t).First());return this.hasTransform?N1(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?tP(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new k1(this.schema,t,this.Errors(t).First());return r}};o(pA,"TypeCheck");var aA=pA,Rf;(function(e){function t(s){return s===36}o(t,"DollarSign"),e.DollarSign=t;function r(s){return s===95}o(r,"IsUnderscore"),e.IsUnderscore=r;function n(s){return s>=65&&s<=90||s>=97&&s<=122}o(n,"IsAlpha"),e.IsAlpha=n;function i(s){return s>=48&&s<=57}o(i,"IsNumeric"),e.IsNumeric=i})(Rf||(Rf={}));var pP;(function(e){function t(s){return s.length===0?!1:Rf.IsNumeric(s.charCodeAt(0))}o(t,"IsFirstCharacterNumeric");function r(s){if(t(s))return!1;for(let l=0;l<s.length;l++){let c=s.charCodeAt(l);if(!(Rf.IsAlpha(c)||Rf.IsNumeric(c)||Rf.DollarSign(c)||Rf.IsUnderscore(c)))return!1}return!0}o(r,"IsAccessor");function n(s){return s.replace(/'/g,"\\'")}o(n,"EscapeHyphen");function i(s,l){return r(l)?"".concat(s,".").concat(l):"".concat(s,"['").concat(n(l),"']")}o(i,"Encode"),e.Encode=i})(pP||(pP={}));var lA;(function(e){function t(r){let n=[];for(let i=0;i<r.length;i++){let s=r.charCodeAt(i);Rf.IsNumeric(s)||Rf.IsAlpha(s)?n.push(r.charAt(i)):n.push("_".concat(s,"_"))}return n.join("").replace(/__/g,"_")}o(t,"Encode"),e.Encode=t})(lA||(lA={}));var uA;(function(e){function t(r){return r.replace(/'/g,"\\'")}o(t,"Escape"),e.Escape=t})(uA||(uA={}));var fA=class fA extends Mt{constructor(t){super("Unknown type"),this.schema=t}};o(fA,"TypeCompilerUnknownTypeError");var cA=fA,dA=class dA extends Mt{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};o(dA,"TypeCompilerTypeGuardError");var fP=dA,Eg;(function(e){function t(l,c,p){return Mn.ExactOptionalPropertyTypes?"('".concat(c,"' in ").concat(l," ? ").concat(p," : true)"):"(".concat(pP.Encode(l,c)," !== undefined ? ").concat(p," : true)")}o(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(l){return Mn.AllowArrayObject?"(typeof ".concat(l," === 'object' && ").concat(l," !== null)"):"(typeof ".concat(l," === 'object' && ").concat(l," !== null && !Array.isArray(").concat(l,"))")}o(r,"IsObjectLike"),e.IsObjectLike=r;function n(l){return Mn.AllowArrayObject?"(typeof ".concat(l," === 'object' && ").concat(l," !== null && !(").concat(l," instanceof Date) && !(").concat(l," instanceof Uint8Array))"):"(typeof ".concat(l," === 'object' && ").concat(l," !== null && !Array.isArray(").concat(l,") && !(").concat(l," instanceof Date) && !(").concat(l," instanceof Uint8Array))")}o(n,"IsRecordLike"),e.IsRecordLike=n;function i(l){return Mn.AllowNaN?"typeof ".concat(l," === 'number'"):"Number.isFinite(".concat(l,")")}o(i,"IsNumberLike"),e.IsNumberLike=i;function s(l){return Mn.AllowNullVoid?"(".concat(l," === undefined || ").concat(l," === null)"):"".concat(l," === undefined")}o(s,"IsVoidLike"),e.IsVoidLike=s})(Eg||(Eg={}));var dP;(function(e){function t(H){return H[xe]==="Any"||H[xe]==="Unknown"}o(t,"IsAnyOrUnknown");function*r(H,ie,ee){yield"true"}o(r,"FromAny");function*n(H,ie,ee){yield"Array.isArray(".concat(ee,")");let[Me,Ne]=[Ae("value","any"),Ae("acc","number")];_t(H.maxItems)&&(yield"".concat(ee,".length <= ").concat(H.maxItems)),_t(H.minItems)&&(yield"".concat(ee,".length >= ").concat(H.minItems));let Oe=Q(H.items,ie,"value");if(yield"".concat(ee,".every((").concat(Me,") => ").concat(Oe,")"),en(H.contains)||_t(H.minContains)||_t(H.maxContains)){let Ze=en(H.contains)?H.contains:Nn(),Pt=Q(Ze,ie,"value"),Er=_t(H.minContains)?["(count >= ".concat(H.minContains,")")]:[],$n=_t(H.maxContains)?["(count <= ".concat(H.maxContains,")")]:[],ot="const count = value.reduce((".concat(Ne,", ").concat(Me,") => ").concat(Pt," ? acc + 1 : acc, 0)"),zt=["(count > 0)",...Er,...$n].join(" && ");yield"((".concat(Me,") => { ").concat(ot,"; return ").concat(zt,"})(").concat(ee,")")}if(H.uniqueItems===!0){let Pt="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(Me,") => { ").concat(Pt," )(").concat(ee,")")}}o(n,"FromArray");function*i(H,ie,ee){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(ee,")")}o(i,"FromAsyncIterator");function*s(H,ie,ee){yield"(typeof ".concat(ee," === 'bigint')"),gs(H.exclusiveMaximum)&&(yield"".concat(ee," < BigInt(").concat(H.exclusiveMaximum,")")),gs(H.exclusiveMinimum)&&(yield"".concat(ee," > BigInt(").concat(H.exclusiveMinimum,")")),gs(H.maximum)&&(yield"".concat(ee," <= BigInt(").concat(H.maximum,")")),gs(H.minimum)&&(yield"".concat(ee," >= BigInt(").concat(H.minimum,")")),gs(H.multipleOf)&&(yield"(".concat(ee," % BigInt(").concat(H.multipleOf,")) === 0"))}o(s,"FromBigInt");function*l(H,ie,ee){yield"(typeof ".concat(ee," === 'boolean')")}o(l,"FromBoolean");function*c(H,ie,ee){yield*Ve(ve(H.returns,ie,"".concat(ee,".prototype")))}o(c,"FromConstructor");function*p(H,ie,ee){yield"(".concat(ee," instanceof Date) && Number.isFinite(").concat(ee,".getTime())"),_t(H.exclusiveMaximumTimestamp)&&(yield"".concat(ee,".getTime() < ").concat(H.exclusiveMaximumTimestamp)),_t(H.exclusiveMinimumTimestamp)&&(yield"".concat(ee,".getTime() > ").concat(H.exclusiveMinimumTimestamp)),_t(H.maximumTimestamp)&&(yield"".concat(ee,".getTime() <= ").concat(H.maximumTimestamp)),_t(H.minimumTimestamp)&&(yield"".concat(ee,".getTime() >= ").concat(H.minimumTimestamp)),_t(H.multipleOfTimestamp)&&(yield"(".concat(ee,".getTime() % ").concat(H.multipleOfTimestamp,") === 0"))}o(p,"FromDate");function*h(H,ie,ee){yield"(typeof ".concat(ee," === 'function')")}o(h,"FromFunction");function*y(H,ie,ee){yield"Number.isInteger(".concat(ee,")"),_t(H.exclusiveMaximum)&&(yield"".concat(ee," < ").concat(H.exclusiveMaximum)),_t(H.exclusiveMinimum)&&(yield"".concat(ee," > ").concat(H.exclusiveMinimum)),_t(H.maximum)&&(yield"".concat(ee," <= ").concat(H.maximum)),_t(H.minimum)&&(yield"".concat(ee," >= ").concat(H.minimum)),_t(H.multipleOf)&&(yield"(".concat(ee," % ").concat(H.multipleOf,") === 0"))}o(y,"FromInteger");function*b(H,ie,ee){let Me=H.allOf.map(Ne=>Q(Ne,ie,ee)).join(" && ");if(H.unevaluatedProperties===!1){let Ne=Ye("".concat(new RegExp(Of(H)),";")),Oe="Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Ne,".test(key))");yield"(".concat(Me," && ").concat(Oe,")")}else if(en(H.unevaluatedProperties)){let Ne=Ye("".concat(new RegExp(Of(H)),";")),Oe="Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Ne,".test(key) || ").concat(Q(H.unevaluatedProperties,ie,"".concat(ee,"[key]")),")");yield"(".concat(Me," && ").concat(Oe,")")}else yield"(".concat(Me,")")}o(b,"FromIntersect");function*_(H,ie,ee){yield"(typeof value === 'object' && Symbol.iterator in ".concat(ee,")")}o(_,"FromIterator");function*C(H,ie,ee){typeof H.const=="number"||typeof H.const=="boolean"?yield"(".concat(ee," === ").concat(H.const,")"):yield"(".concat(ee," === '").concat(uA.Escape(H.const),"')")}o(C,"FromLiteral");function*P(H,ie,ee){yield"false"}o(P,"FromNever");function*E(H,ie,ee){let Me=Q(H.not,ie,ee);yield"(!".concat(Me,")")}o(E,"FromNot");function*w(H,ie,ee){yield"(".concat(ee," === null)")}o(w,"FromNull");function*O(H,ie,ee){yield Eg.IsNumberLike(ee),_t(H.exclusiveMaximum)&&(yield"".concat(ee," < ").concat(H.exclusiveMaximum)),_t(H.exclusiveMinimum)&&(yield"".concat(ee," > ").concat(H.exclusiveMinimum)),_t(H.maximum)&&(yield"".concat(ee," <= ").concat(H.maximum)),_t(H.minimum)&&(yield"".concat(ee," >= ").concat(H.minimum)),_t(H.multipleOf)&&(yield"(".concat(ee," % ").concat(H.multipleOf,") === 0"))}o(O,"FromNumber");function*D(H,ie,ee){yield Eg.IsObjectLike(ee),_t(H.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length >= ").concat(H.minProperties)),_t(H.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length <= ").concat(H.maxProperties));let Me=Object.getOwnPropertyNames(H.properties);for(let Ne of Me){let Oe=pP.Encode(ee,Ne),Ze=H.properties[Ne];if(H.required&&H.required.includes(Ne))yield*Ve(ve(Ze,ie,Oe)),(Af(Ze)||t(Ze))&&(yield"('".concat(Ne,"' in ").concat(ee,")"));else{let Pt=Q(Ze,ie,Oe);yield Eg.IsExactOptionalProperty(ee,Ne,Pt)}}if(H.additionalProperties===!1)if(H.required&&H.required.length===Me.length)yield"Object.getOwnPropertyNames(".concat(ee,").length === ").concat(Me.length);else{let Ne="[".concat(Me.map(Oe=>"'".concat(Oe,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Ne,".includes(key))")}if(typeof H.additionalProperties=="object"){let Ne=Q(H.additionalProperties,ie,"".concat(ee,"[key]")),Oe="[".concat(Me.map(Ze=>"'".concat(Ze,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Oe,".includes(key) || ").concat(Ne,"))")}}o(D,"FromObject");function*A(H,ie,ee){yield"(typeof value === 'object' && typeof ".concat(ee,".then === 'function')")}o(A,"FromPromise");function*k(H,ie,ee){yield Eg.IsRecordLike(ee),_t(H.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length >= ").concat(H.minProperties)),_t(H.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length <= ").concat(H.maxProperties));let[Me,Ne]=Object.entries(H.patternProperties)[0],Oe=Ye("".concat(new RegExp(Me))),Ze=Q(Ne,ie,"value"),Pt=en(H.additionalProperties)?Q(H.additionalProperties,ie,ee):H.additionalProperties===!1?"false":"true",Er="(".concat(Oe,".test(key) ? ").concat(Ze," : ").concat(Pt,")");yield"(Object.entries(".concat(ee,").every(([key, value]) => ").concat(Er,"))")}o(k,"FromRecord");function*j(H,ie,ee){let Me=cn(H,ie);if(Te.functions.has(H.$ref))return yield"".concat(Qe(H.$ref),"(").concat(ee,")");yield*Ve(ve(Me,ie,ee))}o(j,"FromRef");function*W(H,ie,ee){let Me=Ye("".concat(new RegExp(H.source,H.flags),";"));yield"(typeof ".concat(ee," === 'string')"),_t(H.maxLength)&&(yield"".concat(ee,".length <= ").concat(H.maxLength)),_t(H.minLength)&&(yield"".concat(ee,".length >= ").concat(H.minLength)),yield"".concat(Me,".test(").concat(ee,")")}o(W,"FromRegExp");function*Y(H,ie,ee){if(yield"(typeof ".concat(ee," === 'string')"),_t(H.maxLength)&&(yield"".concat(ee,".length <= ").concat(H.maxLength)),_t(H.minLength)&&(yield"".concat(ee,".length >= ").concat(H.minLength)),H.pattern!==void 0){let Me=Ye("".concat(new RegExp(H.pattern),";"));yield"".concat(Me,".test(").concat(ee,")")}H.format!==void 0&&(yield"format('".concat(H.format,"', ").concat(ee,")"))}o(Y,"FromString");function*N(H,ie,ee){yield"(typeof ".concat(ee," === 'symbol')")}o(N,"FromSymbol");function*Z(H,ie,ee){yield"(typeof ".concat(ee," === 'string')");let Me=Ye("".concat(new RegExp(H.pattern),";"));yield"".concat(Me,".test(").concat(ee,")")}o(Z,"FromTemplateLiteral");function*le(H,ie,ee){yield"".concat(Qe(H.$ref),"(").concat(ee,")")}o(le,"FromThis");function*se(H,ie,ee){if(yield"Array.isArray(".concat(ee,")"),H.items===void 0)return yield"".concat(ee,".length === 0");yield"(".concat(ee,".length === ").concat(H.maxItems,")");for(let Me=0;Me<H.items.length;Me++){let Ne=Q(H.items[Me],ie,"".concat(ee,"[").concat(Me,"]"));yield"".concat(Ne)}}o(se,"FromTuple");function*U(H,ie,ee){yield"".concat(ee," === undefined")}o(U,"FromUndefined");function*ye(H,ie,ee){let Me=H.anyOf.map(Ne=>Q(Ne,ie,ee));yield"(".concat(Me.join(" || "),")")}o(ye,"FromUnion");function*ne(H,ie,ee){yield"".concat(ee," instanceof Uint8Array"),_t(H.maxByteLength)&&(yield"(".concat(ee,".length <= ").concat(H.maxByteLength,")")),_t(H.minByteLength)&&(yield"(".concat(ee,".length >= ").concat(H.minByteLength,")"))}o(ne,"FromUint8Array");function*Ce(H,ie,ee){yield"true"}o(Ce,"FromUnknown");function*Ie(H,ie,ee){yield Eg.IsVoidLike(ee)}o(Ie,"FromVoid");function*Ue(H,ie,ee){let Me=Te.instances.size;Te.instances.set(Me,H),yield"kind('".concat(H[xe],"', ").concat(Me,", ").concat(ee,")")}o(Ue,"FromKind");function*ve(H,ie,ee,Me=!0){let Ne=Qr(H.$id)?[...ie,H]:ie,Oe=H;if(Me&&Qr(H.$id)){let Ze=Qe(H.$id);if(Te.functions.has(Ze))return yield"".concat(Ze,"(").concat(ee,")");{let Pt=nt(Ze,H,ie,"value",!1);return Te.functions.set(Ze,Pt),yield"".concat(Ze,"(").concat(ee,")")}}switch(Oe[xe]){case"Any":return yield*Ve(r(Oe,Ne,ee));case"Array":return yield*Ve(n(Oe,Ne,ee));case"AsyncIterator":return yield*Ve(i(Oe,Ne,ee));case"BigInt":return yield*Ve(s(Oe,Ne,ee));case"Boolean":return yield*Ve(l(Oe,Ne,ee));case"Constructor":return yield*Ve(c(Oe,Ne,ee));case"Date":return yield*Ve(p(Oe,Ne,ee));case"Function":return yield*Ve(h(Oe,Ne,ee));case"Integer":return yield*Ve(y(Oe,Ne,ee));case"Intersect":return yield*Ve(b(Oe,Ne,ee));case"Iterator":return yield*Ve(_(Oe,Ne,ee));case"Literal":return yield*Ve(C(Oe,Ne,ee));case"Never":return yield*Ve(P(Oe,Ne,ee));case"Not":return yield*Ve(E(Oe,Ne,ee));case"Null":return yield*Ve(w(Oe,Ne,ee));case"Number":return yield*Ve(O(Oe,Ne,ee));case"Object":return yield*Ve(D(Oe,Ne,ee));case"Promise":return yield*Ve(A(Oe,Ne,ee));case"Record":return yield*Ve(k(Oe,Ne,ee));case"Ref":return yield*Ve(j(Oe,Ne,ee));case"RegExp":return yield*Ve(W(Oe,Ne,ee));case"String":return yield*Ve(Y(Oe,Ne,ee));case"Symbol":return yield*Ve(N(Oe,Ne,ee));case"TemplateLiteral":return yield*Ve(Z(Oe,Ne,ee));case"This":return yield*Ve(le(Oe,Ne,ee));case"Tuple":return yield*Ve(se(Oe,Ne,ee));case"Undefined":return yield*Ve(U(Oe,Ne,ee));case"Union":return yield*Ve(ye(Oe,Ne,ee));case"Uint8Array":return yield*Ve(ne(Oe,Ne,ee));case"Unknown":return yield*Ve(Ce(Oe,Ne,ee));case"Void":return yield*Ve(Ie(Oe,Ne,ee));default:if(!Mo.Has(Oe[xe]))throw new cA(H);return yield*Ve(Ue(Oe,Ne,ee))}}o(ve,"Visit");let Te={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Q(H,ie,ee,Me=!0){return"(".concat([...ve(H,ie,ee,Me)].join(" && "),")")}o(Q,"CreateExpression");function Qe(H){return"check_".concat(lA.Encode(H))}o(Qe,"CreateFunctionName");function Ye(H){let ie="local_".concat(Te.variables.size);return Te.variables.set(ie,"const ".concat(ie," = ").concat(H)),ie}o(Ye,"CreateVariable");function nt(H,ie,ee,Me,Ne=!0){let[Oe,Ze]=["\n",ot=>"".padStart(ot," ")],Pt=Ae("value","any"),Er=Be("boolean"),$n=[...ve(ie,ee,Me,Ne)].map(ot=>"".concat(Ze(4)).concat(ot)).join(" &&".concat(Oe));return"function ".concat(H,"(").concat(Pt,")").concat(Er," {").concat(Oe).concat(Ze(2),"return (").concat(Oe).concat($n).concat(Oe).concat(Ze(2),")\n}")}o(nt,"CreateFunction");function Ae(H,ie){let ee=Te.language==="typescript"?": ".concat(ie):"";return"".concat(H).concat(ee)}o(Ae,"CreateParameter");function Be(H){return Te.language==="typescript"?": ".concat(H):""}o(Be,"CreateReturns");function We(H,ie,ee){let Me=nt("check",H,ie,"value"),Ne=Ae("value","any"),Oe=Be("boolean"),Ze=[...Te.functions.values()],Pt=[...Te.variables.values()],Er=Qr(H.$id)?"return function check(".concat(Ne,")").concat(Oe," {\n return ").concat(Qe(H.$id),"(value)\n}"):"return ".concat(Me);return[...Pt,...Ze,Er].join("\n")}o(We,"Build");function $e(...H){let ie={language:"javascript"},[ee,Me,Ne]=H.length===2&&Bt(H[1])?[H[0],H[1],ie]:H.length===2&&!Bt(H[1])?[H[0],[],H[1]]:H.length===3?[H[0],H[1],H[2]]:H.length===1?[H[0],[],ie]:[null,[],ie];if(Te.language=Ne.language,Te.variables.clear(),Te.functions.clear(),Te.instances.clear(),!en(ee))throw new fP(ee);for(let Oe of Me)if(!en(Oe))throw new fP(Oe);return We(ee,Me,Ne)}o($e,"Code"),e.Code=$e;function we(H,ie=[]){let ee=$e(H,ie,{language:"javascript"}),Me=globalThis.Function("kind","format","hash",ee),Ne=new Map(Te.instances);function Oe($n,ot,zt){if(!Mo.Has($n)||!Ne.has(ot))return!1;let es=Mo.Get($n),Ro=Ne.get(ot);return es(Ro,zt)}o(Oe,"typeRegistryFunction");function Ze($n,ot){return ga.Has($n)?ga.Get($n)(ot):!1}o(Ze,"formatRegistryFunction");function Pt($n){return yh($n)}o(Pt,"hashFunction");let Er=Me(Oe,Ze,Pt);return new aA(H,ie,Er,ee)}o(we,"Compile"),e.Compile=we})(dP||(dP={}));g();g();var VJ={},mwe=o(function(e,t,r,n,i){var s=new Worker(VJ[t]||(VJ[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 s.onmessage=function(l){var c=l.data,p=c.$e$;if(p){var h=new Error(p[0]);h.code=p[1],h.stack=p[2],i(h,null)}else i(null,c)},s.postMessage(r,n),s},"wk"),ii=Uint8Array,va=Uint16Array,MI=Int32Array,$1=new ii([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]),G1=new ii([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]),TI=new ii([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),WJ=o(function(e,t){for(var r=new va(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new MI(r[30]),n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return{b:r,r:i}},"freb"),XJ=WJ($1,2),xA=XJ.b,vP=XJ.r;xA[28]=258,vP[258]=28;var YJ=WJ(G1,0),ZJ=YJ.b,mA=YJ.r,EI=new va(32768);for(wn=0;wn<32768;++wn)Bf=(wn&43690)>>1|(wn&21845)<<1,Bf=(Bf&52428)>>2|(Bf&13107)<<2,Bf=(Bf&61680)>>4|(Bf&3855)<<4,EI[wn]=((Bf&65280)>>8|(Bf&255)<<8)>>1;var Bf,wn,ru=o(function(e,t,r){for(var n=e.length,i=0,s=new va(t);i<n;++i)e[i]&&++s[e[i]-1];var l=new va(t);for(i=1;i<t;++i)l[i]=l[i-1]+s[i-1]<<1;var c;if(r){c=new va(1<<t);var p=15-t;for(i=0;i<n;++i)if(e[i])for(var h=i<<4|e[i],y=t-e[i],b=l[e[i]-1]++<<y,_=b|(1<<y)-1;b<=_;++b)c[EI[b]>>p]=h}else for(c=new va(n),i=0;i<n;++i)e[i]&&(c[i]=EI[l[e[i]-1]++]>>15-e[i]);return c},"hMap"),jf=new ii(288);for(wn=0;wn<144;++wn)jf[wn]=8;var wn;for(wn=144;wn<256;++wn)jf[wn]=9;var wn;for(wn=256;wn<280;++wn)jf[wn]=7;var wn;for(wn=280;wn<288;++wn)jf[wn]=8;var wn,j1=new ii(32);for(wn=0;wn<32;++wn)j1[wn]=5;var wn,KJ=ru(jf,9,0),JJ=ru(jf,9,1),QJ=ru(j1,5,0),eQ=ru(j1,5,1),mP=o(function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},"max"),tu=o(function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},"bits"),gP=o(function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},"bits16"),OI=o(function(e){return(e+7)/8|0},"shft"),Mg=o(function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new ii(e.subarray(t,r))},"slc"),_P={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},tQ=["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"],go=o(function(e,t,r){var n=new Error(t||tQ[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,go),!r)throw n;return n},"err"),rQ=o(function(e,t,r,n){var i=e.length,s=n?n.length:0;if(!i||t.f&&!t.l)return r||new ii(0);var l=!r,c=l||t.i!=2,p=t.i;l&&(r=new ii(i*3));var h=o(function(ee){var Me=r.length;if(ee>Me){var Ne=new ii(Math.max(Me*2,ee));Ne.set(r),r=Ne}},"cbuf"),y=t.f||0,b=t.p||0,_=t.b||0,C=t.l,P=t.d,E=t.m,w=t.n,O=i*8;do{if(!C){y=tu(e,b,1);var D=tu(e,b+1,3);if(b+=3,D)if(D==1)C=JJ,P=eQ,E=9,w=5;else if(D==2){var W=tu(e,b,31)+257,Y=tu(e,b+10,15)+4,N=W+tu(e,b+5,31)+1;b+=14;for(var Z=new ii(N),le=new ii(19),se=0;se<Y;++se)le[TI[se]]=tu(e,b+se*3,7);b+=Y*3;for(var U=mP(le),ye=(1<<U)-1,ne=ru(le,U,1),se=0;se<N;){var Ce=ne[tu(e,b,ye)];b+=Ce&15;var A=Ce>>4;if(A<16)Z[se++]=A;else{var Ie=0,Ue=0;for(A==16?(Ue=3+tu(e,b,3),b+=2,Ie=Z[se-1]):A==17?(Ue=3+tu(e,b,7),b+=3):A==18&&(Ue=11+tu(e,b,127),b+=7);Ue--;)Z[se++]=Ie}}var ve=Z.subarray(0,W),Te=Z.subarray(W);E=mP(ve),w=mP(Te),C=ru(ve,E,1),P=ru(Te,w,1)}else go(1);else{var A=OI(b)+4,k=e[A-4]|e[A-3]<<8,j=A+k;if(j>i){p&&go(0);break}c&&h(_+k),r.set(e.subarray(A,j),_),t.b=_+=k,t.p=b=j*8,t.f=y;continue}if(b>O){p&&go(0);break}}c&&h(_+131072);for(var Q=(1<<E)-1,Qe=(1<<w)-1,Ye=b;;Ye=b){var Ie=C[gP(e,b)&Q],nt=Ie>>4;if(b+=Ie&15,b>O){p&&go(0);break}if(Ie||go(2),nt<256)r[_++]=nt;else if(nt==256){Ye=b,C=null;break}else{var Ae=nt-254;if(nt>264){var se=nt-257,Be=$1[se];Ae=tu(e,b,(1<<Be)-1)+xA[se],b+=Be}var We=P[gP(e,b)&Qe],$e=We>>4;We||go(3),b+=We&15;var Te=ZJ[$e];if($e>3){var Be=G1[$e];Te+=gP(e,b)&(1<<Be)-1,b+=Be}if(b>O){p&&go(0);break}c&&h(_+131072);var we=_+Ae;if(_<Te){var H=s-Te,ie=Math.min(Te,we);for(H+_<0&&go(3);_<ie;++_)r[_]=n[H+_]}for(;_<we;++_)r[_]=r[_-Te]}}t.l=C,t.p=Ye,t.b=_,t.f=y,C&&(y=1,t.m=E,t.d=P,t.n=w)}while(!y);return _!=r.length&&l?Mg(r,0,_):r.subarray(0,_)},"inflt"),dp=o(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},"wbits"),R1=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"),yP=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,s=r.slice();if(!i)return{t:_A,l:0};if(i==1){var l=new ii(r[0].s+1);return l[r[0].s]=1,{t:l,l:1}}r.sort(function(j,W){return j.f-W.f}),r.push({s:-1,f:25001});var c=r[0],p=r[1],h=0,y=1,b=2;for(r[0]={s:-1,f:c.f+p.f,l:c,r:p};y!=i-1;)c=r[r[h].f<r[b].f?h++:b++],p=r[h!=y&&r[h].f<r[b].f?h++:b++],r[y++]={s:-1,f:c.f+p.f,l:c,r:p};for(var _=s[0].s,n=1;n<i;++n)s[n].s>_&&(_=s[n].s);var C=new va(_+1),P=bP(r[y-1],C,0);if(P>t){var n=0,E=0,w=P-t,O=1<<w;for(s.sort(function(W,Y){return C[Y.s]-C[W.s]||W.f-Y.f});n<i;++n){var D=s[n].s;if(C[D]>t)E+=O-(1<<P-C[D]),C[D]=t;else break}for(E>>=w;E>0;){var A=s[n].s;C[A]<t?E-=1<<t-C[A]++-1:++n}for(;n>=0&&E;--n){var k=s[n].s;C[k]==t&&(--C[k],++E)}P=t}return{t:new ii(C),l:P}},"hTree"),bP=o(function(e,t,r){return e.s==-1?Math.max(bP(e.l,t,r+1),bP(e.r,t,r+1)):t[e.s]=r},"ln"),gA=o(function(e){for(var t=e.length;t&&!e[--t];);for(var r=new va(++t),n=0,i=e[0],s=1,l=o(function(p){r[n++]=p},"w"),c=1;c<=t;++c)if(e[c]==i&&c!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(i),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(i);s=1,i=e[c]}return{c:r.subarray(0,n),n:t}},"lc"),B1=o(function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},"clen"),IA=o(function(e,t,r){var n=r.length,i=OI(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 s=0;s<n;++s)e[i+s+4]=r[s];return(i+4+n)*8},"wfblk"),yA=o(function(e,t,r,n,i,s,l,c,p,h,y){dp(t,y++,r),++i[256];for(var b=yP(i,15),_=b.t,C=b.l,P=yP(s,15),E=P.t,w=P.l,O=gA(_),D=O.c,A=O.n,k=gA(E),j=k.c,W=k.n,Y=new va(19),N=0;N<D.length;++N)++Y[D[N]&31];for(var N=0;N<j.length;++N)++Y[j[N]&31];for(var Z=yP(Y,7),le=Z.t,se=Z.l,U=19;U>4&&!le[TI[U-1]];--U);var ye=h+5<<3,ne=B1(i,jf)+B1(s,j1)+l,Ce=B1(i,_)+B1(s,E)+l+14+3*U+B1(Y,le)+2*Y[16]+3*Y[17]+7*Y[18];if(p>=0&&ye<=ne&&ye<=Ce)return IA(t,y,e.subarray(p,p+h));var Ie,Ue,ve,Te;if(dp(t,y,1+(Ce<ne)),y+=2,Ce<ne){Ie=ru(_,C,0),Ue=_,ve=ru(E,w,0),Te=E;var Q=ru(le,se,0);dp(t,y,A-257),dp(t,y+5,W-1),dp(t,y+10,U-4),y+=14;for(var N=0;N<U;++N)dp(t,y+3*N,le[TI[N]]);y+=3*U;for(var Qe=[D,j],Ye=0;Ye<2;++Ye)for(var nt=Qe[Ye],N=0;N<nt.length;++N){var Ae=nt[N]&31;dp(t,y,Q[Ae]),y+=le[Ae],Ae>15&&(dp(t,y,nt[N]>>5&127),y+=nt[N]>>12)}}else Ie=KJ,Ue=jf,ve=QJ,Te=j1;for(var N=0;N<c;++N){var Be=n[N];if(Be>255){var Ae=Be>>18&31;R1(t,y,Ie[Ae+257]),y+=Ue[Ae+257],Ae>7&&(dp(t,y,Be>>23&31),y+=$1[Ae]);var We=Be&31;R1(t,y,ve[We]),y+=Te[We],We>3&&(R1(t,y,Be>>5&8191),y+=G1[We])}else R1(t,y,Ie[Be]),y+=Ue[Be]}return R1(t,y,Ie[256]),y+Ue[256]},"wblk"),nQ=new MI([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),_A=new ii(0),iQ=o(function(e,t,r,n,i,s){var l=s.z||e.length,c=new ii(n+l+5*(1+Math.ceil(l/7e3))+i),p=c.subarray(n,c.length-i),h=s.l,y=(s.r||0)&7;if(t){y&&(p[0]=s.r>>3);for(var b=nQ[t-1],_=b>>13,C=b&8191,P=(1<<r)-1,E=s.p||new va(32768),w=s.h||new va(P+1),O=Math.ceil(r/3),D=2*O,A=o(function(Oe){return(e[Oe]^e[Oe+1]<<O^e[Oe+2]<<D)&P},"hsh"),k=new MI(25e3),j=new va(288),W=new va(32),Y=0,N=0,Z=s.i||0,le=0,se=s.w||0,U=0;Z+2<l;++Z){var ye=A(Z),ne=Z&32767,Ce=w[ye];if(E[ne]=Ce,w[ye]=ne,se<=Z){var Ie=l-Z;if((Y>7e3||le>24576)&&(Ie>423||!h)){y=yA(e,p,0,k,j,W,N,le,U,Z-U,y),le=Y=N=0,U=Z;for(var Ue=0;Ue<286;++Ue)j[Ue]=0;for(var Ue=0;Ue<30;++Ue)W[Ue]=0}var ve=2,Te=0,Q=C,Qe=ne-Ce&32767;if(Ie>2&&ye==A(Z-Qe))for(var Ye=Math.min(_,Ie)-1,nt=Math.min(32767,Z),Ae=Math.min(258,Ie);Qe<=nt&&--Q&&ne!=Ce;){if(e[Z+ve]==e[Z+ve-Qe]){for(var Be=0;Be<Ae&&e[Z+Be]==e[Z+Be-Qe];++Be);if(Be>ve){if(ve=Be,Te=Qe,Be>Ye)break;for(var We=Math.min(Qe,Be-2),$e=0,Ue=0;Ue<We;++Ue){var we=Z-Qe+Ue&32767,H=E[we],ie=we-H&32767;ie>$e&&($e=ie,Ce=we)}}}ne=Ce,Ce=E[ne],Qe+=ne-Ce&32767}if(Te){k[le++]=268435456|vP[ve]<<18|mA[Te];var ee=vP[ve]&31,Me=mA[Te]&31;N+=$1[ee]+G1[Me],++j[257+ee],++W[Me],se=Z+ve,++Y}else k[le++]=e[Z],++j[e[Z]]}}for(Z=Math.max(Z,se);Z<l;++Z)k[le++]=e[Z],++j[e[Z]];y=yA(e,p,h,k,j,W,N,le,U,Z-U,y),h||(s.r=y&7|p[y/8|0]<<3,y-=7,s.h=w,s.p=E,s.i=Z,s.w=se)}else{for(var Z=s.w||0;Z<l+h;Z+=65535){var Ne=Z+65535;Ne>=l&&(p[y/8|0]=h,Ne=l),y=IA(p,y+1,e.subarray(Z,Ne))}s.i=l}return Mg(c,0,n+OI(y)+i)},"dflt"),gwe=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}(),ywe=o(function(){var e=-1;return{p:o(function(t){for(var r=e,n=0;n<t.length;++n)r=gwe[r&255^t[n]]^r>>>8;e=r},"p"),d:o(function(){return~e},"d")}},"crc");var oQ=o(function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),l=new ii(s.length+e.length);l.set(s),l.set(e,s.length),e=l,i.w=s.length}return iQ(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"),SA=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"),zJ=o(function(e,t,r){for(var n=e(),i=e.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),l=0;l<n.length;++l){var c=n[l],p=s[l];if(typeof c=="function"){t+=";"+p+"=";var h=c.toString();if(c.prototype)if(h.indexOf("[native code]")!=-1){var y=h.indexOf(" ",8)+1;t+=h.slice(y,h.indexOf("(",y))}else{t+=h;for(var b in c.prototype)t+=";"+p+".prototype."+b+"="+c.prototype[b].toString()}else t+=h}else r[p]=c}return t},"wcln"),hP=[],vwe=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"),bwe=o(function(e,t,r,n){if(!hP[r]){for(var i="",s={},l=e.length-1,c=0;c<l;++c)i=zJ(e[c],i,s);hP[r]={c:zJ(e[l],i,s),e:s}}var p=SA({},hP[r].e);return mwe(hP[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,p,vwe(p),n)},"wrkr"),xwe=o(function(){return[ii,va,MI,$1,G1,TI,xA,ZJ,JJ,eQ,EI,tQ,ru,mP,tu,gP,OI,Mg,go,rQ,wA,SP,sQ]},"bInflt"),Iwe=o(function(){return[ii,va,MI,$1,G1,TI,vP,mA,KJ,jf,QJ,j1,EI,nQ,_A,ru,dp,R1,yP,bP,gA,B1,IA,yA,OI,Mg,iQ,oQ,CA,SP]},"bDflt");var SP=o(function(e){return postMessage(e,[e.buffer])},"pbf"),sQ=o(function(e){return e&&{out:e.size&&new ii(e.size),dictionary:e.dictionary}},"gopt"),aQ=o(function(e,t,r,n,i,s){var l=bwe(r,n,i,function(c,p){l.terminate(),s(c,p)});return l.postMessage([e,t],t.consume?[e.buffer]:[]),function(){l.terminate()}},"cbify");var hp=o(function(e,t){return e[t]|e[t+1]<<8},"b2"),Xu=o(function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},"b4"),hA=o(function(e,t){return Xu(e,t)+Xu(e,t+4)*4294967296},"b8"),Is=o(function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},"wbytes");function _we(e,t,r){return r||(r=t,t={}),typeof r!="function"&&go(7),aQ(e,t,[Iwe],function(n){return SP(CA(n.data[0],n.data[1]))},0,r)}o(_we,"deflate");function CA(e,t){return oQ(e,t||{},0,0)}o(CA,"deflateSync");function Swe(e,t,r){return r||(r=t,t={}),typeof r!="function"&&go(7),aQ(e,t,[xwe],function(n){return SP(wA(n.data[0],sQ(n.data[1])))},1,r)}o(Swe,"inflate");function wA(e,t){return rQ(e,{i:2},t&&t.out,t&&t.dictionary)}o(wA,"inflateSync");var lQ=o(function(e,t,r,n){for(var i in e){var s=e[i],l=t+i,c=n;Array.isArray(s)&&(c=SA(n,s[1]),s=s[0]),s instanceof ii?r[l]=[s,c]:(r[l+="/"]=[new ii(0),c],lQ(s,l,r,n))}},"fltn"),qJ=typeof TextEncoder<"u"&&new TextEncoder,vA=typeof TextDecoder<"u"&&new TextDecoder,Cwe=0;try{vA.decode(_A,{stream:!0}),Cwe=1}catch(e){}var wwe=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:Mg(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 xP(e,t){if(t){for(var r=new ii(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(qJ)return qJ.encode(e);for(var i=e.length,s=new ii(e.length+(e.length>>1)),l=0,c=o(function(y){s[l++]=y},"w"),n=0;n<i;++n){if(l+5>s.length){var p=new ii(l+8+(i-n<<1));p.set(s),s=p}var h=e.charCodeAt(n);h<128||t?c(h):h<2048?(c(192|h>>6),c(128|h&63)):h>55295&&h<57344?(h=65536+(h&1047552)|e.charCodeAt(++n)&1023,c(240|h>>18),c(128|h>>12&63),c(128|h>>6&63),c(128|h&63)):(c(224|h>>12),c(128|h>>6&63),c(128|h&63))}return Mg(s,0,l)}o(xP,"strToU8");function PA(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(vA)return vA.decode(e);var i=wwe(e),s=i.s,r=i.r;return r.length&&go(8),s}}o(PA,"strFromU8");var Pwe=o(function(e,t){return t+30+hp(e,t+26)+hp(e,t+28)},"slzh"),Twe=o(function(e,t,r){var n=hp(e,t+28),i=PA(e.subarray(t+46,t+46+n),!(hp(e,t+8)&2048)),s=t+46+n,l=Xu(e,t+20),c=r&&l==4294967295?Ewe(e,s):[l,Xu(e,t+24),Xu(e,t+42)],p=c[0],h=c[1],y=c[2];return[hp(e,t+10),p,h,i,s+hp(e,t+30)+hp(e,t+32),y]},"zh"),Ewe=o(function(e,t){for(;hp(e,t)!=1;t+=4+hp(e,t+2));return[hA(e,t+12),hA(e,t+4),hA(e,t+20)]},"z64e"),bA=o(function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&go(9),t+=n+4}return t},"exfl"),HJ=o(function(e,t,r,n,i,s,l,c){var p=n.length,h=r.extra,y=c&&c.length,b=bA(h);Is(e,t,l!=null?33639248:67324752),t+=4,l!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(s<0&&8),e[t++]=i&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var _=new Date(r.mtime==null?Date.now():r.mtime),C=_.getFullYear()-1980;if((C<0||C>119)&&go(10),Is(e,t,C<<25|_.getMonth()+1<<21|_.getDate()<<16|_.getHours()<<11|_.getMinutes()<<5|_.getSeconds()>>1),t+=4,s!=-1&&(Is(e,t,r.crc),Is(e,t+4,s<0?-s-2:s),Is(e,t+8,r.size)),Is(e,t+12,p),Is(e,t+14,b),t+=16,l!=null&&(Is(e,t,y),Is(e,t+6,r.attrs),Is(e,t+10,l),t+=14),e.set(n,t),t+=p,b)for(var P in h){var E=h[P],w=E.length;Is(e,t,+P),Is(e,t+2,w),e.set(E,t+4),t+=4+w}return y&&(e.set(c,t),t+=y),t},"wzh"),Mwe=o(function(e,t,r,n,i){Is(e,t,101010256),Is(e,t+8,r),Is(e,t+10,r),Is(e,t+12,n),Is(e,t+16,i)},"wzf");function uQ(e,t,r){r||(r=t,t={}),typeof r!="function"&&go(7);var n={};lQ(e,"",n,t);var i=Object.keys(n),s=i.length,l=0,c=0,p=s,h=new Array(s),y=[],b=o(function(){for(var w=0;w<y.length;++w)y[w]()},"tAll"),_=o(function(w,O){IP(function(){r(w,O)})},"cbd");IP(function(){_=r});var C=o(function(){var w=new ii(c+22),O=l,D=c-l;c=0;for(var A=0;A<p;++A){var k=h[A];try{var j=k.c.length;HJ(w,c,k,k.f,k.u,j);var W=30+k.f.length+bA(k.extra),Y=c+W;w.set(k.c,Y),HJ(w,l,k,k.f,k.u,j,c,k.m),l+=16+W+(k.m?k.m.length:0),c=Y+j}catch(N){return _(N,null)}}Mwe(w,l,h.length,D,O),_(null,w)},"cbf");s||C();for(var P=o(function(w){var O=i[w],D=n[O],A=D[0],k=D[1],j=ywe(),W=A.length;j.p(A);var Y=xP(O),N=Y.length,Z=k.comment,le=Z&&xP(Z),se=le&&le.length,U=bA(k.extra),ye=k.level==0?0:8,ne=o(function(Ce,Ie){if(Ce)b(),_(Ce,null);else{var Ue=Ie.length;h[w]=SA(k,{size:W,crc:j.d(),c:Ie,f:Y,m:le,u:N!=O.length||le&&Z.length!=se,compression:ye}),l+=30+N+U+Ue,c+=76+2*(N+U)+(se||0)+Ue,--s||C()}},"cbl");if(N>65535&&ne(go(11,0,1),null),!ye)ne(null,A);else if(W<16e4)try{ne(null,CA(A,k))}catch(Ce){ne(Ce,null)}else y.push(_we(A,k,ne))},"_loop_1"),E=0;E<p;++E)P(E);return b}o(uQ,"zip");var IP=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function cQ(e,t,r){r||(r=t,t={}),typeof r!="function"&&go(7);var n=[],i=o(function(){for(var w=0;w<n.length;++w)n[w]()},"tAll"),s={},l=o(function(w,O){IP(function(){r(w,O)})},"cbd");IP(function(){l=r});for(var c=e.length-22;Xu(e,c)!=101010256;--c)if(!c||e.length-c>65558)return l(go(13,0,1),null),i;var p=hp(e,c+8);if(p){var h=p,y=Xu(e,c+16),b=y==4294967295||h==65535;if(b){var _=Xu(e,c-12);b=Xu(e,_)==101075792,b&&(h=p=Xu(e,_+32),y=Xu(e,_+48))}for(var C=t&&t.filter,P=o(function(w){var O=Twe(e,y,b),D=O[0],A=O[1],k=O[2],j=O[3],W=O[4],Y=O[5],N=Pwe(e,Y);y=W;var Z=o(function(se,U){se?(i(),l(se,null)):(U&&(s[j]=U),--p||l(null,s))},"cbl");if(!C||C({name:j,size:A,originalSize:k,compression:D}))if(!D)Z(null,Mg(e,N,N+A));else if(D==8){var le=e.subarray(N,N+A);if(k<524288||A>.8*k)try{Z(null,wA(le,{out:new ii(k)}))}catch(se){Z(se,null)}else n.push(Swe(le,{size:k},Z))}else Z(go(14,"unknown compression type "+D,1),null);else Z(null,null)},"_loop_3"),E=0;E<h;++E)P(E)}else l(null,{});return i}o(cQ,"unzip");g();var Owe=o(e=>{if(e!=null)return e.trim()===""?void 0:e},"maybePath"),Lwe=o(e=>e!=null,"notNull"),CP=o((e,t,r=0)=>{var n;if(oe.IsNull(e))return"null";if(oe.IsUndefined(e))return"undefined";if(oe.IsString(e))return"<string>";if(oe.IsNumber(e))return"<number>";if(oe.IsBoolean(e))return"<boolean>";if(oe.IsLiteral(e))return typeof e.const=="string"?"'".concat(e.const,"'"):"".concat(e.const);if(oe.IsRef(e)){let i=t.find(s=>s.$id===e.$ref);return i==null?e.$ref:CP(i,t,r)}if(oe.IsArray(e))return"".concat(CP(e.items,t,r+1),"[]");if(oe.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let s="".concat(e.anyOf.map(l=>CP(l,t,r+1)).filter(Lwe).join(" | "));return r>0?"(".concat(s,")"):s}return(n=e.$id)!=null?n:""},"resolveSchemaIdent"),Awe=o((e,t,r)=>{var s;let n=t.message;oe.IsUnion(t.schema)&&(n="Expected one of: ".concat(CP(t.schema,r)));let i="#/definitions/".concat(e).concat((s=Owe(t.path))!=null?s:"");return"".concat(i,": ").concat(n)},"errorHandler"),wP=o((e,t,r)=>{let n=t.First();if(n!=null)return Awe(e,n,r)},"shortError");var U1;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(U1||(U1={}));var EA=class EA extends Error{constructor(r,n){super(n);x(this,"name");x(this,"kind");this.name="CompressError",this.kind=r}};o(EA,"CompressError");var V1=EA,Dwe=o(e=>new V1(U1.Archive,e.message),"flateErrorIntoCompressError"),Fwe=o(e=>{let t=Object.values(_P);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),Nwe=o((e,t,r)=>{var n;return new V1(U1.Validate,(n=wP(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoCompressError"),kwe=o(e=>new V1(U1.Encode,e.message),"encodeErrorIntoCompressError"),Rwe=o(e=>new V1(U1.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoCompressError"),TA=o((e,t,r)=>t instanceof wg?kwe(t):t instanceof Jl?Nwe(e,t,r):Fwe(t)?Dwe(t):Rwe(t),"intoCompressError");g();var z1;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(z1||(z1={}));var OA=class OA extends Error{constructor(r,n){super(n);x(this,"name");x(this,"kind");this.name="DecompressError",this.kind=r}};o(OA,"DecompressError");var q1=OA,Bwe=o(e=>new q1(z1.Unarchive,e.message),"flateErrorIntoDecompressError"),jwe=o(e=>{let t=Object.values(_P);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),$we=o((e,t,r)=>{var n;return new q1(z1.Validate,(n=wP(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoDecompressError"),Gwe=o(e=>new q1(z1.Decode,e.message),"decodeErrorIntoDecompressError"),Uwe=o(e=>new q1(z1.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoDecompressError"),MA=o((e,t,r)=>t instanceof Cg?Gwe(t):t instanceof Jl?$we(e,t,r):jwe(t)?Bwe(t):Uwe(t),"intoDecompressError");g();g();g();var Vwe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,zwe=[0,31,28,31,30,31,30,31,31,30,31,30,31],qwe=o(e=>e%4===0&&(e%100!==0||e%400===0),"isLeapYear"),PP=o(e=>{let t=Vwe.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&&qwe(r)?29:zwe[n])},"date");g();var Hwe=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,TP=o(e=>{let t=Hwe.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3],s=t[4],l=t[5]==="-"?-1:1,c=+(t[6]||0),p=+(t[7]||0);if(c>23||p>59||!s)return!1;if(r<=23&&n<=59&&i<60)return!0;let h=n-p*l,y=r-c*l-(h<0?1:0);return(y===23||y===-1)&&(h===59||h===-1)&&i<61},"time");var Wwe=/t|\s/i,pQ=o(e=>{let t=e.split(Wwe);return t.length===2&&PP(t[0])&&TP(t[1])},"dateTime");g();var Xwe=/\/|:/,Ywe=/^(?:[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,fQ=o(e=>Xwe.test(e)&&Ywe.test(e),"uri");var Zwe=[["date",PP],["time",TP],["date-time",pQ],["uri",fQ]],dQ=o(()=>{for(let[e,t]of Zwe)try{Xw.Format(e,t)}catch(r){if(r instanceof SI)continue;throw r}},"registerFormats");g();g();g();var hQ=o(e=>e instanceof Error?e:new Error(String(e)),"asError");var EP=o(e=>(...t)=>{try{return st(e(...t))}catch(r){return ut(hQ(r))}},"safeFn");var Kwe=EP((e,t)=>{let r={};for(let n of t)for(let i of n.intoBundle(e))r[i.path]=xP(JSON.stringify(i.contents));return r}),LA=o(async(e,t,r)=>Kwe(e,t).andThenAsync(n=>new Promise(i=>{uQ(n,re(R({},r),{consume:!0}),(s,l)=>{i(s?ut(s):st(l))})})),"compress");g();g();function MP(e,t,r=[]){let n=R({},e);for(let[i,s]of Object.entries(t))if(s!==void 0)if(i in n){let l=i;if(Array.isArray(s)&&s.length>0){let c=Jwe(s[0],r);if(c){let p=n[l];if(!Array.isArray(p))throw new Error("Expected array at ".concat(i,", got ").concat(typeof p));let h=new Map(s.map(_=>[mQ(_,c),_])),b=p.map(_=>{let C=h.get(mQ(_,c));return C?MP(_,C,r):_});n[l]=b}else n[l]=s}else{let c=n[l];typeof c=="object"&&c!==null&&typeof s=="object"&&s!==null?Object.keys(s).length===0?n[l]=s:n[l]=MP(c,s,r):n[i]=s}}else n[i]=s;return n}o(MP,"deepMergeOn");function Jwe(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,s]of Object.entries(n)){let l=r(s);if(l)return[i,...l]}return null}return o(r,"search"),r(e)}o(Jwe,"findIdentifierKey");function mQ(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}o(mQ,"getValueByKeyPath");var Qwe=o(e=>e,"identity"),ePe=o(e=>JSON.parse(PA(e)),"jsonDecode"),tPe=o((e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,Qwe)!==void 0),"isFileExpected"),rPe=EP((e,t)=>{let r={};for(let n of Object.keys(e)){let i=e[n];for(let s of t){let l=s.fromBundle(n,i,ePe);if(l){r=MP(r,l,[]);break}}}return r}),AA=o(async(e,t)=>new Promise(r=>cQ(e,{filter:o(n=>tPe(n,t),"filter")},(n,i)=>{r(n?ut(n):st(i))})).then(r=>r.andThen(n=>rPe(n,t))),"decompress");g();var nPe=o(e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string","isRef"),iPe=o(e=>{if(e.length<2)return!1;let t=e.filter(nPe);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},"isDuplicateRef"),OP=o(e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&iPe(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,OP(r)])):Array.isArray(e)?e.map(OP):e,"fixDuplicateAllOf");g();var LP=o(e=>typeof e=="object"&&e!=null&&"$ref"in e?re(R({},e),{$ref:"#/definitions/".concat(e.$ref)}):typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,LP(r)])):Array.isArray(e)?e.map(LP):e,"prefixReferences");var H1;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(H1||(H1={}));var oPe=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"),sPe=o((...e)=>{let t=new Map;for(let r of oPe(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return ut({kind:H1.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 st(t)},"computeReferenceMap"),nu,Og,$f,Yu,DP=class DP{constructor(t,r,n,i){G(this,nu);G(this,Og);G(this,$f,[]);G(this,Yu);q(this,nu,t),q(this,Og,r),q(this,$f,n),q(this,Yu,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"){let n=L.Composite(t.extensions.map(s=>s.schema),{$id:r});if(!oe.IsSchema(n))return ut({kind:H1.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let i=sPe(bL.values(),fL.values(),hL.values(),gL.values(),yL.values(),EL.values(),t.extensions.flatMap(s=>{var l;return(l=s.references)!=null?l:[]}).values());if(!i.isOk())return i;try{dQ();let s=dP.Compile(n,[...i.value.values()]);return st(new DP(n,s,t.extensions,i.value))}catch(s){return s instanceof Mt?ut({kind:H1.TypeboxError,message:s.message,original:s}):ut({kind:H1.UnknownError,message:"An unknown error occurred while compiling the schema",original:s})}}is(t){return d(this,Og).Check(t)}parse(t){return d(this,Og).Check(t)?st(t):ut(d(this,Og).Errors(t))}decode(t){try{return st(GJ(d(this,nu),[...d(this,Yu).values()],t))}catch(r){return ut(r)}}encode(t){try{return st(UJ(d(this,nu),[...d(this,Yu).values()],t))}catch(r){return ut(r)}}verify(t){for(let r of d(this,$f))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return ut(n.error)}return st(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([d(this,nu),...d(this,Yu).values()])),r=OP(LP({$id:"#/definitions/".concat((n=d(this,nu).$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=>LA(r,d(this,$f))).then(r=>r.mapErr(n=>{var i;return TA((i=d(this,nu).$id)!=null?i:"CoreMVF",n,[...d(this,Yu).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>LA(r,d(this,$f))).then(r=>r.mapErr(n=>{var i;return TA((i=d(this,nu).$id)!=null?i:"CoreMVF",n,[...d(this,Yu).values()])}))}async decompress(t){return AA(t,d(this,$f)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var i;return MA((i=d(this,nu).$id)!=null?i:"CoreMVF",n,[...d(this,Yu).values()])}))}async decompressUnsafe(t){return AA(t,d(this,$f)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var i;return MA((i=d(this,nu).$id)!=null?i:"CoreMVF",n,[...d(this,Yu).values()])}))}};nu=new WeakMap,Og=new WeakMap,$f=new WeakMap,Yu=new WeakMap,o(DP,"MVFParser");var AP=DP;var W1,DA=class DA{constructor(){G(this,W1,[]);this.extend=this.extend.bind(this)}extend(t){return d(this,W1).push(t),this}extendOptional(t){let r=re(R({},t),{schema:L.Partial(t.schema)});return d(this,W1).push(r),this}build(){return AP.create(this)}get extensions(){return d(this,W1)}};W1=new WeakMap,o(DA,"MVFParserBuilder");var FP=DA;var gQ=o(()=>new FP().extend(tJ).extend(aJ).extend(pJ),"createParser");var Lg=Ci("lcat","LocationCategoryId"),FA=L.Intersect([L.Object({id:L.Ref(Lg),parent:L.Optional(L.Ref(Lg))}),Ig(["name"]),Wu],{$id:"LocationCategory"}),yQ=[Lg,FA];g();g();var Ag;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(Ag||(Ag={}));var vQ=o(e=>{var i,s,l,c,p,h,y,b,_;if(e.locationCategories==null&&e.locations==null)return st(!0);let t=new Set((s=(i=e.locationCategories)==null?void 0:i.map(C=>C.id))!=null?s:[]);for(let C of(l=e.locationCategories)!=null?l:[])if(C.parent!=null&&!t.has(C.parent))return ut({kind:Ag.UnknownParentCategoryError,properties:{categoryId:C.id,parentCategoryId:C.parent}});let r=Oo(e);for(let C of(c=e.locations)!=null?c:[]){for(let P of C.categories)if(!t.has(P))return ut({kind:Ag.UnknownCategoryError,properties:{locationId:C.id,categoryId:P}});for(let P of C.geometryAnchors){let E=r(P.floorId,P.geometryId);if(E.isErr())return E}}let n=new Set((h=(p=e.locations)==null?void 0:p.map(C=>C.id))!=null?h:[]);for(let C of(y=e.locationInstances)!=null?y:[]){if(!n.has(C.parentId))return ut({kind:Ag.UnknownParentLocationError,properties:{locationInstanceId:C.id,parentLocationId:C.parentId}});for(let P of(b=C.categories)!=null?b:[])if(!t.has(P))return ut({kind:Ag.UnknownCategoryError,properties:{locationId:C.id,categoryId:P}});for(let P of(_=C.geometryAnchors)!=null?_:[]){let E=r(P.floorId,P.geometryId);if(E.isErr())return E}}return st(!0)},"validateLocations");g();var Dg=Ci("loc","LocationId"),NP=Ci("loci","LocationInstanceId"),bQ=L.Object({name:L.String(),url:L.String({format:"uri"})},{$id:"LocationSocial"}),xQ=L.Object({url:L.String({format:"uri"})},{$id:"LocationImage"}),NA=L.Object({label:L.String(),url:L.String({format:"uri"})},{$id:"LocationLink"}),kA=L.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),IQ=L.Union([L.Literal("Sunday"),L.Literal("Monday"),L.Literal("Tuesday"),L.Literal("Wednesday"),L.Literal("Thursday"),L.Literal("Friday"),L.Literal("Saturday")],{$id:"OpeningHoursDay"}),aPe="PublicHolidays",RA=L.Union([IQ,L.Literal(aPe)],{$id:"OpeningHoursDayOrPublicHoliday"}),kP=L.Object({"@type":L.Optional(L.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:L.Optional(L.Ref(kA,{description:"The time the opening hours start"})),closes:L.Optional(L.Ref(kA,{description:"The time the opening hours end"})),dayOfWeek:L.Optional(L.Union([L.Ref(RA),L.Array(L.Ref(RA))],{description:"The days of the week the opening hours apply to"})),validFrom:L.Optional(L.String({format:"date-time",description:"The date the opening hours start, in ISO 8601 format"})),validTo:L.Optional(L.String({format:"date-time",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),RP=L.Intersect([L.Object({id:L.Ref(Dg),categories:L.Array(L.Ref(Lg)),logo:L.Optional(L.String({format:"uri"})),phone:L.Optional(L.String()),social:L.Array(L.Ref(bQ)),images:L.Array(L.Ref(xQ)),links:L.Array(L.Ref(NA)),website:L.Optional(L.Ref(NA)),openingHours:L.Optional(L.Array(L.Ref(kP)))}),Ig(["name"]),_g(),Wu],{$id:"Location"}),BA=L.Intersect([L.Object({id:L.Ref(NP),parentId:L.Ref(Dg)}),L.Partial(L.Omit(RP,["id","parentId"]))],{$id:"LocationInstance"}),BP=[Dg,NP,bQ,xQ,NA,kA,IQ,RA,kP,RP,BA];var lPe=L.Object({locations:L.Array(L.Ref(RP)),locationCategories:L.Array(L.Ref(FA)),locationInstances:L.Optional(L.Array(L.Ref(BA)))},{$id:"LocationsExtensionSchema"}),_Q="locations.json",SQ="location-categories.json",CQ="location-instances.json",wQ={name:"ext:locations",schema:lPe,intoBundle:o(function*(e){e.locations!=null&&(yield{path:_Q,contents:e.locations}),e.locationCategories!=null&&(yield{path:SQ,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:CQ,contents:e.locationInstances})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===_Q)return{locations:r(t)};if(e===SQ)return{locationCategories:r(t)};if(e===CQ)return{locationInstances:r(t)}},"fromBundle"),references:[...yQ,...BP],integrityCheck:vQ};g();g();var mp;(function(e){e.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(mp||(mp={}));var PQ=o(e=>{var p,h,y,b,_,C,P,E,w,O,D,A,k,j,W,Y,N,Z,le,se;if(e.enterprise==null)return st(!0);let t=e.enterprise,r=new Set((h=(p=e.locationCategories)==null?void 0:p.map(U=>U.id))!=null?h:[]);for(let U of(y=t.categories)!=null?y:[])if(!r.has(U.categoryId))return ut({kind:mp.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:U.id,locationCategoryId:U.categoryId}});let n=new Set((_=(b=e.locations)==null?void 0:b.map(U=>U.id))!=null?_:[]);for(let U of(C=t.locations)!=null?C:[]){if(!n.has(U.locationId))return ut({kind:mp.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:U.id,locationId:U.locationId}});for(let ye of(P=U.siblingGroups)!=null?P:[])for(let ne of(E=ye.siblings)!=null?E:[])if(!n.has(ne))return ut({kind:mp.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:U.id,siblingLocationId:ne,label:ye.label}})}let i=new Set((O=(w=e.enterprise.locations)==null?void 0:w.map(U=>U.id))!=null?O:[]);if(((D=t.venue)==null?void 0:D.topLocations)!=null){for(let U of t.venue.topLocations)if(!i.has(U))return ut({kind:mp.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:U}})}let s=new Set((k=(A=e.locationInstances)==null?void 0:A.map(U=>U.id))!=null?k:[]);for(let U of(j=t.locationInstances)!=null?j:[]){if(!i.has(U.parentId))return ut({kind:mp.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:U.id,enterpriseLocationId:U.parentId}});if(!s.has(U.locationInstanceId))return ut({kind:mp.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:U.id,locationInstanceId:U.locationInstanceId}});for(let ye of(W=U.siblingGroups)!=null?W:[])for(let ne of(Y=ye.siblings)!=null?Y:[])if(!n.has(ne))return ut({kind:mp.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:U.id,siblingLocationId:ne,label:ye.label}})}let l=Df(e),c=Oo(e);for(let[U,ye]of un((N=t.floorText)!=null?N:{})){let ne=l(U);if(ne.isErr())return ne;for(let Ce of ye.features){if(!("geometryId"in Ce.properties))continue;let Ie=c(U,Ce.properties.geometryId);if(Ie.isErr())return Ie}}for(let[U,ye]of un((Z=t.textures)!=null?Z:{})){let ne=l(U);if(ne.isErr())return ne;for(let Ce of ye){let Ie=c(U,Ce.geometryId);if(Ie.isErr())return Ie}}for(let[U,ye]of un((le=t.layers)!=null?le:{})){let ne=l(U);if(ne.isErr())return ne;for(let Ce of rn(ye!=null?ye:{})){let Ie=c(U,Ce);if(Ie.isErr())return Ie}}for(let[U,ye]of un((se=t.textAreas)!=null?se:{})){let ne=l(U);if(ne.isErr())return ne;for(let Ce of ye.features)if("geometryId"in Ce.properties){let Ie=c(U,Ce.properties.geometryId);if(Ie.isErr())return Ie}}return st(!0)},"validateCMS");g();g();var Fg=Ci("el","EnterpriseLocationId"),jA=Ci("ec","EnterpriseCategoryId"),$A=Ci("eli","EnterpriseLocationInstanceId"),GA=Ci("ev","EnterpriseVenueId"),UA=Ci("eft","EnterpriseFloorTextId"),TQ=[Fg,jA,$A,GA,UA];var EQ=L.Object({id:L.Ref(jA),categoryId:L.Ref(Lg),color:L.Optional(L.String()),sortOrder:L.Number(),iconFromDefaultList:L.Optional(L.Union([L.String(),L.Null()])),picture:L.Optional(L.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),VA=L.Object({categories:L.Optional(L.Array(L.Ref(EQ)))},{$id:"EnterpriseCategoriesSchema"}),MQ=[EQ,VA];g();var OQ=$a(["left","center","right"]),uPe=OQ.schema,RDt=OQ.values,zA=L.Object({id:L.Ref(UA),text:L.String(),visible:L.Boolean({default:!0}),fontSize:L.Number({default:12,minimum:1}),fontFamily:L.String({default:"Droid Sans"}),color:L.String({default:"black"}),rotation:L.Number({minimum:0,maximum:360}),align:uPe},{$id:"FloorTextCommonProperties"}),qA=L.Intersect([L.Ref(zA),Zl],{$id:"AnchoredFloorTextProperties"}),HA=L.Intersect([L.Ref(zA),L.Object({verticalOffset:L.Number()})],{$id:"FloatingFloorTextProperties"}),LQ=L.Union([L.Ref(qA),L.Ref(HA)],{$id:"FloorTextProperties"}),AQ=vs(zs,L.Ref(LQ),{$id:"FloorTextFeature"}),cPe=vs(zs,L.Ref(qA),{$id:"AnchoredFloorTextFeature"}),pPe=vs(zs,L.Ref(HA),{$id:"FloatingFloorTextFeature"}),DQ=ya(L.Ref(AQ),{$id:"EnterpriseFloorTextFeatureCollection"}),FQ=L.Record(ln,L.Ref(DQ),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),WA=L.Object({floorText:L.Optional(L.Ref(FQ))},{$id:"EnterpriseFloorTextSchema"}),NQ=[zA,qA,HA,LQ,AQ,cPe,pPe,DQ,FQ,WA];g();var kQ=Ui(L.Record(Vs,L.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),RQ=Ui(L.Record(ln,L.Ref(kQ),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),XA=L.Object({layers:L.Optional(L.Ref(RQ))},{$id:"EnterpriseLayersSchema"}),BQ=[kQ,RQ,XA];g();g();g();var YA=$a(["closed-temporarily","new","pop-up","coming-soon","relocated"]),fPe=YA.schema,XDt=YA.values,YDt=YA.record,ZA=L.Object({type:fPe,start:L.Optional(L.String({format:"date",description:"The start date of the state"})),end:L.Optional(L.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),KA=L.Object({label:L.String(),siblings:L.Array(L.Ref(Dg))},{$id:"SiblingGroup"}),jP=L.Object({name:L.String(),code:L.String()},{$id:"Language"}),jQ=[ZA,KA,jP];var $P=L.Object({id:L.Ref(Fg),locationId:L.Ref(Dg),type:L.String(),sortOrder:L.Number(),tags:L.Optional(L.Array(L.String())),picture:L.Optional(L.String({format:"uri",description:"The picture of the location"})),states:L.Optional(L.Array(L.Ref(ZA),{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:L.Optional(L.Array(L.Ref(KA))),gallery:L.Optional(L.Array(L.Object({caption:L.Optional(L.String()),image:L.String({format:"uri"}),embeddedUrl:L.Optional(L.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:L.Optional(L.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:L.Optional(L.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:L.Optional(L.Boolean({description:"Whether to show the logo of the location"}))},{$id:"EnterpriseLocation"}),JA=L.Object({locations:L.Optional(L.Array(L.Ref($P)))},{$id:"EnterpriseLocationsSchema"}),$Q=[$P,JA];var GQ=L.Intersect([L.Object({id:L.Ref($A),parentId:L.Ref(Fg),locationInstanceId:L.Ref(NP)}),L.Partial(L.Omit($P,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),QA=L.Object({locationInstances:L.Optional(L.Array(L.Ref(GQ)))},{$id:"EnterpriseLocationInstancesSchema"}),UQ=[GQ,QA];g();var e9=$a(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),VQ=e9.schema,h8t=e9.values,m8t=e9.record,t9=L.Object({maxWidth:L.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:L.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:L.Ref(VQ),rotation:L.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),zQ=L.Intersect([L.Ref(t9),Zl],{$id:"EnterpriseAnchoredTextAreaProperties"}),qQ=L.Intersect([L.Ref(t9),L.Object({verticalOffset:L.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),HQ=L.Union([zQ,qQ],{$id:"EnterpriseTextAreaProperties"}),WQ=vs(L.Ref(zs),HQ,{$id:"EnterpriseTextAreaFeature"}),XQ=ya(L.Ref(WQ),{$id:"EnterpriseTextAreaCollection"}),YQ=L.Record(ln,L.Ref(XQ),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),ZQ=L.Object({textAreas:L.Optional(L.Ref(YQ))},{$id:"EnterpriseTextAreasSchema"}),KQ=[VQ,t9,zQ,qQ,HQ,WQ,XQ,YQ];g();var r9=L.Object({u:L.Number(),v:L.Number()},{$id:"EnterpriseTextureUV"}),n9=$a(["top","side"],{$id:"EnterpriseTextureFace"}),JQ=n9.schema,x8t=n9.values,I8t=n9.record,i9=$a(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),QQ=i9.schema,_8t=i9.values,S8t=i9.record,eee=L.Tuple([T1,E1,T1,E1],{$id:"EnterpriseTextureBounds"}),tee=L.Intersect([L.Object({repeat:L.Ref(r9),offset:L.Ref(r9),rotation:L.Number({minimum:0,maximum:360}),path:L.String({format:"uri"}),face:L.Ref(JQ),surface:L.Ref(QQ),bounds:L.Ref(eee)},{$id:"EnterpriseTextureProperties"}),Zl],{$id:"EnterpriseTexture"}),ree=L.Array(L.Ref(tee),{$id:"EnterpriseTextures"}),nee=L.Record(ln,L.Ref(ree),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),o9=L.Object({textures:L.Optional(L.Ref(nee))},{$id:"EnterpriseTexturesSchema"}),iee=[tee,ree,o9,r9,JQ,QQ,eee,nee];g();var oee=L.Intersect([L.Object({id:L.Ref(GA),slug:L.String(),defaultLanguage:L.Ref(jP),languages:L.Array(L.Ref(jP)),countrycode:L.Optional(L.String()),logo:L.Optional(L.String({format:"uri"})),mappedinWebUrl:L.Optional(L.String({format:"uri"})),topLocations:L.Optional(L.Array(L.Ref(Fg))),operationHours:L.Optional(L.Array(L.Ref(kP))),coverImage:L.Optional(L.String({format:"uri"}))}),Ig(["name"]),Wu],{$id:"EnterpriseVenue"}),s9=L.Object({venue:L.Optional(L.Ref(oee))},{$id:"EnterpriseVenueSchema"}),see=[oee,s9];var lee=L.Intersect([s9,JA,QA,VA,o9,WA,XA,ZQ],{$id:"EnterpriseProperties"}),aee=L.Object({enterprise:L.Optional(L.Ref(lee))},{$id:"CMSExtensionSchema"}),dPe=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,uee={name:"ext:cms",schema:aee,intoBundle:o(function*(e){var r,n,i,s,l,c;if(e.enterprise==null)return;let t=e.enterprise;for(let p of rn(t))switch(p){case"floorText":for(let h of rn((r=t.floorText)!=null?r:{}))yield{path:"enterprise/floorText/".concat(h,".geojson"),contents:((n=t.floorText)!=null?n:{})[h]};continue;case"textures":for(let h of rn((i=t.textures)!=null?i:{}))yield{path:"enterprise/textures/".concat(h,".json"),contents:((s=t.textures)!=null?s:{})[h]};continue;case"textAreas":for(let h of rn((l=t.textAreas)!=null?l:{}))yield{path:"enterprise/textAreas/".concat(h,".geojson"),contents:((c=t.textAreas)!=null?c:{})[h]};continue;default:yield{path:"enterprise/".concat(p,".json"),contents:t[p]};continue}},"intoBundle"),fromBundle:o((e,t,r)=>{let n=e.match(dPe);if(!n)return;let[,i,s]=n,l=r(t);switch(i){case"floorText":case"textures":case"textAreas":return{enterprise:{[i]:{[s]:l}}};default:return{enterprise:{[s]:l}}}},"fromBundle"),references:[lee,aee,...see,...$Q,...UQ,...MQ,...iee,...BQ,...NQ,...KQ,...TQ,...jQ,...BP],integrityCheck:PQ};g();g();g();g();var Zu;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Zu||(Zu={}));var cee=o(e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return st(!0);let r=Object.entries(t).map(([s,l])=>R({key:s},l)).sort((s,l)=>s.index!==l.index?s.index-l.index:s.bit-l.bit),n=0,i=-1;for(let s of r){if(s.bit===i)return ut({kind:Zu.NavigationFlagDuplicateBit,properties:{index:s.index,bit:s.bit,path:"navigationFlags.".concat(s.key)}});if(s.index!=n){if(i!=31)return ut({kind:Zu.NavigationFlagMissingDeclaration,properties:{index:n,bit:i+1,path:"navigationFlags"}});if(s.index!=n+1||s.bit!=0)return ut({kind:Zu.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=s.index,i=0}else{if(s.bit!==i+1)return ut({kind:Zu.NavigationFlagMissingDeclaration,properties:{index:s.index,bit:i+1,path:"navigationFlags"}});i=s.bit}}return st(!0)},"validateNavigationFlags");g();function X1(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}o(X1,"hasFlag");g();var pee=2**32-1,LI=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"),Y1=o((e,t,r)=>{if(t.index==-1&&e.length===0)return st(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return ut({kind:Zu.NavigationFlagIncorrectFlagsLength,properties:{expected:n,actual:e.length,path:r}});for(let i=0;i<e.length;i++){let s=e[i];if(i<t.index){if(s>pee)return ut({kind:Zu.NavigationFlagValueTooBig,properties:{index:i,flagValue:s,expectedMaxFlagValue:pee,path:r}});continue}else if(s>t.flag)return ut({kind:Zu.NavigationFlagValueTooBig,properties:{index:i,flagValue:s,expectedMaxFlagValue:t.flag,path:r}})}return st(!0)},"validateFlags");var hPe=L.Object({index:L.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:L.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),fee=L.Intersect([hPe,Hu],{$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.'}),a9={accessible:"accessible",outdoors:"outdoors"},dee=L.Record(L.String(),fee,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),mPe=L.Object({navigationFlags:L.Ref(dee)},{$id:"NavigationFlagsSchema"}),GP=L.Array(L.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),l9=L.Object({flags:L.Ref(GP)},{$id:"WithFlags"}),Ng=L.Intersect([P1,l9],{$id:"FlaggedGeometryAnchor"}),gPe=L.Object({geometryAnchor:Ng},{$id:"WithFlaggedGeometryAnchor"}),yPe=L.Object({geometryAnchors:L.Array(Ng)},{$id:"WithFlaggedGeometryAnchors"}),hee={name:"ext:mvf-navigation-flags",schema:mPe,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:[fee,dee,GP,Ng,gPe,yPe],integrityCheck:cee};g();var mee=o(e=>{if(e.connections==null)return st(!0);let t=Oo(e),r=LI(e);for(let[n,i]of e.connections.entries()){for(let[s,l]of i.entrances.entries()){let c=t(l.floorId,l.geometryId);if(c.isErr())return c;let p=Y1(l.flags,r,"connections[".concat(n,"].entrances[").concat(s,"]"));if(p.isErr())return p}for(let[s,l]of i.exits.entries()){let c=t(l.floorId,l.geometryId);if(c.isErr())return c;let p=Y1(l.flags,r,"connections[".concat(n,"].exits[").concat(s,"]"));if(p.isErr())return p}}return st(!0)},"validateConnections");var yee=Ci("c","ConnectionId"),{schema:vPe,values:OFt,record:bPe}=$a(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),vee=vPe;var u9=bPe,bee=L.Intersect([L.Object({id:L.Ref(yee,{description:"The unique identifier for the connection."}),entrances:L.Array(L.Ref(Ng)),exits:L.Array(L.Ref(Ng)),entryCost:L.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:L.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:L.Ref(vee,{description:"The type of connection."})}),Hu,Wu],{$id:"ConnectionsProperties"}),xee=L.Array(L.Ref(bee),{$id:"ConnectionsCollection"}),xPe=L.Object({connections:L.Ref(xee)},{$id:"ConnectionsExtensionSchema"}),gee="connections.json",Iee={name:"ext:connections",schema:xPe,intoBundle:o(function*(e){e.connections!=null&&(yield{path:gee,contents:e.connections})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===gee)return{connections:r(t)}},"fromBundle"),references:[bee,xee,vee,yee,Ng,GP],integrityCheck:mee};g();g();var _ee=o(e=>{if(e.defaultStyle==null)return st(!0);let t=Oo(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 st(!0)},"validateDefaultStyle");var See=L.Intersect([_g(),Wu,L.Object({altitude:L.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:L.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:L.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:L.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:L.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:L.Optional(L.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),Cee=L.Record(L.String(),L.Ref(See),{$id:"DefaultStyleCollection",additionalProperties:!1}),IPe=L.Object({defaultStyle:L.Ref(Cee)},{$id:"DefaultStyleSchema"}),wee={name:"ext:mvf-default-style",schema:IPe,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:[See,Cee],integrityCheck:_ee};g();g();g();g();var UP;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(UP||(UP={}));var Pee=o(e=>{if(e.floorStacks==null)return st(!0);let t=Df(e);for(let r of e.floorStacks){for(let n of r.floors){let i=t(n);if(i.isErr())return i}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return ut({kind:UP.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return st(!0)},"validateFloorStacks");var VP=Ci("fs","FloorStackId"),Eee=L.Intersect([L.Object({id:L.Ref(VP,{description:"The unique identifier for the floor stack."}),floors:L.Array(L.Ref(ln),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:L.Optional(L.Ref(ln,{description:"The default floor for the floor stack."}))}),Hu],{$id:"FloorStacksProperties"}),Mee=L.Array(L.Ref(Eee),{$id:"FloorStackCollection"}),_Pe=L.Object({floorStacks:L.Ref(Mee)},{$id:"FloorStackExtensionSchema"}),Tee="floor-stacks.json",Oee={name:"ext:floor-stacks",schema:_Pe,intoBundle:o(function*(e){e.floorStacks!=null&&(yield{path:Tee,contents:e.floorStacks})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===Tee)return{floorStacks:r(t)}},"fromBundle"),references:[VP,Eee,Mee],integrityCheck:Pee};g();g();var AI;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(AI||(AI={}));var Lee=o(e=>{if(e.facade==null)return st(!0);if(e.floorStacks==null)return ut({kind:AI.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(n=>n.id)),r=Oo(e);for(let[n,i]of un(e.facade))if(i!=null){if(!t.has(n))return ut({kind:AI.UnknownFloorStackError,properties:{floorStackId:n}});for(let s of i.geometryAnchors){let l=r(s.floorId,s.geometryId);if(l.isErr())return l}}return st(!0)},"validateFacade");var Aee=Ci("fc","FacadeId"),Dee=L.Intersect([L.Object({id:L.Ref(Aee)}),_g({minItems:1})],{$id:"FacadeProperties"}),SPe=L.Object({facade:Ui(L.Record(VP,L.Ref(Dee),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),CPe=/^facade\/(.*)\.json$/,Fee={name:"ext:facade",schema:SPe,intoBundle:o(function*(e){if(e.facade!=null)for(let t of rn(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(CPe))==null?void 0:i[1];if(n)return{facade:{[n]:r(t)}}},"fromBundle"),references:[Aee,Dee],integrityCheck:Lee};g();g();var Nee=o(e=>{if(e.floorImages==null)return st(!0);let t=Oo(e);for(let[r,n]of un(e.floorImages))if(n!=null)for(let i of n.features){if(!("geometryId"in i.properties))continue;let s=i.properties.geometryId,l=t(r,s);if(l.isErr())return l}return st(!0)},"validateFloorImages");var c9=L.Object({path:L.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:L.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:L.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:L.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),kee=L.Intersect([L.Ref(c9),Zl],{$id:"AnchoredFloorImageProperties"}),Ree=L.Intersect([L.Ref(c9),L.Object({verticalOffset:L.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),Bee=L.Union([kee,Ree],{$id:"FloorImageProperties"}),jee=vs(L.Ref(zs),Bee,{$id:"FloorImageFeature"}),$ee=ya(L.Ref(jee),{$id:"FloorImageCollection"}),wPe=L.Object({floorImages:Ui(L.Record(ln,L.Ref($ee),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),PPe=/^floorImages\/(.*)\.geojson$/,Gee={name:"ext:floor-images",schema:wPe,intoBundle:o(function*(e){if(e.floorImages!=null)for(let t of rn(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(PPe))==null?void 0:i[1];if(n)return{floorImages:{[n]:r(t)}}},"fromBundle"),references:[c9,kee,Ree,Bee,jee,$ee],integrityCheck:Nee};g();g();var Uee=o(e=>{if(e.kinds==null)return st(!0);let t=Oo(e);for(let[r,n]of un(e.kinds))if(n!=null)for(let i of rn(n)){let s=t(r,i);if(s.isErr())return s}return st(!0)},"validateKinds");var{values:ZNt,schema:TPe,record:KNt}=$a(["room","hallway","wall","desk","poi","area","window"],{$id:"Kind"}),Vee=TPe;var zee=Ui(L.Record(Vs,L.Ref(Vee),{additionalProperties:!1,$id:"GeometryKinds"})),EPe=L.Object({kinds:Ui(L.Record(ln,L.Ref(zee),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),MPe=/^kinds\/(.*)\.json$/,qee={name:"ext:kinds",schema:EPe,intoBundle:o(function*(e){if(e.kinds!=null)for(let t of rn(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(MPe))==null?void 0:i[1];if(n)return{kinds:{[n]:r(t)}}},"fromBundle"),references:[Vee,zee],integrityCheck:Uee};g();g();g();var zP;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(zP||(zP={}));var Hee=o(e=>{if(e.nodes==null)return st(!0);let t=Oo(e),r=LI(e);for(let[n,i]of un(e.nodes)){if(i==null)continue;let s=new Set(i.features.map(l=>l.properties.id));for(let[l,c]of i.features.entries()){for(let p of c.properties.geometryIds){let h=t(n,p);if(h.isErr())return h}for(let[p,h]of c.properties.neighbors.entries()){if(!s.has(h.id))return ut({kind:zP.UnknownNeighbor,properties:{floorId:n,nodeId:c.properties.id,neighborId:h.id}});let y=Y1(h.flags,r,'nodes["'.concat(n,'"].features[').concat(l,"].properties.neighbors[").concat(p,"]"));if(y.isErr())return y}}}return st(!0)},"validateNodes");var p9=Ci("n","NodeId"),Wee=L.Intersect([L.Object({id:L.Ref(p9,{description:"The unique identifier for the node."}),extraCost:L.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),l9],{$id:"NodeNeighbor"}),Xee=L.Intersect([L.Object({id:L.Ref(p9,{description:"The unique identifier for the node."}),neighbors:L.Array(L.Ref(Wee),{description:"The neighbors of the node."})}),Ww],{$id:"NodeProperties"}),Yee=vs(L.Ref(zs),Xee,{$id:"NodeFeature"}),Zee=ya(L.Ref(Yee),{$id:"NodeCollection"}),OPe=L.Object({nodes:Ui(L.Record(ln,L.Ref(Zee),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),LPe=/^nodes\/(.*)\.json$/,Kee={name:"ext:nodes",schema:OPe,intoBundle:o(function*(e){if(e.nodes!=null)for(let t of rn(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(LPe))==null?void 0:i[1];if(n)return{nodes:{[n]:r(t)}}},"fromBundle"),references:[p9,Wee,Xee,Yee,Zee],integrityCheck:Hee};g();g();g();var qP;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(qP||(qP={}));var Jee=o(e=>{if(e.outdoors==null)return st(!0);let t=Df(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 ut({kind:qP.FloorInFloorStackError,properties:{floorId:r,floorStackId:i.id}})}}return st(!0)},"validateOutdoors");var ete=L.Object({floors:L.Array(L.Ref(ln),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),APe=L.Object({outdoors:L.Ref(ete)},{$id:"OutdoorsExtensionSchema"}),Qee="outdoors.json",tte={name:"ext:outdoors",schema:APe,intoBundle:o(function*(e){e.outdoors!=null&&(yield{path:Qee,contents:e.outdoors})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===Qee)return{outdoors:r(t)}},"fromBundle"),references:[ete],integrityCheck:Jee};g();g();g();var HP;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(HP||(HP={}));var rte=o(e=>{if(e.tileset==null)return st(!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 ut({kind:HP.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return st(!0)},"validateTilesets");var f9=L.Object({key:L.String({minLength:1,description:"Unique identifier for the tileset style."}),name:L.String({minLength:1,description:"Display name of the tileset style."}),url:L.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),nte=L.Object({default:L.Ref(f9,{description:"The default tileset style, which should be used."}),others:L.Optional(L.Array(L.Ref(f9,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),DPe=L.Object({tileset:L.Ref(nte)},{$id:"TilesetExtensionSchema"}),ite={name:"ext:mvf-tileset",schema:DPe,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:[f9,nte],integrityCheck:rte};g();var ote=L.Object({},{$id:"WalkableProperties"}),ste=L.Object({},{$id:"NonWalkableProperties"}),ate=Ui(L.Record(Vs,L.Ref(ote),{$id:"WalkableGeometries",additionalProperties:!1})),lte=Ui(L.Record(Vs,L.Ref(ste),{$id:"NonWalkableGeometries",additionalProperties:!1})),FPe=L.Object({walkable:Ui(L.Record(ln,L.Ref(ate),{additionalProperties:!1})),nonwalkable:Ui(L.Record(ln,L.Ref(lte),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),NPe=/^walkable\/(.*)\.json$/,kPe=/^nonwalkable\/(.*)\.json$/,ute={name:"ext:mvf-traversability",schema:FPe,intoBundle:o(function*(e){if(e.walkable!=null)for(let t of rn(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of rn(e.nonwalkable))yield{path:"nonwalkable/".concat(t,".json"),contents:e.nonwalkable[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var s,l;let n=(s=e.match(NPe))==null?void 0:s[1];if(n!=null)return{walkable:{[n]:r(t)}};let i=(l=e.match(kPe))==null?void 0:l[1];if(i!=null)return{nonwalkable:{[i]:r(t)}}},"fromBundle"),references:[ote,ste,ate,lte]};g();g();function cte(e){return e.replace(/^g_/,"s_")}o(cte,"toSpaceId");function RPe(e){return e.replace(/^g_/,"o_")}o(RPe,"toObstructionId");function BPe(e){return e.replace(/^g_/,"w_")}o(BPe,"toWindowId");function jPe(e){return e.replace(/^g_/,"ar_")}o(jPe,"convertAreaId");function $Pe(e,t,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],i=0,s=e.geometry.type.replace("Multi","");for(let l of e.geometry.coordinates)n.push(re(R({},e),{geometry:{type:s,coordinates:l},properties:re(R({},e.properties),{id:"".concat(t,"-").concat(i++),kind:r})}));return n}default:return[re(R({},e),{properties:re(R({},e.properties),{id:t,kind:r})})]}}o($Pe,"splitMultiPartGeometryFeatureWithNewId");function DI(e,t,r,n){let i=new Map;for(let{feature:s,floorId:l}of e){let c=s.properties.id,p=n.get(c);if(t.has(c)){let h=$Pe(s,r(c),p),y=h.map(_=>_.properties.id),b=y.map(_=>({geometryId:_,floorId:l}));i.set(c,{ids:y,features:h,anchors:b})}}return i}o(DI,"mapGeometryToOtherIds");function pte(e){var p,h,y;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((p=e.kinds)!=null?p:{}).filter(b=>b!==void 0).flatMap(un)),n=un(e.geometry).flatMap(([b,_])=>{var C;return((C=_==null?void 0:_.features)!=null?C:[]).map(P=>({feature:P,floorId:b}))}).flat(),i=new Set(Object.values((h=e.walkable)!=null?h:{}).filter(b=>b!==void 0).flatMap(rn)),s=new Set(Object.values((y=e.nonwalkable)!=null?y:{}).filter(b=>b!==void 0).flatMap(rn)),l=new Set(Array.from(r.entries()).filter(([b,_])=>_==="area").map(([b])=>b)),c=new Set(Array.from(r.entries()).filter(([b,_])=>_==="window").map(([b])=>b));return i.size>0&&(t.space=DI(n,i,cte,r)),s.size>0&&(t.obstruction=DI(n,s,RPe,r)),l.size>0&&(t.area=DI(n,l,jPe,r)),c.size>0&&(t.window=DI(n,c,BPe,r)),i.size===0&&s.size===0&&l.size===0&&(t.space=DI(n,new Set(n.map(b=>b.feature.properties.id)),cte,r)),t}o(pte,"createGeometryMaps");function fte(e){let t=GPe(e),r=pte(e),n=UPe(e);return{geometryMaps:r,nodesByGeometryId:t,geometryFeatureById:n}}o(fte,"buildBuilderOptions");function GPe(e){var r,n,i;let t=new Map;for(let s of Object.values((r=e.nodes)!=null?r:{}))for(let l of(n=s==null?void 0:s.features)!=null?n:[])if(l.properties.geometryIds.length>0)for(let c of l.properties.geometryIds){let p=(i=t.get(c))!=null?i:[];p.push(l.properties.id),t.set(c,p)}return t}o(GPe,"buildNodesByGeometryId");function UPe(e){var r,n;let t=new Map;for(let i of Object.values((r=e.geometry)!=null?r:{}))for(let s of(n=i==null?void 0:i.features)!=null?n:[])t.set(s.properties.id,s);return t}o(UPe,"buildGeometryFeatureById");g();function dte(e,t){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let r={};for(let[n,i]of un(e.annotations)){if(!i||i.length===0||!e.geometry[n]||e.geometry[n].features.length===0)continue;let s=new Map(e.geometry[n].features.map(c=>[c.properties.id,c])),l={type:"FeatureCollection",features:[]};for(let c of i){let p=s.get(c.geometryId);if(!p||p.geometry.type!=="Point")continue;let h={id:c.id,externalId:c.externalId,symbolId:c.symbolKey};l.features.push({type:"Feature",geometry:p.geometry,properties:h})}r[n]=l}return{annotation:r}}o(dte,"buildAnnotations");g();function hte(e,{nodesByGeometryId:t}){var l,c,p,h,y,b,_;let r={"connection.json":[],entrance:{}},n=(l=e.navigationFlags)==null?void 0:l[a9.accessible],i=(c=e.navigationFlags)==null?void 0:c[a9.outdoors],s=new Map(Object.values((p=e.geometry)!=null?p:{}).flatMap(C=>{var P;return(P=C==null?void 0:C.features)!=null?P:[]}).map(C=>[C.properties.id,C]));for(let C of(h=e.connections)!=null?h:[]){if(d9(C,s)){let O=VPe(C,s,t,i);for(let[D,A]of O)r.entrance[D]||(r.entrance[D]={type:"FeatureCollection",features:[]}),r.entrance[D].features.push(A);continue}let P=n!=null&&C.entrances.every(O=>X1(O,n))&&C.exits.every(O=>X1(O,n)),E=Array.from(new Set([...C.entrances.map(O=>t.get(O.geometryId)),...C.exits.map(O=>t.get(O.geometryId))].flat().filter(O=>O!=null))),w={id:C.id,externalId:(b=(y=C.details)==null?void 0:y.externalId)!=null?b:"",type:C.type,accessible:P,nodes:E};(_=C.details)!=null&&_.name&&(w.details={name:C.details.name}),C.extra&&(w.extra=C.extra),r["connection.json"].push(w)}return r}o(hte,"buildConnections");function d9(e,t){return e.type==u9.door&&e.entrances.every(r=>{let n=t.get(r.geometryId);return(n==null?void 0:n.geometry.type)==="LineString"})}o(d9,"isLineDoor");function VPe(e,t,r,n){var s,l;if(e.type!==u9.door)return[];let i=[];for(let c of e.entrances){let p=t.get(c.geometryId);if((p==null?void 0:p.geometry.type)==="LineString"){let h={type:"Feature",geometry:p.geometry,properties:{id:e.id,externalId:(l=(s=e.details)==null?void 0:s.externalId)!=null?l:"",isExterior:zPe(e,n)}},y=e.details;y&&(h.properties.details={name:y.name,description:y.description},y.icon&&(h.properties.details.images=[{url:y.icon,altText:"".concat(y.name," icon")}]));let b=r.get(c.geometryId);b&&b.length>0&&(h.properties.node=b[0]),i.push([c.floorId,h])}}return i}o(VPe,"buildEntranceFeaturesFromConnection");function zPe(e,t){return e.entrances.some(r=>X1(r,t))||e.exits.some(r=>X1(r,t))}o(zPe,"isExterior");g();function gte(e,{geometryMaps:t,nodesByGeometryId:r}){var D,A,k,j,W,Y,N,Z,le,se,U,ye,ne,Ce,Ie,Ue,ve,Te,Q,Qe,Ye,nt,Ae;if(!e.enterprise)return{};let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"",code:""},languages:[]}},i=(D=e.manifest)==null?void 0:D.features[0];if(i&&(n.venue.defaultFloor=i.properties.defaultFloor,n.venue.tzid=i.properties.tzid,n.venue.name=i.properties.name),e.enterprise.venue){let Be=e.enterprise.venue;n.venue=re(R({},n.venue),{slug:Be.slug,name:(A=Be.details.name)!=null?A:n.venue.name,externalId:(k=Be.details.externalId)!=null?k:"",defaultLanguage:Be.defaultLanguage,languages:Be.languages,countrycode:Be.countrycode,coverImage:Be.coverImage,logo:Be.logo,icon:Be.details.icon,extra:Be.extra,mappedinWebUrl:Be.mappedinWebUrl,operationHours:Be.operationHours,topLocations:Be.topLocations})}let s=new Map,l=new Map,c=e.locations,p=e.enterprise.locations;if(c&&p){let Be=new Map(c.map(We=>[We.id,We]));for(let We of p){let $e=Be.get(We.locationId);if($e){let we=$e.details,H={id:We.id,name:we.name,externalId:(j=we.externalId)!=null?j:"",type:We.type,sortOrder:We.sortOrder,amenity:We.amenity,description:we.description,extra:$e.extra,links:$e.links,operationHours:$e.openingHours,gallery:We.gallery,logo:$e.logo,shortName:we.shortName,picture:We.picture,showFloatingLabelWhenImagePresent:We.showFloatingLabelWhenImagePresent,showLogo:We.showLogo,siblingGroups:We.siblingGroups,states:We.states,tags:We.tags,spaces:[],nodes:[],polygons:[]};$e.phone&&(H.phone={number:$e.phone});let ie=mte($e.social);$e.website&&(ie.website=$e.website.url),H.social=ie;for(let ee of $e.geometryAnchors){let Me=t.space.get(ee.geometryId);if(Me){let Oe=new Set(Me.features.filter(Ze=>Ze.geometry.type==="Polygon").map(Ze=>Ze.properties.id));for(let Ze of Me.anchors)H.spaces.push({floor:Ze.floorId,id:Ze.geometryId}),Oe.has(Ze.geometryId)&&H.polygons.push({map:Ze.floorId,id:Ze.geometryId})}let Ne=r.get(ee.geometryId);for(let Oe of Ne!=null?Ne:[])H.nodes.push({map:ee.floorId,id:Oe})}n.locations.push(H);for(let ee of $e.categories)s.set(ee,[...(W=s.get(ee))!=null?W:[],We.id]);l.set(We.id,$e.categories)}}}let h=e.enterprise.locationInstances,y=e.locationInstances;if(h&&y){let Be=new Map(y.map($e=>[$e.id,$e])),We=[];for(let $e of h){let we=Be.get($e.locationInstanceId);if(we){let H={id:$e.id,parent:$e.parentId,name:(Y=we.details)==null?void 0:Y.name,externalId:(N=we.details)==null?void 0:N.externalId,type:$e.type,sortOrder:$e.sortOrder,amenity:$e.amenity,description:(Z=we.details)==null?void 0:Z.description,extra:we.extra,links:we.links,operationHours:we.openingHours,gallery:$e.gallery,picture:$e.picture,showFloatingLabelWhenImagePresent:$e.showFloatingLabelWhenImagePresent,showLogo:$e.showLogo,siblingGroups:$e.siblingGroups,states:$e.states,tags:$e.tags,logo:we.logo,shortName:(le=we.details)==null?void 0:le.shortName};we.phone&&(H.phone={number:we.phone});let ie=mte((se=we.social)!=null?se:[]);if(we.website&&(ie.website=we.website.url),Object.keys(ie).length>0&&(H.social=ie),(U=we.geometryAnchors)!=null&&U.length){let ee=we.geometryAnchors.flatMap(Me=>{var Ne,Oe;return(Oe=(Ne=t.space.get(Me.geometryId))==null?void 0:Ne.anchors)!=null?Oe:[]});ee.length>0&&(H.spaces=ee.map(Me=>({floor:Me.floorId,id:Me.geometryId})))}if(we.geometryAnchors){H.spaces=[],H.polygons=[],H.nodes=[];for(let ee of we.geometryAnchors){let Me=t.space.get(ee.geometryId);if(Me){let Oe=new Set(Me.features.filter(Ze=>Ze.geometry.type==="Polygon").map(Ze=>Ze.properties.id));for(let Ze of Me.anchors)H.spaces.push({floor:Ze.floorId,id:Ze.geometryId}),Oe.has(Ze.geometryId)&&H.polygons.push({map:Ze.floorId,id:Ze.geometryId})}let Ne=r.get(ee.geometryId);for(let Oe of Ne!=null?Ne:[])H.nodes.push({map:ee.floorId,id:Oe})}}We.push(H)}}We.length>0&&(n.locationInstances=We)}let b=e.locationCategories,_=e.enterprise.categories;if(b&&_){let Be=[],We=new Map(b.map(ie=>[ie.id,ie])),$e=new Map(_.map(ie=>[ie.categoryId,ie.id])),we=new Map;for(let ie of b){let ee=$e.get(ie.parent);if(ee){let Me=(ye=we.get(ee))!=null?ye:[];Me.push(ie.id),we.set(ee,Me)}}for(let ie of _){let ee=We.get(ie.categoryId);if(ee){let Ne=((ne=we.get(ie.id))!=null?ne:[]).map(Ze=>$e.get(Ze)).filter(Ze=>Ze!==void 0),Oe={id:ie.id,name:ee.details.name,externalId:(Ce=ee.details.externalId)!=null?Ce:"",sortOrder:ie.sortOrder,children:Ne,locations:(Ie=s.get(ie.categoryId))!=null?Ie:[],icon:ee.details.icon,picture:ie.picture,color:ie.color,extra:ee.extra,iconFromDefaultList:ie.iconFromDefaultList};Be.push(Oe)}}n.categories=Be;let H={};for(let[ie,ee]of l.entries())H[ie]=ee.map(Me=>$e.get(Me)).filter(Me=>Me!==void 0);n.categoryPriorities=H}let C={};for(let[Be,We]of Object.entries((Ue=e.defaultStyle)!=null?Ue:{}))if(We.buffer>0){let $e=We.geometryAnchors.flatMap(we=>{var H,ie;return(ie=(H=t.space.get(we.geometryId))==null?void 0:H.anchors)!=null?ie:[]});C[Be]={edgeOffset:We.buffer,geometryAnchors:$e}}Object.keys(C).length>0&&(n.enterpriseStyles=C);let P=new Map;for(let Be of Object.values((ve=e.enterprise.layers)!=null?ve:{}))if(Be)for(let[We,$e]of un(Be)){if(typeof $e!="string")continue;let we=(Te=P.get($e))!=null?Te:{name:$e,id:"ely_".concat($e),spaces:[]};we.spaces.push(...(Qe=(Q=t.space.get(We))==null?void 0:Q.anchors.map(H=>({floorId:H.floorId,spaceId:H.geometryId})))!=null?Qe:[]),P.set($e,we)}P.size>0&&(n.layers=Array.from(P.values()));let E=[];for(let Be of Object.values((Ye=e.enterprise.textures)!=null?Ye:{}))for(let We of Be){let $e=(nt=t.space.get(We.geometryId))==null?void 0:nt.anchors;!$e||$e.length<1||We.face==="unknown"||We.surface==="unknown"||E.push({repeat:We.repeat,offset:We.offset,rotation:We.rotation,path:We.path,face:We.face,surface:We.surface,bounds:We.bounds,geometryAnchors:$e})}E.length>0&&(n.textures=E);let w={};for(let[Be,We]of Object.entries((Ae=e.enterprise.floorText)!=null?Ae:{})){let $e={type:"FeatureCollection",features:[]};for(let we of We.features){if(we.properties.align==="unknown")continue;let H={align:we.properties.align,color:we.properties.color,fontFamily:we.properties.fontFamily,fontSize:we.properties.fontSize,rotation:we.properties.rotation,text:we.properties.text,visible:we.properties.visible};"geometryId"in we.properties?H.geometryId=we.properties.geometryId:H.verticalOffset=we.properties.verticalOffset,$e.features.push({type:"Feature",geometry:we.geometry,properties:H})}$e.features.length>0&&(w[Be]=$e)}Object.keys(w).length>0&&(n.floorText=w);let O={enterprise:n};if(e.enterprise.textAreas){let Be={};for(let[We,$e]of un(e.enterprise.textAreas)){let we={type:"FeatureCollection",features:[]};for(let H of $e.features){if(H.properties.align==="unknown")continue;let ie={align:H.properties.align,maxWidth:H.properties.maxWidth,maxHeight:H.properties.maxHeight,rotation:H.properties.rotation};"geometryId"in H.properties?ie.anchorId=H.properties.geometryId:ie.verticalOffset=H.properties.verticalOffset;let ee={type:"Feature",geometry:H.geometry,properties:ie};we.features.push(ee)}Be[We]=we}O.textAreas=Be}return O}o(gte,"buildEnterprise");var qPe=["facebook","instagram","twitter"];function mte(e){let t={};for(let{name:r,url:n}of e){let i=r.toLowerCase();qPe.includes(i)&&(t[i]=n)}return t}o(mte,"convertSocials");g();function yte(e,{geometryMaps:t}){if(!e.facade)return{};let r={},n={};for(let[i,s]of un(e.facade))s&&(n[i]={id:s.id,spaces:s.geometryAnchors.flatMap(({floorId:l,geometryId:c})=>{var p;return(p=t.space.get(c))==null?void 0:p.ids.map(h=>({floorId:l,spaceId:h}))}).filter(l=>l!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}o(yte,"buildFacade");g();function vte(e,t={}){var i,s,l,c,p,h,y,b,_,C,P,E;let r={type:"FeatureCollection",features:[]},n=[];for(let w of e.floors.features)n.push({id:w.properties.id.replace(/^f_/,"m_"),externalId:(s=(i=w.properties.details)==null?void 0:i.externalId)!=null?s:"",elevation:w.properties.elevation,name:(c=(l=w.properties.details)==null?void 0:l.name)!=null?c:"",shortName:(h=(p=w.properties.details)==null?void 0:p.shortName)!=null?h:"",subtitle:w.properties.subtitle}),r.features.push({type:"Feature",geometry:w.geometry,properties:{id:w.properties.id,externalId:(b=(y=w.properties.details)==null?void 0:y.externalId)!=null?b:"",elevation:w.properties.elevation,name:(C=(_=w.properties.details)==null?void 0:_.name)!=null?C:"",shortName:(E=(P=w.properties.details)==null?void 0:P.shortName)!=null?E:"",subtitle:w.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}o(vte,"buildFloors");g();function bte(e,{geometryMaps:t}){var i,s,c,p,h;let r={},n={};for(let[y,b]of un((i=e.floorImages)!=null?i:{})){let _={features:[],type:"FeatureCollection"};for(let C of(s=b==null?void 0:b.features)!=null?s:[])if("verticalOffset"in C.properties)_.features.push(C);else{let l=C.properties,{geometryId:P}=l,E=cs(l,["geometryId"]),w=(h=(c=t.space.get(P))==null?void 0:c.ids[0])!=null?h:(p=t.obstruction.get(P))==null?void 0:p.ids[0];if(!w)continue;let O={geometry:C.geometry,properties:re(R({},E),{anchorId:w}),type:C.type};_.features.push(O)}n[y]=_}return Object.keys(n).length>0&&(r.floorImages=n),r}o(bte,"buildFloorImages");g();function xte(e,t={}){var i,s,l,c,p,h,y;let r=[];for(let b of(i=e==null?void 0:e.floorStacks)!=null?i:[]){let _={id:b.id,floors:b.floors,maps:b.floors,externalId:(l=(s=b.details)==null?void 0:s.externalId)!=null?l:"",name:(p=(c=b.details)==null?void 0:c.name)!=null?p:"",shortName:(y=(h=b.details)==null?void 0:h.shortName)!=null?y:"",type:"Building"};b.defaultFloor&&(_.defaultFloor=b.defaultFloor),r.push(_)}if(e.outdoors){let b={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(b)}return{"floorstack.json":r,"mapstack.geojson":r}}o(xte,"buildFloorStacks");g();g();var Ste=Pn(_te(),1);var ZPe=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"),KPe=o((e,t)=>{let[r,n]=e,i=t.geometry.coordinates[0],s=!1;for(let l=0,c=i.length-1;l<i.length;c=l++){let[p,h]=i[l],[y,b]=i[c];h>n!=b>n&&r<(y-p)*(n-h)/(b-h)+p&&(s=!s)}return s},"pointInPolygon"),JPe=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"),QPe=o(e=>{let t=ZPe(e),r=Number.isFinite(t)?Math.max(t,1):1;return Math.sqrt(r)*1e-6},"estimatePrecision"),XP=o(e=>{try{let r=JPe(e).geometry.coordinates;if(!KPe(r,e)){let i=(0,Ste.default)(e.geometry.coordinates,QPe(e));return st([i[0],i[1]])}return st(r)}catch(t){return ut(new Error("Unable to calculate center of polygon"))}},"labelCenter");function m9(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Polygon"}o(m9,"isPolygonFeature");function Cte(e,{geometryMaps:t,nodesByGeometryId:r}){var h,y,b,_,C,P,E,w,O;let n=i3e(e.defaultStyle),i={},s={},l={},c={};for(let D of rn(e.geometry)){let A=e.geometry[D];if(!A)continue;let k=[],j=[],W=[],Y=[];for(let N of A.features){let Z=N.properties.id,le=n.has(Z),se=(h=r.get(Z))!=null?h:[];for(let U of(b=(y=t.space.get(Z))==null?void 0:y.features)!=null?b:[])k.push(e3e(U,se));for(let U of(C=(_=t.obstruction.get(Z))==null?void 0:_.features)!=null?C:[])j.push(t3e(U,le));for(let U of(E=(P=t.area.get(Z))==null?void 0:P.features)!=null?E:[])W.push(r3e(U,se));for(let U of(O=(w=t.window.get(Z))==null?void 0:w.features)!=null?O:[])Y.push(n3e(U))}k.length>0&&(i[D]={type:"FeatureCollection",features:k.filter(N=>N!==null)}),j.length>0&&(s[D]={type:"FeatureCollection",features:j.filter(N=>N!==null)}),W.length>0&&(l[D]={type:"FeatureCollection",features:W.filter(N=>N!==null)}),Y.length>0&&(c[D]={type:"FeatureCollection",features:Y.filter(N=>N!==null)})}let p={space:i,obstruction:s};return Object.keys(l).length>0&&(p.area=l),Object.keys(c).length>0&&(p.window=c),p}o(Cte,"buildGeometry");function e3e(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}),m9(r)&&(r.properties.center=XP(r).unwrapOr(void 0)),r}o(e3e,"buildSpace");function t3e(e,t){var i,s;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:(s=(i=r.details)==null?void 0:i.externalId)!=null?s:"",entrances:[],kind:r.kind,footprintComponent:t}};return m9(n)&&(n.properties.center=XP(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(t3e,"buildObstruction");function r3e(e,t){var i,s;if(e.geometry.type!=="Polygon")return null;let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(s=(i=r.details)==null?void 0:i.externalId)!=null?s:"",destinationNodes:t}};return m9(n)&&(n.properties.center=XP(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(r3e,"buildArea");function n3e(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}o(n3e,"buildWindow");function i3e(e){var n,i,s,l;let t=[...(i=(n=e==null?void 0:e.ExteriorWalls)==null?void 0:n.geometryAnchors)!=null?i:[],...(l=(s=e==null?void 0:e.Walls)==null?void 0:s.geometryAnchors)!=null?l:[]];return new Set(t.map(c=>c.geometryId))}o(i3e,"calculateFootprintGeometry");g();function wte(e,{geometryMaps:t,geometryFeatureById:r}){var i,s,l,c,p,h,y,b,_,C,P,E,w;if(!e.locationCategories&&!e.locations)return{};let n={};if((i=e.locationCategories)!=null&&i.length){let O=[];for(let D of e.locationCategories){let A={id:D.id,name:D.details.name,icon:(s=D.details.icon)!=null?s:""};D.parent&&(A.parent=D.parent),O.push(A)}n["category.json"]=O}if((l=e.locations)!=null&&l.length){let O=o3e(e,{geometryFeatureById:r}),D=[];for(let A of e.locations){let k={id:A.id,name:A.details.name,categories:A.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:A.links,openingHoursSpecification:(c=A.openingHours)!=null?c:[],pictures:A.images,social:A.social,description:A.details.description,externalId:A.details.externalId,icon:A.details.icon,logo:A.logo,phone:A.phone,website:A.website};D.push(k);for(let{geometryId:j,floorId:W}of A.geometryAnchors)k.spaces.push(...(h=(p=t.space.get(j))==null?void 0:p.ids.map(Y=>({id:Y,floor:W})))!=null?h:[]),k.obstructions.push(...(b=(y=t.obstruction.get(j))==null?void 0:y.ids.map(Y=>({id:Y,floor:W})))!=null?b:[]),k.areas.push(...(C=(_=t.area.get(j))==null?void 0:_.ids.map(Y=>({id:Y,floor:W})))!=null?C:[]),k.entrances.push(...(P=O.entrancesByGeometryId.get(j))!=null?P:[]),k.connections.push(...(E=O.connectionsByGeometryId.get(j))!=null?E:[]),k.annotations.push(...(w=O.annotationsByGeometryId.get(j))!=null?w:[])}n["location.json"]=D}return n}o(wte,"buildLocations");function o3e(e,{geometryFeatureById:t}){var n,i,s;let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(e.annotations)for(let[l,c]of un(e.annotations))for(let p of c!=null?c:[]){let h=p.geometryId,y=p.id,b=(n=r.annotationsByGeometryId.get(h))!=null?n:[];b.push({floor:l,id:y}),r.annotationsByGeometryId.set(h,b)}if(e.connections)for(let l of e.connections){let c=d9(l,t),p=Array.from(new Map([...l.entrances,...l.exits].map(h=>["".concat(h.geometryId,"_").concat(h.floorId),h])).values());for(let h of p){let y=h.geometryId;if(c){let b=(i=r.entrancesByGeometryId.get(y))!=null?i:[];b.push({floor:h.floorId,id:l.id}),r.entrancesByGeometryId.set(y,b)}else{let b=(s=r.connectionsByGeometryId.get(y))!=null?s:[];b.push(l.id),r.connectionsByGeometryId.set(y,b)}}}return r}o(o3e,"buildLocationAttachmentMaps");g();function Pte(e,t){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},i=e.manifest;if(i.features.length>0){let s=i.features[0],l=s.properties,c={type:"Feature",geometry:s.geometry,properties:{folder_struct:[],version:"2.0.0",time:l.time,name:l.name,naturalBearing:l.naturalBearing,tzid:l.tzid,map:l.mapId,org_id:l.orgId,language:l.language}};r.features.push(c)}return n}o(Pte,"buildManifest");g();function Tte(e,{geometryMaps:t}){var c,p,h,y,b,_,C,P,E,w,O,D,A,k,j;let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,i=new Map;for(let W of(p=(c=e.floors)==null?void 0:c.features)!=null?p:[])i.set(W.properties.id,W.properties.elevation);let s=new Map;for(let W of Object.values((h=e.nodes)!=null?h:{}))for(let Y of(y=W==null?void 0:W.features)!=null?y:[])for(let N of Y.properties.geometryIds)s.set(N,[...(b=s.get(N))!=null?b:[],Y.properties.id]);let l=new Map;for(let W of(_=e.connections)!=null?_:[]){let Y=W.exits.map(N=>{var Z;return re(R({},N),{nodes:(Z=s.get(N.geometryId))!=null?Z:[]})});for(let N of W.entrances){let Z=(C=s.get(N.geometryId))!=null?C:[];for(let le of Z)for(let se of Y){let U=Math.abs(((P=i.get(N.floorId))!=null?P:0)-((E=i.get(se.floorId))!=null?E:0))*W.floorCostMultiplier,ye=(w=l.get(le))!=null?w:[];ye.push(...se.nodes.map(ne=>({id:ne,weight:U+W.entryCost}))),l.set(le,ye)}}}for(let[W,Y]of un((O=e.nodes)!=null?O:{}))for(let N of(D=Y==null?void 0:Y.features)!=null?D:[]){let Z=(A=t.space.get(N.properties.geometryIds[0]))==null?void 0:A.features[0],le=(Z==null?void 0:Z.geometry.type)==="Point"&&((k=Z==null?void 0:Z.properties.details)!=null&&k.externalId)?Z.properties.details.externalId:"",se={type:"Feature",geometry:N.geometry,properties:{id:N.properties.id,floor:W,space:N.properties.geometryIds.map(U=>{var ye;return(ye=t.space.get(U))==null?void 0:ye.ids}).flat().filter(U=>U!==void 0),neighbors:[...N.properties.neighbors.map(U=>({id:U.id,weight:U.extraCost})),...(j=l.get(N.properties.id))!=null?j:[]],map:W,externalId:le}};n.push(se)}return r}o(Tte,"buildNodes");g();function s3e(e,t){var n;let r={};for(let i of e){let s=t.get(i);s&&((n=r[s])!=null||(r[s]=[]),r[s].push(i))}return r}o(s3e,"groupGeometryByType");function Ete(e,{geometryMaps:t}){var l,c,p;if(!e.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let i=[...Array.from(t.space.values()).map(h=>h.features),...Array.from(t.obstruction.values()).map(h=>h.features)],s=new Map(i.flatMap(h=>h.map(y=>[y.properties.id,y.geometry.type])));for(let[h,y]of un(e.defaultStyle)){let b=s3e(y.geometryAnchors.flatMap(_=>{var C,P,E,w;return[...(P=(C=t.space.get(_.geometryId))==null?void 0:C.ids)!=null?P:[],...(w=(E=t.obstruction.get(_.geometryId))==null?void 0:E.ids)!=null?w:[]]}),s);if(b.Point&&b.Point.length>0){let _={points:Array.from(b.Point.values()),showImage:((l=y.extra)==null?void 0:l.showImage)!==void 0?((c=y.extra)==null?void 0:c.showImage)===!0:y.opacity!==0};n["".concat(h,".Point")]=_}if(b.LineString&&b.LineString.length>0){let _={lineStrings:Array.from(b.LineString.values()),altitude:y.altitude,color:y.color,height:y.height,opacity:y.opacity,width:y.buffer};n["".concat(h,".LineString")]=_}if(b.Polygon&&b.Polygon.length>0){let _={polygons:Array.from(b.Polygon.values()),altitude:y.altitude,color:y.color,height:y.height,opacity:y.opacity};((p=y.extra)==null?void 0:p.showImage)!==void 0&&(_.showImage=y.extra.showImage===!0),n["".concat(h,".Polygon")]=_}}return r}o(Ete,"buildStyles");var a3e=gQ().extendOptional(hee).extendOptional(Kee).extendOptional(Iee).extendOptional(qee).extendOptional(ute).extendOptional(wee).extendOptional(Oee).extendOptional(tte).extendOptional(ite).extendOptional(Gee).extendOptional(Fee).extendOptional(gJ).extendOptional(wQ).extendOptional(uee).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function l3e(e){let t=fte(e),r=vte(e,t),n=Cte(e,t),i=Tte(e,t),s=hte(e,t),l=Ete(e,t),c=xte(e,t),p=bte(e,t),h=yte(e,t),y=dte(e,t),b=wte(e,t),_=gte(e,t),C=Pte(e,t);return R(R(R(R(R(R(re(R(R(R(R(R(R({},r),n),i),s),l),c),{"tileset.json":e.tileset}),p),h),y),b),_),C)}o(l3e,"convertUnzippedStandardMVFv3ToParsedMVFv2");async function g9(e){let t=await a3e.decompress(e);return t.isOk()?st(l3e(t.value)):ut(t.error)}o(g9,"extractAndConvertMVFv3");g();function Z1(e){return e.endsWith("/")?e:"".concat(e,"/")}o(Z1,"normalizeUrl");g();var K1="https://app.mappedin.com/",Mte="https://auth.mappedin.com/";g();g();var u3e=o(e=>{let t=Date.now();return e-t},"fromNow"),YP=o((e,t)=>u3e(e)<=t*60*1e3,"shouldRefreshToken");var Lte=60,Ate=Lte*60*1e3,Ote="accessTokens";async function FI(e,t=!1){let r="".concat(e.key),n=ef.getInstance(),i=(n==null?void 0:n.loadSessionData(Ote))||{},s=Math.floor(Date.now()/1e3);if(i[r]&&!YP(i[r].expiresTimestamp*1e3,Lte))return i[r];let l=t?await c3e(e,s):await p3e(e,s),c=re(R({},i),{[r]:l});return n==null||n.saveSessionData(Ote,c),l}o(FI,"getAccessToken");async function c3e(e,t){var s;let r="".concat((s=e.baseAuthUri)!=null?s:Mte,"oauth2/token"),n=await Ku()(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(c3e,"fetchAccessTokenEnterprise");async function p3e(e,t){let r="".concat(e.baseAuthUri?Z1(e.baseAuthUri):K1,"api/api-key/token"),n=await Ku()(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(p3e,"fetchAccessToken");g();var Fte=60,Nte=Fte*60*1e3,Dte="miSasTokens";async function y9(e,t){let r="".concat(t,"__").concat(e.mapId),n=ef.getInstance(),i=(n==null?void 0:n.loadSessionData(Dte))||{};if(i[r]&&!YP(i[r].expires,Fte))return i[r];let s=await f3e(e,t),l=re(R({},i),{[r]:{token:s.token,expires:new Date(s.expires).getTime()}});return n==null||n.saveSessionData(Dte,l),s}o(y9,"getSasToken");async function f3e(e,t){let r="".concat(e.baseUri?Z1(e.baseUri):K1,"api/v1/venue/").concat(e.mapId,"/sas-token"),n=await Ku()(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(f3e,"fetchSasToken");var kte=globalThis.fetch,jte,d3e=(jte=I==null?void 0:I.env)==null?void 0:jte.npm_package_version;function Ku(){if(kte==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return kte}o(Ku,"isomorphicFetch");var v9={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function $te(e){var r;let t=R(R({},v9),e);return t.headers=re(R({},t.headers),{"mappedin-sdk-version":d3e}),t.things=[],"platformString"in e&&(t.headers=re(R({},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($te,"parseOptions");function h3e(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 s={method:"GET",headers:i};return e.secure&&(t+="&withcdntoken"),{req:s,url:t}}o(h3e,"constructParamsForRequest");async function m3e(e,t,r=!1){let n=h3e(e,t,r),i=await Ku()(n.url,n.req);if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}o(m3e,"generateAPIRequest");var g3e=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 ce.warn("No perspectives available in response!"),null;let r={};for(let[n,i]of Object.entries(t)){let s="url"in i&&typeof i.url=="string"?i.url:null,l="locale_packs"in i&&typeof i.locale_packs=="object"?i.locale_packs:null;if(s==null||l==null){ce.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}r[n]={url:s,locale_packs:l}}return r},"getPerspectivesFromResponse");async function y3e(e,t="exports/mvf/1/bundle"){var h,y;let r=$te(R(R({baseUri:"https://api-gateway.mappedin.com/"},v9),e)),n="".concat(r.baseUri+t,"?venue=").concat(r.venue,"&version=").concat((h=r.version)!=null?h:"2.0.0");r.headers["Content-Type"]="application/zip";let i=await m3e(r,n),s=i.url,l=i.locale_packs,c=(y=r.perspective)!=null?y:v9.perspective,p=g3e(i);if(c!=null&&c!==""&&p!=null){let b=p[c];b==null?ce.warn("Perspective ".concat(c," not found in response! Loading default perspective instead.")):(ce.log('Loading perspective "'.concat(c,'"')),s=b.url,l=b.locale_packs)}return{url:s,localePacks:l,updated_at:i.updated_at}}o(y3e,"getVenueMVFURL");var J1=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function b9(e,{signal:t}){let r=await(await Ku()(e,{signal:t})).arrayBuffer();return new Uint8Array(r)}o(b9,"getLanguagePackUnitArray");async function Q1(e){let r=(await import("./browser-FYYPDI6C.js")).unzipSync(e),n={};if(r["enterprise/"]!=null){n.enterprise={};let i=r["enterprise/locations.json"];i&&(n.enterprise.locations=JSON.parse(J1().decode(i)));let s=r["enterprise/locationInstances.json"];s&&(n.enterprise.locationInstances=JSON.parse(J1().decode(s)));let l=r["enterprise/categories.json"];l&&(n.enterprise.categories=JSON.parse(J1().decode(l)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(J1().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(J1().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(J1().decode(r["manifest.json"]))),n}o(Q1,"parseLanguagePack");async function Gte(e,{signal:t}){try{let r=await(await Ku()(e,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(r);return await Q1(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}o(Gte,"downloadLanguagePack");async function x9(e){return new Promise(async(t,r)=>{try{let n=e.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:i,localePacks:s}=await y3e(e,n),l=await Ku()(i).then(p=>p.arrayBuffer()),c=new Uint8Array(l);t({compressed:c,localePacks:s})}catch(n){r(n)}})}o(x9,"downloadVenueBundleMVFAPIGateway");async function I9(e,t){return new Promise(async(r,n)=>{try{let{url:i}=await v3e(e,t),s=await Ku()(i).then(c=>c.arrayBuffer()),l=new Uint8Array(s);r(l)}catch(i){n(i)}})}o(I9,"downloadMVF");async function v3e(e,t){let r=new URL("".concat(e.baseUri?Z1(e.baseUri):K1,"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 Ku()(r.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}o(v3e,"getMakerBundleURL");function ZP(e){var n,i,s,l,c,p,h,y,b,_,C,P,E,w,O,D,A,k;let t=new TextDecoder,r=t.decode.bind(t);try{let j={"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};if(e.enterprise!=null&&(j.enterprise={},(n=e.enterprise)!=null&&n["locations.json"]&&(j.enterprise.locations=JSON.parse(r((i=e.enterprise)==null?void 0:i["locations.json"]))),(s=e.enterprise)!=null&&s["categories.json"]&&(j.enterprise.categories=JSON.parse(r((l=e.enterprise)==null?void 0:l["categories.json"]))),(c=e.enterprise)!=null&&c["venue.json"]&&(j.enterprise.venue=JSON.parse(r((p=e.enterprise)==null?void 0:p["venue.json"]))),(h=e.enterprise)!=null&&h["layers.json"]&&(j.enterprise.layers=JSON.parse(r((y=e.enterprise)==null?void 0:y["layers.json"]))),(b=e.enterprise)!=null&&b["locationInstances.json"]&&(j.enterprise.locationInstances=JSON.parse(r((_=e.enterprise)==null?void 0:_["locationInstances.json"]))),(C=e.enterprise)!=null&&C["enterpriseStyles.json"]&&(j.enterprise.enterpriseStyles=JSON.parse(r((P=e.enterprise)==null?void 0:P["enterpriseStyles.json"]))),(E=e.enterprise)!=null&&E["textures.json"]&&(j.enterprise.textures=JSON.parse(r((w=e.enterprise)==null?void 0:w["textures.json"]))),(O=e.enterprise)!=null&&O["floorText.json"]&&(j.enterprise.floorText=JSON.parse(r((D=e.enterprise)==null?void 0:D["floorText.json"]))),(A=e.enterprise)!=null&&A["categoryPriorities.json"]&&(j.enterprise.categoryPriorities=JSON.parse(r((k=e.enterprise)==null?void 0:k["categoryPriorities.json"])))),e["floorstack.json"]!=null?j["floorstack.json"]=JSON.parse(r(e["floorstack.json"])):e["mapstack.json"]!=null&&(j["mapstack.json"]=JSON.parse(r(e["mapstack.json"]))),j["floorstack.json"]==null&&j["mapstack.json"]==null&&j["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(e["floor.geojson"]&&(j["floor.geojson"]=JSON.parse(r(e["floor.geojson"]))),j["floor.geojson"]==null&&j["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in e&&(j["styles.json"]=JSON.parse(r(e["styles.json"]))),"shapes.json"in e&&(j["shapes.json"]=JSON.parse(r(e["shapes.json"]))),"location.json"in e&&(j["location.json"]=JSON.parse(r(e["location.json"]))),"category.json"in e&&(j["category.json"]=JSON.parse(r(e["category.json"]))),e.annotation!=null){j.annotation={};let Y=Object.keys(e.annotation);for(let N of Y){let Z=N.replace(/\.json|\.geojson/g,"");j.annotation[Z]=JSON.parse(r(e.annotation[N]))}}let W=Object.keys(e.space);for(let Y of W){let N=Y.replace(/\.json|\.geojson/g,"");j.space[N]=JSON.parse(r(e.space[Y]))}if(e.obstruction!=null){let Y=Object.keys(e.obstruction);for(let N of Y){let Z=N.replace(/\.json|\.geojson/g,"");j.obstruction[Z]=JSON.parse(r(e.obstruction[N]))}}else j.obstruction={};if(e.entrance!=null){let Y=Object.keys(e.entrance);for(let N of Y){let Z=N.replace(/\.json|\.geojson/g,"");j.entrance[Z]=JSON.parse(r(e.entrance[N]))}}else j.entrance={};if("floorImages"in e&&e.floorImages!=null){j.floorImages={};for(let Y of Object.keys(e.floorImages)){let N=Y.replace(/\.json|\.geojson/g,"");j.floorImages[N]=JSON.parse(r(e.floorImages[Y]))}}if("textAreas"in e&&e.textAreas!=null){j.textAreas={};for(let Y of Object.keys(e.textAreas)){let N=Y.replace(/\.json|\.geojson/g,"");j.textAreas[N]=JSON.parse(r(e.textAreas[Y]))}}if("facade"in e&&e.facade!=null){j.facade={};for(let Y of Object.keys(e.facade)){let N=Y.replace(/\.json|\.geojson/g,"");j.facade[N]=JSON.parse(r(e.facade[Y]))}}if("area"in e&&e.area!=null){j.area={};for(let Y of Object.keys(e.area)){let N=Y.replace(/\.json|\.geojson/g,"");j.area[N]=JSON.parse(r(e.area[Y]))}}return j}catch(j){throw ce.error(j),new Error("MVF parsing failed! Probably encountered a bad file.")}}o(ZP,"parseMVF");function b3e(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(b3e,"validateStaticMVFFiles");async function KP(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-FYYPDI6C.js")).unzipSync(e);if(!b3e(i))throw new Error("MVF is missing some expect static files. Unzipping failed.");let s={},l=Object.keys(i);for(let c of l){if(i[c].length===0)continue;let p=c.split("/");if(p.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(p.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(p.length===1){s[p[0]]=i[c];continue}if(p[0]==="image"){ce.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else s[p[0]]==null&&(s[p[0]]={}),s[p[0]][p[1]]=i[c]}t(s)}catch(n){r(n)}})}o(KP,"unzipMVF");function bh(){let e="us",t={};function r(){return S3e(w3e(e),t)}return o(r,"getState"),{updateByUserOption(n){var i,s;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=(s=n.analytics)==null?void 0:s.baseUri)},updateTileServerBaseUrl(n){t.tileServerUri=n},updateEnvironment(n){e=n},getBaseUri(n){return e==="us"&&n?Rte.baseUri:r().baseUri},getBaseAuthUri(n=!1){return e==="us"&&n?Rte.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){e="us",t={}},__getState:r}}o(bh,"createEnvControl");var Ute=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"}),Rte=Object.freeze(re(R({},Ute),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),x3e=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"}),I3e=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"}),_3e=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 S3e(e,t){return R(R({},e),t)}o(S3e,"getAuthStateByEnvironment");var C3e={eu:x3e,us:Ute,"us-staging-enterprise":I3e,"us-staging-self-serve":_3e};function w3e(e){return C3e[e]}o(w3e,"getEnvironmentAuthState");var JP=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"),Bte=o(async e=>{let t=performance.now(),r=await g9(e);return ce.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),r.inspectErr(n=>{throw ce.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()},"unzipAndParseMVFv3ToMVFv2");async function QP(e,t="2.0.0"){switch(t){case"2.0.0":try{let r=await KP(e);return ZP(r)}catch(r){return Bte(e)}case"3.0.0":return Bte(e);default:throw new Error("Unsupported MVF version: ".concat(t))}}o(QP,"unzipAndParseMVFv2");g();function _9(e){var i,s,l,c,p,h;let t=((s=(i=e.enterprise)==null?void 0:i.locations)==null?void 0:s.reduce((y,b)=>(y[b.id]=b,y),{}))||{};for(let y of((l=e.enterprise)==null?void 0:l.locationInstances)||[])t[y.id]=y;let r={};for(let y of e["floorstack.json"]||[])r[y.id]=y;let n={};for(let y of((c=e["floor.geojson"])==null?void 0:c.features)||[])y.properties&&y.properties.id&&(n[y.properties.id]=y.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":t,"enterprise-category":((h=(p=e.enterprise)==null?void 0:p.categories)==null?void 0:h.reduce((y,b)=>(y[b.id]=b,y),{}))||{},"floor-stack":r,floor:n}}}o(_9,"parseLocalePackToLanguagePack");function Vte(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}o(Vte,"isMappedinCdnUrl");function zte(e){let t=e.split("?")[1];return!!(t!=null&&t.includes("sv="))}o(zte,"hasSasToken");g();g();g();g();var I9e={};wc(I9e,{Annotation:()=>ff,Area:()=>of,Connection:()=>Zd,Coordinate:()=>St,DOORS:()=>Q2,Directions:()=>bd,Door:()=>Au,E_SDK_LOG_LEVEL:()=>vN,EnterpriseCategory:()=>Ix,EnterpriseLocation:()=>Vc,EnterpriseVenue:()=>MC,Facade:()=>Nl,Floor:()=>ca,FloorStack:()=>Bb,Hyperlink:()=>$d,ImageMetaData:()=>Ud,LocationCategory:()=>_x,LocationProfile:()=>Qm,MAPPEDIN_COLORS:()=>fG,MapObject:()=>Oa,Node:()=>tf,PointOfInterest:()=>pf,Space:()=>wo,WALLS:()=>J2,__setWatermarkOnClickFn:()=>m9e,createMapLibreOverlay:()=>b9e,disableText3DWorker:()=>tse,enableTestMode:()=>E9,getMapData:()=>Sse,getMapDataEnterprise:()=>v9e,hydrateMapData:()=>dse,hydrateMapDataFromMVF:()=>g9e,parseMVF:()=>ZP,preloadFont:()=>q7,setLoggerLevel:()=>bN,setUseEnterpriseAPI:()=>y9e,setWorkersUrl:()=>ase,show3dMap:()=>Cse,show3dMapGeojson:()=>x9e,unzipMVF:()=>KP});g();g();g();g();var kI,RI,BI,S9=class S9{constructor(t,r,{enabled:n=!1}={}){G(this,kI);x(this,"searchInstance");G(this,RI);G(this,BI);x(this,"enabled",!1);q(this,kI,t),q(this,RI,r),q(this,BI,()=>{var i;(i=this.searchInstance)==null||i.then(s=>s.populate())}),n&&this.enable()}async query(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return ce.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,r)}catch(n){return ce.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return ce.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,r)}catch(n){return ce.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-3EBGQSTL.js").then(({InternalSearch:t})=>new t(d(this,kI)))),d(this,RI).on("language-change",d(this,BI)),await this.searchInstance)}};kI=new WeakMap,RI=new WeakMap,BI=new WeakMap,o(S9,"Search");var NI=S9;var qte=new WeakMap,Vi,w9=class w9 extends Lt{constructor(r,{search:n}={}){super();G(this,Vi);x(this,"Analytics");x(this,"Search");x(this,"Query");x(this,"internal");x(this,"getDirections",o((r,n,i)=>d(this,Vi).getDirections(r,n,i),"getDirections"));x(this,"getDirectionsMultiDestination",o((r,n,i)=>d(this,Vi).getDirectionsMultiDestination(r,n,i),"getDirectionsMultiDestination"));q(this,Vi,r),qte.set(this,r),this.Analytics=new Sx(r.Analytics),this.Query=r.Query,this.internal=r,this.Search=new NI(this,r,{enabled:n==null?void 0:n.enabled}),d(this,Vi).on("language-change",i=>{this.publish("language-change",i)})}getEnv(){return d(this,Vi).getEnv()}getAccessToken(){var r;return(r=d(this,Vi).tokenManager)==null?void 0:r.getAccessToken().token}get mapName(){return d(this,Vi).mapName}get mapCenter(){return d(this,Vi).mapCenter}get organizationId(){return d(this,Vi).organizationId}get outdoorViewToken(){return d(this,Vi).outdoorViewToken}getByType(r){return d(this,Vi).getByType(r)}getById(r,n){return d(this,Vi).getById(r,n)}getByExternalId(r,n){return d(this,Vi).getByExternalId(r,n)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return d(this,Vi).changeLanguage(r)}get currentLanguage(){return d(this,Vi).currentLanguage}get naturalBearing(){var r;return(r=d(this,Vi).naturalBearing)!=null?r:0}getDistance(r,n){return d(this,Vi).getDistance(r,n)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return d(this,Vi).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return d(this,Vi).toJSONBundle({downloadLanguagePacks:r})}};Vi=new WeakMap,o(w9,"MapData");var C9=w9,jI=C9;function $I(e){let t=qte.get(e);if(!t)throw new Error("MapDataInternal not found");return t}o($I,"getMapDataInternal");g();g();g();g();var P3e=1e-7;function P9(e){return{type:"Point",coordinates:e}}o(P9,"point");function T3e(e,t){let{coordinates:r}=t.geometry,{coordinates:n}=e.geometry,i=r.map(s=>lf(e,P9(s)));return n.reduce((s,l)=>{let c=$S(P9(l),i[0],e),p=$S(P9(l),i[1],e),h=Lm(c)<Lm(p)?c:p;return h.properties=re(R({},e.properties),{entrances:[]}),s.concat([h])},[])}o(T3e,"splitObstructionByEntrance");function T9(e,t){return t.reduce((r,n)=>{let i={epsilon:P3e},s=r.obstructions.findIndex(c=>w0(kc(n),c,i)),l=r.obstructions[s];if(l){let[c,p]=T3e(l,n);r.entrances.push(n),r.obstructions.splice(s,1,c,p)}return r},{obstructions:[e],entrances:[]})}o(T9,"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 Hte="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 Wte=!1;function E9(){Wte=!0}o(E9,"enableTestMode");function Xte(){return Wte}o(Xte,"isTestMode");var M9=class M9{constructor(t){x(this,"backgroundAlpha",1);x(this,"backgroundColor",new An);x(this,"width",0);x(this,"height",0);x(this,"options",{});x(this,"renderer");x(this,"enabledLayers",new Set([0,1]));x(this,"handleWebGLContextCreationError",o(t=>{var r,n;(n=(r=this.options).onWebGLContextCreationError)==null||n.call(r,t)},"handleWebGLContextCreationError"));x(this,"handleWebGLContextLost",o(t=>{var r,n;(n=(r=this.options).onWebGLContextLost)==null||n.call(r,t)},"handleWebGLContextLost"));x(this,"handleWebGLContextRestored",o(t=>{var r,n;(n=(r=this.options).onWebGLContextRestored)==null||n.call(r,t)},"handleWebGLContextRestored"));var r,n,i,s,l;try{this.options=t,Xte()?(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 An,"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 VN({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 An((r=t.backgroundColor)!=null?r:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(c){ce.error(c),t.onWebGLRendererError&&t.onWebGLRendererError(c)}(i=this.domElement())==null||i.addEventListener("webglcontextlost",this.handleWebGLContextLost),(s=this.domElement())==null||s.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(l=this.domElement())==null||l.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,r,n,i,s;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),(s=this.domElement())==null||s.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(xS.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){I.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(M9,"Renderer");var e3=M9;g();g();var Yte='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>J(n,typeof e!="symbol"?e+"":e,t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';g();g();g();g();g();function Zte(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(Zte,"contains");g();function Kte(e,t){let[r,n]=t;return r>=e.x&&r<=e.x+e.w&&n>=e.y&&n<=e.y+e.h}o(Kte,"intersectPoint");g();function Jte(e,t){let r=t.x,n=t.y,i=t.x+t.w,s=t.y+t.h,l=e.x,c=e.y,p=e.x+e.w,h=e.y+e.h;return r<p&&l<i&&n<h&&c<s}o(Jte,"intersects");g();function Gf(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}o(Gf,"appendItems");g();var O9=class O9{constructor(t,r,n,i,s){x(this,"x");x(this,"y");x(this,"w");x(this,"h");x(this,"userData");this.userData=typeof s>"u"?null:s,this.x=t,this.y=r,this.w=n,this.h=i}contains(t){return t===this?!1:Zte(this,t)}intersects(t){return Jte(this,t)}intersectsPoint(t){return Kte(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};o(O9,"Rectangle");var Lo=O9;var kg=class kg{constructor(t,r){x(this,"topLeft");x(this,"topRight");x(this,"bottomLeft");x(this,"bottomRight");x(this,"divided",!1);x(this,"boundary");x(this,"capacity",16);x(this,"objects",[]);x(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 kg(new Lo(t,r,n/2,i/2),this),this.topRight=new kg(new Lo(t+n/2,r,n/2,i/2),this),this.bottomLeft=new kg(new Lo(t,r+i/2,n/2,i/2),this),this.bottomRight=new kg(new Lo(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&&(Gf(r,this.topLeft.queryRect(t)),Gf(r,this.topRight.queryRect(t)),Gf(r,this.bottomLeft.queryRect(t)),Gf(r,this.bottomRight.queryRect(t))),r}queryPoint(t){let r=[];if(this.boundary.intersectsPoint(t))r.push(...this.objects);else return[];return this.divided&&(Gf(r,this.topLeft.queryPoint(t)),Gf(r,this.topRight.queryPoint(t)),Gf(r,this.bottomLeft.queryPoint(t)),Gf(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(kg,"QuadTree");var gp=kg;g();g();var Qte=["","","low","medium","high","always-visible"];function ere(e){return Math.min(5,Math.max(2,e))}o(ere,"clampTierNumber");function ev(e){if(typeof e=="number")return ere(e);let t=Qte.indexOf(e);return t===-1?3:t}o(ev,"convertCollisionRankingTierToNumber");function GI(e){let t=ere(e);return Qte[t]}o(GI,"convertNumberToCollisionRankingTier");function rre(e,t,r){let n,i,s,l=null,c=0;r||(r={});let p=o(function(){c=r.leading===!1?0:Date.now(),l=null,s=e.apply(n,i),l||(n=i=null)},"later");return function(){let h=Date.now();!c&&r.leading===!1&&(c=h);let y=t-(h-c);return n=globalThis,i=arguments,y<=0||y>t?(l&&(clearTimeout(l),l=null),c=h,s=e.apply(n,i),l||(n=i=null)):!l&&r.trailing!==!1&&(l=setTimeout(p,y)),s}}o(rre,"throttle");var Rg=!1,L9="",M3e=150,D9=class D9 extends Lt{constructor(r,n,i=L9?new Worker(L9):new Worker(URL.createObjectURL(new Blob([Yte],{type:"text/javascript"})))){super();x(this,"worker");x(this,"debugContext");x(this,"debugCanvas");x(this,"collidersDirty",!0);x(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);x(this,"visibleCollidersQTree",new gp(new Lo(0,0,0,0)));x(this,"interactiveCollidersQTree",new gp(new Lo(0,0,0,0)));x(this,"coreState");x(this,"postMessage");x(this,"showCollisionBoxes",o(()=>{Rg=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));x(this,"hideCollisionBoxes",o(()=>{Rg=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));x(this,"currentMsgId","");x(this,"working",!1);x(this,"_postMessage",o(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));x(this,"componentArray",[]);x(this,"update",o((r,n,i="bottom-left",s=!1)=>{let l=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let c;for(let p of this.coreState.geometry2DIdsInScene){let h=this.coreState.geometry2DMap.get(p);h&&(c=h.components[0],this.componentArray.push(c))}this.resize(r,n,i),this.collidersDirty=!1,l=!0}else l=this.componentArray.some(c=>c.collisionDirty===!0);l&&this.componentArray.sort((c,p)=>p.rank-c.rank);for(let c=0;c<this.componentArray.length;c++)if(this.packedMessage){let p=this.componentArray[c].toPackedMessage(s&&!l);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]=p.bboxes,this.packedMessage[0][c][1]=p.enabled&&this.componentArray[c].visible&&!this.componentArray[c].isOccluded?1:0,this.packedMessage[0][c][2]=p.rank===5?1:0,this.packedMessage[0][c][3]=p.x,this.packedMessage[0][c][4]=p.y,this.packedMessage[0][c][5]=p.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][c][6]=p.lockedToStrategyIndex}this.working||this.postMessage()},"update"));x(this,"resolve",o(r=>{if(this.working=!1,this.collidersDirty||!r.data)return;let n=r.data.colliders,i=-1,s,l,c;Rg&&(this.visibleCollidersQTree=new gp(new Lo(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new gp(new Lo(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let p=0;p<this.componentArray.length;p++){let h=this.componentArray[p];n[p]!=null&&(i=n[p][0],s=n[p][2],h.offscreen=n[p][1]===1,i!==-1&&s!=null?(c=new Lo(s.x,s.y,s.w,s.h,{entityId:h.id}),Rg&&this.visibleCollidersQTree.insert(c),l=this.coreState.geometry2DMap.get(h.id),(l==null?void 0:l.components[1])!=null&&this.interactiveCollidersQTree.insert(new Lo(s.x,s.y,s.w,s.h,{entityId:h.id})),(h.canShow===!1||h.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in h&&(h.visibilityNeedsUpdate="show"),i!==-1&&i!==h.currentStrategyIndex&&(h.activeBoundingBox=c,h.onStrategySelected(i))):((h.canShow===!0||h.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in h&&(h.visibilityNeedsUpdate="hide"),i!==-1&&i!==h.currentStrategyIndex&&h.onStrategySelected(i)))}Rg&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));x(this,"drawDebug",o(()=>{Rg&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));x(this,"destroy",o(()=>{this.worker.terminate()},"destroy"));this.coreState=n,this.debugCanvas=r,this.debugContext=r.getContext("2d"),this.worker=i,this.worker.onmessage=s=>this.resolve(s),this.postMessage=rre(this._postMessage,M3e,!1),Rg?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(D9,"CollisionSystem");var t3=D9;function A9(e){L9=e}o(A9,"setWorkerUrl");g();g();g();g();var N9=class N9{constructor(t){x(this,"type");x(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};o(N9,"Tap");var r3=N9,k9=class k9{constructor(){x(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(k9,"TapsController");var n3=k9;g();function R9(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 Ar&&n.type==="group-container"&&n.visible&&n.components[1]&&t.add(n)}return Array.from(t)}o(R9,"getUniqueIntersectedGroupContainers");var tv,B9=class B9 extends Lt{constructor(r,n,i,s,l){super();x(this,"raycaster",new Mc);x(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});x(this,"coreState");x(this,"camera");x(this,"worldPlane");x(this,"_quadtree",new gp(new Lo(0,0,0,0)));x(this,"_container");x(this,"lastPointerEvent");x(this,"cursor","grab");x(this,"touchesCount",0);x(this,"isUserInteracting");x(this,"hasTouched",!1);G(this,tv);x(this,"onPointerMoveRaf",o(r=>{this.lastPointerEvent=r,d(this,tv)&&cancelAnimationFrame(d(this,tv)),q(this,tv,requestAnimationFrame(()=>{this.onPointerMove(r)}))},"onPointerMoveRaf"));x(this,"onPointerMove",o(r=>{r.preventDefault(),this.updateInteractionStateIfPanning(r),(r.pointerType!=="touch"||r.pointerType===void 0&&this.hasTouched)&&this.handleHover(r),this.handleCursor()},"onPointerMove"));x(this,"tapsControl",new n3);x(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 r3(r)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));x(this,"clickTimeout");x(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"));x(this,"dirty3D",!0);x(this,"cachedHitBoxes",{entities:[]});x(this,"ndcPoint",new wt);x(this,"debugPanel");this.isUserInteracting=l,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=i,this._container=r,this.coreState=n,this.worldPlane=s,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(s=>{var l,c;return((l=s.object)==null?void 0:l.name)==="worldPlane"||((c=s.object)==null?void 0:c.visible)}),i=n.findIndex(s=>{var l;return((l=s.object)==null?void 0:l.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=R9(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:s,position:l,groupContainers:c}=this.intersect(n);(this.detect3DEntityHover(i)||this.detect2DEntityHover(s)||this.detect3DContainerHover(c))&&(this.state.hovered3DEntity=i,this.state.lastHover=i,this.state.hovered2DEntity=s,this.state.hovered3DContainers=c,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:l,groupContainers:c})),this.handleCursor()}handleCursor(){var l;let r=!!(this.state.hovered3DEntity&&((l=this.state.hovered3DEntity)!=null&&l.components[2])||this.state.hovered2DEntity),n=!!this.state.interaction.mouseDownStart,i=this.state.interaction.isPanning,s=D3e(r,i,n);this.cursor!==s&&(this.cursor=s,s==="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 O,D,A,k,j;let n=[r.offsetX,r.offsetY],i=this._quadtree.queryPoint(n),[s]=i.filter(W=>W.intersectsPoint(n)),l=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-l)/this._container.clientHeight)*2+1;let p=this.getThreeDIntersectsFromXY(this.ndcPoint),h=(O=p[0])==null?void 0:O.point,y=[],b=[],_=p.filter(W=>W.object.name!=="worldPlane");for(let W of _)W.object instanceof $t&&W.object.material.depthTest===!1?y.push(W):b.push(W);let C=(A=(D=y[0])!=null?D:b[0])!=null?A:void 0,P,E;if(C!=null){if(P=N3e(C.object,this.coreState.geometry3DMap),!P){let W=(k=C==null?void 0:C.instanceId)!=null?k:C==null?void 0:C.batchId;P=W!=null&&(C!=null&&C.object.userData.entities)?this.coreState.geometry3DMap.get(C==null?void 0:C.object.userData.entities[W]):this.coreState.geometry3DMap.get(C==null?void 0:C.object.userData.entityId)}P!=null&&P.components[2]&&(E=P)}let w=R9(_);return{entity2D:((j=s==null?void 0:s.userData)==null?void 0:j.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(s==null?void 0:s.userData.entityId),entity3D:E,position:h,groupContainers:w.length>0?w:void 0}}detect3DEntityHover(r){return this.state.lastHover!==r&&(this.state.lastHover&&ire(this.state.lastHover,!1,this.coreState),r&&ire(r,!0,this.coreState)),this.state.hovered3DEntity!==r}detect3DContainerHover(r){return!HN(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,s,l;this.queueDebugMessage("CLICK \n3D: ".concat((i=n.entity3D)==null?void 0:i.id," \n2D: ").concat((s=n.entity2D)==null?void 0:s.id," \nPos: ").concat((l=n.position)==null?void 0:l.toArray().join(", ")),"#fdffb6")}),this.on("hover",n=>{var i,s,l;this.queueDebugMessage("HOVER \n3D: ".concat((i=n.entity3D)==null?void 0:i.id," \n2D: ").concat((s=n.entity2D)==null?void 0:s.id," \nPos: ").concat((l=n.position)==null?void 0:l.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(r,n){var s;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,(s=this.debugPanel)==null||s.prepend(i),setTimeout(()=>{i.style.opacity="0",setTimeout(()=>{i.remove()},500)},2500)}getCursor(){return this.cursor}};tv=new WeakMap,o(B9,"InteractionSystem");var UI=B9;function ire(e,t,r){var l;let n=e.components[2];n&&n.hover!==!0&&(n.hover=t?"user-interaction":!1,n.dirty=!0);let i=(l=e.components[0].textMesh)==null?void 0:l.userData.entityId;if(!i)return;let s=r.geometry3DMap.get(i);(s==null?void 0:s.type)==="text3d"&&(s.components[1].hoverByPolygon=t,s.components[1].dirty=!0)}o(ire,"updateHover");function D3e(e,t,r){return t?"grabbing":e?"pointer":r?"grabbing":"grab"}o(D3e,"processCursor");function F3e(e){let t=e;for(;t!=null&&t.parent;){if(t instanceof Nd)return;if(t.userData.isSingleModel)return t;t=t.parent}}o(F3e,"findModelParent");function N3e(e,t){let r=F3e(e);return r?t.get(r.userData.entityId):void 0}o(N3e,"findModelParentEntity");g();g();g();var ae={};wc(ae,{BRAND:()=>aTe,DIRTY:()=>Bg,EMPTY_PATH:()=>j3e,INVALID:()=>Ot,NEVER:()=>qTe,OK:()=>Xs,ParseStatus:()=>Ss,Schema:()=>Xt,ZodAny:()=>_h,ZodArray:()=>qf,ZodBigInt:()=>Gg,ZodBoolean:()=>Ug,ZodBranded:()=>YI,ZodCatch:()=>Qg,ZodDate:()=>Vg,ZodDefault:()=>Jg,ZodDiscriminatedUnion:()=>u3,ZodEffects:()=>su,ZodEnum:()=>Zg,ZodError:()=>Ga,ZodFirstPartyTypeKind:()=>Dt,ZodFunction:()=>p3,ZodIntersection:()=>Wg,ZodIssueCode:()=>qe,ZodLazy:()=>Xg,ZodLiteral:()=>Yg,ZodMap:()=>uv,ZodNaN:()=>pv,ZodNativeEnum:()=>Kg,ZodNever:()=>Ju,ZodNull:()=>qg,ZodNullable:()=>xp,ZodNumber:()=>$g,ZodObject:()=>Ua,ZodOptional:()=>iu,ZodParsedType:()=>at,ZodPipeline:()=>ZI,ZodPromise:()=>Sh,ZodReadonly:()=>ey,ZodRecord:()=>c3,ZodSchema:()=>Xt,ZodSet:()=>cv,ZodString:()=>Ih,ZodSymbol:()=>av,ZodTransformer:()=>su,ZodTuple:()=>bp,ZodType:()=>Xt,ZodUndefined:()=>zg,ZodUnion:()=>Hg,ZodUnknown:()=>zf,ZodVoid:()=>lv,addIssueToContext:()=>tt,any:()=>gTe,array:()=>xTe,bigint:()=>pTe,boolean:()=>mre,coerce:()=>zTe,custom:()=>fre,date:()=>fTe,datetimeRegex:()=>cre,defaultErrorMap:()=>Uf,discriminatedUnion:()=>CTe,effect:()=>kTe,enum:()=>DTe,function:()=>OTe,getErrorMap:()=>rv,getParsedType:()=>vp,instanceof:()=>uTe,intersection:()=>wTe,isAborted:()=>a3,isAsync:()=>nv,isDirty:()=>l3,isValid:()=>xh,late:()=>lTe,lazy:()=>LTe,literal:()=>ATe,makeIssue:()=>VI,map:()=>ETe,nan:()=>cTe,nativeEnum:()=>FTe,never:()=>vTe,null:()=>mTe,nullable:()=>BTe,number:()=>hre,object:()=>ITe,objectUtil:()=>j9,oboolean:()=>VTe,onumber:()=>UTe,optional:()=>RTe,ostring:()=>GTe,pipeline:()=>$Te,preprocess:()=>jTe,promise:()=>NTe,quotelessJson:()=>k3e,record:()=>TTe,set:()=>MTe,setErrorMap:()=>B3e,strictObject:()=>_Te,string:()=>dre,symbol:()=>dTe,transformer:()=>kTe,tuple:()=>PTe,undefined:()=>hTe,union:()=>STe,unknown:()=>yTe,util:()=>zr,void:()=>bTe});g();g();g();g();g();var zr;(function(e){e.assertEqual=i=>{};function t(i){}o(t,"assertIs"),e.assertIs=t;function r(i){throw new Error}o(r,"assertNever"),e.assertNever=r,e.arrayToEnum=i=>{let s={};for(let l of i)s[l]=l;return s},e.getValidEnumValues=i=>{let s=e.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),l={};for(let c of s)l[c]=i[c];return e.objectValues(l)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let l in i)Object.prototype.hasOwnProperty.call(i,l)&&s.push(l);return s},e.find=(i,s)=>{for(let l of i)if(s(l))return l},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(l=>typeof l=="string"?"'".concat(l,"'"):l).join(s)}o(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(zr||(zr={}));var j9;(function(e){e.mergeShapes=(t,r)=>R(R({},t),r)})(j9||(j9={}));var at=zr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vp=o(e=>{switch(typeof e){case"undefined":return at.undefined;case"string":return at.string;case"number":return Number.isNaN(e)?at.nan:at.number;case"boolean":return at.boolean;case"function":return at.function;case"bigint":return at.bigint;case"symbol":return at.symbol;case"object":return Array.isArray(e)?at.array:e===null?at.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?at.promise:typeof Map<"u"&&e instanceof Map?at.map:typeof Set<"u"&&e instanceof Set?at.set:typeof Date<"u"&&e instanceof Date?at.date:at.object;default:return at.unknown}},"getParsedType");var qe=zr.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"]),k3e=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),o3=class o3 extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},i=o(s=>{for(let l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let c=n,p=0;for(;p<l.path.length;){let h=l.path[p];p===l.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(r(l))):c[h]=c[h]||{_errors:[]},c=c[h],p++}}},"processError");return i(this),n}static assert(t){if(!(t instanceof o3))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,zr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};o(o3,"ZodError");var Ga=o3;Ga.create=e=>new Ga(e);var R3e=o((e,t)=>{let r;switch(e.code){case qe.invalid_type:e.received===at.undefined?r="Required":r="Expected ".concat(e.expected,", received ").concat(e.received);break;case qe.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,zr.jsonStringifyReplacer));break;case qe.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(zr.joinValues(e.keys,", "));break;case qe.invalid_union:r="Invalid input";break;case qe.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(zr.joinValues(e.options));break;case qe.invalid_enum_value:r="Invalid enum value. Expected ".concat(zr.joinValues(e.options),", received '").concat(e.received,"'");break;case qe.invalid_arguments:r="Invalid function arguments";break;case qe.invalid_return_type:r="Invalid function return type";break;case qe.invalid_date:r="Invalid date";break;case qe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),typeof e.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):zr.assertNever(e.validation):e.validation!=="regex"?r="Invalid ".concat(e.validation):r="Invalid";break;case qe.too_small:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):r="Invalid input";break;case qe.too_big:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="bigint"?r="BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):r="Invalid input";break;case qe.custom:r="Invalid input";break;case qe.invalid_intersection_types:r="Intersection results could not be merged";break;case qe.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case qe.not_finite:r="Number must be finite";break;default:r=t.defaultError,zr.assertNever(e)}return{message:r}},"errorMap"),Uf=R3e;var ore=Uf;function B3e(e){ore=e}o(B3e,"setErrorMap");function rv(){return ore}o(rv,"getErrorMap");g();var VI=o(e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],l=re(R({},i),{path:s});if(i.message!==void 0)return re(R({},i),{path:s,message:i.message});let c="",p=n.filter(h=>!!h).slice().reverse();for(let h of p)c=h(l,{data:t,defaultError:c}).message;return re(R({},i),{path:s,message:c})},"makeIssue"),j3e=[];function tt(e,t){let r=rv(),n=VI({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Uf?void 0:Uf].filter(i=>!!i)});e.common.issues.push(n)}o(tt,"addIssueToContext");var s3=class s3{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return Ot;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let s=await i.key,l=await i.value;n.push({key:s,value:l})}return s3.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:s,value:l}=i;if(s.status==="aborted"||l.status==="aborted")return Ot;s.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(n[s.value]=l.value)}return{status:t.value,value:n}}};o(s3,"ParseStatus");var Ss=s3,Ot=Object.freeze({status:"aborted"}),Bg=o(e=>({status:"dirty",value:e}),"DIRTY"),Xs=o(e=>({status:"valid",value:e}),"OK"),a3=o(e=>e.status==="aborted","isAborted"),l3=o(e=>e.status==="dirty","isDirty"),xh=o(e=>e.status==="valid","isValid"),nv=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");g();g();g();var gt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(gt||(gt={}));var U9=class U9{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};o(U9,"ParseInputLazyPath");var ou=U9,sre=o((e,t)=>{if(xh(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ga(e.common.issues);return this._error=r,this._error}}},"handleResult");function Vt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:o((l,c)=>{var h,y;let{message:p}=e;return l.code==="invalid_enum_value"?{message:p!=null?p:c.defaultError}:typeof c.data>"u"?{message:(h=p!=null?p:n)!=null?h:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(y=p!=null?p:r)!=null?y:c.defaultError}},"customMap"),description:i}}o(Vt,"processCreateParams");var V9=class V9{get description(){return this._def.description}_getType(t){return vp(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:vp(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ss,ctx:{common:t.parent.common,data:t.data,parsedType:vp(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(nv(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var s;let n={common:{issues:[],async:(s=r==null?void 0:r.async)!=null?s:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vp(t)},i=this._parseSync({data:t,path:n.path,parent:n});return sre(n,i)}"~validate"(t){var n,i;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vp(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:r});return xh(s)?{value:s.value}:{issues:r.common.issues}}catch(s){(i=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(s=>xh(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vp(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(nv(i)?i:Promise.resolve(i));return sre(n,s)}refine(t,r){let n=o(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"getIssueProperties");return this._refinement((i,s)=>{let l=t(i),c=o(()=>s.addIssue(R({code:qe.custom},n(i))),"setError");return typeof Promise<"u"&&l instanceof Promise?l.then(p=>p?!0:(c(),!1)):l?!0:(c(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new su({schema:this,typeName:Dt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:o(r=>this["~validate"](r),"validate")}}optional(){return iu.create(this,this._def)}nullable(){return xp.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qf.create(this)}promise(){return Sh.create(this,this._def)}or(t){return Hg.create([this,t],this._def)}and(t){return Wg.create(this,t,this._def)}transform(t){return new su(re(R({},Vt(this._def)),{schema:this,typeName:Dt.ZodEffects,effect:{type:"transform",transform:t}}))}default(t){let r=typeof t=="function"?t:()=>t;return new Jg(re(R({},Vt(this._def)),{innerType:this,defaultValue:r,typeName:Dt.ZodDefault}))}brand(){return new YI(R({typeName:Dt.ZodBranded,type:this},Vt(this._def)))}catch(t){let r=typeof t=="function"?t:()=>t;return new Qg(re(R({},Vt(this._def)),{innerType:this,catchValue:r,typeName:Dt.ZodCatch}))}describe(t){let r=this.constructor;return new r(re(R({},this._def),{description:t}))}pipe(t){return ZI.create(this,t)}readonly(){return ey.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(V9,"ZodType");var Xt=V9,$3e=/^c[^\s-]{8,}$/i,G3e=/^[0-9a-z]+$/,U3e=/^[0-9A-HJKMNP-TV-Z]{26}$/i,V3e=/^[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,z3e=/^[a-z0-9_-]{21}$/i,q3e=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,H3e=/^[-+]?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)?)??$/,W3e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,X3e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",$9,Y3e=/^(?:(?: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])$/,Z3e=/^(?:(?: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])$/,K3e=/^(([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]))$/,J3e=/^(([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])$/,Q3e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,eTe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lre="((\\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])))",tTe=new RegExp("^".concat(lre,"$"));function ure(e){let t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?"));let r=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(r)}o(ure,"timeRegexSource");function rTe(e){return new RegExp("^".concat(ure(e),"$"))}o(rTe,"timeRegex");function cre(e){let t="".concat(lre,"T").concat(ure(e)),r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(r.join("|"),")"),new RegExp("^".concat(t,"$"))}o(cre,"datetimeRegex");function nTe(e,t){return!!((t==="v4"||!t)&&Y3e.test(e)||(t==="v6"||!t)&&K3e.test(e))}o(nTe,"isValidIP");function iTe(e,t){if(!q3e.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch(r){return!1}}o(iTe,"isValidJWT");function oTe(e,t){return!!((t==="v4"||!t)&&Z3e.test(e)||(t==="v6"||!t)&&J3e.test(e))}o(oTe,"isValidCidr");var jg=class jg extends Xt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==at.string){let s=this._getOrReturnCtx(t);return tt(s,{code:qe.invalid_type,expected:at.string,received:s.parsedType}),Ot}let n=new Ss,i;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let l=t.data.length>s.value,c=t.data.length<s.value;(l||c)&&(i=this._getOrReturnCtx(t,i),l?tt(i,{code:qe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&tt(i,{code:qe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")W3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"email",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")$9||($9=new RegExp(X3e,"u")),$9.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"emoji",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")V3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"uuid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")z3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"nanoid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")$3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"cuid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")G3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"cuid2",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")U3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"ulid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch(l){i=this._getOrReturnCtx(t,i),tt(i,{validation:"url",code:qe.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"regex",code:qe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?cre(s).test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?tTe.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?rTe(s).test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?H3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"duration",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?nTe(t.data,s.version)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"ip",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?iTe(t.data,s.alg)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"jwt",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?oTe(t.data,s.version)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"cidr",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Q3e.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"base64",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?eTe.test(t.data)||(i=this._getOrReturnCtx(t,i),tt(i,{validation:"base64url",code:qe.invalid_string,message:s.message}),n.dirty()):zr.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),R({validation:r,code:qe.invalid_string},gt.errToObj(n)))}_addCheck(t){return new jg(re(R({},this._def),{checks:[...this._def.checks,t]}))}email(t){return this._addCheck(R({kind:"email"},gt.errToObj(t)))}url(t){return this._addCheck(R({kind:"url"},gt.errToObj(t)))}emoji(t){return this._addCheck(R({kind:"emoji"},gt.errToObj(t)))}uuid(t){return this._addCheck(R({kind:"uuid"},gt.errToObj(t)))}nanoid(t){return this._addCheck(R({kind:"nanoid"},gt.errToObj(t)))}cuid(t){return this._addCheck(R({kind:"cuid"},gt.errToObj(t)))}cuid2(t){return this._addCheck(R({kind:"cuid2"},gt.errToObj(t)))}ulid(t){return this._addCheck(R({kind:"ulid"},gt.errToObj(t)))}base64(t){return this._addCheck(R({kind:"base64"},gt.errToObj(t)))}base64url(t){return this._addCheck(R({kind:"base64url"},gt.errToObj(t)))}jwt(t){return this._addCheck(R({kind:"jwt"},gt.errToObj(t)))}ip(t){return this._addCheck(R({kind:"ip"},gt.errToObj(t)))}cidr(t){return this._addCheck(R({kind:"cidr"},gt.errToObj(t)))}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck(R({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!=null?r:!1,local:(n=t==null?void 0:t.local)!=null?n:!1},gt.errToObj(t==null?void 0:t.message)))}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck(R({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision},gt.errToObj(t==null?void 0:t.message)))}duration(t){return this._addCheck(R({kind:"duration"},gt.errToObj(t)))}regex(t,r){return this._addCheck(R({kind:"regex",regex:t},gt.errToObj(r)))}includes(t,r){return this._addCheck(R({kind:"includes",value:t,position:r==null?void 0:r.position},gt.errToObj(r==null?void 0:r.message)))}startsWith(t,r){return this._addCheck(R({kind:"startsWith",value:t},gt.errToObj(r)))}endsWith(t,r){return this._addCheck(R({kind:"endsWith",value:t},gt.errToObj(r)))}min(t,r){return this._addCheck(R({kind:"min",value:t},gt.errToObj(r)))}max(t,r){return this._addCheck(R({kind:"max",value:t},gt.errToObj(r)))}length(t,r){return this._addCheck(R({kind:"length",value:t},gt.errToObj(r)))}nonempty(t){return this.min(1,gt.errToObj(t))}trim(){return new jg(re(R({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new jg(re(R({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new jg(re(R({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};o(jg,"ZodString");var Ih=jg;Ih.create=e=>{var t;return new Ih(R({checks:[],typeName:Dt.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},Vt(e)))};function sTe(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(e.toFixed(i).replace(".","")),l=Number.parseInt(t.toFixed(i).replace(".",""));return s%l/10**i}o(sTe,"floatSafeRemainder");var zI=class zI extends Xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==at.number){let s=this._getOrReturnCtx(t);return tt(s,{code:qe.invalid_type,expected:at.number,received:s.parsedType}),Ot}let n,i=new Ss;for(let s of this._def.checks)s.kind==="int"?zr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?sTe(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.not_finite,message:s.message}),i.dirty()):zr.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,gt.toString(r))}setLimit(t,r,n,i){return new zI(re(R({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:gt.toString(i)}]}))}_addCheck(t){return new zI(re(R({},this._def),{checks:[...this._def.checks,t]}))}int(t){return this._addCheck({kind:"int",message:gt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:gt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:gt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:gt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:gt.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&zr.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};o(zI,"ZodNumber");var $g=zI;$g.create=e=>new $g(R({checks:[],typeName:Dt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},Vt(e)));var qI=class qI extends Xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(s){return this._getInvalidInput(t)}if(this._getType(t)!==at.bigint)return this._getInvalidInput(t);let n,i=new Ss;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),tt(n,{code:qe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):zr.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return tt(r,{code:qe.invalid_type,expected:at.bigint,received:r.parsedType}),Ot}gte(t,r){return this.setLimit("min",t,!0,gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,gt.toString(r))}setLimit(t,r,n,i){return new qI(re(R({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:gt.toString(i)}]}))}_addCheck(t){return new qI(re(R({},this._def),{checks:[...this._def.checks,t]}))}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:gt.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};o(qI,"ZodBigInt");var Gg=qI;Gg.create=e=>{var t;return new Gg(R({checks:[],typeName:Dt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},Vt(e)))};var z9=class z9 extends Xt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==at.boolean){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.boolean,received:n.parsedType}),Ot}return Xs(t.data)}};o(z9,"ZodBoolean");var Ug=z9;Ug.create=e=>new Ug(R({typeName:Dt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},Vt(e)));var f3=class f3 extends Xt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==at.date){let s=this._getOrReturnCtx(t);return tt(s,{code:qe.invalid_type,expected:at.date,received:s.parsedType}),Ot}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return tt(s,{code:qe.invalid_date}),Ot}let n=new Ss,i;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),tt(i,{code:qe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):zr.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new f3(re(R({},this._def),{checks:[...this._def.checks,t]}))}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:gt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:gt.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};o(f3,"ZodDate");var Vg=f3;Vg.create=e=>new Vg(R({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Dt.ZodDate},Vt(e)));var q9=class q9 extends Xt{_parse(t){if(this._getType(t)!==at.symbol){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.symbol,received:n.parsedType}),Ot}return Xs(t.data)}};o(q9,"ZodSymbol");var av=q9;av.create=e=>new av(R({typeName:Dt.ZodSymbol},Vt(e)));var H9=class H9 extends Xt{_parse(t){if(this._getType(t)!==at.undefined){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.undefined,received:n.parsedType}),Ot}return Xs(t.data)}};o(H9,"ZodUndefined");var zg=H9;zg.create=e=>new zg(R({typeName:Dt.ZodUndefined},Vt(e)));var W9=class W9 extends Xt{_parse(t){if(this._getType(t)!==at.null){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.null,received:n.parsedType}),Ot}return Xs(t.data)}};o(W9,"ZodNull");var qg=W9;qg.create=e=>new qg(R({typeName:Dt.ZodNull},Vt(e)));var X9=class X9 extends Xt{constructor(){super(...arguments),this._any=!0}_parse(t){return Xs(t.data)}};o(X9,"ZodAny");var _h=X9;_h.create=e=>new _h(R({typeName:Dt.ZodAny},Vt(e)));var Y9=class Y9 extends Xt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xs(t.data)}};o(Y9,"ZodUnknown");var zf=Y9;zf.create=e=>new zf(R({typeName:Dt.ZodUnknown},Vt(e)));var Z9=class Z9 extends Xt{_parse(t){let r=this._getOrReturnCtx(t);return tt(r,{code:qe.invalid_type,expected:at.never,received:r.parsedType}),Ot}};o(Z9,"ZodNever");var Ju=Z9;Ju.create=e=>new Ju(R({typeName:Dt.ZodNever},Vt(e)));var K9=class K9 extends Xt{_parse(t){if(this._getType(t)!==at.undefined){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.void,received:n.parsedType}),Ot}return Xs(t.data)}};o(K9,"ZodVoid");var lv=K9;lv.create=e=>new lv(R({typeName:Dt.ZodVoid},Vt(e)));var ov=class ov extends Xt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==at.array)return tt(r,{code:qe.invalid_type,expected:at.array,received:r.parsedType}),Ot;if(i.exactLength!==null){let l=r.data.length>i.exactLength.value,c=r.data.length<i.exactLength.value;(l||c)&&(tt(r,{code:l?qe.too_big:qe.too_small,minimum:c?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(tt(r,{code:qe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(tt(r,{code:qe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,c)=>i.type._parseAsync(new ou(r,l,r.path,c)))).then(l=>Ss.mergeArray(n,l));let s=[...r.data].map((l,c)=>i.type._parseSync(new ou(r,l,r.path,c)));return Ss.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new ov(re(R({},this._def),{minLength:{value:t,message:gt.toString(r)}}))}max(t,r){return new ov(re(R({},this._def),{maxLength:{value:t,message:gt.toString(r)}}))}length(t,r){return new ov(re(R({},this._def),{exactLength:{value:t,message:gt.toString(r)}}))}nonempty(t){return this.min(1,t)}};o(ov,"ZodArray");var qf=ov;qf.create=(e,t)=>new qf(R({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Dt.ZodArray},Vt(t)));function iv(e){if(e instanceof Ua){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=iu.create(iv(n))}return new Ua(re(R({},e._def),{shape:o(()=>t,"shape")}))}else return e instanceof qf?new qf(re(R({},e._def),{type:iv(e.element)})):e instanceof iu?iu.create(iv(e.unwrap())):e instanceof xp?xp.create(iv(e.unwrap())):e instanceof bp?bp.create(e.items.map(t=>iv(t))):e}o(iv,"deepPartialify");var gl=class gl extends Xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=zr.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==at.object){let h=this._getOrReturnCtx(t);return tt(h,{code:qe.invalid_type,expected:at.object,received:h.parsedType}),Ot}let{status:n,ctx:i}=this._processInputParams(t),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ju&&this._def.unknownKeys==="strip"))for(let h in i.data)l.includes(h)||c.push(h);let p=[];for(let h of l){let y=s[h],b=i.data[h];p.push({key:{status:"valid",value:h},value:y._parse(new ou(i,b,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof Ju){let h=this._def.unknownKeys;if(h==="passthrough")for(let y of c)p.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(h==="strict")c.length>0&&(tt(i,{code:qe.unrecognized_keys,keys:c}),n.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let y of c){let b=i.data[y];p.push({key:{status:"valid",value:y},value:h._parse(new ou(i,b,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let h=[];for(let y of p){let b=await y.key,_=await y.value;h.push({key:b,value:_,alwaysSet:y.alwaysSet})}return h}).then(h=>Ss.mergeObjectSync(n,h)):Ss.mergeObjectSync(n,p)}get shape(){return this._def.shape()}strict(t){return gt.errToObj,new gl(R(re(R({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:o((r,n)=>{var s,l,c,p;let i=(c=(l=(s=this._def).errorMap)==null?void 0:l.call(s,r,n).message)!=null?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(p=gt.errToObj(t).message)!=null?p:i}:{message:i}},"errorMap")}:{}))}strip(){return new gl(re(R({},this._def),{unknownKeys:"strip"}))}passthrough(){return new gl(re(R({},this._def),{unknownKeys:"passthrough"}))}extend(t){return new gl(re(R({},this._def),{shape:o(()=>R(R({},this._def.shape()),t),"shape")}))}merge(t){return new gl({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:o(()=>R(R({},this._def.shape()),t._def.shape()),"shape"),typeName:Dt.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new gl(re(R({},this._def),{catchall:t}))}pick(t){let r={};for(let n of zr.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new gl(re(R({},this._def),{shape:o(()=>r,"shape")}))}omit(t){let r={};for(let n of zr.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new gl(re(R({},this._def),{shape:o(()=>r,"shape")}))}deepPartial(){return iv(this)}partial(t){let r={};for(let n of zr.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new gl(re(R({},this._def),{shape:o(()=>r,"shape")}))}required(t){let r={};for(let n of zr.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof iu;)s=s._def.innerType;r[n]=s}return new gl(re(R({},this._def),{shape:o(()=>r,"shape")}))}keyof(){return pre(zr.objectKeys(this.shape))}};o(gl,"ZodObject");var Ua=gl;Ua.create=(e,t)=>new Ua(R({shape:o(()=>e,"shape"),unknownKeys:"strip",catchall:Ju.create(),typeName:Dt.ZodObject},Vt(t)));Ua.strictCreate=(e,t)=>new Ua(R({shape:o(()=>e,"shape"),unknownKeys:"strict",catchall:Ju.create(),typeName:Dt.ZodObject},Vt(t)));Ua.lazycreate=(e,t)=>new Ua(R({shape:e,unknownKeys:"strip",catchall:Ju.create(),typeName:Dt.ZodObject},Vt(t)));var J9=class J9 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let l=s.map(c=>new Ga(c.ctx.common.issues));return tt(r,{code:qe.invalid_union,unionErrors:l}),Ot}if(o(i,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let l=re(R({},r),{common:re(R({},r.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(i);{let s,l=[];for(let p of n){let h=re(R({},r),{common:re(R({},r.common),{issues:[]}),parent:null}),y=p._parseSync({data:r.data,path:r.path,parent:h});if(y.status==="valid")return y;y.status==="dirty"&&!s&&(s={result:y,ctx:h}),h.common.issues.length&&l.push(h.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let c=l.map(p=>new Ga(p));return tt(r,{code:qe.invalid_union,unionErrors:c}),Ot}}get options(){return this._def.options}};o(J9,"ZodUnion");var Hg=J9;Hg.create=(e,t)=>new Hg(R({options:e,typeName:Dt.ZodUnion},Vt(t)));var Vf=o(e=>e instanceof Xg?Vf(e.schema):e instanceof su?Vf(e.innerType()):e instanceof Yg?[e.value]:e instanceof Zg?e.options:e instanceof Kg?zr.objectValues(e.enum):e instanceof Jg?Vf(e._def.innerType):e instanceof zg?[void 0]:e instanceof qg?[null]:e instanceof iu?[void 0,...Vf(e.unwrap())]:e instanceof xp?[null,...Vf(e.unwrap())]:e instanceof YI||e instanceof ey?Vf(e.unwrap()):e instanceof Qg?Vf(e._def.innerType):[],"getDiscriminator"),d3=class d3 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==at.object)return tt(r,{code:qe.invalid_type,expected:at.object,received:r.parsedType}),Ot;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(tt(r,{code:qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ot)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let s of r){let l=Vf(s.shape[t]);if(!l.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let c of l){if(i.has(c))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(c)));i.set(c,s)}}return new d3(R({typeName:Dt.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i},Vt(n)))}};o(d3,"ZodDiscriminatedUnion");var u3=d3;function G9(e,t){let r=vp(e),n=vp(t);if(e===t)return{valid:!0,data:e};if(r===at.object&&n===at.object){let i=zr.objectKeys(t),s=zr.objectKeys(e).filter(c=>i.indexOf(c)!==-1),l=R(R({},e),t);for(let c of s){let p=G9(e[c],t[c]);if(!p.valid)return{valid:!1};l[c]=p.data}return{valid:!0,data:l}}else if(r===at.array&&n===at.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let s=0;s<e.length;s++){let l=e[s],c=t[s],p=G9(l,c);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return r===at.date&&n===at.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}o(G9,"mergeValues");var Q9=class Q9 extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=o((s,l)=>{if(a3(s)||a3(l))return Ot;let c=G9(s.value,l.value);return c.valid?((l3(s)||l3(l))&&r.dirty(),{status:r.value,value:c.data}):(tt(n,{code:qe.invalid_intersection_types}),Ot)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,l])=>i(s,l)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};o(Q9,"ZodIntersection");var Wg=Q9;Wg.create=(e,t,r)=>new Wg(R({left:e,right:t,typeName:Dt.ZodIntersection},Vt(r)));var h3=class h3 extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.array)return tt(n,{code:qe.invalid_type,expected:at.array,received:n.parsedType}),Ot;if(n.data.length<this._def.items.length)return tt(n,{code:qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ot;!this._def.rest&&n.data.length>this._def.items.length&&(tt(n,{code:qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((l,c)=>{let p=this._def.items[c]||this._def.rest;return p?p._parse(new ou(n,l,n.path,c)):null}).filter(l=>!!l);return n.common.async?Promise.all(s).then(l=>Ss.mergeArray(r,l)):Ss.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new h3(re(R({},this._def),{rest:t}))}};o(h3,"ZodTuple");var bp=h3;bp.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bp(R({items:e,typeName:Dt.ZodTuple,rest:null},Vt(t)))};var HI=class HI extends Xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.object)return tt(n,{code:qe.invalid_type,expected:at.object,received:n.parsedType}),Ot;let i=[],s=this._def.keyType,l=this._def.valueType;for(let c in n.data)i.push({key:s._parse(new ou(n,c,n.path,c)),value:l._parse(new ou(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?Ss.mergeObjectAsync(r,i):Ss.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Xt?new HI(R({keyType:t,valueType:r,typeName:Dt.ZodRecord},Vt(n))):new HI(R({keyType:Ih.create(),valueType:t,typeName:Dt.ZodRecord},Vt(r)))}};o(HI,"ZodRecord");var c3=HI,e7=class e7 extends Xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.map)return tt(n,{code:qe.invalid_type,expected:at.map,received:n.parsedType}),Ot;let i=this._def.keyType,s=this._def.valueType,l=[...n.data.entries()].map(([c,p],h)=>({key:i._parse(new ou(n,c,n.path,[h,"key"])),value:s._parse(new ou(n,p,n.path,[h,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let p of l){let h=await p.key,y=await p.value;if(h.status==="aborted"||y.status==="aborted")return Ot;(h.status==="dirty"||y.status==="dirty")&&r.dirty(),c.set(h.value,y.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let p of l){let h=p.key,y=p.value;if(h.status==="aborted"||y.status==="aborted")return Ot;(h.status==="dirty"||y.status==="dirty")&&r.dirty(),c.set(h.value,y.value)}return{status:r.value,value:c}}}};o(e7,"ZodMap");var uv=e7;uv.create=(e,t,r)=>new uv(R({valueType:t,keyType:e,typeName:Dt.ZodMap},Vt(r)));var WI=class WI extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.set)return tt(n,{code:qe.invalid_type,expected:at.set,received:n.parsedType}),Ot;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(tt(n,{code:qe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(tt(n,{code:qe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function l(p){let h=new Set;for(let y of p){if(y.status==="aborted")return Ot;y.status==="dirty"&&r.dirty(),h.add(y.value)}return{status:r.value,value:h}}o(l,"finalizeSet");let c=[...n.data.values()].map((p,h)=>s._parse(new ou(n,p,n.path,h)));return n.common.async?Promise.all(c).then(p=>l(p)):l(c)}min(t,r){return new WI(re(R({},this._def),{minSize:{value:t,message:gt.toString(r)}}))}max(t,r){return new WI(re(R({},this._def),{maxSize:{value:t,message:gt.toString(r)}}))}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};o(WI,"ZodSet");var cv=WI;cv.create=(e,t)=>new cv(R({valueType:e,minSize:null,maxSize:null,typeName:Dt.ZodSet},Vt(t)));var sv=class sv extends Xt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==at.function)return tt(r,{code:qe.invalid_type,expected:at.function,received:r.parsedType}),Ot;function n(c,p){return VI({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,rv(),Uf].filter(h=>!!h),issueData:{code:qe.invalid_arguments,argumentsError:p}})}o(n,"makeArgsIssue");function i(c,p){return VI({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,rv(),Uf].filter(h=>!!h),issueData:{code:qe.invalid_return_type,returnTypeError:p}})}o(i,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof Sh){let c=this;return Xs(async function(...p){let h=new Ga([]),y=await c._def.args.parseAsync(p,s).catch(C=>{throw h.addIssue(n(p,C)),h}),b=await Reflect.apply(l,this,y);return await c._def.returns._def.type.parseAsync(b,s).catch(C=>{throw h.addIssue(i(b,C)),h})})}else{let c=this;return Xs(function(...p){let h=c._def.args.safeParse(p,s);if(!h.success)throw new Ga([n(p,h.error)]);let y=Reflect.apply(l,this,h.data),b=c._def.returns.safeParse(y,s);if(!b.success)throw new Ga([i(y,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new sv(re(R({},this._def),{args:bp.create(t).rest(zf.create())}))}returns(t){return new sv(re(R({},this._def),{returns:t}))}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new sv(R({args:t||bp.create([]).rest(zf.create()),returns:r||zf.create(),typeName:Dt.ZodFunction},Vt(n)))}};o(sv,"ZodFunction");var p3=sv,t7=class t7 extends Xt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};o(t7,"ZodLazy");var Xg=t7;Xg.create=(e,t)=>new Xg(R({getter:e,typeName:Dt.ZodLazy},Vt(t)));var r7=class r7 extends Xt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return tt(r,{received:r.data,code:qe.invalid_literal,expected:this._def.value}),Ot}return{status:"valid",value:t.data}}get value(){return this._def.value}};o(r7,"ZodLiteral");var Yg=r7;Yg.create=(e,t)=>new Yg(R({value:e,typeName:Dt.ZodLiteral},Vt(t)));function pre(e,t){return new Zg(R({values:e,typeName:Dt.ZodEnum},Vt(t)))}o(pre,"createZodEnum");var XI=class XI extends Xt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return tt(r,{expected:zr.joinValues(n),received:r.parsedType,code:qe.invalid_type}),Ot}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return tt(r,{received:r.data,code:qe.invalid_enum_value,options:n}),Ot}return Xs(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return XI.create(t,R(R({},this._def),r))}exclude(t,r=this._def){return XI.create(this.options.filter(n=>!t.includes(n)),R(R({},this._def),r))}};o(XI,"ZodEnum");var Zg=XI;Zg.create=pre;var n7=class n7 extends Xt{_parse(t){let r=zr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==at.string&&n.parsedType!==at.number){let i=zr.objectValues(r);return tt(n,{expected:zr.joinValues(i),received:n.parsedType,code:qe.invalid_type}),Ot}if(this._cache||(this._cache=new Set(zr.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=zr.objectValues(r);return tt(n,{received:n.data,code:qe.invalid_enum_value,options:i}),Ot}return Xs(t.data)}get enum(){return this._def.values}};o(n7,"ZodNativeEnum");var Kg=n7;Kg.create=(e,t)=>new Kg(R({values:e,typeName:Dt.ZodNativeEnum},Vt(t)));var i7=class i7 extends Xt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==at.promise&&r.common.async===!1)return tt(r,{code:qe.invalid_type,expected:at.promise,received:r.parsedType}),Ot;let n=r.parsedType===at.promise?r.data:Promise.resolve(r.data);return Xs(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};o(i7,"ZodPromise");var Sh=i7;Sh.create=(e,t)=>new Sh(R({type:e,typeName:Dt.ZodPromise},Vt(t)));var o7=class o7 extends Xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o(l=>{tt(n,l),l.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let l=i.transform(n.data,s);if(n.common.async)return Promise.resolve(l).then(async c=>{if(r.value==="aborted")return Ot;let p=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return p.status==="aborted"?Ot:p.status==="dirty"?Bg(p.value):r.value==="dirty"?Bg(p.value):p});{if(r.value==="aborted")return Ot;let c=this._def.schema._parseSync({data:l,path:n.path,parent:n});return c.status==="aborted"?Ot:c.status==="dirty"?Bg(c.value):r.value==="dirty"?Bg(c.value):c}}if(i.type==="refinement"){let l=o(c=>{let p=i.refinement(c,s);if(n.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?Ot:(c.status==="dirty"&&r.dirty(),l(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?Ot:(c.status==="dirty"&&r.dirty(),l(c.value).then(()=>({status:r.value,value:c.value}))))}if(i.type==="transform")if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!xh(l))return Ot;let c=i.transform(l.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>xh(l)?Promise.resolve(i.transform(l.value,s)).then(c=>({status:r.value,value:c})):Ot);zr.assertNever(i)}};o(o7,"ZodEffects");var su=o7;su.create=(e,t,r)=>new su(R({schema:e,typeName:Dt.ZodEffects,effect:t},Vt(r)));su.createWithPreprocess=(e,t,r)=>new su(R({schema:t,effect:{type:"preprocess",transform:e},typeName:Dt.ZodEffects},Vt(r)));var s7=class s7 extends Xt{_parse(t){return this._getType(t)===at.undefined?Xs(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};o(s7,"ZodOptional");var iu=s7;iu.create=(e,t)=>new iu(R({innerType:e,typeName:Dt.ZodOptional},Vt(t)));var a7=class a7 extends Xt{_parse(t){return this._getType(t)===at.null?Xs(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};o(a7,"ZodNullable");var xp=a7;xp.create=(e,t)=>new xp(R({innerType:e,typeName:Dt.ZodNullable},Vt(t)));var l7=class l7 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===at.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};o(l7,"ZodDefault");var Jg=l7;Jg.create=(e,t)=>new Jg(R({innerType:e,typeName:Dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default},Vt(t)));var u7=class u7 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=re(R({},r),{common:re(R({},r.common),{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:R({},n)});return nv(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ga(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ga(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o(u7,"ZodCatch");var Qg=u7;Qg.create=(e,t)=>new Qg(R({innerType:e,typeName:Dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch},Vt(t)));var c7=class c7 extends Xt{_parse(t){if(this._getType(t)!==at.nan){let n=this._getOrReturnCtx(t);return tt(n,{code:qe.invalid_type,expected:at.nan,received:n.parsedType}),Ot}return{status:"valid",value:t.data}}};o(c7,"ZodNaN");var pv=c7;pv.create=e=>new pv(R({typeName:Dt.ZodNaN},Vt(e)));var aTe=Symbol("zod_brand"),p7=class p7 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};o(p7,"ZodBranded");var YI=p7,m3=class m3 extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ot:s.status==="dirty"?(r.dirty(),Bg(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ot:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new m3({in:t,out:r,typeName:Dt.ZodPipeline})}};o(m3,"ZodPipeline");var ZI=m3,f7=class f7 extends Xt{_parse(t){let r=this._def.innerType._parse(t),n=o(i=>(xh(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return nv(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};o(f7,"ZodReadonly");var ey=f7;ey.create=(e,t)=>new ey(R({innerType:e,typeName:Dt.ZodReadonly},Vt(t)));function are(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}o(are,"cleanParams");function fre(e,t={},r){return e?_h.create().superRefine((n,i)=>{var l,c;let s=e(n);if(s instanceof Promise)return s.then(p=>{var h,y;if(!p){let b=are(t,n),_=(y=(h=b.fatal)!=null?h:r)!=null?y:!0;i.addIssue(re(R({code:"custom"},b),{fatal:_}))}});if(!s){let p=are(t,n),h=(c=(l=p.fatal)!=null?l:r)!=null?c:!0;i.addIssue(re(R({code:"custom"},p),{fatal:h}))}}):_h.create()}o(fre,"custom");var lTe={object:Ua.lazycreate},Dt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Dt||(Dt={}));var uTe=o((e,t={message:"Input not instance of ".concat(e.name)})=>fre(r=>r instanceof e,t),"instanceOfType"),dre=Ih.create,hre=$g.create,cTe=pv.create,pTe=Gg.create,mre=Ug.create,fTe=Vg.create,dTe=av.create,hTe=zg.create,mTe=qg.create,gTe=_h.create,yTe=zf.create,vTe=Ju.create,bTe=lv.create,xTe=qf.create,ITe=Ua.create,_Te=Ua.strictCreate,STe=Hg.create,CTe=u3.create,wTe=Wg.create,PTe=bp.create,TTe=c3.create,ETe=uv.create,MTe=cv.create,OTe=p3.create,LTe=Xg.create,ATe=Yg.create,DTe=Zg.create,FTe=Kg.create,NTe=Sh.create,kTe=su.create,RTe=iu.create,BTe=xp.create,jTe=su.createWithPreprocess,$Te=ZI.create,GTe=o(()=>dre().optional(),"ostring"),UTe=o(()=>hre().optional(),"onumber"),VTe=o(()=>mre().optional(),"oboolean"),zTe={string:o(e=>Ih.create(re(R({},e),{coerce:!0})),"string"),number:o(e=>$g.create(re(R({},e),{coerce:!0})),"number"),boolean:o(e=>Ug.create(re(R({},e),{coerce:!0})),"boolean"),bigint:o(e=>Gg.create(re(R({},e),{coerce:!0})),"bigint"),date:o(e=>Vg.create(re(R({},e),{coerce:!0})),"date")};var qTe=Ot;var gre=ae;var Cs=gre;var Hre=Pn(S7());var r2=4,BMe=8,jMe="0.6",qre="low-priority-pin",C7=ae.object({rank:ae.union([ae.enum(["low","medium","high","always-visible"]),ae.number()]).optional(),interactive:ae.union([ae.boolean(),ae.literal("pointer-events-auto")]).optional(),id:ae.string().optional(),anchor:ae.union([ae.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),ae.array(ae.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:ae.boolean().optional(),zIndex:ae.number().optional(),lowPriorityPin:ae.object({enabled:ae.boolean().optional(),size:ae.number().positive().optional(),color:ae.string().optional()}).optional()});function Wre(e,t,r){ae.array(ae.number()).min(2).max(3).parse(e),ae.string().parse(t),C7.parse(r)}o(Wre,"validateMarker");var $Me=Object.freeze({enabled:!0,size:BMe,color:"#666"}),iy=class iy{constructor(t,r={}){x(this,"id");x(this,"type","marker");x(this,"rank",0);x(this,"initialRank",0);x(this,"activeAnchor","center");x(this,"pointerEvents","none");x(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:R({},$Me)});x(this,"projection",new wt);x(this,"enabled",!0);x(this,"canShow",!1);x(this,"visible",!0);x(this,"isOccluded",!1);x(this,"offscreen",!1);x(this,"strategyIndex",-1);x(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});x(this,"dimensions",{width:0,height:0});x(this,"markerContainer");x(this,"containerEl");x(this,"contentEl",null);x(this,"contentHtml","");x(this,"style",{top:"0px",left:"0px"});x(this,"dirty",!1);x(this,"attachedDirty",!0);x(this,"collisionDirty",!0);x(this,"visibilityNeedsUpdate","show");x(this,"animation",null);x(this,"currentStrategyIndex",-1);x(this,"onStrategySelected",o((t,r=!1)=>{var i,s;if(this.currentStrategyIndex===t&&!r)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activeAnchor="center",this.markerContainer.setAttribute("data-anchor",qre);let l=this.options.lowPriorityPin,c=l.size,p=l.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(c,"px")),this.markerContainer.style.setProperty("--pin-color",p),this.markerContainer.style.opacity=jMe,this.style.top=-c/2+"px",this.style.left=-c/2+"px"}else{this.activeAnchor=(s=(i=this.strategies[t])==null?void 0:i.name)!=null?s:"center",this.markerContainer.setAttribute("data-anchor",this.activeAnchor),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:l,height:c}=this.dimensions,p=-c/2+"px",h=-l/2+"px";switch(this.style.top=p,this.style.left=h,this.activeAnchor){case"top":{this.style.top=-c+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-l+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-c+"px",this.style.left=-l+"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=-l+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=p,this.style.left=h}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left},"onStrategySelected"));x(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var n,i,s;if(this.id=(r==null?void 0:r.id)||xn(),this.options=(0,Hre.default)(this.options,r),typeof r.rank=="string")this.rank=ev(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let l=Math.trunc(I.env.NODE_ENV==="test"?iy.testId:iy.testId*10)/10;iy.testId+=.001,this.rank=l}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=(s=(i=this.markerContainer.firstElementChild)==null?void 0:i.firstElementChild)!=null?s: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 s;let{width:t,height:r}=this.dimensions;if(t===0||r===0)return[];let i=(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(l=>({name:l,getBoundingBox:o(()=>{let c=r/2,p=r/2,h=t/2,y=t/2;switch(l){case"top":{c=r,p=0;break}case"bottom":{c=0,p=r;break}case"left":{h=t,y=0;break}case"right":{h=0,y=t;break}case"top-left":{c=r,h=t,p=0,y=0;break}case"top-right":{c=r,y=t,p=0,h=0;break}case"bottom-left":{p=r,h=t,c=0,y=0;break}case"bottom-right":{p=r,y=t,c=0,h=0;break}}return[c+r2,p+r2,h+r2,y+r2]},"getBoundingBox")}));if((s=this.options.lowPriorityPin)!=null&&s.enabled&&this.options.rank!=="always-visible"){let l={name:qre,getBoundingBox:o(()=>{let c=Math.max(2,r2/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(l)}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(s=>s[4]===this.currentStrategyIndex);if(i!==-1){let s=this.packedMessage.bboxes.splice(i,1)[0];this.packedMessage.bboxes.unshift(s)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let i=0;i<this.strategies.length;i++){let s=this.strategies[i];i===this.currentStrategyIndex&&r?this.packedMessage.bboxes.unshift([...s.getBoundingBox(),i]):this.packedMessage.bboxes.push([...s.getBoundingBox(),i])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var t;return!((t=this.options.lowPriorityPin)!=null&&t.enabled)||this.options.rank==="always-visible"?-1:Array.isArray(this.options.anchor)?this.options.anchor.length:1}destroy(){}};o(iy,"MarkerComponent"),x(iy,"testId",0);var Ip=iy;g();g();g();g();g();var w7=class w7{constructor(){x(this,"hover",!1);x(this,"dirty",!1)}};o(w7,"InteractionComponent");var mv=w7;g();g();function C3(e){"@babel/helpers - typeof";return C3=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},C3(e)}o(C3,"_typeof");var GMe=/^\s+/,UMe=/\s+$/;function dt(e,t){if(e=e||"",t=t||{},e instanceof dt)return e;if(!(this instanceof dt))return new dt(e,t);var r=VMe(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(dt,"tinycolor");dt.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,s,l,c;return r=t.r/255,n=t.g/255,i=t.b/255,r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),n<=.03928?l=n/12.92:l=Math.pow((n+.055)/1.055,2.4),i<=.03928?c=i/12.92:c=Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*l+.0722*c},"getLuminance"),setAlpha:o(function(t){return this._a=ene(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:o(function(){var t=Yre(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=Yre(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=Xre(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=Xre(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 Zre(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(wi(this._r,255)*100)+"%",g:Math.round(wi(this._g,255)*100)+"%",b:Math.round(wi(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:o(function(){return this._a==1?"rgb("+Math.round(wi(this._r,255)*100)+"%, "+Math.round(wi(this._g,255)*100)+"%, "+Math.round(wi(this._b,255)*100)+"%)":"rgba("+Math.round(wi(this._r,255)*100)+"%, "+Math.round(wi(this._g,255)*100)+"%, "+Math.round(wi(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:o(function(){return this._a===0?"transparent":this._a<1?!1:oOe[Zre(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:o(function(t){var r="#"+Kre(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var s=dt(t);n="#"+Kre(s._r,s._g,s._b,s._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,s=!r&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return s?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 dt(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(KMe,arguments)},"lighten"),brighten:o(function(){return this._applyModification(JMe,arguments)},"brighten"),darken:o(function(){return this._applyModification(QMe,arguments)},"darken"),desaturate:o(function(){return this._applyModification(XMe,arguments)},"desaturate"),saturate:o(function(){return this._applyModification(YMe,arguments)},"saturate"),greyscale:o(function(){return this._applyModification(ZMe,arguments)},"greyscale"),spin:o(function(){return this._applyModification(eOe,arguments)},"spin"),_applyCombination:o(function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},"_applyCombination"),analogous:o(function(){return this._applyCombination(nOe,arguments)},"analogous"),complement:o(function(){return this._applyCombination(tOe,arguments)},"complement"),monochromatic:o(function(){return this._applyCombination(iOe,arguments)},"monochromatic"),splitcomplement:o(function(){return this._applyCombination(rOe,arguments)},"splitcomplement"),triad:o(function(){return this._applyCombination(Jre,[3])},"triad"),tetrad:o(function(){return this._applyCombination(Jre,[4])},"tetrad")};dt.fromRatio=function(e,t){if(C3(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=n2(e[n]));e=r}return dt(e,t)};function VMe(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,s=null,l=!1,c=!1;return typeof e=="string"&&(e=uOe(e)),C3(e)=="object"&&(Xf(e.r)&&Xf(e.g)&&Xf(e.b)?(t=zMe(e.r,e.g,e.b),l=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Xf(e.h)&&Xf(e.s)&&Xf(e.v)?(n=n2(e.s),i=n2(e.v),t=HMe(e.h,n,i),l=!0,c="hsv"):Xf(e.h)&&Xf(e.s)&&Xf(e.l)&&(n=n2(e.s),s=n2(e.l),t=qMe(e.h,n,s),l=!0,c="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=ene(r),{ok:l,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(VMe,"inputToRGB");function zMe(e,t,r){return{r:wi(e,255)*255,g:wi(t,255)*255,b:wi(r,255)*255}}o(zMe,"rgbToRgb");function Xre(e,t,r){e=wi(e,255),t=wi(t,255),r=wi(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,l,c=(n+i)/2;if(n==i)s=l=0;else{var p=n-i;switch(l=c>.5?p/(2-n-i):p/(n+i),n){case e:s=(t-r)/p+(t<r?6:0);break;case t:s=(r-e)/p+2;break;case r:s=(e-t)/p+4;break}s/=6}return{h:s,s:l,l:c}}o(Xre,"rgbToHsl");function qMe(e,t,r){var n,i,s;e=wi(e,360),t=wi(t,100),r=wi(r,100);function l(h,y,b){return b<0&&(b+=1),b>1&&(b-=1),b<1/6?h+(y-h)*6*b:b<1/2?y:b<2/3?h+(y-h)*(2/3-b)*6:h}if(o(l,"hue2rgb"),t===0)n=i=s=r;else{var c=r<.5?r*(1+t):r+t-r*t,p=2*r-c;n=l(p,c,e+1/3),i=l(p,c,e),s=l(p,c,e-1/3)}return{r:n*255,g:i*255,b:s*255}}o(qMe,"hslToRgb");function Yre(e,t,r){e=wi(e,255),t=wi(t,255),r=wi(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,l,c=n,p=n-i;if(l=n===0?0:p/n,n==i)s=0;else{switch(n){case e:s=(t-r)/p+(t<r?6:0);break;case t:s=(r-e)/p+2;break;case r:s=(e-t)/p+4;break}s/=6}return{h:s,s:l,v:c}}o(Yre,"rgbToHsv");function HMe(e,t,r){e=wi(e,360)*6,t=wi(t,100),r=wi(r,100);var n=Math.floor(e),i=e-n,s=r*(1-t),l=r*(1-i*t),c=r*(1-(1-i)*t),p=n%6,h=[r,l,s,s,c,r][p],y=[c,r,r,l,s,s][p],b=[s,s,c,r,r,l][p];return{r:h*255,g:y*255,b:b*255}}o(HMe,"hsvToRgb");function Zre(e,t,r,n){var i=[ec(Math.round(e).toString(16)),ec(Math.round(t).toString(16)),ec(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(Zre,"rgbToHex");function WMe(e,t,r,n,i){var s=[ec(Math.round(e).toString(16)),ec(Math.round(t).toString(16)),ec(Math.round(r).toString(16)),ec(tne(n))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}o(WMe,"rgbaToHex");function Kre(e,t,r,n){var i=[ec(tne(n)),ec(Math.round(e).toString(16)),ec(Math.round(t).toString(16)),ec(Math.round(r).toString(16))];return i.join("")}o(Kre,"rgbaToArgbHex");dt.equals=function(e,t){return!e||!t?!1:dt(e).toRgbString()==dt(t).toRgbString()};dt.random=function(){return dt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function XMe(e,t){t=t===0?0:t||10;var r=dt(e).toHsl();return r.s-=t/100,r.s=w3(r.s),dt(r)}o(XMe,"_desaturate");function YMe(e,t){t=t===0?0:t||10;var r=dt(e).toHsl();return r.s+=t/100,r.s=w3(r.s),dt(r)}o(YMe,"_saturate");function ZMe(e){return dt(e).desaturate(100)}o(ZMe,"_greyscale");function KMe(e,t){t=t===0?0:t||10;var r=dt(e).toHsl();return r.l+=t/100,r.l=w3(r.l),dt(r)}o(KMe,"_lighten");function JMe(e,t){t=t===0?0:t||10;var r=dt(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)))),dt(r)}o(JMe,"_brighten");function QMe(e,t){t=t===0?0:t||10;var r=dt(e).toHsl();return r.l-=t/100,r.l=w3(r.l),dt(r)}o(QMe,"_darken");function eOe(e,t){var r=dt(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,dt(r)}o(eOe,"_spin");function tOe(e){var t=dt(e).toHsl();return t.h=(t.h+180)%360,dt(t)}o(tOe,"_complement");function Jre(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=dt(e).toHsl(),n=[dt(e)],i=360/t,s=1;s<t;s++)n.push(dt({h:(r.h+s*i)%360,s:r.s,l:r.l}));return n}o(Jre,"polyad");function rOe(e){var t=dt(e).toHsl(),r=t.h;return[dt(e),dt({h:(r+72)%360,s:t.s,l:t.l}),dt({h:(r+216)%360,s:t.s,l:t.l})]}o(rOe,"_splitcomplement");function nOe(e,t,r){t=t||6,r=r||30;var n=dt(e).toHsl(),i=360/r,s=[dt(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,s.push(dt(n));return s}o(nOe,"_analogous");function iOe(e,t){t=t||6;for(var r=dt(e).toHsv(),n=r.h,i=r.s,s=r.v,l=[],c=1/t;t--;)l.push(dt({h:n,s:i,v:s})),s=(s+c)%1;return l}o(iOe,"_monochromatic");dt.mix=function(e,t,r){r=r===0?0:r||50;var n=dt(e).toRgb(),i=dt(t).toRgb(),s=r/100,l={r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a};return dt(l)};dt.readability=function(e,t){var r=dt(e),n=dt(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};dt.isReadable=function(e,t,r){var n=dt.readability(e,t),i,s;switch(s=!1,i=cOe(r),i.level+i.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s};dt.mostReadable=function(e,t,r){var n=null,i=0,s,l,c,p;r=r||{},l=r.includeFallbackColors,c=r.level,p=r.size;for(var h=0;h<t.length;h++)s=dt.readability(e,t[h]),s>i&&(i=s,n=dt(t[h]));return dt.isReadable(e,n,{level:c,size:p})||!l?n:(r.includeFallbackColors=!1,dt.mostReadable(e,["#fff","#000"],r))};var P7=dt.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"},oOe=dt.hexNames=sOe(P7);function sOe(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}o(sOe,"flip");function ene(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}o(ene,"boundAlpha");function wi(e,t){aOe(e)&&(e="100%");var r=lOe(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(wi,"bound01");function w3(e){return Math.min(1,Math.max(0,e))}o(w3,"clamp01");function yl(e){return parseInt(e,16)}o(yl,"parseIntFromHex");function aOe(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}o(aOe,"isOnePointZero");function lOe(e){return typeof e=="string"&&e.indexOf("%")!=-1}o(lOe,"isPercentage");function ec(e){return e.length==1?"0"+e:""+e}o(ec,"pad2");function n2(e){return e<=1&&(e=e*100+"%"),e}o(n2,"convertToPercentage");function tne(e){return Math.round(parseFloat(e)*255).toString(16)}o(tne,"convertDecimalToHex");function Qre(e){return yl(e)/255}o(Qre,"convertHexToDecimal");var Qu=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 Xf(e){return!!Qu.CSS_UNIT.exec(e)}o(Xf,"isValidCSSUnit");function uOe(e){e=e.replace(GMe,"").replace(UMe,"").toLowerCase();var t=!1;if(P7[e])e=P7[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Qu.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=Qu.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Qu.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=Qu.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Qu.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=Qu.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Qu.hex8.exec(e))?{r:yl(r[1]),g:yl(r[2]),b:yl(r[3]),a:Qre(r[4]),format:t?"name":"hex8"}:(r=Qu.hex6.exec(e))?{r:yl(r[1]),g:yl(r[2]),b:yl(r[3]),format:t?"name":"hex"}:(r=Qu.hex4.exec(e))?{r:yl(r[1]+""+r[1]),g:yl(r[2]+""+r[2]),b:yl(r[3]+""+r[3]),a:Qre(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=Qu.hex3.exec(e))?{r:yl(r[1]+""+r[1]),g:yl(r[2]+""+r[2]),b:yl(r[3]+""+r[3]),format:t?"name":"hex"}:!1}o(uOe,"stringInputToObject");function cOe(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(cOe,"validateWCAG2Parms");var j7=Pn(B7());var G7=ae.object({rank:ae.union([ae.enum(["low","medium","high","always-visible"]),ae.number()]).optional(),interactive:ae.boolean().optional(),appearance:ae.object({margin:ae.number().min(6).optional(),text:ae.object({numLines:ae.number().optional(),lineHeight:ae.number().optional(),size:ae.number().optional(),maxWidth:ae.number().optional(),foregroundColor:ae.string().optional(),backgroundColor:ae.string().optional()}).optional(),marker:ae.object({size:ae.number().optional(),foregroundColor:ae.object({active:ae.string().optional(),inactive:ae.string().optional()}).optional(),backgroundColor:ae.object({active:ae.string().optional(),inactive:ae.string().optional()}).optional(),iconSizeInterpolation:ae.object({nearZoomLevel:ae.number().optional(),farZoomLevel:ae.number().optional(),nearScale:ae.number().optional(),farScale:ae.number().optional()}).optional()}).optional()}).optional()});function Nne(e,t,r){ae.array(ae.number()).min(2).max(3).parse(e),ae.string().parse(t),G7.parse(r||{})}o(Nne,"validateLabel");var bv={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},r5e={lightOnDark:re(R({},bv),{text:re(R({},bv.text),{foregroundColor:"white",backgroundColor:"#333"}),marker:re(R({},bv.marker),{foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}})}),darkOnLight:re(R({},bv),{text:re(R({},bv.text),{foregroundColor:"#333",backgroundColor:"white"}),marker:re(R({},bv.marker),{foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}})})},n5e="LOW_PRIORITY",Ane=4,i5e=6,o5e=20,s5e=2.5,a5e=2,l5e="cover",u5e=-1/0,Dne=6.5,Fne={heightAbovePolygon:0,appearance:r5e.darkOnLight},kne=o((e,t)=>["numLines","lineHeight","size","maxWidth","foregroundColor","backgroundColor"].some(r=>{var n,i,s;return((n=t.text)==null?void 0:n[r])!=null&&((i=e.text)==null?void 0:i[r])!==((s=t.text)==null?void 0:s[r])}),"isOneOfTextDirtyOptions"),Rne=o((e,t)=>["foregroundColor","backgroundColor","icon"].some(r=>{var n,i,s;return((n=t.marker)==null?void 0:n[r])!=null&&((i=e.marker)==null?void 0:i[r])!==((s=t.marker)==null?void 0:s[r])}),"isOneOfMarkerDirtyOptions");var u2,c2,ay=class ay{constructor(t,r,n){x(this,"lines",0);x(this,"id");x(this,"rank");x(this,"type","label");x(this,"initialRank");x(this,"contextConfigured",!1);x(this,"fillText");x(this,"newStyle",{});x(this,"opacity",0);x(this,"visibilityNeedsUpdate",!1);x(this,"text");x(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});x(this,"projection",new wt);x(this,"labelCacheId");x(this,"_cache",{});x(this,"appearance");x(this,"options");x(this,"visible",!0);x(this,"enabled",!0);x(this,"isOccluded",!1);x(this,"offscreen",!1);x(this,"canShow",!1);x(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});x(this,"dimensions",{width:0,height:0});x(this,"currentStrategyIndex",-1);G(this,u2,0);x(this,"iconScale",1);G(this,c2);x(this,"dirty",!0);x(this,"textDirty",!0);x(this,"markerDirty",!0);x(this,"attachedDirty",!0);x(this,"collisionDirty",!0);x(this,"lastTextAlign");x(this,"imageHash");x(this,"markerSize",0);x(this,"iconVisible",!1);x(this,"dp");x(this,"animate",!0);x(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"));x(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var s,l;if(this.id=(s=r.id)!=null?s:xn(),this.options=(0,j7.default)({},r,Fne),this.text=t,this.dp=(c=1)=>c*n.pixelRatio,typeof r.rank=="string")this.rank=ev(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(I.env.NODE_ENV==="test"?ay.testId:ay.testId*10)/10;ay.testId+=.001,this.rank=c,this.initialRank=c}let i=(0,j7.default)({},this.options.appearance,Fne.appearance);this.appearance={margin:i.margin,text:{lineHeight:i.text.lineHeight,numLines:i.text.numLines,size:i.text.size,maxWidth:i.text.maxWidth,foregroundColor:i.text.foregroundColor,backgroundColor:i.text.backgroundColor},marker:{foregroundColor:{active:i.marker.foregroundColor.active,inactive:i.marker.foregroundColor.inactive||dt(i.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:i.marker.backgroundColor.active,inactive:i.marker.backgroundColor.inactive||dt(i.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:i.marker.icon,iconSize:i.marker.iconSize||o5e,iconPadding:(l=i.marker.iconPadding)!=null?l:a5e,iconFit:i.marker.iconFit||l5e,iconOverflow:i.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:i.marker.iconVisibleAtZoomLevel==null?u5e:i.marker.iconVisibleAtZoomLevel,iconSizeInterpolation:i.marker.iconSizeInterpolation}},this.scaledIconPadding=this.appearance.marker.iconPadding}get totalMarkerSize(){return d(this,u2)*this.iconScale}set totalMarkerSize(t){q(this,u2,t)}get scaledIconPadding(){return(d(this,c2)||this.appearance.marker.iconPadding||0)*this.iconScale}set scaledIconPadding(t){q(this,c2,t)}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(Dne),this.totalMarkerSize=Math.ceil((this.markerSize+s5e)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,i=Math.max(i5e,n),s=this.iconVisible?i/2:0,l=this.iconVisible?this.totalMarkerSize:Dne/2,c=[{name:"RIGHT",getBoundingBox:o(()=>{let p=Math.max(this.totalMarkerSize,r);return[p/2+i,p/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+t+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.totalMarkerSize/2+Ane,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"LEFT",getBoundingBox:o(()=>{let p=Math.max(this.totalMarkerSize,r);return[p/2+i,p/2+i,this.totalMarkerSize/2+t+i,this.totalMarkerSize/2+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-t-this.totalMarkerSize/2-Ane,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"TOP",getBoundingBox:o(()=>{let p=this.dp();return[r+this.totalMarkerSize/2/p+i,this.totalMarkerSize/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.totalMarkerSize/2,this.newStyle.left=-t/2},"onStrategySelected")},{name:n5e,getBoundingBox:o(()=>[l+s,l+s,l+s,l+s],"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.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/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(){}};u2=new WeakMap,c2=new WeakMap,o(ay,"LabelComponent"),x(ay,"testId",0);var $7=ay,_p=$7;g();g();var W7=class W7 extends Lt{constructor(r,n){super();x(this,"rendererState");x(this,"convertTo3DMapPosition");x(this,"textSet",new Set);x(this,"batchedTextMap",new Map);x(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var c,p,h;let n,i,s,l=[];for(let y of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(y),(n==null?void 0:n.type)==="text3d"){i=n.components[0],s=n.components[1];let b=(c=i.mesh)==null?void 0:c.parent;if(!b||!(b instanceof Ar)||!(i instanceof Ch))continue;if("textArea"in i.feature.properties&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((h=(p=i.feature.properties)==null?void 0:p.textArea)==null?void 0:h.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(b)||this.batchedTextMap.set(b,xv().then(({BatchedText:P})=>{let E=new P;return E.type="batchedtext",b.add(E),E}));let C=this.batchedTextMap.get(b);if(!C)throw new Error("batched text required");l.push(Bne({entityId:y,textComponent:i,styleComponent:s,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(y.toString()))continue;this.textSet.add(y.toString()),this.batchedTextMap.has(b)||this.batchedTextMap.set(b,xv().then(({BatchedText:P})=>{let E=new P;return E.type="batchedtext",b.add(E),E}));let C=this.batchedTextMap.get(b);if(!C)throw new Error("batched text required");l.push(Bne({entityId:y,textComponent:i,styleComponent:s,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:C,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let _=this.batchedTextMap.get(b);i.textMesh&&_&&i.polygonEntityId!=null&&Promise.all([_,Promise.resolve({meshComponent:i,styleComponent:s})]).then(([C,{meshComponent:P,styleComponent:E}])=>{let{textMesh:w}=P;if(C&&w){let O=H7(C,w);P.visible&&!O?C.add(w):!P.visible&&O&&C.remove(w)}E.flipToFaceCamera&&this.flipIfNeeded(P,r)})}return Promise.all(l)}flipIfNeeded(r,n){let i=r.textMesh;if(!i)return!1;let s=i.rotation.z,l=FE(s+n);l>Math.PI/2&&l<3*Math.PI/2&&(i.rotation.z=FE(s+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 s=n.feature.properties.textArea;if(!s)continue;let l=new wu(s.maxWidth,s.maxHeight),c=new $t(l,new _o({color:"pink"})),{textMesh:p}=n;if(!p)continue;let h=this.convertTo3DMapPosition(s.position,p2);c.position.copy(h),c.position.z=p.position.z-.1,c.rotation.z=p.rotation.z,U7.identity(),U7.makeRotationAxis(new pt(0,0,1),p.userData.rotationZ),p2.set(s.maxWidth/2,0,0),p2.applyMatrix4(U7),c.position.x-=p2.x,c.position.y-=p2.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(W7,"Text3DSystem");var F3=W7;function z7(e){xv().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}o(z7,"configureWorker");var U7=new nl,p2=new pt,V7;async function q7(e){let{preloadFont:t}=await xv();return t(e)}o(q7,"preloadFont");function xv(){return V7||(V7=import("./text3d-NFTCUL32.js").then(e=>e)),V7}o(xv,"getText3DService");async function Bne({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:s,type:l="text-area"}){return Promise.all([xv(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:c,createTroikaTextArea:p},h])=>l==="text-area"?p(h.entityId,h.meshComponent,h.styleComponent,n):c(h.entityId,h.meshComponent,h.styleComponent,n)).catch(c=>{ce.warn("Trouble creating text: ",c)}).then(c=>{if(!(c!=null&&c.text))return;let p=[Promise.resolve(c.text),i,Promise.resolve()];if(t.polygonEntityId){let h=s.geometry3DMap.get(t.polygonEntityId);if((h==null?void 0:h.type)==="geometry"){let y=h.components[0],b=h.components[1];y.textMesh=c.text,y.mesh!=null&&(c.text.position.z=b.altitude+b.height+c5e)}}else p[2]=xv().then(({syncText:h})=>h(c.text));return Promise.all(p)}).then(c=>{if(!c)return;let[p,h]=c;h.add(p),t.batchedText||(t.batchedText=h)})}o(Bne,"createText");function H7(e,t){return e._members.has(t)}o(H7,"doesBatchedTextContainsText");var c5e=.5;var p5e=ae.object({visible:ae.boolean(),color:ae.string(),flipToFaceCamera:ae.boolean(),font:ae.string().optional(),fontSize:ae.number(),margin:ae.union([ae.number(),ae.tuple([ae.number(),ae.number(),ae.number(),ae.number()])]),outlineColor:ae.string(),outlineOpacity:ae.number(),outlineBlur:ae.union([ae.number(),ae.string()]),outlineWidth:ae.number(),outlineOffsetX:ae.number(),outlineOffsetY:ae.number(),strokeWidth:ae.number(),maxWidth:ae.number().optional(),maxHeight:ae.number().optional(),strokeOpacity:ae.number(),strokeColor:ae.string(),fillOpacity:ae.number(),hoverColor:ae.string().optional(),id:ae.union([ae.string(),ae.number()]),type:ae.literal("text3d"),position:ae.tuple([ae.number(),ae.number(),ae.number()]),content:ae.string()}),jne=p5e.partial().omit({id:!0,type:!0}).strict(),$ne=jne.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),Gne=ae.object({appearance:jne.optional(),parentId:ae.string().optional()}).strict(),X7=class X7{constructor(t){x(this,"mesh",new Eu);x(this,"textMesh");x(this,"type","text3d");x(this,"feature");x(this,"parent");x(this,"batchedText");x(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?H7(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(X7,"Text3DComponent");var Ch=X7;g();var Y7=class Y7{constructor(t){x(this,"color");x(this,"dirty",!0);x(this,"visible",!0);x(this,"edgeColors");x(this,"geometry");x(this,"ranges");x(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[3]:0}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[0],this.edgeColors.array[1],this.edgeColors.array[2]]:[0,0,0]}};o(Y7,"OutlineComponent");var Iv=Y7;g();g();g();var Z7=class Z7 extends FN{constructor(r){let n=r,i=3,s=i*4;super(new Float32Array(r*s),i,r,aS,SN);x(this,"_width");x(this,"_height");x(this,"_propertiesLength");this._width=s,this._height=n,this._propertiesLength=i}setColor(r,n,i){let s=this.image.data,l=r*this._width;s[l]=n.r,s[l+1]=n.g,s[l+2]=n.b,s[l+3]=0,s[l+4]=i.r,s[l+5]=i.g,s[l+6]=i.b,s[l+7]=0,this.needsUpdate=!0}getColor(r){let n=this.image.data,i=r*this._width,s=new An(n[i],n[i+1],n[i+2]),l=new An(n[i+4],n[i+5],n[i+6]);return{color:s,topColor:l}}setTexture(r,n,i){let s=this.image.data,l=r*this._width;s[l+8]=n?1:0,s[l+9]=i?1:0,s[l+10]=0,s[l+11]=0,this.needsUpdate=!0}};o(Z7,"BatchedPropertiesTexture");var N3=Z7;g();var Une="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";g();var Vne="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of '==' comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n";var f5e=-.05,d5e=1,K7=class K7 extends Pu{constructor(r,n,i=1){super(r);x(this,"propertiesTexture");x(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});x(this,"colorSpace",Zp);x(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 N3(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=s=>{let l=this.uniforms.uGradientIntensity,c=this.uniforms.uGradientEnd,p=this.uniforms.uGradientStart,h=this.uniforms.uTopTexture,y=this.uniforms.uTexture,b=this.uniforms.uRepeatYFactor,_=this.uniforms.uBlendTexture;this.uniforms=s.uniforms,s.vertexShader=Une,s.fragmentShader=Vne,Object.assign(this.uniforms,{uGradientIntensity:l,uGradientEnd:c,uGradientStart:p,uMinSideAlpha:{value:f5e},uMaxSideAlpha:{value:d5e},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:h,uTexture:y,uRepeatYFactor:b,uBlendTexture:_})}}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=Pc,r.wrapT=Pc,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=Pc,r.wrapT=Pc,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?CN:Zp,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}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(K7,"BatchedStandardMaterial");var ly=K7;g();function zne(e,t){var c,p,h;let r=0;for(let y of e)r+=((p=(c=y.components[0])==null?void 0:c.geometry)==null?void 0:p.attributes.position.count)||0;let n=new An(t.color),i;i=new ly({color:n,side:t.side==="back"?xN:t.side==="front"?sS:Yp,opacity:(h=t.opacity)!=null?h:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let s=new bS(e.length,r,0,i),l;for(let y of e)l=y.components[0],!(!(l instanceof Mi)||!l.geometry)&&(l.mesh=s,l.material=i,l.instanceIndex=s.addGeometry(l.geometry),s.addInstance(l.instanceIndex),s.userData.entities[l.instanceIndex]=y.id,i instanceof ly&&i.setColor(l.instanceIndex,n,t.topColor?new An(t.topColor):n));return s.perObjectFrustumCulled=!0,s.matrixAutoUpdate=!1,s}o(zne,"batchGeometries");function k3(e){return dt(e).darken(30).toRgbString()}o(k3,"darkenColorForOutline");function qne(e,t,r,n){if(t.length<1)return;e.boundingBox||e.computeBoundingBox();let i=e.boundingBox,s=e.getAttribute("position"),l=e.getAttribute("normal"),c=e.getAttribute("uv"),p,h;e.index?(p=e.index.count/3,h=o(function(A,k){return e.index.getX(A*3+k)},"meshIndex")):(p=s.count/3,h=o(function(A,k){return A*3+k},"meshIndex"));let y=new nl;y.makeRotationFromQuaternion(new um().setFromEuler(new Kp(0,0,r/180*Math.PI)));let b=t.find(A=>A.face==="top"),_;b&&(_={min:n(b.bounds[1],b.bounds[0],0),max:n(b.bounds[3],b.bounds[2],i.max.z)});let C=t.find(A=>A.face==="side"),P;if(C&&(P={min:n(C.bounds[1],C.bounds[0],0),max:n(C.bounds[3],C.bounds[2],i.max.z)}),!(!P&&!_))for(let A=0;A<p;++A){let k=l.getX(h(A,0))+l.getX(h(A,1))+l.getX(h(A,2)),j=l.getY(h(A,0))+l.getY(h(A,1))+l.getY(h(A,2)),W=l.getZ(h(A,0))+l.getZ(h(A,1))+l.getZ(h(A,2)),Y=Math.abs(k),N=Math.abs(j),Z=Math.abs(W);var E,w;Y<=N&&Y<=Z?(E="x",N<=Z?w="y":w="z"):N<=Y&&N<=Z?(E="y",Y<=Z?w="x":w="z"):(E="z",Y<=N?w="x":w="y"),E==="z"&&(E=w,w="z");let le,se,U,ye,ne,Ce;if(w==="z"||E==="z"){if(!C||!P)continue;le=C.repeat.u,se=C.repeat.v,U=C.offset.u,ye=C.offset.v,ne=C.rotation,Ce=P}else{if(!b||!_)continue;le=b.repeat.u,se=b.repeat.v,U=b.offset.u,ye=b.offset.v,ne=(360-r+b.rotation)%360,Ce=_}let{min:Ie,max:Ue}=Ce,ve=new Jp;ve.position.set(Ie.x,Ie.y,0),ve.updateMatrix(),ve.updateMatrixWorld();let Te=Ie.clone().applyMatrix4(y),Q=Ue.clone().applyMatrix4(y),Qe=Math.abs(Q.x-Te.x),Ye=Math.abs(Q.y-Te.y),nt=new pt(Qe,Ye,Ue.z).applyMatrix4(ve.matrixWorld),Ae=Math.abs(nt[E]-Ie[E]),Be=Math.abs(nt[w]-Ie[w]),We=ne*Math.PI/180||0,$e=Math.cos(We),we=Math.sin(We),H=ve.matrixWorld.clone().invert(),ie=new um().setFromEuler(new Kp(0,0,r/180*Math.PI));for(let ee=0;ee<3;ee++){let Ne=new pt(s.getX(h(A,ee)),s.getY(h(A,ee)),s.getZ(h(A,ee))).applyMatrix4(H);Ne.applyQuaternion(ie);let Oe=Ne.applyMatrix4(ve.matrixWorld),Ze=Oe.x,Pt=Oe.y,Er=Oe.z;var O,D;E==="x"?O=le*(Ze-Ie[E])/Ae+U:E==="y"?O=le*(Pt-Ie[E])/Ae+U:O=le*(Er-Ie[E])/Ae+U,w==="x"?D=se*(Ze-Ie[w])/Be+ye:w==="y"?D=se*(Pt-Ie[w])/Be+ye:D=se*(Er-Ie[w])/Be+ye,O-=.5,D-=.5;let $n=O*$e-D*we+.5,ot=O*we+D*$e+.5;c.setX(h(A,ee),$n),c.setY(h(A,ee),ot)}}}o(qne,"updateUVsLegacy");g();var J7=class J7{constructor(){x(this,"focusMesh");x(this,"dirty",!0)}};o(J7,"FocusableComponent");var _v=J7;function Ko(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 fm&&e.components[1]===void 0?(e.components[1]=new mv,e.components[1].dirty=!0):e instanceof mn&&e.components[2]===void 0?(e.components[2]=new mv,e.components[2].dirty=!0):e instanceof Ar&&e.components[1]===void 0&&(e.components[1]=new mv,e.components[1].dirty=!0),!0):(e instanceof fm?e.components[1]=void 0:e instanceof mn?e.components[2]=void 0:e instanceof Ar&&(e.components[1]=void 0),!0);if(e.type==="geometry-group"){let n;for(let i of e.userData.entities3D.values())n=r.geometry3DMap.get(i),Ko(n,t,r);return!0}}return!1}o(Ko,"updateInteractivity");function Hne(e,t,r){if(!(!(r!=null&&r.color)&&!("topColor"in r))){if(r!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let n,i,s=e.components[0];for(let l of e.userData.entities3D.values())if(n=t.geometry3DMap.get(l),n){i=n.components[1],i.color===s.color&&(i.initialColor=r.color||s.color,i.color=r.color||s.color,i.dirty=!0);let c=n.components[3];c&&(c.color=k3(i.color||s.color),c.dirty=!0),i.topColor===s.topColor&&(i.topColor=r.topColor||s.topColor,i.dirty=!0)}return r.color!==void 0&&(s.color=r.color,s.dirty=!0),"topColor"in r&&(s.topColor=r.topColor,s.dirty=!0),!0}return!1}}o(Hne,"updateGroupColor");function Wne(e,t){if(t!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let r=e.components[0];return r.shading=r.shading||{},r.shading&&(t.start!==r.shading.start||t.end!==r.shading.end||t.intensity!==r.shading.intensity)&&(Object.assign(r.shading,t),e.userData.shadingDirty=!0),!0}return!1}o(Wne,"updateGroupShading");function Xne(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(Xne,"updateImageProps");function eD(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"){let n=e.components[0];for(let i of e.userData.entities3D.values()){let s=t.geometry3DMap.get(i),l;((s==null?void 0:s.type)==="geometry"||(s==null?void 0:s.type)==="model")&&(l=s.components[1],l.height===n.height&&(s.components[1].height=r,s.components[1].dirty=!0),s.components[3]&&(s.components[3].dirty=!0))}return e.components[0].height=r,!0}}return!1}o(eD,"updateHeight");function tD(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=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(tD,"updateColor");function rD(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(rD,"updatePosition");function nD(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof Ar?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}o(nD,"updateParent");function Yne(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}o(Yne,"updateEnabled");function Zne(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.anchor!==void 0&&(n.options.anchor=t.anchor,n.collisionDirty=!0),t.dynamicResize!==void 0)return n.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{C7.parse(t.options||{})}catch(i){return ce.error(i),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Ko(e,!1,r)):(n.pointerEvents="none",Ko(e,t.options.interactive,r))),Kne(e,t.options.rank),!0}}return!1}o(Zne,"updateMarker");function Kne(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=ev(t),!0):!1}o(Kne,"updateRank");function Jne(e,t,r){var n,i,s,l,c;if(t!==void 0&&e.type==="label"){let p=e.components[0];t.text!==void 0&&t.text!==p.text&&(p.text=t.text,p.textDirty=!0);try{G7.parse(t.options||{})}catch(h){ce.error(h);return}kne(p.appearance,((n=t.options)==null?void 0:n.appearance)||{})&&(p.textDirty=!0),Rne(p.appearance,((i=t.options)==null?void 0:i.appearance)||{})&&(p.markerDirty=!0),uk(p.appearance,((s=t.options)==null?void 0:s.appearance)||{}),Ko(e,(l=t.options)==null?void 0:l.interactive,r),Kne(e,(c=t.options)==null?void 0:c.rank)}}o(Jne,"updateLabel");function Qne(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}o(Qne,"updateHoverColor");function eie(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(eie,"updateHovered");function iD(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}o(iD,"updateFlipImageToFaceCamera");function Sp(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];n&&(n.visible=r,n.dirty=!0)}else e.type==="geometry-group"?e.setVisible(r):e.type==="group-container"?(e.setVisible(r),r===!1&&e.traverse(n=>{if(n instanceof JN){let i=t.geometry2DMap.get(n.userData.entityId);if(i){let s=i.components[0];s instanceof _p&&(s.canShow=r)}}})):e.type==="label"&&(e.components[0].visible=r);return!0}return!1}o(Sp,"updateVisibility");function oD(e,t,r){if(r!==void 0){if(e.type==="geometry-group"){let n=e.components[0];if(n.opacity!==r){for(let i of e.userData.entities3D.values()){let s=t.geometry3DMap.get(i),l;((s==null?void 0:s.type)==="geometry"||(s==null?void 0:s.type)==="model")&&(l=s.components[1],(!l.opacity||l.opacity===n.opacity)&&(l.opacity=r,l.dirty=!0))}return e.setOpacity(r),n.opacity=r,!0}}else if(e.type==="group-container"&&e.opacity!==r){e.setOpacity(r);let n=1;return e.parent instanceof Ar&&(n=e.parent.opacity),tie(e,t,n),!0}}return!1}o(oD,"updateOpacity");function tie(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 Ns&&i.type==="geometry-group"||i instanceof Ar&&i.type==="group-container")&&tie(i,t,n)}else if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n),s;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(s=i.components[1],s.dirty=!0)}}o(tie,"cascadeOpacity");function rie(e,t){if(t!==void 0&&e.type==="geometry-group"){let r=e.components[0];(t==null?void 0:t.texture)!=null&&r.texture!==(t==null?void 0:t.texture)&&(r.texture=t.texture,r.dirty=!0),(t==null?void 0:t.topTexture)!=null&&r.topTexture!==(t==null?void 0:t.topTexture)&&(r.topTexture=t.topTexture,r.dirty=!0)}}o(rie,"updateGroupTexture");function nie(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 Mi){let i=e.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),e.components[1].dirty=!0,!0}}return!1}o(nie,"updateIndividualGeometryTexture");function iie(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),t===0?r.visible=!1:r.visible=!0,r.dirty=!0;let s=e.parentObject3D;return(s==null?void 0:s.type)==="geometry-group"&&(s.userData.shadingDirty=!0),!0}}return!1}o(iie,"updateIndividualGeometryOpacity");function Sv(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(Sv,"updateAltitude");function R3(e,t,r){if(r!==void 0){if(e.type==="geometry-group"&&e.components[0]!=null)for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i instanceof mn&&R3(i,t,r)}else if(e.type==="geometry"){let n=e.components[3],i=e.components[1];!n&&r===!0?e.components[3]=new Iv(i.color):n&&(n.visible=r,n.dirty=!0)}return!0}return!1}o(R3,"updateOutline");function sD(e,t){if(t!==void 0){if(e.type==="geometry"){let r=e.components[0];if(e.type==="geometry"&&r&&r instanceof Mi&&r.focusable!==t)return r.focusable=t,!0}else if(e.type==="group-container"){let r=e.components[2]!==void 0;if(t===!0&&!r)return e.components[2]=new _v,!0;if(t===!1&&r)return e.components[2]=void 0,!0}}return!1}o(sD,"updateFocusable");function oie(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(oie,"updateIndividualGeometryRenderOrder");function sie(e,t,r){let{visible:n,color:i}=r;if(e.type!=="path")return;let s=e.components[0];n!=null&&Sp(e,t,n),i!=null&&tD(e,{color:i}),Object.assign(s,aD(r)),ok(r)||(s.materialDirty=!0,(r.nearRadius!=null||r.farRadius!=null)&&(s.dirty=!0),(r.nearZoomLevel!=null||r.farZoomLevel!=null)&&(s.dirty=!0))}o(sie,"handlePathUpdate");function aD(e){return il(e,m5e)}o(aD,"pickPathOptions");var m5e=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel","dashed","visibleThroughGeometry"];function aie(e){if(!(e instanceof mn&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}o(aie,"assetGeometryIsText3D");var B3=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function lie(e,t,r){Sp(e,t,r.visible);let n=e.components[1],i=il(r,B3);"margin"in r&&ce.warn("update to margin is not supported atm"),"content"in r&&ce.warn("content update is not supported atm");try{$ne.parse(i)}catch(s){ce.error(s);return}Object.keys(i).length>0&&(Object.assign(n,i),n.dirty=!0)}o(lie,"handleText3DUpdate");var g5e=["color","material","opacity","verticalOffset","rotation","position","scale"];function uie(e,t){let r=il(t,g5e),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.opacity===0?n.visible=!1:n.visible=!0,n.dirty=!0),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(uie,"handleModelStyleUpdate");var uy,Cp,j3,wh,cie,d2,$3,pie,fie,h2,G3,m2,g2,U3,lD=class lD{constructor(t){G(this,wh);G(this,uy,null);G(this,Cp);x(this,"getCurrentSceneGLTF",o(async t=>{let r=R({onlyVisible:!0,binary:!0,light:!0,scale:1},t),n=await ke(this,wh,cie).call(this),i=d(this,j3).call(this,r),s=await n.parseAsync(i,{trs:!1,maxTextureSize:1/0,onlyVisible:r.onlyVisible,binary:r.binary,scale:r.scale}),l;if(s instanceof ArrayBuffer)l=new Blob([s],{type:"application/octet-stream"});else{let c=JSON.stringify(s,null,2);l=new Blob([c],{type:"text/plain"})}return l},"getCurrentSceneGLTF"));G(this,j3,o(t=>{let{scale:r,light:n,onlyVisible:i}=t,s=new Nd,l=new co().setFromObject(d(this,Cp).entityScene);if(d(this,d2).call(this,d(this,Cp).entityScene,s,i),n){let c=new dS(16777215,.3*Math.PI);c.position.set(0,Math.max(l.max.x,l.max.y)*r*.5,l.max.y*r*4),c.lookAt(0,0,-1),c.target.position.set(0,0,-1),c.add(c.target),s.add(c)}return s},"#getExportedScene"));G(this,d2,o((t,r,n)=>{t.material&&(t instanceof cS?ke(this,wh,pie).call(this,t).forEach(i=>r.add(i)):t instanceof o0&&r.add(ke(this,wh,fie).call(this,t))),t.children.forEach(i=>{(!n||i.visible)&&d(this,d2).call(this,i,r,n)})},"#processObject3D"));G(this,$3,o((t,r,n)=>{let i=new BN({color:new An(t),metalness:0});return i.opacity=r,i.transparent=n,i},"#createStandardMaterial"));G(this,h2,o(t=>{let{geometry:r,material:n,position:i,rotation:s,quaternion:l,scale:c}=t;if(!(r!=null&&r.isBufferGeometry))return t;let p=r.attributes.position,h=r.attributes.normal,y=r.attributes.uv;return d(this,G3).call(this,p,h),d(this,g2).call(this,i,c,s,l),y&&d(this,U3).call(this,y),n!=null&&n.map&&r.type==="PlaneGeometry"&&(t.side=Yp),t},"#convertGeometry"));G(this,G3,o((t,r)=>{let n=new pt,i=new pt;for(let s=0;s<t.count;s++)n.fromBufferAttribute(t,s),d(this,m2).call(this,n),t.setXYZ(s,n.x,n.y,n.z),r&&(i.fromBufferAttribute(r,s),d(this,m2).call(this,i),r.setXYZ(s,i.x,i.y,i.z))},"#convertAttributes"));G(this,m2,o(t=>{let r=t.y;t.y=t.z,t.z=-r},"#convertVector"));G(this,g2,o((t,r,n,i)=>{let s=t.y;t.y=t.z,t.z=-s;let l=r.y;if(r.y=r.z,r.z=l,n instanceof Kp)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"));G(this,U3,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"));q(this,Cp,t),d(this,Cp).entityScene=t.entityScene,d(this,Cp).geometry3DMap=t.geometry3DMap}destroy(){q(this,uy,null)}};uy=new WeakMap,Cp=new WeakMap,j3=new WeakMap,wh=new WeakSet,cie=o(async function(){if(!d(this,uy)){let{GLTFExporter:t}=await import("./GLTFExporter-EIH246ZN.js");q(this,uy,new t)}return d(this,uy)},"#getGLTFExporter"),d2=new WeakMap,$3=new WeakMap,pie=o(function(t){var l,c;let r=[],i=((l=t.userData)!=null&&l.entities?Object.values((c=t.userData)==null?void 0:c.entities):[]).map(p=>d(this,Cp).geometry3DMap.get(p)),s=new Map;return i.forEach(p=>{var C;if(!p||!(p instanceof mn))return;let h=p.components[1],y=p.components[2];if(!h.visible||h instanceof Ac&&h.opacity===0||h instanceof kb||h instanceof CS)return;let b=y!=null&&y.hover?h.hoverColor||d(this,Cp).hoverColor:h.color,_="".concat(b,"-").concat(h.opacity,"-").concat(Number(h.visible));s.has(_)||s.set(_,[]),(C=s.get(_))==null||C.push(p)}),s.forEach((p,h)=>{let[y,b,_]=h.split("-"),C=p.reduce((O,D)=>{if(D.type==="custom-geometry")return O;let A=D.components[0];return"geometry"in A&&A.geometry instanceof AN&&O.push(A.geometry),O},[]),P=d(this,$3).call(this,y,Number(b),t.material.transparent),E=Al(C,!0),w=new $t(E,P);w.position.copy(t.position),w.rotation.copy(t.rotation),w.scale.copy(t.scale),w.visible=!!_,d(this,g2).call(this,w.position,w.scale,w.rotation,w.quaternion),r.push(d(this,h2).call(this,w))}),r},"#processBatchedMesh"),fie=o(function(t){let r=t.geometry.clone(),n=t.material,i=new _o({color:n.color,side:Yp});i.opacity=n.opacity,i.transparent=n.transparent;let s=new o0(r,i);return s.position.copy(t.position),s.rotation.copy(t.rotation),s.scale.copy(t.scale),s.visible=t.visible,d(this,h2).call(this,s)},"#processLineSegments"),h2=new WeakMap,G3=new WeakMap,m2=new WeakMap,g2=new WeakMap,U3=new WeakMap,o(lD,"ExporterSystem");var f2=lD;g();g();g();var pD=Pn(_ie());function Sie(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}o(Sie,"JSClipperError");Sie.prototype=Error.prototype;pD.default.Error=function(e){throw new Sie(e)};var Do=pD.default;var uLe="gray",cLe=.1,b2=100,fD=new Do.ClipperOffset;function pLe(e,t){fD.Clear(),t/=2;let r=e.map(i=>({X:i.x*b2,Y:i.y*b2}));fD.AddPath(r,Do.JoinType.jtMiter,Do.EndType.etClosedPolygon);let n=new Do.Paths;return fD.Execute(n,t*b2),n.length?n.map(s=>s.map(l=>({x:l.X/b2,y:l.Y/b2}))):[e]}o(pLe,"offset");function X3(e,t,r){var _,C,P,E,w;let{color:n=uLe,opacity:i=1,altitude:s=0,height:l=cLe}=r||{};Array.isArray(i)&&(i=1);let c={min:{x:1/0,y:1/0,z:s},max:{x:-1/0,y:-1/0,z:l+s},center:{x:0,y:0,z:(l+s)/2}},h=e.geometry.coordinates[0].map(O=>{let D=t(O[1],O[0]);return c.min.x=Math.min(c.min.x,D.x),c.min.y=Math.min(c.min.y,D.y),c.max.x=Math.max(c.max.x,D.x),c.max.y=Math.max(c.max.y,D.y),D});((C=(_=e.properties)==null?void 0:_.style)==null?void 0:C.edgeOffset)!=null&&e.properties.style.edgeOffset!==0||((P=e.properties)==null?void 0:P.image)!=null?h=pLe(h,((w=(E=e.properties)==null?void 0:E.style)==null?void 0:w.edgeOffset)||0):h=[h];let y=[];for(let O of h){let D=new Tc;D.moveTo(O[0].x,O[0].y),O.slice(1).forEach(W=>D.lineTo(W.x,W.y)),D.lineTo(O[0].x,O[0].y);let A=e.geometry.coordinates.slice(1);D.holes=A.map(W=>{let Y=W.map(Z=>t(Z[1],Z[0])),N=new Rd;return N.moveTo(Y[0].x,Y[0].y),Y.slice(1).forEach(Z=>N.lineTo(Z.x,Z.y)),N.lineTo(Y[0].x,Y[0].y),N});let k={bevelEnabled:!1,depth:l},j=new Ec(D,k);j.userData={style:{color:n,opacity:i}},y.push(j)}if(y.length===1)return y[0];let b=Al(y);return b.userData={style:{color:n,opacity:i},_split:!0},b}o(X3,"renderPolygonGeometry");g();var fLe="gray",dLe=.1;function Y3(e,t,r){let{color:n=fLe,opacity:i=1,altitude:s=0,height:l=dLe}=r||{};Array.isArray(i)&&(i=1);let c={min:{x:1/0,y:1/0,z:s},max:{x:-1/0,y:-1/0,z:l+s}},p={bevelEnabled:!1,depth:l},h=[];e.geometry.coordinates.forEach(b=>{let _=new Tc,C=b[0].map(w=>{let O=t(w[1],w[0]);return c.min.x=Math.min(c.min.x,O.x),c.min.y=Math.min(c.min.y,O.y),c.max.x=Math.max(c.max.x,O.x),c.max.y=Math.max(c.max.y,O.y),O});_.moveTo(C[0].x,C[0].y),C.slice(1).forEach(w=>_.lineTo(w.x,w.y)),_.lineTo(C[0].x,C[0].y);let P=b.slice(1);_.holes=P.map(w=>{let O=w.map(A=>t(A[1],A[0])),D=new Rd;return D.moveTo(O[0].x,O[0].y),O.slice(1).forEach(A=>D.lineTo(A.x,A.y)),D.lineTo(O[0].x,O[0].y),D});let E=new Ec(_,p);h.push(E)});let y=Al(h);return y.translate(0,0,s||0),y.userData={style:{color:n,opacity:i}},y}o(Y3,"renderMultiPolygonGeometry");g();var hLe="gray",dD=new Do.ClipperOffset,xa=100;function Cie(e,t,r){let{color:n=hLe,opacity:i=1,width:s=1,join:l="round",cap:c="round",height:p=.01,altitude:h=0}=r||{};Array.isArray(i)&&(i=0);let y=[];for(let E=0;E<e.geometry.coordinates.length-1;E++){let w=t(e.geometry.coordinates[E][1],e.geometry.coordinates[E][0]),O=t(e.geometry.coordinates[E+1][1],e.geometry.coordinates[E+1][0]);y.push([w,O])}dD.AddPaths(y.map(E=>E.map(w=>({X:w.x*xa,Y:w.y*xa}))),l==="round"?Do.JoinType.jsRound:l==="miter"?Do.JoinType.jsMiter:Do.JoinType.jsSquare,c==="round"?Do.EndType.etOpenRound:c==="butt"?Do.EndType.etOpenButt:Do.EndType.etOpenSquare);let b=new Do.PolyTree;dD.Execute(b,s/2*xa);let _=[],C={bevelEnabled:!1,depth:p};for(let E of b.m_AllPolys){let w=new Tc;if(E.IsHole())continue;let O=E.m_polygon;w.moveTo(O[0].X/xa,O[0].Y/xa),O.slice(1).forEach(D=>w.lineTo(D.X/xa,D.Y/xa)),w.lineTo(O[0].X/xa,O[0].Y/xa),w.holes=E.m_Childs.map(D=>{let A=new Rd,k=D.m_polygon;return A.moveTo(k[0].X/xa,k[0].Y/xa),k.slice(1).forEach(j=>A.lineTo(j.X/xa,j.Y/xa)),A.lineTo(k[0].X/xa,k[0].Y/xa),A}),_.push(new Ec(w,C))}let P=Al(_);return P.translate(0,0,h||0),P.userData={style:{color:n,opacity:i}},dD.Clear(),P}o(Cie,"renderLineStringGeometry");g();var Ia=100,mLe=.22,gLe=.01;function wie(e,t,r={}){let{width:n=mLe,height:i=gLe,color:s="gray",opacity:l=1,altitude:c=0}=r,p={min:{x:1/0,y:1/0,z:c},max:{x:-1/0,y:-1/0,z:c+i}},h={bevelEnabled:!1,depth:i},y=new Do.ClipperOffset,b=e.geometry.coordinates.map(E=>E.map(w=>t(w[1],w[0])));y.AddPaths(b.map(E=>E.map(w=>({X:w.x*Ia,Y:w.y*Ia}))),Do.JoinType.jsMiter,Do.EndType.etOpenRound);let _=new Do.PolyTree;y.Execute(_,n/2*Ia);let C=[];for(let E of _.m_AllPolys){let w=new Tc;if(E.IsHole())continue;p.min.x=Math.min(p.min.x,E.m_polygon[0].X),p.min.y=Math.min(p.min.y,E.m_polygon[0].Y),p.max.x=Math.max(p.max.x,E.m_polygon[0].X),p.max.y=Math.max(p.max.y,E.m_polygon[0].Y);let O=E.m_polygon;w.moveTo(O[0].X/Ia,O[0].Y/Ia),O.slice(1).forEach(D=>w.lineTo(D.X/Ia,D.Y/Ia)),w.lineTo(O[0].X/Ia,O[0].Y/Ia),w.holes=E.m_Childs.map(D=>{let A=new Rd,k=D.m_polygon;return A.moveTo(k[0].X/Ia,k[0].Y/Ia),k.slice(1).forEach(j=>A.lineTo(j.X/Ia,j.Y/Ia)),A.lineTo(k[0].X/Ia,k[0].Y/Ia),A}),C.push(new Ec(w,h))}let P=Al(C);return P.translate(0,0,c||0),P.userData={style:{color:s,opacity:l}},y.Clear(),P}o(wie,"renderMultiLineStringGeometry");g();g();var Pv=ae.object({type:ae.enum(["Point"]),coordinates:ae.array(ae.number()).min(2).max(3)});var yLe=ae.object({rotation:ae.array(ae.number()).length(3).optional(),altitude:ae.number().optional(),scale:ae.array(ae.number()).length(3).optional(),interactive:ae.boolean().optional(),verticalOffset:ae.number().optional(),id:ae.union([ae.number(),ae.string()]).optional()}),vLe=ae.object({type:ae.enum(["Feature"]),geometry:Pv,properties:yLe}),bLe=ae.object({type:ae.enum(["FeatureCollection"]),features:ae.array(vLe)}),xLe=ae.object({color:ae.string()}),ILe=ae.object({url:ae.string(),color:ae.string().optional(),opacity:ae.number().optional(),material:ae.record(ae.string(),xLe).optional()});function Tie(e,t,r){ae.union([ae.number(),ae.string()]).parse(e),bLe.parse(t),ILe.parse(r)}o(Tie,"validateModelGroup");var x2,I2,hD=class hD{constructor(t){x(this,"mesh");x(this,"type","model");x(this,"positionDirty",!0);x(this,"outline");x(this,"geometry");x(this,"material");x(this,"feature");x(this,"instanceIndex",-1);x(this,"visible",!0);x(this,"color",new An);x(this,"position",new pt);G(this,x2,0);G(this,I2,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return d(this,x2)}set altitude(t){this.mesh&&(this.mesh.position.z=t,q(this,x2,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(Yt.degToRad(t[0]),Yt.degToRad(t[1]),Yt.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,I2)}set opacity(t){var r,n,i;if(this.mesh){if(this.mesh.children[0]instanceof kd){for(let s of this.mesh.children)if(s instanceof kd){((r=s.userData)==null?void 0:r.originalOpacity)===void 0&&(s.userData.originalOpacity=s.material.opacity);let l=Ll(t,0,(n=s.userData)==null?void 0:n.originalOpacity,0,1);s.material.opacity=l,s.material.transparent=l<1,s.material.needsUpdate=!0}}else(i=this.mesh)==null||i.traverse(s=>{s instanceof $t&&s.material&&(Array.isArray(s.material)?s.material.forEach(l=>{Pie(l,t)}):Pie(s.material,t))});q(this,I2,t)}}};x2=new WeakMap,I2=new WeakMap,o(hD,"ModelComponent");var Eh=hD;function Pie(e,t){e.opacity!==t&&(t===1?(e.opacity=1,e.transparent=!1):(e.opacity=t,e.transparent=!0),e.needsUpdate=!0)}o(Pie,"updateMaterialOpacity");g();function Z3(e){var c,p;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 h=_Le(i,n);(c=t.mesh)==null||c.traverse(y=>{y instanceof $t&&y.material&&(Array.isArray(y.material)?y.material.forEach(b=>{h[b.name]?b.color.set(h[b.name].color):b.color.set(i)}):h[y.material.name]?y.material.color.set(h[y.material.name].color):y.material.color.set(i))})}let s=(p=t.feature.geometry.coordinates[2])!=null?p:0,l=r.verticalOffset+s;t.altitude!==l&&(t.altitude=l),r.visible!==t.visible&&(t.visible=r.visible),r.rotation&&t.setRotation(r.rotation),r.scale&&t.setScale(r.scale)}o(Z3,"applyModelGeometryStyle");function _Le(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(_Le,"consolidateColorAndMaterial");function Eie(e,t){var l,c;let r=e.components[0],i=(l=e.components[1].verticalOffset)!=null?l:0,s=r.feature.geometry.coordinates.slice();s[2]=((c=s[2])!=null?c:0)+i,r.mesh?r.mesh.position.copy(t(s)):r.position.copy(t(s))}o(Eie,"applyModelPosition");function SLe(e){let{color:t,opacity:r,topColor:n,texture:i,topTexture:s}=e;return"".concat(t).concat(r).concat(n||"").concat(i||"").concat(s||"")}o(SLe,"generateIndex");var CLe=1e4,mD=class mD extends Lt{constructor(r,n){super();x(this,"state");x(this,"convertTo3DMapPosition");x(this,"loader");x(this,"optimizePromise",[]);this.state=r,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:r}=await import("./GLTFLoader-VE3GQXID.js");return this.loader=new r,this.loader}createEntityFromFeature(r,n,i){var c,p;let s=new Mi(n),l=new mn(s,new Ac(re(R({},i),{url:(p=(c=n.properties)==null?void 0:c.image)==null?void 0:p.path})));return i!=null&&i.outline&&(l.components[3]=new Iv(k3(i.color))),l.id=r,l}createModelFromFeature(r,n,i){let s=new Eh(n),l=R({},i);n.properties.verticalOffset!=null&&(l.verticalOffset=n.properties.verticalOffset),n.properties.rotation!=null&&(l.rotation=n.properties.rotation),n.properties.scale!=null&&(l.scale=n.properties.scale);let c=new CS(l),p=new mn(s,c);return p.id=r,p}populateEntityMesh(r,n){let i=r.components[0];i.geometry=n,i.currentHeight=r.components[1].height,i.dirty=!1}async populateModelGroup(r,n,i){let s=new nl,l=new Kp,c=new um,p=new pt,h=new Eu,y=await this.getGLTFLoader(),b=new Promise(_=>{y.load(n,C=>{"entities3D"in i.userData&&(i.userData.entities3D.size>1?C.scene.traverse(P=>{let E=P;if("isMesh"in E&&E.isMesh===!0){let w=new kd(E.geometry,E.material,r.size);w.userData={entities:{}},h.add(w),i.add(h)}}):(C.scene.traverse(P=>{"isMesh"in P&&P.isMesh===!0&&(P.position.set(0,0,0),P.rotation.set(0,0,0),P.scale.set(1,1,1),P.updateMatrix())}),h.add(C.scene),i.add(h),h.userData.isSingleModel=!0,h.userData.entityId=r.values().next().value,h.userData.type="model")),_()})});return this.optimizePromise.push(b.then(()=>{var P,E,w,O,D,A,k,j,W,Y,N,Z;let _=0,C;for(let le of r.values()){if(C=this.state.geometry3DMap.get(le),!C||(C==null?void 0:C.type)!=="model")continue;let se=C.components[0],U=C.components[1],ye=C.components[0].feature;se.mesh=h,se.instanceIndex=_,Z3(C),C.components[1].dirty=!1;let{x:ne,y:Ce}=this.convertTo3DMapPosition(ye.geometry.coordinates[1],ye.geometry.coordinates[0],0);se.position.set(ne,Ce,se.altitude),l.set(Yt.degToRad((E=(P=U.rotation)==null?void 0:P[0])!=null?E:d0[0]),Yt.degToRad((O=(w=U.rotation)==null?void 0:w[1])!=null?O:d0[1]),Yt.degToRad((A=(D=U.rotation)==null?void 0:D[2])!=null?A:d0[2])),p.set((j=(k=U.scale)==null?void 0:k[0])!=null?j:f0[0],(Y=(W=U.scale)==null?void 0:W[1])!=null?Y:f0[1],(Z=(N=U.scale)==null?void 0:N[2])!=null?Z:f0[2]),c.setFromEuler(l),s.compose(se.position,c,p),h.children.forEach(Ie=>{!C||(C==null?void 0:C.type)!=="model"||!(Ie instanceof kd)||(Ie.setMatrixAt(_,s),Ie.userData.entities[_]=C.id)}),se.mesh.userData.isSingleModel&&(se.mesh.matrix.copy(s),se.mesh.matrix.decompose(se.mesh.position,se.mesh.quaternion,se.mesh.scale)),_++}this.publish("model-loaded")})),h}populateEntityGroup(r){var c;let n,i,s,l;for(let p of r.values())l=this.state.geometry3DMap.get(p),l.components[0]instanceof Mi&&(i=l.components[0].feature,s=l.components[1],i.geometry.type==="Polygon"?(n=X3(i,this.convertTo3DMapPosition,s),(c=i.properties)!=null&&c.textures&&i.properties.textures.length>0&&qne(n,i.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(l,n)):i.geometry.type==="MultiPolygon"?(n=Y3(i,this.convertTo3DMapPosition,s),this.populateEntityMesh(l,n)):i.geometry.type==="LineString"?(n=Cie(i,this.convertTo3DMapPosition,s),this.populateEntityMesh(l,n)):i.geometry.type==="MultiLineString"&&(n=wie(i,this.convertTo3DMapPosition,s),this.populateEntityMesh(l,n)));return r}optimize(r){var n;if((r.visible||r.userData.preloadGeometry)&&(r instanceof Ns||r instanceof Ar)){for(let l of r.children)this.optimize(l);if(r instanceof Ar||r.userData.dirty===!1)return;let i={};if(!r.userData.modelURL&&r.userData.dirty)try{this.populateEntityGroup(r.userData.entities3D)}catch(l){ce.warn(l)}else r.userData.modelURL&&r.userData.dirty&&(this.populateModelGroup(r.userData.entities3D,r.userData.modelURL,r),r.userData.dirty=!1);let s=0;if(r.userData.dirty){let l=0,c;for(let p of r.userData.entities3D.values()){c=this.state.geometry3DMap.get(p);let h=c==null?void 0:c.components[0];if((c==null?void 0:c.type)==="geometry"){let y=c.components[1];l++,l>=CLe&&(l=0,s++);let b=SLe(y)+s;i[b]===void 0&&(i[b]={style:y,entities:[]}),i[b].entities.push(c)}else h&&"mesh"in h&&h.mesh&&((n=h.mesh)==null?void 0:n.parent)!==r&&r.add(h.mesh)}for(let p in i){let h=zne(i[p].entities,i[p].style);r.add(h),r.userData.dirty=!1}for(let p of r.userData.entities3D.values())if(c=this.state.geometry3DMap.get(p),c!=null&&c.entities2D.size>0)for(let h of c.entities2D.values())h&&(c.attach(h),this.publish("geometry-2d-added"))}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};o(mD,"MeshCreationAndOptimizationSystem");var K3=mD;g();var gD=class gD{constructor(t,r){x(this,"state");x(this,"dirty",!0);x(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 Ip&&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(gD,"DOMVisibilitySystem");var J3=gD;g();var yD=class yD{constructor(t,r){x(this,"state");x(this,"project");this.state=t,this.project=r}update(){let t,r=0,n,i;for(let s of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(s),t){i=t.components[0];let l=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(l instanceof mn)if(this.state.geometry3DIdsInScene.has(l.id)){n=l.components[1],i=t.components[0],(n.dirty||t.components[0].attachedDirty)&&(r=n.height,t.setAltitude(r));let c=n.visible&&n.opacity>0;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(yD,"TwoDProjectionSystem");var Q3=yD;g();g();var wLe=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")(),Mie=o(({text:e,size:t,maxWidth:r,pixelRatio:n,maxLines:i=2,lineHeight:s=1.2,options:l={strokeText:!0}})=>{let c="bold ".concat(t*n,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:p}=wLe(n);p.font=c;let h=[],y=e.split(" "),b=0,_=0,C=0;for(;_<y.length;){let O=y[_];if(b===i&&b>0){h[b-1]+="...";break}if(h[b]==null&&(h[b]=O,_++),y.length===1){h[b]=O;break}if(y[_]==null)break;let{width:D}=p.measureText(h[b]+" "+y[_]);D<=r*n?(h[b]+=" "+y[_],_++):b++}h.forEach(O=>{let{width:D}=p.measureText(O);C=Math.max(D,C)});let P=t*n*s,E=h.length*P;return{maxWidth:C,maxHeight:E,lines:h.length,draw:o((O,D,A)=>{h.length===1?(l.strokeText&&O.strokeText(h[0],D,A),O.fillText(h[0],D,A)):(l.strokeText&&(O.strokeText(h[0],D,A-P/2),O.strokeText(h[1],D,A+P/2)),O.fillText(h[0],D,A-P/2),O.fillText(h[1],D,A+P/2))},"draw")}},"shaveText");g();function Oie(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(Oie,"createImage");var PLe=3.5,TLe=2.5,ELe=2,MLe=5,_2=2.5;var vD=class vD extends Lt{constructor(r,n,i){super();x(this,"dirty",!1);x(this,"state");x(this,"colliderContext");x(this,"colliderCanvas");x(this,"transformRequestFunc");x(this,"transformRequest",o(async r=>this.transformRequestFunc?await this.transformRequestFunc(r):{url:r},"transformRequest"));x(this,"pinCache",{});x(this,"imageCache",{});x(this,"imagePromiseCache",{});x(this,"imageDimensionsCache",{});x(this,"textCache",{});x(this,"update",o(r=>{let n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let i,s,l,c,p,h,y;for(let b of this.state.geometry2DIdsInScene)if(y=this.state.geometry2DMap.get(b),y!=null&&(h=y.components[0],h instanceof _p&&!y.disposed)){if(p=h.appearance.marker.iconVisibleAtZoomLevel,h.appearance.marker.icon!=null&&p&&r>=p!==h.iconVisible&&(h.iconVisible=r>=p,h.dirty=!0),(h.dirty||this.dirty)&&h.calculateMarkerSize(),s=h.appearance.marker.foregroundColor,l=h.appearance.marker.backgroundColor,c=a0(h.markerSize,2),i="".concat(s.active,"-").concat(s.inactive,"-").concat(l.active,"-").concat(l.inactive,"-").concat(c,"-").concat(h.iconVisible),h.labelCacheId=i,(!this.pinCache[i]||this.dirty)&&(this.prepare(h,i,this.colliderContext),h.dirty=!0),(h.appearance.marker.icon&&(!h.imageHash||h.markerDirty)||this.dirty)&&this.cacheImage(h),this.textCache[h.id]==null||h.textDirty||this.dirty){h.dirty=!0,this.textCache[h.id]={};let{textDrawFn:C,width:P,height:E}=this.processText(h.text,h.appearance.text.size,h.appearance.text.maxWidth,h.appearance.text.numLines,h.appearance.text.lineHeight);["left","center","right"].forEach(w=>{this.textCache[h.id][w]=this.textToCanvas(C,h.appearance.text.size,w,P,E,h.appearance.text.foregroundColor,h.appearance.text.backgroundColor)}),h.dimensions={width:Math.ceil(P/n),height:Math.ceil(E/n)}}let _=1;if(h.appearance.marker.iconSizeInterpolation&&h.appearance.marker.iconSize){let{minZoomLevel:C,maxZoomLevel:P,minScale:E,maxScale:w}=h.appearance.marker.iconSizeInterpolation;_=Ll(r,C,P,E,w)}h.recomputeCurrentStrategy(h.iconVisible?_:1),h.canShow&&h.visible&&(h.enabled||h.visibilityNeedsUpdate!==!1)&&this.draw(h,i,this.colliderContext),h.textDirty=!1,h.markerDirty=!1}this.dirty=!1},"update"));x(this,"processText",o((r,n,i,s,l)=>{let c=this.state.pixelRatio,{draw:p,maxWidth:h,maxHeight:y}=Mie({text:r,size:n,pixelRatio:c,maxWidth:i,maxLines:s,lineHeight:l});return{textDrawFn:p,width:h+_2*c*2,height:y+_2*c*2}},"processText"));x(this,"textToCanvas",o((r,n,i,s,l,c,p)=>{let h=this.state.pixelRatio,y,b=s,_=l;window.OffscreenCanvas!=null&&!ik()?y=new OffscreenCanvas(b,_):(y=document.createElement("canvas"),y.width=b,y.height=_,y.style.width=b+"px",y.style.height=_+"px");let C=y.getContext("2d",{willReadFrequently:!0});if(!C)return;C.textAlign=i,C.font="bold ".concat(n*h,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),C.textBaseline="middle",C.lineJoin="miter",C.miterLimit=2,C.strokeStyle="white",C.lineWidth=_2*h,C.fillStyle=c,C.strokeStyle=p;let P=i==="left"?0:i==="center"?b/2:b-_2*h/2;return r(C,P,(_+_2*h/2)/2),y},"textToCanvas"));x(this,"cacheImage",o(r=>{if(!r.appearance.marker.icon)return;let n=pk(r.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(i=>{this.transformRequest(r.appearance.marker.icon).then(s=>{let l=Oie(s.url);l.onload=()=>{this.imageCache[n]=l,this.publish("img:loaded"),i(l)}})})),r.imageHash!==n&&(r.imageHash=n,this.imagePromiseCache[n].then(()=>{r.dirty=!0}))},"cacheImage"));x(this,"createPinCanvas",o((r,n,i,s,l=1)=>{let c,p=this.state.pixelRatio,h=r.totalMarkerSize*2*p*l;window.OffscreenCanvas!=null?c=new OffscreenCanvas(h,h):(c=document.createElement("canvas"),c.width=h,c.height=h,c.style.width=h/p+"px",c.style.height=h/p+"px");let y=c.getContext("2d");return y.shadowColor="rgba(0,0,0,0.3)",y.shadowOffsetY=ELe*p,y.shadowBlur=MLe*p,y.beginPath(),y.arc(h/2,h/2,(n/2+TLe*p/2)*l,0,2*Math.PI),y.fillStyle=i,y.fill(),y.beginPath(),y.arc(h/2,h/2,n/2*l,0,2*Math.PI),y.shadowColor="transparent",y.fillStyle=s,y.fill(),c},"createPinCanvas"));x(this,"prepare",o((r,n,i)=>{var p,h;let s=this.state.pixelRatio;i.lineWidth=4*s;let l=this.createPinCanvas(r,r.markerSize,r.appearance.marker.backgroundColor.active,r.appearance.marker.foregroundColor.active,(p=r.appearance.marker.iconSizeInterpolation)==null?void 0:p.maxScale),c=this.createPinCanvas(r,r.iconVisible?r.markerSize:PLe*s,r.appearance.marker.backgroundColor.inactive,r.appearance.marker.foregroundColor.inactive,(h=r.appearance.marker.iconSizeInterpolation)==null?void 0:h.maxScale);this.pinCache[n]=[l,c]},"prepare"));this.state=r,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=i}draw(r,n,i){var h,y;if(!r.canShow||!r.visible)return;i.save(),i.globalAlpha=r.opacity;let s=this.state.pixelRatio,l=r.projection.x*s,c=r.projection.y*s,p=r.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1];if(i.drawImage(p,l-r.totalMarkerSize*s,c-r.totalMarkerSize*s,r.totalMarkerSize*2*s,r.totalMarkerSize*2*s),r.appearance.marker.icon&&r.iconVisible&&r.imageHash&&r.appearance.marker.iconSize&&this.imageCache[r.imageHash]){let b=this.imageCache[r.imageHash],_=(r.totalMarkerSize-r.scaledIconPadding)*s,C=r.appearance.marker.iconFit,P=_,E=_,w="".concat(r.imageHash,"_").concat(C);if(this.imageDimensionsCache[w])P=this.imageDimensionsCache[w].width,E=this.imageDimensionsCache[w].height;else{let O=b.width*s,D=b.height*s;if(C==="contain"){let A=Math.sqrt(O**2+D**2),k=_/A;P=O*k,E=D*k}if(C==="cover"){let A=_/O,k=_/D,j=Math.max(A,k);P=O*j,E=D*j}}i.save(),i.beginPath(),i.arc(l,c,_/2,0,2*Math.PI),i.closePath(),((y=(h=r==null?void 0:r.appearance)==null?void 0:h.marker)==null?void 0:y.iconOverflow)!=="visible"&&i.clip(),i.drawImage(b,l-P/2,c-E/2,P,E),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],l+r.style.left*s,c+r.style.top*s),i.restore()}};o(vD,"TwoDDrawSystem");var eT=vD;g();g();var Mh=class Mh{constructor(){x(this,"loader");this.loader=new s0}static getInstance(){return Mh.instance||(Mh.instance=new Mh),Mh.instance}getLoader(){return this.loader}load(t){return new Promise((r,n)=>{this.loader.load(t,r,void 0,n)})}};o(Mh,"TextureLoaderSingleton"),x(Mh,"instance");var bD=Mh,Oh=bD.getInstance();function OLe(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(OLe,"processColor");var dy,S2,xD=class xD extends Lt{constructor(r,n){super();G(this,dy);x(this,"state");x(this,"convertTo3DMapPosition");x(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=n,this.state=r}setShading(r,n){r.material&&r.material.setGradientShading(n.start,n.end,n.intensity)}processTextures(r,n,i){var s;if(n.texture!==r.texture&&n.texture!==""&&ke(this,dy,S2).call(this,n.texture,r,"texture"),n.topTexture!==r.topTexture&&n.topTexture!==""&&ke(this,dy,S2).call(this,n.topTexture,r,"topTexture"),(r.texture==null||r.topTexture==null)&&Array.isArray((s=r.feature.properties)==null?void 0:s.textures)&&r.feature.properties.textures.length>0)for(let l of r.feature.properties.textures)l.face==="top"&&r.topTexture!==l.path?ke(this,dy,S2).call(this,l.path,r,"topTexture"):l.face==="side"&&r.texture!==l.path&&ke(this,dy,S2).call(this,l.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 s,l,c,p,h,y,b,_;let r,n,i;for(let C of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(C),i instanceof Ns&&i.type==="geometry-group"){let P=i.components[0];if(i.userData.shadingDirty){let E=i.userData.entities3D.values().next().value;if(E==null)continue;let w=this.state.geometry3DMap.get(E);w instanceof mn&&(w.type==="geometry"||w.type==="custom-geometry")&&(r=w.components[0],i.userData.shadingDirty&&P.shading&&this.setShading(r,P.shading));let O,D;for(let A of i.userData.entities3D.values())O=this.state.geometry3DMap.get(A),D=O.components[0],O.type==="geometry"&&D.detached&&i.userData.shadingDirty&&P.shading&&this.setShading(D,P.shading);i.userData.shadingDirty=!1}if(P.dirty){let E=i.getfirstChildEntityId();if(E){let O=this.state.geometry3DMap.get(E),D=O==null?void 0:O.components[0];D instanceof Mi&&this.processTextures(D,P)}let w=P.opacity*dm(i);i.getOpacity()!==w&&i.setOpacity(w),P.dirty=!1}}else if(i&&(i.type==="geometry"||i.type==="custom-geometry")&&((s=i.components[1])!=null&&s.dirty||(l=i.components[2])!=null&&l.dirty)){let P=i.components[0],E=i.components[1];n=i.components[2];let w=OLe(i,this.state.hoverColor);if(P.setColor(w[0],w[1]),E.visible!==P.visible&&(P.visible=E.visible,P instanceof Mi&&P.textMesh)){let D=this.state.geometry3DMap.get(P.textMesh.userData.entityId);(D==null?void 0:D.type)==="text3d"&&D.components[0].polygonEntityId!=null&&(D.components[0].visible=E.visible)}E.altitude!==P.altitude&&(P.altitude=E.altitude);let O=E.opacity*dm(i);O!==P.opacity&&(P.opacity=O),E.renderOrder!==P.renderOrder&&(P.renderOrder=E.renderOrder),E.dirty=!1,P instanceof Mi&&this.processTextures(P,E,n),i.components[2]&&(i.components[2].dirty=!1)}else if((i==null?void 0:i.type)==="model")i.components[1].dirty&&(Z3(i),i.components[1].dirty=!1),i.components[0].positionDirty&&(Eie(i,this.convertTo3DMapPosition),i.components[0].positionDirty=!1);else if((i==null?void 0:i.type)==="image"&&((c=i.components[1])!=null&&c.dirty)){r=i.components[0];let P=i.components[1];P.visible!==r.visible&&(r.visible=P.visible),P.dirty=!1}else if((i==null?void 0:i.type)==="text3d"&&((p=i.components[1])!=null&&p.dirty)&&i.components[0].polygonEntityId!=null){r=i.components[0];let P=i.components[1];P.visible!=null&&P.visible!==r.visible&&(r.visible=P.visible);let{textMesh:E}=r;if(E){Object.assign(E,P.getState());let w=(h=P.hoverColor)!=null?h:this.state.text3dHoverColor;E.color=P.hoverByPolygon?w:(y=P.color)!=null?y:p0.color,E.outlineColor=P.hoverByPolygon?w:(b=P.outlineColor)!=null?b:p0.outlineColor,E.strokeColor=P.hoverByPolygon?w:(_=P.strokeColor)!=null?_:p0.strokeColor}P.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async r=>{(await r).dispose()}),this.textureLoadingCache.clear()}};dy=new WeakSet,S2=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 s=new Promise((l,c)=>{Oh.getLoader().load(r,p=>{i==="topTexture"?n.topTexture=p:n.texture=p,n.showTextures(),this.publish("texture-loaded"),l(p)},void 0,()=>{ce.error("Failed to load texture: ".concat(r)),c("Failed to load texture: ".concat(r))})});this.textureLoadingCache.set(r,s)}},"#loadTexture"),o(xD,"DrawSystem");var tT=xD;g();var ID=class ID extends Lt{constructor(r){super();x(this,"state");x(this,"animating",new Map);x(this,"isAnimating",!1);x(this,"startTime",-1);x(this,"showDuration",300);x(this,"hideDuration",250);x(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 _p&&(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"));x(this,"playAnimations");this.state=r,this.playAnimations=this._playAnimations}_playAnimations(){let r=performance.now();for(let[n,[i,s]]of this.animating.entries()){let l=s===1?this.showDuration:this.hideDuration,c=(r-this.startTime)/l;n.opacity=Ll(c,0,1,i,s,s===0?fk:dk),r-this.startTime>=l&&(s===1?n.canShow=!0:s===0&&(n.canShow=!1),n.visibilityNeedsUpdate=!1,this.animating.delete(n))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};o(ID,"TwoDVisibilitySystem");var rT=ID;g();var _D=class _D extends Lt{constructor(r,n,i,s,l,c,p){super();x(this,"state");x(this,"renderer");x(this,"mode");x(this,"scene");x(this,"cameraObject");x(this,"viewCamera");x(this,"systems");x(this,"needs2DRecompute",!1);x(this,"twoDdirty",!0);x(this,"threeDdirty",!0);x(this,"frameId",null);x(this,"twoDFrameId",null);x(this,"animationFrameId",null);x(this,"nextFrame",null);x(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=>{this.frameId=requestAnimationFrame(()=>{var s,l;return((s=this.renderer)==null?void 0:s.renderer)==null?i():this.mode==="standalone"?(l=this.commitRenderState())==null?void 0:l.then(()=>{this.paint(),i()}):i()})})},"update"));x(this,"animate2D",o(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));x(this,"drawEntities2D",o(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));x(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"));x(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(),lk(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(),ak(this.state.entityScene,this.state.geometry3DIdsInScene),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.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getRotation()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.occlusion2DSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update();let i=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!i)}),this.systems.drawSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.publish("post-render"),Promise.all(r)}catch(r){ce.error("Render failed: ",r)}},"commitRenderState"));this.renderer=r,this.state=n,this.mode=i,this.scene=s,this.cameraObject=l,this.viewCamera=c,this.systems=p,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(_D,"RenderSystem");var nT=_D;g();var LLe=ae.object({interactive:ae.boolean().optional(),id:ae.string().optional(),nearRadius:ae.number().optional(),farRadius:ae.number().optional(),accentColor:ae.string().optional(),displayArrowsOnPath:ae.boolean().optional(),animateArrowsOnPath:ae.boolean().optional(),nearZoomLevel:ae.number().optional(),farZoomLevel:ae.number().optional(),visibleThroughGeometry:ae.boolean().optional(),dashed:ae.boolean().optional()}),ALe=ae.object({type:ae.enum(["Feature"]),geometry:Pv,properties:ae.object({parentId:ae.any().optional()})});function Lie(e,t){ae.object({features:ae.array(ALe)}).parse(e),LLe.parse(t)}o(Lie,"validatePath");var C2,SD=class SD{constructor(t,r){x(this,"type","path");x(this,"mesh",new Eu);x(this,"material");x(this,"geometry");x(this,"outline");x(this,"feature");x(this,"options");x(this,"nearRadius",.2);x(this,"farRadius",.4);x(this,"nearZoomLevel");x(this,"farZoomLevel");x(this,"nearZoomAltitude");x(this,"farZoomAltitude");x(this,"accentColor","blue");x(this,"completeFraction",1);x(this,"altitudeAdjustment",1);x(this,"displayArrowsOnPath",!1);x(this,"animateArrowsOnPath",!1);x(this,"visibleThroughGeometry",!1);x(this,"dashed",!1);x(this,"isVertical",!1);x(this,"dirty",!0);x(this,"materialDirty",!0);x(this,"position",new pt);G(this,C2,0);var n,i,s,l,c,p,h;this.feature=t,this.options=r||{},this.accentColor=(n=r==null?void 0:r.accentColor)!=null?n:this.accentColor,this.nearRadius=(i=r==null?void 0:r.nearRadius)!=null?i:this.nearRadius,this.farRadius=(s=r==null?void 0:r.farRadius)!=null?s:this.farRadius,this.nearZoomLevel=r==null?void 0:r.nearZoomLevel,this.farZoomLevel=r==null?void 0:r.farZoomLevel,this.displayArrowsOnPath=(l=r==null?void 0:r.displayArrowsOnPath)!=null?l:this.displayArrowsOnPath,this.animateArrowsOnPath=(c=r==null?void 0:r.animateArrowsOnPath)!=null?c:this.animateArrowsOnPath,this.visibleThroughGeometry=(p=r==null?void 0:r.visibleThroughGeometry)!=null?p:this.visibleThroughGeometry,this.dashed=(h=r==null?void 0:r.dashed)!=null?h: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,C2)}set altitude(t){this.mesh&&(this.mesh.position.z=t,q(this,C2,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};C2=new WeakMap,o(SD,"PathComponent");var Lh=SD;g();var CD=class CD{constructor(t){x(this,"rendererState");this.rendererState=t}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(r),t instanceof Ar&&t.components[0]){let n=t.components[0];if(n.dirty){for(let i of t.children)(i instanceof Ns||i instanceof Ar)&&(i.userData.entityId!==t.components[0].activeId?i.setVisible(!1):i.setVisible(!0));n.dirty=!1}}}};o(CD,"StackSystem");var iT=CD;g();g();g();var Qi=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-Qi.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?Qi.Bounce.In(e*2)*.5:Qi.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")}),w2=o(function(){return performance.now()},"now"),oT=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,s=r;i<s.length;i++){var l=s[i];(t=l._group)===null||t===void 0||t.remove(l),l._group=this,this._tweens[l.getId()]=l,this._tweensAddedDuringUpdate[l.getId()]=l}},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 s=i[n];s._group=void 0,delete this._tweens[s.getId()],delete this._tweensAddedDuringUpdate[s.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,r){t===void 0&&(t=w2()),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 s=this._tweens[n[i]],l=!r;s&&s.update(t,l)===!1&&!r&&this.remove(s)}n=Object.keys(this._tweensAddedDuringUpdate)}},e}(),Tv={Linear:o(function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),s=Tv.Utils.Linear;return t<0?s(e[0],e[1],n):t>1?s(e[r],e[r-1],r-n):s(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,s=Tv.Utils.Bernstein,l=0;l<=n;l++)r+=i(1-t,n-l)*i(t,l)*e[l]*s(n,l);return r},"Bezier"),CatmullRom:o(function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),s=Tv.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(i=Math.floor(n=r*(1+t))),s(e[(i-1+r)%r],e[i],e[(i+1)%r],e[(i+2)%r],n-i)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[r]-(s(e[r],e[r],e[r-1],e[r-1],n-r)-e[r]):s(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=Tv.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 s=(r-e)*.5,l=(n-t)*.5,c=i*i,p=i*c;return(2*t-2*r+s+l)*p+(-3*t+3*r-2*s-l)*c+s*i+t},"CatmullRom")}},Aie=function(){function e(){}return o(e,"Sequence"),e.nextId=function(){return e._nextId++},e._nextId=0,e}(),wD=new oT,Va=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=Qi.Linear.None,this._interpolationFunction=Tv.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Aie.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=wD,wD.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=w2()),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 s in this._valuesEnd)i[s]=this._valuesEnd[s];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,s){for(var l in n){var c=t[l],p=Array.isArray(c),h=p?"array":typeof c,y=!p&&Array.isArray(n[l]);if(!(h==="undefined"||h==="function")){if(y){var b=n[l];if(b.length===0)continue;for(var _=[c],C=0,P=b.length;C<P;C+=1){var E=this._handleRelativeValue(c,b[C]);if(isNaN(E)){y=!1,console.warn("Found invalid interpolation list. Skipping.");break}_.push(E)}y&&(n[l]=_)}if((h==="object"||p)&&c&&!y){r[l]=p?[]:{};var w=c;for(var O in w)r[l][O]=w[O];i[l]=p?[]:{};var b=n[l];if(!this._isDynamic){var D={};for(var O in b)D[O]=b[O];n[l]=b=D}this._setupProperties(w,r[l],b,i[l],s)}else(typeof r[l]>"u"||s)&&(r[l]=c),p||(r[l]*=1),y?i[l]=n[l].slice().reverse():i[l]=r[l]||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=w2()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=w2()),!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=Qi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=Tv.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=w2()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var s;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 l=t-this._startTime,c=this._duration+((i=this._repeatDelayTime)!==null&&i!==void 0?i:this._delayTime),p=this._duration+this._repeat*c,h=o(function(){if(n._duration===0||l>p)return 1;var E=Math.trunc(l/c),w=l-E*c,O=Math.min(w/n._duration,1);return O===0&&l===n._duration?1:O},"calculateElapsedPortion"),y=h(),b=this._easingFunction(y);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,b),this._onUpdateCallback&&this._onUpdateCallback(this._object,y),this._duration===0||l>=this._duration)if(this._repeat>0){var _=Math.min(Math.trunc((l-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=_);for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*_,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var C=0,P=this._chainedTweens.length;C<P;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 s in n)if(r[s]!==void 0){var l=r[s]||0,c=n[s],p=Array.isArray(t[s]),h=Array.isArray(c),y=!p&&h;y?t[s]=this._interpolationFunction(c,i):typeof c=="object"&&c?this._updateProperties(t[s],l,c,i):(c=this._handleRelativeValue(l,c),typeof c=="number"&&(t[s]=l+(c-l)*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 dWt=Aie.nextId,wp=wD,hWt=wp.getAll.bind(wp),mWt=wp.removeAll.bind(wp),gWt=wp.add.bind(wp),yWt=wp.remove.bind(wp),vWt=wp.update.bind(wp);g();g();g();var Die=o((e,t)=>(t-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),Fie=o((e,t)=>new wt(e.clientX-t.offsetLeft,e.clientY-t.offsetTop),"getTouchPos"),PD=o((e,t)=>Math.atan2(t.y-e.y,t.x-e.x),"angle"),P2=o((e,t)=>Math.sqrt((t.y-e.y)**2+(t.x-e.x)**2),"distance"),TD=o((e,t)=>new wt((e.x+t.x)/2,(e.y+t.y)/2),"average"),ED=o(e=>{let t=0,{wheelDelta:r,detail:n}=e;return r!==void 0?t=r:n!==void 0&&(t=-n),t},"getScrollDelta");var MD=class MD{constructor(t,r){x(this,"input1");x(this,"input2");x(this,"lastAngle");x(this,"lastDistance");x(this,"totalDistance");x(this,"first");x(this,"second");this.input1=t,this.input2=r,this.lastAngle=PD(t,r),this.lastDistance=P2(t,r),this.totalDistance=0,this.first=t,this.second=r}update(t,r){let n=P2(t,r);this.input1=t,this.input2=r;let i=PD(t,r);this.lastAngle=i,this.lastDistance=n,this.totalDistance+=(P2(this.first,t)+P2(this.second,r))/2,this.first=TD(this.first,t),this.second=TD(this.second,r)}};o(MD,"InputSet");var sT=MD;g();var OD=class OD{constructor(t,r,n){x(this,"touch");x(this,"camera");x(this,"cameraPlane");x(this,"viewCoordinate");x(this,"snapHolderMatrix");x(this,"snapCamera");x(this,"cameraPosition");x(this,"raycaster");x(this,"worldCoordinate");x(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 wt(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Mc,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 wt(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(OD,"TouchAnchor");var T2=OD;var lu={};wc(lu,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>FLe,CLIPPING_RADIUS:()=>E2,CONTROL_OPTIONS:()=>DLe,DEFAULT_ANIMATION_DURATION:()=>ND,DEFAULT_BEARING:()=>jLe,DEFAULT_MAX_ZOOM_LEVEL:()=>RLe,DEFAULT_MIN_ZOOM_LEVEL:()=>kD,DEFAULT_PITCH:()=>BLe,DEFAULT_ZOOM_LEVEL:()=>kLe,EVENTS:()=>cT,MAPLIBRE_TILE_SIZE:()=>aT,MAX_LAT:()=>AD,MAX_MERCATOR_ZOOM_LEVEL:()=>uT,MIN_LAT:()=>LD,MIN_MERCATOR_ZOOM_LEVEL:()=>lT,ROOM_MERCATOR_ZOOM_LEVEL:()=>NLe,TWO_PI:()=>DD,WHEEL_ZOOM_MULTIPLIER:()=>FD,ZRANGE:()=>Ev});g();var aT=512,LD=-85.051129,AD=85.051129,E2=1e4,DLe={chain:"chain",cancel:"cancel"},DD=Math.PI*2,Ev=100,FD=1e4,lT=0,uT=24,FLe=17,NLe=20,ND=200,cT=["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"],kLe=18,kD=12,RLe=22,BLe=0,jLe=0;g();function Nie(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}o(Nie,"scrubMaterial");function Pi(e){for(let t=e.children.length-1;t>=0;t--)Pi(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){Nie(t)}):"material"in e&&typeof e.material<"u"&&Nie(e.material)}o(Pi,"destroyObject3D");var pT=!1,$Le=!1;var fT,dT=class dT extends Lt{constructor(r,n,i,s,l){super();x(this,"dirty",!1);x(this,"zoomDirty",!1);x(this,"rotationDirty",!1);x(this,"panDirty",!1);G(this,fT,kD);x(this,"zoomSpeed",5);x(this,"rotateSpeed",100);x(this,"enabled",!0);x(this,"enableZoom",!0);x(this,"enablePan",!0);x(this,"enablePedestal",!1);x(this,"maxPedestal",1/0);x(this,"minPedestal",0);x(this,"enableRotate",!0);x(this,"minZoomAltitude",0);x(this,"maxZoomAltitude",1/0);x(this,"ignoreZoomLimits",!1);x(this,"zoomFactor",1);x(this,"panBounds",{min:new pt(1/0,1/0),max:new pt(-1/0,-1/0),center:new pt(0,0,0),radius:1/0});x(this,"minTilt",0);x(this,"maxTilt",1.2);x(this,"MOUSE_BUTTONS",{ORBIT:oS.RIGHT,ZOOM:oS.MIDDLE,PAN:oS.LEFT});x(this,"camera");x(this,"scene");x(this,"renderer");x(this,"elevation");x(this,"orbit");x(this,"cameraPlane");x(this,"raycaster",new Mc);x(this,"rendererState");x(this,"options");x(this,"state",-1);x(this,"intersection");x(this,"viewState",null);x(this,"tweens",new Map);x(this,"clock",new $N(!0));x(this,"coords",{mouse:new wt,rotateStart:new wt,rotateEnd:new wt,rotateDelta:new wt,panStart:new pt,panCameraStart:new pt,panEnd:new pt,panDelta:new pt,initialShiftPos:new wt,initialPedestal:0,floorAnchor:new pt});x(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});x(this,"scrollTimer",null);x(this,"lastWheelTime",0);x(this,"resetZoom",!1);x(this,"zoomStart");x(this,"pedestalScaleFactor",1);x(this,"isUserZooming",!1);x(this,"stayInsideBounds",!0);x(this,"userInteracting",!1);x(this,"cameraMoving",!1);x(this,"lastCameraMoveTime",Date.now());x(this,"raycastToFloor",o(r=>{this.raycaster.setFromCamera(r,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new pt},"raycastToFloor"));x(this,"isUserInteracting",o(()=>this.userInteracting,"isUserInteracting"));x(this,"getPosition",o(()=>new pt(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));x(this,"getPedestal",o(()=>this.orbit.position.z,"getPedestal"));x(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"));x(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"));x(this,"isCameraMoving",o(()=>this.cameraMoving,"isCameraMoving"));x(this,"lastCameraStoppedMovingTime",o(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));x(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)},"setPosition"));x(this,"updateCameraPosition",o((r,n)=>{let i=r-this.panBounds.center.x,s=n-this.panBounds.center.y,l=Math.sqrt(i*i+s*s);if(this.stayInsideBounds&&l>this.panBounds.radius){let c=Math.atan2(s,i),p={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=p.x,this.orbit.position.y=p.y}else this.orbit.position.x=r,this.orbit.position.y=n},"updateCameraPosition"));x(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")},"tilt"));x(this,"zoomIn",o((r,n,i)=>{let s=this.getZoomAltitude();this.animateCamera({zoom:s/1.5},r,n,i)},"zoomIn"));x(this,"zoomOut",o((r,n,i)=>{let s=this.getZoomAltitude();this.animateCamera({zoom:s*1.5},r,n,i)},"zoomOut"));x(this,"getRotation",o(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));x(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"));x(this,"animateCamera",o((r,n,i,s,l,c)=>{let p=R({interruptible:!0},c),h={},y={},b=this.getPosition();if(r.position!=null&&(r.position.x!==void 0&&(h.x=b.x,y.x=r.position.x),r.position.y!==void 0&&(h.y=b.y,y.y=r.position.y),r.position.z!==void 0&&(h.z=b.z,y.z=r.position.z)),r.zoom!==void 0&&(h.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?y.zoom=r.zoom:y.zoom=Math.min(Math.max(r.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),r.rotation!==void 0){let{start:A,end:k}=gS(this.getRotation(),r.rotation);h.rotation=A,y.rotation=k}r.tilt!==void 0&&(h.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?y.tilt=r.tilt:y.tilt=Math.max(Math.min(r.tilt,this.maxTilt),this.minTilt));let _=h.zoom!==y.zoom,C=h.rotation!==y.rotation,P=h.tilt!==y.tilt,E=new Va(h).to(y,I.env.TESTING?0:n).onUpdate(A=>{this.setMulti({x:A.x,y:A.y,z:A.z},A.zoom,A.rotation,A.tilt)}).onComplete(()=>{this.completeTween(E),this.publish("multi-end",{zooming:_,rotating:C,tilting:P}),s&&s()}).onStart(()=>{this.state!==7&&(this.state=7,E.state=7,this.publish("multi-start",{zooming:_,rotating:C,tilting:P})),this.publish("change")});this.rendererState.internalTweenGroup.add(E);let w=Array.from(this.tweens.entries()),O=w[w.length-1],D=!1;return O!=null&&(O[1].interruptible?(typeof O[1].cancelledCallback=="function"&&O[1].cancelledCallback(),this.completeTween(O[0])):(D=!0,O[0].chain(E))),this.tweens.set(E,{cancelledCallback:l,interruptible:p.interruptible}),i?E.easing(i):E.easing(Qi.Quadratic.In),!r.doNotAutoStart&&!D&&(E.start(),this.publish("change")),E.cameraAnimation=!0,E},"animateCamera"));x(this,"setMulti",o((r,n,i,s,l=!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),c=!0)),c&&this.publish("position-updated");let p={zooming:!1,tilting:!!n,rotating:!1};if(n!==void 0&&!isNaN(n)){let h=this.stayInsideBounds?Math.min(Math.max(n,this.getZoomScaledMin()),this.getZoomScaledMax()):n;h!==this.camera.position.z&&(p.zooming=!0,this.camera.position.z=h,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>E2&&(this.camera.near=n-E2,this.camera.far=n+E2):(this.camera.near=n/Ev,this.camera.far=n*Ev),this.camera.updateProjectionMatrix())}if(i!==void 0&&!isNaN(i)&&i!==this.getRotation()&&(p.rotating=!0,this.orbit.rotation.z=-i,this.publish("rotation-updated")),s!==void 0&&!isNaN(s)){let h=this.stayInsideBounds?Math.max(Math.min(s,this.maxTilt),this.minTilt):s;h!==this.elevation.rotation.x&&(p.tilting=!0,this.elevation.rotation.x=h,this.publish("tilt-updated"))}l&&this.publish("change"),this.state===-1&&this.publish("multi-end",p)},"setMulti"));x(this,"getZoomScaledMin",o(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));x(this,"getZoomScaledMax",o(()=>{let r=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,r)},"getZoomScaledMax"));x(this,"setRotation",o((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let i=-(r%DD);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},"setRotation"));x(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/Ev,this.camera.far=n*Ev,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));x(this,"setZoomLevel",o(r=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(r))},"setZoomLevel"));x(this,"getZoomAltitude",o(()=>this.camera.position.z,"getZoomAltitude"));x(this,"getZoomLevel",o(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));x(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},"setTilt"));x(this,"getTilt",o(()=>this.elevation.rotation.x,"getTilt"));x(this,"setCameraPlaneElevation",o(r=>{this.cameraPlane.position.z=r},"setCameraPlaneElevation"));x(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")},"zoom"));x(this,"getProjectionScaleFactor",o((r,n,i)=>NE(r,n,i),"getProjectionScaleFactor"));x(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"));x(this,"setPedestal",o((r,n=!1)=>{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)},"setPedestal"));x(this,"dispose",o(()=>{for(let r of cT)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"));x(this,"createCameraPlane",o(()=>{let r=pT?2e3:1e10,n=pT?100:1,i=new wu(r,r,n,n),s=new _o({color:0,wireframe:pT,visible:pT}),l=new $t(i,s);return this.scene.add(l),l},"createCameraPlane"));x(this,"addEventListeners",o(()=>{let{domElement:r}=this.renderer;for(let n of cT)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"));x(this,"addMouseEventListeners",o(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));x(this,"addMouseMoveEventListeners",o(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));x(this,"removeMouseMoveEventListeners",o(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));x(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"));x(this,"removeMouseUpEventListeners",o(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));x(this,"onContextMenu",o(r=>{r.preventDefault()},"onContextMenu"));x(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"));x(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"));x(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 sT(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));x(this,"onTouchMove",o(r=>{if(this.enabled!==!1)switch(this.touchToScene(r),r.touches.length){case 2:r.preventDefault(),r.stopPropagation();let n=R({},this.touch.inputs.first),i=R({},this.touch.inputs.second),s=new wt(this.touch.touches[0].x,this.touch.touches[0].y),l=new wt(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<s.y&&i.y<l.y,p=n.y>s.y&&i.y>l.y;this.enableRotate&&this.state!==4&&(p||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"));x(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"));x(this,"handleTouchMovePan",o(r=>{let n=Object.hasOwn(r,"x")?new wt(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"));x(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 wt(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 T2(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new T2(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"));x(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"));x(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"));x(this,"handleTouchMovePedestal",o(r=>{this.handleMouseMovePedestal(r.touches[0])},"handleTouchMovePedestal"));x(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"));x(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"));x(this,"handleTouchEnd",o(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));x(this,"handleTouchStartPan",o(r=>{let n=Object.hasOwn(r,"x")?new wt(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"));x(this,"handleTouchStartPedestal",o(r=>{this.handleMouseDownPedestal(r.touches[0])},"handleTouchStartPedestal"));x(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"));x(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"));x(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-ED(r)*n/FD*this.zoomSpeed;if(this.setZoomAltitude(i),this.enablePan){let s=i/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-s),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));x(this,"setCameraFromTransformMatrix",o(r=>{this.orbit.updateMatrixWorld();let n=new Kp;n.setFromRotationMatrix(r,"ZYX");let i=(r.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),s=n.z,l=new pt(0,0,1);l.applyEuler(n),l.setLength(i);let c=new pt;c.setFromMatrixPosition(r),c.sub(l),this.enablePan&&this.setPosition(c.x,c.y),this.enableZoom&&this.setZoomAltitude(i),this.enableRotate&&this.setRotation(-s)},"setCameraFromTransformMatrix"));x(this,"makeTransformFromTouchAnchors",o((r,n)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let i=this.camera.projectionMatrix.clone(),s=r.worldCoordinate,l=n.worldCoordinate,c=r.reUnproject(),p=n.reUnproject();if(!c||!p||!s||!l)return null;let h=r.viewCoordinate,y=n.viewCoordinate,b=l.x-s.x,_=l.y-s.y,C=Math.atan2(_,b),P=p.x-c.x,E=p.y-c.y,w=Math.atan2(E,P),O=Die(C,w),D=new nl;D.makeRotationZ(-O);let A=D.clone();A.multiply(r.snapHolderMatrix);let k=o((ts,ro,rs)=>ts.elements[(ro-1)*4+rs-1],"m"),j=k(i,1,1)*k(A,1,1)-h.x*k(i,3,4)*k(A,3,1),W=k(i,1,1)*k(A,1,2)-h.x*k(i,3,4)*k(A,3,2),Y=k(i,1,1)*k(A,1,3)-h.x*k(i,3,4)*k(A,3,3),N=s.x*j+s.y*W+s.z*Y,Z=k(i,2,2)*k(A,2,1)-h.y*k(i,3,4)*k(A,3,1),le=k(i,2,2)*k(A,2,2)-h.y*k(i,3,4)*k(A,3,2),se=k(i,2,2)*k(A,2,3)-h.y*k(i,3,4)*k(A,3,3),U=s.x*Z+s.y*le+s.z*se,ye=k(i,1,1)*k(A,1,1)-y.x*k(i,3,4)*k(A,3,1),ne=k(i,1,1)*k(A,1,2)-y.x*k(i,3,4)*k(A,3,2),Ce=k(i,1,1)*k(A,1,3)-y.x*k(i,3,4)*k(A,3,3),Ie=l.x*ye+l.y*ne+l.z*Ce,Ue=k(i,2,2)*k(A,2,1)-y.y*k(i,3,4)*k(A,3,1),ve=k(i,2,2)*k(A,2,2)-y.y*k(i,3,4)*k(A,3,2),Te=k(i,2,2)*k(A,2,3)-y.y*k(i,3,4)*k(A,3,3),Q=l.x*Ue+l.y*ve+l.z*Te,Qe=Math.abs(ye-j),Ye=Math.abs(ne-W),nt=Math.abs(Ce-Y),Ae=Math.abs(ye-Z),Be=Math.abs(ne-le),We=Math.abs(Ce-se),$e=Math.abs(Ue-j),we=Math.abs(ve-W),H=Math.abs(Te-Y),ie=Math.abs(Ue-Z),ee=Math.abs(ve-le),Me=Math.abs(Te-se),Ne=Math.min(Qe+Ye+nt,Ae+Be+We),Oe=Math.min($e+we+H,ie+ee+Me);Ne<Oe&&(ye=Ue,ne=ve,Ce=Te,Ie=Q);let Ze=Z*Y-j*se,Pt=le*Y-W*se,Er=U*Y-N*se,$n=ye*se-Z*Ce,ot=ne*se-le*Ce,zt=Ie*se-U*Ce,es=(zt*Pt-Er*ot)/($n*Pt-Ze*ot),Ro=(zt*Ze-Er*$n)/(ot*Ze-Pt*$n),Js=le*j-W*Z,Ri=se*j-Y*Z,ze=U*j-N*Z,du=ne*Z-le*ye,Ya=Ce*Z-se*ye,Qs=((Ie*Z-U*ye)*Js-ze*du)/(Ya*Js-Ri*du),hc=A.clone();return hc.elements[12]=es,hc.elements[13]=Ro,hc.elements[14]=Qs,Qs>0?hc:null},"makeTransformFromTouchAnchors"));x(this,"updateTouchOrigin",o(()=>{let r=this.renderer.domElement;this.touch.origin.offsetLeft=r.getBoundingClientRect().left,this.touch.origin.offsetTop=r.getBoundingClientRect().top},"updateTouchOrigin"));x(this,"touchToScene",o(r=>{this.touch.touches=[];for(let n=0,i=r.touches.length;n<i;n++){let s=r.touches[n],l=Fie(s,this.touch.origin);this.touch.touches.push(new wt(l.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(l.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));x(this,"canScrollZoom",o(r=>{let n=ED(r),i=this.getZoomAltitude();return!(n<0&&i===this.getZoomScaledMax()||n>0&&i===this.getZoomScaledMin())},"canScrollZoom"));x(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"));x(this,"getMousePos",o(r=>({x:r.offsetX,y:r.offsetY}),"getMousePos"));x(this,"handleMouseDownRotate",o(r=>{this.coords.rotateStart.set(r.clientX,r.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));x(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"));x(this,"handleMouseDownPedestal",o(r=>{let n=new wt(r.clientX,r.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=NE(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));x(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"));x(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"));x(this,"publishUserZoomDebounced",c0(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));x(this,"publishUserZoomEvent",o(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));x(this,"setCameraMoving",o(()=>{this.cameraMoving=!0},"setCameraMoving"));x(this,"unsetCameraMoving",o(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));x(this,"setUserInteracting",o(()=>{this.userInteracting=!0},"setUserInteracting"));x(this,"unsetUserInteracting",o(()=>{this.userInteracting=!1},"unsetUserInteracting"));x(this,"publishPedestalChangeEvent",o(r=>{this.publish("pedestal-change",{pedestal:r,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));x(this,"convertAltitudeToZoomLevel",o(r=>{let[,n]=this.center,s=r*2*Math.tan(Yt.degToRad(this.camera.fov)/2)/this.options.canvasHeight,l=Math.cos(Yt.degToRad(n))*2*Math.PI*wE/s;return Yt.clamp(Math.log2(l/512),lT,uT)},"convertAltitudeToZoomLevel"));x(this,"convertZoomLevelToAltitude",o(r=>{let[,n]=this.center,i=Yt.clamp(r,lT,uT),s=Math.pow(2,i),l=Yt.clamp(n,LD,AD),c=s*512;return Math.cos(Yt.degToRad(l))*Math.PI*2*wE/c*this.options.canvasHeight/2/Math.tan(Yt.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));x(this,"completeTween",o(r=>{r.isPlaying()&&r.stop(),this.rendererState.internalTweenGroup.remove(r),this.tweens.delete(r)},"completeTween"));x(this,"debugContainer",new Jp);this.camera=r,this.renderer=i,this.rendererState=s,this.scene=n,this.options=l,this.elevation=r.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=r.position.z,l.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(r){this.minZoomAltitude=this.convertZoomLevelToAltitude(r)}get defaultMinZoomLevel(){return d(this,fT)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(r){this.maxZoomAltitude=this.convertZoomLevelToAltitude(r)}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 s,l,c,p;let r=this.getPosition(),{lat:n,lon:i}=IS((l=(s=this.rendererState.center)==null?void 0:s[1])!=null?l:0,(p=(c=this.rendererState.center)==null?void 0:c[0])!=null?p:0,r.x,r.y);return[i,n]}setCenter(r,n){var l,c,p,h;let{x:i,y:s}=_S((c=(l=this.rendererState.center)==null?void 0:l[1])!=null?c:0,(h=(p=this.rendererState.center)==null?void 0:p[0])!=null?h:0,n,r);this.setPosition(i,s)}get isAnimating(){return this.rendererState.internalTweenGroup.getAll().some(r=>r.cameraAnimation)}getCameraFrameForCoordinates(r,n){let i=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,s=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,l=this.options.canvasWidth,c=this.options.canvasHeight,p=this.getRotation(),h=this.getTilt(),y=this.getPosition();this.setRotation(n.rotation||p,!0),this.setTilt(n.tilt||h,!0);let b=kie(r,{canvasWidth:l,canvasHeight:c,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:i,maxZoom:s,position:y,camera:this.camera,orbit:this.orbit});return this.setRotation(p,!0),this.setTilt(h,!0),{center:b.position,zoomLevel:this.convertAltitudeToZoomLevel(b.zoom)}}focusOn(r,n){if($Le){this.debugContainer&&Pi(this.debugContainer);let w=new Cu(4,4,4),O=new _o({color:65280,depthTest:!1}),D=new kd(w,O,r.length),A=new nl;r.forEach((k,j)=>{A.setPosition(k),D.setMatrixAt(j,A)}),D.instanceMatrix.needsUpdate=!0,this.debugContainer.add(D),this.scene.add(this.debugContainer)}let i=n.curve,s=n.callback,l=n.cancelledCallback,c=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,p=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,h=this.options.canvasWidth,y=this.options.canvasHeight,b;n.duration!==void 0?b=n.duration:I.env.TESTING==="true"?b=0:b=ND;let _=n.padding,C=this.getRotation(),P=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let E=kie(r,{canvasHeight:y,paddingOption:_,canvasWidth:h,minZoom:c,maxZoom:p,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(C),this.setTilt(P),this.animateCamera({position:E.position,tilt:n.tilt,rotation:n.rotation,zoom:E.zoom},b,i,s,l,n)}resize(r,n){this.options.canvasWidth=r,this.options.canvasHeight=n}};fT=new WeakMap,o(dT,"CameraSystem"),x(dT,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var Mv=dT;function kie(e,{canvasWidth:t,orbit:r,paddingOption:n,verticalPadding:i=0,canvasHeight:s,minZoom:l,maxZoom:c,camera:p,position:h}){let y={zoom:l,position:h};if(e.length===0)return y;for(let Ze of Mv.CAMERA_FRAME_PADDING_SIDES)typeof n[Ze]!="number"&&(n[Ze]=0);let b=n.type==="portion"?{top:n.top*s,bottom:n.bottom*s,left:n.left*t,right:n.right*t,type:"pixel"}:n;if(b.left+b.right>=t||b.top+b.bottom>=s)return y;r.updateMatrixWorld();let _=p.matrixWorldInverse,C=p.fov*(Math.PI/180)/2,P=C,w=Math.atan(Math.tan(C)*(t/s)),O=new pt(1/0,1/0,1/0),D=new pt(-1/0,-1/0,-1/0),A=new co,k=new pt;for(let Ze=0,Pt=e.length;Ze<Pt;Ze++)k.copy(e[Ze]),A.expandByPoint(k),k.applyMatrix4(_),O.min(k),D.max(k),k.copy(e[Ze]),k.z-=i,k.applyMatrix4(_),O.min(k),D.max(k),k.copy(e[Ze]),k.z+=i,k.applyMatrix4(_),O.min(k),D.max(k);let j=D.x-O.x,W=D.y-O.y,Y=t-b.left-b.right,N=s-b.top-b.bottom,Z=(D.x+O.x)/2,le=(D.y+O.y)/2,se=j/Y,U=W/N,ye=l,ne=c,Ce=ye*Math.tan(w)*2,Ie=ne*Math.tan(w)*2,Ue=Ce/t,ve=Ie/t,Te=Math.max(se,U);Te=Yt.clamp(Te,Ue,ve);let Q=Y*Te,Qe=N*Te,Ye={min:{x:Z-Q/2-b.left*Te,y:le-Qe/2-b.bottom*Te},max:{x:Z+Q/2+b.right*Te,y:le+Qe/2+b.top*Te}},nt=(Ye.min.x+Ye.max.x)/2,Ae=(Ye.min.y+Ye.max.y)/2,Be=A.getCenter(new pt),We=Math.abs(nt-Ye.min.x),$e=Math.abs(Ae-Ye.min.y),we=We/Math.tan(w),H=$e/Math.tan(P),ie=new pt;ie.set(nt,Ae,D.z+Math.max(we,H)),ie.applyMatrix4(p.matrixWorld);let ee=new pt;ee.set(nt,Ae,D.z),ee.applyMatrix4(p.matrixWorld);let Me=new pt().subVectors(ee,ie),Ne=(Be.z-ie.z)/Me.z,Oe=new pt().copy(ie).add(Me.clone().multiplyScalar(Ne));return ee.set(Oe.x,Oe.y,Oe.z),ie.sub(ee),{position:Oe,zoom:ie.length()}}o(kie,"getCameraFrameForPoints");g();var GLe=300,M2,O2,RD=class RD{constructor(t){x(this,"state");G(this,M2,new pt);G(this,O2,new pt);this.state=t}update(t){var i;let r,n;this.state.cameraObject.getWorldPosition(d(this,O2));for(let s of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(s),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,M2));let l=d(this,O2).distanceTo(d(this,M2));n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(-l,"px)")}if(n.canShow===!0&&n.visible===!0?n.markerContainer.style.pointerEvents=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:GLe,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};M2=new WeakMap,O2=new WeakMap,o(RD,"DOMDrawSystem");var hT=RD;g();var BD=class BD{constructor(){x(this,"percentExpanded",0);x(this,"activeId","");x(this,"gap",20);x(this,"dirty",!0)}};o(BD,"StackComponent");var mT=BD;g();var jD=class jD extends Lt{constructor(r,n){super();x(this,"state");x(this,"dirty",!0);x(this,"domTree");x(this,"observers",new Map);x(this,"updateDimensions",o(r=>{r.forEach(n=>{var l;let s=(l=n.target.parentElement)==null?void 0:l.getAttribute("data-marker-id");if(s){let c=this.state.geometry2DMap.get(s),p=c==null?void 0:c.components[0];c&&p instanceof Ip&&(p.updateDimensions(n.contentRect.width,n.contentRect.height),p.collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=r,this.domTree=n}setupObserver(){var i;if(this.observers){for(let s of this.observers.values())s.disconnect();this.observers.clear()}let r,n;for(let s of this.domTree.children){let l=s.getAttribute("data-marker-id");if(l!=null&&(r=this.state.geometry2DMap.get(l),n=r.components[0],(i=n.options)!=null&&i.dynamicResize)){let c=new ResizeObserver(this.updateDimensions);c.observe(n.containerEl),this.observers.set(s.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(jD,"DOMResizeSystem");var gT=jD;g();var ULe=0,VLe=90,zLe=(I.env.NODE_ENV==="test",!1),Jf={linear:Qi.Linear.None,"ease-in":Qi.Quadratic.In,"ease-out":Qi.Quadratic.Out,"ease-in-out":Qi.Quadratic.InOut},qLe=-50,yt,Ft,Ah,L2,A2,GD,UD=class UD{constructor(t,r,n){G(this,A2);G(this,yt);G(this,Ft);G(this,Ah);G(this,L2);q(this,yt,t),q(this,Ft,r),q(this,Ah,n),d(this,Ft).cameraSystem.on("pedestal-change",({pedestal:i})=>{d(this,yt).map&&(d(this,yt).map.transform.elevation=i,d(this,yt).map.transform.minElevationForCurrentTile=qLe,d(this,yt).map.triggerRepaint()),d(this,Ft).cameraSystem.setCameraPlaneElevation(i)})}get center(){return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?d(this,yt).map.getCenter().toArray():d(this,Ft).cameraSystem.center}setCenter(t){var r;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map){(r=d(this,yt).map)==null||r.setCenter(t),d(this,Ft).interactionSystem.handleHover();return}d(this,Ft).cameraSystem.setCenter(t[0],t[1]),d(this,Ft).interactionSystem.handleHover()}get zoomLevel(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getZoom():d(this,Ft).cameraSystem.getZoomLevel()}setZoomLevel(t){var r;d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map&&((r=d(this,yt).map)==null||r.setZoom(t)),d(this,Ft).cameraSystem.setZoomLevel(Oc(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get isAnimating(){return d(this,Ft).cameraSystem.isAnimating}cancelAnimation(){d(this,Ft).cameraSystem.cancelAnimation()}get maxZoomLevel(){return d(this,Ft).cameraSystem.maxZoomLevel}get minZoomLevel(){return d(this,Ft).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){d(this,Ft).panBoundsSystem.autoMinZoomLevel=t,t&&(d(this,Ft).panBoundsSystem.dirty=!0,d(this,Ft).panBoundsSystem.update())}get autoMinZoomLevel(){return d(this,Ft).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,r=!1){var i;r&&this.setAutoMinZoomLevel(!1);let n=Oc(t,lu.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(lu.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));d(this,Ft).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(i=d(this,yt).map)==null||i.setMinZoom(n)}setMaxZoomLevel(t){var n;let r=Oc(t,this.minZoomLevel,lu.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(lu.MAX_MERCATOR_ZOOM_LEVEL,"."));d(this,Ft).cameraSystem.setMaxZoomLevel(r),this.zoomLevel>r&&this.setZoomLevel(r),(n=d(this,yt).map)==null||n.setMaxZoom(r)}get maxPitch(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getMaxPitch():Yt.radToDeg(d(this,Ft).cameraSystem.maxTilt)}get minPitch(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getMinPitch():Yt.radToDeg(d(this,Ft).cameraSystem.minTilt)}setMinPitch(t){var n;let r=Math.max(ULe,t);(n=d(this,yt).map)==null||n.setMinPitch(r),d(this,Ft).cameraSystem.minTilt=Yt.degToRad(r)}setMaxPitch(t){var n;let r=Math.min(VLe,t);(n=d(this,yt).map)==null||n.setMaxPitch(r),d(this,Ft).cameraSystem.maxTilt=Yt.degToRad(r)}get bearing(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getBearing():Yt.radToDeg(d(this,Ft).cameraSystem.getRotation())}setBearing(t){var r;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map){(r=d(this,yt).map)==null||r.setBearing(t);return}d(this,Ft).cameraSystem.setRotation(Yt.degToRad(t))}get pitch(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getPitch():Yt.radToDeg(d(this,Ft).cameraSystem.getTilt())}setPitch(t){var r;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map){(r=d(this,yt).map)==null||r.setPitch(t);return}d(this,Ft).cameraSystem.setTilt(Yt.degToRad(Oc(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,Ft).cameraSystem.getPedestal()}setElevation(t){d(this,Ft).cameraSystem.setPedestal(t,!0)}animateElevation(t,r){return d(this,L2)&&d(this,L2).stop(),new Promise(n=>{var s;let i=d(this,Ft).cameraSystem.getPosition();i.z=t,d(this,Ft).cameraSystem.animateCamera({position:i},(r==null?void 0:r.duration)||300,Jf[(r==null?void 0:r.easing)||"ease-in-out"],n,n,{interruptible:(s=r==null?void 0:r.interruptible)!=null?s:!0})})}get insetsPadding(){return d(this,Ah).insetsPadding}get panMode(){return d(this,Ft).cameraSystem.enablePan===!1&&d(this,Ft).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,Ft).cameraSystem.enablePan=!0,d(this,Ft).cameraSystem.enablePedestal=!1):(d(this,Ft).cameraSystem.enablePan=!1,d(this,Ft).cameraSystem.enablePedestal=!0))}setInsetPadding(t){d(this,Ah).insetsPadding=Object.assign({},Fb,t)}animateTo(t){var l,c,p,h,y,b;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map)return(b=d(this,yt).map)==null||b.flyTo({center:(l=t.center)!=null?l:this.center,zoom:(c=t.zoomLevel)!=null?c:this.zoomLevel,bearing:(p=t.bearing)!=null?p:this.bearing,pitch:(h=t.pitch)!=null?h:this.pitch,duration:(y=t.duration)!=null?y:600}),Promise.resolve();let r=t.center?d(this,yt).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?d(this,Ft).cameraSystem.convertZoomLevelToAltitude(Oc(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?Yt.degToRad(t.bearing):void 0,s=t.pitch!==void 0?Yt.degToRad(Oc(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(_=>{var C;d(this,Ft).cameraSystem.animateCamera({position:r,zoom:n,rotation:i,tilt:s},t.duration||0,Jf[t.easing||"ease-in-out"],()=>{d(this,Ft).interactionSystem.handleHover(),_()},_,{interruptible:(C=t==null?void 0:t.interruptible)!=null?C:!0})})}getCameraFrameForCoordinates(t,r){let n=ke(this,A2,GD).call(this,r||{},()=>Promise.resolve()),{pointCloud:i}=Rie(t,d(this,yt),d(this,Ah).geometry3DMap);if(i.length===0)return ce.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:s,zoomLevel:l}=d(this,Ft).cameraSystem.getCameraFrameForCoordinates(i,n);return{center:d(this,yt).convert3DMapPositionToCoordinate(s),zoomLevel:l}}focusOn(t,r){var l,c,p,h;let{pointCloud:n,geoBounds:i,firstPosition:s}=Rie(t,d(this,yt),d(this,Ah).geometry3DMap);return n.length===0?(ce.error("No valid coordinates found in targets:",t),Promise.resolve()):d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(n.length===1&&s?(l=d(this,yt).map)==null||l.flyTo({center:[s[0],s[1]],duration:(r==null?void 0:r.duration)||d(this,yt).map.getBearing(),animate:!0,bearing:(r==null?void 0:r.bearing)===void 0?d(this,yt).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?d(this,yt).map.getPitch():r==null?void 0:r.pitch,zoom:(r==null?void 0:r.maxZoomLevel)||d(this,yt).map.getMaxZoom()}):(zLe&&HLe(d(this,yt),i),(h=d(this,yt).map)==null||h.fitBounds(i,{duration:(c=r==null?void 0:r.duration)!=null?c:lu.DEFAULT_ANIMATION_DURATION,bearing:(r==null?void 0:r.bearing)===void 0?d(this,yt).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?d(this,yt).map.getPitch():r==null?void 0:r.pitch,maxZoom:(p=r==null?void 0:r.maxZoomLevel)!=null?p:d(this,yt).map.getMaxZoom()})),d(this,Ft).interactionSystem.handleHover(),Promise.resolve()):new Promise(y=>{d(this,Ft).cameraSystem.focusOn(n,ke(this,A2,GD).call(this,r||{},y))})}};yt=new WeakMap,Ft=new WeakMap,Ah=new WeakMap,L2=new WeakMap,A2=new WeakSet,GD=o(function(t,r){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:d(this,Ft).cameraSystem.convertZoomLevelToAltitude(Oc(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,Ft).cameraSystem.convertZoomLevelToAltitude(Oc(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({},Fb,t==null?void 0:t.padding):this.insetsPadding,curve:Jf[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:Yt.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?Yt.degToRad(Oc(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,Ft).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(UD,"Camera");var yT=UD;function $D(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($D,"updateBounds");function Rie(e,t,r){var c;let n=[],i=[1/0,1/0,-1/0,-1/0],s=null;if(!e||!Array.isArray(e)||e.length===0)return{pointCloud:n,geoBounds:i,firstPosition:s};let l=t.getSystems().renderSystem;(l.threeDdirty||l.twoDdirty)&&t.renderSync();for(let p of e)if(typeof p=="string"){let h=r.get(p);if(!h){ce.error("Entity not found with id:",p);continue}let y=new co;nk(t,"userData"in h&&(c=h.userData.entityId)!=null?c:h.id,n,y,h instanceof Ar?h.position.z:void 0);let b=t.convert3DMapPositionToCoordinate(y.min),_=t.convert3DMapPositionToCoordinate(y.max);$D(i,b),$D(i,_),s||(s=t.convert3DMapPositionToCoordinate(y.getCenter(new pt)))}else n.push(t.convertTo3DMapPosition(p[1],p[0],p[2]||0)),$D(i,p),s||(s=p);return{pointCloud:n,geoBounds:i,firstPosition:s}}o(Rie,"processTargets");function HLe(e,t){var n,i,s,l;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"),(s=e.map)==null||s.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:r}}}),(l=e.map)==null||l.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}o(HLe,"drawBounds");g();g();var Bie="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 jie="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 $ie=4.291666666666667,Gie=15,Uie=25,Vie=43/60;g();var zie=["horizontal","icon"],WLe=new Map([[zie[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>'],[zie[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>']]),XLe=/<svg([^>]*)>/g;function qie(e,t,r,n){let i=WLe.get(e);return i?i.replace(XLe,'<svg$1 width="'.concat(r,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}o(qie,"getLogoIcon");var Hie=!1,Xn,Qf,Ov,Fo,_a,hy,tc,Pp,VD=class VD extends Lt{constructor(r,n,i){super();G(this,Xn,{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});G(this,Qf);G(this,Ov);G(this,Fo);G(this,_a);G(this,hy);G(this,tc,0);G(this,Pp,0);x(this,"dirty",!0);x(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,Xn).position],"getPositionAlignedCanvasCoordinates"));x(this,"getPositionAlignedPadding",o(()=>{var i,s,l,c;let r=d(this,Xn).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,Xn).position];let n={top:(i=r.top)!=null?i:0,right:(s=r.right)!=null?s:0,bottom:(l=r.bottom)!=null?l: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(([s,l])=>{l!==void 0&&(d(this,Xn)[s]=l)}),q(this,Ov,r),q(this,Qf,n)}get color(){return d(this,Xn).color==="light"?"white":"#293136"}get iconName(){return d(this,Xn).iconOnly?"icon":"horizontal"}get minWidth(){return d(this,Xn).iconOnly?Gie:75}get defaultWidth(){return d(this,Xn).iconOnly?Uie:150}get aspectRatio(){return d(this,Xn).iconOnly?Vie:$ie}get options(){return R({},d(this,Xn))}set options(r){var n,i;q(this,Xn,{padding:r.padding||d(this,Xn).padding,position:r.position||d(this,Xn).position,iconOnly:r.iconOnly||d(this,Xn).iconOnly,color:r.color||d(this,Xn).color,scale:r.scale||d(this,Xn).scale,onClick:d(this,Xn).onClick,interactive:(n=r.interactive)!=null?n:d(this,Xn).interactive,visible:(i=r.visible)!=null?i:d(this,Xn).visible})}get icon(){return qie(this.iconName,this.color,d(this,tc)*d(this,Qf).pixelRatio,d(this,Pp)*d(this,Qf).pixelRatio)}setSize(r,n){d(this,_a)&&(d(this,_a).uniforms.uSize.value.x=r,d(this,_a).uniforms.uSize.value.y=n)}setXY(r,n){d(this,_a)&&(d(this,_a).uniforms.uSize.value.w=r,d(this,_a).uniforms.uSize.value.z=n)}get width(){return d(this,tc)}get height(){return d(this,Pp)}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,Xn).position]}insertIntoQuadTree(r){d(this,hy)!=null&&typeof d(this,Xn).onClick=="function"&&d(this,Xn).interactive&&r.insert(d(this,hy))}resize(r,n){if(d(this,Xn).visible!==!0)return;let i=this.getPositionAlignedCanvasCoordinates(r,n),s=this.getPositionAlignedPadding(),l=this.getPositionAlignedOffset(d(this,tc),d(this,Pp)),c=Math.min(r-d(this,tc),Math.max(0,i.x+s.x+l.x)),p=Math.min(n-d(this,Pp),Math.max(0,i.y+s.y+l.y));this.setSize(d(this,tc)/r,d(this,Pp)/n),this.setXY(c/r,p/n),q(this,hy,new Lo(c,p,d(this,tc),d(this,Pp),{entityId:"watermark"}))}update(){this.dirty&&(d(this,Xn).visible===!0?(q(this,tc,Math.min(d(this,Qf).canvasWidth,Math.max(this.minWidth,this.defaultWidth*d(this,Xn).scale))),q(this,Pp,d(this,tc)/this.aspectRatio),Oh.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),r=>{if(q(this,_a,new Fd({uniforms:{uTexture:{value:r},uSize:{value:new MN(0,0,0,0)},uOpacity:{value:.7}},vertexShader:Bie,fragmentShader:jie,depthWrite:!1,depthTest:!1,defines:{debug:Hie},wireframe:Hie,transparent:!0,visible:!0})),d(this,Fo))d(this,Fo).visible=!0,d(this,Fo).material=d(this,_a),d(this,Fo).material.needsUpdate=!0;else{let n=new wu(2,2,1,1);q(this,Fo,new $t(n,d(this,_a))),d(this,Fo).position.set(0,0,-1),d(this,Fo).frustumCulled=!1,d(this,Fo).renderOrder=999;let i=new Cu(1,1,1),s=new $t(i,new _o({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));s.frustumCulled=!1,s.layers.set(1),d(this,Fo).add(s),d(this,Ov).add(d(this,Fo))}this.resize(d(this,Qf).canvasWidth,d(this,Qf).canvasHeight),this.publish("texture-loaded")})):d(this,Fo)&&(d(this,Fo).visible=!1),this.dirty=!1)}destroy(){d(this,Fo)&&(d(this,Ov).remove(d(this,Fo)),Pi(d(this,Fo))),q(this,Fo,void 0),d(this,_a)&&d(this,_a).dispose(),q(this,_a,void 0),q(this,hy,void 0)}};Xn=new WeakMap,Qf=new WeakMap,Ov=new WeakMap,Fo=new WeakMap,_a=new WeakMap,hy=new WeakMap,tc=new WeakMap,Pp=new WeakMap,o(VD,"WatermarkSystem");var vT=VD;g();var bT=100,KLe=!1,zD=class zD extends Lt{constructor(r,n){super();x(this,"currentTotalBoundingBox");x(this,"state");x(this,"cameraSystem");x(this,"debugMesh",null);x(this,"dirty",!0);x(this,"autoMinZoomLevel",!0);this.state=r,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new co,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new pt(0,0,0),new pt(bT*2,bT*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(bT)));let r=new co().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(r);let n=r.getSize(new pt),i=Math.max(n.x,n.y,n.z);for(let l of this.state.geometry2DMap.values())l.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(l.position),l.positionDirty=!1);let s=xT.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(i,bT)).getBoundingSphere(JLe).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new pt),min:xT.min,max:xT.max,radius:s},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,KLe&&this.state.entityScene.parent instanceof Nd){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Jp,this.debugMesh.add(new $t(new fS(this.cameraSystem.panBounds.radius),new _o({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let l=new pt;xT.getSize(l);let c=new Cu(l.x,l.y,l.z),p=new _o({color:65280,wireframe:!0,transparent:!0,opacity:.5}),h=new $t(c,p);h.position.copy(this.currentTotalBoundingBox.getCenter(new pt)),this.debugMesh.add(h)}}}};o(zD,"PanBoundsSystem");var IT=zD,xT=new co,JLe=new LN;g();var Wie="\xA9 Mappedin",QLe="https://info.mappedin.com/feedback",HD=["top-left","top-right","bottom-left","bottom-right"],eAe=640,tAe=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"),qD={custom:[],position:"bottom-right",feedback:!0},WD=class WD{constructor(t){x(this,"controlContainerEl");x(this,"controlPositions");x(this,"compact");x(this,"attribContainerEl");x(this,"attribInnerEl");x(this,"attribButtonEl");x(this,"feedbackLinkEl");x(this,"attribHTML",Wie);x(this,"customAttributions",[]);x(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.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=HD.reduce((r,n)=>{let i=document.createElement("div");return i.classList.add("mappedin-ctrl-".concat(n)),this.controlContainerEl.appendChild(i),r[n]=i,r},{})}addAttributionControl(t=qD){var i;let r=t.position&&HD.includes(t.position)?t.position:qD.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(r)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=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=tAe(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((i=t.feedback)!=null?i:qD.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=QLe,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=[Wie],n=t.style.sourceCaches;for(let i in n){let s=n[i];if(s.used||s.usedForTerrain){let l=s.getSource();l.attribution&&r.indexOf(l.attribution)<0&&r.push(l.attribution)}}r=r.filter(i=>String(i).trim()),r=r.filter((i,s)=>{for(let l=s+1;l<r.length;l++)if(r[l].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<=eAe||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}};o(WD,"HTMLControlsSystem");var _T=WD;g();var D2,F2,XD=class XD{constructor(t,r){x(this,"mesh");x(this,"type","custom-geometry");x(this,"dirty",!0);x(this,"feature");x(this,"builder");x(this,"outline");G(this,D2,1);x(this,"color",new An);G(this,F2,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){q(this,D2,t)}get opacity(){return d(this,D2)}setColor(t){this.color.set(t)}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return d(this,F2)}set altitude(t){this.mesh&&(this.mesh.position.z=t,q(this,F2,t))}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(t){this.mesh&&(this.mesh.renderOrder=t)}};D2=new WeakMap,F2=new WeakMap,o(XD,"CustomGeometryComponent");var Lv=XD;g();var YD=class YD{constructor(t,r){x(this,"state");x(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(s=>{s.userData={entityId:n,type:"custom-geometry"}}),t.dirty=!1),r.visible!==!1&&t.builder.update(t.mesh))}}};o(YD,"CustomGeometrySystem");var ST=YD;g();g();function Xie(e){return e.children.some(t=>t.userData.isOutline)}o(Xie,"hasOutline");var iAe=80,my,Av,wT,PT,ZD=class ZD{constructor(t){x(this,"rendererState");x(this,"outlineOpacitiesDirty",!0);G(this,my,!0);G(this,Av,-1/0);G(this,wT,new Map);G(this,PT,new TE({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:sS}));this.rendererState=t}get geometries3DDirty(){return d(this,my)}set geometries3DDirty(t){q(this,my,t)}update(t,r=!0){let n;if(this.geometries3DDirty){for(let s of this.rendererState.geometry3DMap.values())if(s instanceof Ar&&(s.visible||s.userData.preloadGeometry)){for(let l of s.children)if(l instanceof Ns&&l.components[0].outline&&(l.visible||s.userData.preloadGeometry)&&!Xie(l)&&l.userData.entities3D.size>0)for(let c of l.userData.entities3D.values()){let p=this.rendererState.geometry3DMap.get(c),h=[];if(p instanceof mn&&p.type==="geometry"&&p.components[3]&&p.components[3].dirty===!0&&p.components[0].geometry!=null&&p.components[0].material!=null){let w=p.components[0].geometry;if(!w)continue;h.push([p.components[3],new EE(w,iAe)])}if(h.length===0)continue;let y=Al(h.map(w=>w[1]),!1);if(y==null)continue;let b=y.getAttribute("position"),_=new Float32Array(b.count*4),C=new Qp(_,4);y.setAttribute("color",C);let P=0;for(let w=0;w<h.length;w++){let[O,D]=h[w],A=D.getAttribute("position").count;O.edgeColors=C,O.geometry=y,O.ranges={count:A,start:P},P+=A,D.dispose()}let E=new o0(y,d(this,PT));E.userData.isOutline=!0,l.add(E)}}q(this,my,!1),this.outlineOpacitiesDirty=!0}for(let s of this.rendererState.geometry3DIdsInScene){let l=this.rendererState.geometry3DMap.get(s);if(l instanceof mn&&l.type==="geometry"&&l.components[3]&&l.components[3].dirty===!0&&l.components[0].geometry!=null&&l.components[0].material!=null&&l.parentObject3D instanceof Ns){let c=l.components[3].geometry;if(!c)continue;let p=l.components[3];if(!p)continue;let h=p.edgeColors;if(!h)continue;let y=new An(p.color);for(let w=0;w<p.ranges.count;w++){let O=p.ranges.start+w;h.setXYZ(O,y.r,y.g,y.b)}let b=l.components[1].height,_=l.components[1].altitude,P=c.getAttribute("position").array,E=-1/0;for(let w=0;w<p.ranges.count;w++){let D=(p.ranges.start+w)*3,A=P[D+2];E=Math.max(E,A)}for(let w=0;w<p.ranges.count;w++){let D=(p.ranges.start+w)*3,A=P[D+2];Math.abs(A-E)<1e-4?P[D+2]=Math.max(b+_,2e-4+_):P[D+2]=_}c.attributes.color.needsUpdate=!0,c.attributes.position.needsUpdate=!0,c.computeBoundingSphere(),p.dirty=!1}}let i=r?Ll(t,16,19,0,1):d(this,Av);if((i!==d(this,Av)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let s of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(s),(n==null?void 0:n.type)==="geometry"&&n.components[0]instanceof Mi){let l=n.components[3];if(l&&l.edgeColors&&l.geometry){let c=l.visible,p=Math.min(i,c?n.components[1].opacity*dm(n):0);if(l.currentOpacity!==p){for(let h=0;h<l.ranges.count;h++){let y=l.ranges.start+h;l.edgeColors.setW(y,p)}l.geometry.attributes.color.needsUpdate=!0}}}}q(this,Av,i),q(this,my,!1),this.outlineOpacitiesDirty=!1}destroy(){d(this,wT).clear()}};my=new WeakMap,Av=new WeakMap,wT=new WeakMap,PT=new WeakMap,o(ZD,"OutlineInterpolationSystem");var CT=ZD;g();g();var KD=class KD extends $t{constructor(){super(...arguments);x(this,"userData",{entityId:""})}};o(KD,"EntityMesh");var TT=KD,oAe=ae.object({flipImageToFaceCamera:ae.boolean().optional(),url:ae.string()}),sAe=ae.object({type:ae.enum(["Feature"]),properties:ae.object({width:ae.number(),height:ae.number(),rotation:ae.number().min(0).max(360).optional(),verticalOffset:ae.number().optional()}),geometry:Pv});function Yie(e,t,r){ae.union([ae.number(),ae.string()]).parse(e),sAe.parse(t),oAe.parse(r)}o(Yie,"validateImage");var JD=class JD{constructor(t){x(this,"mesh",new Eu);x(this,"imageMesh");x(this,"outline");x(this,"type","image");x(this,"instanceIndex",-1);x(this,"geometry");x(this,"material");x(this,"feature");x(this,"position",new pt);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(JD,"ImageComponent");var ET=JD;g();function QD(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(QD,"rotatePoint");function aAe(e,t){return e.map(r=>QD(r,t))}o(aAe,"rotatePoints");function lAe(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(let s of e)t=Math.min(t,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);return{minX:t,minY:r,maxX:n,maxY:i}}o(lAe,"getBounds");function uAe(e,t){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let s=t[n].x,l=t[n].y,c=t[i].x,p=t[i].y;l>e.y!=p>e.y&&e.x<(c-s)*(e.y-l)/(p-l)+s&&(r=!r)}return r}o(uAe,"pointInPolygon");function Zie(e,t,r,n,i){for(let s=0;s<i;s++)for(let l=0;l<n;l++)if(e[r+s][t+l]!==1)return!1;return!0}o(Zie,"isValidRectangle");function cAe(e,t,r){let n=e.maxX-e.minX,i=e.maxY-e.minY,s,l,c=R({},e);return n/i>t?(l=i/r,s=l*t,c.minX+=(n-s*r)/2):(s=n/r,l=s/t,c.minY+=(i-l*r)/2),{dx:s,dy:l,gridBounds:c}}o(cAe,"calculateGridDimensions");function pAe(e,t,r,n,i){let s=Array(r).fill(0).map(()=>Array(r).fill(0));for(let l=0;l<r;l++)for(let c=0;c<r;c++){let p={x:t.minX+c*n,y:t.minY+l*i};uAe(p,e)&&(s[l][c]=1)}return s}o(pAe,"createAndFillGrid");function fAe(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 s=0;for(let l=1;l<=Math.min(t-i,t-n)&&Zie(e,i,n,l,l);l++)s=l;r[n][i]=s}return r}o(fAe,"calculateRectSizes");function dAe(e,t,r,n,i,s){let l=0,c=0,p=0;for(let h=0;h<n;h++)for(let y=0;y<n;y++)if(e[h][y]===1){let b=Math.pow(t[h][y],2),_=r.minX+y*i,C=r.minY+h*s;l+=b,c+=_*b,p+=C*b}return{x:c/l,y:p/l}}o(dAe,"calculatePolygonCenter");function hAe(e,t,r,n,i,s,l){let c=-1/0,p=null,h=e.length,y=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let b=0;b<h;b++)for(let _=0;_<h;_++)if(e[b][_]===1)for(let C=1;C<=h-_;C++){let P=C;if(!(P>h-b)&&Zie(e,_,b,C,P)){let E=C*P,w=t.minX+(_+C/2)*r,O=t.minY+(b+P/2)*n,D={x:w,y:O},k=Math.sqrt(Math.pow(D.x-i.x,2)+Math.pow(D.y-i.y,2))/y,j=E*(1-s)-k*s*E;j>c&&(c=j,p={center:D,width:C*r*l,height:C*n*l})}}return p}o(hAe,"findBestRectangle");function e8(e,t,r,n={}){let{scaleFactor:i=.9,centerPriority:s=.5,resolution:l=100,minimumSizeRatio:c=.5}=n,p=zN(r),h=e.width/e.height,y=aAe(t,p),b=lAe(y),{dx:_,dy:C,gridBounds:P}=cAe(b,h,l),E=pAe(y,P,l,_,C),w=fAe(E,l),O=dAe(E,w,P,l,_,C),D=hAe(E,P,_,C,O,s,i);return!D||D.width<e.width*c||D.height<e.height*c?e:re(R({},D),{center:QD(D.center,-p),rotation:r,polygonCenter:QD(O,-p)})}o(e8,"findLargestInteriorRectangle");var N2=Math.PI*2,mAe=Math.PI/2,gAe=Math.PI*1.5,yAe=a0(mAe,2),vAe=a0(gAe,2),bAe=.01,Kie=!1,t8=class t8 extends Lt{constructor(r,n,i=0,s=0,l={}){super();x(this,"rendererState");x(this,"convertTo3DMapPosition");x(this,"initialBearing",0);x(this,"naturalBearing",0);x(this,"imagePlacementOptions");x(this,"imageLoadingCache",new Map);this.rendererState=r,this.convertTo3DMapPosition=n,this.initialBearing=i,this.naturalBearing=s,this.imagePlacementOptions=l}createImageMesh(r,n,i,s=0,l,c){var P,E,w;let p={width:i.width,height:i.height,center:this.convertTo3DMapPosition(l),rotation:(P=i.rotation)!=null?P:0},h=(E=this.imagePlacementOptions.mode)!=null?E:"default",y=(()=>{switch(h){case"fit-nearest-90":let O=(this.initialBearing-this.naturalBearing+360)%180;return O>=45&&O<=135?e8(p,c,p.rotation+90,this.imagePlacementOptions):p;case"fit-initial-bearing":return e8(p,c,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return p}})();if(Kie&&y.polygonCenter){let O=new $t(new fS(1),new Pu({color:65280}));O.position.set(y.polygonCenter.x,y.polygonCenter.y,s),this.rendererState.entityScene.add(O)}let b=new Pu({transparent:!0,depthWrite:!1,side:Yp}),_=new wu(y.width,y.height),C=new TT(_);if(C.visible=!1,(w=this.getOrDownloadImage(n))==null||w.then(O=>{b.map=O,b.needsUpdate=!0,b.map.colorSpace=Zp,C.visible=!0,this.publish("image-loaded")}),C.userData.entityId=r,C.material=b,Kie){let O=new $t(new wu(i.width,i.height),new Pu({color:"gray"}));C.add(O);let D=new UN;C.add(D),D.scale.set(10,10,10)}return C.position.set(y.center.x,y.center.y,s+bAe),C.rotation.z=(-Yt.degToRad(y.rotation)+N2)%N2,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(s=>{Oh.getLoader().load(r,l=>{let c=this.imageLoadingCache.get(r);c&&!c.loaded&&(c.loaded=!0),s(l)})});return this.imageLoadingCache.set(r,{loaded:!1,promise:i}),i}}flipIfNeeded(r,n){if(r.imageMesh==null)return;let i=-n,s=r.imageMesh.rotation.z,l=a0((s-i+N2)%N2,2);l>yAe&&l<vAe&&(r.imageMesh.rotation.z=(s+Math.PI)%N2)}update(r){var l,c,p,h,y;let n,i,s;for(let b of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(b),(n==null?void 0:n.type)==="image"){if(i=n.components[0],s=n.components[1],s.url&&i.imageMesh==null){let _=this.convertTo3DMapPosition(i.feature.geometry.coordinates),C={x:_.x,y:_.y};i.imageMesh=this.createImageMesh(n.id,s.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&&s.flipImageToFaceCamera&&this.flipIfNeeded(i,r)}else if((n==null?void 0:n.type)==="geometry"){if(i=n.components[0],s=n.components[1],s.showImage&&((l=i.feature.properties)!=null&&l.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.feature.geometry.coordinates[0].map(P=>{let E=this.convertTo3DMapPosition(P);return{x:E.x,y:E.y}}),C=this.createImageMesh(b,(p=i.feature.properties)==null?void 0:p.image.path,(h=i.feature.properties)==null?void 0:h.image,s.height,(y=i.feature.properties)==null?void 0:y.image.position,_);i.mesh.parent.add(C),i.imageMesh=C}if(i.imageMesh){if(!i.visible)i.imageMesh.visible=!1;else if(s.showImage&&!i.imageMesh.visible)if(s.url){let _=this.imageLoadingCache.get(s.url);_&&_.loaded&&(i.imageMesh.visible=!0)}else i.imageMesh.visible=!0;else!s.showImage&&i.imageMesh.visible&&(i.imageMesh.visible=!1);s.flipImageToFaceCamera&&this.flipIfNeeded(i,r)}}}};o(t8,"ImageSystem");var MT=t8;g();var xAe=250,Dh,r8=class r8 extends Lt{constructor(r,n){super();x(this,"cameraDirty",!0);x(this,"focusablesDirty",!0);x(this,"state");x(this,"camera");x(this,"debugEl",null);x(this,"raycasters",[]);x(this,"collisions",new Map);x(this,"focusableEntities",new Set);x(this,"debugRaycasters",!1);G(this,Dh);x(this,"update",o((r=!1,n=Date.now())=>{r||Date.now()-n>xAe||(d(this,Dh)&&cancelAnimationFrame(d(this,Dh)),q(this,Dh,requestAnimationFrame(()=>{this.updateRaf()})))},"update"));this.state=r,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let r=new wt(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new wt(r.x/1.2,r.y/1.2),i=new wt(r.x+(r.x-n.x),n.y),s=new wt(n.x,r.y+(r.y-n.y)),l=new wt(i.x,s.y),c=new wt(r.x,r.y/1.5),p=new wt(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,p,n,i,s,l].map((h,y)=>{if(this.debugRaycasters){let E=document.createElement("div");E.style.position="absolute",E.style.top=h.y+"px",E.style.left=h.x+"px",E.style.width="10px",E.style.height="10px",E.style.backgroundColor="red",this.debugEl.append(E)}let b=h.x/this.state.canvasWidth*2-1,_=-(h.y/this.state.canvasHeight)*2+1,C=new wt(b,_),P=new Mc;return P.setFromCamera(C,this.camera),[P,C,y===0?10:y<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let r,n;for(let i of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(i),n!=null){if(n.type==="group-container"&&n.components[2]!==void 0&&n.components[2]instanceof _v){let s=n.components[2];if(s.dirty===!0||s.focusMesh==null){s.focusMesh&&Pi(s.focusMesh);let l=new co;l.setFromObject(n);let c=new Cu(l.max.x-l.min.x,l.max.y-l.min.y,l.max.z-l.min.z),p=new _o({transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters}),h=new $t(c,p);h.position.set((l.min.x+l.max.x)/2,(l.min.y+l.max.y)/2,(l.min.z+l.max.z)/2),h.userData={entityId:n.userData.entityId},s.focusMesh=h,n.add(h),n.components[2].dirty=!1}this.focusableEntities.add(s.focusMesh)}else if(n.components[0]&&n.components[0]instanceof Mi&&n.components[0].focusable&&n.components[0].geometry!=null&&(r=n.components[0],r instanceof Mi&&r.focusable&&r.geometry!=null)){if(r.focusMesh==null){let s=new $t(r.geometry);s.userData={entityId:n.id},r.focusMesh=s}this.focusableEntities.add(r.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.cameraDirty){if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.raycast()}}raycast(){this.collisions.clear();for(let[n,i]of this.raycasters)n.setFromCamera(i,this.camera);for(let[n,i,s]of this.raycasters)n.intersectObjects(Array.from(this.focusableEntities.values())).forEach(c=>{var p;if((c==null?void 0:c.object)!=null&&"isMesh"in c.object&&(c!=null&&c.object.isMesh)){let h=c.object.userData.entityId,y=(p=this.collisions.get(h))!=null?p:0;this.collisions.set(h,y+s)}});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,Dh)&&cancelAnimationFrame(d(this,Dh)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Dh=new WeakMap,o(r8,"GeometryInFocusSystem");var OT=r8;g();var Jie=20,IAe=5e3,uu,k2,R2,Fh,gy,yy,AT,B2,n8=class n8{constructor(t){x(this,"dirty",!0);x(this,"map");x(this,"stylesheetId","");x(this,"userHiddenLayers",new Set);x(this,"hiddenLayersInStyle",new Set);x(this,"centerPoint");x(this,"bbox");x(this,"polygons");G(this,uu,null);G(this,k2,o(()=>{d(this,uu)&&(clearTimeout(d(this,uu)),q(this,uu,null),this.dirty=!1)},"#stopTrying"));G(this,R2,o(()=>{d(this,uu)&&(clearTimeout(d(this,uu)),q(this,uu,null)),q(this,uu,setTimeout(()=>{d(this,k2).call(this)},IAe))},"#startTrying"));x(this,"handleRender",o(async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(d(this,Fh)&&(d(this,AT).call(this),q(this,Fh,!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=[],q(this,Fh,!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){q(this,Fh,!0);for(let r=0;r<t.length;r+=Jie){let n=t.slice(r,r+Jie);d(this,gy).push(()=>{for(let i of n)if(i.geometry!=null&&"coordinates"in i.geometry){if(this.polygons==null)return;let s;if(i.geometry.type==="Polygon"?s=Un(i.geometry.coordinates):i.geometry.type==="MultiPolygon"&&(s=Tu(i.geometry.coordinates)),!s)continue;for(let l of this.polygons)if(nx(l,s)){this.expr.push(["!=",["id"],i.id]);continue}}})}d(this,B2).call(this)}}}},"handleRender"));x(this,"expr",[]);G(this,Fh,!1);G(this,gy,[]);G(this,yy,null);G(this,AT,o(()=>{d(this,yy)&&(globalThis.cancelAnimationFrame(d(this,yy)),q(this,yy,null)),q(this,gy,[])},"#cancelJobs"));G(this,B2,o(()=>{let t=d(this,gy).pop();typeof t=="function"&&(t(),d(this,gy).length>0&&q(this,yy,globalThis.requestAnimationFrame(d(this,B2)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(r=>{this.map.setFilter(r,["all",...this.expr])}),this.dirty=!1),this.expr=[],q(this,Fh,!1),d(this,k2).call(this)},"#runJobs"));x(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,R2).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,uu)&&clearTimeout(d(this,uu)),d(this,R2).call(this),this.bbox=t,this.polygons=r.reduce((i,s)=>{if(s.geometry.type==="Polygon"){let l=Un(s.geometry.coordinates);i.push(l)}else s.geometry.type==="MultiPolygon"&&i.push(...s.geometry.coordinates.map(l=>Un(l)));return i},[]);for(let i of n)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let 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))}};uu=new WeakMap,k2=new WeakMap,R2=new WeakMap,Fh=new WeakMap,gy=new WeakMap,yy=new WeakMap,AT=new WeakMap,B2=new WeakMap,o(n8,"OutdoorLayers");var LT=n8;g();g();g();g();var DT="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 i8="#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 Qie="void main(void) {\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n}";var eoe="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 SAe=new s0;function toe(e,t,r){let{nearRadius:n,farRadius:i,accentColor:s,completeFraction:l,isVertical:c,visibleThroughGeometry:p,dashed:h}=t,{color:y}=r,b=!0,_=0,C=1/0,P=t.displayArrowsOnPath,E=!0,w=P,O=n/2+CAe,D=0;e[0].z+=O;for(let we=1;we<e.length;++we){e[we].z+=O;let H=e[we].x-e[we-1].x,ie=e[we].z-e[we-1].z;if(c)D+=Math.sqrt(H*H+ie*ie);else{let ee=e[we].y-e[we-1].y;D+=Math.sqrt(H*H+ee*ee+ie*ie)}}if(!c){let we=e[0],H=e[e.length-1];e.push(H.clone().setZ(H.z-.01)),e.unshift(we.clone().setZ(we.z-.01))}let A=new EN;w&&(A=SAe.load(eoe),A.colorSpace=Zp);let k=new An(y),j=new An(s),W={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new wt(1,1)},cameraParameters:{type:"v2",value:new wt(_,0)},complete:{type:"f",value:b?0:1},color:{type:"c",value:k},pathLength:{type:"f",value:D},nearRadius:{type:"f",value:n},farRadius:{type:"f",value:i},nearZoom:{type:"f",value:_},farZoom:{type:"f",value:C},pulseColor:{type:"c",value:j},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:c},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:A},displayArrowsOnPath:{type:"b",value:P},showPulse:{type:"b",value:E},opacityMultiplier:{type:"f",value:1},dashed:{type:"b",value:h}},Y=new kN(e);Y.curveType="catmullrom",Y.tension=0;let N=30,Z=8,le=N*e.length,se=new RN(Y,le,n,Z,!1),U=new Float32Array(se.attributes.position.count);for(let we=e.length;we<U.length;we++)U[we]=we;se.setAttribute("vertexIndex",new Qp(U,1));let ye=new Float32Array(se.attributes.position.count),ne=new Qp(ye,1);for(let we=0;we<=le;we++)for(let H=0;H<=Z;++H)ne.setX(we*(Z+1)+H,we/le);se.setAttribute("pathDistance",ne);let Ce=new Float32Array(se.attributes.normal.count*3),Ie=new Qp(Ce,3);for(let we=0;we<le;we++){let H=se.tangents[we];for(let ie=0;ie<=Z;++ie)Ie.setXYZ(we*(Z+1)+ie,H.x,H.y,H.z)}se.setAttribute("pathTangent",Ie);let Ue=new Float32Array(se.attributes.normal.count*3),ve=new Qp(Ue,3);for(let we=0;we<le;we++){let H=se.tangents[we];var Te,Q,Qe;c?(Te=H.x*H.y,Q=-1+H.y*H.y,Qe=H.z*H.y):(Te=-H.x*H.z,Q=-H.y*H.z,Qe=1-H.z*H.z);let ie=Math.sqrt(Te*Te+Q*Q+Qe*Qe);ie===0&&(ie=1);let ee=Te/ie,Me=Q/ie,Ne=Qe/ie;for(let Oe=0;Oe<=Z;++Oe)ve.setXYZ(we*(Z+1)+Oe,ee,Me,Ne)}se.setAttribute("pathNormal",ve);let Ye=new Fd({uniforms:W,vertexShader:DT,fragmentShader:i8});Ye.transparent=!0,Ye.alphaTest=.5,W.resolution.value.x=1,W.resolution.value.y=1,W.vertexes.value=U.length,W.arrowTexture.value.wrapS=Pc,W.arrowTexture.value.wrapT=Pc,W.arrowTexture.value.anisotropy=16;let nt=new $t(se,Ye),Ae=nt.clone(),Be=re(R({},W),{opacityMultiplier:{type:"f",value:.25}});Be.complete.value=1,Ae.material=new Fd({uniforms:Be,vertexShader:DT,fragmentShader:i8}),Ae.material.transparent=!0,Ae.material.alphaTest=.5,Ae.material.depthWrite=!1,Ae.material.depthTest=!1,Be.resolution.value.x=1,Be.resolution.value.y=1,Be.vertexes.value=U.length,Be.arrowTexture.value.wrapS=Pc,Be.arrowTexture.value.wrapT=Pc,Be.arrowTexture.value.anisotropy=16,Be.complete.value=l,nt.userData=Ae.userData=t.mesh.userData;let We=t.mesh;if(!p){let we=new Fd({uniforms:W,vertexShader:DT,fragmentShader:Qie}),H=new $t(se,we);H.name="stencil",H.material.colorWrite=!1,H.material.stencilWrite=!0,H.material.stencilRef=1,H.material.stencilFunc=PN,H.material.stencilZPass=uS,H.material.stencilZFail=uS,H.material.stencilFail=uS,H.material.depthWrite=!1,H.material.depthTest=!1,H.userData=t.mesh.userData,We.add(H),We.add(Ae)}if(We.add(nt),c){let we=new co().setFromObject(nt),H=new pt;we.getCenter(H),We.children.forEach(ie=>{ie.geometry.center(),ie.position.copy(H)})}p&&(nt.material.stencilWrite=!0,nt.material.stencilRef=1,nt.material.stencilFunc=wN,nt.material.stencilZPass=lS,nt.material.stencilZFail=lS,nt.material.stencilFail=lS,nt.material.needsUpdate=!0,nt.layers.disableAll(),nt.layers.enable(xS.ALWAYS_ON_TOP)),se.computeBoundingBox();let $e=new pt;return se.boundingBox.getCenter($e),{mesh:We,material:Ye,center:$e}}o(toe,"buildPath");var CAe=.15;var wAe=.5,o8=class o8 extends Lt{constructor(r,n,i,s){super();x(this,"rendererState");x(this,"altitudeDirty",!0);x(this,"convertTo3DMapPosition");x(this,"getParentContainer");x(this,"convertZoomLevelToAltitude");this.rendererState=r,this.convertTo3DMapPosition=n,this.getParentContainer=i,this.convertZoomLevelToAltitude=s}update(r,n,i,s=0){let l,c=!1;for(let p of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(p),l&&l.type==="path"&&l.components[0].type==="path"){let h=l.components[0],y=l.components[1],b=h.isVertical&&this.altitudeDirty;if(!(h instanceof Lh))continue;let _=[];if(h.dirty||b){if(h.mesh.parent!=null)for(let C=h.mesh.children.length-1;C>=0;C--)Pi(h.mesh.children[0]);if(h.feature.features.length===2&&h.feature.features[0].properties.parentId&&h.feature.features[1].properties.parentId){let C=h.feature.features[0],P=h.feature.features[h.feature.features.length-1],E,w,O=C.geometry.coordinates[2]||0,D=P.geometry.coordinates[2]||0;C.properties.parentId&&(E=this.getParentContainer(C.properties.parentId,!0),E!=null&&E.altitude!=null&&(O+=E.altitude,h.isVertical=!0)),P.properties.parentId&&(w=this.getParentContainer(P.properties.parentId,!0),w!=null&&w.altitude!=null&&(D+=w.altitude,h.isVertical=!0));let A=this.convertTo3DMapPosition(C.geometry.coordinates[1],C.geometry.coordinates[0],O),k=this.convertTo3DMapPosition(P.geometry.coordinates[1],P.geometry.coordinates[0],D);Math.abs(A.z-k.z)>wAe&&E!=null&&E.visible&&w!=null&&w.visible&&(_=[A,k])}else _=h.feature.features.map(C=>this.convertTo3DMapPosition(C.geometry.coordinates[1],C.geometry.coordinates[0],C.geometry.coordinates[2]||0));if(_.length>1){let{mesh:C,material:P,center:E}=toe(_,h,{color:y.color});h.mesh=C,h.material=P,h.position=E}h.dirty&&(h.nearZoomLevel!=null&&(h.nearZoomAltitude=this.convertZoomLevelToAltitude(h.nearZoomLevel)),h.farZoomLevel!=null&&(h.farZoomAltitude=this.convertZoomLevelToAltitude(h.farZoomLevel))),h.dirty=!1}y.dirty&&(h.mesh.children.forEach(C=>{C.name!=="stencil"&&(C.material.uniforms.color.value.set(y.color),C.material.visible=y.visible,C.material.needsUpdate=!0)}),h.mesh.position.z=y.altitude,y.dirty=!1),h.isVertical&&h.mesh.children.forEach(C=>{C.rotation.z=-s}),h.material&&(h.mesh.children.forEach(C=>{var E,w;if(C.name==="stencil")return;let P=C.material.uniforms;P.nearZoom.value=(E=h.nearZoomAltitude)!=null?E:r,P.farZoom.value=(w=h.farZoomAltitude)!=null?w:n,P.cameraParameters.value.x=i,h.materialDirty&&(P.nearRadius.value=h.nearRadius,P.displayArrowsOnPath.value=h.displayArrowsOnPath,P.farRadius.value=h.farRadius,P.pulseColor.value.set(h.accentColor),P.complete.value=h.completeFraction),C.material.needsUpdate=!0}),h.displayArrowsOnPath&&h.animateArrowsOnPath&&(h.mesh.children.forEach(C=>{C.name!=="stencil"&&(C.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,C.material.needsUpdate=!0)}),c=!0),h.materialDirty=!1)}this.altitudeDirty=!1,c&&this.publish("animate:path")}};o(o8,"PathSystem");var j2=o8;g();var No,Dv,ed,s8=class s8{constructor(t){x(this,"rendererState");x(this,"dirty",!1);G(this,No);G(this,Dv);G(this,ed);this.rendererState=t}updateOne(t){if(t instanceof mn&&t.components[0]instanceof Mi&&t.components[1]instanceof Ac&&t.parentObject3D instanceof Ns&&(q(this,No,t.components[0]),q(this,ed,t.components[1]),d(this,No).detached&&d(this,No).dirty&&d(this,No).geometry!=null&&d(this,No).material!=null)){q(this,Dv,t.parentObject3D),d(this,No).visible=!1;let r=new An(d(this,ed).color),n=d(this,ed).opacity*dm(t),i=new ly({color:r,side:Yp,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,d(this,No).material.repeatYFactor),s=new bS(1,d(this,No).geometry.attributes.position.count||0,0,i),l=s.addGeometry(d(this,No).geometry);s.addInstance(l),s.userData={entities:{0:t.id},detached:!0},d(this,No).instanceIndex=l,d(this,No).material.setColor(d(this,No).instanceIndex,r,d(this,ed).topColor?new An(d(this,ed).topColor):r),d(this,No).mesh=s,d(this,No).material=i,d(this,Dv).add(s),d(this,No).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(){q(this,No,void 0),q(this,Dv,void 0),q(this,ed,void 0)}};No=new WeakMap,Dv=new WeakMap,ed=new WeakMap,o(s8,"MeshDetachmentSystem");var FT=s8;g();g();function roe(e,t,r){var n,i;if(e.geometry!=null){let s=t||1e-4,l=s/Math.max(e.currentHeight,1e-4),c=s/Math.max(r,1e-4);return e.geometry.scale(1,1,l),e.material&&(e.material.repeatYFactor=c),(n=e.mesh)==null||n.setGeometryAt(e.instanceIndex,e.geometry),(i=e.mesh)==null||i.computeBoundingSphere(),e.currentHeight=s,!0}return!1}o(roe,"updateHeight");function noe(e,t,r,n,i,s){return e.mesh&&e.instanceIndex!==-1?(e.mesh.getMatrixAt(e.instanceIndex,r),r.decompose(n,i,s),n.z=t,r.compose(n,i,s),e.mesh.setMatrixAt(e.instanceIndex,r),e.altitude=t,!0):!1}o(noe,"updateAltitude");var rc,Tp,kT,RT,BT,jT,a8=class a8{constructor(t){x(this,"rendererState");x(this,"dirty",!1);G(this,rc);G(this,Tp);G(this,kT,new nl);G(this,RT,new pt);G(this,BT,new um);G(this,jT,new pt);this.rendererState=t}updateOne(t){var r;if(t instanceof mn&&t.type==="geometry"&&((r=t.components[1])!=null&&r.dirty)&&(q(this,rc,t.components[0]),q(this,Tp,t.components[1]),t.type==="geometry")){let n=!1;d(this,Tp).height!==d(this,rc).currentHeight&&(n=roe(d(this,rc),d(this,Tp).height,d(this,Tp).initialHeight)),d(this,Tp).altitude!==d(this,rc).altitude&&(n=noe(d(this,rc),d(this,Tp).altitude,d(this,kT),d(this,RT),d(this,BT),d(this,jT))),n&&d(this,rc).mesh!=null&&d(this,rc).mesh.computeBoundingSphere()}}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.cleanup()}cleanup(){q(this,rc,void 0),q(this,Tp,void 0)}};rc=new WeakMap,Tp=new WeakMap,kT=new WeakMap,RT=new WeakMap,BT=new WeakMap,jT=new WeakMap,o(a8,"MeshModificationSystem");var NT=a8;g();var PAe={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},l8=class l8{constructor(t){x(this,"state",PAe);x(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(l8,"Debug");var $T=l8;g();var $2=9,TAe=!1,ioe=.1;function EAe(e,t,r){for(let n=0;n<t;n++){let i=(r&16711680)>>16,s=(r&65280)>>8,l=r&255;e[n*3]=i/255,e[n*3+1]=s/255,e[n*3+2]=l/255}}o(EAe,"fillArrayWithColor");var u8=class u8{constructor(t,r,n){x(this,"state");x(this,"renderer");x(this,"renderService");x(this,"pickingTexture");x(this,"pickingMaterial");x(this,"pixelBuffer");x(this,"width",0);x(this,"height",0);x(this,"scale",1/2);x(this,"color",1);x(this,"convertTo3DMapPosition");x(this,"destroyed",!1);x(this,"enabled",!1);x(this,"backgroundId",16777215);x(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 ON(this.width,this.height,{format:aS,type:_N,internalFormat:"RGBA"})},"resize"));x(this,"shouldShowByXY",o((t,r,n)=>{if(this.pixelBuffer==null)return!1;let i=t+(this.height-r-1)*this.width,s=this.pixelBuffer[i*4],l=this.pixelBuffer[i*4+1],c=this.pixelBuffer[i*4+2],p=s<<16|l<<8|c;return p===n||p===this.backgroundId},"shouldShowByXY"));x(this,"activeOccluders",new Set);x(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 s=this.state.geometry3DMap.get(i);if(s&&s instanceof Ar&&s.userData.occluderFeature!=null&&s.userData.occluderId!=null&&(this.activeOccluders.add(s.userData.occluderId),s.userData.occluderDirty)){if(t=s.userData.occluderFeature,t.geometry.type==="Polygon"){let l=X3(t,this.convertTo3DMapPosition,{color:"white",height:ioe});r=this.createOccluderMesh(l,s.userData.occluderId),s.add(r)}else if(t.geometry.type==="MultiPolygon"){let l=Y3(t,this.convertTo3DMapPosition,{color:"white",height:ioe});r=this.createOccluderMesh(l,s.userData.occluderId),s==null||s.add(r)}s.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new An(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable($2),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable($2),TAe?this.renderService.enabledLayers.add($2):this.renderService.enabledLayers.delete($2),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 s=this.state.geometry2DMap.get(i);if(s&&(s==null?void 0:s.occluderId)!=null&&this.activeOccluders.has(s==null?void 0:s.occluderId)){let l=s.components[0].projection,c=Math.floor(l.x*this.scale),p=Math.floor(l.y*this.scale),h=this.shouldShowByXY(c,p,s.occluderId);s.components[0].isOccluded=!h}}})},"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 Fd({glslVersion:TN,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);EAe(i,n.count,r),t.setAttribute("color",new Qp(i,3))}createOccluderMesh(t,r){let n=new $t(t,this.pickingMaterial);return n.layers.set($2),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(u8,"Occlusion2DSystem");var GT=u8;var ooe=new Mc;var{DEFAULT_PITCH:h8,DEFAULT_BEARING:m8,DEFAULT_ZOOM_LEVEL:g8,DEFAULT_MIN_ZOOM_LEVEL:MAe,DEFAULT_MAX_ZOOM_LEVEL:OAe}=lu,LAe=Yt.radToDeg(.6435011087932844),zi,Ni,vy,G2,Fv,Nh,by,Nv,ws,p8,de,Bn,nc,ki,Ep,Jo,me,U2,yo,jn,soe,aoe,loe,kh,V2,z2,q2,kv,UT,H2,W2,X2,Rv,f8,xy,Y2,Sa,Ca,d8,Bv,Z2,y8=class y8 extends Lt{constructor(r,n={}){var _,C,P,E,w,O,D,A,k,j,W,Y;super();G(this,ws);x(this,"options");x(this,"container");x(this,"Debug");G(this,zi);G(this,Ni);G(this,vy);G(this,G2);G(this,Fv);G(this,Nh);G(this,by);G(this,Nv);x(this,"rendererDomElement");G(this,de,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Ar("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:Fb,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,internalTweenGroup:new oT,externalTweenGroup:new oT,cameraObject:new PE,naturalBearing:0,containerOffset:[0,0],useStandaloneCamera:!1});x(this,"camera");G(this,Bn);G(this,nc);G(this,ki);G(this,Ep);G(this,Jo);G(this,me,{});G(this,U2,window.matchMedia("screen and (min-resolution: 2dppx)"));x(this,"map");G(this,yo,o(()=>{d(this,me).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));G(this,jn,o(()=>{d(this,me).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));G(this,kh,"standalone");G(this,V2,o(r=>Math.trunc(r*10)/10,"#round10"));G(this,z2,o(()=>{ke(this,ws,p8).call(this,u0()),d(this,me).twoDDrawSystem.dirty=!0,d(this,kv).call(this,void 0,void 0,!0)},"#handlePixelRatioChange"));G(this,q2,o(()=>{d(this,kv).call(this)},"#handleWindowResizeWithEvent"));G(this,kv,o((r,n,i=!1)=>{let s=r!=null?r:this.rendererDomElement.clientWidth,l=n!=null?n:this.rendererDomElement.clientHeight;if((s===0||l===0)&&!i)return;d(this,de).canvasWidth=s,d(this,de).canvasHeight=l,ke(this,ws,p8).call(this,u0()),d(this,Rv).call(this),ke(this,ws,loe).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:p}=this.container.getBoundingClientRect();d(this,de).containerOffset=[c,p],this.publish("resize"),this.render()},"#handleWindowResize"));G(this,UT,o(()=>{this.renderSync()},"#renderFull"));G(this,H2,new pt);G(this,W2,o((r,n)=>{let i=this.mode==="standalone"?d(this,Ni):this.viewCamera;if(d(this,Ni).position.z+this.camera.elevation>n.z){d(this,H2).copy(n);let s=d(this,H2).project(i),l=(s.x+1)/2*this.canvasWidth-0/2,c=(-s.y+1)/2*this.canvasHeight-0/2,p=d(this,V2).call(this,l),h=d(this,V2).call(this,c);r.x=p,r.y=h}else r.x=-1e3,r.y=-1e3},"#project"));G(this,X2,o((r,n)=>{d(this,Jo).setBufferSize(r,n),d(this,Ni).aspect=r/n,d(this,Ni).updateProjectionMatrix(),d(this,Ni).updateMatrixWorld(!0),d(this,Fv).x=r,d(this,Fv).y=n},"#setBufferSize"));G(this,Rv,o(()=>{var l;let r=d(this,de).canvasWidth=this.rendererDomElement.clientWidth,n=d(this,de).canvasHeight=this.rendererDomElement.clientHeight,i=Math.floor(r*this.resolutionScale),s=Math.floor(n*this.resolutionScale);d(this,X2).call(this,i,s),(l=this.map)==null||l.resize(),d(this,de).shouldMeasureCanvas=!1},"#measureCanvas"));x(this,"getParentContainer",o((r,n=!0)=>{if(!r)return n?d(this,de).entityScene:void 0;if(typeof r=="string"||typeof r=="number"){let i=d(this,de).geometry3DMap.get(r);return i instanceof Ar?i:(ce.warn("Parent (".concat(typeof r=="object"?r.id:r,") is not a valid container, adding to scene")),n?d(this,de).entityScene:void 0)}else if(r.type==="group-container"){let i=d(this,de).geometry3DMap.get(r.id);if(i instanceof Ar)return i}return n?d(this,de).entityScene:void 0},"getParentContainer"));x(this,"showCollisionBoxes",o(()=>{d(this,me).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));x(this,"hideCollisionBoxes",o(()=>{d(this,me).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));x(this,"projectScreenXYToCoordinate",o((r,n,i=!1)=>{var _,C;let s=d(this,de).containerOffset[0],l=d(this,de).containerOffset[1],c=(r-l)/d(this,de).canvasWidth*2-1,p=-((n-s)/d(this,de).canvasHeight)*2+1,h=new wt(c,p),y,b;if(i)ooe.setFromCamera(h,d(this,Ni)),y=(_=ooe.intersectObject(d(this,Nh),!1)[0])==null?void 0:_.point;else{let P=d(this,me).interactionSystem.getThreeDIntersectsFromXY(h);y=(C=P==null?void 0:P[0])==null?void 0:C.point,b=d(this,me).interactionSystem.getGroupContainerIntersectsFromXY(h)}if(y)return{coordinate:this.convert3DMapPositionToCoordinate(y),groupContainers:b}},"projectScreenXYToCoordinate"));x(this,"projectCoordinateToScreenXY",o(r=>{let n=this.convertTo3DMapPosition(r[1],r[0],r[2]||0),i=new wt;return d(this,W2).call(this,i,n),{x:i.x,y:i.y}},"projectCoordinateToScreenXY"));x(this,"convert3DMapPositionToCoordinate",o(r=>{var s,l,c,p;let{lat:n,lon:i}=IS((l=(s=d(this,de).center)==null?void 0:s[1])!=null?l:0,(p=(c=d(this,de).center)==null?void 0:c[0])!=null?p:0,r.x,r.y);return[i,n,r.z]},"convert3DMapPositionToCoordinate"));x(this,"setBackgroundColor",o((r,n)=>{d(this,Jo).setBackgroundColor(r,n)},"setBackgroundColor"));x(this,"getMetresPerPixel",o(()=>{let r=this.container.clientWidth,n=this.container.clientHeight/2,i=this.projectScreenXYToCoordinate(0,n,!0),s=this.projectScreenXYToCoordinate(r,n,!0);return i==null||s==null?void 0:mS(i.coordinate,s.coordinate)/r},"getMetresPerPixel"));x(this,"hideOutdoorLayersUnderPoint",o((r,n)=>{!this.map||(n==null?void 0:n.length)===0||(d(this,me).outdoorLayersSystem.hideLayersUnderPoint(r,n),this.render())},"hideOutdoorLayersUnderPoint"));x(this,"hideOutdoorLayersIntersectingPolygons",o((r,n,i)=>{d(this,me).outdoorLayersSystem.hideLayersIntersectingPolygons(r,n,i),this.render()},"hideOutdoorLayersIntersectingPolygons"));G(this,xy,new NN);G(this,Y2,new nl);x(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()},"render"));x(this,"renderSync",o(()=>d(this,me).renderSystem.update(!0),"renderSync"));G(this,Sa,c0(()=>{this.publish("user-interaction-start",void 0)},0,!0));G(this,Ca,c0(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));x(this,"on",o((r,n)=>{super.on(r,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(r)&&this.mode==="standalone"&&I.env.NODE_ENV!=="test"&&(ce.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"));x(this,"off",o((r,n)=>{super.off(r,n)},"off"));x(this,"getCursor",o(()=>d(this,me).interactionSystem.getCursor(),"getCursor"));x(this,"destroy",o(()=>{var r;d(this,me)&&(d(this,me).cameraSystem.off("user-dolly-start",d(this,Sa)),d(this,me).cameraSystem.off("user-pan-start",d(this,Sa)),d(this,me).cameraSystem.off("user-rotate-start",d(this,Sa)),d(this,me).cameraSystem.off("user-zoom-start",d(this,Sa)),d(this,me).cameraSystem.off("user-tilt-start",d(this,Sa)),d(this,me).cameraSystem.off("user-pedestal-start",d(this,Sa)),d(this,me).cameraSystem.off("user-dolly-end",d(this,Ca)),d(this,me).cameraSystem.off("user-pan-end",d(this,Ca)),d(this,me).cameraSystem.off("user-rotate-end",d(this,Ca)),d(this,me).cameraSystem.off("user-zoom-end",d(this,Ca)),d(this,me).cameraSystem.off("user-tilt-end",d(this,Ca)),d(this,me).cameraSystem.off("user-pedestal-end",d(this,Ca)),d(this,me).renderSystem.off("measure-canvas",d(this,Rv)),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,q2),!1),d(this,U2).removeEventListener("change",d(this,z2)),d(this,by)&&d(this,by).disconnect(),this._subscribers={},d(this,Jo).destroy(),(r=d(this,zi))==null||r.traverse(n=>{Pi(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),q(this,zi,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(),q(this,me,void 0),d(this,kh)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(d(this,Ep)),this.container.removeChild(d(this,Bn)),q(this,Jo,void 0))},"destroy"));G(this,Bv,new pt);G(this,Z2,new pt);if(d(this,de).useStandaloneCamera=(_=n.useStandaloneCamera)!=null?_:!1,d(this,de).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&&(q(this,kh,n.mode),this.map=n.map),d(this,de).entityScene.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,yo).call(this)}),d(this,de).entityScene.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,yo).call(this)}),d(this,de).geometry3DMap.set(d(this,de).entityScene.userData.entityId,d(this,de).entityScene),n.center&&(d(this,de).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=r,ke(this,ws,soe).call(this),ke(this,ws,aoe).call(this),d(this,me).htmlControlsSystem=new _T(this.container),d(this,kh)!=="outdoors-overlay"&&d(this,me).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),I.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),q(this,Jo,new e3({antialias:typeof n.antialias=="boolean"?n.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(P=n.gl)==null?void 0:P.canvas:void 0,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:o(N=>{var Z;(Z=n.onWebGLContextRestored)==null||Z.call(n,N),d(this,yo).call(this),d(this,jn).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(E=n.backgroundAlpha)!=null?E:1})),q(this,zi,new Nd),d(this,zi).add(d(this,de).entityScene);let i=window.__THREE_DEVTOOLS__;I.env.NODE_ENV==="dev"&&typeof i<"u"&&(i.dispatchEvent(new CustomEvent("observe",{detail:d(this,zi)})),i.dispatchEvent(new CustomEvent("observe",{detail:d(this,Jo)}))),q(this,Ni,new PE(LAe,this.aspect,50,1e5)),d(this,de).cameraObject=d(this,Ni),q(this,G2,new DN),d(this,Ni).renderOrder=999;let s=new Jp;s.add(d(this,Ni)),q(this,Nv,new Jp),d(this,Nv).add(s),d(this,zi).add(d(this,Nv)),d(this,Ni).updateProjectionMatrix(),d(this,Ni).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,Jo).domElement(),q(this,Fv,new wt);let l=new wu(1e6,1e6),c=new _o({color:0,visible:!1});q(this,Nh,new $t(l,c)),d(this,Nh).name="worldPlane",d(this,zi).add(d(this,Nh)),(w=n.gl)!=null&&w.canvas||r.appendChild(this.rendererDomElement),window.addEventListener("resize",d(this,q2),!1),d(this,U2).addEventListener("change",d(this,z2)),typeof ResizeObserver=="function"&&((O=I.env)==null?void 0:O.NODE_ENV)!=="test"&&(q(this,by,new ResizeObserver(ek(N=>{d(this,kv).call(this,N[0].contentRect.width,N[0].contentRect.height)},50))),(D=d(this,by))==null||D.observe(r)),r.classList.add("mappedin-map"),this.rendererDomElement.style.width=(A=globalThis.MappedinDebug)!=null&&A.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(k=globalThis.MappedinDebug)!=null&&k.TEST_IOS?"1920px":"100%",I.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),d(this,de).canvasWidth=this.rendererDomElement.clientWidth,d(this,de).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let p=this.canvasWidth,h=this.canvasHeight;d(this,me).watermarkSystem=new vT(d(this,Ni),d(this,de),n==null?void 0:n.watermark),d(this,me).watermarkSystem.on("texture-loaded",this.render),d(this,de).shouldMeasureCanvas=!0,d(this,de).pixelRatio=this.resolutionScale,d(this,X2).call(this,Math.floor(p*this.resolutionScale),Math.floor(h*this.resolutionScale));let y=new dS(16777215,.3*Math.PI);y.position.set(-150,-150,350),d(this,zi).add(y);let b=new jN(16777215,.741*Math.PI);d(this,zi).add(b),d(this,me).cameraSystem=new Mv(d(this,Ni),d(this,zi),d(this,Jo).renderer,d(this,de),{mode:this.mode,canvasHeight:h,canvasWidth:p}),d(this,me).cameraSystem.on("user-dolly-start",d(this,Sa)),d(this,me).cameraSystem.on("user-pan-start",d(this,Sa)),d(this,me).cameraSystem.on("user-rotate-start",d(this,Sa)),d(this,me).cameraSystem.on("user-zoom-start",d(this,Sa)),d(this,me).cameraSystem.on("user-tilt-start",d(this,Sa)),d(this,me).cameraSystem.on("user-pedestal-start",d(this,Sa)),d(this,me).cameraSystem.on("user-dolly-end",d(this,Ca)),d(this,me).cameraSystem.on("user-pan-end",d(this,Ca)),d(this,me).cameraSystem.on("user-rotate-end",d(this,Ca)),d(this,me).cameraSystem.on("user-zoom-end",d(this,Ca)),d(this,me).cameraSystem.on("user-tilt-end",d(this,Ca)),d(this,me).cameraSystem.on("user-pedestal-end",d(this,Ca)),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 j2(d(this,de),this.convertTo3DMapPosition,this.getParentContainer,d(this,me).cameraSystem.convertZoomLevelToAltitude),d(this,me).pathSystem.on("animate:path",this.render),d(this,me).panBoundsSystem=new IT(d(this,de),d(this,me).cameraSystem),d(this,me).panBoundsSystem.on("update",()=>{let{panBounds:N,fov:Z,convertAltitudeToZoomLevel:le}=d(this,me).cameraSystem;if(d(this,me).panBoundsSystem.autoMinZoomLevel){if(N.radius<=0)return;let se=Math.min(d(this,de).canvasWidth/d(this,de).canvasHeight,1),U=Z*Math.PI/180*se,ye=Math.tan(U/2),{radius:ne,center:Ce}=d(this,me).cameraSystem.panBounds,Ie=ne/ye,Ue=this.getThreeCamera().getWorldPosition(new pt),ve=Ce.distanceTo(Ue),Te=Math.abs(Ue.z-Ce.z),Q=Ie*Te/ve,Qe=le(Q);mk(Qe,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(Qe)}}),this.camera=new yT(this,d(this,me),d(this,de)),this.camera.setZoomLevel((j=n.zoomLevel)!=null?j:g8),this.camera.setBearing((W=n.bearing)!=null?W:m8),this.camera.setPitch((Y=n.pitch)!=null?Y:h8),this.camera.setMaxZoomLevel(OAe),this.camera.setMinZoomLevel(MAe),d(this,me).domVisiblitySystem=new J3(d(this,de),d(this,Ep)),d(this,me).domMutationSystem=new gT(d(this,de),d(this,Ep)),d(this,me).domMutationSystem.on("dimensions-update",()=>{d(this,me).collisionSystem.collidersDirty=!0,this.render()}),d(this,me).domDrawSystem=new hT(d(this,de)),d(this,me).collisionSystem=new t3(d(this,nc),d(this,de)),d(this,me).twoDDrawSystem=new eT(d(this,de),d(this,ki),n.transformImageRequest),d(this,me).twoDDrawSystem.on("img:loaded",this.render),d(this,me).interactionSystem=new UI(this.rendererDomElement,d(this,de),d(this,Ni),d(this,Nh),d(this,me).cameraSystem.isUserInteracting),d(this,me).interactionSystem.on("doubletap-with-onefinger",N=>{var Z;this.camera.animateTo({center:(Z=this.projectScreenXYToCoordinate(N.clientX,N.clientY))==null?void 0:Z.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:DE,easing:"ease-out"})}),d(this,me).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:DE,easing:"ease-out"})}),d(this,me).interactionSystem.on("hover",this.render),d(this,me).interactionSystem.on("click",N=>{var le,se,U,ye,ne,Ce,Ie,Ue,ve,Te,Q,Qe;if(((le=N.entity2D)==null?void 0:le.id)==="watermark"&&typeof d(this,me).watermarkSystem.options.onClick=="function"&&d(this,me).watermarkSystem.options.interactive){d(this,me).watermarkSystem.options.onClick();return}let Z=N.entity3D?[(se=N.entity3D)==null?void 0:se.id]:[];(ne=(ye=(U=N.entity3D)==null?void 0:U.parentObject3D)==null?void 0:ye.userData)!=null&&ne.entityId&&Z.push((Ue=(Ie=(Ce=N.entity3D)==null?void 0:Ce.parentObject3D)==null?void 0:Ie.userData)==null?void 0:Ue.entityId),this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(N.position),geometry:Z,paths:((ve=N.entity3D)==null?void 0:ve.components[0])instanceof Lh?[N.entity3D.id]:[],markers:((Te=N.entity2D)==null?void 0:Te.components[0])instanceof Ip?[N.entity2D.id]:[],models:((Q=N.entity3D)==null?void 0:Q.components[0])instanceof Eh?[N.entity3D.id]:[],labels:((Qe=N.entity2D)==null?void 0:Qe.components[0])instanceof _p?[N.entity2D.id]:[],containers:Array.isArray(N.groupContainers)?N.groupContainers.map(Ye=>Ye.userData.entityId):[],pointerEvent:N.pointerEvent})}),d(this,me).interactionSystem.on("hover",N=>{var Z,le,se,U,ye,ne;N.position&&((Z=N.entity2D)==null?void 0:Z.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(N.position),geometry:N.entity3D?[(le=N.entity3D)==null?void 0:le.id]:[],paths:((se=N.entity3D)==null?void 0:se.components[0])instanceof Lh?[N.entity3D.id]:[],markers:((U=N.entity2D)==null?void 0:U.components[0])instanceof Ip?[N.entity2D.id]:[],models:((ye=N.entity3D)==null?void 0:ye.components[0])instanceof Eh?[N.entity3D.id]:[],labels:((ne=N.entity2D)==null?void 0:ne.components[0])instanceof _p?[N.entity2D.id]:[],containers:Array.isArray(N.groupContainers)?N.groupContainers.map(Ce=>Ce.userData.entityId):[]})}),d(this,me).geometryInFocusSystem=new OT(d(this,de),d(this,Ni)),d(this,me).geometryInFocusSystem.on("geometry-in-focus",N=>{this.publish("geometry-in-focus",N)}),d(this,me).twoDVisiblitySystem=new rT(d(this,de)),d(this,me).drawSystem=new tT(d(this,de),this.convertTo3DMapPosition),d(this,me).drawSystem.on("texture-loaded",this.render),d(this,me).stackSystem=new iT(d(this,de)),d(this,me).twoDProjectionSystem=new Q3(d(this,de),d(this,W2)),d(this,me).exporterSystem=new f2(d(this,de)),d(this,me).meshOptimizationSystem=new K3(d(this,de),this.convertTo3DMapPosition),d(this,me).meshOptimizationSystem.on("model-loaded",this.render),d(this,me).meshOptimizationSystem.on("geometry-2d-added",this.render),d(this,me).meshDetachmentSystem=new FT(d(this,de)),d(this,me).meshModificationSystem=new NT(d(this,de)),d(this,me).customGeometrySystem=new ST(d(this,de),this.convertTo3DMapPosition),d(this,me).outlineInterpolationSystem=new CT(d(this,de)),d(this,me).renderSystem=new nT(d(this,Jo),d(this,de),this.mode,d(this,zi),d(this,Ni),this.viewCamera,d(this,me)),d(this,me).imageSystem=new MT(d(this,de),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),d(this,me).text3DSystem=new F3(d(this,de),this.convertTo3DMapPosition),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,Rv)),d(this,me).outdoorLayersSystem=new LT(this.map),d(this,me).occlusion2DSystem=new GT(d(this,de),this.convertTo3DMapPosition,d(this,Jo)),n.occlusionEnabled&&d(this,me).occlusion2DSystem.enable(),this.Debug=new $T(this),n.environment!==!1&&q(this,vy,ke(this,ws,d8).call(this)),d(this,UT).call(this)}get viewCamera(){return d(this,G2)}get canvasWidth(){return d(this,de).canvasWidth}get canvasHeight(){return d(this,de).canvasHeight}get resolutionScale(){var r,n;return(n=(r=this.map)==null?void 0:r._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:u0()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return d(this,kh)}addGroupContainer(r,n,i){if(!d(this,de).geometry3DMap.has(r)&&!d(this,de).geometry2DMap.has(r)){let s=new Ar(r);s.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,yo).call(this)}),s.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,yo).call(this)}),(n==null?void 0:n.visible)!==void 0&&(s.visible=n.visible),(n==null?void 0:n.altitude)!==void 0&&s.setAltitude(n.altitude),(n==null?void 0:n.interactive)!==void 0&&Ko(s,n.interactive,d(this,de)),(n==null?void 0:n.focusable)!==void 0&&sD(s,n.focusable),(n==null?void 0:n.preloadGeometry)!==void 0&&(s.userData.preloadGeometry=n.preloadGeometry),d(this,de).geometry3DMap.set(r,s);let l=this.getParentContainer(i);l instanceof Ar&&l.addEntity(s),d(this,jn).call(this),this.render()}else ce.error("Group container with ID '".concat(r,"' already exists. The group container cannot be added."));return{id:r,type:"group-container"}}addStackContainer(r,n,i){if(d(this,de).geometry3DMap.has(r))ce.error("Stack container with ID '".concat(r,"' already exists. The stack container cannot be added."));else{let s=new Ar(r);s.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,yo).call(this)}),s.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,yo).call(this)}),s.components[0]=new mT,(n==null?void 0:n.visible)!==void 0&&(s.visible=n.visible),d(this,de).geometry3DMap.set(r,s);let l=this.getParentContainer(i);l instanceof Ar&&l.addEntity(s)}return{id:r,type:"stack-container"}}addCustomGeometry(r,n,i,s,l){if(d(this,de).geometry3DMap.has(r))ce.error("Custom geometry with ID '".concat(r,"' already exists. The custom geometry cannot be added."));else{let c=new Lv(n,i),p=new mn(c,new Ac(s));(s==null?void 0:s.interactive)!==void 0&&Ko(p,s.interactive,d(this,de)),p.id=r,c.mesh.userData={entityId:r,type:"custom-geometry"},d(this,de).geometry3DMap.set(p.id,p);let h=this.getParentContainer(l);h instanceof Ar&&h.addEntity(p),d(this,jn).call(this),this.render()}return{id:r,type:"custom-geometry"}}addGeometryGroup(r,n,i,s){var l,p;if(!d(this,de).geometry3DMap.has(r)&&!d(this,de).geometry2DMap.has(r)){let h=new Ns(r,new LE(i));h.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,yo).call(this)}),h.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,yo).call(this)}),h.userData.dirty=!0,d(this,de).geometry3DMap.set(r,h);for(let b of n.features){if(b.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(b.geometry.type))continue;let _=(b==null?void 0:b.id)||((l=b==null?void 0:b.properties)==null?void 0:l.id)||xn(),c=i||{color:KN},{visible:C,altitude:P}=c,E=cs(c,["visible","altitude"]),w=d(this,me).meshOptimizationSystem.createEntityFromFeature(_,b,re(R({},E),{outline:!0}));d(this,de).geometry3DMap.set(_,w),h.userData.entities3D.add(_)}h.setVisible((p=i==null?void 0:i.visible)!=null?p:!0),(i==null?void 0:i.altitude)!=null&&h.setAltitude(i.altitude);let y=this.getParentContainer(s);y instanceof Ar&&y.addEntity(h),d(this,jn).call(this),this.render()}else ce.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),s=d(this,me).occlusion2DSystem.reserveOccluderId();return i==null||i.addOccluderFeature(r,s),s}addImage(r,n,i,s){try{Yie(r,n,i)}catch(l){ce.error(l);return}if(!d(this,de).geometry3DMap.has(r)&&!d(this,de).geometry2DMap.has(r)){let l=new ET(n),c=new mn(l,new Ac(i));c.id=r||xn(),l.mesh.userData={entityId:c.id,type:"path"},d(this,de).geometry3DMap.set(c.id,c);let p=this.getParentContainer(s);p instanceof Ar&&p.addEntity(c),d(this,jn).call(this),this.render()}else ce.error("Image with ID '".concat(r,"' already exists. The image cannot be added."));return{id:r,type:"image"}}addModelGroup(r,n,i,{parent:s,onComplete:l}={}){var c,p;try{Tie(r,n,i)}catch(h){ce.error(h);return}if(!d(this,de).geometry3DMap.has(r)&&!d(this,de).geometry2DMap.has(r)){let h=new Ns(r,new LE(re(R({},i),{outline:!1})));h.addEventListener("childadded",()=>{d(this,jn).call(this),d(this,yo).call(this)}),h.addEventListener("childremoved",()=>{d(this,jn).call(this),d(this,yo).call(this)}),d(this,de).geometry3DMap.set(r,h),h.userData.dirty=!0,h.userData.modelURL=i.url;for(let b of n.features){let _=b.id||b.properties.id||xn(),C=d(this,me).meshOptimizationSystem.createModelFromFeature(_,b,i);(b.properties.interactive!==void 0||i.interactive!=null)&&Ko(C,(c=b.properties.interactive)!=null?c:i.interactive,d(this,de)),d(this,de).geometry3DMap.set(_,C),h.userData.entities3D.add(_)}let y=this.getParentContainer(s);y instanceof Ar&&y.addEntity(h),d(this,jn).call(this),(p=this.render())==null||p.then(l)}else ce.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,s){var c;let l=i==null?void 0:i.id;try{Wre(r,n,i||{})}catch(p){ce.error(p);return}if(l===void 0||!d(this,de).geometry2DMap.has(l)&&!d(this,de).geometry3DMap.has(l)){let p=ke(this,ws,f8).call(this,r,new Ip(n,i),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);p.id=l||String(p.id),l=p.id,(i==null?void 0:i.interactive)!=null&&i.interactive!=="pointer-events-auto"&&Ko(p,i==null?void 0:i.interactive,d(this,de));let h=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?d(this,de).geometry3DMap.get(i.attachTo):void 0;h instanceof mn&&h.attach(p),(c=this.getParentContainer(s))==null||c.addEntity(p),this.render()}else ce.error("Marker2D with ID '".concat(l,"' already exists. The marker cannot be added."));return{id:l,type:"marker"}}addText3D(r,n,i,s){if(!d(this,de).geometry3DMap.has(r)&&!d(this,de).geometry2DMap.has(r)){let l=new Ch(re(R({},n),{properties:re(R({},n.properties),{id:r,content:n.properties.text})})),c=new mn(l,new kb(i==null?void 0:i.appearance));c.id=r,l.mesh.userData.entityId=r.toString(),l.mesh.userData.type="text3d",d(this,de).geometry3DMap.set(r,c);let p=this.getParentContainer(s);p instanceof Ar&&p.addEntity(c),d(this,jn).call(this),this.render()}else ce.error("Text3D with ID '".concat(r,"' already exists. The text3d cannot be added."));return{id:r,type:"text3d"}}labelText3D(r,n,i={}){var h,y;try{if(!n||!r)throw new Error("content and meshGeometryId are required");Gne.parse(i)}catch(b){ce.error(b);return}let s=d(this,de).geometry3DMap.get(r);if((s==null?void 0:s.type)!=="geometry"){ce.error(".labelText3D failed: target incorrect");return}let l=s==null?void 0:s.components[0];if(!l.feature.properties.textArea)return;if(l.textEntityId){let b=d(this,de).geometry3DMap.get(l.textEntityId);if((b==null?void 0:b.type)!=="text3d"){ce.error(".labelText3D failed: existing text3d not found");return}return{id:b.id,type:b.type}}let c=new Ch({type:"Feature",geometry:{coordinates:(h=l.feature.properties.textArea)==null?void 0:h.position,type:"Point"},properties:{textArea:l.feature.properties.textArea,content:n,id:xn()}});c.polygonEntityId=r;let p=new mn(c,new kb(i==null?void 0:i.appearance));return l.textEntityId=p.id.toString(),c.mesh.userData.entityId=p.id.toString(),c.mesh.userData.type="text3d",d(this,de).geometry3DMap.set(p.id.toString(),p),i.parentId&&((y=this.getParentContainer(i.parentId))==null||y.addEntity(p)),this.render(),{id:p.id,type:"text3d"}}addLabel2D(r,n,i,s){var c;let l=i==null?void 0:i.id;try{Nne(r,n,i||{})}catch(p){ce.error(p);return}if(l===void 0||!d(this,de).geometry2DMap.has(l)&&!d(this,de).geometry3DMap.has(l)){let p=ke(this,ws,f8).call(this,r,new _p(n,i||{},d(this,de)),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);p.id=l||String(p.id),l=p.id,(i==null?void 0:i.interactive)!=null&&Ko(p,i==null?void 0:i.interactive,d(this,de));let h=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?d(this,de).geometry3DMap.get(i.attachTo):void 0;h instanceof mn&&h.attach(p),(c=this.getParentContainer(s))==null||c.addEntity(p),d(this,yo).call(this),this.render()}else ce.error("Label2D with ID '".concat(l,"' already exists. The label cannot be added."));return{id:l,type:"label"}}addPath(r,n={},i){var p;try{Lie(r,n||{})}catch(h){ce.error(h);return}let s=new Lh(r,aD(n)),l=new mn(s,new Ac({color:(p=n==null?void 0:n.color)!=null?p:"#ff834c"}));l.id=(n==null?void 0:n.id)||xn(),s.mesh.userData={entityId:l.id,type:"path"},d(this,de).geometry3DMap.set(l.id,l),(n==null?void 0:n.interactive)!=null&&Ko(l,n==null?void 0:n.interactive,d(this,de));let c=this.getParentContainer(i);return c instanceof Ar&&c.addEntity(l),d(this,jn).call(this),this.render(),{id:l.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,de).geometry2DMap.get(r),n==null&&(n=d(this,de).geometry3DMap.get(r))):typeof r.id=="string"||typeof r.id=="number"?(n=d(this,de).geometry2DMap.get(r.id),n==null&&(n=d(this,de).geometry3DMap.get(r.id))):n=r,n!=null){if(n.type==="custom-geometry")d(this,de).geometry3DMap.delete(n.id),n.object3d&&Pi(n.object3d);else if(n.type==="group-container"){d(this,de).geometry3DMap.delete(n.userData.entityId);for(let l of n.childrenIds.values())this.remove(l),n.userData.entities2D.delete(l);let s=n.components[2];s&&s.focusMesh&&Pi(s.focusMesh),Pi(n)}else if(n.type==="geometry-group"){d(this,de).geometry3DMap.delete(n.userData.entityId);for(let s of n.userData.entities3D.values())this.remove(s),n.userData.entities3D.delete(s);Pi(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let s=n.components[0];if(n.entities2D.size>0){for(let l of n.entities2D.values())this.remove(l);n.removeAllEntities()}if(n.object3d&&(((i=n.parentObject3D)==null?void 0:i.type)==="geometry-group"&&n.parentObject3D.userData.entities3D.delete(n.id),Pi(n.object3d)),n.type==="geometry"){let l=n.components[3];l&&(l.visible=!1,l.dirty=!0)}"focusMesh"in s&&s.focusMesh!=null&&Pi(s.focusMesh),"textMesh"in s&&s.textMesh!=null&&this.remove(s.textMesh.userData.entityId),d(this,de).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let s=n.attachedTo;if(s){let l=d(this,de).geometry3DMap.get(s);l instanceof mn&&l.detach(n)}n.object3d&&Pi(n.object3d),n.type==="label"&&delete d(this,me).twoDDrawSystem.textCache[n.id],d(this,de).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&Pi(n.object3d),d(this,de).geometry3DMap.delete(n.id);else if(n.type==="text3d"){Pi(n.object3d);let{batchedText:s,textMesh:l,polygonEntityId:c}=n.components[0];if(l&&(s&&s.removeText(l),Pi(l)),c){d(this,me).text3DSystem.remove(c);let p=d(this,de).geometry3DMap.get(c);(p==null?void 0:p.type)==="geometry"&&(p.components[0].textMesh=void 0,p.components[0].textEntityId=void 0)}d(this,de).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,zi)}getThreeCamera(){return d(this,Ni)}async setEnvironment(r){if(d(this,zi))if(r==="basic"){d(this,vy)||q(this,vy,ke(this,ws,d8).call(this));let n=await d(this,vy);d(this,zi).environment=n}else d(this,zi).environment=null}getEnvironment(){var r;return(r=d(this,zi))!=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 co;if(r==null)n.setFromObject(d(this,de).entityScene);else{let i=Nb(d(this,de),r);if((i==null?void 0:i.type)==="geometry"&&(i==null?void 0:i.object3d)!=null){let s=i.components[0],l=s instanceof Mi?s.geometry:void 0;s.mesh instanceof cS&&l?(l.computeBoundingBox(),l.boundingBox&&n.union(l.boundingBox)):n.setFromObject(i.object3d)}else((i==null?void 0:i.type)==="geometry-group"||(i==null?void 0:i.type)==="group-container")&&(i==null?void 0:i.userData.entityId)!=null&&n.setFromObject(i)}if(cm(n))return rk(n).map(this.convert3DMapPositionToCoordinate)}getState(r){var i,s,l,c,p,h,y,b,_,C;if(r==null)return{type:"map-view",hoverColor:d(this,de).hoverColor,text3dHoverColor:d(this,de).text3dHoverColor};let n=Nb(d(this,de),r);if((n==null?void 0:n.type)==="custom-geometry"){let P=n.components[0],E=n.components[1];return{id:n.id,type:"custom-geometry",visible:E.visible,altitude:E.altitude,parent:(i=n.parentObject3D)==null?void 0:i.userData.entityId,position:this.convert3DMapPositionToCoordinate(P.position)}}else if((n==null?void 0:n.type)==="geometry-group"){let P=[];for(let w of n.userData.entities3D.values()){let O=this.getState(w);((O==null?void 0:O.type)==="geometry"||(O==null?void 0:O.type)==="model")&&P.push(O)}let E=n.components[0];return{id:n.userData.entityId,type:"geometry-group",visible:n.visible,opacity:E.opacity,color:E.color,initialColor:E.initialColor,height:E.height,altitude:n.altitude,topColor:E.topColor,outline:E.outline,shading:E.shading,texture:E.texture,topTexture:E.topTexture,interactive:Array.from(n.userData.entities3D.values()).map(w=>d(this,de).geometry3DMap.get(w)).every(w=>w&&w.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(w=>this.getState(w)).filter(Boolean)}}else{if((n==null?void 0:n.type)==="group-container")return{id:n.userData.entityId,type:"group-container",visible:n.visible,altitude:n.altitude,opacity:n.opacity,interactive:!!n.components[1],children:Array.from(n.childrenIds.values()).map(P=>this.getState(P)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let P=n.components[0],E=n.object3d.parent,w=E==null?void 0:E.userData.entityId;return{id:n.id,type:"label",text:P.text||"",parent:{id:w,type:E==null?void 0:E.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:P.enabled,visible:P.visible,initialRank:GI(P.initialRank),options:{rank:GI(P.rank),appearance:P.appearance,interactive:n.components[1]!=null,verticalOffset:n.verticalOffset,attachTo:n.attachedTo}}}else if((n==null?void 0:n.type)==="marker"){let P=n.components[0],E=n.object3d.parent,w=E==null?void 0:E.userData.entityId;return{id:n.id,type:"marker",enabled:P.enabled,visible:P.visible,anchor:P.options.anchor,dynamicResize:P.options.dynamicResize,parent:{id:w,type:E==null?void 0:E.type},position:this.convert3DMapPositionToCoordinate(n.position),element:P.containerEl,initialRank:GI(P.initialRank),contentHTML:P.contentHtml,options:{rank:GI(P.rank),interactive:n.components[1]!=null||!1,verticalOffset:n.verticalOffset,attachTo:n.attachedTo,lowPriorityPin:P.options.lowPriorityPin}}}else if((n==null?void 0:n.type)==="geometry"){let{color:P,hoverColor:E,initialColor:w,initialTopColor:O,topColor:D,altitude:A}=n.components[1],k=n.components[0],j=n.components[1],W=n.components[2],Y=n.components[3],N=n.parentObject3D;return{id:n.id,type:"geometry",opacity:j.opacity,initialColor:w,color:P,focusable:k.focusable,initialTopColor:O,topColor:D,hoverColor:E,hovered:!!(W!=null&&W.hover),height:j.height,visible:j.visible,outline:Y==null?void 0:Y.visible,showImage:j.showImage,texture:j.texture,topTexture:j.topTexture,flipImageToFaceCamera:j.flipImageToFaceCamera,parent:{id:N==null?void 0:N.userData.entityId,type:N==null?void 0:N.type},altitude:A,position:this.convert3DMapPositionToCoordinate(k.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let P=n.components[0],E=n.components[1],w=n.components[2];return{id:n.id,type:"model",position:P.mesh?this.convert3DMapPositionToCoordinate((s=P.mesh)==null?void 0:s.getWorldPosition(new pt)):this.convert3DMapPositionToCoordinate(P.position),interactive:w!=null,material:E.material,parent:(l=n.parentObject3D)!=null&&l.parent?{id:n.parentObject3D.parent.userData.entityId,type:n.parentObject3D.parent.type}:void 0,visible:E.visible,verticalOffset:E.verticalOffset,color:E.color,opacity:E.opacity,rotation:(c=E.rotation)!=null?c:d0,scale:(p=E.scale)!=null?p:f0}}else if((n==null?void 0:n.type)==="path"){let P=n.components[0],E=n.components[2],w=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(P.position),visible:w.visible,interactive:E!=null,completeFraction:P.completeFraction,color:w.color,accentColor:P.accentColor,nearRadius:P.nearRadius,farRadius:P.farRadius,animateArrowsOnPath:P.animateArrowsOnPath,displayArrowsOnPath:P.displayArrowsOnPath,nearZoomLevel:P.nearZoomLevel,farZoomLevel:P.farZoomLevel}}else if((n==null?void 0:n.type)==="image"){let P=n.components[0];return{id:n.id,type:"image",position:this.convert3DMapPositionToCoordinate(P.position),visible:n.components[1].visible,verticalOffset:(h=P.feature.properties.verticalOffset)!=null?h:0,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof Ch&&"textArea"in n.components[0].feature.properties){aie(n);let P=n.components[0],E=n.components[1],{textMesh:w}=P,O=(y=P.mesh)==null?void 0:y.parent;O instanceof Ar&&((b=O.children.find(k=>k.type==="batchedtext"))==null||b.getWorldPosition(d(this,Z2))),d(this,Bv).set(0,0,0);let D=w?w.getWorldPosition(d(this,Bv)):d(this,Bv);return Object.assign({},p0,E.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(D.add(d(this,Z2))),visible:(_=P.visible)!=null?_:!1,content:(C=P.feature.properties.content)!=null?C:""})}else return}}setState(r,n){var s,l;if(typeof r=="object"&&n==null){"hoverColor"in r&&(d(this,de).hoverColor=(s=r.hoverColor)!=null?s:d(this,de).hoverColor),"text3dHoverColor"in r&&(d(this,de).text3dHoverColor=(l=r.text3dHoverColor)!=null?l:d(this,de).text3dHoverColor);return}let i=Nb(d(this,de),r);if(i!=null){if(i.type==="custom-geometry"){let c=d(this,de).geometry3DMap.get(i.id);if(c instanceof mn&&c.components[0]instanceof Lv){let p=n;Sp(i,d(this,de),p.visible),Sv(i,p.altitude),rD(i,p.position,this.convertTo3DMapPosition),nD(i,this.getParentContainer(p.parent,!1)),Ko(i,p.interactive,d(this,de))&&d(this,jn).call(this)}}else if(i.type==="path"){let c=n;Ko(i,c.interactive,d(this,de))&&d(this,jn).call(this),Sv(i,c.altitude),sie(i,d(this,de),c)}else if(i.type==="model"){let c=n;Ko(i,c.interactive,d(this,de))&&d(this,jn).call(this),Sp(i,d(this,de),c.visible),uie(i,c)}else if(i.type==="group-container"){let c=n;Sp(i,d(this,de),c.visible)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0,d(this,me).pathSystem.altitudeDirty=!0),Sv(i,c.altitude)&&(d(this,me).pathSystem.altitudeDirty=!0),Ko(i,c.interactive,d(this,de))&&d(this,jn).call(this),oD(i,d(this,de),c.opacity)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),c.preloadGeometry&&i.userData.preloadGeometry!==!0&&(i.userData.preloadGeometry=!0,d(this,me).outlineInterpolationSystem.geometries3DDirty=!0)}else if(i.type==="geometry-group"){let c=n;Sp(i,d(this,de),c.visible)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Hne(i,d(this,de),c),R3(i,d(this,de),c.outline),c.height!=null&&eD(i,d(this,de),c.height),Sv(i,c.altitude),rie(i,c),Wne(i,c.shading),oD(i,d(this,de),c.opacity)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Ko(i,c.interactive,d(this,de))&&(d(this,jn).call(this),d(this,yo).call(this))}else if(i.type==="geometry"){if(i.components[0]instanceof Mi){let c=n;Sp(i,d(this,de),c.visible)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),R3(i,d(this,de),c.outline),Xne(i,c),sD(i,c.focusable)&&(d(this,me).geometryInFocusSystem.focusablesDirty=!0),oie(i,c.renderOrder)&&(d(this,me).meshDetachmentSystem.dirty=!0),iie(i,c.opacity)&&(d(this,me).meshDetachmentSystem.dirty=!0,d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),iD(i,c.flipImageToFaceCamera),Sv(i,c.altitude),c.height!=null&&eD(i,d(this,de),c.height),nie(i,c)&&(d(this,me).meshDetachmentSystem.dirty=!0),tD(i,c),Qne(i,c.hoverColor),Ko(i,c.interactive,d(this,de)),eie(i,c.hovered)}d(this,jn).call(this)}else if(i.type==="label"||i.type==="marker"){let c=n;Jne(i,n,d(this,de)),Zne(i,n,d(this,de))&&(d(this,yo).call(this),d(this,me).domMutationSystem.dirty=!0),rD(i,c.position,this.convertTo3DMapPosition),nD(i,this.getParentContainer(c.parent,!1))&&(d(this,yo).call(this),d(this,me).panBoundsSystem.dirty=!0),Yne(i,c.enabled),Sp(i,d(this,de),c.visible)}else if(i.type==="image"){let c=n;Sp(i,d(this,de),c.visible),iD(i,c.flipImageToFaceCamera)}else if(i.type==="text3d"){let c=n;lie(i,d(this,de),c)}this.render()}}convertTo3DMapPosition(r,n,i=0,s){var p,h,y,b,_;if(Array.isArray(r))return this.convertTo3DMapPosition(r[1],r[0],(p=r[2])!=null?p:i,typeof n=="function"?n:void 0);if(typeof n!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:l,y:c}=_S((y=(h=d(this,de).center)==null?void 0:h[1])!=null?y:0,(_=(b=d(this,de).center)==null?void 0:b[0])!=null?_:0,r,n);return s?(s.set(l,c,i),s):new pt(l,c,i)}get backgroundColor(){return typeof d(this,Jo).backgroundColor=="string"?d(this,Jo).backgroundColor:"#".concat(d(this,Jo).backgroundColor.getHexString())}get backgroundAlpha(){return d(this,Jo).backgroundAlpha}getThreeRenderer(){return d(this,Jo)}getCenter(r){let n=Array.isArray(r)?r:this.getBoundingArea(r);return n?hk(n):void 0}isInView(r){let n=Nb(d(this,de),r);if(d(this,Y2).identity().multiply(d(this,Ni).projectionMatrix).multiply(d(this,Ni).matrixWorldInverse),d(this,xy).setFromProjectionMatrix(d(this,Y2)),n instanceof fm)return d(this,xy).containsPoint(n.position);if(n instanceof mn){let i=n==null?void 0:n.components[0];if(i instanceof Lv||i instanceof Eh)return d(this,xy).containsPoint(this.convertTo3DMapPosition(i.feature.geometry.coordinates));if(i instanceof Mi){let s=new co(this.convertTo3DMapPosition(i.featureBbox[1],i.featureBbox[0],0),this.convertTo3DMapPosition(i.featureBbox[3],i.featureBbox[2],0));return d(this,xy).intersectsBox(s)}}return!1}getSystems(){return d(this,me)}getInternalState(){return d(this,de)}getInternalTweenGroup(){return d(this,de).internalTweenGroup}getExternalTweenGroup(){return d(this,de).externalTweenGroup}};zi=new WeakMap,Ni=new WeakMap,vy=new WeakMap,G2=new WeakMap,Fv=new WeakMap,Nh=new WeakMap,by=new WeakMap,Nv=new WeakMap,ws=new WeakSet,p8=o(function(r){var n;d(this,kh)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(r)),d(this,de).pixelRatio=this.resolutionScale},"#setResolutionScale"),de=new WeakMap,Bn=new WeakMap,nc=new WeakMap,ki=new WeakMap,Ep=new WeakMap,Jo=new WeakMap,me=new WeakMap,U2=new WeakMap,yo=new WeakMap,jn=new WeakMap,soe=o(function(){q(this,Bn,document.createElement("div")),d(this,Bn).classList.add("mappedin__smart-collision-engine__container"),q(this,nc,document.createElement("canvas")),d(this,nc).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(d(this,Bn)),q(this,ki,document.createElement("canvas")),d(this,ki).classList.add("mappedin__smart-collision-engine__container"),d(this,ki).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,ki).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,ki).style.width=d(this,Bn).clientWidth+"px",d(this,ki).style.height=d(this,Bn).clientHeight+"px",d(this,Bn).appendChild(d(this,nc)),d(this,Bn).appendChild(d(this,ki)),d(this,nc).width=d(this,Bn).clientWidth,d(this,nc).height=d(this,Bn).clientHeight,d(this,ki).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,ki).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,ki).style.width=d(this,Bn).clientWidth+"px",d(this,ki).style.height=d(this,Bn).clientHeight+"px"},"#renderEntity2DContainer"),aoe=o(function(){q(this,Ep,document.createElement("div")),d(this,Ep).classList.add("mappedin-2d-entities"),Object.assign(d(this,Ep).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(d(this,Ep))},"#renderEntityDOMContainer"),loe=o(function(){d(this,ki).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,ki).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,ki).style.width=d(this,Bn).clientWidth+"px",d(this,ki).style.height=d(this,Bn).clientHeight+"px",d(this,nc).width=d(this,Bn).clientWidth,d(this,nc).height=d(this,Bn).clientHeight,d(this,ki).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,ki).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,ki).style.width=d(this,Bn).clientWidth+"px",d(this,ki).style.height=d(this,Bn).clientHeight+"px",d(this,me).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),kh=new WeakMap,V2=new WeakMap,z2=new WeakMap,q2=new WeakMap,kv=new WeakMap,UT=new WeakMap,H2=new WeakMap,W2=new WeakMap,X2=new WeakMap,Rv=new WeakMap,f8=o(function(r,n,i,s){let l=new fm(n,this.convertTo3DMapPosition(r[1],r[0],r[2]||0),s);return l.occluderId=i!=null?i:d(this,me).occlusion2DSystem.backgroundId,d(this,de).geometry2DMap.set(l.id,l),l},"#createEntity2D"),xy=new WeakMap,Y2=new WeakMap,Sa=new WeakMap,Ca=new WeakMap,d8=o(async function(){return Oh.load(Hte).then(r=>{var n;return d(this,zi)&&((n=d(this,zi).environment)==null||n.dispose(),r.mapping=IN,d(this,zi).environment=r,this.render()),r})},"#loadEnvMap"),Bv=new WeakMap,Z2=new WeakMap,o(y8,"Core");var c8=y8,K2=c8;g();function AAe(e,t){DAe(e,t)(e.getScene(),t),FAe(e,t),t.addFolder("Export").add({export:o(async()=>{let l=await e.getCurrentSceneGLTF({binary:!0}),c=new Blob([l],{type:"application/octet-stream"});var p=document.createElement("a");document.body.appendChild(p),p.style.display="none";let h=window.URL.createObjectURL(c);p.href=h,p.download="scene.glb",p.click(),window.URL.revokeObjectURL(h)},"export")},"export");let i=t.addFolder("Camera"),s={get bearing(){return e.camera.bearing},set bearing(l){e.camera.setBearing(l)},get pitch(){return e.camera.pitch},set pitch(l){e.camera.setPitch(l)},get zoomLevel(){return e.camera.zoomLevel},set zoomLevel(l){e.camera.setZoomLevel(l)}};i.add(s,"bearing",-359,359,1),i.add(s,"pitch",e.camera.minPitch,e.camera.maxPitch,1),i.add(s,"zoomLevel",e.camera.minZoomLevel,e.camera.maxZoomLevel,.1)}o(AAe,"mountSceneGraphVisualizer");function DAe(e,t){let r=t;return o(function n(i,s){let l=s.addFolder("".concat([i.type]," ").concat(i.id.slice(0,16)));if(s.close(),i.type==="geometry"||i.type==="model"||i.type==="path"||i.type==="image"){let c={get height(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"?p.height:0},set height(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(i,{height:p})},set flipImageToFaceCamera(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="image"&&e.setState(i,{flipImageToFaceCamera:p})},get flipImageToFaceCamera(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="image"?p.flipImageToFaceCamera:!1},set visible(p){let h=e.getState(i.id);((h==null?void 0:h.type)==="geometry"||(h==null?void 0:h.type)==="path"||(h==null?void 0:h.type)==="image")&&e.setState(i,{visible:p})},get visible(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image"?p.visible:!1},set outline(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(i,{outline:p})},get outline(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"?p.outline:!1},get opacity(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"?p.opacity:1},set opacity(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(h,{opacity:p})},get color(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"&&p.color?dt(p.color).toHexString():"#ffffff"},set color(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(h,{color:p})},set interactive(p){let h=e.getState(i.id);((h==null?void 0:h.type)==="geometry"||(h==null?void 0:h.type)==="model"||(h==null?void 0:h.type)==="path")&&(e.setState(i,{interactive:p}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get interactive(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path"?p.interactive:!1},get completeFraction(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="path"?p.completeFraction:1},set completeFraction(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="path"&&e.setState(h,{completeFraction:p})},focus:o(()=>{},"focus")};l.add(c,"focus").onChange(()=>{let p=e.getState(i.id);(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image"?e.camera.focusOn([p.position]):(p==null?void 0:p.type)==="geometry"&&e.camera.focusOn(e.getBoundingArea(p))}),l.add(c,"visible"),i.type==="image"?l.add(c,"flipImageToFaceCamera"):(l.add(c,"interactive"),i.type==="path"&&l.add(c,"completeFraction",0,1,.1),i.type!=="model"&&(l.addColor(c,"color"),l.add(c,"outline"))),i.type==="geometry"&&(l.add(c,"height"),l.add(c,"opacity",0,1,.1))}else if(i.type==="marker"){let c={get interactive(){var h;let p=e.getState(i.id);return(p==null?void 0:p.type)==="marker"?(h=p.options)==null?void 0:h.interactive:!1},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="marker"&&(e.setState(h,{options:{interactive:p}}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},focus:o(()=>{},"focus")};l.add(c,"focus").onChange(()=>{let p=e.getState(i.id);(p==null?void 0:p.type)==="marker"&&e.camera.focusOn([p.position])}),l.add(c,"interactive")}else if(i.type==="label"){let c={get interactive(){var h;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(h=p.options)==null?void 0:h.interactive:!1},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&(e.setState(h,{options:{interactive:p}}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get text(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?p.text:""},set text(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:p})},get"Text Color"(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(y=(h=p.options.appearance)==null?void 0:h.text)==null?void 0:y.foregroundColor:"#000000"},set"Text Color"(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(i.id,{text:c.text,options:{appearance:{text:{foregroundColor:p}}}})},get"Text Size"(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(y=(h=p.options.appearance)==null?void 0:h.text)==null?void 0:y.size:10},set"Text Size"(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{text:{size:p}}}})},get"Icon Size"(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.iconSize:10},set"Icon Size"(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{iconSize:p}}}})},get"Active Foreground Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.foregroundColor)==null?void 0:b.active:"#000000"},set"Active Foreground Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{foregroundColor:re(R({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.foregroundColor),{active:p})}}}})},get"Inactive Foreground Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.foregroundColor)==null?void 0:b.inactive:"#000000"},set"Inactive Foreground Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{foregroundColor:re(R({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.foregroundColor),{inactive:p})}}}})},get"Active Background Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.backgroundColor)==null?void 0:b.active:"#000000"},set"Active Background Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{backgroundColor:re(R({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.backgroundColor),{active:p})}}}})},get"Inactive Background Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.backgroundColor)==null?void 0:b.inactive:"#000000"},set"Inactive Background Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{backgroundColor:re(R({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.backgroundColor),{inactive:p})}}}})},focus:o(()=>{},"focus")};l.add(c,"focus").onChange(()=>{let p=e.getState(i.id);(p==null?void 0:p.type)==="label"&&e.camera.focusOn([p.position])}),l.add(c,"interactive"),l.add(c,"text"),l.add(c,"Text Size",10,50),l.add(c,"Icon Size",10,50),l.addColor(c,"Text Color"),l.addColor(c,"Active Background Color"),l.addColor(c,"Inactive Background Color"),l.addColor(c,"Active Foreground Color"),l.addColor(c,"Inactive Foreground Color")}else if(i.type==="geometry-group"){let c={get opacity(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.opacity:1},set opacity(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{opacity:p})},set visible(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{visible:p})},get visible(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.visible:!1},set outline(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{outline:p})},get outline(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.outline:!1},set altitude(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{altitude:p})},get altitude(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.altitude:0},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&(e.setState(i,{interactive:p}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get interactive(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.interactive:!1},get shadingStart(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"&&(y=(h=p.shading)==null?void 0:h.start)!=null?y:0},set shadingStart(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(h,{shading:{start:p}})},get shadingEnd(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"&&(y=(h=p.shading)==null?void 0:h.end)!=null?y:0},set shadingEnd(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(h,{shading:{end:p}})},get shadingIntensity(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"&&(y=(h=p.shading)==null?void 0:h.intensity)!=null?y:0},set shadingIntensity(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(h,{shading:{intensity:p}})}};l.add(c,"visible"),l.add(c,"opacity",0,1,.1),l.add(c,"interactive"),l.add(c,"outline"),l.add(c,"altitude",0,100,1),l.add(c,"shadingStart",0,1,.1),l.add(c,"shadingEnd",0,1,.1),l.add(c,"shadingIntensity",0,1,.1)}else if(i.type==="group-container"){let c={set visible(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="group-container"&&e.setState(i,{visible:p})},get visible(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="group-container"?p.visible:!1},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="group-container"&&(e.setState(h,{interactive:p}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get interactive(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="group-container"?p.interactive:!1}};l.add(c,"visible"),l.add(c,"interactive")}if(l.close(),i.children)for(let c of i.children.values())n(c,l)},"parseChild")}o(DAe,"createParseChild");function FAe(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(FAe,"createWatermarkChild");g();g();g();g();g();g();var v8=class v8{constructor({origin:t,destination:r,distance:n=0,angle:i=0,pathWeight:s=0,multiplicativeDistanceWeightScaling:l=!0}){x(this,"origin");x(this,"destination");x(this,"distance");x(this,"angle");x(this,"weight");if(this.origin=t,this.destination=r,this.distance=n,this.angle=i,this.weight=s||0,l?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(v8,"Edge");var Iy=v8;g();g();g();g();function td([e,t],[r,n]){let i=t-n,s=e-r;return(Math.atan2(s,i)+Math.PI*3)%(Math.PI*2)}o(td,"getAngle");g();var NAe=63710088e-1;function ic(e,t){let[r,n]=e.map(y=>y*Math.PI/180),[i,s]=t.map(y=>y*Math.PI/180),l=s-n,c=i-r,p=Math.sin(l/2)*Math.sin(l/2)+Math.cos(n)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2),h=2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p));return NAe*h}o(ic,"getDistance");g();g();function VT(e,t,r,n){let[i,s]=e,[l,c]=t,[p,h]=r,[y,b]=n;if(s===c&&i===l||h===b&&p===y)return null;let _=(y-p)*(c-s)-(b-h)*(l-i);if(_===0)return null;let C=((b-h)*(i-p)-(y-p)*(s-h))/_,P=((c-s)*(i-p)-(l-i)*(s-h))/_;if(C<0||C>1||P<0||P>1)return null;let E=s+C*(c-s);return[i+C*(l-i),E]}o(VT,"getLineIntersection");g();function b8(e,t,r,n){let i=al(e,r/1e3,n),s=al(t,r/1e3,n);return[i.geometry.coordinates,s.geometry.coordinates]}o(b8,"getOffsetLine");g();function x8(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(x8,"radToDegNormalized");var uoe=111e3;function coe(e,t,r=[],n=0){let i=!0,s=e.geometry.coordinates,l=t.geometry.coordinates,c=x8(td(s,l)-Math.PI/2),p=x8(td(s,l)+Math.PI/2),h=n/uoe,y=n/(uoe*Math.cos(s[1]*Math.PI/180)),b=Math.min(s[1],l[1])-h,_=Math.max(s[1],l[1])+h,C=Math.min(s[0],l[0])-y,P=Math.max(s[0],l[0])+y;for(let E of r)if(!(Math.max(E[0][1],E[1][1])<b||Math.min(E[0][1],E[1][1])>_||Math.max(E[0][0],E[1][0])<C||Math.min(E[0][0],E[1][0])>P)){if(n>0){let w=b8(s,l,n,c),O=b8(s,l,n,p);if(VT(w[0],w[1],E[0],E[1])||VT(O[0],O[1],E[0],E[1])){i=!1;return}}else if(VT(s,l,E[0],E[1])){i=!1;return}}return i}o(coe,"hasLineOfSight");var _y,Ps,I8,poe,foe,doe,hoe,moe,goe,qT,_8=class _8{constructor({nodes:t,groupBy:r,multiplicativeDistanceWeightScaling:n}){G(this,Ps);x(this,"edges",{});x(this,"nodesById");x(this,"nodesByGroup",new Map);G(this,_y);G(this,qT,o((t,r)=>{let n=0;for(let i of r)(!i[d(this,_y)]||i[d(this,_y)]===t.properties[d(this,_y)])&&ci(t.geometry.coordinates,i.geometry.geometry)&&(n+=Math.max(0,i.cost));return n},"#getZonalCost"));q(this,_y,r);let{features:i}=t;this.nodesById=ke(this,Ps,poe).call(this,i),ke(this,Ps,foe).call(this),ke(this,Ps,doe).call(this,i,r,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,r){return r.reduce((n,i)=>{let s=ic(t.geometry.coordinates,i.geometry.coordinates);return Math.min(n,s)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:r,excludedNodeIds:n,disabledConnectionNodeIds:i,zones:s,overrideEdgeWeights:l}){var _;let c=ke(this,Ps,I8).call(this,t),p=ke(this,Ps,I8).call(this,r);if(c.length===0||p.length===0)return[];let{frontier:h,cameFrom:y,costSoFar:b}=ke(this,Ps,hoe).call(this,c,p);for(;h.length>0;){let C=h.shift();if(!C)break;if(ke(this,Ps,moe).call(this,C.origin,p))return ke(this,Ps,goe).call(this,y,C.origin.properties.id);for(let P of this.edges[C.origin.properties.id]){let E=(_=l==null?void 0:l.get(P))!=null?_:P.weight;if(i!=null&&i.has(P.origin.properties.id)&&P.destination.properties.map!==P.origin.properties.map)continue;let w=b[C.origin.properties.id]+E+d(this,qT).call(this,P.destination,s);if(!(w===1/0||n!=null&&n.has(P.destination.properties.id))&&(b[P.destination.properties.id]==null||w<b[P.destination.properties.id])){let O=w+this.getShortestEuclideanDistance(P.destination,p);b[P.destination.properties.id]=w,y[P.destination.properties.id]=P,h.push({origin:P.destination,priority:O})}}h.sort((P,E)=>P.priority-E.priority)}return[]}};_y=new WeakMap,Ps=new WeakSet,I8=o(function(t){return t.map(r=>this.nodesById[r]).filter(Boolean)},"#filterValidNodes"),poe=o(function(t){return t.reduce((r,n)=>(r[n.properties.id]=n,r),{})},"#createNodesById"),foe=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"),doe=o(function(t,r,n){t.forEach(i=>{let s=r==="default"?r:i.properties[r];this.nodesByGroup.has(s)||this.nodesByGroup.set(s,[]),this.nodesByGroup.get(s).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:l,weight:c})=>{let p=this.nodesById[l],h=ic(i.geometry.coordinates,p.geometry.coordinates),y=td(i.geometry.coordinates,p.geometry.coordinates);return new Iy({origin:i,destination:p,pathWeight:c,distance:h,angle:y,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),hoe=o(function(t,r){let n=[],i={},s={};return t.forEach(l=>{let c=this.getShortestEuclideanDistance(l,r);n.push({origin:l,priority:c}),i[l.properties.id]=null,s[l.properties.id]=0}),n.sort((l,c)=>l.priority-c.priority),{frontier:n,cameFrom:i,costSoFar:s}},"#initializeSearch"),moe=o(function(t,r){return r.some(n=>n.properties.id===t.properties.id)},"#isDestinationNode"),goe=o(function(t,r){let n=[],i=t[r];for(;i;)n.push(i),i=t[i.origin.properties.id];return n.reverse()},"#reconstructPath"),qT=new WeakMap,o(_8,"NavigationGraph");var zT=_8;var kAe=.4,S8=class S8{constructor({nodes:t,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:i}){x(this,"groupBy");x(this,"graph");x(this,"geometryEdgesByMapId",new Map);x(this,"generatePath",o(t=>{let{destination:r}=t[t.length-1],n={type:"FeatureCollection",features:[]};for(let s=0;s<t.length;s++){let{origin:l,destination:c}=t[s],p={id:l.properties.id,angle:t[s].angle,distance:t[s].distance,destination:c.properties.id,edges:this.graph.edges[l.properties.id]};this.groupBy!=="default"&&(p.groupBy=l.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[l.geometry.coordinates[0],l.geometry.coordinates[1]]},properties:p})}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"));x(this,"getDistance",o((t,r)=>ic(t,r),"getDistance"));x(this,"getAngle",o((t,r)=>td(t,r),"getAngle"));this.groupBy=n,this.graph=new zT({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:i}),((r==null?void 0:r.features)||[]).forEach(l=>{let c=null;if(l.geometry.type==="LineString"?c=l.geometry.coordinates:l.geometry.type==="Polygon"&&(c=l.geometry.coordinates.flat()),c){let p=this.groupBy==="default"?this.groupBy:l.properties[this.groupBy];this.geometryEdgesByMapId.has(p)||this.geometryEdgesByMapId.set(p,[]),c.forEach((h,y)=>{this.geometryEdgesByMapId.get(p).push([h,c[y+1]||c[0]])})}})}getDirections({zones:t,originIds:r,destinationNodeIds:n,excludedNodeIds:i,disabledConnectionNodeIds:s,simplify:l,multiplicativeDistanceWeightScaling:c,overrideEdgeWeights:p}){var _,C;let h=(_=l==null?void 0:l.enabled)!=null?_:!0,y=t!=null?t:[],b=this.graph.aStar({originIds:r,destinationNodeIds:n,zones:y,excludedNodeIds:new Set(i),disabledConnectionNodeIds:new Set(s),overrideEdgeWeights:p});return b.length===0?{type:"FeatureCollection",features:[]}:(h&&(b=this.simplifyAllSteps(b,(C=l==null?void 0:l.bufferRadius)!=null?C:kAe,c)),this.generatePath(b))}simplifyAllSteps(t,r,n){var h,y;let i=[],s=[t[0]];for(let b=1;b<t.length;b++)if(this.groupBy!=="default"&&t[b].origin.properties[this.groupBy]!==t[b-1].origin.properties[this.groupBy]){let _=t[b-1].origin.properties[this.groupBy],C=(h=this.geometryEdgesByMapId.get(_))!=null?h:[];i.push(...this.simplifySteps(s,C,r,n)),s=[t[b]]}else s.push(t[b]);let l=t[t.length-1],c=this.groupBy==="default"?this.groupBy:l.origin.properties[this.groupBy],p=(y=this.geometryEdgesByMapId.get(c))!=null?y:[];return i.push(...this.simplifySteps(s,p,r,n)),i}simplifySteps(t,r,n,i){if(t.length<3)return t;let s=[t[0]],l=1;for(let c=l+2;c<t.length;c++)if(t[l].origin.properties.preventSmoothing||!coe(t[l].origin,t[c].origin,r,n)){let p=c-1;s.push(new Iy(re(R({},t[l]),{destination:t[p].origin,distance:ic(t[l].origin.geometry.coordinates,t[p].origin.geometry.coordinates),angle:td(t[l].origin.geometry.coordinates,t[p].origin.geometry.coordinates)}))),l=p}return s.push(new Iy(re(R({},t[l]),{destination:t[t.length-1].origin,distance:ic(t[l].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:td(t[l].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:i})),t[t.length-1]),s}};o(S8,"Navigator");var jv=S8;var yoe="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",RAe="https://auth.mappedin.com/oauth2/token";async function voe(e,t){var r,n,i,s,l,c;if((r=t==null?void 0:t.outdoorView)!=null&&r.enabled){let{Map:p,MercatorCoordinate:h}=await import("./outdoor-context-v4-NYXT7FKP.js"),y=t.outdoorView.headers;y==null&&(y=await ck(RAe));let b=t.center||[0,0],_=new p({container:e,style:t.outdoorView.style||yoe,center:b,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:g8,pitch:(i=t.pitch)!=null?i:h8,bearing:(s=t.bearing)!=null?s:m8,transformRequest:sk(y),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:u0(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),C=_.painter.context.gl,P=new K2(e,{center:b,zoomLevel:_.getZoom(),pitch:_.getPitch(),bearing:_.getBearing(),gl:C,map:_,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias,occlusionEnabled:t.occlusionEnabled,transformImageRequest:t.transformImageRequest,naturalBearing:(l=t.naturalBearing)!=null?l:0,imagePlacementOptions:t.imagePlacementOptions,onWebGLContextCreationError:t.onWebGLContextCreationError,onWebGLContextLost:t.onWebGLContextLost,onWebGLContextRestored:t.onWebGLContextRestored,onWebGLRendererError:t.onWebGLRendererError,useStandaloneCamera:(c=t.useStandaloneCamera)!=null?c:!1}),E={center:_.getCenter().toArray(),zoom:_.getZoom(),bearing:_.getBearing(),pitch:_.getPitch()};_.setMinZoom(P.camera.minZoomLevel),_.setMaxZoom(P.camera.maxZoomLevel),P.on("camera-change",j=>{E.center=j.center,E.zoom=j.zoomLevel,E.bearing=j.bearing,E.pitch=j.pitch,_.jumpTo(E)});let w=h.fromLngLat(b,0),O=SS(w,P.viewCamera,P.camera,()=>{P.renderSync()});_.on("style.load",async()=>{_&&(_.addLayer(O),P.renderSync())});let D=!1,A=!1;_.on("idle",()=>{_&&(D||(P.publish("outdoor-view-loaded"),D=!0),A||(A=!0,P.publish("outdoor-style-loaded")))});let k=o(j=>{j&&(j.sourceDataType==="metadata"||j.sourceDataType==="visibility"||j.dataType==="style"||j.type==="terrain")&&P.getSystems().htmlControlsSystem.updateData(_)},"updateData");return _.on("styledata",j=>{_&&j&&j.dataType==="style"&&j.type==="styledata"&&(A=!1),k(j)}),_.on("sourcedata",k),_.on("terrain",k),_.on("error",j=>{var W;if(((W=j.error)==null?void 0:W.url)===yoe){ce.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(y["x-mappedin-tiles-key"],'"'));return}ce.warn(j)}),P}else return new K2(e,t)}o(voe,"createRenderer");g();g();g();var J2=(r=>(r.Exterior="exterior-walls",r.Interior="interior-walls",r))(J2||{}),Q2=(r=>(r.Interior="interior-doors",r.Exterior="exterior-doors",r))(Q2||{});g();g();var $v=class $v{constructor(t,r,n){x(this,"id");x(this,"text");x(this,"target");x(this,"__type",$v.__type);this.id=t,this.text=r,this.target=n}static is(t){return t.__type===$v.__type}get focusTarget(){return this.target.anchorTarget}};o($v,"Label"),x($v,"__type","Label");var Rh=$v;g();var Cy,Sy=class Sy{constructor(t,r,n){x(this,"id");G(this,Cy);x(this,"__type",Sy.__type);x(this,"contentEl");this.id=t,this.contentEl=r,q(this,Cy,n)}get target(){return d(this,Cy)}get coordinate(){return d(this,Cy).anchorTarget}toJSON(){return{id:this.id,__type:Sy.__type,target:this.target,coordinate:this.coordinate}}static is(t){return t.__type===Sy.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){q(this,Cy,t)}};Cy=new WeakMap,o(Sy,"Marker"),x(Sy,"__type","Marker");var rd=Sy;g();var t_,r_,Gv=class Gv{constructor(t,r,n){G(this,t_);G(this,r_);x(this,"target");x(this,"__type",Gv.__type);q(this,t_,t),q(this,r_,r),this.target=n}static is(t){return t.__type===Gv.__type}get id(){return d(this,t_)}get url(){return d(this,r_)}};t_=new WeakMap,r_=new WeakMap,o(Gv,"Image"),x(Gv,"__type","Image");var e_=Gv;g();var Vv,Uv=class Uv{constructor(t,r,n){x(this,"id");x(this,"groupId");x(this,"__type",Uv.__type);G(this,Vv);this.id=t,this.groupId=r,q(this,Vv,n)}get target(){return d(this,Vv)}static is(t){return t.__type===Uv.__type}updateTarget(t){q(this,Vv,t)}};Vv=new WeakMap,o(Uv,"Model"),x(Uv,"__type","Model");var wy=Uv;g();var zv=class zv{constructor(t,r){x(this,"id");x(this,"coordinates");x(this,"__type",zv.__type);this.id=t,this.coordinates=r}static is(t){return t.__type===zv.__type}get focusTarget(){return this.coordinates}};o(zv,"PathSegment"),x(zv,"__type","PathSegment");var qv=zv,Py=class Py{constructor(t,r,n,i){x(this,"id");x(this,"animation");x(this,"coordinates");x(this,"segments");x(this,"__type",Py.__type);this.id=t,this.animation=r,this.coordinates=n,this.segments=i.map(({id:s,coordinates:l})=>new qv(s.toString(),l))}static is(t){return t.__type===Py.__type}get focusTarget(){return this.coordinates}toJSON(){return{__type:Py.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};o(Py,"Path"),x(Py,"__type","Path");var oc=Py;g();var Bh,C8=class C8{constructor(t){G(this,Bh);q(this,Bh,t)}get center(){return d(this,Bh).center}get bearing(){return d(this,Bh).bearing}get pitch(){return d(this,Bh).pitch}get zoomLevel(){return d(this,Bh).zoomLevel}};Bh=new WeakMap,o(C8,"CameraTransform");var n_=C8;g();var Hv=class Hv{constructor(t){x(this,"id");x(this,"__type",Hv.__type);this.id=t}static is(t){return t.__type===Hv.__type}get focusTarget(){return this}};o(Hv,"Shape"),x(Hv,"__type","Shape");var nd=Hv;g();var i_=class i_{constructor(t,r){x(this,"id");x(this,"target");x(this,"__type","Text3D");this.id=t,this.target=r}static is(t){return t.__type===i_.__type}};o(i_,"Text3D"),x(i_,"__type","Text3D");var jh=i_;g();g();g();var BAe=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>']]),jAe=/<svg([^>]*)>/g;function boe(e,t,r){let n=BAe.get(e);return n?n.replace(jAe,'<svg$1 style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}o(boe,"getStyledIcon");var $Ae=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"),GAe=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"),w8="#722ED1",P8="#1890FF",xoe=o(({type:e="departure",color:t=P8})=>'<div class="dropped-pin-wrapper">\n '.concat(e==="departure"?$Ae(t):GAe(t),"\n </div>"),"DroppedPin"),UAe=o(e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),Ioe=o(({type:e="stairs",color:t=w8,direction:r="up"})=>{let n=UAe("default"),i=n/2+2,s=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(boe("connection-"+e+"-16x16","white",i)||"","\n </div>\n ").concat(s?'<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 _oe=o(async e=>new Promise(t=>setTimeout(t,e)),"ms");var VAe={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},zAe={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},$h={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:VAe,inactivePathOptions:zAe,markerOptions:{departureColor:P8,destinationColor:w8},animatePathDrawing:!0},id,sc,od,Wr,s_,sd,Ty,vo,ac,za,lc,Gh,qi,Soe,Coe,T8,HT,Wv,E8,Xv,M8=class M8{constructor(t,r,n){G(this,qi);G(this,id,new Map);G(this,sc);G(this,od);G(this,Wr,$h);G(this,s_);G(this,sd);G(this,Ty);G(this,vo,[]);G(this,ac);G(this,za,new Map);G(this,lc,new Map);G(this,Gh,new Map);G(this,Xv,o(t=>{var r;if((r=d(this,Wr).createMarkers)!=null&&r.connection&&t.markers.length>0){let{instruction:n}=d(this,id).get(t.markers[0]);n!=null&&n.action.toFloor&&(d(this,Wr).setMapOnConnectionClick&&this.currentMap.setFloor(n.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:n,fromFloor:n.action.fromFloor,toFloor:n.action.toFloor}))}},"#handleClick"));q(this,sc,t),q(this,s_,n),q(this,od,r)}get currentMap(){return d(this,s_).call(this)}get isMultiFloor(){if(!d(this,vo).length)return!1;let t=new Set;for(let r of d(this,vo))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,za).get(t)}getMarkerById(t){return d(this,id).get(t)}get paths(){let t=new Set;return d(this,za).forEach(({path:r})=>t.add(r)),Array.from(t)}get activeDirections(){return d(this,Gh).get(d(this,ac))}get activePath(){var t;if(d(this,ac))return(t=d(this,za).get(d(this,ac).id))==null?void 0:t.path}get floorStacks(){let t=d(this,od).getMapData();if(!d(this,vo).length||!t)return[];let r=new Set;for(let n of d(this,vo))for(let i of n.coordinates)if(i.floorId){let s=t.getById("floor",i.floorId);s&&r.add(s.floorStack)}return Array.from(r)}get floors(){let t=d(this,od).getMapData();if(!d(this,vo).length||!t)return[];let r=new Set;for(let n of d(this,vo))for(let i of n.coordinates)if(i.floorId){let s=t.getById("floor",i.floorId);s&&r.add(s)}return Array.from(r)}setActivePathByIndex(t){let r=d(this,vo)[t];if(!d(this,vo).length){ce.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!d(this,vo)[t]){ce.warn("Direction #".concat(t," does not exist"));return}let n=d(this,lc).get(r);if(!n){ce.warn("The direction is not a part of muli-direcional path");return}ke(this,qi,HT).call(this,n)}setActivePath(t){if(!d(this,vo).length){ce.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!d(this,Gh).get(t)){ce.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}ke(this,qi,HT).call(this,t)}setActivePathByDirections(t){if(!d(this,vo).length){ce.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let r=d(this,lc).get(t);if(!r){ce.warn("The direction is not a part of muli-direcional path");return}ke(this,qi,HT).call(this,r)}drawSync(t,r={}){var c,p,h;d(this,Ty)&&this.clear(),q(this,Ty,!0),ke(this,qi,T8).call(this,r);let n=Array.isArray(t)?t:[t],i=n[0],s=n[n.length-1],l=i.coordinates[0];q(this,vo,n),l.floorId&&d(this,Wr).setMapToDeparture&&this.currentMap.setFloor(l.floorId),(c=d(this,Wr).createMarkers)!=null&&c.departure&&ke(this,qi,Wv).call(this,i.coordinates[0],"departure",i.instructions[0]);for(let y=0;y<n.length;y++){let b=n[y],_=y?R({},d(this,Wr).inactivePathOptions):R({},d(this,Wr).pathOptions);if(b.coordinates.length<2){ce.warn("Directions must have at least 2 coordinates");return}let C=this.currentMap.Paths.add(b.coordinates,re(R({},_),{animateDrawing:d(this,Wr).animatePathDrawing})),P=C.paths.map(w=>w.id.toString()),E=new oc(xn(),C.animation,b.coordinates,C.paths);for(let w of P){d(this,za).set(w,{path:E,entityIds:P});let O=y?re(R({},d(this,Wr).inactivePathOptions),{altitude:0}):re(R({},d(this,Wr).pathOptions),{altitude:.05});d(this,sc).setState(w,O)}d(this,za).set(E.id,{path:E,entityIds:P}),d(this,lc).set(b,E),d(this,Gh).set(E,b),(p=d(this,Wr).createMarkers)!=null&&p.connection&&ke(this,qi,E8).call(this,b.instructions,"connection"),y===0&&(q(this,ac,d(this,lc).get(d(this,vo)[0])),d(this,sc).on("click",d(this,Xv)))}(h=d(this,Wr).createMarkers)!=null&&h.destination&&ke(this,qi,Wv).call(this,s.coordinates[s.coordinates.length-1],"destination",s.instructions[s.instructions.length-1]),d(this,od).mapObjects.forEach(y=>{y.processFloorChange(y.currentFloorId)})}async draw(t,r={}){d(this,sd)&&this.clear(),ke(this,qi,T8).call(this,r);let n=Array.isArray(t)?t:[t],s=n[0].coordinates[0];return q(this,vo,n),s.floorId&&d(this,Wr).setMapToDeparture&&this.currentMap.setFloor(s.floorId),ke(this,qi,Coe).call(this,n)}clear(){d(this,id).forEach((t,r)=>{this.currentMap.Markers.remove(r.toString())}),d(this,id).clear(),d(this,za).forEach(({path:t,entityIds:r})=>{d(this,za).delete(t.id),r.forEach(n=>d(this,za).delete(n)),this.currentMap.Paths.remove(r)}),d(this,sd)&&(d(this,sd).cancel(),q(this,sd,void 0)),d(this,Ty)&&q(this,Ty,!1),q(this,vo,[]),d(this,lc).clear(),d(this,Gh).clear(),q(this,ac,void 0),d(this,sc).off("click",d(this,Xv)),d(this,od).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};id=new WeakMap,sc=new WeakMap,od=new WeakMap,Wr=new WeakMap,s_=new WeakMap,sd=new WeakMap,Ty=new WeakMap,vo=new WeakMap,ac=new WeakMap,za=new WeakMap,lc=new WeakMap,Gh=new WeakMap,qi=new WeakSet,Soe=o(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),Coe=o(function(t){let r=t[0],n=t[t.length-1],i=!1;return q(this,sd,{promise:new Promise(async s=>{var l,c,p;if(I.env.NODE_ENV!=="test"&&await _oe(500),i||!t.length){s();return}(l=d(this,Wr).createMarkers)!=null&&l.departure&&ke(this,qi,Wv).call(this,r.coordinates[0],"departure",r.instructions[0]);for(let h=0;h<t.length;h++){let y=t[h],b=h?R({},d(this,Wr).inactivePathOptions):R({},d(this,Wr).pathOptions);if(y.coordinates.length<2){ce.warn("Directions must have at least 2 coordinates"),s();return}let _=this.currentMap.Paths.add(y.coordinates,re(R({},b),{animateDrawing:d(this,Wr).animatePathDrawing})),C=_.paths.map(E=>E.id.toString()),P=new oc(xn(),_.animation,y.coordinates,_.paths);for(let E of C){d(this,za).set(E,{path:P,entityIds:C});let w=h?re(R({},d(this,Wr).inactivePathOptions),{altitude:0}):re(R({},d(this,Wr).pathOptions),{altitude:.05});d(this,sc).setState(E,w)}if(d(this,za).set(P.id,{path:P,entityIds:C}),d(this,lc).set(y,P),d(this,Gh).set(P,y),I.env.NODE_ENV!=="test"&&await _.animation,i){s();return}(c=d(this,Wr).createMarkers)!=null&&c.connection&&ke(this,qi,E8).call(this,y.instructions,"connection"),h===0&&(q(this,ac,d(this,lc).get(d(this,vo)[0])),d(this,sc).on("click",d(this,Xv)))}if((p=d(this,Wr).createMarkers)!=null&&p.destination&&ke(this,qi,Wv).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),i){s();return}d(this,od).mapObjects.forEach(h=>{h.processFloorChange(h.currentFloorId)}),s()}),cancel:o(()=>{i=!0},"cancel")}),d(this,sd).promise},"#drawAsync"),T8=o(function(t){var r,n,i;q(this,Wr,{setMapOnConnectionClick:(r=t.setMapOnConnectionClick)!=null?r:$h.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:$h.setMapToDeparture,pathOptions:R(R({},$h.pathOptions),t.pathOptions),inactivePathOptions:R(R({},$h.inactivePathOptions),t.inactivePathOptions),createMarkers:R(R({},$h.createMarkers),t.createMarkers),markerOptions:R(R({},$h.markerOptions),t.markerOptions),animatePathDrawing:(i=t.animatePathDrawing)!=null?i:$h.animatePathDrawing})},"#setupOptions"),HT=o(function(t){q(this,ac,t),d(this,vo).forEach(r=>{let n=d(this,lc).get(r);if(n){let i=d(this,za).get(n.id),s=i.path.id===d(this,ac).id?re(R({},d(this,Wr).pathOptions),{altitude:.05}):re(R({},d(this,Wr).inactivePathOptions),{altitude:0});i.entityIds.forEach(l=>{d(this,sc).setState(l,s)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),Wv=o(function(t,r,n){var i,s,l,c,p;if(r==="connection"&&n){let h=n.action.type==="ExitConnection"?d(this,Wr).markerOptions.departureColor:d(this,Wr).markerOptions.destinationColor,y;if(typeof((i=d(this,Wr).createMarkers)==null?void 0:i.connection)=="function"){let _=d(this,Wr).createMarkers.connection(n);d(this,sc).setState(_.id.toString(),{options:{interactive:!0}}),y={id:_.id,type:"marker"}}else y=this.currentMap.Markers.add(n.coordinate,Ioe({type:(l=(s=n.action.connection)==null?void 0:s.type)!=null?l:n.action.connectionType,color:h,direction:n.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let b=this.currentMap.Markers.getContentEl(y.id.toString());if(!b)throw new Error("marker component should exist");d(this,id).set(y.id,{instruction:n,marker:new rd(y.id.toString(),b,n.coordinate)})}else{let h=r==="departure"?d(this,Wr).markerOptions.departureColor:d(this,Wr).markerOptions.destinationColor,y;typeof((c=d(this,Wr).createMarkers)==null?void 0:c.departure)=="function"&&r==="departure"?y={id:d(this,Wr).createMarkers.departure(n).id,type:"marker"}:typeof((p=d(this,Wr).createMarkers)==null?void 0:p.destination)=="function"&&r==="destination"?y={id:d(this,Wr).createMarkers.destination(n).id,type:"marker"}:y=this.currentMap.Markers.add(t,xoe({type:r,color:h}),{anchor:"top",rank:"always-visible"}),d(this,id).set(y.id,void 0)}},"#addMarker"),E8=o(function(t,r){t.filter(i=>ke(this,qi,Soe).call(this,i.action)).forEach(i=>{ke(this,qi,Wv).call(this,i.coordinate,r,i)})},"#addMarkers"),Xv=new WeakMap,o(M8,"Navigation");var o_=M8;g();g();g();var qAe=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>']]),HAe=/<svg([^>]*)>/g;function woe(e,t,r){let n=qAe.get(e);return n?n.replace(HAe,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}o(woe,"getStyledIcon");var Ey,Yv,qa,O8,Poe,Toe,L8,Eoe,A8=class A8{constructor(t,r){G(this,qa);G(this,Ey);G(this,Yv);x(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});q(this,Ey,t),q(this,Yv,r)}auto(){let t=[],r=d(this,Yv)[Object.keys(d(this,Yv))[0]];return[...r.getByType("connection"),...r.getByType("point-of-interest"),...r.getByType("space")].forEach(n=>{if(n.__type==="connection")n.coordinates.forEach(i=>{let s=n.name||n.externalId;if(s){let l=d(this,Ey).Labels.add(i,s,ke(this,qa,O8).call(this,n));t.push(l)}});else{n.__type==="space"&&n.name!==""&&d(this,Ey).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let i=n.name;if(i){let s=d(this,Ey).Labels.add(n,i,ke(this,qa,O8).call(this,n));t.push(s)}}}),{labels:t}}};Ey=new WeakMap,Yv=new WeakMap,qa=new WeakSet,O8=o(function(t){let r=woe(ke(this,qa,Poe).call(this,t),"white",12);return{appearance:{text:{foregroundColor:ke(this,qa,L8).call(this,t)},marker:{foregroundColor:{active:ke(this,qa,L8).call(this,t)},icon:r,iconSize:12}},interactive:!0,rank:ke(this,qa,Eoe).call(this,t)}},"#generatLabelAppearance"),Poe=o(function(t){return t.__type==="connection"?ke(this,qa,Toe).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),Toe=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"),L8=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"),Eoe=o(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),o(A8,"Labels");var WT=A8;var D8=class D8{constructor(t,r){x(this,"Labels");x(this,"auto",o(()=>this.Labels.auto(),"auto"));this.Labels=new WT(t,r)}};o(D8,"DefaultTheme");var XT=D8;g();var Nt,l_,ad,YT,F8,N8=class N8{constructor(t){G(this,ad);G(this,Nt);G(this,l_);x(this,"interactions",{set:o(t=>{(t==null?void 0:t.pan)!=null&&(d(this,Nt).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(d(this,Nt).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(d(this,Nt).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},"set"),enable:o(()=>{d(this,Nt).getSystems().cameraSystem.enablePan=!0,d(this,Nt).getSystems().cameraSystem.enableZoom=!0,d(this,Nt).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:o(()=>{d(this,Nt).getSystems().cameraSystem.enablePan=!1,d(this,Nt).getSystems().cameraSystem.enableZoom=!1,d(this,Nt).getSystems().cameraSystem.enableRotate=!1},"disable")});x(this,"setMinPitch",o(t=>{d(this,Nt).camera.setMinPitch(t)},"setMinPitch"));x(this,"setMaxPitch",o(t=>{d(this,Nt).camera.setMaxPitch(t)},"setMaxPitch"));x(this,"setMinZoomLevel",o(t=>{d(this,Nt).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));x(this,"setMaxZoomLevel",o(t=>{d(this,Nt).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));q(this,l_,t),q(this,Nt,t.core)}setScreenOffsets(t){d(this,Nt).camera.setInsetPadding(t)}get screenOffsets(){return d(this,Nt).camera.insetsPadding}get panMode(){return d(this,Nt).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&d(this,Nt).camera.setPanMode(t)}getFocusOnTransform(t,r){var i;let n=d(this,Nt).camera.getCameraFrameForCoordinates(ke(this,ad,F8).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 St(n.center[1],n.center[0]),zoomLevel:n.zoomLevel}}focusOn(t,r){var n;return d(this,Nt).camera.focusOn(ke(this,ad,F8).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 p;let{center:n,zoomLevel:i,bearing:s,pitch:l}=t,c=n!=null?n:this.center;return d(this,Nt).camera.animateTo({center:n!=null?[c.longitude,c.latitude,d(this,Nt).camera.elevation]:void 0,zoomLevel:i,bearing:s,pitch:l,duration:(p=r==null?void 0:r.duration)!=null?p:600,easing:r==null?void 0:r.easing})}set(t){let{center:r=this.center,zoomLevel:n=this.zoomLevel,bearing:i=this.bearing,pitch:s=this.pitch}=t,l=[r.longitude,r.latitude];d(this,Nt).camera.setCenter(l),d(this,Nt).camera.setZoomLevel(n),d(this,Nt).camera.setBearing(i),d(this,Nt).camera.setPitch(s)}get center(){let t=d(this,Nt).camera.center;return new St(t[1],t[0],void 0)}setAutoMinZoomLevel(t){d(this,Nt).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return d(this,Nt).camera.autoMinZoomLevel}get zoomLevel(){return d(this,Nt).camera.zoomLevel}get pitch(){return d(this,Nt).camera.pitch}get minPitch(){return d(this,Nt).camera.minPitch}get maxPitch(){return d(this,Nt).camera.maxPitch}get bearing(){let t=d(this,Nt).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return d(this,Nt).camera.minZoomLevel}get maxZoomLevel(){return d(this,Nt).camera.maxZoomLevel}setElevation(t){d(this,Nt).camera.setElevation(t)}get elevation(){return d(this,Nt).camera.elevation}animateElevation(t,r){return d(this,Nt).camera.animateElevation(t,r)}updateFacadesInView(){d(this,Nt).getSystems().geometryInFocusSystem.raycast()}};Nt=new WeakMap,l_=new WeakMap,ad=new WeakSet,YT=o(function(t){var n,i,s,l,c,p;let r=d(this,Nt).camera.elevation;return St.is(t)&&t.floorId!=null?(i=(n=d(this,Nt).getState(t.floorId))==null?void 0:n.altitude)!=null?i:r:ca.is(t)?(l=(s=d(this,Nt).getState(t.id))==null?void 0:s.altitude)!=null?l:r:"floor"in t&&ca.is(t.floor)&&(p=(c=d(this,Nt).getState(t.floor.id))==null?void 0:c.altitude)!=null?p:r},"#getFloorAltitude"),F8=o(function(t){var s;let r=[],i=(Array.isArray(t)?t:[t]).flatMap(l=>{var c;return(c=l==null?void 0:l.focusTarget)!=null?c:[l]});for(let l of i)if(l!=null)if(St.is(l)){let c=ke(this,ad,YT).call(this,l);r.push([l.longitude,l.latitude,c])}else if((l==null?void 0:l.id)!=null){let c=ke(this,ad,YT).call(this,l);if(ca.is(l)&&((s=d(this,l_).getMapDataInternal())!=null&&s.enterpriseMode)){r.push(l.id);continue}else if("geoJSON"in l&&l.geoJSON.geometry.coordinates.length>0){ps(l.geoJSON,h=>{r.push([h[0],h[1],c])});continue}let p=d(this,Nt).getBoundingArea(l.id);if(p)r.push(...p.map(h=>[h[0],h[1],c]));else if("geoJSONBoundingBox"in l){let h=ke(this,ad,YT).call(this,l);if(l.geoJSONBoundingBox!=null){let y=[[l.geoJSONBoundingBox[0],l.geoJSONBoundingBox[1],h],[l.geoJSONBoundingBox[2],l.geoJSONBoundingBox[3],h]];r.push(...y)}}}else zE(l)&&r.push(l);return r},"#computeCoordinateCloud"),o(N8,"Camera");var a_=N8;g();var Zv,k8=class k8{constructor({currentMapGetter:t}){G(this,Zv);q(this,Zv,t)}get currentMap(){return d(this,Zv).call(this)}async getCurrentSceneGLTF(t){let r=d(this,Zv).call(this);return r?r==null?void 0:r.Exporter.getCurrentSceneGLTF(t):(ce.error("There is no map to export. Please load a map first."),new Blob)}};Zv=new WeakMap,o(k8,"Exporter");var u_=k8;g();var Mp,p_,R8=class R8{constructor({currentMapGetter:t}){G(this,Mp,new Map);G(this,p_);q(this,p_,t)}get currentMap(){return d(this,p_).call(this)}getById(t){return d(this,Mp).get(t)}add(t,r,n){let i=t.anchorTarget,s=this.currentMap;if(!s)throw new Error("currentMap should exist");let l=s.Labels.add(i,r,re(R({},n),{attachTo:Kv(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank})),c=new Rh(l.id.toString(),r,t);return d(this,Mp).set(c.id,{label:c,entityId:c.id}),c}all(t){var n;let r=[];return(n=this.currentMap)==null||n.Labels.all({onCreate:o((i,s,l)=>{let c=new Rh(i.toString(),s,l);d(this,Mp).set(c.id,{label:c,entityId:c.id}),r.push(c)},"onCreate"),labelOptions:t}),r}remove(t){var n;let r=d(this,Mp).get(t.id);r&&((n=this.currentMap)==null||n.Labels.remove(r),d(this,Mp).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Mp).forEach(({label:r})=>{this.remove(r),t.push(r),d(this,Mp).delete(r.id.toString())}),t}};Mp=new WeakMap,p_=new WeakMap,o(R8,"Labels");var c_=R8;g();g();var B8={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},Moe={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},Ooe=.5,G8=class G8{constructor(t,r,n=new Map){x(this,"containerId");x(this,"layers");x(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(G8,"Layer");var ld=G8,My,U8=class U8{constructor(t,r,n,i,s,l,c,p){x(this,"id");x(this,"name");x(this,"elevation");x(this,"containerId");x(this,"externalId");x(this,"metadata");x(this,"shortName");x(this,"subtitle");x(this,"occluderId");x(this,"loaded",!1);x(this,"styleMap",{});x(this,"obstructions");x(this,"entrances");x(this,"spaces");x(this,"floorImages");x(this,"floorText");x(this,"renderer");x(this,"options");x(this,"layers",new Map);x(this,"footprint");x(this,"floorStackId");x(this,"multiFloorView");x(this,"mapDataInternal");x(this,"facadesByStyleId",new Map);G(this,My);x(this,"load",o(()=>{var i,s,l,c,p,h,y,b,_,C,P,E,w,O,D,A;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(df,"-").concat(this.id),{},this.id);this.layers.set(df,new ld(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer("".concat(qc,"-").concat(this.id),{},this.id);this.layers.set(qc,new ld(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat(Zi,"-").concat(this.id),{},this.id);if(this.layers.set(Zi,new ld(this.renderer,n.id.toString())),((i=this.footprint)==null?void 0:i.geometry)!=null&&((s=this.footprint)==null?void 0:s.geometry.coordinates.length)!==0){let k=B8;if(this.obstructions!=null&&this.obstructions.features.length>0){let Y=this.obstructions.features.filter(N=>{var Z;return N.geometry.type==="LineString"&&((Z=N.properties.kind)==null?void 0:Z.toLowerCase())==="wall"&&N.properties.footprintComponent===!0});Y!=null&&Y.length>0&&(k=this.styleMap[(l=Y[0].properties)==null?void 0:l.id])}let j=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},re(R({},k),{height:(p=(c=this.multiFloorView)==null?void 0:c.floorHeight)!=null?p:10,altitude:0,outline:(y=(h=this.options.style)==null?void 0:h.outlines)!=null?y:!0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":k.color,renderOrder:2}),this.id);this.layers.set(gx,new ld(this.renderer,j.id.toString()));let W=this.renderer.addGroupContainer("".concat(V0,"-").concat(this.id),{},this.id);this.layers.set(V0,new ld(this.renderer,W.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,W.id)}if(this.spaces!=null&&this.spaces.features.length>0){let k=[],j=new Map;this.spaces.features.filter(Z=>{var le;return Z.geometry.type==="Polygon"&&((le=Z.properties.kind)==null?void 0:le.toLowerCase())!=="void"}).forEach(Z=>{var se;let le=(se=this.mapDataInternal)==null?void 0:se.facadesBySpaceId[Z.properties.id];if(le){let U=j.get(le.id)||[];j.set(le.id,[...U,Z])}else k.push(Z)});let W=ZT(k,this.styleMap),Y=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),N=0;for(let[Z,le]of W){let se=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(N),{features:le},Jv(Z,this.options),Y);N++;let U=Y.id.toString();this.layers.get(Zi).layers.set(Z.id||U,se.id.toString())}if(j.size>0){let Z=this.renderer.addGroupContainer("".concat(Vm,"-").concat(this.id),{},this.id);this.layers.set(Vm,new ld(this.renderer,Z.id.toString()));for(let[le,se]of j){let U=this.renderer.addGroupContainer(le,{focusable:!0},Z),ye=this.renderer.addGroupContainer("".concat(le,"-geometry"),{},U),ne=ZT(se,this.styleMap),Ce=0;for(let[Ie,Ue]of ne){let ve=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(le,"-").concat(Ce),{features:Ue},re(R({},Jv(Ie,this.options)),{renderOrder:3}),ye);Ce++;let Te=Ie.id||ve.id.toString();this.layers.get(Vm).layers.set("".concat(le,"-").concat(Te),ve.id.toString()),this.facadesByStyleId.has(Te)?(b=this.facadesByStyleId.get(Te))==null||b.push(le):this.facadesByStyleId.set(Te,[le])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let k=this.obstructions.features.filter(ye=>ye.geometry.type==="Polygon"&&(ye.properties.kind==="object"||ye.properties.kind==="unknown")),j=ZT(k,this.styleMap),W=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),Y=0;for(let[ye,ne]of j){let Ce=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(Y),{features:ne},Jv(ye,this.options),W);Y++;let Ie=W.id.toString();this.layers.get(Zi).layers.set(ye.id||Ie,Ce.id.toString())}let N=this.obstructions.features.filter(ye=>{var ne;return ye.geometry.type==="LineString"&&((ne=ye.properties.kind)==null?void 0:ne.toLowerCase())==="wall"&&ye.properties.footprintComponent===!1}),Z=this.obstructions.features.filter(ye=>{var ne;return ye.geometry.type==="LineString"&&((ne=ye.properties.kind)==null?void 0:ne.toLowerCase())==="wall"&&ye.properties.footprintComponent===!0}),le=this.entrances,se=B8,U=B8;if(N!=null&&N.length>0){let ye=this.styleMap[(_=N[0].properties)==null?void 0:_.id];ye!=null&&(se=R({},ye)),U=se;let{walls:ne,entrances:Ce}=j8(N,(le==null?void 0:le.features)||[]),Ie=Math.max(se.height-.11,Ooe),Ue=re(R({},Moe),{height:Ie}),ve=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),Ce,Ue,n);this.layers.get(Zi).layers.set(G0,ve.id.toString());let Te=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[ne]},Jv(se,this.options),n);this.layers.get(Zi).layers.set(Xd,Te.id.toString())}if(Z!=null&&Z.length>0){let ye=this.styleMap[(C=Z[0].properties)==null?void 0:C.id];ye!=null&&(U=re(R({},ye),{id:zc}));let{walls:ne,entrances:Ce}=j8(Z,(le==null?void 0:le.features)||[]),Ie=Math.max(U.height-.11,Ooe),Ue=re(R({},Moe),{height:Ie}),ve=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),Ce,Ue,n);this.layers.get(Zi).layers.set(U0,ve.id.toString());let Te=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[ne]},Jv(U,this.options),n);this.layers.get(Zi).layers.set(zc,Te.id.toString())}}if(this.floorImages!=null){let k=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let j of this.floorImages.features||[])"anchorId"in j.properties||"anchorId"in j.properties&&((P=j.properties)==null?void 0:P.anchorId)==null||this.renderer.addImage(xn(),j,{url:j.properties.path,flipImageToFaceCamera:(E=this.options.flipImagesToFaceCamera)!=null?E:!0},k);this.layers.set(cG,new ld(this.renderer,k.id.toString()))}if(this.floorText!=null)for(let k of this.floorText.features||[]){let j=0;"geometryId"in k.properties?j=(O=(w=this.renderer.getState(k.properties.geometryId))==null?void 0:w.height)!=null?O:0:j=(D=k.properties.verticalOffset)!=null?D:0,this.renderer.addText3D(xn(),re(R({},k),{properties:re(R({},k.properties),{verticalOffset:j})}),{},this.id)}return(A=this.multiFloorView)!=null&&A.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var y,b,_,C,P;this.id=r.id,this.options=s;let h=n.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:(y=s.preloadFloors)==null?void 0:y.map(E=>E.id).includes(r.id)},t);this.containerId=h.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,l!=null&&c!=null&&(this.styleMap=c,this.spaces=l.space[this.id],this.entrances=l.entrance[this.id],this.obstructions=l.obstruction[this.id],this.floorImages=(b=l.floorImages)==null?void 0:b[this.id],this.floorText=(C=(_=l.enterprise)==null?void 0:_.floorText)==null?void 0:C[this.id],this.footprint=(P=l["floor.geojson"])==null?void 0:P.features.find(E=>E.properties.id===r.id)),this.renderer=n,this.floorStackId=t,this.multiFloorView=i,this.mapDataInternal=p}get geoJSONBoundingBox(){if(d(this,My))return d(this,My);if(!this.footprint){ce.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return q(this,My,KT(this.footprint)),d(this,My)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};My=new WeakMap,o(U8,"FloorObject");var f_=U8;g();var V8=50,z8=!1,WAe=1e3,Ti,Qv,Op,uc,Ts,h_,Vh,eb,Oy,Ha,H8,Ly,m_,g_,y_,v_,ud,Foe,b_,zh,W8,Noe,koe,Ay,X8=class X8 extends Lt{constructor({currentMapGetter:r}){super();G(this,Ha);G(this,Ti);G(this,Qv,0);G(this,Op);G(this,uc,!1);G(this,Ts,[]);G(this,h_,0);G(this,Vh,V8);G(this,eb,!1);G(this,Oy,"collapsed");x(this,"expandedFactor",0);G(this,Ly,"all-floors");G(this,m_,o(()=>{let r=d(this,Ti).call(this);if(d(this,h_)===this.expandedFactor||r==null||!d(this,uc))return;q(this,h_,this.expandedFactor);let n=Ll(this.expandedFactor,0,1,0,this.distanceBetweenFloors),s=Ll(this.expandedFactor,0,.1,0,1)===0;d(this,Ts).forEach((l,c)=>{r.api.updateState(l.containerId,{visible:s?l.id===r.currentFloorId:!0,altitude:n*c})}),this.expandedFactor===0?(q(this,uc,!1),r.renderer.camera.setPanMode("default"),d(this,zh)&&d(this,zh).call(this)):this.expandedFactor===1&&(q(this,uc,!1),d(this,zh)&&d(this,zh).call(this))},"#handlePreRender"));G(this,g_,o(()=>{var r,n,i;this.expanded&&q(this,Qv,(n=(r=d(this,Ti).call(this))==null?void 0:r.renderer.camera.elevation)!=null?n:0),(i=d(this,Ti).call(this))==null||i.renderer.on("user-interaction-end",d(this,v_))},"#handleUserInteractionStart"));G(this,y_,o(()=>{var n;let r=d(this,Ti).call(this);if(r!=null&&this.expanded&&d(this,eb)&&!d(this,uc)){let i=r.currentFloorId,s=[1/0,r.currentFloorId];for(let l=0;l<d(this,Ts).length;l++){let c=d(this,Ts)[l],p=Math.abs(((n=r.renderer.camera.elevation)!=null?n:0)-l*this.distanceBetweenFloors);p<this.distanceBetweenFloors/3&&(s[0]=p,s[1]=c.id)}s[1]!==r.currentFloorId&&(r.currentFloorId=s[1],d(this,Ts).forEach(l=>{r.api.updateState(l.containerId,{visible:d(this,Ly)==="all-floors"?!0:r.currentFloor.id===l.id})}),r.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:r.currentFloorId,previousFloorId:i}))}},"#determineCurrentMapBasedOnElevation"));G(this,v_,o(()=>{var n,i;let r=d(this,Ti).call(this);if(this.expanded&&r&&d(this,Qv)!==((n=r.renderer.camera.elevation)!=null?n:0)){let s=[1/0,r.currentFloorId,0];for(let l=0;l<d(this,Ts).length;l++){let c=d(this,Ts)[l],p=Math.abs(((i=r.renderer.camera.elevation)!=null?i:0)-l*this.distanceBetweenFloors);p<s[0]&&(s[0]=p,s[1]=c.id,s[2]=l*this.distanceBetweenFloors)}d(this,eb)&&ke(this,Ha,Foe).call(this,s[2]),q(this,Qv,0),r.renderer.off("user-interaction-end",d(this,v_))}},"#handleUserInteractionEnd"));G(this,ud,null);G(this,b_,null);G(this,zh);G(this,Ay);q(this,Ti,r);let n=d(this,Ti).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",d(this,g_)),n.renderer.on("camera-change",d(this,y_)),n.renderer.on("pre-render",d(this,m_)))}get state(){return d(this,Oy)}get expanded(){return d(this,Oy)!=="collapsed"}get distanceBetweenFloors(){if(d(this,Vh)==="auto"){if(d(this,Ay)!=null)return d(this,Ay);let r=ke(this,Ha,koe).call(this);if(r)return q(this,Ay,r),r}return typeof d(this,Vh)=="number"?d(this,Vh):V8}clearCachedFloorSeparationDistance(){q(this,Ay,void 0)}get includedFloors(){var r;return(r=d(this,Ha,H8))!=null&&r.api.mapData?d(this,Ts).map(n=>{var i,s;return(s=(i=d(this,Ha,H8))==null?void 0:i.api.mapData)==null?void 0:s.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return d(this,Ly)}setFloorVisiblityMode(r){q(this,Ly,r);let n=d(this,Ti).call(this);n!=null&&d(this,Ts).forEach(i=>{n.api.updateState(i.containerId,{visible:d(this,Ly)==="all-floors"?!0:n.currentFloor.id===i.id})})}changeFloorOnElevationChanges(r){q(this,eb,r)}async expand(r){var i,s,l;let n=d(this,Ti).call(this);if(n!=null)return(r==null?void 0:r.distanceBetweenFloors)==="auto"?q(this,Vh,"auto"):q(this,Vh,(i=r==null?void 0:r.distanceBetweenFloors)!=null?i:V8),q(this,Ts,(r==null?void 0:r.includedFloors)!=null&&(r==null?void 0:r.includedFloors.length)>0?r==null?void 0:r.includedFloors.map(c=>n.floorsById.get(c.id)).filter(Boolean):n.currentFloorStack.floorObjects),d(this,Ts).sort((c,p)=>c.elevation-p.elevation),d(this,Ts).length<=1||this.expanded===!0?Promise.resolve():(q(this,uc,!0),n.api.Camera.setPanMode((s=r==null?void 0:r.cameraPanMode)!=null?s:"elevation"),this.changeFloorOnElevationChanges((l=r==null?void 0:r.changeFloorOnElevationChanges)!=null?l:!0),ke(this,Ha,W8).call(this,"expand",r).then(()=>{q(this,Oy,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{q(this,uc,!1)}))}async collapse(r){let n=d(this,Ti).call(this);if(n!=null)return this.expanded===!0?(q(this,uc,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),ke(this,Ha,W8).call(this,"collapse",r).then(()=>{q(this,Oy,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{q(this,uc,!1)})):Promise.resolve()}destroy(){let r=d(this,Ti).call(this);r!=null&&(r.renderer.off("user-interaction-start",d(this,g_)),r.renderer.off("camera-change",d(this,y_)),r.renderer.off("pre-render",d(this,m_)))}};Ti=new WeakMap,Qv=new WeakMap,Op=new WeakMap,uc=new WeakMap,Ts=new WeakMap,h_=new WeakMap,Vh=new WeakMap,eb=new WeakMap,Oy=new WeakMap,Ha=new WeakSet,H8=o(function(){return d(this,Ti).call(this)},"#currentMap"),Ly=new WeakMap,m_=new WeakMap,g_=new WeakMap,y_=new WeakMap,v_=new WeakMap,ud=new WeakMap,Foe=o(function(r){var i,s,l;d(this,ud)&&d(this,ud).stop();let n=d(this,Ti).call(this);n!=null&&(q(this,ud,new Va({elevation:(i=n.renderer.camera.elevation)!=null?i:0}).to({elevation:r},150).easing(Qi.Quadratic.Out).onComplete(()=>{var c;d(this,ud)&&((c=d(this,Ti).call(this))==null||c.renderer.getInternalTweenGroup().remove(d(this,ud)))}).onUpdate(({elevation:c})=>{n.renderer.camera.setElevation(c)}).start()),(s=d(this,Ti).call(this))==null||s.renderer.getInternalTweenGroup().add(d(this,ud)),(l=d(this,Ti).call(this))==null||l.renderer.render())},"#animateElevationTo"),b_=new WeakMap,zh=new WeakMap,W8=o(function(r,n){var c,p,h,y;d(this,Op)&&d(this,Op).stop();let i=d(this,Ti).call(this);if(i==null)return Promise.reject(new Error("No current map"));let s=d(this,Ts).indexOf(i.currentFloor),l=(c=i.renderer.camera.elevation)!=null?c:0;return q(this,b_,new Promise(b=>{q(this,zh,b)})),q(this,Op,new Va({percentExpanded:this.expandedFactor}).to({percentExpanded:r==="expand"?1:0},(p=n==null?void 0:n.duration)!=null?p:WAe).easing(Jf[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:b})=>{this.expandedFactor=b;let _=s*this.distanceBetweenFloors;i.renderer.camera.setElevation(r==="expand"?_*b:l*b)}).onComplete(()=>{var b;d(this,Op)&&((b=d(this,Ti).call(this))==null||b.renderer.getInternalTweenGroup().remove(d(this,Op)))}).start()),d(this,Op).cameraAnimation=!0,(h=d(this,Ti).call(this))==null||h.renderer.getInternalTweenGroup().add(d(this,Op)),(y=d(this,Ti).call(this))==null||y.renderer.render(),d(this,b_)},"#animate"),Noe=o(function(r,n,i,s){let l=q8(r,i),c=n.clone(),p=q8(c,i);if(!cm(l)||!cm(p))return-1;let h=0,y;z8&&s.querySelectorAll(".debug-box").forEach(_=>_.remove());do{if(h>1e4)return-1;if(h+=20,c.position.z=h,c.updateMatrixWorld(),p.makeEmpty(),q8(c,i,p),y=l.intersectsBox(p),z8){let b=Doe(l,"blue",s),_=Doe(p,y?"red":"green",s);b.classList.add("debug-box"),_.classList.add("debug-box")}}while(y);return h},"#computeMinZOffsetToSeparateFirstTwoFloors"),koe=o(function(){let r=d(this,Ti).call(this);if(!r)return;let n=r.renderer,i=n.getThreeScene();if(!r.api.mapData||!i)return;let l=d(this,Ts).length>0?d(this,Ts):r.currentFloorStack.floorObjects;if(l.length<2)return;let c=n.getInternalState().geometry3DMap.get(l[0].id),p=n.getInternalState().geometry3DMap.get(l[1].id);if(!c||!p)return;if(ME(c,"group-container"),ME(p,"group-container"),z8){let y=new co;y.setFromObject(c);let b=new co;if(b.setFromObject(p),c.children.forEach(D=>{D instanceof $t&&D.userData.debugBox&&Pi(D)}),p.children.forEach(D=>{D instanceof $t&&D.userData.debugBox&&Pi(D)}),!cm(y)||!cm(b))return;let _=new Cu(y.max.x-y.min.x,y.max.y-y.min.y,y.max.z-y.min.z),C=new _o({color:255,transparent:!0,opacity:.5}),P=new $t(_,C);P.position.set((y.min.x+y.max.x)/2,(y.min.y+y.max.y)/2,(y.min.z+y.max.z)/2),P.userData.debugBox=!0;let E=new Cu(b.max.x-b.min.x,b.max.y-b.min.y,b.max.z-b.min.z),w=new _o({color:"cyan",transparent:!0,opacity:.5}),O=new $t(E,w);O.position.set((b.min.x+b.max.x)/2,(b.min.y+b.max.y)/2,(b.min.z+b.max.z)/2),O.userData.debugBox=!0,c.add(P),p.add(O)}let h=ke(this,Ha,Noe).call(this,c,p,n.getThreeCamera(),n.container);if(h!==-1)return h},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),Ay=new WeakMap,o(X8,"StackedMaps");var d_=X8,Uh=new pt,Loe=new wt;function q8(e,t,r=new GN){return e.traverse(n=>{if(n instanceof $t){let s=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let c=0;c<s.count;c++)Uh.fromBufferAttribute(s,c),Uh.applyMatrix4(n.matrixWorld),Uh.applyMatrix4(t.matrixWorldInverse),Uh.applyMatrix4(t.projectionMatrix),Uh.z<1&&Uh.z>0&&(Loe.set(Uh.x,Uh.y),r.expandByPoint(Loe))}}),r}o(q8,"projectToBox2D");function Aoe(e,t){let r=t.clientWidth,n=t.clientHeight;return new wt((e.x+1)*r/2,(1-e.y)*n/2)}o(Aoe,"ndcToScreen");function Doe(e,t,r){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(t),n.style.pointerEvents="none";let i=Aoe(new wt(e.min.x,e.min.y),r),s=Aoe(new wt(e.max.x,e.max.y),r);n.style.left="".concat(i.x,"px"),n.style.top="".concat(s.y,"px");let l=Math.abs(s.x-i.x),c=Math.abs(s.y-i.y);return n.style.width="".concat(l,"px"),n.style.height="".concat(c,"px"),r.appendChild(n),n}o(Doe,"drawProjectedBox");g();g();function XAe(e,t){return"".concat(t," ").concat(e)}o(XAe,"formatMessage");var Y8=class Y8 extends Error{constructor(t,r=yN){super(XAe(t,r)),this.name="MappedinError"}};o(Y8,"MappedinError");var Ys=Y8;var tb,Z8=class Z8{constructor(t,r,n,i){x(this,"id");x(this,"externalId");x(this,"name");x(this,"type");x(this,"floorIds");x(this,"defaultFloorId");x(this,"floorObjects",[]);x(this,"floorObjectsByElevation",new Map);x(this,"metadata");x(this,"containerId");x(this,"facade");x(this,"renderer");G(this,tb);var l;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(l=t.floors)!=null?l:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=n;let s=n.addGroupContainer(this.id,{visible:!0,interactive:!0},r);this.containerId=s.id.toString(),this.facade=i}get defaultFloor(){if(d(this,tb)==null){if(this.floorObjects.length===0)throw new Ys("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)),q(this,tb,t)}return d(this,tb)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){ce.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var r,n;(n=(r=this.facade)==null?void 0:r.spaces)==null||n.forEach(i=>{this.renderer.setState(i.spaceId,{visible:t})})}};tb=new WeakMap,o(Z8,"FloorStackObject");var x_=Z8;g();function Roe(e,t,r,n){let i={outdoorOpacity:1,floorStates:[]},s=e.sort((y,b)=>y.elevation-b.elevation),l=Math.min(0,s[0].elevation),c=s[s.length-1].elevation,p,h;for(let y=l;y<=c;y++){let b=s.find(w=>w.elevation===y);if(b==null){y>=0&&(p==null?p=y:h=y);continue}let _=0,C=y<0?Math.abs(b.elevation)*r:r,P=!1;if(p===0&&h!=null){let w=r*h;_=-w,C=w,P=!0}else if(p!=null&&h!=null){let w=p,O=e.find(A=>A.elevation===w-1),D=i.floorStates.find(A=>A.floor===O);if(D){let A=r*(h-p+2);D.state.footprint=re(R({},D.state.footprint),{altitude:0,height:A,visible:!0})}}p=void 0,h=void 0;let E={floor:b,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};i.floorStates.push(E),b.id===t.id?(E.state.visible=!0,E.state.geometry.visible=!0,E.state.labels.enabled=!0,E.state.markers.enabled=!0,E.state.occlusion.enabled=!0,(b.elevation<0||P)&&(b.elevation<0&&(i.outdoorOpacity=.2),E.state.footprint.height=C,E.state.footprint.altitude=_,E.state.footprint.visible=!0)):n.includes(b.id)&&b.elevation<t.elevation?(E.state.visible=!0,E.state.geometry.visible=!0,E.state.markers.enabled=!0,E.state.occlusion.enabled=!0,E.state.footprint.visible=!0,b.elevation<0?(E.state.footprint.height=C,E.state.footprint.altitude=_,i.outdoorOpacity=.2):(E.state.footprint.height=C,E.state.footprint.altitude=_)):t.elevation>0&&b.elevation<t.elevation&&b.elevation>=0&&(E.state.visible=!0,E.state.footprint.visible=!0,E.state.footprint.height=r,E.state.footprint.altitude=_)}return i}o(Roe,"getVisiblityState");var YAe={linear:Qi.Linear.None,easeIn:Qi.Quadratic.In,easeOut:Qi.Quadratic.Out,easeInOut:Qi.Quadratic.InOut},Lp,Q8=class Q8 extends Lt{constructor(r,n,i,s){var h,y,b,_;super();x(this,"floorStacksById",new Map);x(this,"floorsById",new Map);x(this,"startingFloorId","");x(this,"currentFloorId","");x(this,"currentFloorStackId","");x(this,"outdoorFloorStacks",new Set);x(this,"id");x(this,"renderer");x(this,"api");x(this,"mvf");x(this,"options",{});x(this,"styleMap");x(this,"StackedMaps");x(this,"animations",new Map);x(this,"Models",{add:o((r,n,i)=>{let b=i,{floorId:s,scale:l}=b,c=cs(b,["floorId","scale"]),p=s?this.floorsById.get(s):this.currentFloor,h=R({},c);l!=null&&(h.scale=Array.isArray(i.scale)?i.scale:[i.scale,i.scale,i.scale]);let y=this.renderer.addModelGroup(r,{type:"FeatureCollection",features:n.map(_=>{var C;return{type:"Feature",properties:{id:xn(),rotation:i.rotation,scale:h.scale,interactive:i.interactive,verticalOffset:_.verticalOffset+((C=i.verticalOffset)!=null?C:0)},geometry:{type:"Point",coordinates:cu(_)}}})},h,{parent:p.id});if(y==null)throw new Ys("error creating model");return this.renderer.getState(y).children},"add"),remove:o((r,n)=>{this.renderer.remove(r),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)},"remove")});x(this,"Images",{add:o((r,n,i)=>{let y=i,{floorId:s,flipImageToFaceCamera:l}=y,c=cs(y,["floorId","flipImageToFaceCamera"]),p=s?this.floorsById.get(s):this.currentFloor,h={type:"Feature",properties:c,geometry:{type:"Point",coordinates:r}};return this.renderer.addImage(xn(),h,{url:n,flipImageToFaceCamera:l!=null?l:!1},p.id)},"add"),remove:o(r=>{this.renderer.remove(r)},"remove"),removeAll:o(()=>{},"removeAll")});x(this,"Markers",{add:o((r,n,i)=>{let s=J8(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),b=i,{attachTo:l}=b,c=cs(b,["attachTo"]),p=c;c.rank==="initial"&&(p.rank="medium");let h=s.layers.get(qc),y=this.renderer.addMarker2D(cu(r),n,re(R({},p),{occluderId:s==null?void 0:s.occluderId,attachTo:l}),h==null?void 0:h.containerId);if(!y)throw new Ys("Failed to create Marker");return y},"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 s=this.renderer.getState(r),l=i?this.floorsById.get(i):this.currentFloor;if(!s){ce.error('Failed to retrieve state for Marker with id "'.concat(r,'".'));return}if(s.type!=="marker"){ce.error('Geometry with id "'.concat(r,'" is not of type "marker".'));return}this.renderer.setState(s,{position:n,parent:(c=l==null?void 0:l.layers.get(qc))==null?void 0:c.containerId})},"setPosition"),animateTo:o((r,n,i,s)=>{let l=this.renderer.getState(r),c=i?this.floorsById.get(i):this.currentFloor;if(!l)return ce.error('Failed to retrieve state for Marker with id "'.concat(r,'".')),Promise.resolve();if(l.type!=="marker")return ce.error('Geometry with id "'.concat(r,'" is not of type "marker".')),Promise.resolve();let p=R({duration:1e3,easing:"ease-in-out"},s);this.cancelAnimation(r);let h=new Va({lon:l.position[0],lat:l.position[1]}).to({lon:n[0],lat:n[1]},p.duration).easing(YAe[p.easing]).onUpdate(({lon:y,lat:b})=>{var C;if(!this.renderer.getState(r))this.cancelAnimation(r);else{let P=(C=c==null?void 0:c.layers.get(qc))==null?void 0:C.containerId;P&&this.Markers.setPosition(r,[y,b],P)}}).start();return this.renderer.getInternalTweenGroup().add(h),this.renderer.render(),this.animations.set(r,h),K8(h).then(()=>{this.animations.delete(r)})},"animateTo")});x(this,"Exporter",{getCurrentSceneGLTF:o(async r=>this.renderer.getCurrentSceneGLTF(r),"getCurrentSceneGLTF")});x(this,"Shapes",{add:o((r,n,i)=>{let s=i!=null&&i.floorId?this.floorsById.get(i==null?void 0:i.floorId):this.currentFloor,l="shape-"+xn();return this.renderer.addGeometryGroup(l,r,n,s.id),l},"add"),remove:o(r=>(this.renderer.remove(r.id),r.id),"remove")});x(this,"Text3D",{label:o((r,n,i)=>{var l;if(!((l=this.api.getMapDataInternal())!=null&&l.enterpriseMode)){ce.warn("Enterprise mode is not enabled, skipping label creation");return}let s=Boe(this.renderer,r,n,i);if(s)return{textInfo:s,target:r}},"label"),labelAll:o((r={})=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode))return ce.warn("Enterprise mode is not enabled, skipping label creation"),[];let n=this.api.getMapData();if(!n)return[];let i=[];return n.getByType("space").forEach(l=>{var c,p;if(l.locations[0]){let h=Boe(this.renderer,l,(p=(c=l.locations[0])==null?void 0:c.name)!=null?p:l.name,r);h&&i.push({textInfo:h,target:l})}}),i},"labelAll"),remove:o(r=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){ce.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(r),r},"remove")});x(this,"Labels",{all:o(({onCreate:r,labelOptions:n={}})=>{for(let i of Object.entries(this.mvf.space)){let[s,l]=i;l&&l.features.forEach(c=>{var E,w,O,D,A;let p=(E=this.api.getMapData())==null?void 0:E.getById("space",c.properties.id);if(!p)return;let h=(w=this.styleMap[c.properties.id])==null?void 0:w.showImage,y=(O=c.properties.details)==null?void 0:O.images,b=h&&((D=y==null?void 0:y[0])!=null&&D.url)?{icon:y[0].url}:{},_=R({marker:R(R({},b),(A=n.appearance)==null?void 0:A.marker)},n.appearance),P=(s?this.floorsById.get(s):this.currentFloor).layers.get(df);if(c.properties.center&&p.name!==""){let k=this.renderer.addLabel2D(c.properties.center,p.name,re(R({id:c.properties.id+"-label"},n),{appearance:_,rank:n.rank,attachTo:Kv(p)}),wo.is(p)?p.id:P==null?void 0:P.containerId);k&&r(k.id,p.name,p)}})}},"all"),add:o((r,n,i={})=>{let y=i,{attachTo:s}=y,l=cs(y,["attachTo"]),c=J8(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),p=c.layers.get(df),h=this.renderer.addLabel2D(cu(r),n,re(R({},l),{occluderId:c.occluderId,attachTo:s}),p==null?void 0:p.containerId);if(!h)throw new Ys("label creating failed");return h},"add"),remove:o(({entityId:r})=>{this.renderer.remove(r)},"remove"),removeAll:o(()=>{},"removeAll")});x(this,"Paths",{add:o((r,n)=>{var h;let i=(h=n==null?void 0:n.animateDrawing)!=null?h:!0,s=[],l=r[0].floorId||"root",c=0;for(let y of r){let{floorId:b="root",latitude:_,longitude:C}=y;b!==l&&(c++,l=b),s[c]==null&&s.push({floorId:b,coordinates:[]});let P=b===y.floorId?y:new St({longitude:C,latitude:_,floorId:b});s[c].coordinates.push(P)}let p=s.reduce((y,{floorId:b,coordinates:_},C)=>{if(C!==0){let E=s[C-1],w=E.coordinates[E.coordinates.length-1],O=_[0],D=cu(w),A=cu(O),k=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:E.floorId},geometry:{type:"Point",coordinates:D}},{type:"Feature",properties:{parentId:b},geometry:{type:"Point",coordinates:A}}]},n,this.id);k&&(n!=null&&n.animateDrawing&&this.renderer.setState(k.id,{completeFraction:0}),y.push(re(R({},k),{coordinates:[w,O]})))}let P=this.renderer.addPath({type:"FeatureCollection",features:_.map(E=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:cu(E)}}))},n,b);return P&&(n!=null&&n.animateDrawing&&this.renderer.setState(P.id,{completeFraction:0}),y.push(re(R({},P),{coordinates:_}))),y},[]);if(i){let y=[],b=this.api.getMapData();return p.forEach(_=>{var P;let C=$oe(_,b,this.api);y.push(new Va({fraction:0}).to({fraction:1},C===!1?0:(P=n==null?void 0:n.drawDuration)!=null?P:1500).onUpdate(E=>{this.renderer.setState(_.id,{completeFraction:E.fraction})}))}),y.forEach((_,C)=>{C<y.length-1&&_.chain(y[C+1]),this.renderer.getInternalTweenGroup().add(_)}),y[0].start(),this.renderer.render(),this.animations.set(p[0].id.toString(),y[0]),{paths:p,animation:K8(y[y.length-1]).then(()=>{this.animations.delete(p[0].id.toString())})}}else return{paths:p,animation:Promise.resolve()}},"add"),remove:o(r=>{r.forEach(n=>{this.cancelAnimation(n),this.renderer.remove(n)})},"remove")});G(this,Lp,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=s.core,this.api=s,this.id=r,this.renderer.addGroupContainer(r,{},"root"),this.options=i!=null?i:{},this.StackedMaps=new d_({currentMapGetter:o(()=>this,"currentMapGetter")}),this.mvf=(h=n==null?void 0:n.mvf)!=null?h:{};let l=joe(this.mvf["styles.json"]||{});if(this.styleMap=l,q(this,Lp,R({enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0},i==null?void 0:i.multiFloorView)),!n){this.id!=="outdoors-container"&&ce.warn("Map (".concat(this.id,") created with no data."));let C=new x_({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 P=new f_(C.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,d(this,Lp),i!=null?i:{});C.addFloor(P),this.floorsById.set(P.id,P),this.setFloor(P.id);return}let c=n.getMVFFeatureByType("floor-stack");if(c==null||c.length===0)throw new Ys("MVF does not contain any Floor Stacks.");for(let C of c){let P=new x_(C,this.id,this.renderer,(y=this.mvf.facade)==null?void 0:y[C.id]);if(P.floorIds.length!==0){for(let E of P.floorIds){let w=n.getMVFFeatureById("floor",E);if(w!=null){let O=this.mvf.space[w.id],D=this.mvf.obstruction[w.id];if((O==null||O.features.length===0)&&(D==null||D.features.length===0))continue;let A=new f_(P.id,w,this.renderer,d(this,Lp),i!=null?i:{},this.mvf,l,n);P.addFloor(A),this.floorsById.set(A.id,A)}}this.floorStacksById.set(C.id,P),this.currentFloorStackId||(this.currentFloorStackId=C.id)}}for(let[C]of Object.entries(n.facadesBySpaceId)){let P=n.getById("space",C);P&&(this.outdoorFloorStacks.add(P.floor.floorStack.id),(b=this.floorsById.get(P.floor.id))==null||b.setVisible(!0))}let p=(_=this.mvf.enterprise)==null?void 0:_.venue.defaultMap;if(i!=null&&i.initialFloor){let C=$b(i.initialFloor);C&&this.floorsById.has(C)?p=C:ce.error("Invalid initial floor specified (".concat(i.initialFloor,"), using default behavior instead"))}p||(p=this.currentFloorStack.defaultFloor.id),this.startingFloorId=p}get currentFloorStack(){let r=this.floorStacksById.get(this.currentFloorStackId);if(!r)throw new Ys('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){ce.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){ce.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 Ys('Floor with id "'.concat(this.currentFloorId,'" not found'));return r}get floors(){return Array.from(this.floorsById.values())}processFloorChange(r){var s,l,c,p,h;if(this.api.manualFloorVisibility===!0||this.StackedMaps.expandedFactor!==0)return;let n=this.floorsById.get(r),i=this.floorStacksById.get(this.currentFloorStackId);if(n&&i)if(!((s=d(this,Lp))!=null&&s.enabled)||n.floorStackId!==(i==null?void 0:i.id))for(let y of this.floorStacksById.values())y.floorObjects.forEach(b=>{b.id!==r&&b.setVisible(!1)});else{let y=Roe(this.currentFloorStack.floorObjects,n,d(this,Lp).floorHeight,((c=(l=this.api.Navigation)==null?void 0:l.floors)==null?void 0:c.map(b=>b.id))||[]);(h=(p=this.api)==null?void 0:p.Outdoor)==null||h.setOpacity(y.outdoorOpacity),y.floorStates.forEach(b=>{var _;if(b.floor){let C=(_=this.api.getMapData())==null?void 0:_.getById("floor",b.floor.id);C&&this.api.updateState(C,b.state)}}),d(this,Lp).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*d(this,Lp).floorHeight)}}setFloor(r,n){if(this.currentFloorId===r)return;if(!this.floorsById.get(r)){ce.error("Invalid floor passed to setFloor (".concat(r,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let s=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:s,floorId:r,reason:n}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.processFloorChange(r),this.currentFloorId=r,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.publish("floor-change",{reason:n,floorId:this.currentFloor.id,previousFloorId:s})}cancelAnimation(r){let n=this.animations.get(r);n&&(n.stop(),this.animations.delete(r),this.renderer.getInternalTweenGroup().remove(n))}};Lp=new WeakMap,o(Q8,"GeojsonApiMapObject");var I_=Q8;function Boe(e,t,r,n){return e.labelText3D(t.id,r!=null?r:t.name,re(R({},n),{parentId:t.floor.id}))}o(Boe,"labelSpace");g();var cc,S_,eF=class eF{constructor({currentMapGetter:t}){G(this,cc,new Map);G(this,S_);q(this,S_,t)}get currentMap(){return d(this,S_).call(this)}getById(t){return d(this,cc).get(t)}add(t,r,n){let i=t.anchorTarget;if(!i)throw new Error("get coordinate failed");let s=this.currentMap;if(!s)throw new Error("currentMap should exist");let l=s.Markers.add(i,r,re(R({},n),{rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(n==null?void 0:n.dynamicResize)||!1,attachTo:Kv(t)}));if(l==null)throw new Error("error creating marker");let c=s.Markers.getContentEl(l.id.toString());if(!c)throw new Error("marker component should exist");let p=new rd(l.id.toString(),c,t);return d(this,cc).set(p.id,{marker:p,entityId:l.id.toString()}),p}remove(t){var n;let r=d(this,cc).get(t.id);r&&((n=this.currentMap)==null||n.Markers.remove(r.entityId),d(this,cc).delete(t.id.toString()))}removeAll(){let t=[];return d(this,cc).forEach(({marker:r})=>{this.remove(r),t.push(r),d(this,cc).delete(r.id.toString())}),t}setPosition(t,r){var l;let n=r.anchorTarget;if(!n){ce.error("Cannot determine coordinate from target.");return}let i=this.currentMap;if(!i){ce.error("Cannot determine the current map.");return}let s=d(this,cc).get(t.id);if(!s){ce.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}i.Markers.setPosition(s.entityId,cu(n),(l=n.floorId)!=null?l:i.currentFloorId),s.marker.updateTarget(r)}animateTo(t,r,n){var c;let i=r.anchorTarget;if(!i)return ce.error("Cannot determine coordinate from target."),Promise.resolve();let s=this.currentMap;if(!s)return ce.error("Cannot determine the current map."),Promise.resolve();let l=d(this,cc).get(t.id);return l?(l.marker.updateTarget(r),s.Markers.animateTo(l.entityId,cu(i),(c=i.floorId)!=null?c:s.currentFloorId,n)):(ce.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};cc=new WeakMap,S_=new WeakMap,o(eF,"Markers");var __=eF;g();var cd,w_,tF=class tF{constructor({currentMapGetter:t}){G(this,cd,new Map);G(this,w_);q(this,w_,t)}get currentMap(){return d(this,w_).call(this)}getById(t){return d(this,cd).get(t)}add(t,r,n){var p;let i=t.anchorTarget;if(!i)throw new Error("Target does not implement IAnchorable.");let s=this.currentMap;if(!s)throw new Error("currentMap should exist");let l=s.Images.add(cu(i),r,re(R({},n),{floorId:i.floorId,verticalOffset:i.verticalOffset+((p=n.verticalOffset)!=null?p:0)}));if(!l)throw new Error("image component should exist");let c=new e_(l.id.toString(),r,t);return d(this,cd).set(c.id,{image:c,entityId:l.id.toString()}),c}remove(t){var n;let r=d(this,cd).get(t.id);r&&((n=this.currentMap)==null||n.Images.remove(r.entityId),d(this,cd).delete(t.id.toString()))}removeAll(){let t=[];return d(this,cd).forEach(({image:r})=>{this.remove(r),t.push(r),d(this,cd).delete(r.id.toString())}),t}};cd=new WeakMap,w_=new WeakMap,o(tF,"Images");var C_=tF;g();var Ap,T_,rF=class rF{constructor({currentMapGetter:t}){G(this,Ap,new Map);G(this,T_);q(this,T_,t)}get currentMap(){return d(this,T_).call(this)}getById(t){return d(this,Ap).get(t)}add(t,r,n){let i=[t],s=i.reduce((p,h)=>{var y;return h?(p.has(h.floorId)||p.set(h.floorId,[]),(y=p.get(h.floorId))==null||y.push(h),p):(ce.error("Cannot determine coordinate from options."),p)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let l=this.currentMap;if(!l)throw new Error("currentMap should exist");let c=[];return s.forEach((p,h)=>{let y=xn();l.Models.add(y,p,re(R({},n),{url:r,floorId:h})).forEach(({id:_})=>{let C=new wy(_.toString(),y,p[0]);d(this,Ap).set(C.id,{model:C,entityId:_.toString(),groupId:y}),c.push(C)})}),c[0]}remove(t){var n;let r=d(this,Ap).get(t.id);r&&((n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),d(this,Ap).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Ap).forEach(({model:r})=>{var i;let n=d(this,Ap).get(r.id);n&&(t.push(r),(i=this.currentMap)==null||i.Models.remove(n.entityId,n.groupId),d(this,Ap).delete(r.id.toString()))}),t}};Ap=new WeakMap,T_=new WeakMap,o(rF,"Models");var P_=rF;g();var Dp,M_,nF=class nF{constructor({currentMapGetter:t}){G(this,Dp,new Map);G(this,M_);q(this,M_,t)}get currentMap(){return d(this,M_).call(this)}getById(t){return d(this,Dp).get(t)}add(t,r){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let i=n.Paths.add(t,r),s=i.paths.map(c=>c.id.toString()),l=new oc(xn(),i.animation,t,i.paths);for(let c of s)d(this,Dp).set(c,{path:l,entityIds:s});return d(this,Dp).set(l.id,{path:l,entityIds:s}),l}remove(t){var n;let r=d(this,Dp).get(t.id);r&&((n=this.currentMap)==null||n.Paths.remove(r.entityIds),d(this,Dp).delete(t.id),r.entityIds.forEach(i=>d(this,Dp).delete(i)))}removeAll(){let t=[];return d(this,Dp).forEach(({path:r})=>{this.remove(r),t.push(r)}),t}};Dp=new WeakMap,M_=new WeakMap,o(nF,"Paths");var E_=nF;g();var Joe=Pn(B7(),1);g();var iF="#2266ff",ZAe="#808080",Goe="#f5f5f5";var Uoe={radius:10,color:iF,inactiveColor:ZAe,heading:{color:iF,opacity:.7},accuracyRing:{color:iF,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};g();var Voe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";g();var zoe=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),s=i+t,l=10,c=new Tc;c.moveTo(-i*Math.sin(e/2),i*Math.cos(e/2)-n);for(let p=0;p<l;p++)c.lineTo(-(s*Math.sin(e/2-e/l*p)),s*Math.cos(e/2-e/l*p)-n);for(let p=0;p<l;p++)c.lineTo(-(r*Math.sin(Math.PI/-2+Math.PI/l*p)),r*Math.cos(Math.PI/-2+Math.PI/l*p));return new Ec(c,{depth:.1,bevelEnabled:!1,UVGenerator:JAe(t)})},"createSectorGeometry"),oF=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 wt(0,i)},"generateRadialUV"),JAe=o(e=>({generateTopUV:o((t,r,n,i,s)=>{let l=r[n*3],c=r[n*3+1],p=r[i*3],h=r[i*3+1],y=r[s*3],b=r[s*3+1];return[oF(l,c,e),oF(p,h,e),oF(y,b,e)]},"generateTopUV"),generateSideWallUV:o(()=>[new wt(0,1),new wt(0,1),new wt(0,1),new wt(0,1)],"generateSideWallUV")}),"radialUVGenerator");function qoe(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(qoe,"getPositionWithOverrides");function QAe([e,t],[r,n],[i,s]){let l=r-e,c=n-t,p=l**2+c**2;if(p===0)return;let h=((i-e)*l+(s-t)*c)/p,y;h<=0?y=[e,t]:h>=1?y=[r,n]:y=[e+h*l,t+h*c];let b=mS([i,s],y);return{proportion:Math.max(0,Math.min(1,h)),intersection:y,distance:b}}o(QAe,"getPointLineIntersection");function Hoe(e,t){if(e==null||e.length<2)return;let r=Number.MAX_SAFE_INTEGER,n,i=0,s=0;for(let l=0;l<e.length-1;l++){let c=e[l],p=e[l+1],h=QAe(c,p,t);h!=null&&h.distance<r&&(r=h.distance,n=h.intersection,i=l,s=h.proportion)}if(n)return{intersection:n,distance:r,segmentIndex:i,proportion:s}}o(Hoe,"findBlueDotOnPath");function Woe(e,t){let r=new Pu({color:e,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,i=.35*4,s=zoe(Math.PI/6,i,n);new s0().load(Voe,c=>{r.alphaMap=c,r.needsUpdate=!0});let l=new $t(s,r);return l.position.z=-.05,l.renderOrder=0,l}o(Woe,"createHeadingCone");function Xoe(e,t){let r=new pS(1,1,.05,32),n=new Pu({transparent:!0,color:e,opacity:t,depthTest:!1,depthWrite:!1}),i=new $t(r,n);return i.scale.set(0,0,.05),i.renderOrder=1,i.rotation.x=Math.PI/2,i}o(Xoe,"createAccuracyRing");function Yoe(e){let t=new pS(.35,.35,.07,32),r=new Pu({transparent:!0,color:Goe,depthTest:!1,depthWrite:!1}),n=new $t(t,r);n.renderOrder=2;let i=new pS(.35*.8,.35*.8,.01,32),s=new Pu({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),l=new $t(i,s);return l.renderOrder=3,n.rotation.x=Math.PI/2,n.position.z=.07/2,l.rotation.x=Math.PI/2,l.position.z=.07,{outerMesh:n,innerMesh:l}}o(Yoe,"createBlueDot");var Qoe=Pn(Zoe(),1);var tE="blue-dot",Dy,pd,vl,bl,fd,Fy,Ny,ky,eo,Wa,O_,dd,L_,A_,D_,F_,QT,Fp,hd,eE,Ry,N_,Np,sF=class sF extends Lt{constructor(r,n){super();this.core=r;this.geoJSONApi=n;G(this,Dy,null);x(this,"geometry");G(this,pd);G(this,vl);G(this,bl);G(this,fd);G(this,Fy);G(this,Ny);G(this,ky);G(this,eo,Uoe);G(this,Wa,1);G(this,O_);G(this,dd);x(this,"state","disabled");x(this,"following",!1);G(this,L_,o(r=>{var n;return(n=this.geoJSONApi.getMapData())==null?void 0:n.getById("floor",r)},"#getFloorByFloorId"));G(this,A_,o(r=>{var i;let n;if(r!=null){let s=(i=this.geoJSONApi.currentMap)==null?void 0:i.currentFloorStack.floorObjectsByElevation.get(r);n=s?d(this,L_).call(this,s.id):void 0}return n},"#getFloorByFloorLevel"));G(this,D_,o(r=>{if(this.state==="hidden"||this.state==="disabled")return;let[n,i,s,l]=r.children;if(d(this,QT).call(this),i.scale.set(d(this,Wa),d(this,Wa),d(this,Wa)),i.position.z=.07/2*d(this,Wa),s.scale.set(d(this,Wa),d(this,Wa),d(this,Wa)),s.position.z=.07*d(this,Wa),this.state==="active"){s.material.color.set(d(this,eo).color);let c=this.accuracy;c!=null?(n.visible=!0,d(this,Ny)&&d(this,Ny).stop(),q(this,Ny,new Va({scale:n.scale.x}).to({scale:c/2},150).onUpdate(({scale:h})=>{n.scale.set(h,1,h)}).start()),this.core.getInternalTweenGroup().add(d(this,Ny))):n.visible=!1;let p=this.heading;if(p!=null){l.visible=!0,d(this,ky)&&d(this,ky).stop();let{start:h,end:y}=gS(l.rotation.z,-Yt.degToRad(p));q(this,ky,new Va({rotation:h}).to({rotation:y},150).onUpdate(({rotation:b})=>{l.rotation.z=b}).start()),this.core.getInternalTweenGroup().add(d(this,ky)),l.scale.set(d(this,Wa),d(this,Wa),1)}else l.visible=!1}else this.state==="inactive"&&(s.material.color.set(d(this,eo).inactiveColor),l.visible=!1,n.visible=!1)},"#updateGeometryPerFrame"));G(this,F_,o(r=>{var l,c;let n;try{n=i9e.parse(qoe(r,d(this,vl)))}catch(p){d(this,Fp).call(this,"error"),ce.error("BlueDot: Position parse failed",p instanceof ae.ZodError?p.message:String(p)),this.publish("error");return}d(this,eo).debug&&ce.log("BlueDot: Parsed position",n),q(this,bl,n),d(this,Fp).call(this,"position-update"),d(this,fd)&&clearTimeout(d(this,fd)),typeof d(this,eo).timeout=="number"&&d(this,eo).timeout<1/0&&q(this,fd,setTimeout(()=>{d(this,eo).debug&&ce.log("BlueDot: Position timed out after ".concat(d(this,eo).timeout,"ms")),d(this,Fp).call(this,"timeout"),this.core.render()},d(this,eo).timeout)),(c=this.geoJSONApi.getMapDataInternal())==null||c.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:n.latitude,longitude:n.longitude,floorLevel:(l=n.floor)==null?void 0:l.elevation,accuracy:n.accuracy}});let i=n.floor!=null?n.floor.id:this.geoJSONApi.currentFloor.id||"outdoors-container",s=[n.longitude,n.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(tE,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:s}},{setup:o(p=>{let h=Xoe(d(this,eo).accuracyRing.color,d(this,eo).accuracyRing.opacity),{outerMesh:y,innerMesh:b}=Yoe(d(this,eo).color),_=Woe(d(this,eo).heading.color,d(this,eo).heading.opacity);p.add(h),h.visible=!1,p.add(y),p.add(b),p.add(_),_.visible=!1,d(this,D_).call(this,p)},"setup"),update:d(this,D_)},{visible:!0,interactive:!0},i);else{let p=this.core.getState(this.geometry);s=[p.position[0],p.position[1]]}d(this,Fy)&&d(this,Fy).stop(),q(this,Fy,new Va(s).to([n.longitude,n.latitude],1e3).easing(Qi.Cubic.Out).onUpdate(p=>{if(this.geometry){let h={position:[p[0],p[1]]};h.parent=i,this.core.setState(this.geometry,h)}}).start()),this.core.getInternalTweenGroup().add(d(this,Fy)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));x(this,"onPositionUpdate",o(r=>{var n,i,s,l,c;if(this.state!=="disabled"){try{n9e.parse(r)}catch(p){d(this,Fp).call(this,"error"),ce.error("BlueDot: Browser sent invalid position",p instanceof ae.ZodError?p.message:String(p)),this.publish("error");return}q(this,pd,{latitude:(n=r.coords)==null?void 0:n.latitude,longitude:(i=r.coords)==null?void 0:i.longitude,accuracy:(s=r.coords)==null?void 0:s.accuracy,heading:(l=r.coords)==null?void 0:l.heading,floor:d(this,A_).call(this,(c=r.coords)==null?void 0:c.floorLevel)}),d(this,F_).call(this,d(this,pd))}},"onPositionUpdate"));x(this,"onPositionError",o(r=>{var n;switch(d(this,Fp).call(this,"error"),r.code){case r.PERMISSION_DENIED:ce.error("Geolocation permission denied by the user.",r),(n=this.geoJSONApi.getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case r.POSITION_UNAVAILABLE:ce.error("Geolocation position unavailable.",r);break;case r.TIMEOUT:ce.error("Geolocation request timed out.",r);break;default:ce.error("An unknown geolocation error occurred.",r);break}this.publish("error",r)},"onPositionError"));G(this,QT,o(()=>{var n;let r=Math.round(this.core.camera.zoomLevel*1e5);if(r!==d(this,O_)){q(this,O_,r);let i=(n=this.core.getMetresPerPixel())!=null?n:1;q(this,Wa,Math.max(d(this,eo).radius/(.35/i),1))}},"#updateScale"));G(this,Fp,o(r=>{let n=r9e[this.state].actions[r];if(n){switch(d(this,eo).debug&&ce.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(n," using ").concat(r)),n){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==n&&(this.publish("state-change",{state:n,action:r}),this.state=n)}else ce.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(r))},"#transitionAction"));G(this,hd);G(this,eE,o(()=>{if(d(this,hd)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let n=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(i=>i.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(i=>i.floorId===this.geoJSONApi.currentFloor.id);q(this,hd,(0,Qoe.default)(n.map(i=>({x:i.longitude,y:i.latitude})),1e-5).map(i=>[i.x,i.y]))}return d(this,hd)},"#getSimplifiedDirections"));G(this,Ry,o(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),d(this,Np)&&(this.off("position-update",d(this,Np)),q(this,Np,void 0)),this.following=!1,q(this,hd,void 0),this.core.off("user-interaction-start",d(this,Ry)),this.geoJSONApi.currentMap.off("navigation-active-path-change",d(this,N_)),this.publish("follow-change",{following:!1})},"#cancelFollow"));G(this,N_,o(()=>{q(this,hd,void 0)},"#pathChangeHandler"));G(this,Np);x(this,"follow",o((r,n)=>{var s,l,c,p;if(r===!1){d(this,Ry).call(this);return}r!=="position-only"&&(n==null?void 0:n.bearing)!=null&&ce.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:(s=n==null?void 0:n.zoomLevel)!=null?s:21,bearing:r==="position-only"?n==null?void 0:n.bearing:void 0,pitch:(l=n==null?void 0:n.pitch)!=null?l:45,duration:(c=n==null?void 0:n.duration)!=null?c:1e3,easing:(p=n==null?void 0:n.easing)!=null?p:"ease-in-out"};this.following?d(this,Np)&&this.off("position-update",d(this,Np)):(this.following=!0,this.core.on("user-interaction-start",d(this,Ry)),this.geoJSONApi.currentMap.on("navigation-active-path-change",d(this,N_))),q(this,Np,h=>{let{coordinate:y,heading:b,floor:_}=h;if(i.center=[y.longitude,y.latitude],_!=null&&_.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(_.id),q(this,hd,void 0)),r==="position-and-heading")i.bearing=b!=null?b:void 0;else if(r==="position-and-path-direction"){let C=d(this,eE).call(this);if(C!=null){let P=Hoe(C,[y.longitude,y.latitude]);if(P!=null){let E=C[P.segmentIndex],w=C[P.segmentIndex+1];i.bearing=qN(E,w)}}}this.core.camera.animateTo(i)}),this.on("position-update",d(this,Np)),this.publish("follow-change",{following:!0,mode:r})},"follow"))}get heading(){var r;return(r=d(this,bl))==null?void 0:r.heading}get accuracy(){var r;return(r=d(this,bl))==null?void 0:r.accuracy}get coordinate(){var r,n;if(d(this,bl)!=null)return(d(this,dd)==null||((r=this.floor)==null?void 0:r.id)!==d(this,dd).floorId||d(this,bl).latitude!==d(this,dd).latitude||d(this,bl).longitude!==d(this,dd).longitude)&&q(this,dd,new St(d(this,bl).latitude,d(this,bl).longitude,(n=this.floor)==null?void 0:n.id)),d(this,dd)}get floor(){var r;return(r=d(this,bl))==null?void 0:r.floor}enable(r){q(this,eo,(0,Joe.default)({},r,d(this,eo))),d(this,Fp).call(this,"enable"),this.watchDevicePosition(d(this,eo).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),d(this,fd)&&(clearTimeout(d(this,fd)),q(this,fd,void 0)),this.following&&d(this,Ry).call(this),this.watchDevicePosition(!1),q(this,bl,void 0),q(this,vl,void 0),d(this,Fp).call(this,"disable")}watchDevicePosition(r){if(d(this,Dy)&&(navigator.geolocation.clearWatch(d(this,Dy)),q(this,Dy,null)),d(this,pd)&&q(this,pd,void 0),r){if(this.state==="disabled"){ce.warn("BlueDot must be enabled before watching browser position.");return}q(this,Dy,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(r){var i,s;r==null?q(this,vl,void 0):"coords"in r?q(this,vl,Object.assign({},d(this,vl),{latitude:r.coords.latitude,longitude:r.coords.longitude,accuracy:r.coords.accuracy,heading:r.coords.heading,floor:d(this,A_).call(this,r.coords.floorLevel)})):(q(this,vl,Object.assign({},d(this,vl),r)),"floorOrFloorId"in r&&(d(this,vl).floor=typeof r.floorOrFloorId=="string"&&r.floorOrFloorId!=="device"?d(this,L_).call(this,r.floorOrFloorId):r.floorOrFloorId)),(((i=d(this,vl))==null?void 0:i.latitude)!=null&&((s=d(this,vl))==null?void 0:s.longitude)!=null||d(this,pd)!=null)&&d(this,F_).call(this,d(this,pd))}};Dy=new WeakMap,pd=new WeakMap,vl=new WeakMap,bl=new WeakMap,fd=new WeakMap,Fy=new WeakMap,Ny=new WeakMap,ky=new WeakMap,eo=new WeakMap,Wa=new WeakMap,O_=new WeakMap,dd=new WeakMap,L_=new WeakMap,A_=new WeakMap,D_=new WeakMap,F_=new WeakMap,QT=new WeakMap,Fp=new WeakMap,hd=new WeakMap,eE=new WeakMap,Ry=new WeakMap,N_=new WeakMap,Np=new WeakMap,o(sF,"BlueDot");var nb=sF,r9e={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"}}},n9e=ae.object({coords:ae.object({latitude:ae.number(),longitude:ae.number(),accuracy:ae.number(),altitude:ae.number().optional().nullable(),altitudeAccuracy:ae.number().optional().nullable(),heading:ae.number().optional().nullable(),speed:ae.number().optional().nullable(),floorLevel:ae.number().optional().nullable()}),timestamp:ae.number()}),i9e=ae.object({latitude:ae.number(),longitude:ae.number(),floor:ae.custom().optional(),accuracy:ae.number().optional(),heading:ae.number().optional().nullable()});g();var md,R_,aF=class aF{constructor({currentMapGetter:t}){G(this,md,new Map);G(this,R_);q(this,R_,t)}get currentMap(){return d(this,R_).call(this)}getById(t){return d(this,md).get(t)}add(t,r,n){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let s=i.Shapes.add(t,r||{},{floorId:n==null?void 0:n.id}),l=new nd(s);return d(this,md).set(l.id,l),l}remove(t){var n;d(this,md).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),d(this,md).delete(t.id.toString()))}removeAll(){let t=[];return d(this,md).forEach(r=>{this.remove(r),t.push(r.id),d(this,md).delete(r.id.toString())}),t}};md=new WeakMap,R_=new WeakMap,o(aF,"Shapes");var k_=aF;g();var j_,lF=class lF{constructor({currentMapGetter:t}){G(this,j_);q(this,j_,t)}get currentMap(){return d(this,j_).call(this)}setFromStyleCollection(t){var r,n,i,s;for(let l in t)for(let c of((r=this.currentMap)==null?void 0:r.floors)||[]){if(t[l]==null||!c.layers.has(Zi))continue;let p=c.layers.get(Zi);if(p!=null&&p.layers.has(l)&&"color"in t[l]){let b=p.layers.get(l);b&&((n=this.currentMap)==null||n.renderer.setState(b,{color:t[l].color}))}if(p&&l===Xd&&!(zc in t)){let b=p.layers.get(zc);b&&"color"in t[l]&&((i=this.currentMap)==null||i.renderer.setState(b,{color:t[l].color}))}if(!c.layers.has(Vm))continue;let h=c.layers.get(Vm),y=c.facadesByStyleId.get(l);if(y&&y.length>0)for(let b of y){let _=h.layers.get("".concat(b,"-").concat(l));_&&"color"in t[l]&&((s=this.currentMap)==null||s.renderer.setState(_,{color:t[l].color}))}}}};j_=new WeakMap,o(lF,"Style");var B_=lF;g();var uF={opacity:1},Zs,$_,G_,Hh,gd,By,cF,ese,pF=class pF{constructor(t,r){G(this,By);G(this,Zs);G(this,$_,[]);G(this,G_,{opacity:"initial"});G(this,Hh,{opacity:new Map});G(this,gd,new Set);q(this,Zs,t),q(this,$_,r||[]);let n=d(this,Zs).map;n&&n.on("idle",()=>{d(this,Hh).opacity.size||ke(this,By,cF).call(this,n)})}setStyle(t){var r,n;if(d(this,Zs).map){(r=d(this,Zs).map)==null||r.setStyle(t),d(this,gd).size&&(d(this,gd).clear(),this.hide()),ke(this,By,ese).call(this),ke(this,By,cF).call(this,d(this,Zs).map),this.setOpacity(d(this,G_).opacity),(n=d(this,Zs).map)==null||n.moveLayer(AE);for(let[i,s,l]of d(this,$_)||[])d(this,Zs).hideOutdoorLayersIntersectingPolygons(i,s,l)}}get map(){return d(this,Zs).map}get enabled(){return!!d(this,Zs).map}get visible(){return d(this,gd).size===0}show(){let t=d(this,Zs).map;if(!t)return;let r=t.getStyle().layers;r&&(r.forEach(n=>{d(this,gd).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),d(this,gd).clear())}hide(t=[]){let r=d(this,Zs).map;if(!r)return;let n=r.getStyle().layers;n&&n.forEach(i=>{let s=r.getLayoutProperty(i.id,"visibility");!t.includes(i.id)&&s!=="none"&&(r.setLayoutProperty(i.id,"visibility","none"),d(this,gd).add(i.id))})}setOpacity(t,r=[]){var s,l;let n=d(this,Zs).map;if(!n)return;let i=(l=(s=d(this,Zs).map)==null?void 0:s.getStyle())==null?void 0:l.layers;i&&n.once("idle",()=>{i.forEach(c=>{let p=n.getLayoutProperty(c.id,"visibility");if(!r.includes(c.id)&&p!=="none")try{let h=d(this,Hh).opacity.get(c.id);h!==void 0&&(c.id==="background"||(c.type==="symbol"?(n.setPaintProperty(c.id,"icon-opacity",t==="initial"?h[0]:t),n.setPaintProperty(c.id,"text-opacity",t==="initial"?h[1]:t)):n.setPaintProperty(c.id,"".concat(c.type,"-opacity"),t==="initial"?h[0]:t)),d(this,G_).opacity=t)}catch(h){ce.warn("Error setting opacity:",h)}})})}};Zs=new WeakMap,$_=new WeakMap,G_=new WeakMap,Hh=new WeakMap,gd=new WeakMap,By=new WeakSet,cF=o(function(t){let r=t.getStyle().layers;r&&r.forEach(n=>{var s,l,c;t.getLayoutProperty(n.id,"visibility")!=="none"&&(n.id==="background"||(n.type==="symbol"?d(this,Hh).opacity.set(n.id,[(s=t.getPaintProperty(n.id,"icon-opacity"))!=null?s:uF.opacity,(l=t.getPaintProperty(n.id,"text-opacity"))!=null?l:uF.opacity]):d(this,Hh).opacity.set(n.id,[(c=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?c:uF.opacity,void 0])))})},"#setInitialStyle"),ese=o(function(){Object.values(d(this,Hh)).forEach(t=>t.clear())},"#clearInitialStyle"),o(pF,"Outdoor");var ib=pF;g();function tse(){z7(!1)}o(tse,"disableText3DWorker");var yd,vd,Wh,fF=class fF{constructor({currentMapGetter:t}){G(this,yd);G(this,vd,new Map);G(this,Wh,new Map);q(this,yd,t)}labelAll(t={}){var i,s;let r=[],n=new Set;return(s=(i=d(this,yd).call(this))==null?void 0:i.Text3D.labelAll(t))==null||s.forEach(({textInfo:l,target:c})=>{let p=l.id.toString(),h=d(this,Wh).get(p);if(h){n.has(p)||r.push(h.text3DView),n.add(p);return}n.add(p);let y=new jh(p,c);d(this,vd).set(y.id,{targetId:c.id,text3d:p,text3DView:y}),d(this,Wh).set(p,{text3DView:y}),r.push(y)}),r}label(t,r,n={}){var s;if(d(this,yd).call(this))if(wo.is(t)){let l=(s=d(this,yd).call(this))==null?void 0:s.Text3D.label(t,r,n);if(!l)return;let c=l.textInfo.id.toString(),p=d(this,Wh).get(c);if(p)return p.text3DView;let h=new jh(c,l.target);return d(this,vd).set(h.id,{targetId:l.target.id,text3d:c,text3DView:h}),d(this,Wh).set(c,{text3DView:h}),h}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,vd).get(r);n&&((i=d(this,yd).call(this))==null||i.Text3D.remove(n.text3d),d(this,vd).delete(r),d(this,Wh).delete(n.text3d))}removeAll(){d(this,vd).forEach(t=>{var r;(r=d(this,yd).call(this))==null||r.Text3D.remove(t.text3d)}),d(this,vd).clear()}};yd=new WeakMap,vd=new WeakMap,Wh=new WeakMap,o(fF,"Text3D");var rE=fF;var nE=.05,hF=class hF{constructor(t,r){x(this,"core");x(this,"mapObjects",[]);x(this,"id");x(this,"mapDataExternal",{});x(this,"mapsByFloorId",{});x(this,"mapData");x(this,"currentMap");x(this,"hiddenOutdoorGeometries",[]);x(this,"lastFacadeIntersected");x(this,"manualFloorVisibility",!1);x(this,"mapView");x(this,"Camera");x(this,"Labels");x(this,"Text3D");x(this,"Markers");x(this,"Models");x(this,"Paths");x(this,"Exporter");x(this,"Navigation");x(this,"Outdoor");x(this,"BlueDot");x(this,"Shapes");x(this,"Style");x(this,"Images");x(this,"update",o(()=>{this.core.render()},"update"));this.core=t,this.mapView=r,this.Camera=new a_(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new I_("outdoors-container",void 0,void 0,this);this.mapObjects.push(n),this.currentMap=n,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")}),this.core.on("resize",()=>{this.mapView.publish("resize")}),this.core.on("geometry-in-focus",p=>{this.mapView.publish("facades-in-view-change",{facades:p.map(h=>{var y;return(y=this.getMapDataInternal())==null?void 0:y.facadesById[h]}).filter(h=>h!=null)})});let i=new n_(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",i)});let s=o(p=>h=>{let y=[],b=[],_=[],C=[];h.labels.forEach(W=>{let Y=this.Labels.getById(W.toString());Y&&y.push(Y.label)}),h.markers.forEach(W=>{let Y=this.Markers.getById(W.toString())||this.Navigation.getMarkerById(W.toString());Y&&b.push(Y.marker)}),h.models.forEach(W=>{let Y=this.Models.getById(W.toString());Y&&_.push(Y.model)}),h.paths.forEach(W=>{let Y=this.Paths.getById(W.toString())||this.Navigation.getPathById(W.toString());Y&&C.push(Y.path)});let P=h.geometry.includes(tE),E=h.geometry.filter(W=>W!==tE),w;E.length>0&&(w=E.map(W=>{var Y;return(Y=this.getMapDataInternal())==null?void 0:Y.getById("space",W)}).filter(Boolean)[0],w||(w=E.map(W=>{var Y;return(Y=this.getMapDataInternal())==null?void 0:Y.getById("object",W)}).filter(Boolean)[0]),w||(w=E.map(W=>this.Shapes.getById(W)).filter(Boolean)[0]));let O=h.containers.reduce((W,Y)=>{var Z;let N=(Z=this.getMapDataInternal())==null?void 0:Z.getById("floor",Y);return N&&ca.is(N)&&W.push(N),W},[]),D,A=0;if(O.length>0){D=O[0].id;let W=this.core.getState(D);A=h.coordinate[2]?h.coordinate[2]-W.altitude:A}let k;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(W=>{this.core.setState(W.id,{hovered:!1})}),w&&wo.is(w)&&(k=E.map(W=>{var Y;return(Y=this.getMapDataInternal())==null?void 0:Y.facadesBySpaceId[W]}).filter(Boolean)[0],k&&k.spaces.forEach(W=>{this.core.setState(W.id,{hovered:!0})})),this.lastFacadeIntersected=k;let j={coordinate:new St({latitude:h.coordinate[1],longitude:h.coordinate[0],floorId:D,verticalOffset:A}),spaces:w&&wo.is(w)?[w]:[],objects:w&&Oa.is(w)?[w]:[],shapes:w&&nd.is(w)?[w]:[],markers:b,labels:y,models:_,paths:C,blueDot:P,floors:O,facades:k?[k]:[]};"pointerEvent"in h&&(j.pointerEvent=h.pointerEvent),this.mapView.publish(p,j)},"createHandler");this.core.on("hover",s("hover")),this.core.on("click",s("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let l={currentMapGetter:o(()=>this.currentMap,"currentMapGetter")};this.Markers=new __(l),this.Models=new P_(l),this.Labels=new c_(l),this.Text3D=new rE(l),this.Exporter=new u_(l),this.Paths=new E_(l),this.Navigation=new o_(this.core,this,l.currentMapGetter),this.BlueDot=new nb(this.core,this),this.BlueDot.on("position-update",p=>{this.mapView.publish("blue-dot-position-update",p)}),this.BlueDot.on("state-change",p=>{this.mapView.publish("blue-dot-state-change",p)}),this.BlueDot.on("error",p=>{this.mapView.publish("blue-dot-error",p)}),this.BlueDot.on("follow-change",p=>{this.mapView.publish("blue-dot-follow-change",p)}),this.Outdoor=new ib(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{this.mapView.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{this.mapView.publish("outdoor-style-loaded")})),this.Images=new C_(l),this.Shapes=new k_(l),this.Style=new B_(l);let c=new XT(r,this.mapDataExternal);this.auto=c.auto}get StackedMaps(){return this.currentMap.StackedMaps}preloadFloors(t){t.forEach(r=>{r instanceof ca&&this.core.setState(r.id,{preloadGeometry:!0})})}updateState(t,r){if(t==="interior-walls"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(Xd);c&&this.core.setState(c,dF(r,this.core.getState(c)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(zc);c&&this.core.setState(c,dF(r,this.core.getState(c)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(G0);c&&this.core.setState(c,iE(r,this.core.getState(c)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(U0);c&&this.core.setState(c,iE(r,this.core.getState(c)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if(Rh.is(n))return this.core.setState(n.id,rse(re(R({},r),{type:"label"}),this.core.getState(n.id)));if(rd.is(n))return this.core.setState(n.id,nse(re(R({},r),{type:"marker"}),this.core.getState(n.id)));if(wo.is(n)||Oa.is(n)){let s=this.core.getState(n.id),l=s.parent&&s.parent.type==="geometry-group"?this.core.getState(s.parent):void 0;this.core.setState(n.id,ise(re(R({},r),{type:"geometry"}),s,l))}if(Au.is(n)&&this.core.setState(n.id,iE(re(R({},r),{type:"doors"}),this.core.getState(n.id))),nd.is(n)&&this.core.setState(n.id,il(r,["altitude","color","opacity","height","visible","interactive"])),wy.is(n)){let i=r,{position:s,scale:l}=i,p=cs(i,["position","scale"]);s&&(p.position=[s.longitude,s.latitude,s.verticalOffset]),l!=null&&(Array.isArray(l)?p.scale=l:p.scale=[l,l,l]),s&&n.updateTarget(s),this.core.setState(n.id,p)}if(ca.is(n)){let s=this.currentMap.floorsById.get(n.id);if(s==null)return;this.core.setState(n.id,il(r,["visible","altitude"]));let l=s.layers.get(Zi);l!=null&&"geometry"in r&&this.core.setState(l.containerId,il(r.geometry,["opacity","visible"]));let c=s.layers.get(df);c!=null&&"labels"in r&&"enabled"in r.labels&&typeof r.labels.enabled=="boolean"&&c.setVisible(r.labels.enabled);let p=s.layers.get(qc);p!=null&&"markers"in r&&"enabled"in r.markers&&typeof r.markers.enabled=="boolean"&&p.setVisible(r.markers.enabled);let h=s.layers.get(gx);h!=null&&"footprint"in r&&this.core.setState(h.containerId,il(r.footprint,["visible","height","opacity","side","color","altitude"]));let y=s.layers.get(V0);y!=null&&"occlusion"in r&&"enabled"in r.occlusion&&typeof r.occlusion.enabled=="boolean"&&y.setVisible(r.occlusion.enabled)}if(Nl.is(n)){let s=this.core.getState(n.id);for(let l of s.children)l.type==="group-container"&&this.core.setState(l.id,il(r,["opacity","visible"]))}if(jh.is(n)&&this.core.setState(n.id,il(r,B3)),oc.is(n))for(let s of n.segments)this.core.setState(s.id,il(r,["color","nearRadius","farRadius","visible","completeFraction"]));qv.is(n)&&this.core.setState(n.id,il(r,["color"]))}}getMapDataObject(t){var r;return(r=this.getMapDataInternal())==null?void 0:r.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return $I(this.mapData)}getMapData(){return this.mapData}addMap(t,r){return new Promise(n=>{var b,_,C,P;let i;try{i=$I(t)}catch(E){ce.error("Error adding map",E),n(t);return}this.mapDataExternal[t.mapName]=t,this.mapData=t;let{mvf:s}=i,l=s["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new St(l[1],l[0])});let c=s["manifest.geojson"].features[0].properties.name,p=new I_("mapObject-".concat(c),i,r,this);this.currentMap=p,this.currentMap.setFloor(this.currentMap.startingFloorId);let h=this.core.getBoundingArea(p.currentFloor.id);h==null&&ce.error("Could not determine bounding box for map:",p.currentFloor.id);let y=(_=(b=r==null?void 0:r.outdoorView)==null?void 0:b.layersHiddenByGeometry)!=null?_:[];if(y.length>0){let E,w=[];for(let O of p.floorStacksById.values())if(O.defaultFloor.footprint&&O.defaultFloor.footprint.geometry!=null&&((C=O.defaultFloor.footprint.geometry)==null?void 0:C.coordinates.length)>0){let D=O.defaultFloor.footprint,A=KT(D);E==null?E=A:sse(E,A),w.push(D)}w.length>0&&E!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(E,w,y),this.hiddenOutdoorGeometries.push([E,w,y]))}if(this.mapObjects.push(p),i.getMVFFeatureByType("floor").forEach(E=>{this.mapsByFloorId[E.id]=p}),p.on("navigation-connection-click",E=>{this.mapView.publish("navigation-connection-click",E)}),p.on("navigation-active-path-change",E=>{this.mapView.publish("navigation-active-path-change",E)}),p.StackedMaps.on("stacked-maps-state-change",({state:E})=>{this.mapView.publish("stacked-maps-state-change",{state:E})}),p.on("floor-change-start",E=>{var w,O,D,A;this.mapView.publish("floor-change-start",{reason:E.reason,floor:(O=(w=this.getMapDataInternal())==null?void 0:w.getById("floor",E.floorId))!=null?O:this.currentFloor,previousFloor:(A=(D=this.getMapDataInternal())==null?void 0:D.getById("floor",E.previousFloorId))!=null?A:this.currentFloor})}),p.on("floor-change",E=>{var w,O;this.mapView.publish("floor-change",{reason:E.reason,floor:this.currentFloor,previousFloor:(O=(w=this.getMapDataInternal())==null?void 0:w.getById("floor",E.previousFloorId))!=null?O:this.currentFloor})}),(r==null?void 0:r.zoomLevel)!=null)this.core.camera.setZoomLevel(r.zoomLevel),n(t);else if(this.core.mode!=="outdoors-overlay"&&h){let E=(P=r==null?void 0:r.screenOffsets)!=null?P:{top:nE*this.core.canvasHeight,left:nE*this.core.canvasWidth,right:nE*this.core.canvasWidth,bottom:nE*this.core.canvasHeight};this.core.camera.focusOn(h,{duration:uG,padding:E}).then(()=>{n(t)})}else n(t)})}setFloor(t,r){return this.currentMap.setFloor($b(t),r)}setFloorStack(t,r){return this.currentMap.setFloorStack($b(t),r)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var n;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Ys("Missing currentFloorStack.");let r=(n=this.mapData)==null?void 0:n.getById("floor-stack",t);if(!r)throw new Ys("FloorStack was not found in map data.");return r}get currentFloor(){var n;let t=this.currentMap.currentFloor.id;if(!t)throw new Ys("Missing currentFloor object from GeoJsonApi");let r=(n=this.mapData)==null?void 0:n.getById("floor",t);if(!r)throw new Ys("Missing currentFloor");return r}getState(t){var i,s,l,c,p,h,y,b,_,C,P,E,w,O,D,A,k,j,W,Y;typeof t=="object"&&oc.is(t)&&ce.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let r=ose(t,this),n=this.core.getState(r);if(n)if(["interior-walls","exterior-walls"].includes(t)){let{color:N,topColor:Z,texture:le,topTexture:se,visible:U,height:ye,opacity:ne}=n;return{type:"walls",visible:U,color:N,topColor:Z,texture:le?{url:le}:void 0,topTexture:se?{url:se}:void 0,height:ye,opacity:ne}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:N,topColor:Z,texture:le,topTexture:se,visible:U,opacity:ye}=n;return{type:"doors",visible:U,color:N,topColor:Z,opacity:ye,texture:le?{url:le}:void 0,topTexture:se?{url:se}:void 0}}else if(n.type==="geometry"){let N;n.parent&&n.parent.type==="geometry-group"&&(N=this.core.getState(n.parent));let Z=N!=null&&N.altitude?n.altitude+N.altitude:n.altitude;return{type:"geometry",interactive:n.interactive,hoverColor:n.hoverColor,color:n.color,visible:n.visible,opacity:n.opacity,height:n.height,texture:n.texture?{url:n.texture}:void 0,topTexture:n.topTexture?{url:n.topTexture}:void 0,flipImageToFaceCamera:n.flipImageToFaceCamera,topColor:n.topColor,altitude:Z}}else{if(n.type==="label"&&n.options.appearance&&n.options.rank!==void 0&&n.options.interactive!==void 0)return{type:"label",text:n.text,appearance:n.options.appearance,rank:n.options.rank,enabled:n.enabled,interactive:n.options.interactive};if(n.type==="marker"&&((i=n.options)==null?void 0:i.rank)!==void 0&&n.options.interactive!==void 0){let N=typeof n.parent=="object"?n.parent.id:n.parent,Z=this.Markers.getById(n.id.toString()),le=Z!=null&&Z.marker.target?Z==null?void 0:Z.marker.target.anchorTarget:void 0;return le==null&&(le=new St(n.position[1],n.position[0],N.toString())),{type:"marker",rank:n.options.rank,interactive:n.options.interactive,enabled:n.enabled,element:n.element,anchor:n.anchor,zIndex:n.options.zIndex,dynamicResize:n.dynamicResize,lowPriorityPin:n.options.lowPriorityPin,contentHTML:n.contentHTML}}else if(n.type==="model"){let N=n!=null&&typeof n.parent=="object"?n.parent.id.toString():(s=n.parent)==null?void 0:s.toString();return delete n.parent,re(R({},n),{position:new St({latitude:n.position[1],longitude:n.position[0],verticalOffset:n.position[2],floorId:N}),type:"model"})}else{if(n.type==="image")return{type:"image"};if(n.type==="text3d")return n;if(n.type==="geometry-group"&&t&&typeof t!="string"&&nd.is(t)){let[N]=n.children;if(N.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(l=n.altitude)!=null?l:0,visible:n.visible,color:n.color,height:N.height,opacity:n.opacity,interactive:n.interactive}}else{if(n.type==="path")return{type:"path",color:n.color,visible:n.visible,nearRadius:n.nearRadius,farRadius:n.farRadius,completeFraction:n.completeFraction};if(n.type==="group-container"&&typeof t!="string"&&ca.is(t)){let N=(c=this.currentMap.floorsById.get(t.id))==null?void 0:c.layers.get(Zi),Z=N?this.core.getState(N.containerId):void 0,le=(p=this.currentMap.floorsById.get(t.id))==null?void 0:p.layers.get(df),se=(h=this.currentMap.floorsById.get(t.id))==null?void 0:h.layers.get(qc),U=(y=this.currentMap.floorsById.get(t.id))==null?void 0:y.layers.get(gx),ye=U?this.core.getState(U.containerId):void 0,ne=(b=this.currentMap.floorsById.get(t.id))==null?void 0:b.layers.get(V0),Ce=ne?this.core.getState(ne.containerId):void 0;return{type:"floor",geometry:{opacity:(_=Z==null?void 0:Z.opacity)!=null?_:0,visible:(C=Z==null?void 0:Z.visible)!=null?C:!0},labels:{enabled:(P=le==null?void 0:le.visible)!=null?P:!1},markers:{enabled:(E=se==null?void 0:se.visible)!=null?E:!1},footprint:{altitude:(w=ye==null?void 0:ye.altitude)!=null?w:0,visible:(O=ye==null?void 0:ye.visible)!=null?O:!1,height:(D=ye==null?void 0:ye.height)!=null?D:0,opacity:(A=ye==null?void 0:ye.opacity)!=null?A:0,side:(k=ye==null?void 0:ye.side)!=null?k:"double",color:(j=ye==null?void 0:ye.color)!=null?j:"white"},occlusion:{enabled:(W=Ce==null?void 0:Ce.visible)!=null?W:!1},visible:n.visible,altitude:(Y=n.altitude)!=null?Y:0}}else if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&Nl.is(t)){let N=this.core.getState(n.children[0].id);return{type:"facade",opacity:N.opacity,visible:N.visible}}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,r,n){var p;if(n!=null){let h=this.core.projectScreenXYToCoordinate(t,r,!0);return h?new St(h.coordinate[1],h.coordinate[0],n.id):void 0}let i=this.core.projectScreenXYToCoordinate(t,r);if(i==null||i.coordinate==null)return;let{coordinate:s,groupContainers:l}=i,c=(p=l==null?void 0:l.find(h=>{let y=h.userData.entityId.toString();return y.includes("f_")||y.includes("m_")}))==null?void 0:p.userData.entityId.toString();return new St(s[1],s[0],c)}getScreenCoordinateFromCoordinate(t){var n,i,s;let r=0;if(t.floorId!=null){let l=(n=this.mapData)==null?void 0:n.getById("floor",t.floorId);l!=null&&(r=(s=(i=this.getState(l))==null?void 0:i.altitude)!=null?s:0)}return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude,r])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){return{labels:this.Labels.all()}}tween(t){let r=new Va(t);return this.core.getExternalTweenGroup().add(r),this.core.render(),r}removeTween(t){this.core.getExternalTweenGroup().remove(t)}tweenGroup(){return this.core.getExternalTweenGroup()}get __core(){return this.core}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()}};o(hF,"GeoJsonApi");var U_=hF;function ase(e){tk("".concat(e,"/maplibre-worker.csp.js")),A9("".concat(e,"/collision-worker.csp.js"))}o(ase,"setWorkersUrl");g();g();var mF=class mF{constructor(t){x(this,"state");x(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};o(mF,"Debug");var oE=mF;g();var lse=Cs.object({environment:Cs.union([Cs.literal("basic"),Cs.literal(!1)]).optional(),text3d:Cs.object({hoverColor:Cs.string().optional()}).optional(),geometry:Cs.object({hoverColor:Cs.string().optional()}).optional(),backgroundColor:Cs.string().optional(),backgroundAlpha:Cs.number().optional()}).strict();g();var gF=Pn(S7(),1);var use=o(e=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(r=>e.startsWith(r)))return!0;let t=console.warn;return console.warn=()=>{},e==="white"||yF(e).some(r=>r<1)?!0:(console.warn=t,!1)},"isProbablyColor"),yF=o(e=>{let t=new An(e);return[t.r,t.g,t.b]},"stringToRgbArray"),o9e=o(e=>{let t=new An;return t.setRGB(e[0],e[1],e[2],Zp),"#"+t.getHexString()},"rgbArrayToString"),s9e=o((e,t)=>{let r={},n=o((i,s,l)=>{for(let c in s){let p=i[c],h=s[c];typeof h=="object"&&!Array.isArray(h)&&h!==null&&typeof p=="object"&&!Array.isArray(p)&&p!==null?(l[c]={},n(p,h,l[c])):l[c]=p}},"processObject");return n(e,t,r),r},"extractProperties"),cse=o((e,t)=>{let r=s9e(e,t),n=(0,gF.default)({},r,t),i=o((s,l,c)=>{for(let p in l){let h=s[p],y=l[p];if(typeof y=="number"&&typeof h=="number")s[p]=h+(y-h)*c;else if(typeof y=="string"&&typeof h=="string"){if(use(h)&&use(y)){let b=yF(h),_=yF(y);b&&_?s[p]=o9e([b[0]+(_[0]-b[0])*c,b[1]+(_[1]-b[1])*c,b[2]+(_[2]-b[2])*c]):ce.warn('Color "'.concat(p,'" could not be animated!'))}}else typeof y=="object"&&y!==null&&typeof h=="object"&&h!==null?i(h,y,c):ce.warn('Value "'.concat(p,'" could not be animated!'))}},"interpolate");return s=>{if(s=Math.min(Math.max(s,0),1),s===0)return e;if(s===1)return n;let l=(0,gF.default)({},r);return i(l,t,s),l}},"animationFactory");var V_,lt,xd,vF=class vF extends Lt{constructor(r){super();G(this,V_,{});G(this,lt);G(this,xd);x(this,"Camera");x(this,"Labels");x(this,"Text3D");x(this,"Markers");x(this,"Images");x(this,"Models");x(this,"Paths");x(this,"Exporter");x(this,"Navigation");x(this,"BlueDot");x(this,"Style");x(this,"Shapes");x(this,"Outdoor");x(this,"update",o(()=>{d(this,lt).core.render()},"update"));x(this,"getDirections",o((r,n,i)=>{var s;return(s=d(this,lt).getMapData())==null?void 0:s.getDirections(r,n,i)},"getDirections"));x(this,"getDirectionsMultiDestination",o((r,n,i)=>{var s;return(s=d(this,lt).getMapData())==null?void 0:s.getDirectionsMultiDestination(r,n,i)},"getDirectionsMultiDestination"));x(this,"on",o((r,n)=>{super.on(r,n)},"on"));x(this,"off",o((r,n)=>{super.off(r,n)},"off"));x(this,"Debug");q(this,xd,r);let n=new U_(r,this);q(this,lt,n),this.Camera=d(this,lt).Camera,q(this,V_,d(this,lt).mapDataExternal),this.Markers=d(this,lt).Markers,this.Models=d(this,lt).Models,this.Labels=d(this,lt).Labels,this.Text3D=d(this,lt).Text3D,this.Exporter=d(this,lt).Exporter,this.Paths=d(this,lt).Paths,this.Navigation=d(this,lt).Navigation,this.BlueDot=d(this,lt).BlueDot,this.Shapes=d(this,lt).Shapes,this.Style=d(this,lt).Style,this.auto=d(this,lt).auto,this.Outdoor=d(this,lt).Outdoor,this.Images=d(this,lt).Images,d(this,xd).container.dataset.version=I.env.npm_package_version,this.Debug=new oE(d(this,lt).core)}get StackedMaps(){return d(this,lt).currentMap.StackedMaps}updateState(r,n){return d(this,lt).updateState(r,n)}animateState(r,n,i){var h;let s=d(this,lt).getState(r);if(s==null)return ce.warn("Cannot animate state of ".concat(r,".")),new Promise(b=>b({result:"completed"}));let l=cse(s,n),c=d(this,lt).tween({percent:0}).to({percent:1},(h=i==null?void 0:i.duration)!=null?h:1e3).onUpdate(({percent:y})=>{d(this,lt).updateState(r,l(y))});i!=null&&i.easing&&i.easing in Jf&&c.easing(Jf[i.easing]);let p=new Promise(y=>{c.onComplete(()=>{d(this,lt).removeTween(c),y({result:"completed"})}).onStop(()=>{d(this,lt).removeTween(c),y({result:"cancelled"})}),c.start()});return p.cancel=()=>{c.stop(),d(this,lt).updateState(r,l(0))},p}updateGlobalState(r){var n,i,s,l;try{lse.parse(r)}catch(c){ce.error("updateGlobalState",c);return}if(typeof r=="object"){let c={};if((n=r.text3d)!=null&&n.hoverColor&&(c.text3dHoverColor=r.text3d.hoverColor),(i=r.geometry)!=null&&i.hoverColor&&(c.hoverColor=r.geometry.hoverColor),r.backgroundColor||r.backgroundAlpha!==void 0){let p=(s=r.backgroundColor)!=null?s:d(this,lt).core.backgroundColor,h=(l=r.backgroundAlpha)!=null?l:d(this,lt).core.backgroundAlpha;d(this,lt).core.setBackgroundColor(p,h)}r.environment!=null&&d(this,lt).core.setEnvironment(r.environment),d(this,lt).core.setState(c)}}getGlobalState(){let r=d(this,lt).core.getState();return{backgroundColor:d(this,lt).core.backgroundColor,backgroundAlpha:d(this,lt).core.backgroundAlpha,environment:d(this,lt).core.getEnvironment(),geometry:{hoverColor:r.hoverColor},text3d:{hoverColor:r.text3dHoverColor}}}getMapData(){return d(this,V_)}getDimensions(){return{width:d(this,xd).canvasWidth,height:d(this,xd).canvasHeight}}expand(r){var n;return(n=d(this,lt).currentMap)==null?void 0:n.StackedMaps.expand(r)}collapse(r){var n;return(n=d(this,lt).currentMap)==null?void 0:n.StackedMaps.collapse(r)}addMap(r,n){return d(this,lt).addMap(r,n)}setFloor(r,n){return d(this,lt).setFloor(r,n==null?void 0:n.context)}setFloorStack(r,n){return d(this,lt).setFloorStack(r,n==null?void 0:n.context)}preloadFloors(r){d(this,lt).preloadFloors(r)}tween(r){return d(this,lt).tween(r)}removeTween(r){d(this,lt).removeTween(r)}get tweenGroup(){return d(this,lt).tweenGroup()}get currentFloorStack(){return d(this,lt).currentFloorStack}get currentFloor(){return d(this,lt).currentFloor}updateWatermark(r){d(this,lt).updateWatermark(r)}getState(r){return d(this,lt).getState(r)}setHoverColor(r){d(this,lt).setHoverColor(r)}getHoverColor(){return d(this,lt).getHoverColor()}convertAltitudeToMercatorZoomLevel(r){return d(this,lt).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(r)}convertMercatorZoomLevelToAltitude(r){return d(this,lt).core.getSystems().cameraSystem.convertZoomLevelToAltitude(r)}isInView(r){return d(this,lt).isInView(r)}getDistance(r,n){var i;return(i=d(this,lt).getMapData())==null?void 0:i.getDistance(r,n)}createCoordinate(r,n,i){return typeof r=="object"?new St(r):new St(r,n,i==null?void 0:i.id)}createCoordinateFromScreenCoordinate(r,n,i){return d(this,lt).createCoordinateFromScreenCoordinate(r,n,i)}getScreenCoordinateFromCoordinate(r){return d(this,lt).getScreenCoordinateFromCoordinate(r)}auto(){return{labels:this.Labels.all()}}get __core(){if(I.env.INTERNAL==="true")return d(this,lt).core;throw new Error("__core is not available.")}clear(){d(this,lt).clear()}destroy(){d(this,lt).destroy()}async enableDebug(r={}){let{Inspector:n}=await import("./inspector-EE243Q6Y.js");await new n(this,d(this,lt)).enable(r)}async takeScreenshot(){return await d(this,xd).renderSync(),d(this,xd).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return d(this,lt).manualFloorVisibility}set manualFloorVisibility(r){d(this,lt).manualFloorVisibility=r}};V_=new WeakMap,lt=new WeakMap,xd=new WeakMap,o(vF,"MapView");var ob=vF;g();g();var bF=class bF extends Lt{constructor(r){super();x(this,"gl");x(this,"el",document.createElement("div"));x(this,"core");x(this,"origin");x(this,"map");x(this,"layer");x(this,"handleStyleChange",o(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));x(this,"handleMove",o(()=>{if(!this.map)return;let[r,n]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(r,n),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(Yt.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(Yt.degToRad(this.map.getPitch()))},"handleMove"));x(this,"handleError",o(r=>{ce.warn(r)},"handleError"));this.origin=r}onAdd(r){this.origin=this.origin||r.getCenter().toArray(),this.gl=r.painter.context.gl,this.core=new K2(r._container,{center:this.origin,zoomLevel:r.getZoom(),pitch:r.getPitch(),bearing:r.getBearing(),gl:this.gl,map:r,mode:"outdoors-overlay"}),this.map=r,this.core.camera.setMinZoomLevel(r.getMinZoom()),this.core.camera.setMaxZoomLevel(r.getMaxZoom()),this.core.camera.setMinPitch(r.getMinPitch()),this.core.camera.setMaxPitch(r.getMaxPitch()),this.map.on("error",this.handleError);let n=QN.fromLngLat(this.origin,0);return this.layer=SS(n,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};o(bF,"MapLibreOverlay");var sE=bF;var jy,sb,Xh,$y,z_=class z_ extends Lt{constructor(r,n,i){super();G(this,jy);G(this,sb);G(this,Xh);G(this,$y);x(this,"on",o((r,n)=>{super.on(r,n)},"on"));x(this,"off",o((r,n)=>{super.off(r,n)},"off"));q(this,$y,new sE(r)),q(this,jy,n),q(this,sb,i)}onAdd(r){var s,l;let n=d(this,$y).onAdd(r),i=re(R(R({},Um),(s=d(this,sb))!=null?s:{}),{outdoorView:R({token:d(this,jy).outdoorViewToken},(l=d(this,sb))==null?void 0:l.outdoorView)});return q(this,Xh,new ob(d(this,$y).core)),d(this,Xh).addMap(d(this,jy),i).then(()=>{this.publish("loaded",{mapView:d(this,Xh),mapData:d(this,jy)})}),n}onRemove(){d(this,Xh)&&d(this,Xh).clear(),z_.instance=null,d(this,$y).onRemove()}};jy=new WeakMap,sb=new WeakMap,Xh=new WeakMap,$y=new WeakMap,o(z_,"MappedinMapLibreOverlay"),x(z_,"instance");var ab=z_;g();var a9e=1e3*60*60*2,Yh,ub,oi,pc,fc,pu,dc,cb,pb,q_,Yn,xF,pse,fse,lb,aE,IF,_F,SF,CF=class CF{constructor(t,r){G(this,Yn);G(this,Yh,new Lt);G(this,ub);G(this,oi);G(this,pc);G(this,fc);G(this,pu);G(this,dc);G(this,cb);G(this,pb);G(this,q_,o(()=>{"key"in d(this,oi)&&"secret"in d(this,oi)&&ke(this,Yn,lb).call(this),ke(this,Yn,aE).call(this)},"#handleWindowFocus"));x(this,"on",o((t,r)=>d(this,Yh).on(t,r),"on"));x(this,"off",o((t,r)=>d(this,Yh).off(t,r),"off"));q(this,ub,t),q(this,oi,r)}setMapIds(t){q(this,ub,t)}setEnterprise(t){d(this,oi).enterprise=t}async readySync(){if((!("key"in d(this,oi))||!("secret"in d(this,oi)))&&!("accessToken"in d(this,oi))){ce.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[ke(this,Yn,lb).call(this),null];d(this,oi).enterprise||(t[1]=this.getSasTokensAsync());let[r,n]=await Promise.all(t);ke(this,Yn,SF).call(this),ke(this,Yn,IF).call(this,r),n!=null&&ke(this,Yn,_F).call(this,n),ke(this,Yn,xF).call(this)&&globalThis.addEventListener("focus",d(this,q_))}async refreshing(){let t=[];return d(this,pc)!=null&&t.push(d(this,pc)),d(this,fc)!=null&&t.push(d(this,fc)),Promise.all(t)}getAccessTokenAsync(){return ke(this,Yn,lb).call(this)}getSasTokensAsync(){return ke(this,Yn,aE).call(this)}getAccessToken(){return d(this,pu)==null?(ce.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):d(this,pu)}getSasToken(t){return this.isEnterpriseMode()?(ce.error("SAS tokens are not available in the enterprise mode!"),{token:""}):d(this,dc)==null?(ce.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in d(this,dc).tokens?d(this,dc).tokens[t]:(ce.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=d(this,oi).enterprise)!=null?t:!1}destroy(){ke(this,Yn,SF).call(this),d(this,Yh).destroy(),ke(this,Yn,xF).call(this)&&globalThis.removeEventListener("focus",d(this,q_))}};Yh=new WeakMap,ub=new WeakMap,oi=new WeakMap,pc=new WeakMap,fc=new WeakMap,pu=new WeakMap,dc=new WeakMap,cb=new WeakMap,pb=new WeakMap,q_=new WeakMap,Yn=new WeakSet,xF=o(function(){return typeof window<"u"&&window!==null},"#isBrowser"),pse=o(function(t){var n;let r=t.token!==((n=d(this,pu))==null?void 0:n.token);q(this,pu,t),r&&d(this,Yh).publish("access-token-refreshed",{accessToken:t})},"#setAccessToken"),fse=o(function(t){var n;let r=JSON.stringify(t.tokens)!==JSON.stringify((n=d(this,dc))==null?void 0:n.tokens);q(this,dc,t),r&&d(this,Yh).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},"#setSasTokens"),lb=o(async function(t=!1){var r;if("accessToken"in d(this,oi)&&typeof d(this,oi).accessToken=="string"){let n={token:d(this,oi).accessToken,expires:Date.now()+72e5};return q(this,pu,n),n}if(!("key"in d(this,oi))||!("secret"in d(this,oi))||typeof d(this,oi).key!="string"||typeof d(this,oi).secret!="string")throw new Error("No API keys or access token provided!");return d(this,pc)!=null?d(this,pc):d(this,pu)!=null&&d(this,pu).expires!=null&&d(this,pu).expires>Date.now()&&!t?d(this,pu):(q(this,pc,FI(re(R({},d(this,oi)),{key:d(this,oi).key,secret:d(this,oi).secret}),(r=d(this,oi).enterprise)!=null?r:!1).then(n=>{let i={token:n.accessToken,expires:n.expiresTimestamp*1e3};return ke(this,Yn,pse).call(this,i),i})),d(this,pc).finally(()=>{q(this,pc,void 0)}),d(this,pc))},"#refreshAccessToken"),aE=o(async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:d(this,fc)!=null?d(this,fc):d(this,dc)!=null&&d(this,dc).expires>Date.now()&&!t?d(this,dc):(q(this,fc,new Promise((r,n)=>{ke(this,Yn,lb).call(this).then(i=>{let s={},l=d(this,ub).map(c=>y9(re(R({},d(this,oi)),{mapId:c}),i.token).then(p=>{s[c]={token:p.token,expires:p.expires}}).catch(p=>{ce.error("Error getting SAS token for map ".concat(c,":"),p)}));Promise.all(l).then(()=>{let c={tokens:s,expires:Math.min(...Object.values(s).map(p=>{var h;return(h=p.expires)!=null?h:1/0}))};ke(this,Yn,fse).call(this,c),r(c)})}).catch(i=>{n(i)})})),d(this,fc).catch(r=>{throw r}).finally(()=>{q(this,fc,void 0)}),d(this,fc))},"#refreshSasTokens"),IF=o(function(t){if(!("key"in d(this,oi))||!("secret"in d(this,oi)))return;let r=t.expires!=null?t.expires-Date.now():a9e;isFinite(r)&&q(this,cb,setTimeout(()=>{ke(this,Yn,lb).call(this,!0).then(n=>{ke(this,Yn,IF).call(this,n)})},r-Ate))},"#setAccessTokenRefresh"),_F=o(function(t){let r=t.expires-Date.now();isFinite(r)&&q(this,pb,setTimeout(()=>{ke(this,Yn,aE).call(this,!0).then(n=>{ke(this,Yn,_F).call(this,n)})},r-Nte))},"#setSasTokensRefresh"),SF=o(function(){d(this,cb)!=null&&clearTimeout(d(this,cb)),d(this,pb)!=null&&clearTimeout(d(this,pb))},"#stopRefreshing"),o(CF,"TokenManager");var fb=CF;g();var dse=o(async(e,t)=>{var C,P,E,w,O,D,A;let r=(E="mvfVersion"in(t!=null?t:{})?t==null?void 0:t.mvfVersion:void 0)!=null?E:"options"in e&&"version"in((C=e.options)!=null?C:{})?(P=e.options)==null?void 0:P.version:void 0,n=re(R({},t||{}),{mvfVersion:r}),i,s=bh();s.updateByUserOption(n);let l={};if("type"in e&&typeof e.type=="string"){if(l.enterprise=(w=e.options)==null?void 0:w.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){i=await QP(e.main,n.mvfVersion),l.languagePacks=[];for(let k of(O=e.languagePacks)!=null?O:[])k.localePack instanceof Uint8Array&&l.languagePacks.push({language:k.language,localePack:await Q1(k.localePack)})}else if(e.type==="json")i=e.main,l.languagePacks=(D=e.languagePacks)!=null?D:[];else throw new Error("Invalid backup type");e.type==="binary"&&e.main instanceof Uint8Array&&(l.binaryBundle=e.main)}else i=e,l.enterprise=i.enterprise!=null;let c=JP(i),p=c.length>0?c:[n.mapId],h=new fb(p,re(R({},n),{enterprise:l.enterprise})),y;if("accessToken"in n)y=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=s.getBaseAuthUri(l.enterprise);let k=await h.getAccessTokenAsync();y=(k==null?void 0:k.token)||""}l.outdoorViewToken=y,l.env=s,l.getMapDataOptions=n;try{await h.readySync()}catch(k){ce.error("Failed to ready token manager!",k)}let b=new Gy(i,l);y&&b.Analytics.init(re(R({accessToken:y,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0},n.analytics),{baseUri:s.getAnalyticsBaseUri(),context:(A=n.analytics)==null?void 0:A.context}));let _=new jI(b);if("language"in n)try{await _.changeLanguage(n.language)}catch(k){}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(i),_},"hydrateMapData");g();var hse=o((e,{id:t}={})=>{let r=Array.isArray(e)?e:[e];if(!r.every(s=>typeof s=="string"))return;let n=r.join(""),i=null;if(t){let s=document.getElementById(t);s instanceof HTMLStyleElement&&(i=s)}i==null&&(i=document.createElement("style")),t&&t!==""&&(i.id=t),i.textContent=n,document.head.appendChild(i)},"injectCSS");var mse=":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 gse='.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 all content including text nodes by setting font-size to 0 */\n.mappedin-marker[data-anchor="low-priority-pin"] {\n font-size: 0;\n line-height: 0;\n}\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor="low-priority-pin"]>* {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker[data-anchor="low-priority-pin"]::before {\n content: \'\';\n display: block;\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';var yse=".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 vse=".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 bse=".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 xse='.maplibregl-map {\n font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\n.maplibregl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.maplibregl-map:fullscreen {\n width: 100%;\n height: 100%;\n}\n\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {\n cursor: pointer;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive:active,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: pinch-zoom;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-ctrl-top-left,\n.maplibregl-ctrl-top-right,\n.maplibregl-ctrl-bottom-left,\n.maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n\n.maplibregl-ctrl-top-left { top: 0; left: 0; }\n\n.maplibregl-ctrl-top-right { top: 0; right: 0; }\n\n.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }\n\n.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.maplibregl-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; }\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; }\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; }\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; }\n\n.maplibregl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.maplibregl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.maplibregl-ctrl-group button + button {\n border-top: 1px solid #ddd;\n}\n\n.maplibregl-ctrl button .maplibregl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-icon {\n background-color: transparent;\n }\n\n .maplibregl-ctrl-group button + button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.maplibregl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.maplibregl-ctrl-attrib-button:focus,\n.maplibregl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {\n opacity: 0.25;\n}\n\n.maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.maplibregl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.maplibregl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.maplibregl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n @svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {\n fill: #fff;\n #south { fill: #999; }\n }\n\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);\n }\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain-enabled);\n}\n\n@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #fff;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #000;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #aaa;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #999;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #666;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e58978;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e54e33;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {\n animation: maplibregl-spin 2s infinite linear;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-black);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-black);\n }\n}\n\n@keyframes maplibregl-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\na.maplibregl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: svg-load("svg/maplibregl-ctrl-logo.svg");\n}\n\na.maplibregl-ctrl-logo.maplibregl-compact {\n width: 14px;\n}\n\n@media (-ms-high-contrast: active) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; }\n #fill { opacity: 1; }\n }\n\n background-color: transparent;\n background-image: svg-inline(ctrl-logo-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; fill: #fff; stroke: #fff; }\n #fill { opacity: 1; fill: #000; }\n }\n\n background-image: svg-inline(ctrl-logo-black);\n }\n}\n\n.maplibregl-ctrl.maplibregl-ctrl-attrib {\n padding: 0 5px;\n background-color: rgb(255 255 255 / 50%);\n margin: 0;\n}\n\n@media screen {\n .maplibregl-ctrl-attrib.maplibregl-compact {\n min-height: 20px;\n padding: 2px 24px 2px 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n color: #000;\n border-radius: 12px;\n box-sizing: content-box;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 28px 2px 8px;\n visibility: visible;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 8px 2px 28px;\n border-radius: 12px;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {\n display: none;\n }\n\n .maplibregl-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n background-color: rgb(255 255 255 / 50%);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n outline: none;\n top: 0;\n right: 0;\n border: 0;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {\n left: 0;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {\n display: block;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {\n background-color: rgb(0 0 0 / 5%);\n }\n\n .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n left: 0;\n }\n\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n }\n}\n\n.maplibregl-ctrl-attrib a {\n color: rgb(0 0 0 / 75%);\n text-decoration: none;\n}\n\n.maplibregl-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n.maplibregl-attrib-empty {\n display: none;\n}\n\n.maplibregl-ctrl-scale {\n background-color: rgb(255 255 255 / 75%);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n\n.maplibregl-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n\n.maplibregl-popup-anchor-top,\n.maplibregl-popup-anchor-top-left,\n.maplibregl-popup-anchor-top-right {\n flex-direction: column;\n}\n\n.maplibregl-popup-anchor-bottom,\n.maplibregl-popup-anchor-bottom-left,\n.maplibregl-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n\n.maplibregl-popup-anchor-left {\n flex-direction: row;\n}\n\n.maplibregl-popup-anchor-right {\n flex-direction: row-reverse;\n}\n\n.maplibregl-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n\n.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-left: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n align-self: center;\n border-bottom: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-bottom: none;\n border-left: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-bottom: none;\n border-right: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n align-self: center;\n border-left: none;\n border-right-color: #fff;\n}\n\n.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n\n.maplibregl-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.maplibregl-popup-close-button:hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n padding: 15px 10px;\n pointer-events: auto;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-content {\n border-top-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-content {\n border-top-right-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {\n border-bottom-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {\n border-bottom-right-radius: 0;\n}\n\n.maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-popup-track-pointer * {\n pointer-events: none;\n user-select: none;\n}\n\n.maplibregl-map:hover .maplibregl-popup-track-pointer {\n display: flex;\n}\n\n.maplibregl-map:active .maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-marker {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n transition: opacity 0.2s;\n}\n\n.maplibregl-user-location-dot {\n background-color: #1da1f2;\n width: 15px;\n height: 15px;\n border-radius: 50%;\n}\n\n.maplibregl-user-location-dot::before {\n background-color: #1da1f2;\n content: "";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n position: absolute;\n animation: maplibregl-user-location-dot-pulse 2s infinite;\n}\n\n.maplibregl-user-location-dot::after {\n border-radius: 50%;\n border: 2px solid #fff;\n content: "";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgb(0 0 0 / 35%);\n}\n\n@keyframes maplibregl-user-location-dot-pulse {\n 0% { transform: scale(1); opacity: 1; }\n 70% { transform: scale(3); opacity: 0; }\n 100% { transform: scale(1); opacity: 0; }\n}\n\n.maplibregl-user-location-dot-stale {\n background-color: #aaa;\n}\n\n.maplibregl-user-location-dot-stale::after {\n display: none;\n}\n\n.maplibregl-user-location-accuracy-circle {\n background-color: #1da1f233;\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n\n.maplibregl-crosshair,\n.maplibregl-crosshair .maplibregl-interactive,\n.maplibregl-crosshair .maplibregl-interactive:active {\n cursor: crosshair;\n}\n\n.maplibregl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n}\n\n.maplibregl-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.maplibregl-cooperative-gesture-screen.maplibregl-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {\n display: none;\n }\n\n .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: block;\n }\n}\n\n.maplibregl-pseudo-fullscreen {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 99999;\n}\n';var h9e=[mse,gse,yse,vse,bse,xse],Ise;function m9e(e){Ise=e}o(m9e,"__setWatermarkOnClickFn");var g9e=o(async(e,t)=>{let r,n=bh();t&&n.updateByUserOption(t);try{t&&(r=(await FI(re(R({},t),{baseAuthUri:n.getBaseAuthUri()}))).accessToken)}catch(l){ce.warn("Getting access token failed. Outdoor map disabled.",l)}let i=new Gy(e,{outdoorViewToken:r,languagePacks:t==null?void 0:t.languagePacks,env:n});return new jI(i)},"hydrateMapDataFromMVF"),_se=!1;function y9e(e){_se=e}o(y9e,"setUseEnterpriseAPI");var Sse=o(async e=>{var E;let t=_se,r,n=bh();n.updateByUserOption(e);let i=R({},e),s=new fb([i.mapId],i);if("accessToken"in i){r=i.accessToken;let{aud:w,sub:O}=hS(r);(pG.some(D=>w.includes(D))||O&&O.startsWith("client"))&&(t=!0,s.setEnterprise(t))}else if("key"in i&&"secret"in i)i.key.startsWith("mik_")||(t=!0,s.setEnterprise(t)),i.baseAuthUri=n.getBaseAuthUri(t),r=(await s.getAccessTokenAsync()).token;else throw new Error("Missing key or secret.");i.layoutId!=null&&(t?i.layoutId!=="draft"&&ce.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):ce.warn("layoutId is currently unsupported!")),i.baseUri=n.getBaseUri(t);let l=performance.now(),c,p;if(t){let w=re(R({},i),{venue:i.mapId,clientId:i.key,clientSecret:i.secret,version:"1.0.0",perspective:i.viewId,useDraftData:i.layoutId==="draft"}),O=await x9(w);c=O.compressed,p=O.localePacks}else c=await I9(i,r);let h=performance.now(),y=await QP(c,i.mvfVersion),b=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(y);let _=JP(y);_.length>0?s.setMapIds(_):s.setMapIds([i.mapId]);try{await s.readySync()}catch(w){ce.error("Failed to ready token manager!",w)}let C=new Gy(y,{env:n,outdoorViewToken:r,tokenManager:s,enterprise:t,localePacksUrls:p,binaryBundle:c,getMapDataOptions:i}),P=new jI(C,{search:e.search});if(C.Analytics.init(re(R({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:(E=i.analytics)==null?void 0:E.context})),C.Analytics.sendGetMapDataEvent({parseDuration:b-h,downloadDuration:h-l,viewId:i.viewId}),"language"in i)try{await P.changeLanguage(i.language)}catch(w){}return P},"getMapData"),v9e=Sse,b9e=o((e,t)=>{ab.instance!=null&&ce.warn("Only a single map venue is supported at this time.");let r=new ab([e.mapCenter.longitude,e.mapCenter.latitude],e,t);return ab.instance=r,r},"createMapLibreOverlay"),Cse=o(async(e,t,r)=>{var h,y,b,_,C,P,E,w,O,D,A,k,j,W,Y;let n=performance.now(),i=DO(r,t);i&&AO(i),((h=i.injectStyles)==null||h)&&hse(h9e,{id:"mappedin__styles"});let s=dG((y=t.outdoorViewToken)!=null?y:""),l=$I(t);(b=i.outdoorView)!=null&&b.style&&l.envControl.updateTileServerBaseUrl((_=i.outdoorView)==null?void 0:_.style);let c=await voe(e,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:i.bearing,pitch:i.pitch,zoomLevel:i.zoomLevel,backgroundAlpha:(C=i.style)==null?void 0:C.backgroundAlpha,backgroundColor:(P=i.style)==null?void 0:P.backgroundColor,outdoorView:(E=i.outdoorView)!=null&&E.token?{headers:{"x-mappedin-tiles-key":(w=i.outdoorView)==null?void 0:w.token},style:t.getEnv().tileServerUri,enabled:!!((O=i.outdoorView)!=null&&O.enabled),lowDpi:(D=i.outdoorView)==null?void 0:D.lowDpi}:void 0,watermark:re(R({},i.watermark),{visible:(k=(A=i.watermark)==null?void 0:A.visible)!=null?k:!l.enterpriseMode&&!s.remove_watermark,onClick:Ise||void 0}),attribution:i.attribution,antialias:typeof i.antialiasing=="boolean"?i.antialiasing:!!((j=i.antialiasing)!=null&&j.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(W=i.occlusion)==null?void 0:W.enabled,transformImageRequest:l.enterpriseMode?void 0:l.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:i.imagePlacementOptions,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:i.onWebGLContextRestored,onWebGLRendererError:i.onWebGLRendererError,useStandaloneCamera:(Y=i.useStandaloneCamera)!=null?Y:!1}),p=new ob(c);return await p.addMap(t,i),l.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:p.getDimensions()}),p},"show3dMap"),x9e=Cse;function cu(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}o(cu,"convertCoordinateToPosition");function _9e(e){return new Map(e.map(t=>{let{properties:r}=t,{id:n}=r;return[n,t]}))}o(_9e,"getEntranceMap");var j8=o((e,t)=>{let r=_9e(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 s=[i.geometry.coordinates],l=(i.properties.entrances||[]).reduce((c,p)=>(r.has(p)&&c.push(r.get(p)),c),[]);if(l.length){let{entrances:c,obstructions:p}=T9(i,l);s=p.map(h=>h.geometry.coordinates),n.entrances.features.push(...c)}n.walls.geometry.coordinates.push(...s)}return n},"cutEntrancesFromLineStrings");function rse(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(rse,"translateLabelStateToGeojsonCore");function nse(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(nse,"translateMarkerStateToGeojsonCore");function iE(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(iE,"translateDoorsStateToGeojsonCore");function dF(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(dF,"translateWallsStateToGeojsonCore");function ise(e,t,r){var i,s,l;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),((s=e.topTexture)==null?void 0:s.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-((l=r==null?void 0:r.altitude)!=null?l:0))),n}o(ise,"translateSpaceStateToGeojsonCore");function wse(e,t){return((t-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}o(wse,"differenceBetweenAngles");function Pse(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(Pse,"getRelativeBearing");function joe(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(joe,"extractStyleMap");function ZT(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 s=re(R({},i),{id:i.id+"-textures"});r.set(s,[n])}else r.has(i)||r.set(i,[]),r.get(i).push(n);return r},new Map)}o(ZT,"groupGeometryByStyle");function Jv(e,t={}){var i,s,l,c,p,h,y;let r=re(R({},e),{flipImageToFaceCamera:(i=t==null?void 0:t.flipImagesToFaceCamera)!=null?i:!0}),n=(l=(s=t==null?void 0:t.style)==null?void 0:s.shading)!=null?l: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=(p=(c=t==null?void 0:t.style)==null?void 0:c.outlines)!=null?p:t==null?void 0:t.shadingAndOutlines,"lineStrings"in e){let b=(y=(h=t==null?void 0:t.style)==null?void 0:h.wallTopColor)!=null?y:t==null?void 0:t.wallTopColor;b!=null&&(r.topColor=b)}return r}o(Jv,"translateToCoreStyle");var ose=o((e,t)=>{var i;let n=((i=t.currentMap)==null?void 0:i.currentFloor).layers.get(Zi);switch(e){case"interior-walls":return n==null?void 0:n.layers.get(Xd);case"exterior-walls":return n==null?void 0:n.layers.get(zc);case"interior-doors":return n==null?void 0:n.layers.get(G0);case"exterior-doors":return n==null?void 0:n.layers.get(U0);default:return typeof e=="string"?e:e.id}},"getTargetID");function K8(e){return new Promise(t=>{e.onComplete(t),e.onStop(t)})}o(K8,"tweenToPromise");function KT(e){return e.bbox?e.bbox:po(e)}o(KT,"getBoundingBox");function sse(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(sse,"expandBbox");function Tse(e){return[...new Set(e)]}o(Tse,"unique");function J8(e,t,r){return e.floorId&&t.has(e.floorId)?t.get(e.floorId):r}o(J8,"getTargetFloorObject");function Kv(e){if(wo.is(e)||Oa.is(e))return e.id}o(Kv,"getAttachableGeometryId");function $oe(e,t,r){var s,l,c,p,h,y;let n=e.coordinates.length===2,i=!0;if(n&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let b=t==null?void 0:t.getById("floor",e.coordinates[0].floorId),_=t==null?void 0:t.getById("floor",e.coordinates[1].floorId);b&&_&&(i=((l=(s=r.getState(b))==null?void 0:s.visible)!=null?l:!0)&&((p=(c=r.getState(_))==null?void 0:c.visible)!=null?p:!0))}else{let b=e.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",e.coordinates[0].floorId):void 0;i=b&&(y=(h=r.getState(b))==null?void 0:h.visible)!=null?y:!0}return i}o($oe,"determineFloorVisibleBasedOnPath");g();function Id(e,t){var r,n,i,s;if(Qm.is(e))return e.navigationTarget.flatMap(l=>Id(l,t));if(ff.is(e)){let l=t.Query.nearest(e,{types:["node"]});return(r=l==null?void 0:l[0])!=null&&r.feature.id?[l[0].feature.id]:[]}else if(St.is(e)){let l=t.Query.nearest(e,{types:["node"]});return(n=l==null?void 0:l[0])!=null&&n.feature.id?[l[0].feature.id]:[]}else if(pf.is(e)){let l=t.Query.nearest(e,{types:["node"]});return(i=l==null?void 0:l[0])!=null&&i.feature.id?[l[0].feature.id]:[]}else if(Au.is(e)){let l=t==null?void 0:t.getMVFFeatureById("entrance",e.id);return l!=null&&l.properties.node?[l==null?void 0:l.properties.node]:[]}else if(of.is(e)){let l=t==null?void 0:t.getMVFFeatureById("area",e.id);return(s=l==null?void 0:l.properties.destinationNodes)!=null?s:[]}else if(wo.is(e)){let l=t==null?void 0:t.getMVFFeatureById("space",e.id);return l==null?[]:l.properties.destinationNodes}else{if(Zd.is(e))return e.coordinates.reduce((l,c)=>{var h;let p=t.Query.nearest(c,{types:["node"]});return(h=p==null?void 0:p[0])!=null&&h.feature.id&&l.push(p[0].feature.id),l},[]);if(Oa.is(e)){let l=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return l!=null?l:[]}else return Nl.is(e)?e.spaces.flatMap(l=>{var c,p;return(p=(c=t==null?void 0:t.getMVFFeatureById("space",l.id))==null?void 0:c.properties.destinationNodes)!=null?p:[]}).filter(l=>typeof l=="string"):Vc.is(e)?e.nodes.map(l=>l.id):tf.is(e)?[e.id]:[]}}o(Id,"getNodesFromTarget");var Ese=Math.PI*.1,to,Ks,Qo,_d,Sd,Cd,Uy,hb,fu,Mse,db,Ose,wF=class wF{constructor(t,r,n,i){G(this,fu);G(this,to,{});G(this,Ks);G(this,Qo);G(this,_d);G(this,Sd);G(this,Cd);G(this,Uy);G(this,hb);q(this,Ks,r),q(this,Qo,t.features),q(this,_d,n),q(this,Sd,i)}get path(){return d(this,Qo).map(t=>d(this,Ks).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(d(this,to).departure)return d(this,to).departure;if(d(this,Qo).length===0||d(this,_d).length===0)return;let t=d(this,Qo)[0].properties.id,r=d(this,_d)[0];if(d(this,_d).length>1){for(let n of d(this,_d))if(Id(n,d(this,Ks)).includes(t)){r=n;break}}return d(this,to).departure=r,r}get destination(){if(d(this,to).destination)return d(this,to).destination;if(d(this,Qo).length===0||d(this,Sd).length===0)return;let t=d(this,Qo)[d(this,Qo).length-1].properties.id,r=d(this,Sd)[0];if(d(this,Sd).length>1){for(let n of d(this,Sd))if(Id(n,d(this,Ks)).includes(t)){r=n;break}}return d(this,to).destination=r,r}get coordinates(){return d(this,to).coordinates?d(this,to).coordinates:(d(this,to).coordinates=d(this,Qo).map(t=>new St(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),d(this,to).coordinates)}get distance(){return d(this,to).distance?d(this,to).distance:(d(this,to).distance=d(this,Qo).reduce((t,r)=>t+(r.properties.distance||0),0),d(this,to).distance)}get instructions(){if(d(this,Qo).length<2)return[];if(d(this,to).instructions)return d(this,to).instructions;let t=[],r=0;for(let n=0;n<d(this,Qo).length;n++){let i=d(this,Qo)[n],s=d(this,Qo)[n-1],l=d(this,Qo)[n+1],c=new St(i.geometry.coordinates[1],i.geometry.coordinates[0],i.properties.groupBy),p=ke(this,fu,Mse).call(this,{prevDirection:s,direction:i,nextDirection:l});r+=(s==null?void 0:s.properties.distance)||0;for(let h of p)h&&(t.push({action:h,distance:r,coordinate:c,node:d(this,Ks).getById("node",i.properties.id)}),r=0)}return d(this,to).instructions=t,d(this,to).instructions}toJSON(){return{directions:d(this,Qo),__type:"directions",from:d(this,_d),to:d(this,Sd)}}};to=new WeakMap,Ks=new WeakMap,Qo=new WeakMap,_d=new WeakMap,Sd=new WeakMap,Cd=new WeakMap,Uy=new WeakMap,hb=new WeakMap,fu=new WeakSet,Mse=o(function(t){var P,E;let{prevDirection:r,direction:n,nextDirection:i}=t,s=r&&d(this,Ks).getById("floor",r.properties.groupBy),l=d(this,Ks).getById("floor",n.properties.groupBy),c=i&&d(this,Ks).getById("floor",i.properties.groupBy),p=[];r||p.push({type:"Departure"});let h=d(this,Ks).getMVFFeatureByNodeId("connection",n.properties.id),y=h?d(this,Ks).getById("connection",h.id):void 0,b=h&&h.nodes.length>1,_=d(this,Ks).enterpriseMode&&(!n.properties.destination||!(h!=null&&h.nodes.includes(n.properties.destination))||!(h!=null&&h.nodes.includes(n.properties.id)));if(h&&!(!b||_))if(!d(this,Cd)||d(this,Cd)==="exit")p.push(ke(this,fu,db).call(this,"TakeConnection",l,c,y,h)),q(this,Cd,"take"),q(this,Uy,y),q(this,hb,h);else{let w=d(this,Ks).getMVFFeatureByNodeId("connection",(P=r==null?void 0:r.properties.id)!=null?P:""),O=d(this,Ks).getById("connection",(E=w==null?void 0:w.id)!=null?E:"");p.push(ke(this,fu,db).call(this,"ExitConnection",l,s,O,w)),q(this,Cd,"exit"),q(this,Uy,y),q(this,hb,h)}else d(this,Cd)==="take"?(p.push(ke(this,fu,db).call(this,"ExitConnection",l,s,d(this,Uy),d(this,hb))),q(this,Cd,"exit"),q(this,Uy,y)):c&&l.id!==c.id?p.push(ke(this,fu,db).call(this,"TakeConnection",l,c,y)):s&&s.id!==l.id?p.push(ke(this,fu,db).call(this,"ExitConnection",l,s,y)):p.push(ke(this,fu,Ose).call(this,r,n));return i||p.push({type:"Arrival"}),p},"#getActions"),db=o(function(t,r,n,i,s){var p,h;let l="none";if(r.elevation!=null&&(n==null?void 0:n.elevation)!=null){let y=r.elevation-n.elevation;y>0?l="down":y<0&&(l="up")}let c=(h=(p=i==null?void 0:i.type)!=null?p:s==null?void 0:s.type)!=null?h:"stairs";return{type:t,fromFloor:r,toFloor:n,direction:l,connection:i,connectionType:c}},"#createConnectionAction"),Ose=o(function(t,r){let n=r.properties.edges;if(!n||n.filter(l=>l.destination.properties.id!==(t==null?void 0:t.properties.id)&&l.destination.properties.id!==r.properties.destination).length===0)return null;let s=t?-wse(t.properties.angle,r.properties.angle):0;return Math.abs(s)>=Ese?{type:"Turn",bearing:Pse(s,Ese),referencePosition:"At"}:null},"#createTurnAction"),o(wF,"Directions");var bd=wF;g();var PF=class PF{constructor({nodes:t,geojsonCollection:r,connections:n,groupBy:i,multiplicativeDistanceWeightScaling:s}){x(this,"navigator");x(this,"connections");x(this,"getDirections",o((t,r,n,i)=>{let{accessible:s,smoothing:{enabled:l,radius:c},connectionIdWeightMap:p}=n,h=t.flatMap(w=>Id(w,i)),y=r.flatMap(w=>Id(w,i)),b=this.getExcludedNodeIds(n.excludedConnections).filter(w=>!h.includes(w)&&!y.includes(w)),_=this.getDisabledConnectionNodeIds(s).filter(w=>!h.includes(w)&&!y.includes(w)),C=new Map;for(let w in p){let O=i.getMVFFeatureById("connection",w);if(!O)continue;let D=this.navigator.graph.edges[O.nodes[0]];if(D){let A=D.find(k=>k.destination.properties.id===O.nodes[1]);A&&C.set(A,p[w])}}let P=this.navigator.getDirections({zones:n.zones.map(w=>{var O;return{geometry:w.geometry,cost:w.cost,map:(O=w.floor)==null?void 0:O.id}}),originIds:h,destinationNodeIds:y,excludedNodeIds:b,disabledConnectionNodeIds:_,simplify:{enabled:l,bufferRadius:c},overrideEdgeWeights:C,multiplicativeDistanceWeightScaling:!i.enterpriseMode});this.addCoordinateDirections(P,t,r);let E=new bd(P,i,t,r);if(!(E.distance===0&&new Set([...h,...y]).size===h.length+y.length))return E},"getDirections"));x(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"));x(this,"getDisabledConnectionNodeIds",o(t=>t===!1?[]:this.connections.reduce((r,n)=>n.accessible?r:r.concat(n.nodes),[]),"getDisabledConnectionNodeIds"));x(this,"addCoordinateDirections",o((t,[r],[n])=>{if(t.features.length){if(St.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(St.is(n)){let i=this.createDirectionFeature(n,0,0),s=t.features[t.features.length-1];s.properties.distance=this.navigator.getDistance(s.geometry.coordinates,[n.longitude,n.latitude]),s.properties.angle=this.navigator.getAngle(s.geometry.coordinates,[n.longitude,n.latitude]),t.features.push(i)}}},"addCoordinateDirections"));x(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 jv({nodes:t,geojsonCollection:this.createCollection(r),groupBy:i,multiplicativeDistanceWeightScaling:s}),this.connections=n}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((r,[n,i])=>r.concat(i.features.map(s=>(s.properties.map=n,s))),[])}}};o(PF,"DirectionsInternal");var mb=PF;g();g();g();g();g();g();function TF(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return Lse(this.cover(t,r),t,r,e)}o(TF,"default");function Lse(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,s=e._root,l={data:n},c=e._x0,p=e._y0,h=e._x1,y=e._y1,b,_,C,P,E,w,O,D;if(!s)return e._root=l,e;for(;s.length;)if((E=t>=(b=(c+h)/2))?c=b:h=b,(w=r>=(_=(p+y)/2))?p=_:y=_,i=s,!(s=s[O=w<<1|E]))return i[O]=l,e;if(C=+e._x.call(null,s.data),P=+e._y.call(null,s.data),t===C&&r===P)return l.next=s,i?i[O]=l:e._root=l,e;do i=i?i[O]=new Array(4):e._root=new Array(4),(E=t>=(b=(c+h)/2))?c=b:h=b,(w=r>=(_=(p+y)/2))?p=_:y=_;while((O=w<<1|E)===(D=(P>=_)<<1|C>=b));return i[D]=s,i[O]=l,e}o(Lse,"add");function Ase(e){var t,r,n=e.length,i,s,l=new Array(n),c=new Array(n),p=1/0,h=1/0,y=-1/0,b=-1/0;for(r=0;r<n;++r)isNaN(i=+this._x.call(null,t=e[r]))||isNaN(s=+this._y.call(null,t))||(l[r]=i,c[r]=s,i<p&&(p=i),i>y&&(y=i),s<h&&(h=s),s>b&&(b=s));if(p>y||h>b)return this;for(this.cover(p,h).cover(y,b),r=0;r<n;++r)Lse(this,l[r],c[r],e[r]);return this}o(Ase,"addAll");g();function EF(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,s=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,s=(n=Math.floor(t))+1;else{for(var l=i-r||1,c=this._root,p,h;r>e||e>=i||n>t||t>=s;)switch(h=(t<n)<<1|e<r,p=new Array(4),p[h]=c,c=p,l*=2,h){case 0:i=r+l,s=n+l;break;case 1:r=i-l,s=n+l;break;case 2:i=r+l,n=s-l;break;case 3:r=i-l,n=s-l;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=s,this}o(EF,"default");g();function MF(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}o(MF,"default");g();function OF(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(OF,"default");g();g();function ko(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}o(ko,"default");function LF(e,t,r){var n,i=this._x0,s=this._y0,l,c,p,h,y=this._x1,b=this._y1,_=[],C=this._root,P,E;for(C&&_.push(new ko(C,i,s,y,b)),r==null?r=1/0:(i=e-r,s=t-r,y=e+r,b=t+r,r*=r);P=_.pop();)if(!(!(C=P.node)||(l=P.x0)>y||(c=P.y0)>b||(p=P.x1)<i||(h=P.y1)<s))if(C.length){var w=(l+p)/2,O=(c+h)/2;_.push(new ko(C[3],w,O,p,h),new ko(C[2],l,O,w,h),new ko(C[1],w,c,p,O),new ko(C[0],l,c,w,O)),(E=(t>=O)<<1|e>=w)&&(P=_[_.length-1],_[_.length-1]=_[_.length-1-E],_[_.length-1-E]=P)}else{var D=e-+this._x.call(null,C.data),A=t-+this._y.call(null,C.data),k=D*D+A*A;if(k<r){var j=Math.sqrt(r=k);i=e-j,s=t-j,y=e+j,b=t+j,n=C.data}}return n}o(LF,"default");g();function AF(e){if(isNaN(y=+this._x.call(null,e))||isNaN(b=+this._y.call(null,e)))return this;var t,r=this._root,n,i,s,l=this._x0,c=this._y0,p=this._x1,h=this._y1,y,b,_,C,P,E,w,O;if(!r)return this;if(r.length)for(;;){if((P=y>=(_=(l+p)/2))?l=_:p=_,(E=b>=(C=(c+h)/2))?c=C:h=C,t=r,!(r=r[w=E<<1|P]))return this;if(!r.length)break;(t[w+1&3]||t[w+2&3]||t[w+3&3])&&(n=t,O=w)}for(;r.data!==e;)if(i=r,!(r=r.next))return this;return(s=r.next)&&delete r.next,i?(s?i.next=s:delete i.next,this):t?(s?t[w]=s:delete t[w],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[O]=r:this._root=r),this):(this._root=s,this)}o(AF,"default");function Dse(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}o(Dse,"removeAll");g();function DF(){return this._root}o(DF,"default");g();function FF(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}o(FF,"default");g();function NF(e){var t=[],r,n=this._root,i,s,l,c,p;for(n&&t.push(new ko(n,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(n=r.node,s=r.x0,l=r.y0,c=r.x1,p=r.y1)&&n.length){var h=(s+c)/2,y=(l+p)/2;(i=n[3])&&t.push(new ko(i,h,y,c,p)),(i=n[2])&&t.push(new ko(i,s,y,h,p)),(i=n[1])&&t.push(new ko(i,h,l,c,y)),(i=n[0])&&t.push(new ko(i,s,l,h,y))}return this}o(NF,"default");g();function kF(e){var t=[],r=[],n;for(this._root&&t.push(new ko(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var i=n.node;if(i.length){var s,l=n.x0,c=n.y0,p=n.x1,h=n.y1,y=(l+p)/2,b=(c+h)/2;(s=i[0])&&t.push(new ko(s,l,c,y,b)),(s=i[1])&&t.push(new ko(s,y,c,p,b)),(s=i[2])&&t.push(new ko(s,l,b,y,h)),(s=i[3])&&t.push(new ko(s,y,b,p,h))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}o(kF,"default");g();function Fse(e){return e[0]}o(Fse,"defaultX");function RF(e){return arguments.length?(this._x=e,this):this._x}o(RF,"default");g();function Nse(e){return e[1]}o(Nse,"defaultY");function BF(e){return arguments.length?(this._y=e,this):this._y}o(BF,"default");function H_(e,t,r){var n=new jF(t==null?Fse:t,r==null?Nse:r,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}o(H_,"quadtree");function jF(e,t,r,n,i,s){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=s,this._root=void 0}o(jF,"Quadtree");function kse(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}o(kse,"leaf_copy");var wa=H_.prototype=jF.prototype;wa.copy=function(){var e=new jF(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=kse(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]=kse(n));return e};wa.add=TF;wa.addAll=Ase;wa.cover=EF;wa.data=MF;wa.extent=OF;wa.find=LF;wa.remove=AF;wa.removeAll=Dse;wa.root=DF;wa.size=FF;wa.visit=NF;wa.visitAfter=kF;wa.x=RF;wa.y=BF;var xl,Zh,$F=class $F{constructor(t){G(this,xl,{});G(this,Zh);q(this,Zh,t)}getTreeByType(t,r,n){var l;if(d(this,xl)[t]||(d(this,xl)[t]={}),d(this,xl)[t][r]&&d(this,xl)[t][r][n])return d(this,xl)[t][r][n];d(this,xl)[t][r]||(d(this,xl)[t][r]={}),d(this,xl)[t][r][n]||(d(this,xl)[t][r][n]=H_());let i=d(this,xl)[t][r][n];i.x(c=>c.geometry.coordinates[1]),i.y(c=>c.geometry.coordinates[0]);let s=[];switch(t){case"node":s=((l=d(this,Zh).directions.navigator.graph.nodesByGroup.get(n))==null?void 0:l.filter(c=>c.properties.neighbors.length>0))||[];break;case"point-of-interest":s=d(this,Zh).mvfPoisByFloorId[n]||[];break;case"door":s=d(this,Zh).mvfEntrancesByFloorId[n]||[];break;case"annotation":s=d(this,Zh).mvfAnnotationsByFloorId[n]||[];break}return(s==null?void 0:s.length)>0&&i.addAll(s),i}};xl=new WeakMap,Zh=new WeakMap,o($F,"QueryCache");var lE=$F;var S9e=Cs.object({limit:Cs.enum(["same-floor","same-elevation"]).optional(),radius:Cs.number().optional(),types:Cs.array(Cs.enum(["node","point-of-interest"])).min(1)}),kp,X_,GF=class GF{constructor(t){G(this,kp);G(this,X_);q(this,kp,t),q(this,X_,new lE(d(this,kp)))}nearest(t,r){try{S9e.parse(r)}catch(l){ce.error(l);return}let n=mx(t);if(!n)return;let i=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let l of d(this,kp).getByType("floor-stack")){let c=l.defaultFloor;c&&i.push(c.id)}else if(r.limit==="same-elevation"){let l=d(this,kp).floorsById[n.floorId];if(l){let c=l==null?void 0:l.elevation;c&&(i=d(this,kp).getByType("floor-stack").map(p=>{var h;return(h=p.floors.find(y=>y.elevation===c))==null?void 0:h.id}).filter(Boolean))}}let s=[];for(let l of Tse(r.types))for(let c of i){let p=d(this,X_).getTreeByType(l,d(this,kp).mapName,c).find(n.latitude,n.longitude,r.radius);if(p){let h=d(this,kp).getById(l,p==null?void 0:p.properties.id);h&&s.push({distance:ic([n.longitude,n.latitude],p.geometry.coordinates),feature:h})}}return s.sort((l,c)=>l.distance-c.distance)}};kp=new WeakMap,X_=new WeakMap,o(GF,"Query");var W_=GF;g();g();var Y_,UF=class UF{constructor(t){G(this,Y_);q(this,Y_,t||[])}get raw(){return d(this,Y_)}};Y_=new WeakMap,o(UF,"OpeningHours");var uE=UF;var Es,ft,Qn,Vy=class Vy extends Co{constructor(r,n){super(n.mvfData.id);x(this,"__type",Vy.__type);x(this,"id","loc_");x(this,"name","");x(this,"externalId");x(this,"description");x(this,"logo");x(this,"phone");x(this,"social",[]);x(this,"images",[]);x(this,"links",[]);x(this,"website");x(this,"icon");G(this,Es);G(this,ft,{});G(this,Qn);q(this,Es,r),q(this,Qn,n.mvfData);for(let i in n.mvfData)i==="links"?this.links=n.mvfData.links.map(s=>new $d({mvfData:s})):i==="pictures"?this.images=n.mvfData.pictures.map(s=>{var l;return s.url?new Ud({mvfData:re(R({},s),{url:(l=s.url)!=null?l:""}),mapData:d(this,Es)}):void 0}).filter(s=>s!=null):i==="website"?n.mvfData.website&&(this.website=new $d({mvfData:n.mvfData.website})):i==="icon"?n.mvfData.icon&&(this.icon=new Ud({mvfData:{url:n.mvfData.icon},mapData:d(this,Es)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return d(this,Qn)[i]}})}static is(r){return r.__type===Vy.__type}get spaces(){if(d(this,ft).spaces)return d(this,ft).spaces;if(d(this,Qn).spaces==null)return d(this,ft).spaces=[],d(this,ft).spaces;d(this,ft).spaces=[];for(let r=0;r<d(this,Qn).spaces.length;r++){let n=d(this,Es).getById("space",d(this,Qn).spaces[r].id);n&&d(this,ft).spaces.push(n)}return d(this,ft).spaces}get points(){if(d(this,ft).points)return d(this,ft).points;if(d(this,Qn).spaces==null)return d(this,ft).points=[],d(this,ft).points;d(this,ft).points=[];for(let r=0;r<d(this,Qn).spaces.length;r++){let n=d(this,Es).getById("point-of-interest",d(this,Qn).spaces[r].id);n&&d(this,ft).points.push(n)}return d(this,ft).points}get doors(){if(d(this,ft).doors)return d(this,ft).doors;if(d(this,Qn).entrances==null)return d(this,ft).doors=[],d(this,ft).doors;d(this,ft).doors=[];for(let r=0;r<d(this,Qn).entrances.length;r++){let n=d(this,Es).getById("door",d(this,Qn).entrances[r].id);n&&d(this,ft).doors.push(n)}return d(this,ft).doors}get connections(){var n;if(d(this,ft).connections)return d(this,ft).connections;if(d(this,Qn).connections==null)return d(this,ft).connections=[],d(this,ft).connections;let r=new Set;for(let i=0;i<d(this,Qn).connections.length;i++){let s=d(this,Qn).connections[i],l=d(this,Es).mvfConnectionsById[s],p=(l==null?[]:l.nodes).map(h=>d(this,Es).getById("node",h)).filter(Boolean);for(let h of p){if(h==null)continue;let y=Fc([h.coordinate.longitude,h.coordinate.latitude]),_=((n=d(this,Es).connectionSpaceIdsByLatLon[y])!=null?n:[]).map(C=>d(this,Es).connectionsById[C]).filter(C=>C!=null);for(let C of _)r.add(C)}}return d(this,ft).connections=Array.from(r),d(this,ft).connections}get annotations(){if(d(this,ft).annotations)return d(this,ft).annotations;if(d(this,Qn).annotations==null)return d(this,ft).annotations=[],d(this,ft).annotations;d(this,ft).annotations=[];for(let r=0;r<d(this,Qn).annotations.length;r++){let n=d(this,Es).getById("annotation",d(this,Qn).annotations[r].id);n&&d(this,ft).annotations.push(n)}return d(this,ft).annotations}get categories(){return d(this,ft).categories?d(this,ft).categories:d(this,Qn).categories==null?(d(this,ft).categories=[],d(this,ft).categories):(d(this,ft).categories=d(this,Qn).categories.map(r=>d(this,Es).getById("location-category",r)).filter(r=>r!=null),d(this,ft).categories)}get mapObjects(){return d(this,ft).mapObjects?d(this,ft).mapObjects:d(this,Qn).obstructions==null?(d(this,ft).mapObjects=[],d(this,ft).mapObjects):(d(this,ft).mapObjects=d(this,Qn).obstructions.map(r=>d(this,Es).getById("object",r.id)).filter(r=>r!=null),d(this,ft).mapObjects)}get areas(){return d(this,ft).areas?d(this,ft).areas:d(this,Qn).areas==null?(d(this,ft).areas=[],d(this,ft).areas):(d(this,ft).areas=d(this,Qn).areas.map(r=>d(this,Es).getById("area",r.id)).filter(r=>r!=null),d(this,ft).areas)}get focusTarget(){if(d(this,ft).focusTarget)return d(this,ft).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);return d(this,ft).focusTarget=r,r}get openingHours(){var r;return d(this,ft).openingHours?d(this,ft).openingHours:(d(this,ft).openingHours=new uE((r=d(this,Qn).openingHoursSpecification)!=null?r:[]),d(this,ft).openingHours)}get navigationTarget(){if(d(this,ft).navigationTarget)return d(this,ft).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,ft).navigationTarget=r,r}toJSON(){return{__type:Vy.__type,id:this.id,name:this.name}}};Es=new WeakMap,ft=new WeakMap,Qn=new WeakMap,o(Vy,"LocationProfile"),x(Vy,"__type","location-profile");var VF=Vy,Qm=VF;g();var Kh,Xa,qy,zy=class zy extends Co{constructor(r,n){super(n.mvfData.id);x(this,"__type",zy.__type);x(this,"id","cat_");x(this,"name","");x(this,"icon","");G(this,Kh);G(this,Xa,{});G(this,qy);q(this,Kh,r),q(this,qy,n.mvfData);for(let i in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return d(this,qy)[i]}})}static is(r){return r.__type===zy.__type}get parent(){return d(this,Xa).parent?d(this,Xa).parent:(d(this,Xa).parent=d(this,qy).parent?d(this,Kh).getById("location-category",d(this,qy).parent):void 0,d(this,Xa).parent)}get children(){return d(this,Xa).children?d(this,Xa).children:(d(this,Xa).children=d(this,Kh).locationCategoriesByParentId[this.id]||[],d(this,Xa).children)}get locationProfiles(){if(d(this,Xa).locationProfiles)return d(this,Xa).locationProfiles;let r=[];for(let n of d(this,Kh).locationProfilesByCategoryId[this.id]||[]){let i=d(this,Kh).getById("location-profile",n.id);i&&r.push(i)}return d(this,Xa).locationProfiles=r,r}toJSON(){return{__type:zy.__type,id:this.id,name:this.name}}};Kh=new WeakMap,Xa=new WeakMap,qy=new WeakMap,o(zy,"LocationCategory"),x(zy,"__type","location-category");var zF=zy,_x=zF;var Ct,cE,Rse,gb,qF=class qF extends Lt{constructor(r,n){var c,p,h,y,b;super();G(this,cE);x(this,"Analytics");G(this,Ct,{});x(this,"Query");x(this,"mvf");x(this,"outdoorViewToken");x(this,"spaceIdsByDestinationNodeId");x(this,"objectEntranceNodeIdsByObstructionId");x(this,"obstructionIdByEntranceId");x(this,"venue");x(this,"tokenManager");x(this,"directions");x(this,"enterpriseMode",!1);x(this,"nodesById");x(this,"spacesById");x(this,"floorsById");x(this,"floorStacksById");x(this,"facadesById");x(this,"facadesBySpaceId");x(this,"connectionsById");x(this,"objectsById");x(this,"doorsById");x(this,"pointsOfInterestById");x(this,"annotationsById");x(this,"areasById");x(this,"locationProfilesById");x(this,"locationCategoriesById");x(this,"locationProfilesByExternalId");x(this,"locationsById");x(this,"locationProfilesByCategoryId");x(this,"locationCategoriesByParentId");x(this,"categoriesById");x(this,"doorsByNodeId");x(this,"mvfLocationsBySpaceId");x(this,"locationIdsByNodeId");x(this,"spaceIdsByNodeId");x(this,"mvfAnnotationsById");x(this,"mvfConnectionsById");x(this,"mvfConnectionsByNodeId");x(this,"mvfConnectionIdsByLatLon");x(this,"mvfEntrancesById");x(this,"mvfNodesById");x(this,"mvfObstructionById");x(this,"mvfSpacesById");x(this,"mvfFloorsById");x(this,"mvfFloorStacksById");x(this,"mvfAreasById");x(this,"connectionSpaceIdsByLatLon");x(this,"locationProfilesByAttachedFeatureId");x(this,"spacesByExternalId");x(this,"nodesByExternalId");x(this,"objectsByExternalId");x(this,"poisByExternalId");x(this,"floorsByExternalId");x(this,"floorStacksByExternalId");x(this,"doorsByExternalId");x(this,"areasByExternalId");x(this,"connectionsByExternalId");x(this,"locationsByExternalId");x(this,"categoriesByExternalId");x(this,"mvfNodesByFloorId");x(this,"mvfSpacesByFloorId");x(this,"mvfPoisByFloorId");x(this,"mvfEntrancesByFloorId");x(this,"mvfAnnotationsByFloorId");x(this,"localePacksUrls");x(this,"currentLanguage");x(this,"languagePacks",{});x(this,"tilesets",{});x(this,"binaryBundle");x(this,"envControl");x(this,"getMapDataOptions");G(this,gb);x(this,"getDirectionsMultiDestination",o((r,n,i)=>this.getDirections(r,n,re(R({},i),{multiDestination:!0})),"getDirectionsMultiDestination"));x(this,"getDirections",o((r,n,i)=>{let{accessible:s=!1,smoothing:l=!0,multiDestination:c=!1}=i||{},p=typeof l=="object"?l.enabled:l,h=typeof l=="object"?l.radius:void 0,y=(i==null?void 0:i.zones)||[],b={accessible:s,zones:y,smoothing:{enabled:p!=null?p:!0,radius:h!=null?h:.75},excludedConnections:(i==null?void 0:i.excludedConnections)||[],connectionIdWeightMap:(i==null?void 0:i.connectionIdWeightMap)||{}};if(c&&Array.isArray(n)){let _=Array.isArray(r)?r:[r],C=[];for(let P of n){let E=Array.isArray(P)?P:[P],w=this.directions.getDirections(_,E,b,this);if(!w){ce.error("getDirections failed due to missing directions for one of the segments");return}_=E,C.push(w)}return C}else{let _=Array.isArray(r)?r:[r],C=Array.isArray(n)?n:[n];if(Array.isArray(C[0])){ce.error("getDirections does not support multi-destination without multisegment option");return}return _[0].id&&C[0].id&&this.Analytics.sendGetDirectionsEvent(_[0].id,C[0].id),this.directions.getDirections(_,C,b,this)}},"getDirections"));x(this,"transformImageRequest",o(async r=>{var i;if(this.enterpriseMode||!this.getMapDataOptions)return{url:r};if(!Vte(r))return{url:r};if(zte(r))return{url:r};let n=wS(r);if(!n)return{url:r};try{let s=await((i=this.tokenManager)==null?void 0:i.getSasTokensAsync()),l=s==null?void 0:s[n.mapId];if(l==null)throw new Error("SAS token not found");let[c]=r.split("?");return{url:"".concat(c,"?").concat(l.token)}}catch(s){return ce.error("Failed to append SAS token to image request. Requests for private images may fail.",s),{url:r}}},"transformImageRequest"));let i=(c=n==null?void 0:n.env)!=null?c:bh();if(this.envControl=i,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new q0,this.localePacksUrls=(p=n==null?void 0:n.localePacksUrls)!=null?p:{},this.mvf=r,this.outdoorViewToken=n==null?void 0:n.outdoorViewToken,this.getMapDataOptions=n==null?void 0:n.getMapDataOptions,((h=r["tileset.json"])==null?void 0:h.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 _ of r["tileset.json"].others)this.tilesets[_.key]=_;this.enterpriseMode=(y=n==null?void 0:n.enterprise)!=null?y:!1,this.tokenManager=n==null?void 0:n.tokenManager;let s=mG(r,this);this.nodesById=s.nodesById,this.spacesById=s.spacesById,this.floorsById=s.floorsById,this.floorStacksById=s.floorStacksById,this.facadesById=s.facadesById,this.facadesBySpaceId=s.facadesBySpaceId,this.connectionsById=s.connectionsById,this.objectsById=s.objectsById,this.doorsById=s.doorsById,this.pointsOfInterestById=s.poisById,this.annotationsById=s.annotationsById,this.areasById=s.areasById,this.locationProfilesById=s.locationProfilesById,this.locationCategoriesById=s.locationCategoriesById,this.locationProfilesByCategoryId=s.locationProfilesByCategoryId,this.locationCategoriesByParentId=s.locationCategoriesByParentId,this.spacesByExternalId=s.spacesByExternalId,this.nodesByExternalId=s.nodesByExternalId,this.objectsByExternalId=s.objectsByExternalId,this.floorsByExternalId=s.floorsByExternalId,this.locationProfilesByExternalId=s.locationProfilesByExternalId,this.floorStacksByExternalId=s.floorStacksByExternalId,this.poisByExternalId=s.poisByExternalId,this.doorsByExternalId=s.doorsByExternalId,this.areasByExternalId=s.areasByExternalId,this.mvfAnnotationsById=s.mvfAnnotationsById,this.mvfConnectionsById=s.mvfConnectionsById,this.mvfConnectionsByNodeId=s.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=s.mvfConnectionIdsByLatLon,this.mvfEntrancesById=s.mvfEntrancesById,this.mvfNodesById=s.mvfNodesById,this.mvfObstructionById=s.mvfObstructionById,this.mvfSpacesById=s.mvfSpacesById,this.mvfFloorsById=s.mvfFloorsById,this.mvfFloorStacksById=s.mvfFloorStacksById,this.mvfNodesByFloorId=s.mvfNodesByFloorId,this.mvfSpacesByFloorId=s.mvfSpacesByFloorId,this.mvfPoisByFloorId=s.mvfPoisByFloorId,this.mvfEntrancesByFloorId=s.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=s.mvfAnnotationsByFloorId,this.mvfAreasById=s.mvfAreasById,this.doorsByNodeId=s.doorsByNodeId,this.spaceIdsByDestinationNodeId=s.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=s.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=s.obstructionIdByEntranceId;let l=hG(r,this);if(this.locationsById=l.locationsById,this.categoriesById=l.categoriesById,this.mvfLocationsBySpaceId=l.mvfLocationsBySpaceId,this.locationIdsByNodeId=l.locationIdsByNodeId,this.connectionSpaceIdsByLatLon=s.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=s.locationProfilesByAttachedFeatureId,this.spaceIdsByNodeId=l.spaceIdsByNodeId,this.connectionsByExternalId=l.connectionsByExternalId,this.locationsByExternalId=l.locationsByExternalId,this.categoriesByExternalId=l.categoriesByExternalId,l.venue.name!=null){this.venue=new MC(this,{mvfData:l.venue});let _={};for(let C in l.mvfLocationsById)_[C]=l.mvfLocationsById[C];for(let C in l.locationInstancesById)_[C]=l.locationInstancesById[C];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":_,"enterprise-category":l.mvfCategoriesById,"floor-stack":s.mvfFloorStacksById,floor:s.mvfFloorsById}},(b=n==null?void 0:n.languagePacks)==null||b.forEach(({language:C,localePack:P})=>{this.languagePacks[C.code]=_9(P)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new W_(this),this.directions=new mb({nodes:r["node.geojson"],geojsonCollection:r.enterprise?r.space:r.obstruction,connections:r["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}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 St(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,Ct).spaces==null&&(d(this,Ct).spaces=globalThis.Object.values(this.spacesById)),d(this,Ct).spaces}get objects(){return d(this,Ct).objects==null&&(d(this,Ct).objects=globalThis.Object.values(this.objectsById)),d(this,Ct).objects}get connections(){return d(this,Ct).connections==null&&(d(this,Ct).connections=globalThis.Object.values(this.connectionsById)),d(this,Ct).connections}get floors(){return d(this,Ct).floors==null&&(d(this,Ct).floors=globalThis.Object.values(this.floorsById)),d(this,Ct).floors}get floorStacks(){return d(this,Ct).floorStacks==null&&(d(this,Ct).floorStacks=globalThis.Object.values(this.floorStacksById)),d(this,Ct).floorStacks}get facades(){return d(this,Ct).facades==null&&(d(this,Ct).facades=globalThis.Object.values(this.facadesById)),d(this,Ct).facades}get doors(){return d(this,Ct).doors==null&&(d(this,Ct).doors=globalThis.Object.values(this.doorsById)),d(this,Ct).doors}get pointsOfInterest(){return d(this,Ct).pointsOfInterest==null&&(d(this,Ct).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),d(this,Ct).pointsOfInterest}get annotations(){return d(this,Ct).annotations==null&&(d(this,Ct).annotations=globalThis.Object.values(this.annotationsById)),d(this,Ct).annotations}get areas(){return d(this,Ct).areas==null&&(d(this,Ct).areas=globalThis.Object.values(this.areasById)),d(this,Ct).areas}get nodes(){return d(this,Ct).nodes==null&&(d(this,Ct).nodes=globalThis.Object.values(this.nodesById)),d(this,Ct).nodes}get locations(){return d(this,Ct).locations==null&&(d(this,Ct).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return d(this,Ct).categories==null&&(d(this,Ct).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return d(this,Ct).locationProfiles==null&&(d(this,Ct).locationProfiles=globalThis.Object.values(this.locationProfilesById)),d(this,Ct).locationProfiles}get locationCategories(){return d(this,Ct).locationCategories==null&&(d(this,Ct).locationCategories=globalThis.Object.values(this.locationCategoriesById)),d(this,Ct).locationCategories}get mvfFloors(){return d(this,Ct).mvfFloors==null&&(d(this,Ct).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),d(this,Ct).mvfFloors}get mvfFloorStacks(){return d(this,Ct).mvfFloorStacks==null&&(d(this,Ct).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),d(this,Ct).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){switch(r){case"location-profile":return this.locationProfilesById[n];case"location-category":return this.locationCategoriesById[n];case"space":return this.spacesById[n];case"floor":return this.floorsById[n];case"floor-stack":return this.floorStacksById[n];case"facade":return this.facadesById[n];case"node":return this.nodesById[n];case"door":return this.doorsById[n];case"connection":let i=this.connectionsById[n];return i==null&&(i=ke(this,cE,Rse).call(this,this.mvfConnectionsById[n])),i;case"object":return this.objectsById[n];case"point-of-interest":return this.pointsOfInterestById[n];case"annotation":return this.annotationsById[n];case"area":return this.areasById[n];case"enterprise-location":return this.locationsById[n];case"enterprise-category":return this.categoriesById[n];default:return}}getByExternalId(r,n){var i,s,l,c,p,h,y,b,_,C,P,E;switch(r){case"location-profile":return(i=this.locationProfilesByExternalId[n])!=null?i:[];case"location-category":return[];case"space":return(s=this.spacesByExternalId[n])!=null?s:[];case"floor":return(l=this.floorsByExternalId[n])!=null?l:[];case"floor-stack":return(c=this.floorStacksByExternalId[n])!=null?c:[];case"node":return(p=this.nodesByExternalId[n])!=null?p:[];case"door":return(h=this.doorsByExternalId[n])!=null?h:[];case"connection":return(y=this.connectionsByExternalId[n])!=null?y:[];case"object":return(b=this.objectsByExternalId[n])!=null?b:[];case"point-of-interest":return(_=this.poisByExternalId[n])!=null?_:[];case"area":return(C=this.areasByExternalId[n])!=null?C:[];case"enterprise-location":return(P=this.locationsByExternalId[n])!=null?P:[];case"enterprise-category":return(E=this.categoriesByExternalId[n])!=null?E:[];default:return[]}}getMapDataById(r){var n,i,s,l,c,p,h,y,b,_;return(_=(b=(y=(h=(p=(c=(l=(s=(i=(n=this.spacesById[r])!=null?n:this.floorsById[r])!=null?i:this.floorStacksById[r])!=null?s:this.facadesById[r])!=null?l:this.nodesById[r])!=null?c:this.doorsById[r])!=null?p:this.connectionsById[r])!=null?h:this.objectsById[r])!=null?y:this.pointsOfInterestById[r])!=null?b:this.annotationsById[r])!=null?_: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,s){var p,h;if(!this.currentLanguage)return s;let{code:l}=this.currentLanguage,c=(h=(p=this.languagePacks[l])==null?void 0:p.optimized)==null?void 0:h[r];if(c){let y=c[i];if(y!=null&&y[n]!==void 0)return y[n]}return s}async changeLanguage(r){var c;let n=r.toLowerCase();if(!n){ce.error("language code must be defined");return}if(!this.currentLanguage){ce.error("languageCode feature is not supported");return}let i=this.currentLanguage.code,s=(c=this.venue)==null?void 0:c.languages.find(({code:p})=>p.toLowerCase()===n.toLowerCase());if(!s){ce.warn("language not found");return}if(i===s.code)return;let l=this.languagePacks[s.code];if(!l){let p=this.localePacksUrls[s.code];if(!p){ce.error("locale packs url not found for ".concat(s.code));return}d(this,gb)&&d(this,gb).abort();let h=new AbortController;q(this,gb,h);let y;try{y=await Gte(p,{signal:h.signal})}catch(b){ce.error("failed downloading language pack",b);return}if(!y||h.signal.aborted)return;l=_9(y),this.languagePacks[s.code]=l}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=s,this.publish("language-change",this.currentLanguage)}getDistance(r,n){let i=mx(r),s=mx(n);return ic([i.longitude,i.latitude],[s.longitude,s.latitude])}async toJSONBundle({downloadLanguagePacks:r=!0}={}){var i;let n=[];if(r&&this.enterpriseMode){let s=new AbortController;for(let l of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[l.code]){let c=await b9(this.localePacksUrls[l.code],{signal:s.signal}),p=await Q1(c);p&&n.push({language:{code:l.code,name:l.name},localePack:p})}}catch(c){ce.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){ce.error("binary bundle not found");return}let n=[];if(r&&this.enterpriseMode){let s=new AbortController;for(let l of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[l.code]){let c=await b9(this.localePacksUrls[l.code],{signal:s.signal});c&&n.push({language:{code:l.code,name:l.name},localePack:c})}}catch(c){ce.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,Ct)))d(this,Ct)[r]=null}};Ct=new WeakMap,cE=new WeakSet,Rse=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 s=Fc([i.coordinate.longitude,i.coordinate.latitude]),l=this.connectionSpaceIdsByLatLon[s];return l==null?void 0:l.map(p=>this.connectionsById[p]).find(p=>p!=null)},"#getConnectionFromMVFConnection"),gb=new WeakMap,o(qF,"MapDataInternal");var Gy=qF;var vb,Hy,Z_,Rp,yb=class yb extends Mu{constructor(r,n){super(n.mvfData.id,r);x(this,"__type",yb.__type);G(this,vb);G(this,Hy);G(this,Z_);G(this,Rp,{});q(this,vb,n.mvfData),q(this,Hy,r),q(this,Z_,n.floorStackId)}static is(r){return r.__type===yb.__type}get floorStack(){return d(this,Hy).getById("floor-stack",d(this,Z_))}get spaces(){if(!d(this,Rp).spaces){d(this,Rp).spaces=[];for(let r of d(this,vb).spaces){let n=d(this,Hy).getById("space",r.spaceId);n&&d(this,Rp).spaces.push(n)}}return d(this,Rp).spaces}get center(){if(!d(this,Rp).center){let r={type:"FeatureCollection",features:[]};for(let i of this.spaces){let s=d(this,Hy).mvfSpacesById[i.id];s&&r.features.push(s)}if(r.features.length===0)throw new Error("No geometry found for facade!");let n=kc(r);d(this,Rp).center=new St(n.geometry.coordinates[1],n.geometry.coordinates[0],d(this,vb).spaces[0].floorId)}return d(this,Rp).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};vb=new WeakMap,Hy=new WeakMap,Z_=new WeakMap,Rp=new WeakMap,o(yb,"Facade"),x(yb,"__type","facade");var HF=yb,Nl=HF;export{St as a,tf as b,wo as c,Bb as d,Nl as e,Vc as f,Ix as g,ae as h,B7 as i,AAe as j,Sse as k,Cse as l,I9e as m};
|