@mappedin/mappedin-js 6.0.0-rc.2 → 6.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +42 -2
- package/lib/esm/{GLTFExporter-Z6JPGY7L.js → GLTFExporter-RSA32FAS.js} +2 -2
- package/lib/esm/{GLTFLoader-QCSKNB7G.js → GLTFLoader-FLMCN6TW.js} +2 -2
- package/lib/esm/{browser-I5Q2RPA3.js → browser-4FMFOYKX.js} +2 -2
- package/lib/esm/chunk-43XLQYI5.js +193 -0
- package/lib/esm/chunk-43XLQYI5.js.map +7 -0
- package/lib/esm/{chunk-L4AKE3TV.js → chunk-4AZZH27P.js} +2 -2
- package/lib/esm/{chunk-W5WDIXXO.js → chunk-K3PVENYC.js} +2 -2
- package/lib/esm/{chunk-7SIXH4EE.js → chunk-LTNJEB3M.js} +2 -2
- package/lib/esm/chunk-UVZJOVQM.js +2 -0
- package/lib/esm/{chunk-AJPWEERG.js.map → chunk-UVZJOVQM.js.map} +1 -1
- package/lib/esm/chunk-WJDRJJIM.js +2153 -0
- package/lib/esm/chunk-WJDRJJIM.js.map +7 -0
- package/lib/esm/index.css +1 -1
- package/lib/esm/index.css.map +3 -3
- package/lib/esm/index.d.ts +280 -82
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-T3HA7VGW.css → inspector-4GBSTGDH.css} +2 -2
- package/lib/esm/{inspector-T3HA7VGW.css.map → inspector-4GBSTGDH.css.map} +3 -3
- package/lib/esm/{inspector-YD6373IB.js → inspector-BHVDJXVZ.js} +2 -2
- package/lib/esm/{internal-JKAX4KK2.js → internal-3NNUFZ25.js} +2 -2
- package/lib/esm/{internal-VKD5KMH3.css → internal-CH27ONAB.css} +2 -2
- package/lib/esm/{internal-VKD5KMH3.css.map → internal-CH27ONAB.css.map} +3 -3
- package/lib/esm/{outdoor-context-v5-TZEP6AEK.js → outdoor-context-v5-6IFFZHAJ.js} +2 -2
- package/lib/esm/{text3d-OX5R3UZU.js → text3d-EKD5MTTV.js} +2 -2
- package/lib/esm/{text3d-OX5R3UZU.js.map → text3d-EKD5MTTV.js.map} +1 -1
- package/lib/esm/text3d-ZPCG4PKJ.css +2 -0
- package/lib/esm/text3d-ZPCG4PKJ.css.map +7 -0
- package/lib/index-rn.js +193 -193
- package/lib/index.css +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-6KGIA4EU.js +0 -3
- package/lib/esm/chunk-6KGIA4EU.js.map +0 -7
- package/lib/esm/chunk-AJPWEERG.js +0 -2
- package/lib/esm/chunk-VI2AJVL2.js +0 -2343
- package/lib/esm/chunk-VI2AJVL2.js.map +0 -7
- /package/lib/esm/{GLTFExporter-Z6JPGY7L.js.map → GLTFExporter-RSA32FAS.js.map} +0 -0
- /package/lib/esm/{GLTFLoader-QCSKNB7G.js.map → GLTFLoader-FLMCN6TW.js.map} +0 -0
- /package/lib/esm/{browser-I5Q2RPA3.js.map → browser-4FMFOYKX.js.map} +0 -0
- /package/lib/esm/{chunk-L4AKE3TV.js.map → chunk-4AZZH27P.js.map} +0 -0
- /package/lib/esm/{chunk-W5WDIXXO.js.map → chunk-K3PVENYC.js.map} +0 -0
- /package/lib/esm/{chunk-7SIXH4EE.js.map → chunk-LTNJEB3M.js.map} +0 -0
- /package/lib/esm/{inspector-YD6373IB.js.map → inspector-BHVDJXVZ.js.map} +0 -0
- /package/lib/esm/{internal-JKAX4KK2.js.map → internal-3NNUFZ25.js.map} +0 -0
- /package/lib/esm/{outdoor-context-v5-TZEP6AEK.js.map → outdoor-context-v5-6IFFZHAJ.js.map} +0 -0
|
@@ -0,0 +1,2153 @@
|
|
|
1
|
+
import{$ as U3,$a as mS,A as D3,Aa as Q3,Ab as FS,B as cl,Ba as q3,Bb as y0,C as k3,Ca as eS,Cb as ES,D as L3,Da as tS,Db as DS,E as t0,Ea as rS,Eb as kS,F as pi,Fa as c0,Fb as LS,G as Kh,Ga as oS,Gb as AS,H as os,Ha as nS,Hb as RS,I as pl,Ia as jc,Ib as ui,J as A3,Ja as iS,Jb as _S,K as R3,Ka as sS,Kb as _t,L as _3,La as og,Lb as BS,M as B3,Ma as p0,Mb as NS,N as xu,Na as aS,Nb as fi,O as co,Oa as Cu,Ob as jS,P as N3,Pa as Gc,Pb as or,Q as r0,Qa as ng,Qb as Cn,R as di,Ra as Uc,Rb as nr,S as j3,Sa as Vc,T as Rc,Ta as lS,U as D,Ua as d0,V as X,W as wO,Wa as cS,X as Qh,Xa as pS,Y as _c,Ya as dS,Z as vu,Za as ig,_ as G3,_a as uS,aa as V3,ab as fS,ba as H3,bb as hS,c as L,ca as ns,cb as gS,d as fr,da as $3,db as Tu,e as n3,ea as W3,eb as wo,f as Jb,fa as is,fb as yS,g as li,ga as n0,gb as bS,h as w3,ha as pa,hb as xS,i as Zh,ia as yt,ib as u0,j as O3,ja as qh,jb as vS,k as ci,ka as Iu,kb as m0,l as Xh,la as i0,lb as f0,m as P3,ma as eg,mb as IS,n as Yh,na as s0,nb as SS,o as ll,oa as a0,ob as CS,p as yu,pa as l0,pb as TS,q as qb,qa as X3,qb as MS,r as Ac,ra as Bc,rb as h0,s as nt,sa as Y3,sb as da,t as Jh,ta as Nc,tb as sg,u as Ie,ua as Su,ub as wS,v as rs,va as J3,vb as OS,w as bu,wa as K3,wb as PS,x as e0,xb as Hc,y as F3,ya as tg,yb as g0,z as E3,za as rg,zb as ag}from"./chunk-43XLQYI5.js";import{X as o0,ea as Z3,w as z3}from"./chunk-LTNJEB3M.js";import{a as mi}from"./chunk-K3PVENYC.js";import{$ as Oe,Aa as $h,B as jh,Ba as x3,C as Gh,Ca as la,D as l3,Da as ca,E as c3,Ea as ts,Fa as Wh,G as p3,Ga as v3,H as Le,Ha as I3,I as Se,Ja as si,M as d3,N as u3,O as m3,P as Uh,Q as ae,R as Qt,S as f3,T as qi,Ta as Lc,U as Dc,V as es,W as qt,Xa as zh,Y as Mr,Ya as S3,Z as Yr,_ as Vh,aa as Sn,ab as C3,b as Bh,c as fu,ca as ia,cb as ai,d as Kb,da as h3,e as Qi,ea as Qb,eb as T3,f as i3,g as hu,ga as sa,gb as M3,oa as aa,p as s3,pa as g3,qa as Hh,r as a3,ra as y3,ta as gu,ya as b3,z as Nh,za as kc}from"./chunk-4AZZH27P.js";import{a as d,b as y}from"./chunk-UVZJOVQM.js";import{b as oa,c as na,d as Ec,e as u,f as s,g as S,h as w,i as W}from"./chunk-ROCNZJLL.js";var V7=oa((Dx,kx)=>{d();(function(e,r){typeof Dx=="object"&&typeof kx<"u"?kx.exports=r():typeof define=="function"&&define.amd?define(r):(e=e||self,e.TinyQueue=r())})(Dx,function(){"use strict";var e=function(o,n){if(o===void 0&&(o=[]),n===void 0&&(n=r),this.data=o,this.length=this.data.length,this.compare=n,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)};e.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},e.prototype.pop=function(){if(this.length!==0){var o=this.data[0],n=this.data.pop();return this.length--,this.length>0&&(this.data[0]=n,this._down(0)),o}},e.prototype.peek=function(){return this.data[0]},e.prototype._up=function(o){for(var n=this,i=n.data,a=n.compare,l=i[o];o>0;){var c=o-1>>1,p=i[c];if(a(l,p)>=0)break;i[o]=p,o=c}i[o]=l},e.prototype._down=function(o){for(var n=this,i=n.data,a=n.compare,l=this.length>>1,c=i[o];o<l;){var p=(o<<1)+1,m=i[p],f=p+1;if(f<this.length&&a(i[f],m)<0&&(p=f,m=i[f]),a(m,c)>=0)break;i[o]=m,o=p}i[o]=c};function r(t,o){return t<o?-1:t>o?1:0}return e})});var $7=oa((cge,Lx)=>{"use strict";d();var Hy=V7();Hy.default&&(Hy=Hy.default);Lx.exports=H7;Lx.exports.default=H7;function H7(e,r,t){r=r||1;for(var o,n,i,a,l=0;l<e[0].length;l++){var c=e[0][l];(!l||c[0]<o)&&(o=c[0]),(!l||c[1]<n)&&(n=c[1]),(!l||c[0]>i)&&(i=c[0]),(!l||c[1]>a)&&(a=c[1])}var p=i-o,m=a-n,f=Math.min(p,m),g=f/2;if(f===0){var b=[o,n];return b.distance=0,b}for(var x=new Hy(void 0,SN),C=o;C<i;C+=f)for(var v=n;v<a;v+=f)x.push(new Ta(C+g,v+g,g,e));var I=TN(e),M=new Ta(o+p/2,n+m/2,0,e);M.d>I.d&&(I=M);for(var O=x.length;x.length;){var T=x.pop();T.d>I.d&&(I=T,t&&console.log("found best %d after %d probes",Math.round(1e4*T.d)/1e4,O)),!(T.max-I.d<=r)&&(g=T.h/2,x.push(new Ta(T.x-g,T.y-g,g,e)),x.push(new Ta(T.x+g,T.y-g,g,e)),x.push(new Ta(T.x-g,T.y+g,g,e)),x.push(new Ta(T.x+g,T.y+g,g,e)),O+=4)}t&&(console.log("num probes: "+O),console.log("best distance: "+I.d));var P=[I.x,I.y];return P.distance=I.d,P}function SN(e,r){return r.max-e.max}function Ta(e,r,t,o){this.x=e,this.y=r,this.h=t,this.d=CN(e,r,o),this.max=this.d+this.h*Math.SQRT2}function CN(e,r,t){for(var o=!1,n=1/0,i=0;i<t.length;i++)for(var a=t[i],l=0,c=a.length,p=c-1;l<c;p=l++){var m=a[l],f=a[p];m[1]>r!=f[1]>r&&e<(f[0]-m[0])*(r-m[1])/(f[1]-m[1])+m[0]&&(o=!o),n=Math.min(n,MN(e,r,m,f))}return n===0?0:(o?1:-1)*Math.sqrt(n)}function TN(e){for(var r=0,t=0,o=0,n=e[0],i=0,a=n.length,l=a-1;i<a;l=i++){var c=n[i],p=n[l],m=c[0]*p[1]-p[0]*c[1];t+=(c[0]+p[0])*m,o+=(c[1]+p[1])*m,r+=m*3}return r===0?new Ta(n[0][0],n[0][1],0,e):new Ta(t/r,o/r,0,e)}function MN(e,r,t,o){var n=t[0],i=t[1],a=o[0]-n,l=o[1]-i;if(a!==0||l!==0){var c=((e-n)*a+(r-i)*l)/(a*a+l*l);c>1?(n=o[0],i=o[1]):c>0&&(n+=a*c,i+=l*c)}return a=e-n,l=r-i,a*a+l*l}});var u6=oa(($x,Wx)=>{d();(function(e,r){typeof $x=="object"&&typeof Wx<"u"?Wx.exports=r():typeof define=="function"&&define.amd?define(r):(e=e||self).RBush=r()})($x,function(){"use strict";function e(v,I,M,O,T){(function P(B,G,A,N,z){for(;N>A;){if(N-A>600){var Z=N-A+1,oe=G-A+1,J=Math.log(Z),fe=.5*Math.exp(2*J/3),ye=.5*Math.sqrt(J*fe*(Z-fe)/Z)*(oe-Z/2<0?-1:1),Te=Math.max(A,Math.floor(G-oe*fe/Z+ye)),ve=Math.min(N,Math.floor(G+(Z-oe)*fe/Z+ye));P(B,G,Te,ve,z)}var we=B[G],ie=A,Me=N;for(r(B,A,G),z(B[N],we)>0&&r(B,A,N);ie<Me;){for(r(B,ie,Me),ie++,Me--;z(B[ie],we)<0;)ie++;for(;z(B[Me],we)>0;)Me--}z(B[A],we)===0?r(B,A,Me):r(B,++Me,N),Me<=G&&(A=Me+1),G<=Me&&(N=Me-1)}})(v,I,M||0,O||v.length-1,T||t)}function r(v,I,M){var O=v[I];v[I]=v[M],v[M]=O}function t(v,I){return v<I?-1:v>I?1:0}var o=function(v){v===void 0&&(v=9),this._maxEntries=Math.max(4,v),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(v,I,M){if(!M)return I.indexOf(v);for(var O=0;O<I.length;O++)if(M(v,I[O]))return O;return-1}function i(v,I){a(v,0,v.children.length,I,v)}function a(v,I,M,O,T){T||(T=x(null)),T.minX=1/0,T.minY=1/0,T.maxX=-1/0,T.maxY=-1/0;for(var P=I;P<M;P++){var B=v.children[P];l(T,v.leaf?O(B):B)}return T}function l(v,I){return v.minX=Math.min(v.minX,I.minX),v.minY=Math.min(v.minY,I.minY),v.maxX=Math.max(v.maxX,I.maxX),v.maxY=Math.max(v.maxY,I.maxY),v}function c(v,I){return v.minX-I.minX}function p(v,I){return v.minY-I.minY}function m(v){return(v.maxX-v.minX)*(v.maxY-v.minY)}function f(v){return v.maxX-v.minX+(v.maxY-v.minY)}function g(v,I){return v.minX<=I.minX&&v.minY<=I.minY&&I.maxX<=v.maxX&&I.maxY<=v.maxY}function b(v,I){return I.minX<=v.maxX&&I.minY<=v.maxY&&I.maxX>=v.minX&&I.maxY>=v.minY}function x(v){return{children:v,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function C(v,I,M,O,T){for(var P=[I,M];P.length;)if(!((M=P.pop())-(I=P.pop())<=O)){var B=I+Math.ceil((M-I)/O/2)*O;e(v,B,I,M,T),P.push(I,B,B,M)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(v){var I=this.data,M=[];if(!b(v,I))return M;for(var O=this.toBBox,T=[];I;){for(var P=0;P<I.children.length;P++){var B=I.children[P],G=I.leaf?O(B):B;b(v,G)&&(I.leaf?M.push(B):g(v,G)?this._all(B,M):T.push(B))}I=T.pop()}return M},o.prototype.collides=function(v){var I=this.data;if(!b(v,I))return!1;for(var M=[];I;){for(var O=0;O<I.children.length;O++){var T=I.children[O],P=I.leaf?this.toBBox(T):T;if(b(v,P)){if(I.leaf||g(v,P))return!0;M.push(T)}}I=M.pop()}return!1},o.prototype.load=function(v){if(!v||!v.length)return this;if(v.length<this._minEntries){for(var I=0;I<v.length;I++)this.insert(v[I]);return this}var M=this._build(v.slice(),0,v.length-1,0);if(this.data.children.length)if(this.data.height===M.height)this._splitRoot(this.data,M);else{if(this.data.height<M.height){var O=this.data;this.data=M,M=O}this._insert(M,this.data.height-M.height-1,!0)}else this.data=M;return this},o.prototype.insert=function(v){return v&&this._insert(v,this.data.height-1),this},o.prototype.clear=function(){return this.data=x([]),this},o.prototype.remove=function(v,I){if(!v)return this;for(var M,O,T,P=this.data,B=this.toBBox(v),G=[],A=[];P||G.length;){if(P||(P=G.pop(),O=G[G.length-1],M=A.pop(),T=!0),P.leaf){var N=n(v,P.children,I);if(N!==-1)return P.children.splice(N,1),G.push(P),this._condense(G),this}T||P.leaf||!g(P,B)?O?(M++,P=O.children[M],T=!1):P=null:(G.push(P),A.push(M),M=0,O=P,P=P.children[0])}return this},o.prototype.toBBox=function(v){return v},o.prototype.compareMinX=function(v,I){return v.minX-I.minX},o.prototype.compareMinY=function(v,I){return v.minY-I.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(v){return this.data=v,this},o.prototype._all=function(v,I){for(var M=[];v;)v.leaf?I.push.apply(I,v.children):M.push.apply(M,v.children),v=M.pop();return I},o.prototype._build=function(v,I,M,O){var T,P=M-I+1,B=this._maxEntries;if(P<=B)return i(T=x(v.slice(I,M+1)),this.toBBox),T;O||(O=Math.ceil(Math.log(P)/Math.log(B)),B=Math.ceil(P/Math.pow(B,O-1))),(T=x([])).leaf=!1,T.height=O;var G=Math.ceil(P/B),A=G*Math.ceil(Math.sqrt(B));C(v,I,M,A,this.compareMinX);for(var N=I;N<=M;N+=A){var z=Math.min(N+A-1,M);C(v,N,z,G,this.compareMinY);for(var Z=N;Z<=z;Z+=G){var oe=Math.min(Z+G-1,z);T.children.push(this._build(v,Z,oe,O-1))}}return i(T,this.toBBox),T},o.prototype._chooseSubtree=function(v,I,M,O){for(;O.push(I),!I.leaf&&O.length-1!==M;){for(var T=1/0,P=1/0,B=void 0,G=0;G<I.children.length;G++){var A=I.children[G],N=m(A),z=(Z=v,oe=A,(Math.max(oe.maxX,Z.maxX)-Math.min(oe.minX,Z.minX))*(Math.max(oe.maxY,Z.maxY)-Math.min(oe.minY,Z.minY))-N);z<P?(P=z,T=N<T?N:T,B=A):z===P&&N<T&&(T=N,B=A)}I=B||I.children[0]}var Z,oe;return I},o.prototype._insert=function(v,I,M){var O=M?v:this.toBBox(v),T=[],P=this._chooseSubtree(O,this.data,I,T);for(P.children.push(v),l(P,O);I>=0&&T[I].children.length>this._maxEntries;)this._split(T,I),I--;this._adjustParentBBoxes(O,T,I)},o.prototype._split=function(v,I){var M=v[I],O=M.children.length,T=this._minEntries;this._chooseSplitAxis(M,T,O);var P=this._chooseSplitIndex(M,T,O),B=x(M.children.splice(P,M.children.length-P));B.height=M.height,B.leaf=M.leaf,i(M,this.toBBox),i(B,this.toBBox),I?v[I-1].children.push(B):this._splitRoot(M,B)},o.prototype._splitRoot=function(v,I){this.data=x([v,I]),this.data.height=v.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(v,I,M){for(var O,T,P,B,G,A,N,z=1/0,Z=1/0,oe=I;oe<=M-I;oe++){var J=a(v,0,oe,this.toBBox),fe=a(v,oe,M,this.toBBox),ye=(T=J,P=fe,B=void 0,G=void 0,A=void 0,N=void 0,B=Math.max(T.minX,P.minX),G=Math.max(T.minY,P.minY),A=Math.min(T.maxX,P.maxX),N=Math.min(T.maxY,P.maxY),Math.max(0,A-B)*Math.max(0,N-G)),Te=m(J)+m(fe);ye<z?(z=ye,O=oe,Z=Te<Z?Te:Z):ye===z&&Te<Z&&(Z=Te,O=oe)}return O||M-I},o.prototype._chooseSplitAxis=function(v,I,M){var O=v.leaf?this.compareMinX:c,T=v.leaf?this.compareMinY:p;this._allDistMargin(v,I,M,O)<this._allDistMargin(v,I,M,T)&&v.children.sort(O)},o.prototype._allDistMargin=function(v,I,M,O){v.children.sort(O);for(var T=this.toBBox,P=a(v,0,I,T),B=a(v,M-I,M,T),G=f(P)+f(B),A=I;A<M-I;A++){var N=v.children[A];l(P,v.leaf?T(N):N),G+=f(P)}for(var z=M-I-1;z>=I;z--){var Z=v.children[z];l(B,v.leaf?T(Z):Z),G+=f(B)}return G},o.prototype._adjustParentBBoxes=function(v,I,M){for(var O=M;O>=0;O--)l(I[O],v)},o.prototype._condense=function(v){for(var I=v.length-1,M=void 0;I>=0;I--)v[I].children.length===0?I>0?(M=v[I-1].children).splice(M.indexOf(v[I]),1):this.clear():i(v[I],this.toBBox)},o})});var Jx=oa(ue=>{"use strict";d();Object.defineProperty(ue,"__esModule",{value:!0});ue.earthRadius=63710088e-1;ue.factors={centimeters:ue.earthRadius*100,centimetres:ue.earthRadius*100,degrees:ue.earthRadius/111325,feet:ue.earthRadius*3.28084,inches:ue.earthRadius*39.37,kilometers:ue.earthRadius/1e3,kilometres:ue.earthRadius/1e3,meters:ue.earthRadius,metres:ue.earthRadius,miles:ue.earthRadius/1609.344,millimeters:ue.earthRadius*1e3,millimetres:ue.earthRadius*1e3,nauticalmiles:ue.earthRadius/1852,radians:1,yards:ue.earthRadius*1.0936};ue.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/ue.earthRadius,yards:1.0936133};ue.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 Oa(e,r,t){t===void 0&&(t={});var o={type:"Feature"};return(t.id===0||t.id)&&(o.id=t.id),t.bbox&&(o.bbox=t.bbox),o.properties=r||{},o.geometry=e,o}ue.feature=Oa;function mj(e,r,t){switch(t===void 0&&(t={}),e){case"Point":return zx(r).geometry;case"LineString":return Xx(r).geometry;case"Polygon":return Zx(r).geometry;case"MultiPoint":return f6(r).geometry;case"MultiLineString":return m6(r).geometry;case"MultiPolygon":return h6(r).geometry;default:throw new Error(e+" is invalid")}}ue.geometry=mj;function zx(e,r,t){if(t===void 0&&(t={}),!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(!Jy(e[0])||!Jy(e[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:e};return Oa(o,r,t)}ue.point=zx;function fj(e,r,t){return t===void 0&&(t={}),Ky(e.map(function(o){return zx(o,r)}),t)}ue.points=fj;function Zx(e,r,t){t===void 0&&(t={});for(var o=0,n=e;o<n.length;o++){var i=n[o];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<i[i.length-1].length;a++)if(i[i.length-1][a]!==i[0][a])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:e};return Oa(l,r,t)}ue.polygon=Zx;function hj(e,r,t){return t===void 0&&(t={}),Ky(e.map(function(o){return Zx(o,r)}),t)}ue.polygons=hj;function Xx(e,r,t){if(t===void 0&&(t={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:e};return Oa(o,r,t)}ue.lineString=Xx;function gj(e,r,t){return t===void 0&&(t={}),Ky(e.map(function(o){return Xx(o,r)}),t)}ue.lineStrings=gj;function Ky(e,r){r===void 0&&(r={});var t={type:"FeatureCollection"};return r.id&&(t.id=r.id),r.bbox&&(t.bbox=r.bbox),t.features=e,t}ue.featureCollection=Ky;function m6(e,r,t){t===void 0&&(t={});var o={type:"MultiLineString",coordinates:e};return Oa(o,r,t)}ue.multiLineString=m6;function f6(e,r,t){t===void 0&&(t={});var o={type:"MultiPoint",coordinates:e};return Oa(o,r,t)}ue.multiPoint=f6;function h6(e,r,t){t===void 0&&(t={});var o={type:"MultiPolygon",coordinates:e};return Oa(o,r,t)}ue.multiPolygon=h6;function yj(e,r,t){t===void 0&&(t={});var o={type:"GeometryCollection",geometries:e};return Oa(o,r,t)}ue.geometryCollection=yj;function bj(e,r){if(r===void 0&&(r=0),r&&!(r>=0))throw new Error("precision must be a positive number");var t=Math.pow(10,r||0);return Math.round(e*t)/t}ue.round=bj;function g6(e,r){r===void 0&&(r="kilometers");var t=ue.factors[r];if(!t)throw new Error(r+" units is invalid");return e*t}ue.radiansToLength=g6;function Yx(e,r){r===void 0&&(r="kilometers");var t=ue.factors[r];if(!t)throw new Error(r+" units is invalid");return e/t}ue.lengthToRadians=Yx;function xj(e,r){return y6(Yx(e,r))}ue.lengthToDegrees=xj;function vj(e){var r=e%360;return r<0&&(r+=360),r}ue.bearingToAzimuth=vj;function y6(e){var r=e%(2*Math.PI);return r*180/Math.PI}ue.radiansToDegrees=y6;function Ij(e){var r=e%360;return r*Math.PI/180}ue.degreesToRadians=Ij;function Sj(e,r,t){if(r===void 0&&(r="kilometers"),t===void 0&&(t="kilometers"),!(e>=0))throw new Error("length must be a positive number");return g6(Yx(e,r),t)}ue.convertLength=Sj;function Cj(e,r,t){if(r===void 0&&(r="meters"),t===void 0&&(t="kilometers"),!(e>=0))throw new Error("area must be a positive number");var o=ue.areaFactors[r];if(!o)throw new Error("invalid original units");var n=ue.areaFactors[t];if(!n)throw new Error("invalid final units");return e/o*n}ue.convertArea=Cj;function Jy(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}ue.isNumber=Jy;function Tj(e){return!!e&&e.constructor===Object}ue.isObject=Tj;function Mj(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(r){if(!Jy(r))throw new Error("bbox must only contain numbers")})}ue.validateBBox=Mj;function wj(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")}ue.validateId=wj});var Qx=oa(ar=>{"use strict";d();Object.defineProperty(ar,"__esModule",{value:!0});var Wr=Jx();function xm(e,r,t){if(e!==null)for(var o,n,i,a,l,c,p,m=0,f=0,g,b=e.type,x=b==="FeatureCollection",C=b==="Feature",v=x?e.features.length:1,I=0;I<v;I++){p=x?e.features[I].geometry:C?e.geometry:e,g=p?p.type==="GeometryCollection":!1,l=g?p.geometries.length:1;for(var M=0;M<l;M++){var O=0,T=0;if(a=g?p.geometries[M]:p,a!==null){c=a.coordinates;var P=a.type;switch(m=t&&(P==="Polygon"||P==="MultiPolygon")?1:0,P){case null:break;case"Point":if(r(c,f,I,O,T)===!1)return!1;f++,O++;break;case"LineString":case"MultiPoint":for(o=0;o<c.length;o++){if(r(c[o],f,I,O,T)===!1)return!1;f++,P==="MultiPoint"&&O++}P==="LineString"&&O++;break;case"Polygon":case"MultiLineString":for(o=0;o<c.length;o++){for(n=0;n<c[o].length-m;n++){if(r(c[o][n],f,I,O,T)===!1)return!1;f++}P==="MultiLineString"&&O++,P==="Polygon"&&T++}P==="Polygon"&&O++;break;case"MultiPolygon":for(o=0;o<c.length;o++){for(T=0,n=0;n<c[o].length;n++){for(i=0;i<c[o][n].length-m;i++){if(r(c[o][n][i],f,I,O,T)===!1)return!1;f++}T++}O++}break;case"GeometryCollection":for(o=0;o<a.geometries.length;o++)if(xm(a.geometries[o],r,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Oj(e,r,t,o){var n=t;return xm(e,function(i,a,l,c,p){a===0&&t===void 0?n=i:n=r(n,i,a,l,c,p)},o),n}function b6(e,r){var t;switch(e.type){case"FeatureCollection":for(t=0;t<e.features.length&&r(e.features[t].properties,t)!==!1;t++);break;case"Feature":r(e.properties,0);break}}function Pj(e,r,t){var o=t;return b6(e,function(n,i){i===0&&t===void 0?o=n:o=r(o,n,i)}),o}function x6(e,r){if(e.type==="Feature")r(e,0);else if(e.type==="FeatureCollection")for(var t=0;t<e.features.length&&r(e.features[t],t)!==!1;t++);}function Fj(e,r,t){var o=t;return x6(e,function(n,i){i===0&&t===void 0?o=n:o=r(o,n,i)}),o}function Ej(e){var r=[];return xm(e,function(t){r.push(t)}),r}function Kx(e,r){var t,o,n,i,a,l,c,p,m,f,g=0,b=e.type==="FeatureCollection",x=e.type==="Feature",C=b?e.features.length:1;for(t=0;t<C;t++){for(l=b?e.features[t].geometry:x?e.geometry:e,p=b?e.features[t].properties:x?e.properties:{},m=b?e.features[t].bbox:x?e.bbox:void 0,f=b?e.features[t].id:x?e.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,n=0;n<a;n++){if(i=c?l.geometries[n]:l,i===null){if(r(null,g,p,m,f)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(r(i,g,p,m,f)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<i.geometries.length;o++)if(r(i.geometries[o],g,p,m,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}function Dj(e,r,t){var o=t;return Kx(e,function(n,i,a,l,c){i===0&&t===void 0?o=n:o=r(o,n,i,a,l,c)}),o}function Qy(e,r){Kx(e,function(t,o,n,i,a){var l=t===null?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return r(Wr.feature(t,n,{bbox:i,id:a}),o,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var m=t.coordinates[p],f={type:c,coordinates:m};if(r(Wr.feature(f,n),o,p)===!1)return!1}})}function kj(e,r,t){var o=t;return Qy(e,function(n,i,a){i===0&&a===0&&t===void 0?o=n:o=r(o,n,i,a)}),o}function v6(e,r){Qy(e,function(t,o,n){var i=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var l,c=0,p=0,m=0;if(xm(t,function(f,g,b,x,C){if(l===void 0||o>c||x>p||C>m){l=f,c=o,p=x,m=C,i=0;return}var v=Wr.lineString([l,f],t.properties);if(r(v,o,n,C,i)===!1)return!1;i++,l=f})===!1)return!1}}})}function Lj(e,r,t){var o=t,n=!1;return v6(e,function(i,a,l,c,p){n===!1&&t===void 0?o=i:o=r(o,i,a,l,c,p),n=!0}),o}function I6(e,r){if(!e)throw new Error("geojson is required");Qy(e,function(t,o,n){if(t.geometry!==null){var i=t.geometry.type,a=t.geometry.coordinates;switch(i){case"LineString":if(r(t,o,n,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<a.length;l++)if(r(Wr.lineString(a[l],t.properties),o,n,l)===!1)return!1;break}}})}function Aj(e,r,t){var o=t;return I6(e,function(n,i,a,l){i===0&&t===void 0?o=n:o=r(o,n,i,a,l)}),o}function Rj(e,r){if(r=r||{},!Wr.isObject(r))throw new Error("options is invalid");var t=r.featureIndex||0,o=r.multiFeatureIndex||0,n=r.geometryIndex||0,i=r.segmentIndex||0,a=r.properties,l;switch(e.type){case"FeatureCollection":t<0&&(t=e.features.length+t),a=a||e.features[t].properties,l=e.features[t].geometry;break;case"Feature":a=a||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=c.length+i-1),Wr.lineString([c[i],c[i+1]],a,r);case"Polygon":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i-1),Wr.lineString([c[n][i],c[n][i+1]],a,r);case"MultiLineString":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i-1),Wr.lineString([c[o][i],c[o][i+1]],a,r);case"MultiPolygon":return o<0&&(o=c.length+o),n<0&&(n=c[o].length+n),i<0&&(i=c[o][n].length-i-1),Wr.lineString([c[o][n][i],c[o][n][i+1]],a,r)}throw new Error("geojson is invalid")}function _j(e,r){if(r=r||{},!Wr.isObject(r))throw new Error("options is invalid");var t=r.featureIndex||0,o=r.multiFeatureIndex||0,n=r.geometryIndex||0,i=r.coordIndex||0,a=r.properties,l;switch(e.type){case"FeatureCollection":t<0&&(t=e.features.length+t),a=a||e.features[t].properties,l=e.features[t].geometry;break;case"Feature":a=a||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return Wr.point(c,a,r);case"MultiPoint":return o<0&&(o=c.length+o),Wr.point(c[o],a,r);case"LineString":return i<0&&(i=c.length+i),Wr.point(c[i],a,r);case"Polygon":return n<0&&(n=c.length+n),i<0&&(i=c[n].length+i),Wr.point(c[n][i],a,r);case"MultiLineString":return o<0&&(o=c.length+o),i<0&&(i=c[o].length+i),Wr.point(c[o][i],a,r);case"MultiPolygon":return o<0&&(o=c.length+o),n<0&&(n=c[o].length+n),i<0&&(i=c[o][n].length-i),Wr.point(c[o][n][i],a,r)}throw new Error("geojson is invalid")}ar.coordAll=Ej;ar.coordEach=xm;ar.coordReduce=Oj;ar.featureEach=x6;ar.featureReduce=Fj;ar.findPoint=_j;ar.findSegment=Rj;ar.flattenEach=Qy;ar.flattenReduce=kj;ar.geomEach=Kx;ar.geomReduce=Dj;ar.lineEach=I6;ar.lineReduce=Aj;ar.propEach=b6;ar.propReduce=Pj;ar.segmentEach=v6;ar.segmentReduce=Lj});var S6=oa(ev=>{"use strict";d();Object.defineProperty(ev,"__esModule",{value:!0});var Bj=Qx();function qx(e){var r=[1/0,1/0,-1/0,-1/0];return Bj.coordEach(e,function(t){r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r}qx.default=qx;ev.default=qx});var O6=oa((B1e,tv)=>{d();var Ei=u6(),T6=Jx(),M6=Qx(),Gp=S6().default,Nj=M6.featureEach,R1e=M6.coordEach,_1e=T6.polygon,C6=T6.featureCollection;function w6(e){var r=new Ei(e);return r.insert=function(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Gp(t),Ei.prototype.insert.call(this,t)},r.load=function(t){var o=[];return Array.isArray(t)?t.forEach(function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:Gp(n),o.push(n)}):Nj(t,function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:Gp(n),o.push(n)}),Ei.prototype.load.call(this,o)},r.remove=function(t,o){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Gp(t),Ei.prototype.remove.call(this,t,o)},r.clear=function(){return Ei.prototype.clear.call(this)},r.search=function(t){var o=Ei.prototype.search.call(this,this.toBBox(t));return C6(o)},r.collides=function(t){return Ei.prototype.collides.call(this,this.toBBox(t))},r.all=function(){var t=Ei.prototype.all.call(this);return C6(t)},r.toJSON=function(){return Ei.prototype.toJSON.call(this)},r.fromJSON=function(t){return Ei.prototype.fromJSON.call(this,t)},r.toBBox=function(t){var o;if(t.bbox)o=t.bbox;else if(Array.isArray(t)&&t.length===4)o=t;else if(Array.isArray(t)&&t.length===6)o=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")o=Gp(t);else if(t.type==="FeatureCollection")o=Gp(t);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},r}tv.exports=w6;tv.exports.default=w6});var f8=oa((hPe,Db)=>{d();(function(){"use strict";function e(a,l){var c=a.x-l.x,p=a.y-l.y;return c*c+p*p}function r(a,l,c){var p=l.x,m=l.y,f=c.x-p,g=c.y-m;if(f!==0||g!==0){var b=((a.x-p)*f+(a.y-m)*g)/(f*f+g*g);b>1?(p=c.x,m=c.y):b>0&&(p+=f*b,m+=g*b)}return f=a.x-p,g=a.y-m,f*f+g*g}function t(a,l){for(var c=a[0],p=[c],m,f=1,g=a.length;f<g;f++)m=a[f],e(m,c)>l&&(p.push(m),c=m);return c!==m&&p.push(m),p}function o(a,l,c,p,m){for(var f=p,g,b=l+1;b<c;b++){var x=r(a[b],a[l],a[c]);x>f&&(g=b,f=x)}f>p&&(g-l>1&&o(a,l,g,p,m),m.push(a[g]),c-g>1&&o(a,g,c,p,m))}function n(a,l){var c=a.length-1,p=[a[0]];return o(a,0,c,l,p),p.push(a[c]),p}function i(a,l,c){if(a.length<=2)return a;var p=l!==void 0?l*l:1;return a=c?a:t(a,p),a=n(a,p),a}typeof define=="function"&&define.amd?define(function(){return i}):typeof Db<"u"?(Db.exports=i,Db.exports.default=i):typeof self<"u"?self.simplify=i:window.simplify=i})()});d();d();d();d();d();d();var Mu=e=>e!=null;var OO=function(){let r=globalThis.fetch;return{fetch(...t){if(!Mu(r))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return r?.(...t)},setFetch(t){r=t}}}(),GS=OO.fetch;var WS=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke","reactsdk"],US=WS[0],zS="https://api-gateway.mappedin.com/track-analytics/a/",ZS="deny-watchposition",XS="load-mapview",YS="load-mapdata",JS="change-language",KS="query-directions";var hi,Vo,ss,x0,lg,$c=class{constructor(){S(this,ss);S(this,hi,Object.freeze({}));S(this,Vo);u(this,"oneTimeEventsSent",new Set);u(this,"sendGetDirectionsEvent",qb((r,t,o)=>{let n={start:r,end:t,type:"location_to_location"};return o!==void 0&&(n.accessible=o),this.sendAnalyticEvent(KS,n)},2500));w(this,Vo,W(this,ss,lg).call(this,s(this,hi)))}init(r){this.reset(),this.updateStateWithOptions(r)}reset(){w(this,hi,{}),w(this,Vo,W(this,ss,lg).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(r){return w(this,hi,Object.freeze(Object.assign({},s(this,hi),r))),w(this,Vo,W(this,ss,lg).call(this,r)),W(this,ss,x0).call(this,s(this,Vo)),s(this,Vo)}updateState(r){let t={...r};t.mapId&&(t.analyticsBaseUrl=b0({...s(this,Vo),mapId:t.mapId})),t.context&&(t.context=$S(t.context)),t.baseUri&&(t.analyticsBaseUrl=b0({baseUri:t.baseUri,mapId:s(this,Vo).mapId})),Object.assign(s(this,Vo),t),this.handleStateUpdate(r),W(this,ss,x0).call(this,t)}handleStateUpdate(r){r.userPosition?.floorLevel?this.sendBlueDotEvents("found-floor"):r.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:r,secret:t,accessToken:o}=this.getState();return!!(r&&t)||!!o}getState(){return s(this,Vo)}getContext(){return this.getState().context||s(this,hi).context||US}getSessionId(){return this.getState().sessionId||s(this,hi).sessionId||HS()}getDeviceId(){return this.getState().deviceId||s(this,hi).deviceId||VS()}sendAnalyticEvent(r,t={}){let o=this.getState(),n=PO(o.analyticsBaseUrl,r),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(o.logEvents&&L.log("Analytics.track",n,i),!o.sendEvents)return Promise.resolve();if(!this.authReady)return L.warn("Auth needs to be ready to send analytics.");let a={...t,g:o.geolocationMode,sdk_version:o.version};return o.userPosition&&Object.assign(a,o.userPosition),i["Content-Type"]="application/json",o.accessToken?i.Authorization=`Bearer ${o.accessToken}`:o.noAuth||o.secret&&o.key&&(i["x-mappedin-key"]=btoa(o.key),i["x-mappedin-secret"]=btoa(o.secret)),GS(n,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(a)})}capture(r,t){if(EO.includes(r))return L.warn(`${r} event is sent internally.`),Promise.resolve();let o=FO.includes(r)?r.slice(1):r;return this.sendAnalyticEvent(o,t)}sendGetMapDataEvent(r){return this.sendAnalyticEvent(YS,r)}sendChangeLanguageEvent(r){return this.sendAnalyticEvent(JS,r)}sendWatchPositionDenied(){return this.sendAnalyticEvent(ZS)}sendMapViewLoadedEvent({firstRenderDuration:r,dimension:t,collisionWorkerDisabled:o,outdoorsWorkerDisabled:n}){return this.sendAnalyticEvent(XS,{type:"3d",firstRenderDuration:r,width:t.width,height:t.height,devicePixelRatio:globalThis.devicePixelRatio||1,collisionWorkerDisabled:o,outdoorsWorkerDisabled:n})}sendBlueDotEvents(r){if(!((r==="found-floor"||r==="found-position")&&this.oneTimeEventsSent.has(r)))return this.oneTimeEventsSent.add(r),this.sendAnalyticEvent(r)}};hi=new WeakMap,Vo=new WeakMap,ss=new WeakSet,x0=function(r){r.sessionId&&rs.getInstance().saveSessionData("id",r.sessionId),r.deviceId&&rs.getInstance().saveLocalData("deviceId",r.deviceId)},lg=function(r){let t=r.baseUri??zS;return{baseUri:t,analyticsBaseUrl:b0({...r,baseUri:t}),version:y?.env?.npm_package_version||"v6",deviceId:r.deviceId||VS(),accessToken:r.accessToken,mapId:r.mapId,sessionId:r.sessionId||HS(),platformString:r.platformString||"",context:$S(r.context)||US,geolocationMode:!1,sendEvents:r.sendEvents??!0,logEvents:r.logEvents??!1,noAuth:r.noAuth||!1,key:r.key,secret:r.secret}};function b0({mapId:e,baseUri:r=zS}){return`${r}${e}/`}function VS(){return rs.getInstance().loadLocalData("deviceId")}function HS(){return rs.getInstance().loadSessionData("id")}function PO(e,r){return e+r}function $S(e){return WS.find(r=>r===e)}var FO=["$select-location","$select-category","$query-suggest","$query-search"],EO=[XS,YS,KS,ZS,JS],eH=new $c,Ho,wu=class{constructor(r){S(this,Ho);u(this,"capture");u(this,"updateState");w(this,Ho,r),this.capture=s(this,Ho).capture.bind(s(this,Ho)),this.updateState=s(this,Ho).updateState.bind(s(this,Ho))}getState(){let{sessionId:r,deviceId:t,...o}=s(this,Ho).getState();return o}getContext(){return s(this,Ho).getContext()}getSessionId(){return s(this,Ho).getSessionId()}getDeviceId(){return s(this,Ho).getDeviceId()}};Ho=new WeakMap;d();d();var Pu,Fu,Eu,Ou=class{constructor(r,t,{enabled:o=!1}={}){S(this,Pu);u(this,"searchInstance");S(this,Fu);S(this,Eu);u(this,"enabled",!1);w(this,Pu,r),w(this,Fu,t),w(this,Eu,()=>{this.searchInstance?.then(n=>n.populate())}),o&&this.enable()}async query(r,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return L.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(r,t)}catch(o){return L.error("Search.query failed due to",o),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(r,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return L.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(r,t)}catch(o){return L.error("Search.suggest failed due to",o),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-3NNUFZ25.js").then(({InternalSearch:r})=>new r(s(this,Pu)))),s(this,Fu).on("language-change",s(this,Eu)),await this.searchInstance)}};Pu=new WeakMap,Fu=new WeakMap,Eu=new WeakMap;var QS=new WeakMap,dl,Ot,v0=class{constructor(r,{search:t}={}){S(this,dl);S(this,Ot);u(this,"Analytics");u(this,"Search");u(this,"Query");u(this,"internal");u(this,"on",(r,t)=>{s(this,dl).on(r,t)});u(this,"off",(r,t)=>{s(this,dl).off(r,t)});u(this,"__LEGACY_GET_DIRECTIONS_SYNC",(r,t,o)=>s(this,Ot).__LEGACY_GET_DIRECTIONS_SYNC(r,t,o));u(this,"getDirections",(r,t,o)=>s(this,Ot).getDirections(r,t,o));u(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",(r,t,o)=>s(this,Ot).__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(r,t,o));u(this,"getDirectionsMultiDestination",(r,t,o)=>s(this,Ot).getDirectionsMultiDestination(r,t,o));w(this,dl,new Ie),w(this,Ot,r),QS.set(this,r),this.Analytics=new wu(r.Analytics),this.Query=r.Query,this.internal=r,this.Search=new Ou(this,r,{enabled:t?.enabled}),s(this,Ot).on("language-change",o=>{s(this,dl).publish("language-change",o)})}getEnv(){return s(this,Ot).getEnv()}getAccessToken(){return s(this,Ot).tokenManager?.getAccessToken().token}get mapName(){return s(this,Ot).mapName}get mapId(){return s(this,Ot).getMapDataOptions?.mapId}get mapCenter(){return s(this,Ot).mapCenter}get organizationId(){return s(this,Ot).organizationId}get outdoorViewToken(){return s(this,Ot).outdoorViewToken}getByType(r){return s(this,Ot).getByType(r)}getById(r,t){return s(this,Ot).getById(r,t)}getByExternalId(r,t){return s(this,Ot).getByExternalId(r,t)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return s(this,Ot).changeLanguage(r)}get currentLanguage(){return s(this,Ot).currentLanguage}get naturalBearing(){return s(this,Ot).naturalBearing??0}getDistance(r,t){return s(this,Ot).getDistance(r,t)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return s(this,Ot).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return s(this,Ot).toJSONBundle({downloadLanguagePacks:r})}};dl=new WeakMap,Ot=new WeakMap;var Du=v0;function ku(e){let r=QS.get(e);if(!r)throw new Error("MapDataInternal not found");return r}d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();d();var Ge={};na(Ge,{HasPropertyKey:()=>DO,IsArray:()=>Nr,IsAsyncIterator:()=>I0,IsBigInt:()=>Lu,IsBoolean:()=>ua,IsDate:()=>ul,IsFunction:()=>S0,IsIterator:()=>C0,IsNull:()=>T0,IsNumber:()=>Tn,IsObject:()=>dt,IsRegExp:()=>Au,IsString:()=>St,IsSymbol:()=>M0,IsUint8Array:()=>as,IsUndefined:()=>Bt});d();function DO(e,r){return r in e}function I0(e){return dt(e)&&!Nr(e)&&!as(e)&&Symbol.asyncIterator in e}function Nr(e){return Array.isArray(e)}function Lu(e){return typeof e=="bigint"}function ua(e){return typeof e=="boolean"}function ul(e){return e instanceof globalThis.Date}function S0(e){return typeof e=="function"}function C0(e){return dt(e)&&!Nr(e)&&!as(e)&&Symbol.iterator in e}function T0(e){return e===null}function Tn(e){return typeof e=="number"}function dt(e){return typeof e=="object"&&e!==null}function Au(e){return e instanceof globalThis.RegExp}function St(e){return typeof e=="string"}function M0(e){return typeof e=="symbol"}function as(e){return e instanceof globalThis.Uint8Array}function Bt(e){return e===void 0}function kO(e){return e.map(r=>cg(r))}function LO(e){return new Date(e.getTime())}function AO(e){return new Uint8Array(e)}function RO(e){return new RegExp(e.source,e.flags)}function _O(e){let r={};for(let t of Object.getOwnPropertyNames(e))r[t]=cg(e[t]);for(let t of Object.getOwnPropertySymbols(e))r[t]=cg(e[t]);return r}function cg(e){return Nr(e)?kO(e):ul(e)?LO(e):as(e)?AO(e):Au(e)?RO(e):dt(e)?_O(e):e}function Pt(e){return cg(e)}function qS(e){return e.map(r=>Ru(r))}function Ru(e,r){return r===void 0?Pt(e):Pt({...r,...e})}d();d();d();function pg(e){return Ce(e)&&Symbol.asyncIterator in e}function dg(e){return Ce(e)&&Symbol.iterator in e}function w0(e){return Ce(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function ug(e){return e instanceof Promise}function Jr(e){return e instanceof Date&&Number.isFinite(e.getTime())}function e5(e){return e instanceof globalThis.Map}function t5(e){return e instanceof globalThis.Set}function $o(e){return ArrayBuffer.isView(e)}function Wc(e){return e instanceof globalThis.Uint8Array}function me(e,r){return r in e}function Ce(e){return e!==null&&typeof e=="object"}function xe(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}function Nt(e){return e===void 0}function ls(e){return e===null}function gi(e){return typeof e=="boolean"}function le(e){return typeof e=="number"}function mg(e){return Number.isInteger(e)}function wr(e){return typeof e=="bigint"}function _e(e){return typeof e=="string"}function ma(e){return typeof e=="function"}function cs(e){return typeof e=="symbol"}function Or(e){return wr(e)||gi(e)||ls(e)||le(e)||_e(e)||cs(e)||Nt(e)}var ot;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function r(a,l){return e.ExactOptionalPropertyTypes?l in a:a[l]!==void 0}e.IsExactOptionalProperty=r;function t(a){let l=Ce(a);return e.AllowArrayObject?l:l&&!xe(a)}e.IsObjectLike=t;function o(a){return t(a)&&!(a instanceof Date)&&!(a instanceof Uint8Array)}e.IsRecordLike=o;function n(a){return e.AllowNaN?le(a):Number.isFinite(a)}e.IsNumberLike=n;function i(a){let l=Nt(a);return e.AllowNullVoid?l||a===null:l}e.IsVoidLike=i})(ot||(ot={}));d();function BO(e){return globalThis.Object.freeze(e).map(r=>_u(r))}function NO(e){let r={};for(let t of Object.getOwnPropertyNames(e))r[t]=_u(e[t]);for(let t of Object.getOwnPropertySymbols(e))r[t]=_u(e[t]);return globalThis.Object.freeze(r)}function _u(e){return Nr(e)?BO(e):ul(e)?e:as(e)?e:Au(e)?e:dt(e)?NO(e):e}function $(e,r){let t=r!==void 0?{...r,...e}:e;switch(ot.InstanceMode){case"freeze":return _u(t);case"clone":return Pt(t);default:return t}}d();var de=class extends Error{constructor(r){super(r)}};d();d();d();var Ft=Symbol.for("TypeBox.Transform"),ps=Symbol.for("TypeBox.Readonly"),Kr=Symbol.for("TypeBox.Optional"),Wo=Symbol.for("TypeBox.Hint"),j=Symbol.for("TypeBox.Kind");function r5(e){return dt(e)&&e[ps]==="Readonly"}function yi(e){return dt(e)&&e[Kr]==="Optional"}function O0(e){return Ue(e,"Any")}function ds(e){return Ue(e,"Array")}function Bu(e){return Ue(e,"AsyncIterator")}function P0(e){return Ue(e,"BigInt")}function F0(e){return Ue(e,"Boolean")}function Nu(e){return Ue(e,"Constructor")}function jO(e){return Ue(e,"Date")}function ju(e){return Ue(e,"Function")}function ml(e){return Ue(e,"Integer")}function Yt(e){return Ue(e,"Intersect")}function Gu(e){return Ue(e,"Iterator")}function Ue(e,r){return dt(e)&&j in e&&e[j]===r}function us(e){return Ue(e,"Literal")}function Oo(e){return Ue(e,"MappedKey")}function Et(e){return Ue(e,"MappedResult")}function fa(e){return Ue(e,"Never")}function GO(e){return Ue(e,"Not")}function UO(e){return Ue(e,"Null")}function fl(e){return Ue(e,"Number")}function ir(e){return Ue(e,"Object")}function hl(e){return Ue(e,"Promise")}function E0(e){return Ue(e,"Record")}function D0(e){return Ue(e,"Ref")}function k0(e){return Ue(e,"RegExp")}function Uu(e){return Ue(e,"String")}function VO(e){return Ue(e,"Symbol")}function Po(e){return Ue(e,"TemplateLiteral")}function HO(e){return Ue(e,"This")}function zc(e){return dt(e)&&Ft in e}function Mn(e){return Ue(e,"Tuple")}function $O(e){return Ue(e,"Undefined")}function Xe(e){return Ue(e,"Union")}function WO(e){return Ue(e,"Uint8Array")}function zO(e){return Ue(e,"Unknown")}function ZO(e){return Ue(e,"Unsafe")}function XO(e){return Ue(e,"Void")}function ha(e){return dt(e)&&j in e&&St(e[j])}function wn(e){return O0(e)||ds(e)||F0(e)||P0(e)||Bu(e)||Nu(e)||jO(e)||ju(e)||ml(e)||Yt(e)||Gu(e)||us(e)||Oo(e)||Et(e)||fa(e)||GO(e)||UO(e)||fl(e)||ir(e)||hl(e)||E0(e)||D0(e)||k0(e)||Uu(e)||VO(e)||Po(e)||HO(e)||Mn(e)||$O(e)||Xe(e)||WO(e)||zO(e)||ZO(e)||XO(e)||ha(e)}var E={};na(E,{IsAny:()=>s5,IsArray:()=>a5,IsAsyncIterator:()=>l5,IsBigInt:()=>c5,IsBoolean:()=>p5,IsConstructor:()=>d5,IsDate:()=>u5,IsFunction:()=>m5,IsInteger:()=>f5,IsIntersect:()=>h5,IsIterator:()=>g5,IsKind:()=>G5,IsKindOf:()=>Ne,IsLiteral:()=>Hu,IsLiteralBoolean:()=>tP,IsLiteralNumber:()=>b5,IsLiteralString:()=>y5,IsLiteralValue:()=>x5,IsMappedKey:()=>v5,IsMappedResult:()=>I5,IsNever:()=>S5,IsNot:()=>C5,IsNull:()=>T5,IsNumber:()=>M5,IsObject:()=>w5,IsOptional:()=>eP,IsPromise:()=>O5,IsProperties:()=>_0,IsReadonly:()=>qO,IsRecord:()=>P5,IsRecursive:()=>rP,IsRef:()=>F5,IsRegExp:()=>E5,IsSchema:()=>Be,IsString:()=>D5,IsSymbol:()=>k5,IsTemplateLiteral:()=>L5,IsThis:()=>A5,IsTransform:()=>Ct,IsTuple:()=>R5,IsUint8Array:()=>_5,IsUndefined:()=>Zc,IsUnion:()=>B0,IsUnionLiteral:()=>oP,IsUnknown:()=>B5,IsUnsafe:()=>N5,IsVoid:()=>j5,TypeGuardUnknownTypeError:()=>L0});d();var L0=class extends de{},JO=["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 o5(e){try{return new RegExp(e),!0}catch{return!1}}function A0(e){if(!St(e))return!1;for(let r=0;r<e.length;r++){let t=e.charCodeAt(r);if(t>=7&&t<=13||t===27||t===127)return!1}return!0}function n5(e){return R0(e)||Be(e)}function Vu(e){return Bt(e)||Lu(e)}function bt(e){return Bt(e)||Tn(e)}function R0(e){return Bt(e)||ua(e)}function it(e){return Bt(e)||St(e)}function KO(e){return Bt(e)||St(e)&&A0(e)&&o5(e)}function QO(e){return Bt(e)||St(e)&&A0(e)}function i5(e){return Bt(e)||Be(e)}function qO(e){return dt(e)&&e[ps]==="Readonly"}function eP(e){return dt(e)&&e[Kr]==="Optional"}function s5(e){return Ne(e,"Any")&&it(e.$id)}function a5(e){return Ne(e,"Array")&&e.type==="array"&&it(e.$id)&&Be(e.items)&&bt(e.minItems)&&bt(e.maxItems)&&R0(e.uniqueItems)&&i5(e.contains)&&bt(e.minContains)&&bt(e.maxContains)}function l5(e){return Ne(e,"AsyncIterator")&&e.type==="AsyncIterator"&&it(e.$id)&&Be(e.items)}function c5(e){return Ne(e,"BigInt")&&e.type==="bigint"&&it(e.$id)&&Vu(e.exclusiveMaximum)&&Vu(e.exclusiveMinimum)&&Vu(e.maximum)&&Vu(e.minimum)&&Vu(e.multipleOf)}function p5(e){return Ne(e,"Boolean")&&e.type==="boolean"&&it(e.$id)}function d5(e){return Ne(e,"Constructor")&&e.type==="Constructor"&&it(e.$id)&&Nr(e.parameters)&&e.parameters.every(r=>Be(r))&&Be(e.returns)}function u5(e){return Ne(e,"Date")&&e.type==="Date"&&it(e.$id)&&bt(e.exclusiveMaximumTimestamp)&&bt(e.exclusiveMinimumTimestamp)&&bt(e.maximumTimestamp)&&bt(e.minimumTimestamp)&&bt(e.multipleOfTimestamp)}function m5(e){return Ne(e,"Function")&&e.type==="Function"&&it(e.$id)&&Nr(e.parameters)&&e.parameters.every(r=>Be(r))&&Be(e.returns)}function f5(e){return Ne(e,"Integer")&&e.type==="integer"&&it(e.$id)&&bt(e.exclusiveMaximum)&&bt(e.exclusiveMinimum)&&bt(e.maximum)&&bt(e.minimum)&&bt(e.multipleOf)}function _0(e){return dt(e)&&Object.entries(e).every(([r,t])=>A0(r)&&Be(t))}function h5(e){return Ne(e,"Intersect")&&!(St(e.type)&&e.type!=="object")&&Nr(e.allOf)&&e.allOf.every(r=>Be(r)&&!Ct(r))&&it(e.type)&&(R0(e.unevaluatedProperties)||i5(e.unevaluatedProperties))&&it(e.$id)}function g5(e){return Ne(e,"Iterator")&&e.type==="Iterator"&&it(e.$id)&&Be(e.items)}function Ne(e,r){return dt(e)&&j in e&&e[j]===r}function y5(e){return Hu(e)&&St(e.const)}function b5(e){return Hu(e)&&Tn(e.const)}function tP(e){return Hu(e)&&ua(e.const)}function Hu(e){return Ne(e,"Literal")&&it(e.$id)&&x5(e.const)}function x5(e){return ua(e)||Tn(e)||St(e)}function v5(e){return Ne(e,"MappedKey")&&Nr(e.keys)&&e.keys.every(r=>Tn(r)||St(r))}function I5(e){return Ne(e,"MappedResult")&&_0(e.properties)}function S5(e){return Ne(e,"Never")&&dt(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function C5(e){return Ne(e,"Not")&&Be(e.not)}function T5(e){return Ne(e,"Null")&&e.type==="null"&&it(e.$id)}function M5(e){return Ne(e,"Number")&&e.type==="number"&&it(e.$id)&&bt(e.exclusiveMaximum)&&bt(e.exclusiveMinimum)&&bt(e.maximum)&&bt(e.minimum)&&bt(e.multipleOf)}function w5(e){return Ne(e,"Object")&&e.type==="object"&&it(e.$id)&&_0(e.properties)&&n5(e.additionalProperties)&&bt(e.minProperties)&&bt(e.maxProperties)}function O5(e){return Ne(e,"Promise")&&e.type==="Promise"&&it(e.$id)&&Be(e.item)}function P5(e){return Ne(e,"Record")&&e.type==="object"&&it(e.$id)&&n5(e.additionalProperties)&&dt(e.patternProperties)&&(r=>{let t=Object.getOwnPropertyNames(r.patternProperties);return t.length===1&&o5(t[0])&&dt(r.patternProperties)&&Be(r.patternProperties[t[0]])})(e)}function rP(e){return dt(e)&&Wo in e&&e[Wo]==="Recursive"}function F5(e){return Ne(e,"Ref")&&it(e.$id)&&St(e.$ref)}function E5(e){return Ne(e,"RegExp")&&it(e.$id)&&St(e.source)&&St(e.flags)&&bt(e.maxLength)&&bt(e.minLength)}function D5(e){return Ne(e,"String")&&e.type==="string"&&it(e.$id)&&bt(e.minLength)&&bt(e.maxLength)&&KO(e.pattern)&&QO(e.format)}function k5(e){return Ne(e,"Symbol")&&e.type==="symbol"&&it(e.$id)}function L5(e){return Ne(e,"TemplateLiteral")&&e.type==="string"&&St(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function A5(e){return Ne(e,"This")&&it(e.$id)&&St(e.$ref)}function Ct(e){return dt(e)&&Ft in e}function R5(e){return Ne(e,"Tuple")&&e.type==="array"&&it(e.$id)&&Tn(e.minItems)&&Tn(e.maxItems)&&e.minItems===e.maxItems&&(Bt(e.items)&&Bt(e.additionalItems)&&e.minItems===0||Nr(e.items)&&e.items.every(r=>Be(r)))}function Zc(e){return Ne(e,"Undefined")&&e.type==="undefined"&&it(e.$id)}function oP(e){return B0(e)&&e.anyOf.every(r=>y5(r)||b5(r))}function B0(e){return Ne(e,"Union")&&it(e.$id)&&dt(e)&&Nr(e.anyOf)&&e.anyOf.every(r=>Be(r))}function _5(e){return Ne(e,"Uint8Array")&&e.type==="Uint8Array"&&it(e.$id)&&bt(e.minByteLength)&&bt(e.maxByteLength)}function B5(e){return Ne(e,"Unknown")&&it(e.$id)}function N5(e){return Ne(e,"Unsafe")}function j5(e){return Ne(e,"Void")&&e.type==="void"&&it(e.$id)}function G5(e){return dt(e)&&j in e&&St(e[j])&&!JO.includes(e[j])}function Be(e){return dt(e)&&(s5(e)||a5(e)||p5(e)||c5(e)||l5(e)||d5(e)||u5(e)||m5(e)||f5(e)||h5(e)||g5(e)||Hu(e)||v5(e)||I5(e)||S5(e)||C5(e)||T5(e)||M5(e)||w5(e)||O5(e)||P5(e)||F5(e)||E5(e)||D5(e)||k5(e)||L5(e)||A5(e)||R5(e)||Zc(e)||B0(e)||_5(e)||B5(e)||N5(e)||j5(e)||G5(e))}d();var N0="(true|false)",$u="(0|[1-9][0-9]*)",j0="(.*)",nP="(?!.*)",L$=`^${N0}$`,ms=`^${$u}$`,fs=`^${j0}$`,U5=`^${nP}$`;d();var po={};na(po,{Clear:()=>sP,Delete:()=>aP,Entries:()=>iP,Get:()=>pP,Has:()=>lP,Set:()=>cP});d();var Xc=new Map;function iP(){return new Map(Xc)}function sP(){return Xc.clear()}function aP(e){return Xc.delete(e)}function lP(e){return Xc.has(e)}function cP(e,r){Xc.set(e,r)}function pP(e){return Xc.get(e)}var hr={};na(hr,{Clear:()=>uP,Delete:()=>mP,Entries:()=>dP,Get:()=>gP,Has:()=>fP,Set:()=>hP});d();var Yc=new Map;function dP(){return new Map(Yc)}function uP(){return Yc.clear()}function mP(e){return Yc.delete(e)}function fP(e){return Yc.has(e)}function hP(e,r){Yc.set(e,r)}function gP(e){return Yc.get(e)}d();function V5(e,r){return e.includes(r)}function H5(e){return[...new Set(e)]}function yP(e,r){return e.filter(t=>r.includes(t))}function bP(e,r){return e.reduce((t,o)=>yP(t,o),r)}function $5(e){return e.length===1?e[0]:e.length>1?bP(e.slice(1),e[0]):[]}function W5(e){let r=[];for(let t of e)r.push(...t);return r}d();function ga(e){return $({[j]:"Any"},e)}d();function fg(e,r){return $({[j]:"Array",type:"array",items:e},r)}d();function hg(e,r){return $({[j]:"AsyncIterator",type:"AsyncIterator",items:e},r)}d();d();d();function xP(e,r){let{[r]:t,...o}=e;return o}function $t(e,r){return r.reduce((t,o)=>xP(t,o),e)}d();function st(e){return $({[j]:"Never",not:{}},e)}d();d();function Ve(e){return $({[j]:"MappedResult",properties:e})}d();d();function gg(e,r,t){return $({[j]:"Constructor",type:"Constructor",parameters:e,returns:r},t)}d();function ya(e,r,t){return $({[j]:"Function",type:"Function",parameters:e,returns:r},t)}d();d();d();d();function Wu(e,r){return $({[j]:"Union",anyOf:e},r)}function vP(e){return e.some(r=>yi(r))}function z5(e){return e.map(r=>yi(r)?IP(r):r)}function IP(e){return $t(e,[Kr])}function SP(e,r){return vP(e)?uo(Wu(z5(e),r)):Wu(z5(e),r)}function bi(e,r){return e.length===0?st(r):e.length===1?$(e[0],r):SP(e,r)}d();function at(e,r){return e.length===0?st(r):e.length===1?$(e[0],r):Wu(e,r)}d();d();d();var yg=class extends de{};function CP(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function G0(e,r,t){return e[r]===t&&e.charCodeAt(r-1)!==92}function hs(e,r){return G0(e,r,"(")}function zu(e,r){return G0(e,r,")")}function Z5(e,r){return G0(e,r,"|")}function TP(e){if(!(hs(e,0)&&zu(e,e.length-1)))return!1;let r=0;for(let t=0;t<e.length;t++)if(hs(e,t)&&(r+=1),zu(e,t)&&(r-=1),r===0&&t!==e.length-1)return!1;return!0}function MP(e){return e.slice(1,e.length-1)}function wP(e){let r=0;for(let t=0;t<e.length;t++)if(hs(e,t)&&(r+=1),zu(e,t)&&(r-=1),Z5(e,t)&&r===0)return!0;return!1}function OP(e){for(let r=0;r<e.length;r++)if(hs(e,r))return!0;return!1}function PP(e){let[r,t]=[0,0],o=[];for(let i=0;i<e.length;i++)if(hs(e,i)&&(r+=1),zu(e,i)&&(r-=1),Z5(e,i)&&r===0){let a=e.slice(t,i);a.length>0&&o.push(Jc(a)),t=i+1}let n=e.slice(t);return n.length>0&&o.push(Jc(n)),o.length===0?{type:"const",const:""}:o.length===1?o[0]:{type:"or",expr:o}}function FP(e){function r(n,i){if(!hs(n,i))throw new yg("TemplateLiteralParser: Index must point to open parens");let a=0;for(let l=i;l<n.length;l++)if(hs(n,l)&&(a+=1),zu(n,l)&&(a-=1),a===0)return[i,l];throw new yg("TemplateLiteralParser: Unclosed group parens in expression")}function t(n,i){for(let a=i;a<n.length;a++)if(hs(n,a))return[i,a];return[i,n.length]}let o=[];for(let n=0;n<e.length;n++)if(hs(e,n)){let[i,a]=r(e,n),l=e.slice(i,a+1);o.push(Jc(l)),n=a}else{let[i,a]=t(e,n),l=e.slice(i,a);l.length>0&&o.push(Jc(l)),n=a-1}return o.length===0?{type:"const",const:""}:o.length===1?o[0]:{type:"and",expr:o}}function Jc(e){return TP(e)?Jc(MP(e)):wP(e)?PP(e):OP(e)?FP(e):{type:"const",const:CP(e)}}function Kc(e){return Jc(e.slice(1,e.length-1))}var U0=class extends de{};function EP(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]*"}function DP(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"}function kP(e){return e.type==="const"&&e.const===".*"}function gl(e){return EP(e)||kP(e)?!1:DP(e)?!0:e.type==="and"?e.expr.every(r=>gl(r)):e.type==="or"?e.expr.every(r=>gl(r)):e.type==="const"?!0:(()=>{throw new U0("Unknown expression type")})()}function bg(e){let r=Kc(e.pattern);return gl(r)}d();var V0=class extends de{};function*X5(e){if(e.length===1)return yield*e[0];for(let r of e[0])for(let t of X5(e.slice(1)))yield`${r}${t}`}function*LP(e){return yield*X5(e.expr.map(r=>[...Zu(r)]))}function*AP(e){for(let r of e.expr)yield*Zu(r)}function*RP(e){return yield e.const}function*Zu(e){return e.type==="and"?yield*LP(e):e.type==="or"?yield*AP(e):e.type==="const"?yield*RP(e):(()=>{throw new V0("Unknown expression")})()}function Qc(e){let r=Kc(e.pattern);return gl(r)?[...Zu(r)]:[]}d();d();function Je(e,r){return $({[j]:"Literal",const:e,type:typeof e},r)}d();function xg(e){return $({[j]:"Boolean",type:"boolean"},e)}d();function qc(e){return $({[j]:"BigInt",type:"bigint"},e)}d();function xi(e){return $({[j]:"Number",type:"number"},e)}d();function zo(e){return $({[j]:"String",type:"string"},e)}function*_P(e){let r=e.trim().replace(/"|'/g,"");return r==="boolean"?yield xg():r==="number"?yield xi():r==="bigint"?yield qc():r==="string"?yield zo():yield(()=>{let t=r.split("|").map(o=>Je(o.trim()));return t.length===0?st():t.length===1?t[0]:bi(t)})()}function*BP(e){if(e[1]!=="{"){let r=Je("$"),t=H0(e.slice(1));return yield*[r,...t]}for(let r=2;r<e.length;r++)if(e[r]==="}"){let t=_P(e.slice(2,r)),o=H0(e.slice(r+1));return yield*[...t,...o]}yield Je(e)}function*H0(e){for(let r=0;r<e.length;r++)if(e[r]==="$"){let t=Je(e.slice(0,r)),o=BP(e.slice(r));return yield*[t,...o]}yield Je(e)}function Y5(e){return[...H0(e)]}d();var $0=class extends de{};function NP(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function J5(e,r){return Po(e)?e.pattern.slice(1,e.pattern.length-1):Xe(e)?`(${e.anyOf.map(t=>J5(t,r)).join("|")})`:fl(e)?`${r}${$u}`:ml(e)?`${r}${$u}`:P0(e)?`${r}${$u}`:Uu(e)?`${r}${j0}`:us(e)?`${r}${NP(e.const.toString())}`:F0(e)?`${r}${N0}`:(()=>{throw new $0(`Unexpected Kind '${e[j]}'`)})()}function W0(e){return`^${e.map(r=>J5(r,"")).join("")}$`}d();function yl(e){let t=Qc(e).map(o=>Je(o));return bi(t)}d();function vg(e,r){let t=St(e)?W0(Y5(e)):W0(e);return $({[j]:"TemplateLiteral",type:"string",pattern:t},r)}function jP(e){return Qc(e).map(t=>t.toString())}function GP(e){let r=[];for(let t of e)r.push(...mo(t));return r}function UP(e){return[e.toString()]}function mo(e){return[...new Set(Po(e)?jP(e):Xe(e)?GP(e.anyOf):us(e)?UP(e.const):fl(e)?["[number]"]:ml(e)?["[number]"]:[])]}d();function VP(e,r,t){let o={};for(let n of Object.getOwnPropertyNames(r))o[n]=ep(e,mo(r[n]),t);return o}function HP(e,r,t){return VP(e,r.properties,t)}function K5(e,r,t){let o=HP(e,r,t);return Ve(o)}function q5(e,r){return e.map(t=>eC(t,r))}function $P(e){return e.filter(r=>!fa(r))}function WP(e,r){return Ig($P(q5(e,r)))}function zP(e){return e.some(r=>fa(r))?[]:e}function ZP(e,r){return bi(zP(q5(e,r)))}function XP(e,r){return r in e?e[r]:r==="[number]"?bi(e):st()}function YP(e,r){return r==="[number]"?e:st()}function JP(e,r){return r in e?e[r]:st()}function eC(e,r){return Yt(e)?WP(e.allOf,r):Xe(e)?ZP(e.anyOf,r):Mn(e)?XP(e.items??[],r):ds(e)?YP(e.items,r):ir(e)?JP(e.properties,r):st()}function Xu(e,r){return r.map(t=>eC(e,t))}function Q5(e,r){return bi(Xu(e,r))}function ep(e,r,t){return Et(r)?K5(e,r,t):Oo(r)?tC(e,r,t):$(wn(r)?Q5(e,mo(r)):Q5(e,r),t)}function KP(e,r,t){return{[r]:ep(e,[r],Pt(t))}}function QP(e,r,t){return r.reduce((o,n)=>({...o,...KP(e,n,t)}),{})}function qP(e,r,t){return QP(e,r.keys,t)}function tC(e,r,t){let o=qP(e,r,t);return Ve(o)}d();function Sg(e,r){return $({[j]:"Iterator",type:"Iterator",items:e},r)}d();function eF(e){let r=[];for(let t in e)yi(e[t])||r.push(t);return r}function tF(e,r){let t=eF(e),o=t.length>0?{[j]:"Object",type:"object",properties:e,required:t}:{[j]:"Object",type:"object",properties:e};return $(o,r)}var ut=tF;d();function Cg(e,r){return $({[j]:"Promise",type:"Promise",item:e},r)}d();d();function rF(e){return $($t(e,[ps]))}function oF(e){return $({...e,[ps]:"Readonly"})}function nF(e,r){return r===!1?rF(e):oF(e)}function Zo(e,r){let t=r??!0;return Et(e)?rC(e,t):nF(e,t)}function iF(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=Zo(e[o],r);return t}function sF(e,r){return iF(e.properties,r)}function rC(e,r){let t=sF(e,r);return Ve(t)}d();function vi(e,r){return $(e.length>0?{[j]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[j]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},r)}function oC(e,r){return e in r?Xo(e,r[e]):Ve(r)}function aF(e){return{[e]:Je(e)}}function lF(e){let r={};for(let t of e)r[t]=Je(t);return r}function cF(e,r){return V5(r,e)?aF(e):lF(r)}function pF(e,r){let t=cF(e,r);return oC(e,t)}function Yu(e,r){return r.map(t=>Xo(e,t))}function dF(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(r))t[o]=Xo(e,r[o]);return t}function Xo(e,r){let t={...r};return yi(r)?uo(Xo(e,$t(r,[Kr]))):r5(r)?Zo(Xo(e,$t(r,[ps]))):Et(r)?oC(e,r.properties):Oo(r)?pF(e,r.keys):Nu(r)?gg(Yu(e,r.parameters),Xo(e,r.returns),t):ju(r)?ya(Yu(e,r.parameters),Xo(e,r.returns),t):Bu(r)?hg(Xo(e,r.items),t):Gu(r)?Sg(Xo(e,r.items),t):Yt(r)?fo(Yu(e,r.allOf),t):Xe(r)?at(Yu(e,r.anyOf),t):Mn(r)?vi(Yu(e,r.items??[]),t):ir(r)?ut(dF(e,r.properties),t):ds(r)?fg(Xo(e,r.items),t):hl(r)?Cg(Xo(e,r.item),t):r}function uF(e,r){let t={};for(let o of e)t[o]=Xo(o,r);return t}function nC(e,r,t){let o=wn(e)?mo(e):e,n=r({[j]:"MappedKey",keys:o}),i=uF(o,n);return ut(i,t)}d();function mF(e){return $($t(e,[Kr]))}function fF(e){return $({...e,[Kr]:"Optional"})}function hF(e,r){return r===!1?mF(e):fF(e)}function uo(e,r){let t=r??!0;return Et(e)?iC(e,t):hF(e,t)}function gF(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=uo(e[o],r);return t}function yF(e,r){return gF(e.properties,r)}function iC(e,r){let t=yF(e,r);return Ve(t)}d();function Ju(e,r={}){let t=e.every(n=>ir(n)),o=wn(r.unevaluatedProperties)?{unevaluatedProperties:r.unevaluatedProperties}:{};return $(r.unevaluatedProperties===!1||wn(r.unevaluatedProperties)||t?{...o,[j]:"Intersect",type:"object",allOf:e}:{...o,[j]:"Intersect",allOf:e},r)}function bF(e){return e.every(r=>yi(r))}function xF(e){return $t(e,[Kr])}function sC(e){return e.map(r=>yi(r)?xF(r):r)}function vF(e,r){return bF(e)?uo(Ju(sC(e),r)):Ju(sC(e),r)}function Ig(e,r={}){if(e.length===0)return st(r);if(e.length===1)return $(e[0],r);if(e.some(t=>zc(t)))throw new Error("Cannot intersect transform types");return vF(e,r)}d();function fo(e,r){if(e.length===0)return st(r);if(e.length===1)return $(e[0],r);if(e.some(t=>zc(t)))throw new Error("Cannot intersect transform types");return Ju(e,r)}function aC(e){return e.map(r=>z0(r))}function IF(e){return fo(aC(e))}function SF(e){return at(aC(e))}function CF(e){return z0(e)}function z0(e){return Yt(e)?IF(e.allOf):Xe(e)?SF(e.anyOf):hl(e)?CF(e.item):e}function lC(e,r){return $(z0(e),r)}d();d();d();d();function cC(e){let r=[];for(let t of e)r.push(gr(t));return r}function TF(e){let r=cC(e);return W5(r)}function MF(e){let r=cC(e);return $5(r)}function wF(e){return e.map((r,t)=>t.toString())}function OF(e){return["[number]"]}function PF(e){return globalThis.Object.getOwnPropertyNames(e)}function FF(e){return Z0?globalThis.Object.getOwnPropertyNames(e).map(t=>t[0]==="^"&&t[t.length-1]==="$"?t.slice(1,t.length-1):t):[]}function gr(e){return Yt(e)?TF(e.allOf):Xe(e)?MF(e.anyOf):Mn(e)?wF(e.items??[]):ds(e)?OF(e.items):ir(e)?PF(e.properties):E0(e)?FF(e.patternProperties):[]}var Z0=!1;function gs(e){Z0=!0;let r=gr(e);return Z0=!1,`^(${r.map(o=>`(${o})`).join("|")})$`}function EF(e){return e.map(r=>r==="[number]"?xi():Je(r))}function Tg(e,r){if(Et(e))return pC(e,r);{let t=gr(e),o=EF(t),n=bi(o);return $(n,r)}}function DF(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=Tg(e[o],Pt(r));return t}function kF(e,r){return DF(e.properties,r)}function pC(e,r){let t=kF(e,r);return Ve(t)}d();function ba(e){let r=gr(e),t=Xu(e,r);return r.map((o,n)=>[r[n],t[n]])}function LF(e){let r=[];for(let t of e)r.push(...gr(t));return H5(r)}function AF(e){return e.filter(r=>!fa(r))}function RF(e,r){let t=[];for(let o of e)t.push(...Xu(o,[r]));return AF(t)}function _F(e,r){let t={};for(let o of r)t[o]=Ig(RF(e,o));return t}function dC(e,r){let t=LF(e),o=_F(e,t);return ut(o,r)}d();d();function Mg(e){return $({[j]:"Date",type:"Date"},e)}d();function wg(e){return $({[j]:"Null",type:"null"},e)}d();function Og(e){return $({[j]:"Symbol",type:"symbol"},e)}d();function Pg(e){return $({[j]:"Undefined",type:"undefined"},e)}d();function Fg(e){return $({[j]:"Uint8Array",type:"Uint8Array"},e)}d();function ys(e){return $({[j]:"Unknown"},e)}function BF(e){return e.map(r=>X0(r,!1))}function NF(e){let r={};for(let t of globalThis.Object.getOwnPropertyNames(e))r[t]=Zo(X0(e[t],!1));return r}function Eg(e,r){return r===!0?e:Zo(e)}function X0(e,r){return I0(e)?Eg(ga(),r):C0(e)?Eg(ga(),r):Nr(e)?Zo(vi(BF(e))):as(e)?Fg():ul(e)?Mg():dt(e)?Eg(ut(NF(e)),r):S0(e)?Eg(ya([],ys()),r):Bt(e)?Pg():T0(e)?wg():M0(e)?Og():Lu(e)?qc():Tn(e)?Je(e):ua(e)?Je(e):St(e)?Je(e):ut({})}function uC(e,r){return $(X0(e,!0),r)}d();function mC(e,r){return vi(e.parameters,r)}d();function Ku(e,r){return e.map(t=>On(t,r))}function jF(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=On(e[o],r);return t}function GF(e,r){return e.parameters=Ku(e.parameters,r),e.returns=On(e.returns,r),e}function UF(e,r){return e.parameters=Ku(e.parameters,r),e.returns=On(e.returns,r),e}function VF(e,r){return e.allOf=Ku(e.allOf,r),e}function HF(e,r){return e.anyOf=Ku(e.anyOf,r),e}function $F(e,r){return Bt(e.items)||(e.items=Ku(e.items,r)),e}function WF(e,r){return e.items=On(e.items,r),e}function zF(e,r){return e.properties=jF(e.properties,r),e}function ZF(e,r){return e.item=On(e.item,r),e}function XF(e,r){return e.items=On(e.items,r),e}function YF(e,r){return e.items=On(e.items,r),e}function JF(e,r){let t=r.find(n=>n.$id===e.$ref);if(t===void 0)throw Error(`Unable to dereference schema with $id ${e.$ref}`);let o=$t(t,["$id"]);return On(o,r)}function KF(e,r){return Nu(e)?GF(e,r):ju(e)?UF(e,r):Yt(e)?VF(e,r):Xe(e)?HF(e,r):Mn(e)?$F(e,r):ds(e)?WF(e,r):ir(e)?zF(e,r):hl(e)?ZF(e,r):Bu(e)?XF(e,r):Gu(e)?YF(e,r):D0(e)?JF(e,r):e}function On(e,r){return KF(Ru(e),qS(r))}d();function fC(e,r){if(Bt(e))throw new Error("Enum undefined or empty");let t=globalThis.Object.getOwnPropertyNames(e).filter(i=>isNaN(i)).map(i=>e[i]),n=[...new Set(t)].map(i=>Je(i));return at(n,{...r,[Wo]:"Enum"})}d();d();d();var J0=class extends de{},V;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(V||(V={}));function Yo(e){return e===V.False?e:V.True}function tp(e){throw new J0(e)}function er(e){return E.IsNever(e)||E.IsIntersect(e)||E.IsUnion(e)||E.IsUnknown(e)||E.IsAny(e)}function tr(e,r){return E.IsNever(r)?IC(e,r):E.IsIntersect(r)?Dg(e,r):E.IsUnion(r)?e2(e,r):E.IsUnknown(r)?MC(e,r):E.IsAny(r)?q0(e,r):tp("StructuralRight")}function q0(e,r){return V.True}function QF(e,r){return E.IsIntersect(r)?Dg(e,r):E.IsUnion(r)&&r.anyOf.some(t=>E.IsAny(t)||E.IsUnknown(t))?V.True:E.IsUnion(r)?V.Union:E.IsUnknown(r)||E.IsAny(r)?V.True:V.Union}function qF(e,r){return E.IsUnknown(e)?V.False:E.IsAny(e)?V.Union:E.IsNever(e)?V.True:V.False}function eE(e,r){return E.IsObject(r)&&kg(r)?V.True:er(r)?tr(e,r):E.IsArray(r)?Yo(lt(e.items,r.items)):V.False}function tE(e,r){return er(r)?tr(e,r):E.IsAsyncIterator(r)?Yo(lt(e.items,r.items)):V.False}function rE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):E.IsBigInt(r)?V.True:V.False}function xC(e,r){return E.IsLiteralBoolean(e)||E.IsBoolean(e)?V.True:V.False}function oE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):E.IsBoolean(r)?V.True:V.False}function nE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsConstructor(r)?e.parameters.length>r.parameters.length?V.False:e.parameters.every((t,o)=>Yo(lt(r.parameters[o],t))===V.True)?Yo(lt(e.returns,r.returns)):V.False:V.False}function iE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):E.IsDate(r)?V.True:V.False}function sE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsFunction(r)?e.parameters.length>r.parameters.length?V.False:e.parameters.every((t,o)=>Yo(lt(r.parameters[o],t))===V.True)?Yo(lt(e.returns,r.returns)):V.False:V.False}function vC(e,r){return E.IsLiteral(e)&&Ge.IsNumber(e.const)||E.IsNumber(e)||E.IsInteger(e)?V.True:V.False}function aE(e,r){return E.IsInteger(r)||E.IsNumber(r)?V.True:er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):V.False}function Dg(e,r){return r.allOf.every(t=>lt(e,t)===V.True)?V.True:V.False}function lE(e,r){return e.allOf.some(t=>lt(t,r)===V.True)?V.True:V.False}function cE(e,r){return er(r)?tr(e,r):E.IsIterator(r)?Yo(lt(e.items,r.items)):V.False}function pE(e,r){return E.IsLiteral(r)&&r.const===e.const?V.True:er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):E.IsString(r)?TC(e,r):E.IsNumber(r)?SC(e,r):E.IsInteger(r)?vC(e,r):E.IsBoolean(r)?xC(e,r):V.False}function IC(e,r){return V.False}function dE(e,r){return V.True}function hC(e){let[r,t]=[e,0];for(;E.IsNot(r);)r=r.not,t+=1;return t%2===0?r:ys()}function uE(e,r){return E.IsNot(e)?lt(hC(e),r):E.IsNot(r)?lt(e,hC(r)):tp("Invalid fallthrough for Not")}function mE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):E.IsNull(r)?V.True:V.False}function SC(e,r){return E.IsLiteralNumber(e)||E.IsNumber(e)||E.IsInteger(e)?V.True:V.False}function fE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):E.IsInteger(r)||E.IsNumber(r)?V.True:V.False}function ho(e,r){return Object.getOwnPropertyNames(e.properties).length===r}function gC(e){return kg(e)}function yC(e){return ho(e,0)||ho(e,1)&&"description"in e.properties&&E.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(E.IsString(e.properties.description.anyOf[0])&&E.IsUndefined(e.properties.description.anyOf[1])||E.IsString(e.properties.description.anyOf[1])&&E.IsUndefined(e.properties.description.anyOf[0]))}function Y0(e){return ho(e,0)}function bC(e){return ho(e,0)}function hE(e){return ho(e,0)}function gE(e){return ho(e,0)}function yE(e){return kg(e)}function bE(e){let r=xi();return ho(e,0)||ho(e,1)&&"length"in e.properties&&Yo(lt(e.properties.length,r))===V.True}function xE(e){return ho(e,0)}function kg(e){let r=xi();return ho(e,0)||ho(e,1)&&"length"in e.properties&&Yo(lt(e.properties.length,r))===V.True}function vE(e){let r=ya([ga()],ga());return ho(e,0)||ho(e,1)&&"then"in e.properties&&Yo(lt(e.properties.then,r))===V.True}function CC(e,r){return lt(e,r)===V.False||E.IsOptional(e)&&!E.IsOptional(r)?V.False:V.True}function jr(e,r){return E.IsUnknown(e)?V.False:E.IsAny(e)?V.Union:E.IsNever(e)||E.IsLiteralString(e)&&gC(r)||E.IsLiteralNumber(e)&&Y0(r)||E.IsLiteralBoolean(e)&&bC(r)||E.IsSymbol(e)&&yC(r)||E.IsBigInt(e)&&hE(r)||E.IsString(e)&&gC(r)||E.IsSymbol(e)&&yC(r)||E.IsNumber(e)&&Y0(r)||E.IsInteger(e)&&Y0(r)||E.IsBoolean(e)&&bC(r)||E.IsUint8Array(e)&&yE(r)||E.IsDate(e)&&gE(r)||E.IsConstructor(e)&&xE(r)||E.IsFunction(e)&&bE(r)?V.True:E.IsRecord(e)&&E.IsString(K0(e))?r[Wo]==="Record"?V.True:V.False:E.IsRecord(e)&&E.IsNumber(K0(e))?ho(r,0)?V.True:V.False:V.False}function IE(e,r){return er(r)?tr(e,r):E.IsRecord(r)?Jo(e,r):E.IsObject(r)?(()=>{for(let t of Object.getOwnPropertyNames(r.properties)){if(!(t in e.properties)&&!E.IsOptional(r.properties[t]))return V.False;if(E.IsOptional(r.properties[t]))return V.True;if(CC(e.properties[t],r.properties[t])===V.False)return V.False}return V.True})():V.False}function SE(e,r){return er(r)?tr(e,r):E.IsObject(r)&&vE(r)?V.True:E.IsPromise(r)?Yo(lt(e.item,r.item)):V.False}function K0(e){return ms in e.patternProperties?xi():fs in e.patternProperties?zo():tp("Unknown record key pattern")}function Q0(e){return ms in e.patternProperties?e.patternProperties[ms]:fs in e.patternProperties?e.patternProperties[fs]:tp("Unable to get record value schema")}function Jo(e,r){let[t,o]=[K0(r),Q0(r)];return E.IsLiteralString(e)&&E.IsNumber(t)&&Yo(lt(e,o))===V.True?V.True:E.IsUint8Array(e)&&E.IsNumber(t)||E.IsString(e)&&E.IsNumber(t)||E.IsArray(e)&&E.IsNumber(t)?lt(e,o):E.IsObject(e)?(()=>{for(let n of Object.getOwnPropertyNames(e.properties))if(CC(o,e.properties[n])===V.False)return V.False;return V.True})():V.False}function CE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?lt(Q0(e),Q0(r)):V.False}function TE(e,r){let t=E.IsRegExp(e)?zo():e,o=E.IsRegExp(r)?zo():r;return lt(t,o)}function TC(e,r){return E.IsLiteral(e)&&Ge.IsString(e.const)||E.IsString(e)?V.True:V.False}function ME(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):E.IsString(r)?V.True:V.False}function wE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):E.IsSymbol(r)?V.True:V.False}function OE(e,r){return E.IsTemplateLiteral(e)?lt(yl(e),r):E.IsTemplateLiteral(r)?lt(e,yl(r)):tp("Invalid fallthrough for TemplateLiteral")}function PE(e,r){return E.IsArray(r)&&e.items!==void 0&&e.items.every(t=>lt(t,r.items)===V.True)}function FE(e,r){return E.IsNever(e)?V.True:E.IsUnknown(e)?V.False:E.IsAny(e)?V.Union:V.False}function EE(e,r){return er(r)?tr(e,r):E.IsObject(r)&&kg(r)||E.IsArray(r)&&PE(e,r)?V.True:E.IsTuple(r)?Ge.IsUndefined(e.items)&&!Ge.IsUndefined(r.items)||!Ge.IsUndefined(e.items)&&Ge.IsUndefined(r.items)?V.False:Ge.IsUndefined(e.items)&&!Ge.IsUndefined(r.items)||e.items.every((t,o)=>lt(t,r.items[o])===V.True)?V.True:V.False:V.False}function DE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):E.IsUint8Array(r)?V.True:V.False}function kE(e,r){return er(r)?tr(e,r):E.IsObject(r)?jr(e,r):E.IsRecord(r)?Jo(e,r):E.IsVoid(r)?RE(e,r):E.IsUndefined(r)?V.True:V.False}function e2(e,r){return r.anyOf.some(t=>lt(e,t)===V.True)?V.True:V.False}function LE(e,r){return e.anyOf.every(t=>lt(t,r)===V.True)?V.True:V.False}function MC(e,r){return V.True}function AE(e,r){return E.IsNever(r)?IC(e,r):E.IsIntersect(r)?Dg(e,r):E.IsUnion(r)?e2(e,r):E.IsAny(r)?q0(e,r):E.IsString(r)?TC(e,r):E.IsNumber(r)?SC(e,r):E.IsInteger(r)?vC(e,r):E.IsBoolean(r)?xC(e,r):E.IsArray(r)?qF(e,r):E.IsTuple(r)?FE(e,r):E.IsObject(r)?jr(e,r):E.IsUnknown(r)?V.True:V.False}function RE(e,r){return E.IsUndefined(e)||E.IsUndefined(e)?V.True:V.False}function _E(e,r){return E.IsIntersect(r)?Dg(e,r):E.IsUnion(r)?e2(e,r):E.IsUnknown(r)?MC(e,r):E.IsAny(r)?q0(e,r):E.IsObject(r)?jr(e,r):E.IsVoid(r)?V.True:V.False}function lt(e,r){return E.IsTemplateLiteral(e)||E.IsTemplateLiteral(r)?OE(e,r):E.IsRegExp(e)||E.IsRegExp(r)?TE(e,r):E.IsNot(e)||E.IsNot(r)?uE(e,r):E.IsAny(e)?QF(e,r):E.IsArray(e)?eE(e,r):E.IsBigInt(e)?rE(e,r):E.IsBoolean(e)?oE(e,r):E.IsAsyncIterator(e)?tE(e,r):E.IsConstructor(e)?nE(e,r):E.IsDate(e)?iE(e,r):E.IsFunction(e)?sE(e,r):E.IsInteger(e)?aE(e,r):E.IsIntersect(e)?lE(e,r):E.IsIterator(e)?cE(e,r):E.IsLiteral(e)?pE(e,r):E.IsNever(e)?dE(e,r):E.IsNull(e)?mE(e,r):E.IsNumber(e)?fE(e,r):E.IsObject(e)?IE(e,r):E.IsRecord(e)?CE(e,r):E.IsString(e)?ME(e,r):E.IsSymbol(e)?wE(e,r):E.IsTuple(e)?EE(e,r):E.IsPromise(e)?SE(e,r):E.IsUint8Array(e)?DE(e,r):E.IsUndefined(e)?kE(e,r):E.IsUnion(e)?LE(e,r):E.IsUnknown(e)?AE(e,r):E.IsVoid(e)?_E(e,r):tp(`Unknown left type operand '${e[j]}'`)}function xa(e,r){return lt(e,r)}d();d();d();function BE(e,r,t,o,n){let i={};for(let a of globalThis.Object.getOwnPropertyNames(e))i[a]=rp(e[a],r,t,o,Pt(n));return i}function NE(e,r,t,o,n){return BE(e.properties,r,t,o,n)}function wC(e,r,t,o,n){let i=NE(e,r,t,o,n);return Ve(i)}function jE(e,r,t,o){let n=xa(e,r);return n===V.Union?at([t,o]):n===V.True?t:o}function rp(e,r,t,o,n){return Et(e)?wC(e,r,t,o,n):Oo(e)?$(OC(e,r,t,o,n)):$(jE(e,r,t,o),n)}function GE(e,r,t,o,n){return{[e]:rp(Je(e),r,t,o,Pt(n))}}function UE(e,r,t,o,n){return e.reduce((i,a)=>({...i,...GE(a,r,t,o,n)}),{})}function VE(e,r,t,o,n){return UE(e.keys,r,t,o,n)}function OC(e,r,t,o,n){let i=VE(e,r,t,o,n);return Ve(i)}d();function HE(e){return e.allOf.every(r=>bs(r))}function $E(e){return e.anyOf.some(r=>bs(r))}function WE(e){return!bs(e.not)}function bs(e){return e[j]==="Intersect"?HE(e):e[j]==="Union"?$E(e):e[j]==="Not"?WE(e):e[j]==="Undefined"}d();function PC(e,r){return op(yl(e),r)}function zE(e,r){let t=e.filter(o=>xa(o,r)===V.False);return t.length===1?t[0]:at(t)}function op(e,r,t={}){return Po(e)?$(PC(e,r),t):Et(e)?$(FC(e,r),t):$(Xe(e)?zE(e.anyOf,r):xa(e,r)!==V.False?st():e,t)}function ZE(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=op(e[o],r);return t}function XE(e,r){return ZE(e.properties,r)}function FC(e,r){let t=XE(e,r);return Ve(t)}d();d();d();function EC(e,r){return np(yl(e),r)}function YE(e,r){let t=e.filter(o=>xa(o,r)!==V.False);return t.length===1?t[0]:at(t)}function np(e,r,t){return Po(e)?$(EC(e,r),t):Et(e)?$(DC(e,r),t):$(Xe(e)?YE(e.anyOf,r):xa(e,r)!==V.False?e:st(),t)}function JE(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=np(e[o],r);return t}function KE(e,r){return JE(e.properties,r)}function DC(e,r){let t=KE(e,r);return Ve(t)}d();function kC(e,r){return $(e.returns,r)}d();function LC(e){return $({[j]:"Integer",type:"integer"},e)}d();d();d();function QE(e,r,t){return{[e]:Pn(Je(e),r,Pt(t))}}function qE(e,r,t){return e.reduce((n,i)=>({...n,...QE(i,r,t)}),{})}function eD(e,r,t){return qE(e.keys,r,t)}function AC(e,r,t){let o=eD(e,r,t);return Ve(o)}function tD(e){let[r,t]=[e.slice(0,1),e.slice(1)];return[r.toLowerCase(),t].join("")}function rD(e){let[r,t]=[e.slice(0,1),e.slice(1)];return[r.toUpperCase(),t].join("")}function oD(e){return e.toUpperCase()}function nD(e){return e.toLowerCase()}function iD(e,r,t){let o=Kc(e.pattern);if(!gl(o))return{...e,pattern:RC(e.pattern,r)};let a=[...Zu(o)].map(p=>Je(p)),l=_C(a,r),c=at(l);return vg([c],t)}function RC(e,r){return typeof e=="string"?r==="Uncapitalize"?tD(e):r==="Capitalize"?rD(e):r==="Uppercase"?oD(e):r==="Lowercase"?nD(e):e:e.toString()}function _C(e,r){return e.map(t=>Pn(t,r))}function Pn(e,r,t={}){return Oo(e)?AC(e,r,t):Po(e)?iD(e,r,t):Xe(e)?at(_C(e.anyOf,r),t):us(e)?Je(RC(e.const,r),t):$(e,t)}function BC(e,r={}){return Pn(e,"Capitalize",r)}d();function NC(e,r={}){return Pn(e,"Lowercase",r)}d();function jC(e,r={}){return Pn(e,"Uncapitalize",r)}d();function GC(e,r={}){return Pn(e,"Uppercase",r)}d();function UC(e,r){return $({[j]:"Not",not:e},r)}d();d();d();function sD(e,r,t){let o={};for(let n of globalThis.Object.getOwnPropertyNames(e))o[n]=ip(e[n],r,Pt(t));return o}function aD(e,r,t){return sD(e.properties,r,t)}function VC(e,r,t){let o=aD(e,r,t);return Ve(o)}function lD(e,r){return e.map(t=>t2(t,r))}function cD(e,r){return e.map(t=>t2(t,r))}function pD(e,r){let{[r]:t,...o}=e;return o}function dD(e,r){return r.reduce((t,o)=>pD(t,o),e)}function uD(e,r){let t=$t(e,[Ft,"$id","required","properties"]),o=dD(e.properties,r);return ut(o,t)}function t2(e,r){return Yt(e)?fo(lD(e.allOf,r)):Xe(e)?at(cD(e.anyOf,r)):ir(e)?uD(e,r):ut({})}function ip(e,r,t){if(Oo(r))return HC(e,r,t);if(Et(e))return VC(e,r,t);let o=wn(r)?mo(r):r;return $({...t2(e,o),...t})}function mD(e,r,t){return{[r]:ip(e,[r],Pt(t))}}function fD(e,r,t){return r.reduce((o,n)=>({...o,...mD(e,n,t)}),{})}function hD(e,r,t){return fD(e,r.keys,t)}function HC(e,r,t){let o=hD(e,r,t);return Ve(o)}d();function $C(e,r){return vi(e.parameters,r)}d();d();function WC(e){return e.map(r=>zC(r))}function gD(e){let r={};for(let t of globalThis.Object.getOwnPropertyNames(e))r[t]=uo(e[t]);return r}function yD(e){let r=$t(e,[Ft,"$id","required","properties"]),t=gD(e.properties);return ut(t,r)}function zC(e){return Yt(e)?fo(WC(e.allOf)):Xe(e)?at(WC(e.anyOf)):ir(e)?yD(e):ut({})}function Lg(e,r){return Et(e)?ZC(e,r):$({...zC(e),...r})}function bD(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=Lg(e[o],Pt(r));return t}function xD(e,r){return bD(e.properties,r)}function ZC(e,r){let t=xD(e,r);return Ve(t)}d();d();d();function vD(e,r,t){let o={};for(let n of globalThis.Object.getOwnPropertyNames(e))o[n]=sp(e[n],r,Pt(t));return o}function ID(e,r,t){return vD(e.properties,r,t)}function XC(e,r,t){let o=ID(e,r,t);return Ve(o)}function SD(e,r){return e.map(t=>r2(t,r))}function CD(e,r){return e.map(t=>r2(t,r))}function TD(e,r){let t={};for(let o of r)o in e&&(t[o]=e[o]);return t}function MD(e,r){let t=$t(e,[Ft,"$id","required","properties"]),o=TD(e.properties,r);return ut(o,t)}function r2(e,r){return Yt(e)?fo(SD(e.allOf,r)):Xe(e)?at(CD(e.anyOf,r)):ir(e)?MD(e,r):ut({})}function sp(e,r,t){if(Oo(r))return YC(e,r,t);if(Et(e))return XC(e,r,t);let o=wn(r)?mo(r):r;return $({...r2(e,o),...t})}function wD(e,r,t){return{[r]:sp(e,[r],Pt(t))}}function OD(e,r,t){return r.reduce((o,n)=>({...o,...wD(e,n,t)}),{})}function PD(e,r,t){return OD(e,r.keys,t)}function YC(e,r,t){let o=PD(e,r,t);return Ve(o)}d();function JC(e){return Zo(uo(e))}d();function bl(e,r,t){return $({[j]:"Record",type:"object",patternProperties:{[e]:r}},t)}function o2(e,r,t){let o={};for(let n of e)o[n]=r;return ut(o,{...t,[Wo]:"Record"})}function FD(e,r,t){return bg(e)?o2(mo(e),r,t):bl(e.pattern,r,t)}function ED(e,r,t){return o2(mo(at(e)),r,t)}function DD(e,r,t){return o2([e.toString()],r,t)}function kD(e,r,t){return bl(e.source,r,t)}function LD(e,r,t){let o=Bt(e.pattern)?fs:e.pattern;return bl(o,r,t)}function AD(e,r,t){return bl(fs,r,t)}function RD(e,r,t){return bl(U5,r,t)}function _D(e,r,t){return bl(ms,r,t)}function BD(e,r,t){return bl(ms,r,t)}function KC(e,r,t={}){return Xe(e)?ED(e.anyOf,r,t):Po(e)?FD(e,r,t):us(e)?DD(e.const,r,t):ml(e)?_D(e,r,t):fl(e)?BD(e,r,t):k0(e)?kD(e,r,t):Uu(e)?LD(e,r,t):O0(e)?AD(e,r,t):fa(e)?RD(e,r,t):st(t)}d();var ND=0;function QC(e,r={}){Bt(r.$id)&&(r.$id=`T${ND++}`);let t=Ru(e({[j]:"This",$ref:`${r.$id}`}));return t.$id=r.$id,$({[Wo]:"Recursive",...t},r)}d();function qC(e,r){if(St(e))return $({[j]:"Ref",$ref:e},r);if(Bt(e.$id))throw new Error("Reference target type must specify an $id");return $({[j]:"Ref",$ref:e.$id},r)}d();function e4(e,r){let t=St(e)?new globalThis.RegExp(e):e;return $({[j]:"RegExp",type:"RegExp",source:t.source,flags:t.flags},r)}d();d();function t4(e){return e.map(r=>r4(r))}function jD(e){let r={};for(let t of globalThis.Object.getOwnPropertyNames(e))r[t]=$t(e[t],[Kr]);return r}function GD(e){let r=$t(e,[Ft,"$id","required","properties"]),t=jD(e.properties);return ut(t,r)}function r4(e){return Yt(e)?fo(t4(e.allOf)):Xe(e)?at(t4(e.anyOf)):ir(e)?GD(e):ut({})}function Ag(e,r){return Et(e)?o4(e,r):$({...r4(e),...r})}function UD(e,r){let t={};for(let o of globalThis.Object.getOwnPropertyNames(e))t[o]=Ag(e[o],r);return t}function VD(e,r){return UD(e.properties,r)}function o4(e,r){let t=VD(e,r);return Ve(t)}d();function HD(e){return Yt(e)?e.allOf:Xe(e)?e.anyOf:Mn(e)?e.items??[]:[]}function n4(e){return HD(e)}d();function i4(e,r){return $(e.returns,r)}d();function s4(e){return JSON.parse(JSON.stringify(e))}d();var n2=class{constructor(r){this.schema=r}Decode(r){return new i2(this.schema,r)}},i2=class{constructor(r,t){this.schema=r,this.decode=t}EncodeTransform(r,t){let i={Encode:a=>t[Ft].Encode(r(a)),Decode:a=>this.decode(t[Ft].Decode(a))};return{...t,[Ft]:i}}EncodeSchema(r,t){let o={Decode:this.decode,Encode:r};return{...t,[Ft]:o}}Encode(r){return zc(this.schema)?this.EncodeTransform(r,this.schema):this.EncodeSchema(r,this.schema)}};function a4(e){return new n2(e)}d();function Rg(e={}){return $({[j]:e[j]??"Unsafe"},e)}d();function l4(e){return $({[j]:"Void",type:"void"},e)}d();var s2={};na(s2,{Any:()=>ga,Array:()=>fg,AsyncIterator:()=>hg,Awaited:()=>lC,BigInt:()=>qc,Boolean:()=>xg,Capitalize:()=>BC,Composite:()=>dC,Const:()=>uC,Constructor:()=>gg,ConstructorParameters:()=>mC,Date:()=>Mg,Deref:()=>On,Enum:()=>fC,Exclude:()=>op,Extends:()=>rp,Extract:()=>np,Function:()=>ya,Index:()=>ep,InstanceType:()=>kC,Integer:()=>LC,Intersect:()=>fo,Iterator:()=>Sg,KeyOf:()=>Tg,Literal:()=>Je,Lowercase:()=>NC,Mapped:()=>nC,Never:()=>st,Not:()=>UC,Null:()=>wg,Number:()=>xi,Object:()=>ut,Omit:()=>ip,Optional:()=>uo,Parameters:()=>$C,Partial:()=>Lg,Pick:()=>sp,Promise:()=>Cg,Readonly:()=>Zo,ReadonlyOptional:()=>JC,Record:()=>KC,Recursive:()=>QC,Ref:()=>qC,RegExp:()=>e4,Required:()=>Ag,Rest:()=>n4,ReturnType:()=>i4,Strict:()=>s4,String:()=>zo,Symbol:()=>Og,TemplateLiteral:()=>vg,Transform:()=>a4,Tuple:()=>vi,Uint8Array:()=>Fg,Uncapitalize:()=>jC,Undefined:()=>Pg,Union:()=>at,Unknown:()=>ys,Unsafe:()=>Rg,Uppercase:()=>GC,Void:()=>l4});d();var h=s2;d();var Qu=h.Object({externalId:h.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:h.String({description:"The name of the entity."}),shortName:h.String({description:"A short name for the entity."}),description:h.String({description:"A description of the entity."}),icon:h.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),a2=h.Partial(Qu,{$id:"Details",description:"Additional information about a given entity."}),Fo=h.Object({details:h.Optional(h.Ref(a2))},{$id:"WithDetails"}),xl=e=>{let r=[...e].sort(),t=h.Pick(Qu,e),o=h.Omit(Qu,e);return h.Object({details:h.Intersect([t,h.Partial(o)])},{$id:`WithRequiredDetails_${r.join("_")}`})},l2=[Qu,a2];d();var ap=h.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),lp=h.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),vl=h.Tuple([h.Ref(ap),h.Ref(lp)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),Gr=h.Object({type:h.Literal("Point"),coordinates:h.Ref(vl)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),_g=h.Object({type:h.Literal("MultiPoint"),coordinates:h.Array(h.Ref(vl))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),Bg=h.Object({type:h.Literal("LineString"),coordinates:h.Array(h.Ref(vl),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),Ng=h.Object({type:h.Literal("MultiLineString"),coordinates:h.Array(h.Array(h.Ref(vl),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),c4=h.Array(h.Ref(vl),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),c2=h.Array(h.Ref(c4),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),cp=h.Object({type:h.Literal("Polygon"),coordinates:h.Ref(c2)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),pp=h.Object({type:h.Literal("MultiPolygon"),coordinates:h.Array(h.Ref(c2))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),Pr=(e,r,t)=>h.Object({type:h.Literal("Feature"),geometry:e,properties:r},t),Qr=(e,r,t)=>h.Object({type:h.Literal("FeatureCollection"),features:h.Array(e,t)},r),p2=[ap,lp,vl,Gr,_g,Bg,Ng,c4,c2,cp,pp];d();var Wt=(e,r)=>h.Unsafe(h.String({$id:r,pattern:`^${e}_[A-Za-z0-9-]+$`})),Ur=Wt("g","GeometryId"),Ae=Wt("f","FloorId"),d2=[Ur,Ae];d();d();d();var jg=class{constructor(r){u(this,"_value");this._value=r}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let r=this._value;return this._value=null,{done:!1,value:r}}},Gg=class{constructor(r){u(this,"_tag","Some");u(this,"_value");this._value=r}get value(){return this._value}isSome(){return!0}isSomeAnd(r){return r(this.value)}isNone(){return!1}equals(r){return r.isSome()&&r.value===this.value}expect(r){return this.value}unwrap(){return this.value}unwrapOr(r){return this.value}unwrapOrElse(r){return this.value}inspect(r){return r(this.value),this}inspectNone(r){return this}map(r){return p4(r(this.value))}mapAsync(r){return r(this.value).then(t=>p4(t))}mapOr(r,t){return this.map(r).unwrapOr(t)}mapOrAsync(r,t){return this.mapAsync(r).then(o=>o.unwrapOr(t))}mapOrElse(r,t){return this.map(r).unwrapOrElse(t)}mapOrElseAsync(r,t){return this.mapAsync(r).then(o=>o.unwrapOrElse(t))}and(r){return r}andThen(r){return r(this.value)}andThenAsync(r){return r(this.value)}filter(r){return r(this.value)?this:va()}or(r){return this}orElse(r){return this}xor(r){return r.isSome()?va():this}toString(){return`Some(${this.value})`}okOr(r){return ee(this.value)}okOrElse(r){return ee(this.value)}iter(){return new jg(this.value)}[Symbol.iterator](){return this.iter()}zip(r){return r.isSome()?dp([this.value,r.value]):va()}zipWith(r,t){return r.isSome()?dp(t(this.value,r.value)):va()}get[Symbol.toStringTag](){return"Some"}},Ug=class{constructor(){u(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(r){return!1}isNone(){return!0}equals(r){return r.isNone()}expect(r){throw new Error(r)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(r){return r}unwrapOrElse(r){return r()}inspect(r){return this}inspectNone(r){return r(),this}map(r){return this}mapAsync(r){return Promise.resolve(this)}mapOr(r,t){return t}mapOrAsync(r,t){return Promise.resolve(t)}mapOrElse(r,t){return t()}mapOrElseAsync(r,t){return t()}and(r){return this}andThen(r){return this}andThenAsync(r){return Promise.resolve(this)}filter(r){return this}or(r){return r}orElse(r){return r()}xor(r){return r}toString(){return"None"}okOr(r){return re(r)}okOrElse(r){return re(r())}iter(){return new jg(null)}[Symbol.iterator](){return this.iter()}zip(r){return this}zipWith(r,t){return this}get[Symbol.toStringTag](){return"None"}},dp=e=>new Gg(e),va=()=>new Ug,p4=e=>e instanceof Gg||e instanceof Ug?e:e==null?va():dp(e);var Vg=class{constructor(r){u(this,"_value");this._value=r}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let r=this._value;return this._value=null,{done:!1,value:r}}},u2=class{constructor(r){u(this,"_tag","Ok");u(this,"_value");this._value=r}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(r){return r(this.value)}isErr(){return!1}isErrAnd(r){return!1}ok(){return dp(this.value)}err(){return va()}expect(r){return this.value}expectErr(r){throw new Error(r)}unwrap(){return this.value}unwrapOr(r){return this.value}unwrapOrElse(r){return this.value}inspect(r){return r(this.value),this}inspectErr(){return this}map(r){return ee(r(this.value))}async mapAsync(r){return r(this.value).then(ee)}mapOr(r,t){return r(this.value)}async mapOrAsync(r,t){return r(this.value)}mapOrElse(r,t){return r(this.value)}async mapOrElseAsync(r,t){return r(this.value)}mapErr(r){return this}iter(){return new Vg(this.value)}[Symbol.iterator](){return this.iter()}and(r){return r}andThen(r){return r(this.value)}or(r){return this}orElse(r){return this}async andThenAsync(r){return r(this.value)}toString(){return`Ok(${this.value})`}get[Symbol.toStringTag](){return"Ok"}},m2=class e{constructor(r){u(this,"_tag","Err");u(this,"_error");this._error=r}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(r){return!1}isErr(){return!0}isErrAnd(r){return r(this.error)}ok(){return va()}err(){return dp(this.error)}expect(r){throw new Error(r)}expectErr(r){return this.error}unwrap(){throw this.error}unwrapOr(r){return r}unwrapOrElse(r){return r()}inspect(){return this}inspectErr(r){return r(this.error),this}map(r){return this}iter(){return new Vg(null)}[Symbol.iterator](){return this.iter()}async mapAsync(r){return this}mapOr(r,t){return t}async mapOrAsync(r,t){return t}mapOrElse(r,t){return t()}async mapOrElseAsync(r,t){return t()}mapErr(r){return new e(r(this.error))}and(r){return this}andThen(r){return this}async andThenAsync(r){return this}or(r){return r}orElse(r){return r(this.error)}toString(){return`Err(${this.error})`}get[Symbol.toStringTag](){return"Err"}},ee=e=>new u2(e),re=e=>new m2(e);d();var go;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError",e.DuplicateIdError="DuplicateIdError"})(go||(go={}));d();d();d();d();var f2=class extends de{constructor(r){super(`Duplicate type kind '${r}' detected`)}},qu=class extends de{constructor(r){super(`Duplicate string format '${r}' detected`)}},Hg;(function(e){function r(o,n){if(hr.Has(o))throw new f2(o);return hr.Set(o,n),(i={})=>Rg({...i,[j]:o})}e.Type=r;function t(o,n){if(po.Has(o))throw new qu(o);return po.Set(o,n),o}e.Format=t})(Hg||(Hg={}));d();function $D(e){switch(e.errorType){case U.ArrayContains:return"Expected array to contain at least one matching value";case U.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case U.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case U.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case U.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case U.ArrayUniqueItems:return"Expected array elements to be unique";case U.Array:return"Expected array";case U.AsyncIterator:return"Expected AsyncIterator";case U.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case U.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case U.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case U.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case U.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case U.BigInt:return"Expected bigint";case U.Boolean:return"Expected boolean";case U.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case U.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case U.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case U.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case U.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case U.Date:return"Expected Date";case U.Function:return"Expected function";case U.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case U.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case U.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case U.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case U.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case U.Integer:return"Expected integer";case U.IntersectUnevaluatedProperties:return"Unexpected property";case U.Intersect:return"Expected all values to match";case U.Iterator:return"Expected Iterator";case U.Literal:return`Expected ${typeof e.schema.const=="string"?`'${e.schema.const}'`:e.schema.const}`;case U.Never:return"Never";case U.Not:return"Value should not match";case U.Null:return"Expected null";case U.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case U.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case U.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case U.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case U.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case U.Number:return"Expected number";case U.Object:return"Expected object";case U.ObjectAdditionalProperties:return"Unexpected property";case U.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case U.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case U.ObjectRequiredProperty:return"Expected required property";case U.Promise:return"Expected Promise";case U.RegExp:return"Expected string to match regular expression";case U.StringFormatUnknown:return`Unknown format '${e.schema.format}'`;case U.StringFormat:return`Expected string to match '${e.schema.format}' format`;case U.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case U.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case U.StringPattern:return`Expected string to match '${e.schema.pattern}'`;case U.String:return"Expected string";case U.Symbol:return"Expected symbol";case U.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case U.Tuple:return"Expected tuple";case U.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case U.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case U.Uint8Array:return"Expected Uint8Array";case U.Undefined:return"Expected undefined";case U.Union:return"Expected union value";case U.Void:return"Expected void";case U.Kind:return`Expected kind '${e.schema[j]}'`;default:return"Unknown error type"}}var WD=$D;function d4(){return WD}d();var h2=class extends de{constructor(r){super(`Unable to dereference schema with $id '${r.$ref}'`),this.schema=r}};function zD(e,r){let t=r.find(o=>o.$id===e.$ref);if(t===void 0)throw new h2(e);return He(t,r)}function Ko(e,r){return!_e(e.$id)||r.some(t=>t.$id===e.$id)||r.push(e),r}function He(e,r){return e[j]==="This"||e[j]==="Ref"?zD(e,r):e}d();var g2=class extends de{constructor(r){super("Unable to hash value"),this.value=r}},Eo;(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"})(Eo||(Eo={}));var up=BigInt("14695981039346656037"),[ZD,XD]=[BigInt("1099511628211"),BigInt("18446744073709551616")],YD=Array.from({length:256}).map((e,r)=>BigInt(r)),u4=new Float64Array(1),m4=new DataView(u4.buffer),f4=new Uint8Array(u4.buffer);function*JD(e){let r=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let t=0;t<r;t++)yield e>>8*(r-1-t)&255}function KD(e){Vr(Eo.Array);for(let r of e)mp(r)}function QD(e){Vr(Eo.Boolean),Vr(e?1:0)}function qD(e){Vr(Eo.BigInt),m4.setBigInt64(0,e);for(let r of f4)Vr(r)}function ek(e){Vr(Eo.Date),mp(e.getTime())}function tk(e){Vr(Eo.Null)}function rk(e){Vr(Eo.Number),m4.setFloat64(0,e);for(let r of f4)Vr(r)}function ok(e){Vr(Eo.Object);for(let r of globalThis.Object.getOwnPropertyNames(e).sort())mp(r),mp(e[r])}function nk(e){Vr(Eo.String);for(let r=0;r<e.length;r++)for(let t of JD(e.charCodeAt(r)))Vr(t)}function ik(e){Vr(Eo.Symbol),mp(e.description)}function sk(e){Vr(Eo.Uint8Array);for(let r=0;r<e.length;r++)Vr(e[r])}function ak(e){return Vr(Eo.Undefined)}function mp(e){if(xe(e))return KD(e);if(gi(e))return QD(e);if(wr(e))return qD(e);if(Jr(e))return ek(e);if(ls(e))return tk(e);if(le(e))return rk(e);if(Ce(e))return ok(e);if(_e(e))return nk(e);if(cs(e))return ik(e);if(Wc(e))return sk(e);if(Nt(e))return ak(e);throw new g2(e)}function Vr(e){up=up^YD[e],up=up*ZD%XD}function Ia(e){return up=BigInt("14695981039346656037"),mp(e),up}d();var y2=class extends de{constructor(r){super("Unknown type"),this.schema=r}};function lk(e){return e[j]==="Any"||e[j]==="Unknown"}function De(e){return e!==void 0}function ck(e,r,t){return!0}function pk(e,r,t){if(!xe(t)||De(e.minItems)&&!(t.length>=e.minItems)||De(e.maxItems)&&!(t.length<=e.maxItems)||!t.every(i=>Fr(e.items,r,i))||e.uniqueItems===!0&&!function(){let i=new Set;for(let a of t){let l=Ia(a);if(i.has(l))return!1;i.add(l)}return!0}())return!1;if(!(De(e.contains)||le(e.minContains)||le(e.maxContains)))return!0;let o=De(e.contains)?e.contains:st(),n=t.reduce((i,a)=>Fr(o,r,a)?i+1:i,0);return!(n===0||le(e.minContains)&&n<e.minContains||le(e.maxContains)&&n>e.maxContains)}function dk(e,r,t){return pg(t)}function uk(e,r,t){return!(!wr(t)||De(e.exclusiveMaximum)&&!(t<e.exclusiveMaximum)||De(e.exclusiveMinimum)&&!(t>e.exclusiveMinimum)||De(e.maximum)&&!(t<=e.maximum)||De(e.minimum)&&!(t>=e.minimum)||De(e.multipleOf)&&t%e.multipleOf!==BigInt(0))}function mk(e,r,t){return gi(t)}function fk(e,r,t){return Fr(e.returns,r,t.prototype)}function hk(e,r,t){return!(!Jr(t)||De(e.exclusiveMaximumTimestamp)&&!(t.getTime()<e.exclusiveMaximumTimestamp)||De(e.exclusiveMinimumTimestamp)&&!(t.getTime()>e.exclusiveMinimumTimestamp)||De(e.maximumTimestamp)&&!(t.getTime()<=e.maximumTimestamp)||De(e.minimumTimestamp)&&!(t.getTime()>=e.minimumTimestamp)||De(e.multipleOfTimestamp)&&t.getTime()%e.multipleOfTimestamp!==0)}function gk(e,r,t){return ma(t)}function yk(e,r,t){return!(!mg(t)||De(e.exclusiveMaximum)&&!(t<e.exclusiveMaximum)||De(e.exclusiveMinimum)&&!(t>e.exclusiveMinimum)||De(e.maximum)&&!(t<=e.maximum)||De(e.minimum)&&!(t>=e.minimum)||De(e.multipleOf)&&t%e.multipleOf!==0)}function bk(e,r,t){let o=e.allOf.every(n=>Fr(n,r,t));if(e.unevaluatedProperties===!1){let n=new RegExp(gs(e)),i=Object.getOwnPropertyNames(t).every(a=>n.test(a));return o&&i}else if(Be(e.unevaluatedProperties)){let n=new RegExp(gs(e)),i=Object.getOwnPropertyNames(t).every(a=>n.test(a)||Fr(e.unevaluatedProperties,r,t[a]));return o&&i}else return o}function xk(e,r,t){return dg(t)}function vk(e,r,t){return t===e.const}function Ik(e,r,t){return!1}function Sk(e,r,t){return!Fr(e.not,r,t)}function Ck(e,r,t){return ls(t)}function Tk(e,r,t){return!(!ot.IsNumberLike(t)||De(e.exclusiveMaximum)&&!(t<e.exclusiveMaximum)||De(e.exclusiveMinimum)&&!(t>e.exclusiveMinimum)||De(e.minimum)&&!(t>=e.minimum)||De(e.maximum)&&!(t<=e.maximum)||De(e.multipleOf)&&t%e.multipleOf!==0)}function Mk(e,r,t){if(!ot.IsObjectLike(t)||De(e.minProperties)&&!(Object.getOwnPropertyNames(t).length>=e.minProperties)||De(e.maxProperties)&&!(Object.getOwnPropertyNames(t).length<=e.maxProperties))return!1;let o=Object.getOwnPropertyNames(e.properties);for(let n of o){let i=e.properties[n];if(e.required&&e.required.includes(n)){if(!Fr(i,r,t[n])||(bs(i)||lk(i))&&!(n in t))return!1}else if(ot.IsExactOptionalProperty(t,n)&&!Fr(i,r,t[n]))return!1}if(e.additionalProperties===!1){let n=Object.getOwnPropertyNames(t);return e.required&&e.required.length===o.length&&n.length===o.length?!0:n.every(i=>o.includes(i))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(t).every(i=>o.includes(i)||Fr(e.additionalProperties,r,t[i])):!0}function wk(e,r,t){return ug(t)}function Ok(e,r,t){if(!ot.IsRecordLike(t)||De(e.minProperties)&&!(Object.getOwnPropertyNames(t).length>=e.minProperties)||De(e.maxProperties)&&!(Object.getOwnPropertyNames(t).length<=e.maxProperties))return!1;let[o,n]=Object.entries(e.patternProperties)[0],i=new RegExp(o),a=Object.entries(t).every(([p,m])=>i.test(p)?Fr(n,r,m):!0),l=typeof e.additionalProperties=="object"?Object.entries(t).every(([p,m])=>i.test(p)?!0:Fr(e.additionalProperties,r,m)):!0,c=e.additionalProperties===!1?Object.getOwnPropertyNames(t).every(p=>i.test(p)):!0;return a&&l&&c}function Pk(e,r,t){return Fr(He(e,r),r,t)}function Fk(e,r,t){let o=new RegExp(e.source,e.flags);return De(e.minLength)&&!(t.length>=e.minLength)||De(e.maxLength)&&!(t.length<=e.maxLength)?!1:o.test(t)}function Ek(e,r,t){return!_e(t)||De(e.minLength)&&!(t.length>=e.minLength)||De(e.maxLength)&&!(t.length<=e.maxLength)||De(e.pattern)&&!new RegExp(e.pattern).test(t)?!1:De(e.format)?po.Has(e.format)?po.Get(e.format)(t):!1:!0}function Dk(e,r,t){return cs(t)}function kk(e,r,t){return _e(t)&&new RegExp(e.pattern).test(t)}function Lk(e,r,t){return Fr(He(e,r),r,t)}function Ak(e,r,t){if(!xe(t)||e.items===void 0&&t.length!==0||t.length!==e.maxItems)return!1;if(!e.items)return!0;for(let o=0;o<e.items.length;o++)if(!Fr(e.items[o],r,t[o]))return!1;return!0}function Rk(e,r,t){return Nt(t)}function _k(e,r,t){return e.anyOf.some(o=>Fr(o,r,t))}function Bk(e,r,t){return!(!Wc(t)||De(e.maxByteLength)&&!(t.length<=e.maxByteLength)||De(e.minByteLength)&&!(t.length>=e.minByteLength))}function Nk(e,r,t){return!0}function jk(e,r,t){return ot.IsVoidLike(t)}function Gk(e,r,t){return hr.Has(e[j])?hr.Get(e[j])(e,t):!1}function Fr(e,r,t){let o=De(e.$id)?[...r,e]:r,n=e;switch(n[j]){case"Any":return ck(n,o,t);case"Array":return pk(n,o,t);case"AsyncIterator":return dk(n,o,t);case"BigInt":return uk(n,o,t);case"Boolean":return mk(n,o,t);case"Constructor":return fk(n,o,t);case"Date":return hk(n,o,t);case"Function":return gk(n,o,t);case"Integer":return yk(n,o,t);case"Intersect":return bk(n,o,t);case"Iterator":return xk(n,o,t);case"Literal":return vk(n,o,t);case"Never":return Ik(n,o,t);case"Not":return Sk(n,o,t);case"Null":return Ck(n,o,t);case"Number":return Tk(n,o,t);case"Object":return Mk(n,o,t);case"Promise":return wk(n,o,t);case"Record":return Ok(n,o,t);case"Ref":return Pk(n,o,t);case"RegExp":return Fk(n,o,t);case"String":return Ek(n,o,t);case"Symbol":return Dk(n,o,t);case"TemplateLiteral":return kk(n,o,t);case"This":return Lk(n,o,t);case"Tuple":return Ak(n,o,t);case"Undefined":return Rk(n,o,t);case"Union":return _k(n,o,t);case"Uint8Array":return Bk(n,o,t);case"Unknown":return Nk(n,o,t);case"Void":return jk(n,o,t);default:if(!hr.Has(n[j]))throw new y2(n);return Gk(n,o,t)}}function Fe(...e){return e.length===3?Fr(e[0],e[1],e[2]):Fr(e[0],[],e[1])}var U;(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"})(U||(U={}));var b2=class extends de{constructor(r){super("Unknown type"),this.schema=r}};function xs(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function ke(e){return e!==void 0}var Qo=class{constructor(r){this.iterator=r}[Symbol.iterator](){return this.iterator}First(){let r=this.iterator.next();return r.done?void 0:r.value}};function K(e,r,t,o,n=[]){return{type:e,schema:r,path:t,value:o,message:d4()({errorType:e,path:t,schema:r,value:o,errors:n}),errors:n}}function*Uk(e,r,t,o){}function*Vk(e,r,t,o){if(!xe(o))return yield K(U.Array,e,t,o);ke(e.minItems)&&!(o.length>=e.minItems)&&(yield K(U.ArrayMinItems,e,t,o)),ke(e.maxItems)&&!(o.length<=e.maxItems)&&(yield K(U.ArrayMaxItems,e,t,o));for(let a=0;a<o.length;a++)yield*Er(e.items,r,`${t}/${a}`,o[a]);if(e.uniqueItems===!0&&!function(){let a=new Set;for(let l of o){let c=Ia(l);if(a.has(c))return!1;a.add(c)}return!0}()&&(yield K(U.ArrayUniqueItems,e,t,o)),!(ke(e.contains)||ke(e.minContains)||ke(e.maxContains)))return;let n=ke(e.contains)?e.contains:st(),i=o.reduce((a,l,c)=>Er(n,r,`${t}${c}`,l).next().done===!0?a+1:a,0);i===0&&(yield K(U.ArrayContains,e,t,o)),le(e.minContains)&&i<e.minContains&&(yield K(U.ArrayMinContains,e,t,o)),le(e.maxContains)&&i>e.maxContains&&(yield K(U.ArrayMaxContains,e,t,o))}function*Hk(e,r,t,o){pg(o)||(yield K(U.AsyncIterator,e,t,o))}function*$k(e,r,t,o){if(!wr(o))return yield K(U.BigInt,e,t,o);ke(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield K(U.BigIntExclusiveMaximum,e,t,o)),ke(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield K(U.BigIntExclusiveMinimum,e,t,o)),ke(e.maximum)&&!(o<=e.maximum)&&(yield K(U.BigIntMaximum,e,t,o)),ke(e.minimum)&&!(o>=e.minimum)&&(yield K(U.BigIntMinimum,e,t,o)),ke(e.multipleOf)&&o%e.multipleOf!==BigInt(0)&&(yield K(U.BigIntMultipleOf,e,t,o))}function*Wk(e,r,t,o){gi(o)||(yield K(U.Boolean,e,t,o))}function*zk(e,r,t,o){yield*Er(e.returns,r,t,o.prototype)}function*Zk(e,r,t,o){if(!Jr(o))return yield K(U.Date,e,t,o);ke(e.exclusiveMaximumTimestamp)&&!(o.getTime()<e.exclusiveMaximumTimestamp)&&(yield K(U.DateExclusiveMaximumTimestamp,e,t,o)),ke(e.exclusiveMinimumTimestamp)&&!(o.getTime()>e.exclusiveMinimumTimestamp)&&(yield K(U.DateExclusiveMinimumTimestamp,e,t,o)),ke(e.maximumTimestamp)&&!(o.getTime()<=e.maximumTimestamp)&&(yield K(U.DateMaximumTimestamp,e,t,o)),ke(e.minimumTimestamp)&&!(o.getTime()>=e.minimumTimestamp)&&(yield K(U.DateMinimumTimestamp,e,t,o)),ke(e.multipleOfTimestamp)&&o.getTime()%e.multipleOfTimestamp!==0&&(yield K(U.DateMultipleOfTimestamp,e,t,o))}function*Xk(e,r,t,o){ma(o)||(yield K(U.Function,e,t,o))}function*Yk(e,r,t,o){if(!mg(o))return yield K(U.Integer,e,t,o);ke(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield K(U.IntegerExclusiveMaximum,e,t,o)),ke(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield K(U.IntegerExclusiveMinimum,e,t,o)),ke(e.maximum)&&!(o<=e.maximum)&&(yield K(U.IntegerMaximum,e,t,o)),ke(e.minimum)&&!(o>=e.minimum)&&(yield K(U.IntegerMinimum,e,t,o)),ke(e.multipleOf)&&o%e.multipleOf!==0&&(yield K(U.IntegerMultipleOf,e,t,o))}function*Jk(e,r,t,o){let n=!1;for(let i of e.allOf)for(let a of Er(i,r,t,o))n=!0,yield a;if(n)return yield K(U.Intersect,e,t,o);if(e.unevaluatedProperties===!1){let i=new RegExp(gs(e));for(let a of Object.getOwnPropertyNames(o))i.test(a)||(yield K(U.IntersectUnevaluatedProperties,e,`${t}/${a}`,o))}if(typeof e.unevaluatedProperties=="object"){let i=new RegExp(gs(e));for(let a of Object.getOwnPropertyNames(o))if(!i.test(a)){let l=Er(e.unevaluatedProperties,r,`${t}/${a}`,o[a]).next();l.done||(yield l.value)}}}function*Kk(e,r,t,o){dg(o)||(yield K(U.Iterator,e,t,o))}function*Qk(e,r,t,o){o!==e.const&&(yield K(U.Literal,e,t,o))}function*qk(e,r,t,o){yield K(U.Never,e,t,o)}function*eL(e,r,t,o){Er(e.not,r,t,o).next().done===!0&&(yield K(U.Not,e,t,o))}function*tL(e,r,t,o){ls(o)||(yield K(U.Null,e,t,o))}function*rL(e,r,t,o){if(!ot.IsNumberLike(o))return yield K(U.Number,e,t,o);ke(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield K(U.NumberExclusiveMaximum,e,t,o)),ke(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield K(U.NumberExclusiveMinimum,e,t,o)),ke(e.maximum)&&!(o<=e.maximum)&&(yield K(U.NumberMaximum,e,t,o)),ke(e.minimum)&&!(o>=e.minimum)&&(yield K(U.NumberMinimum,e,t,o)),ke(e.multipleOf)&&o%e.multipleOf!==0&&(yield K(U.NumberMultipleOf,e,t,o))}function*oL(e,r,t,o){if(!ot.IsObjectLike(o))return yield K(U.Object,e,t,o);ke(e.minProperties)&&!(Object.getOwnPropertyNames(o).length>=e.minProperties)&&(yield K(U.ObjectMinProperties,e,t,o)),ke(e.maxProperties)&&!(Object.getOwnPropertyNames(o).length<=e.maxProperties)&&(yield K(U.ObjectMaxProperties,e,t,o));let n=Array.isArray(e.required)?e.required:[],i=Object.getOwnPropertyNames(e.properties),a=Object.getOwnPropertyNames(o);for(let l of n)a.includes(l)||(yield K(U.ObjectRequiredProperty,e.properties[l],`${t}/${xs(l)}`,void 0));if(e.additionalProperties===!1)for(let l of a)i.includes(l)||(yield K(U.ObjectAdditionalProperties,e,`${t}/${xs(l)}`,o[l]));if(typeof e.additionalProperties=="object")for(let l of a)i.includes(l)||(yield*Er(e.additionalProperties,r,`${t}/${xs(l)}`,o[l]));for(let l of i){let c=e.properties[l];e.required&&e.required.includes(l)?(yield*Er(c,r,`${t}/${xs(l)}`,o[l]),bs(e)&&!(l in o)&&(yield K(U.ObjectRequiredProperty,c,`${t}/${xs(l)}`,void 0))):ot.IsExactOptionalProperty(o,l)&&(yield*Er(c,r,`${t}/${xs(l)}`,o[l]))}}function*nL(e,r,t,o){ug(o)||(yield K(U.Promise,e,t,o))}function*iL(e,r,t,o){if(!ot.IsRecordLike(o))return yield K(U.Object,e,t,o);ke(e.minProperties)&&!(Object.getOwnPropertyNames(o).length>=e.minProperties)&&(yield K(U.ObjectMinProperties,e,t,o)),ke(e.maxProperties)&&!(Object.getOwnPropertyNames(o).length<=e.maxProperties)&&(yield K(U.ObjectMaxProperties,e,t,o));let[n,i]=Object.entries(e.patternProperties)[0],a=new RegExp(n);for(let[l,c]of Object.entries(o))a.test(l)&&(yield*Er(i,r,`${t}/${xs(l)}`,c));if(typeof e.additionalProperties=="object")for(let[l,c]of Object.entries(o))a.test(l)||(yield*Er(e.additionalProperties,r,`${t}/${xs(l)}`,c));if(e.additionalProperties===!1){for(let[l,c]of Object.entries(o))if(!a.test(l))return yield K(U.ObjectAdditionalProperties,e,`${t}/${xs(l)}`,c)}}function*sL(e,r,t,o){yield*Er(He(e,r),r,t,o)}function*aL(e,r,t,o){if(!_e(o))return yield K(U.String,e,t,o);if(ke(e.minLength)&&!(o.length>=e.minLength)&&(yield K(U.StringMinLength,e,t,o)),ke(e.maxLength)&&!(o.length<=e.maxLength)&&(yield K(U.StringMaxLength,e,t,o)),!new RegExp(e.source,e.flags).test(o))return yield K(U.RegExp,e,t,o)}function*lL(e,r,t,o){if(!_e(o))return yield K(U.String,e,t,o);ke(e.minLength)&&!(o.length>=e.minLength)&&(yield K(U.StringMinLength,e,t,o)),ke(e.maxLength)&&!(o.length<=e.maxLength)&&(yield K(U.StringMaxLength,e,t,o)),_e(e.pattern)&&(new RegExp(e.pattern).test(o)||(yield K(U.StringPattern,e,t,o))),_e(e.format)&&(po.Has(e.format)?po.Get(e.format)(o)||(yield K(U.StringFormat,e,t,o)):yield K(U.StringFormatUnknown,e,t,o))}function*cL(e,r,t,o){cs(o)||(yield K(U.Symbol,e,t,o))}function*pL(e,r,t,o){if(!_e(o))return yield K(U.String,e,t,o);new RegExp(e.pattern).test(o)||(yield K(U.StringPattern,e,t,o))}function*dL(e,r,t,o){yield*Er(He(e,r),r,t,o)}function*uL(e,r,t,o){if(!xe(o))return yield K(U.Tuple,e,t,o);if(e.items===void 0&&o.length!==0)return yield K(U.TupleLength,e,t,o);if(o.length!==e.maxItems)return yield K(U.TupleLength,e,t,o);if(e.items)for(let n=0;n<e.items.length;n++)yield*Er(e.items[n],r,`${t}/${n}`,o[n])}function*mL(e,r,t,o){Nt(o)||(yield K(U.Undefined,e,t,o))}function*fL(e,r,t,o){if(Fe(e,r,o))return;let n=e.anyOf.map(i=>new Qo(Er(i,r,t,o)));yield K(U.Union,e,t,o,n)}function*hL(e,r,t,o){if(!Wc(o))return yield K(U.Uint8Array,e,t,o);ke(e.maxByteLength)&&!(o.length<=e.maxByteLength)&&(yield K(U.Uint8ArrayMaxByteLength,e,t,o)),ke(e.minByteLength)&&!(o.length>=e.minByteLength)&&(yield K(U.Uint8ArrayMinByteLength,e,t,o))}function*gL(e,r,t,o){}function*yL(e,r,t,o){ot.IsVoidLike(o)||(yield K(U.Void,e,t,o))}function*bL(e,r,t,o){hr.Get(e[j])(e,o)||(yield K(U.Kind,e,t,o))}function*Er(e,r,t,o){let n=ke(e.$id)?[...r,e]:r,i=e;switch(i[j]){case"Any":return yield*Uk(i,n,t,o);case"Array":return yield*Vk(i,n,t,o);case"AsyncIterator":return yield*Hk(i,n,t,o);case"BigInt":return yield*$k(i,n,t,o);case"Boolean":return yield*Wk(i,n,t,o);case"Constructor":return yield*zk(i,n,t,o);case"Date":return yield*Zk(i,n,t,o);case"Function":return yield*Xk(i,n,t,o);case"Integer":return yield*Yk(i,n,t,o);case"Intersect":return yield*Jk(i,n,t,o);case"Iterator":return yield*Kk(i,n,t,o);case"Literal":return yield*Qk(i,n,t,o);case"Never":return yield*qk(i,n,t,o);case"Not":return yield*eL(i,n,t,o);case"Null":return yield*tL(i,n,t,o);case"Number":return yield*rL(i,n,t,o);case"Object":return yield*oL(i,n,t,o);case"Promise":return yield*nL(i,n,t,o);case"Record":return yield*iL(i,n,t,o);case"Ref":return yield*sL(i,n,t,o);case"RegExp":return yield*aL(i,n,t,o);case"String":return yield*lL(i,n,t,o);case"Symbol":return yield*cL(i,n,t,o);case"TemplateLiteral":return yield*pL(i,n,t,o);case"This":return yield*dL(i,n,t,o);case"Tuple":return yield*uL(i,n,t,o);case"Undefined":return yield*mL(i,n,t,o);case"Union":return yield*fL(i,n,t,o);case"Uint8Array":return yield*hL(i,n,t,o);case"Unknown":return yield*gL(i,n,t,o);case"Void":return yield*yL(i,n,t,o);default:if(!hr.Has(i[j]))throw new b2(e);return yield*bL(i,n,t,o)}}function Ii(...e){let r=e.length===3?Er(e[0],e[1],"",e[2]):Er(e[0],[],"",e[1]);return new Qo(r)}d();d();var xL=function(e,r,t,o,n){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?e!==r||!n:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?n.call(e,t):n?n.value=t:r.set(e,t),t},g4=function(e,r,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!o:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(e):o?o.value:r.get(e)},x2,$g,y4,v2=class extends de{constructor(r){let t=r.First();super(t===void 0?"Invalid Value":t.message),x2.add(this),$g.set(this,void 0),xL(this,$g,r,"f"),this.error=t}Errors(){return new Qo(g4(this,x2,"m",y4).call(this))}};$g=new WeakMap,x2=new WeakSet,y4=function*(){this.error&&(yield this.error),yield*g4(this,$g,"f")};function h4(e,r,t){if(!Fe(e,r,t))throw new v2(Ii(e,r,t))}function Wg(...e){return e.length===3?h4(e[0],e[1],e[2]):h4(e[0],[],e[1])}d();d();d();function vL(e){let r={};for(let t of Object.getOwnPropertyNames(e))r[t]=$e(e[t]);for(let t of Object.getOwnPropertySymbols(e))r[t]=$e(e[t]);return r}function IL(e){return e.map(r=>$e(r))}function SL(e){return e.slice()}function CL(e){return new Map($e([...e.entries()]))}function TL(e){return new Set($e([...e.entries()]))}function ML(e){return new Date(e.toISOString())}function $e(e){if(xe(e))return IL(e);if(Jr(e))return ML(e);if($o(e))return SL(e);if(e5(e))return CL(e);if(t5(e))return TL(e);if(Ce(e))return vL(e);if(Or(e))return e;throw new Error("ValueClone: Unable to clone value")}var Do=class extends de{constructor(r,t){super(t),this.schema=r}};function We(e){return ma(e)?e():$e(e)}function wL(e,r){return me(e,"default")?We(e.default):{}}function OL(e,r){if(e.uniqueItems===!0&&!me(e,"default"))throw new Do(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!me(e,"default"))throw new Do(e,"Array with the contains constraint requires a default value");return"default"in e?We(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(t=>ko(e.items,r)):[]}function PL(e,r){return me(e,"default")?We(e.default):async function*(){}()}function FL(e,r){return me(e,"default")?We(e.default):BigInt(0)}function EL(e,r){return me(e,"default")?We(e.default):!1}function DL(e,r){if(me(e,"default"))return We(e.default);{let t=ko(e.returns,r);return typeof t=="object"&&!Array.isArray(t)?class{constructor(){for(let[o,n]of Object.entries(t)){let i=this;i[o]=n}}}:class{}}}function kL(e,r){return me(e,"default")?We(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function LL(e,r){return me(e,"default")?We(e.default):()=>ko(e.returns,r)}function AL(e,r){return me(e,"default")?We(e.default):e.minimum!==void 0?e.minimum:0}function RL(e,r){if(me(e,"default"))return We(e.default);{let t=e.allOf.reduce((o,n)=>{let i=ko(n,r);return typeof i=="object"?{...o,...i}:i},{});if(!Fe(e,r,t))throw new Do(e,"Intersect produced invalid value. Consider using a default value.");return t}}function _L(e,r){return me(e,"default")?We(e.default):function*(){}()}function BL(e,r){return me(e,"default")?We(e.default):e.const}function NL(e,r){if(me(e,"default"))return We(e.default);throw new Do(e,"Never types cannot be created. Consider using a default value.")}function jL(e,r){if(me(e,"default"))return We(e.default);throw new Do(e,"Not types must have a default value")}function GL(e,r){return me(e,"default")?We(e.default):null}function UL(e,r){return me(e,"default")?We(e.default):e.minimum!==void 0?e.minimum:0}function VL(e,r){if(me(e,"default"))return We(e.default);{let t=new Set(e.required),o={};for(let[n,i]of Object.entries(e.properties))t.has(n)&&(o[n]=ko(i,r));return o}}function HL(e,r){return me(e,"default")?We(e.default):Promise.resolve(ko(e.item,r))}function $L(e,r){let[t,o]=Object.entries(e.patternProperties)[0];if(me(e,"default"))return We(e.default);if(t===fs||t===ms)return{};{let n=t.slice(1,t.length-1).split("|"),i={};for(let a of n)i[a]=ko(o,r);return i}}function WL(e,r){return me(e,"default")?We(e.default):ko(He(e,r),r)}function zL(e,r){if(me(e,"default"))return We(e.default);throw new Do(e,"RegExp types cannot be created. Consider using a default value.")}function ZL(e,r){if(e.pattern!==void 0){if(me(e,"default"))return We(e.default);throw new Do(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(me(e,"default"))return We(e.default);throw new Do(e,"String types with formats must specify a default value")}else return me(e,"default")?We(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}function XL(e,r){return me(e,"default")?We(e.default):"value"in e?Symbol.for(e.value):Symbol()}function YL(e,r){if(me(e,"default"))return We(e.default);if(!bg(e))throw new Do(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Qc(e)[0]}function JL(e,r){if(b4++>nA)throw new Do(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return me(e,"default")?We(e.default):ko(He(e,r),r)}function KL(e,r){return me(e,"default")?We(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((t,o)=>ko(e.items[o],r))}function QL(e,r){if(me(e,"default"))return We(e.default)}function qL(e,r){if(me(e,"default"))return We(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return ko(e.anyOf[0],r)}function eA(e,r){return me(e,"default")?We(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function tA(e,r){return me(e,"default")?We(e.default):{}}function rA(e,r){if(me(e,"default"))return We(e.default)}function oA(e,r){if(me(e,"default"))return We(e.default);throw new Error("User defined types must specify a default value")}function ko(e,r){let t=Ko(e,r),o=e;switch(o[j]){case"Any":return wL(o,t);case"Array":return OL(o,t);case"AsyncIterator":return PL(o,t);case"BigInt":return FL(o,t);case"Boolean":return EL(o,t);case"Constructor":return DL(o,t);case"Date":return kL(o,t);case"Function":return LL(o,t);case"Integer":return AL(o,t);case"Intersect":return RL(o,t);case"Iterator":return _L(o,t);case"Literal":return BL(o,t);case"Never":return NL(o,t);case"Not":return jL(o,t);case"Null":return GL(o,t);case"Number":return UL(o,t);case"Object":return VL(o,t);case"Promise":return HL(o,t);case"Record":return $L(o,t);case"Ref":return WL(o,t);case"RegExp":return zL(o,t);case"String":return ZL(o,t);case"Symbol":return XL(o,t);case"TemplateLiteral":return YL(o,t);case"This":return JL(o,t);case"Tuple":return KL(o,t);case"Undefined":return QL(o,t);case"Union":return qL(o,t);case"Uint8Array":return eA(o,t);case"Unknown":return tA(o,t);case"Void":return rA(o,t);default:if(!hr.Has(o[j]))throw new Do(o,"Unknown type");return oA(o,t)}}var nA=512,b4=0;function qo(...e){return b4=0,e.length===2?ko(e[0],e[1]):ko(e[0],[])}var zg=class extends de{constructor(r,t){super(t),this.schema=r}};function iA(e,r,t){if(e[j]==="Object"&&typeof t=="object"&&!ls(t)){let o=e,n=Object.getOwnPropertyNames(t),i=Object.entries(o.properties),[a,l]=[1/i.length,i.length];return i.reduce((c,[p,m])=>{let f=m[j]==="Literal"&&m.const===t[p]?l:0,g=Fe(m,r,t[p])?a:0,b=n.includes(p)?a:0;return c+(f+g+b)},0)}else return Fe(e,r,t)?1:0}function sA(e,r,t){let o=e.anyOf.map(a=>He(a,r)),[n,i]=[o[0],0];for(let a of o){let l=iA(a,r,t);l>i&&(n=a,i=l)}return n}function aA(e,r,t){if("default"in e)return typeof t=="function"?e.default:$e(e.default);{let o=sA(e,r,t);return I2(o,r,t)}}function lA(e,r,t){return Fe(e,r,t)?$e(t):qo(e,r)}function cA(e,r,t){return Fe(e,r,t)?t:qo(e,r)}function pA(e,r,t){if(Fe(e,r,t))return $e(t);let o=xe(t)?$e(t):qo(e,r),n=le(e.minItems)&&o.length<e.minItems?[...o,...Array.from({length:e.minItems-o.length},()=>null)]:o,a=(le(e.maxItems)&&n.length>e.maxItems?n.slice(0,e.maxItems):n).map(c=>Si(e.items,r,c));if(e.uniqueItems!==!0)return a;let l=[...new Set(a)];if(!Fe(e,r,l))throw new zg(e,"Array cast produced invalid data due to uniqueItems constraint");return l}function dA(e,r,t){if(Fe(e,r,t))return qo(e,r);let o=new Set(e.returns.required||[]),n=function(){};for(let[i,a]of Object.entries(e.returns.properties))!o.has(i)&&t.prototype[i]===void 0||(n.prototype[i]=Si(a,r,t.prototype[i]));return n}function uA(e,r,t){let o=qo(e,r),n=Ce(o)&&Ce(t)?{...o,...t}:t;return Fe(e,r,n)?n:qo(e,r)}function mA(e,r,t){throw new zg(e,"Never types cannot be cast")}function fA(e,r,t){if(Fe(e,r,t))return t;if(t===null||typeof t!="object")return qo(e,r);let o=new Set(e.required||[]),n={};for(let[i,a]of Object.entries(e.properties))!o.has(i)&&t[i]===void 0||(n[i]=Si(a,r,t[i]));if(typeof e.additionalProperties=="object"){let i=Object.getOwnPropertyNames(e.properties);for(let a of Object.getOwnPropertyNames(t))i.includes(a)||(n[a]=Si(e.additionalProperties,r,t[a]))}return n}function hA(e,r,t){if(Fe(e,r,t))return $e(t);if(t===null||typeof t!="object"||Array.isArray(t)||t instanceof Date)return qo(e,r);let o=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[o],i={};for(let[a,l]of Object.entries(t))i[a]=Si(n,r,l);return i}function gA(e,r,t){return Si(He(e,r),r,t)}function yA(e,r,t){return Si(He(e,r),r,t)}function bA(e,r,t){return Fe(e,r,t)?$e(t):xe(t)?e.items===void 0?[]:e.items.map((o,n)=>Si(o,r,t[n])):qo(e,r)}function xA(e,r,t){return Fe(e,r,t)?$e(t):aA(e,r,t)}function Si(e,r,t){let o=_e(e.$id)?[...r,e]:r,n=e;switch(e[j]){case"Array":return pA(n,o,t);case"Constructor":return dA(n,o,t);case"Intersect":return uA(n,o,t);case"Never":return mA(n,o,t);case"Object":return fA(n,o,t);case"Record":return hA(n,o,t);case"Ref":return gA(n,o,t);case"This":return yA(n,o,t);case"Tuple":return bA(n,o,t);case"Union":return xA(n,o,t);case"Date":case"Symbol":case"Uint8Array":return lA(e,r,t);default:return cA(n,o,t)}}function I2(...e){return e.length===3?Si(e[0],e[1],e[2]):Si(e[0],[],e[1])}d();function vA(e){return ha(e)&&e[j]!=="Unsafe"}function IA(e,r,t){return xe(t)?t.map(o=>Lo(e.items,r,o)):t}function SA(e,r,t){let o=e.unevaluatedProperties,i=e.allOf.map(l=>Lo(l,r,$e(t))).reduce((l,c)=>Ce(c)?{...l,...c}:c,{});if(!Ce(t)||!Ce(i)||!ha(o))return i;let a=gr(e);for(let l of Object.getOwnPropertyNames(t))a.includes(l)||Fe(o,r,t[l])&&(i[l]=Lo(o,r,t[l]));return i}function CA(e,r,t){if(!Ce(t)||xe(t))return t;let o=e.additionalProperties;for(let n of Object.getOwnPropertyNames(t)){if(me(e.properties,n)){t[n]=Lo(e.properties[n],r,t[n]);continue}if(ha(o)&&Fe(o,r,t[n])){t[n]=Lo(o,r,t[n]);continue}delete t[n]}return t}function TA(e,r,t){if(!Ce(t))return t;let o=e.additionalProperties,n=Object.getOwnPropertyNames(t),[i,a]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let c of n){if(l.test(c)){t[c]=Lo(a,r,t[c]);continue}if(ha(o)&&Fe(o,r,t[c])){t[c]=Lo(o,r,t[c]);continue}delete t[c]}return t}function MA(e,r,t){return Lo(He(e,r),r,t)}function wA(e,r,t){return Lo(He(e,r),r,t)}function OA(e,r,t){if(!xe(t))return t;if(Nt(e.items))return[];let o=Math.min(t.length,e.items.length);for(let n=0;n<o;n++)t[n]=Lo(e.items[n],r,t[n]);return t.length>o?t.slice(0,o):t}function PA(e,r,t){for(let o of e.anyOf)if(vA(o)&&Fe(o,r,t))return Lo(o,r,t);return t}function Lo(e,r,t){let o=_e(e.$id)?[...r,e]:r,n=e;switch(n[j]){case"Array":return IA(n,o,t);case"Intersect":return SA(n,o,t);case"Object":return CA(n,o,t);case"Record":return TA(n,o,t);case"Ref":return MA(n,o,t);case"This":return wA(n,o,t);case"Tuple":return OA(n,o,t);case"Union":return PA(n,o,t);default:return t}}function Zg(...e){return e.length===3?Lo(e[0],e[1],e[2]):Lo(e[0],[],e[1])}d();function Xg(e){return _e(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function FA(e){return wr(e)||gi(e)||le(e)}function em(e){return e===!0||le(e)&&e===1||wr(e)&&e===BigInt("1")||_e(e)&&(e.toLowerCase()==="true"||e==="1")}function tm(e){return e===!1||le(e)&&(e===0||Object.is(e,-0))||wr(e)&&e===BigInt("0")||_e(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function EA(e){return _e(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}function DA(e){return _e(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}function kA(e){return _e(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)}function LA(e){return _e(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)}function AA(e){return _e(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}function RA(e,r){let t=v4(e);return t===r?t:e}function _A(e,r){let t=I4(e);return t===r?t:e}function BA(e,r){let t=x4(e);return t===r?t:e}function NA(e,r){return _e(e.const)?RA(r,e.const):le(e.const)?_A(r,e.const):gi(e.const)?BA(r,e.const):r}function x4(e){return em(e)?!0:tm(e)?!1:e}function jA(e){let r=t=>t.split(".")[0];return Xg(e)?BigInt(r(e)):le(e)?BigInt(Math.trunc(e)):tm(e)?BigInt(0):em(e)?BigInt(1):e}function v4(e){return FA(e)?e.toString():cs(e)&&e.description!==void 0?e.description.toString():e}function I4(e){return Xg(e)?parseFloat(e):em(e)?1:tm(e)?0:e}function GA(e){return Xg(e)?parseInt(e):le(e)?e|0:em(e)?1:tm(e)?0:e}function UA(e){return _e(e)&&e.toLowerCase()==="null"?null:e}function VA(e){return _e(e)&&e==="undefined"?void 0:e}function HA(e){return Jr(e)?e:le(e)?new Date(e):em(e)?new Date(1):tm(e)?new Date(0):Xg(e)?new Date(parseInt(e)):DA(e)?new Date(`1970-01-01T${e}.000Z`):EA(e)?new Date(`1970-01-01T${e}`):LA(e)?new Date(`${e}.000Z`):kA(e)?new Date(e):AA(e)?new Date(`${e}T00:00:00.000Z`):e}function $A(e,r,t){return(xe(t)?t:[t]).map(n=>Ci(e.items,r,n))}function WA(e,r,t){return jA(t)}function zA(e,r,t){return x4(t)}function ZA(e,r,t){return HA(t)}function XA(e,r,t){return GA(t)}function YA(e,r,t){return e.allOf.reduce((o,n)=>Ci(n,r,o),t)}function JA(e,r,t){return NA(e,t)}function KA(e,r,t){return UA(t)}function QA(e,r,t){return I4(t)}function qA(e,r,t){if(!Ce(t))return t;for(let o of Object.getOwnPropertyNames(e.properties))me(t,o)&&(t[o]=Ci(e.properties[o],r,t[o]));return t}function eR(e,r,t){if(!Ce(t))return t;let n=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[n];for(let[a,l]of Object.entries(t))t[a]=Ci(i,r,l);return t}function tR(e,r,t){return Ci(He(e,r),r,t)}function rR(e,r,t){return v4(t)}function oR(e,r,t){return _e(t)||le(t)?Symbol(t):t}function nR(e,r,t){return Ci(He(e,r),r,t)}function iR(e,r,t){return xe(t)&&!Nt(e.items)?t.map((n,i)=>i<e.items.length?Ci(e.items[i],r,n):n):t}function sR(e,r,t){return VA(t)}function aR(e,r,t){for(let o of e.anyOf){let n=Ci(o,r,$e(t));if(Fe(o,r,n))return n}return t}function Ci(e,r,t){let o=Ko(e,r),n=e;switch(e[j]){case"Array":return $A(n,o,t);case"BigInt":return WA(n,o,t);case"Boolean":return zA(n,o,t);case"Date":return ZA(n,o,t);case"Integer":return XA(n,o,t);case"Intersect":return YA(n,o,t);case"Literal":return JA(n,o,t);case"Null":return KA(n,o,t);case"Number":return QA(n,o,t);case"Object":return qA(n,o,t);case"Record":return eR(n,o,t);case"Ref":return tR(n,o,t);case"String":return rR(n,o,t);case"Symbol":return oR(n,o,t);case"This":return nR(n,o,t);case"Tuple":return iR(n,o,t);case"Undefined":return sR(n,o,t);case"Union":return aR(n,o,t);default:return t}}function Yg(...e){return e.length===3?Ci(e[0],e[1],e[2]):Ci(e[0],[],e[1])}d();d();var fp=class extends de{constructor(r,t,o){super("Unable to decode value as it does not match the expected schema"),this.schema=r,this.value=t,this.error=o}},Il=class extends de{constructor(r,t,o,n){super(n instanceof Error?n.message:"Unknown error"),this.schema=r,this.path=t,this.value=o,this.error=n}};function jt(e,r,t){try{return Ct(e)?e[Ft].Decode(t):t}catch(o){throw new Il(e,r,t,o)}}function lR(e,r,t,o){return xe(o)?jt(e,t,o.map((n,i)=>Ti(e.items,r,`${t}/${i}`,n))):jt(e,t,o)}function cR(e,r,t,o){if(!Ce(o)||Or(o))return jt(e,t,o);let n=ba(e),i=n.map(m=>m[0]),a={...o};for(let[m,f]of n)m in a&&(a[m]=Ti(f,r,`${t}/${m}`,a[m]));if(!Ct(e.unevaluatedProperties))return jt(e,t,a);let l=Object.getOwnPropertyNames(a),c=e.unevaluatedProperties,p={...a};for(let m of l)i.includes(m)||(p[m]=jt(c,`${t}/${m}`,p[m]));return jt(e,t,p)}function pR(e,r,t,o){return jt(e,t,Ti(e.not,r,t,o))}function dR(e,r,t,o){if(!Ce(o))return jt(e,t,o);let n=gr(e),i={...o};for(let p of n)me(i,p)&&(Nt(i[p])&&(!Zc(e.properties[p])||ot.IsExactOptionalProperty(i,p))||(i[p]=Ti(e.properties[p],r,`${t}/${p}`,i[p])));if(!Be(e.additionalProperties))return jt(e,t,i);let a=Object.getOwnPropertyNames(i),l=e.additionalProperties,c={...i};for(let p of a)n.includes(p)||(c[p]=jt(l,`${t}/${p}`,c[p]));return jt(e,t,c)}function uR(e,r,t,o){if(!Ce(o))return jt(e,t,o);let n=Object.getOwnPropertyNames(e.patternProperties)[0],i=new RegExp(n),a={...o};for(let m of Object.getOwnPropertyNames(o))i.test(m)&&(a[m]=Ti(e.patternProperties[n],r,`${t}/${m}`,a[m]));if(!Be(e.additionalProperties))return jt(e,t,a);let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let m of l)i.test(m)||(p[m]=jt(c,`${t}/${m}`,p[m]));return jt(e,t,p)}function mR(e,r,t,o){let n=He(e,r);return jt(e,t,Ti(n,r,t,o))}function fR(e,r,t,o){let n=He(e,r);return jt(e,t,Ti(n,r,t,o))}function hR(e,r,t,o){return xe(o)&&xe(e.items)?jt(e,t,e.items.map((n,i)=>Ti(n,r,`${t}/${i}`,o[i]))):jt(e,t,o)}function gR(e,r,t,o){for(let n of e.anyOf){if(!Fe(n,r,o))continue;let i=Ti(n,r,t,o);return jt(e,t,i)}return jt(e,t,o)}function Ti(e,r,t,o){let n=Ko(e,r),i=e;switch(e[j]){case"Array":return lR(i,n,t,o);case"Intersect":return cR(i,n,t,o);case"Not":return pR(i,n,t,o);case"Object":return dR(i,n,t,o);case"Record":return uR(i,n,t,o);case"Ref":return mR(i,n,t,o);case"Symbol":return jt(i,t,o);case"This":return fR(i,n,t,o);case"Tuple":return hR(i,n,t,o);case"Union":return gR(i,n,t,o);default:return jt(i,t,o)}}function hp(e,r,t){return Ti(e,r,"",t)}d();var gp=class extends de{constructor(r,t,o){super("The encoded value does not match the expected schema"),this.schema=r,this.value=t,this.error=o}},Sl=class extends de{constructor(r,t,o,n){super(`${n instanceof Error?n.message:"Unknown error"}`),this.schema=r,this.path=t,this.value=o,this.error=n}};function Hr(e,r,t){try{return Ct(e)?e[Ft].Encode(t):t}catch(o){throw new Sl(e,r,t,o)}}function yR(e,r,t,o){let n=Hr(e,t,o);return xe(n)?n.map((i,a)=>Mi(e.items,r,`${t}/${a}`,i)):n}function bR(e,r,t,o){let n=Hr(e,t,o);if(!Ce(o)||Or(o))return n;let i=ba(e),a=i.map(f=>f[0]),l={...n};for(let[f,g]of i)f in l&&(l[f]=Mi(g,r,`${t}/${f}`,l[f]));if(!Ct(e.unevaluatedProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,m={...l};for(let f of c)a.includes(f)||(m[f]=Hr(p,`${t}/${f}`,m[f]));return m}function xR(e,r,t,o){return Hr(e.not,t,Hr(e,t,o))}function vR(e,r,t,o){let n=Hr(e,t,o);if(!Ce(n))return n;let i=gr(e),a={...n};for(let m of i)me(a,m)&&(Nt(a[m])&&(!Zc(e.properties[m])||ot.IsExactOptionalProperty(a,m))||(a[m]=Mi(e.properties[m],r,`${t}/${m}`,a[m])));if(!Be(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let m of l)i.includes(m)||(p[m]=Hr(c,`${t}/${m}`,p[m]));return p}function IR(e,r,t,o){let n=Hr(e,t,o);if(!Ce(o))return n;let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),l={...n};for(let f of Object.getOwnPropertyNames(o))a.test(f)&&(l[f]=Mi(e.patternProperties[i],r,`${t}/${f}`,l[f]));if(!Be(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,m={...l};for(let f of c)a.test(f)||(m[f]=Hr(p,`${t}/${f}`,m[f]));return m}function SR(e,r,t,o){let n=He(e,r),i=Mi(n,r,t,o);return Hr(e,t,i)}function CR(e,r,t,o){let n=He(e,r),i=Mi(n,r,t,o);return Hr(e,t,i)}function TR(e,r,t,o){let n=Hr(e,t,o);return xe(e.items)?e.items.map((i,a)=>Mi(i,r,`${t}/${a}`,n[a])):[]}function MR(e,r,t,o){for(let n of e.anyOf){if(!Fe(n,r,o))continue;let i=Mi(n,r,t,o);return Hr(e,t,i)}for(let n of e.anyOf){let i=Mi(n,r,t,o);if(Fe(e,r,i))return Hr(e,t,i)}return Hr(e,t,o)}function Mi(e,r,t,o){let n=Ko(e,r),i=e;switch(e[j]){case"Array":return yR(i,n,t,o);case"Intersect":return bR(i,n,t,o);case"Not":return xR(i,n,t,o);case"Object":return vR(i,n,t,o);case"Record":return IR(i,n,t,o);case"Ref":return SR(i,n,t,o);case"This":return CR(i,n,t,o);case"Tuple":return TR(i,n,t,o);case"Union":return MR(i,n,t,o);default:return Hr(i,t,o)}}function Jg(e,r,t){return Mi(e,r,"",t)}d();function wR(e,r){return Ct(e)||yr(e.items,r)}function OR(e,r){return Ct(e)||yr(e.items,r)}function PR(e,r){return Ct(e)||yr(e.returns,r)||e.parameters.some(t=>yr(t,r))}function FR(e,r){return Ct(e)||yr(e.returns,r)||e.parameters.some(t=>yr(t,r))}function ER(e,r){return Ct(e)||Ct(e.unevaluatedProperties)||e.allOf.some(t=>yr(t,r))}function DR(e,r){return Ct(e)||yr(e.items,r)}function kR(e,r){return Ct(e)||yr(e.not,r)}function LR(e,r){return Ct(e)||Object.values(e.properties).some(t=>yr(t,r))||Be(e.additionalProperties)&&yr(e.additionalProperties,r)}function AR(e,r){return Ct(e)||yr(e.item,r)}function RR(e,r){let t=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[t];return Ct(e)||yr(o,r)||Be(e.additionalProperties)&&Ct(e.additionalProperties)}function _R(e,r){return Ct(e)?!0:yr(He(e,r),r)}function BR(e,r){return Ct(e)?!0:yr(He(e,r),r)}function NR(e,r){return Ct(e)||!Nt(e.items)&&e.items.some(t=>yr(t,r))}function jR(e,r){return Ct(e)||e.anyOf.some(t=>yr(t,r))}function yr(e,r){let t=Ko(e,r),o=e;if(e.$id&&S2.has(e.$id))return!1;switch(e.$id&&S2.add(e.$id),e[j]){case"Array":return wR(o,t);case"AsyncIterator":return OR(o,t);case"Constructor":return PR(o,t);case"Function":return FR(o,t);case"Intersect":return ER(o,t);case"Iterator":return DR(o,t);case"Not":return kR(o,t);case"Object":return LR(o,t);case"Promise":return AR(o,t);case"Record":return RR(o,t);case"Ref":return _R(o,t);case"This":return BR(o,t);case"Tuple":return NR(o,t);case"Union":return jR(o,t);default:return Ct(e)}}var S2=new Set;function wi(e,r){return S2.clear(),yr(e,r)}function S4(...e){let[r,t,o]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!Fe(r,t,o))throw new fp(r,o,Ii(r,t,o).First());return wi(r,t)?hp(r,t,o):o}d();function vs(e,r){let t=me(e,"default")?e.default:void 0,o=ma(t)?t():$e(t);return Nt(r)?o:Ce(r)&&Ce(o)?Object.assign(o,r):r}function C2(e){return ha(e)&&"default"in e}function GR(e,r,t){let o=vs(e,t);if(!xe(o))return o;for(let n=0;n<o.length;n++)o[n]=Ao(e.items,r,o[n]);return o}function UR(e,r,t){return Jr(t)?t:vs(e,t)}function VR(e,r,t){let o=vs(e,t);return e.allOf.reduce((n,i)=>{let a=Ao(i,r,o);return Ce(a)?{...n,...a}:a},{})}function HR(e,r,t){let o=vs(e,t);if(!Ce(o))return o;let n=Object.getOwnPropertyNames(e.properties);for(let i of n){let a=Ao(e.properties[i],r,o[i]);Nt(a)||(o[i]=Ao(e.properties[i],r,o[i]))}if(!C2(e.additionalProperties))return o;for(let i of Object.getOwnPropertyNames(o))n.includes(i)||(o[i]=Ao(e.additionalProperties,r,o[i]));return o}function $R(e,r,t){let o=vs(e,t);if(!Ce(o))return o;let n=e.additionalProperties,[i,a]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let c of Object.getOwnPropertyNames(o))l.test(c)&&C2(a)&&(o[c]=Ao(a,r,o[c]));if(!C2(n))return o;for(let c of Object.getOwnPropertyNames(o))l.test(c)||(o[c]=Ao(n,r,o[c]));return o}function WR(e,r,t){return Ao(He(e,r),r,vs(e,t))}function zR(e,r,t){return Ao(He(e,r),r,t)}function ZR(e,r,t){let o=vs(e,t);if(!xe(o)||Nt(e.items))return o;let[n,i]=[e.items,Math.max(e.items.length,o.length)];for(let a=0;a<i;a++)a<n.length&&(o[a]=Ao(n[a],r,o[a]));return o}function XR(e,r,t){let o=vs(e,t);for(let n of e.anyOf){let i=Ao(n,r,$e(o));if(Fe(n,r,i))return i}return o}function Ao(e,r,t){let o=Ko(e,r),n=e;switch(n[j]){case"Array":return GR(n,o,t);case"Date":return UR(n,o,t);case"Intersect":return VR(n,o,t);case"Object":return HR(n,o,t);case"Record":return $R(n,o,t);case"Ref":return WR(n,o,t);case"This":return zR(n,o,t);case"Tuple":return ZR(n,o,t);case"Union":return XR(n,o,t);default:return vs(n,t)}}function Kg(...e){return e.length===3?Ao(e[0],e[1],e[2]):Ao(e[0],[],e[1])}d();d();var Fn={};na(Fn,{Delete:()=>JR,Format:()=>rm,Get:()=>QR,Has:()=>KR,Set:()=>YR,ValuePointerRootDeleteError:()=>qg,ValuePointerRootSetError:()=>Qg});d();var Qg=class extends de{constructor(r,t,o){super("Cannot set root value"),this.value=r,this.path=t,this.update=o}},qg=class extends de{constructor(r,t){super("Cannot delete root value"),this.value=r,this.path=t}};function C4(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*rm(e){if(e==="")return;let[r,t]=[0,0];for(let o=0;o<e.length;o++)e.charAt(o)==="/"?(o===0||(t=o,yield C4(e.slice(r,t))),r=o+1):t=o;yield C4(e.slice(r))}function YR(e,r,t){if(r==="")throw new Qg(e,r,t);let[o,n,i]=[null,e,""];for(let a of rm(r))n[a]===void 0&&(n[a]={}),o=n,n=n[a],i=a;o[i]=t}function JR(e,r){if(r==="")throw new qg(e,r);let[t,o,n]=[null,e,""];for(let i of rm(r)){if(o[i]===void 0||o[i]===null)return;t=o,o=o[i],n=i}if(Array.isArray(t)){let i=parseInt(n);t.splice(i,1)}else delete t[n]}function KR(e,r){if(r==="")return!0;let[t,o,n]=[null,e,""];for(let i of rm(r)){if(o[i]===void 0)return!1;t=o,o=o[i],n=i}return Object.getOwnPropertyNames(t).includes(n)}function QR(e,r){if(r==="")return e;let t=e;for(let o of rm(r)){if(t[o]===void 0)return;t=t[o]}return t}d();function qR(e,r){if(!Ce(r))return!1;let t=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],o=[...Object.keys(r),...Object.getOwnPropertySymbols(r)];return t.length!==o.length?!1:t.every(n=>Cl(e[n],r[n]))}function e_(e,r){return Jr(r)&&e.getTime()===r.getTime()}function t_(e,r){return!xe(r)||e.length!==r.length?!1:e.every((t,o)=>Cl(t,r[o]))}function r_(e,r){return!$o(r)||e.length!==r.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(r).constructor.name?!1:e.every((t,o)=>Cl(t,r[o]))}function o_(e,r){return e===r}function Cl(e,r){if(Jr(e))return e_(e,r);if($o(e))return r_(e,r);if(xe(e))return t_(e,r);if(Ce(e))return qR(e,r);if(Or(e))return o_(e,r);throw new Error("ValueEquals: Unable to compare value")}var n_=ut({type:Je("insert"),path:zo(),value:ys()}),i_=ut({type:Je("update"),path:zo(),value:ys()}),s_=ut({type:Je("delete"),path:zo()}),M4=at([n_,i_,s_]),ey=class extends de{constructor(r,t){super(t),this.value=r}};function ty(e,r){return{type:"update",path:e,value:r}}function w4(e,r){return{type:"insert",path:e,value:r}}function O4(e){return{type:"delete",path:e}}function T4(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new ey(e,"Cannot diff objects with symbols")}function*a_(e,r,t){if(T4(r),T4(t),!w0(t))return yield ty(e,t);let o=globalThis.Object.getOwnPropertyNames(r),n=globalThis.Object.getOwnPropertyNames(t);for(let i of n)me(r,i)||(yield w4(`${e}/${i}`,t[i]));for(let i of o)me(t,i)&&(Cl(r,t)||(yield*ry(`${e}/${i}`,r[i],t[i])));for(let i of o)me(t,i)||(yield O4(`${e}/${i}`))}function*l_(e,r,t){if(!xe(t))return yield ty(e,t);for(let o=0;o<Math.min(r.length,t.length);o++)yield*ry(`${e}/${o}`,r[o],t[o]);for(let o=0;o<t.length;o++)o<r.length||(yield w4(`${e}/${o}`,t[o]));for(let o=r.length-1;o>=0;o--)o<t.length||(yield O4(`${e}/${o}`))}function*c_(e,r,t){if(!$o(t)||r.length!==t.length||globalThis.Object.getPrototypeOf(r).constructor.name!==globalThis.Object.getPrototypeOf(t).constructor.name)return yield ty(e,t);for(let o=0;o<Math.min(r.length,t.length);o++)yield*ry(`${e}/${o}`,r[o],t[o])}function*p_(e,r,t){r!==t&&(yield ty(e,t))}function*ry(e,r,t){if(w0(r))return yield*a_(e,r,t);if(xe(r))return yield*l_(e,r,t);if($o(r))return yield*c_(e,r,t);if(Or(r))return yield*p_(e,r,t);throw new ey(r,"Unable to diff value")}function P4(e,r){return[...ry("",e,r)]}function d_(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function u_(e){return e.length===0}function F4(e,r){if(d_(r))return $e(r[0].value);if(u_(r))return $e(e);let t=$e(e);for(let o of r)switch(o.type){case"insert":{Fn.Set(t,o.path,o.value);break}case"update":{Fn.Set(t,o.path,o.value);break}case"delete":{Fn.Delete(t,o.path);break}}return t}d();function E4(...e){let[r,t,o]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],n=wi(r,t)?Jg(r,t,o):o;if(!Fe(r,t,n))throw new gp(r,n,Ii(r,t,n).First());return n}d();var oy=class extends de{constructor(r){super(r)}};function m_(e,r,t,o){if(!Ce(t))Fn.Set(e,r,$e(o));else{let n=Object.getOwnPropertyNames(t),i=Object.getOwnPropertyNames(o);for(let a of n)i.includes(a)||delete t[a];for(let a of i)n.includes(a)||(t[a]=null);for(let a of i)T2(e,`${r}/${a}`,t[a],o[a])}}function f_(e,r,t,o){if(!xe(t))Fn.Set(e,r,$e(o));else{for(let n=0;n<o.length;n++)T2(e,`${r}/${n}`,t[n],o[n]);t.splice(o.length)}}function h_(e,r,t,o){if($o(t)&&t.length===o.length)for(let n=0;n<t.length;n++)t[n]=o[n];else Fn.Set(e,r,$e(o))}function g_(e,r,t,o){t!==o&&Fn.Set(e,r,o)}function T2(e,r,t,o){if(xe(o))return f_(e,r,t,o);if($o(o))return h_(e,r,t,o);if(Ce(o))return m_(e,r,t,o);if(Or(o))return g_(e,r,t,o)}function D4(e){return $o(e)||Or(e)}function y_(e,r){return Ce(e)&&xe(r)||xe(e)&&Ce(r)}function k4(e,r){if(D4(e)||D4(r))throw new oy("Only object and array types can be mutated at the root level");if(y_(e,r))throw new oy("Cannot assign due type mismatch of assignable values");T2(e,"",e,r)}d();var b_=[(e,r,t)=>$e(t),(e,r,t)=>Kg(e,r,t),(e,r,t)=>Zg(e,r,t),(e,r,t)=>Yg(e,r,t),(e,r,t)=>(Wg(e,r,t),t),(e,r,t)=>wi(e,r)?hp(e,r,t):t];function L4(e,r,t){return b_.reduce((o,n)=>n(e,r,o),t)}function A4(...e){return e.length===3?L4(e[0],e[1],e[2]):L4(e[0],[],e[1])}d();var En={};na(En,{Assert:()=>Wg,Cast:()=>I2,Check:()=>Fe,Clean:()=>Zg,Clone:()=>$e,Convert:()=>Yg,Create:()=>qo,Decode:()=>S4,Default:()=>Kg,Diff:()=>P4,Edit:()=>M4,Encode:()=>E4,Equal:()=>Cl,Errors:()=>Ii,Hash:()=>Ia,Mutate:()=>k4,Parse:()=>A4,Patch:()=>F4,ValueErrorIterator:()=>Qo});d();d();var R4={},x_=function(e,r,t,o,n){var i=new Worker(R4[r]||(R4[r]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return i.onmessage=function(a){var l=a.data,c=l.$e$;if(c){var p=new Error(c[0]);p.code=c[1],p.stack=c[2],n(p,null)}else n(null,l)},i.postMessage(t,o),i},mt=Uint8Array,qr=Uint16Array,sm=Int32Array,Ip=new mt([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]),Sp=new mt([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]),om=new mt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),N4=function(e,r){for(var t=new qr(31),o=0;o<31;++o)t[o]=r+=1<<e[o-1];for(var n=new sm(t[30]),o=1;o<30;++o)for(var i=t[o];i<t[o+1];++i)n[i]=i-t[o]<<5|o;return{b:t,r:n}},j4=N4(Ip,2),E2=j4.b,ly=j4.r;E2[28]=258,ly[258]=28;var G4=N4(Sp,0),U4=G4.b,w2=G4.r,nm=new qr(32768);for(Qe=0;Qe<32768;++Qe)Is=(Qe&43690)>>1|(Qe&21845)<<1,Is=(Is&52428)>>2|(Is&13107)<<2,Is=(Is&61680)>>4|(Is&3855)<<4,nm[Qe]=((Is&65280)>>8|(Is&255)<<8)>>1;var Is,Qe,tn=function(e,r,t){for(var o=e.length,n=0,i=new qr(r);n<o;++n)e[n]&&++i[e[n]-1];var a=new qr(r);for(n=1;n<r;++n)a[n]=a[n-1]+i[n-1]<<1;var l;if(t){l=new qr(1<<r);var c=15-r;for(n=0;n<o;++n)if(e[n])for(var p=n<<4|e[n],m=r-e[n],f=a[e[n]-1]++<<m,g=f|(1<<m)-1;f<=g;++f)l[nm[f]>>c]=p}else for(l=new qr(o),n=0;n<o;++n)e[n]&&(l[n]=nm[a[e[n]-1]++]>>15-e[n]);return l},Ss=new mt(288);for(Qe=0;Qe<144;++Qe)Ss[Qe]=8;var Qe;for(Qe=144;Qe<256;++Qe)Ss[Qe]=9;var Qe;for(Qe=256;Qe<280;++Qe)Ss[Qe]=7;var Qe;for(Qe=280;Qe<288;++Qe)Ss[Qe]=8;var Qe,xp=new mt(32);for(Qe=0;Qe<32;++Qe)xp[Qe]=5;var Qe,V4=tn(Ss,9,0),H4=tn(Ss,9,1),$4=tn(xp,5,0),W4=tn(xp,5,1),iy=function(e){for(var r=e[0],t=1;t<e.length;++t)e[t]>r&&(r=e[t]);return r},en=function(e,r,t){var o=r/8|0;return(e[o]|e[o+1]<<8)>>(r&7)&t},sy=function(e,r){var t=r/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(r&7)},am=function(e){return(e+7)/8|0},Sa=function(e,r,t){return(r==null||r<0)&&(r=0),(t==null||t>e.length)&&(t=e.length),new mt(e.subarray(r,t))},uy={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},z4=["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"],Gt=function(e,r,t){var o=new Error(r||z4[e]);if(o.code=e,Error.captureStackTrace&&Error.captureStackTrace(o,Gt),!t)throw o;return o},Z4=function(e,r,t,o){var n=e.length,i=o?o.length:0;if(!n||r.f&&!r.l)return t||new mt(0);var a=!t,l=a||r.i!=2,c=r.i;a&&(t=new mt(n*3));var p=function(F){var Q=t.length;if(F>Q){var Y=new mt(Math.max(Q*2,F));Y.set(t),t=Y}},m=r.f||0,f=r.p||0,g=r.b||0,b=r.l,x=r.d,C=r.m,v=r.n,I=n*8;do{if(!b){m=en(e,f,1);var M=en(e,f+1,3);if(f+=3,M)if(M==1)b=H4,x=W4,C=9,v=5;else if(M==2){var B=en(e,f,31)+257,G=en(e,f+10,15)+4,A=B+en(e,f+5,31)+1;f+=14;for(var N=new mt(A),z=new mt(19),Z=0;Z<G;++Z)z[om[Z]]=en(e,f+Z*3,7);f+=G*3;for(var oe=iy(z),J=(1<<oe)-1,fe=tn(z,oe,1),Z=0;Z<A;){var ye=fe[en(e,f,J)];f+=ye&15;var O=ye>>4;if(O<16)N[Z++]=O;else{var Te=0,ve=0;for(O==16?(ve=3+en(e,f,3),f+=2,Te=N[Z-1]):O==17?(ve=3+en(e,f,7),f+=3):O==18&&(ve=11+en(e,f,127),f+=7);ve--;)N[Z++]=Te}}var we=N.subarray(0,B),ie=N.subarray(B);C=iy(we),v=iy(ie),b=tn(we,C,1),x=tn(ie,v,1)}else Gt(1);else{var O=am(f)+4,T=e[O-4]|e[O-3]<<8,P=O+T;if(P>n){c&&Gt(0);break}l&&p(g+T),t.set(e.subarray(O,P),g),r.b=g+=T,r.p=f=P*8,r.f=m;continue}if(f>I){c&&Gt(0);break}}l&&p(g+131072);for(var Me=(1<<C)-1,tt=(1<<v)-1,Ze=f;;Ze=f){var Te=b[sy(e,f)&Me],rt=Te>>4;if(f+=Te&15,f>I){c&&Gt(0);break}if(Te||Gt(2),rt<256)t[g++]=rt;else if(rt==256){Ze=f,b=null;break}else{var Ke=rt-254;if(rt>264){var Z=rt-257,be=Ip[Z];Ke=en(e,f,(1<<be)-1)+E2[Z],f+=be}var gt=x[sy(e,f)&tt],wt=gt>>4;gt||Gt(3),f+=gt&15;var ie=U4[wt];if(wt>3){var be=Sp[wt];ie+=sy(e,f)&(1<<be)-1,f+=be}if(f>I){c&&Gt(0);break}l&&p(g+131072);var Kt=g+Ke;if(g<ie){var k=i-ie,H=Math.min(ie,Kt);for(k+g<0&&Gt(3);g<H;++g)t[g]=o[k+g]}for(;g<Kt;++g)t[g]=t[g-ie]}}r.l=b,r.p=Ze,r.b=g,r.f=m,b&&(m=1,r.m=C,r.d=x,r.n=v)}while(!m);return g!=t.length&&a?Sa(t,0,g):t.subarray(0,g)},Oi=function(e,r,t){t<<=r&7;var o=r/8|0;e[o]|=t,e[o+1]|=t>>8},yp=function(e,r,t){t<<=r&7;var o=r/8|0;e[o]|=t,e[o+1]|=t>>8,e[o+2]|=t>>16},ay=function(e,r){for(var t=[],o=0;o<e.length;++o)e[o]&&t.push({s:o,f:e[o]});var n=t.length,i=t.slice();if(!n)return{t:k2,l:0};if(n==1){var a=new mt(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(P,B){return P.f-B.f}),t.push({s:-1,f:25001});var l=t[0],c=t[1],p=0,m=1,f=2;for(t[0]={s:-1,f:l.f+c.f,l,r:c};m!=n-1;)l=t[t[p].f<t[f].f?p++:f++],c=t[p!=m&&t[p].f<t[f].f?p++:f++],t[m++]={s:-1,f:l.f+c.f,l,r:c};for(var g=i[0].s,o=1;o<n;++o)i[o].s>g&&(g=i[o].s);var b=new qr(g+1),x=cy(t[m-1],b,0);if(x>r){var o=0,C=0,v=x-r,I=1<<v;for(i.sort(function(B,G){return b[G.s]-b[B.s]||B.f-G.f});o<n;++o){var M=i[o].s;if(b[M]>r)C+=I-(1<<x-b[M]),b[M]=r;else break}for(C>>=v;C>0;){var O=i[o].s;b[O]<r?C-=1<<r-b[O]++-1:++o}for(;o>=0&&C;--o){var T=i[o].s;b[T]==r&&(--b[T],++C)}x=r}return{t:new mt(b),l:x}},cy=function(e,r,t){return e.s==-1?Math.max(cy(e.l,r,t+1),cy(e.r,r,t+1)):r[e.s]=t},O2=function(e){for(var r=e.length;r&&!e[--r];);for(var t=new qr(++r),o=0,n=e[0],i=1,a=function(c){t[o++]=c},l=1;l<=r;++l)if(e[l]==n&&l!=r)++i;else{if(!n&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(n),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(n);i=1,n=e[l]}return{c:t.subarray(0,o),n:r}},bp=function(e,r){for(var t=0,o=0;o<r.length;++o)t+=e[o]*r[o];return t},D2=function(e,r,t){var o=t.length,n=am(r+2);e[n]=o&255,e[n+1]=o>>8,e[n+2]=e[n]^255,e[n+3]=e[n+1]^255;for(var i=0;i<o;++i)e[n+i+4]=t[i];return(n+4+o)*8},P2=function(e,r,t,o,n,i,a,l,c,p,m){Oi(r,m++,t),++n[256];for(var f=ay(n,15),g=f.t,b=f.l,x=ay(i,15),C=x.t,v=x.l,I=O2(g),M=I.c,O=I.n,T=O2(C),P=T.c,B=T.n,G=new qr(19),A=0;A<M.length;++A)++G[M[A]&31];for(var A=0;A<P.length;++A)++G[P[A]&31];for(var N=ay(G,7),z=N.t,Z=N.l,oe=19;oe>4&&!z[om[oe-1]];--oe);var J=p+5<<3,fe=bp(n,Ss)+bp(i,xp)+a,ye=bp(n,g)+bp(i,C)+a+14+3*oe+bp(G,z)+2*G[16]+3*G[17]+7*G[18];if(c>=0&&J<=fe&&J<=ye)return D2(r,m,e.subarray(c,c+p));var Te,ve,we,ie;if(Oi(r,m,1+(ye<fe)),m+=2,ye<fe){Te=tn(g,b,0),ve=g,we=tn(C,v,0),ie=C;var Me=tn(z,Z,0);Oi(r,m,O-257),Oi(r,m+5,B-1),Oi(r,m+10,oe-4),m+=14;for(var A=0;A<oe;++A)Oi(r,m+3*A,z[om[A]]);m+=3*oe;for(var tt=[M,P],Ze=0;Ze<2;++Ze)for(var rt=tt[Ze],A=0;A<rt.length;++A){var Ke=rt[A]&31;Oi(r,m,Me[Ke]),m+=z[Ke],Ke>15&&(Oi(r,m,rt[A]>>5&127),m+=rt[A]>>12)}}else Te=V4,ve=Ss,we=$4,ie=xp;for(var A=0;A<l;++A){var be=o[A];if(be>255){var Ke=be>>18&31;yp(r,m,Te[Ke+257]),m+=ve[Ke+257],Ke>7&&(Oi(r,m,be>>23&31),m+=Ip[Ke]);var gt=be&31;yp(r,m,we[gt]),m+=ie[gt],gt>3&&(yp(r,m,be>>5&8191),m+=Sp[gt])}else yp(r,m,Te[be]),m+=ve[be]}return yp(r,m,Te[256]),m+ve[256]},X4=new sm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),k2=new mt(0),Y4=function(e,r,t,o,n,i){var a=i.z||e.length,l=new mt(o+a+5*(1+Math.ceil(a/7e3))+n),c=l.subarray(o,l.length-n),p=i.l,m=(i.r||0)&7;if(r){m&&(c[0]=i.r>>3);for(var f=X4[r-1],g=f>>13,b=f&8191,x=(1<<t)-1,C=i.p||new qr(32768),v=i.h||new qr(x+1),I=Math.ceil(t/3),M=2*I,O=function(q){return(e[q]^e[q+1]<<I^e[q+2]<<M)&x},T=new sm(25e3),P=new qr(288),B=new qr(32),G=0,A=0,N=i.i||0,z=0,Z=i.w||0,oe=0;N+2<a;++N){var J=O(N),fe=N&32767,ye=v[J];if(C[fe]=ye,v[J]=fe,Z<=N){var Te=a-N;if((G>7e3||z>24576)&&(Te>423||!p)){m=P2(e,c,0,T,P,B,A,z,oe,N-oe,m),z=G=A=0,oe=N;for(var ve=0;ve<286;++ve)P[ve]=0;for(var ve=0;ve<30;++ve)B[ve]=0}var we=2,ie=0,Me=b,tt=fe-ye&32767;if(Te>2&&J==O(N-tt))for(var Ze=Math.min(g,Te)-1,rt=Math.min(32767,N),Ke=Math.min(258,Te);tt<=rt&&--Me&&fe!=ye;){if(e[N+we]==e[N+we-tt]){for(var be=0;be<Ke&&e[N+be]==e[N+be-tt];++be);if(be>we){if(we=be,ie=tt,be>Ze)break;for(var gt=Math.min(tt,be-2),wt=0,ve=0;ve<gt;++ve){var Kt=N-tt+ve&32767,k=C[Kt],H=Kt-k&32767;H>wt&&(wt=H,ye=Kt)}}}fe=ye,ye=C[fe],tt+=fe-ye&32767}if(ie){T[z++]=268435456|ly[we]<<18|w2[ie];var F=ly[we]&31,Q=w2[ie]&31;A+=Ip[F]+Sp[Q],++P[257+F],++B[Q],Z=N+we,++G}else T[z++]=e[N],++P[e[N]]}}for(N=Math.max(N,Z);N<a;++N)T[z++]=e[N],++P[e[N]];m=P2(e,c,p,T,P,B,A,z,oe,N-oe,m),p||(i.r=m&7|c[m/8|0]<<3,m-=7,i.h=v,i.p=C,i.i=N,i.w=Z)}else{for(var N=i.w||0;N<a+p;N+=65535){var Y=N+65535;Y>=a&&(c[m/8|0]=p,Y=a),m=D2(c,m+1,e.subarray(N,Y))}i.i=a}return Sa(l,0,o+am(m)+n)},v_=function(){for(var e=new Int32Array(256),r=0;r<256;++r){for(var t=r,o=9;--o;)t=(t&1&&-306674912)^t>>>1;e[r]=t}return e}(),J4=function(){var e=-1;return{p:function(r){for(var t=e,o=0;o<r.length;++o)t=v_[t&255^r[o]]^t>>>8;e=t},d:function(){return~e}}};var K4=function(e,r,t,o,n){if(!n&&(n={l:1},r.dictionary)){var i=r.dictionary.subarray(-32768),a=new mt(i.length+e.length);a.set(i),a.set(e,i.length),e=a,n.w=i.length}return Y4(e,r.level==null?6:r.level,r.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+r.mem,t,o,n)},my=function(e,r){var t={};for(var o in e)t[o]=e[o];for(var o in r)t[o]=r[o];return t},_4=function(e,r,t){for(var o=e(),n=e.toString(),i=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<o.length;++a){var l=o[a],c=i[a];if(typeof l=="function"){r+=";"+c+"=";var p=l.toString();if(l.prototype)if(p.indexOf("[native code]")!=-1){var m=p.indexOf(" ",8)+1;r+=p.slice(m,p.indexOf("(",m))}else{r+=p;for(var f in l.prototype)r+=";"+c+".prototype."+f+"="+l.prototype[f].toString()}else r+=p}else t[c]=l}return r},ny=[],I_=function(e){var r=[];for(var t in e)e[t].buffer&&r.push((e[t]=new e[t].constructor(e[t])).buffer);return r},S_=function(e,r,t,o){if(!ny[t]){for(var n="",i={},a=e.length-1,l=0;l<a;++l)n=_4(e[l],n,i);ny[t]={c:_4(e[a],n,i),e:i}}var c=my({},ny[t].e);return x_(ny[t].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+r.toString()+"}",t,c,I_(c),o)},C_=function(){return[mt,qr,sm,Ip,Sp,om,E2,U4,H4,W4,nm,z4,tn,iy,en,sy,am,Sa,Gt,Z4,gy,fy,Q4]},T_=function(){return[mt,qr,sm,Ip,Sp,om,ly,w2,V4,Ss,$4,xp,nm,X4,k2,tn,Oi,yp,ay,cy,O2,bp,D2,P2,am,Sa,Y4,K4,hy,fy]};var fy=function(e){return postMessage(e,[e.buffer])},Q4=function(e){return e&&{out:e.size&&new mt(e.size),dictionary:e.dictionary}},q4=function(e,r,t,o,n,i){var a=S_(t,o,n,function(l,c){a.terminate(),i(l,c)});return a.postMessage([e,r],r.consume?[e.buffer]:[]),function(){a.terminate()}};var Dn=function(e,r){return e[r]|e[r+1]<<8},kr=function(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24)>>>0},M2=function(e,r){return kr(e,r)+kr(e,r+4)*4294967296},Dr=function(e,r,t){for(;t;++r)e[r]=t,t>>>=8};function M_(e,r,t){return t||(t=r,r={}),typeof t!="function"&&Gt(7),q4(e,r,[T_],function(o){return fy(hy(o.data[0],o.data[1]))},0,t)}function hy(e,r){return K4(e,r||{},0,0)}function w_(e,r,t){return t||(t=r,r={}),typeof t!="function"&&Gt(7),q4(e,r,[C_],function(o){return fy(gy(o.data[0],Q4(o.data[1])))},1,t)}function gy(e,r){return Z4(e,{i:2},r&&r.out,r&&r.dictionary)}var L2=function(e,r,t,o){for(var n in e){var i=e[n],a=r+n,l=o;Array.isArray(i)&&(l=my(o,i[1]),i=i[0]),i instanceof mt?t[a]=[i,l]:(t[a+="/"]=[new mt(0),l],L2(i,a,t,o))}},B4=typeof TextEncoder<"u"&&new TextEncoder,F2=typeof TextDecoder<"u"&&new TextDecoder,O_=0;try{F2.decode(k2,{stream:!0}),O_=1}catch{}var P_=function(e){for(var r="",t=0;;){var o=e[t++],n=(o>127)+(o>223)+(o>239);if(t+n>e.length)return{s:r,r:Sa(e,t-1)};n?n==3?(o=((o&15)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,r+=String.fromCharCode(55296|o>>10,56320|o&1023)):n&1?r+=String.fromCharCode((o&31)<<6|e[t++]&63):r+=String.fromCharCode((o&15)<<12|(e[t++]&63)<<6|e[t++]&63):r+=String.fromCharCode(o)}};function vp(e,r){if(r){for(var t=new mt(e.length),o=0;o<e.length;++o)t[o]=e.charCodeAt(o);return t}if(B4)return B4.encode(e);for(var n=e.length,i=new mt(e.length+(e.length>>1)),a=0,l=function(m){i[a++]=m},o=0;o<n;++o){if(a+5>i.length){var c=new mt(a+8+(n-o<<1));c.set(i),i=c}var p=e.charCodeAt(o);p<128||r?l(p):p<2048?(l(192|p>>6),l(128|p&63)):p>55295&&p<57344?(p=65536+(p&1047552)|e.charCodeAt(++o)&1023,l(240|p>>18),l(128|p>>12&63),l(128|p>>6&63),l(128|p&63)):(l(224|p>>12),l(128|p>>6&63),l(128|p&63))}return Sa(i,0,a)}function A2(e,r){if(r){for(var t="",o=0;o<e.length;o+=16384)t+=String.fromCharCode.apply(null,e.subarray(o,o+16384));return t}else{if(F2)return F2.decode(e);var n=P_(e),i=n.s,t=n.r;return t.length&&Gt(8),i}}var eT=function(e,r){return r+30+Dn(e,r+26)+Dn(e,r+28)},tT=function(e,r,t){var o=Dn(e,r+28),n=A2(e.subarray(r+46,r+46+o),!(Dn(e,r+8)&2048)),i=r+46+o,a=kr(e,r+20),l=t&&a==4294967295?F_(e,i):[a,kr(e,r+24),kr(e,r+42)],c=l[0],p=l[1],m=l[2];return[Dn(e,r+10),c,p,n,i+Dn(e,r+30)+Dn(e,r+32),m]},F_=function(e,r){for(;Dn(e,r)!=1;r+=4+Dn(e,r+2));return[M2(e,r+12),M2(e,r+4),M2(e,r+20)]},im=function(e){var r=0;if(e)for(var t in e){var o=e[t].length;o>65535&&Gt(9),r+=o+4}return r},py=function(e,r,t,o,n,i,a,l){var c=o.length,p=t.extra,m=l&&l.length,f=im(p);Dr(e,r,a!=null?33639248:67324752),r+=4,a!=null&&(e[r++]=20,e[r++]=t.os),e[r]=20,r+=2,e[r++]=t.flag<<1|(i<0&&8),e[r++]=n&&8,e[r++]=t.compression&255,e[r++]=t.compression>>8;var g=new Date(t.mtime==null?Date.now():t.mtime),b=g.getFullYear()-1980;if((b<0||b>119)&&Gt(10),Dr(e,r,b<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>1),r+=4,i!=-1&&(Dr(e,r,t.crc),Dr(e,r+4,i<0?-i-2:i),Dr(e,r+8,t.size)),Dr(e,r+12,c),Dr(e,r+14,f),r+=16,a!=null&&(Dr(e,r,m),Dr(e,r+6,t.attrs),Dr(e,r+10,a),r+=14),e.set(o,r),r+=c,f)for(var x in p){var C=p[x],v=C.length;Dr(e,r,+x),Dr(e,r+2,v),e.set(C,r+4),r+=4+v}return m&&(e.set(l,r),r+=m),r},rT=function(e,r,t,o,n){Dr(e,r,101010256),Dr(e,r+8,t),Dr(e,r+10,t),Dr(e,r+12,o),Dr(e,r+16,n)};function oT(e,r,t){t||(t=r,r={}),typeof t!="function"&&Gt(7);var o={};L2(e,"",o,r);var n=Object.keys(o),i=n.length,a=0,l=0,c=i,p=new Array(i),m=[],f=function(){for(var v=0;v<m.length;++v)m[v]()},g=function(v,I){dy(function(){t(v,I)})};dy(function(){g=t});var b=function(){var v=new mt(l+22),I=a,M=l-a;l=0;for(var O=0;O<c;++O){var T=p[O];try{var P=T.c.length;py(v,l,T,T.f,T.u,P);var B=30+T.f.length+im(T.extra),G=l+B;v.set(T.c,G),py(v,a,T,T.f,T.u,P,l,T.m),a+=16+B+(T.m?T.m.length:0),l=G+P}catch(A){return g(A,null)}}rT(v,a,p.length,M,I),g(null,v)};i||b();for(var x=function(v){var I=n[v],M=o[I],O=M[0],T=M[1],P=J4(),B=O.length;P.p(O);var G=vp(I),A=G.length,N=T.comment,z=N&&vp(N),Z=z&&z.length,oe=im(T.extra),J=T.level==0?0:8,fe=function(ye,Te){if(ye)f(),g(ye,null);else{var ve=Te.length;p[v]=my(T,{size:B,crc:P.d(),c:Te,f:G,m:z,u:A!=I.length||z&&N.length!=Z,compression:J}),a+=30+A+oe+ve,l+=76+2*(A+oe)+(Z||0)+ve,--i||b()}};if(A>65535&&fe(Gt(11,0,1),null),!J)fe(null,O);else if(B<16e4)try{fe(null,hy(O,T))}catch(ye){fe(ye,null)}else m.push(M_(O,T,fe))},C=0;C<c;++C)x(C);return f}function nT(e,r){r||(r={});var t={},o=[];L2(e,"",t,r);var n=0,i=0;for(var a in t){var l=t[a],c=l[0],p=l[1],m=p.level==0?0:8,f=vp(a),g=f.length,b=p.comment,x=b&&vp(b),C=x&&x.length,v=im(p.extra);g>65535&&Gt(11);var I=m?hy(c,p):c,M=I.length,O=J4();O.p(c),o.push(my(p,{size:c.length,crc:O.d(),c:I,f,m:x,u:g!=a.length||x&&b.length!=C,o:n,compression:m})),n+=30+g+v+M,i+=76+2*(g+v)+(C||0)+M}for(var T=new mt(i+22),P=n,B=i-n,G=0;G<o.length;++G){var f=o[G];py(T,f.o,f,f.f,f.u,f.c.length);var A=30+f.f.length+im(f.extra);T.set(f.c,f.o+A),py(T,n,f,f.f,f.u,f.c.length,f.o,f.m),n+=16+A+(f.m?f.m.length:0)}return rT(T,n,o.length,B,P),T}var dy=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function iT(e,r,t){t||(t=r,r={}),typeof t!="function"&&Gt(7);var o=[],n=function(){for(var v=0;v<o.length;++v)o[v]()},i={},a=function(v,I){dy(function(){t(v,I)})};dy(function(){a=t});for(var l=e.length-22;kr(e,l)!=101010256;--l)if(!l||e.length-l>65558)return a(Gt(13,0,1),null),n;var c=Dn(e,l+8);if(c){var p=c,m=kr(e,l+16),f=m==4294967295||p==65535;if(f){var g=kr(e,l-12);f=kr(e,g)==101075792,f&&(p=c=kr(e,g+32),m=kr(e,g+48))}for(var b=r&&r.filter,x=function(v){var I=tT(e,m,f),M=I[0],O=I[1],T=I[2],P=I[3],B=I[4],G=I[5],A=eT(e,G);m=B;var N=function(Z,oe){Z?(n(),a(Z,null)):(oe&&(i[P]=oe),--c||a(null,i))};if(!b||b({name:P,size:O,originalSize:T,compression:M}))if(!M)N(null,Sa(e,A,A+O));else if(M==8){var z=e.subarray(A,A+O);if(T<524288||O>.8*T)try{N(null,gy(z,{out:new mt(T)}))}catch(Z){N(Z,null)}else o.push(w_(z,{size:T},N))}else N(Gt(14,"unknown compression type "+M,1),null);else N(null,null)},C=0;C<p;++C)x(C)}else a(null,{});return n}function sT(e,r){for(var t={},o=e.length-22;kr(e,o)!=101010256;--o)(!o||e.length-o>65558)&&Gt(13);var n=Dn(e,o+8);if(!n)return{};var i=kr(e,o+16),a=i==4294967295||n==65535;if(a){var l=kr(e,o-12);a=kr(e,l)==101075792,a&&(n=kr(e,l+32),i=kr(e,l+48))}for(var c=r&&r.filter,p=0;p<n;++p){var m=tT(e,i,a),f=m[0],g=m[1],b=m[2],x=m[3],C=m[4],v=m[5],I=eT(e,v);i=C,(!c||c({name:x,size:g,originalSize:b,compression:f}))&&(f?f==8?t[x]=gy(e.subarray(I,I+g),{out:new mt(b)}):Gt(14,"unknown compression type "+f):t[x]=Sa(e,I,I+g))}return t}d();var E_=e=>{if(e!=null)return e.trim()===""?void 0:e},D_=e=>e!=null,yy=(e,r,t=0)=>{if(E.IsNull(e))return"null";if(E.IsUndefined(e))return"undefined";if(E.IsString(e))return"<string>";if(E.IsNumber(e))return"<number>";if(E.IsBoolean(e))return"<boolean>";if(E.IsLiteral(e))return typeof e.const=="string"?`'${e.const}'`:`${e.const}`;if(E.IsRef(e)){let o=r.find(n=>n.$id===e.$ref);return o==null?e.$ref:yy(o,r,t)}if(E.IsArray(e))return`${yy(e.items,r,t+1)}[]`;if(E.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let n=`${e.anyOf.map(i=>yy(i,r,t+1)).filter(D_).join(" | ")}`;return t>0?`(${n})`:n}return e.$id??""},k_=(e,r,t)=>{let o=r.message;return E.IsUnion(r.schema)&&(o=`Expected one of: ${yy(r.schema,t)}`),`${`#/definitions/${e}${E_(r.path)??""}`}: ${o}`},by=(e,r,t)=>{let o=r.First();if(o!=null)return k_(e,o,t)};var Cp;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(Cp||(Cp={}));var Tp=class extends Error{constructor(t,o){super(o);u(this,"name");u(this,"kind");this.name="CompressError",this.kind=t}},L_=e=>new Tp(Cp.Archive,e.message),A_=e=>{let r=Object.values(uy);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&r.includes(e.code)},R_=(e,r,t)=>new Tp(Cp.Validate,by(e,r,t)??"Unknown validate error"),__=e=>new Tp(Cp.Encode,e.message),B_=e=>new Tp(Cp.Unknown,e instanceof Error?e.message:String(e)),lm=(e,r,t)=>r instanceof Sl?__(r):r instanceof Qo?R_(e,r,t):A_(r)?L_(r):B_(r);d();var Mp;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(Mp||(Mp={}));var wp=class extends Error{constructor(t,o){super(o);u(this,"name");u(this,"kind");this.name="DecompressError",this.kind=t}},N_=e=>new wp(Mp.Unarchive,e.message),j_=e=>{let r=Object.values(uy);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&r.includes(e.code)},G_=(e,r,t)=>new wp(Mp.Validate,by(e,r,t)??"Unknown validate error"),U_=e=>new wp(Mp.Decode,e.message),V_=e=>new wp(Mp.Unknown,e instanceof Error?e.message:String(e)),cm=(e,r,t)=>r instanceof Il?U_(r):r instanceof Qo?G_(e,r,t):j_(r)?N_(r):V_(r);var aT=function*(e,r=""){if(e!=null){if(Array.isArray(e)){for(let t=0;t<e.length;t++)yield[r+`[${t}]`,e[t]];return}if("features"in e){for(let t=0;t<e.features.length;t++)yield[r===""?`features[${t}]`:`${r}.features[${t}]`,e.features[t]];return}for(let[t,o]of Object.entries(e)){let n=r===""?t:`${r}.${t}`;yield*aT(o,n)}}},H_=(e,r)=>e===""?r:r.startsWith("[")?`${e}${r}`:`${e}.${r}`,zt=(e,r,t)=>{let o=new Set;for(let[n,i]of aT(e)){let a=r(i);if(o.has(a))return re({kind:go.DuplicateIdError,properties:{id:a,path:H_(t,n)}});o.add(a)}return ee(!0)};var lT=e=>e.floors==null?re({kind:go.FloorMissingError,properties:null}):zt(e.floors.features,r=>r.properties.id,"floors");var cT=h.Intersect([h.Object({id:h.Ref(Ae),elevation:h.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:h.Optional(h.String({description:"The subtitle of the floor."}))}),Fo],{$id:"FloorProperties"}),pT=Pr(h.Union([h.Ref(cp),h.Ref(pp),h.Null()]),h.Ref(cT),{$id:"FloorFeature"}),dT=Qr(h.Ref(pT),{$id:"FloorCollection"}),$_=h.Object({floors:h.Ref(dT)}),uT={name:"core:floors",intoBundle:function*(e){e.floors!=null&&(yield{path:"floors.geojson",contents:e.floors})},fromBundle:(e,r,t)=>{if(e==="floors.geojson")return{floors:t(r)}},integrityCheck:lT,schema:$_,references:[cT,pT,dT]};d();d();var Zt=e=>h.Unsafe(e);d();var je=e=>Object.keys(e);d();d();var W_=e=>new Map(e.floors?.features.map(r=>[r.properties.id,r])??[]),kn=e=>{let r=W_(e);return o=>{let n=r.get(o);return n==null?re({kind:go.UnknownFloorError,properties:{floorId:o}}):ee(n)}};var mT=e=>{if(e.floors==null)return re({kind:go.FloorMissingError,properties:null});if(e.geometry==null)return re({kind:go.GeometryMissingError,properties:null});let r=zt(e.geometry,o=>o.properties.id,"geometry");if(r.isErr())return r;let t=kn(e);for(let o of je(e.geometry)){let n=t(o);if(n.isErr())return n}return ee(!0)};var fT=h.Intersect([h.Object({id:h.Ref(Ur)}),Fo],{$id:"GeometryProperties"}),hT=Pr(h.Union([h.Ref(Gr),h.Ref(_g),h.Ref(Bg),h.Ref(Ng),h.Ref(cp),h.Ref(pp)]),h.Ref(fT),{$id:"GeometryFeature"}),gT=Qr(h.Ref(hT),{$id:"GeometryCollection"}),z_=h.Object({geometry:Zt(h.Record(Ae,h.Ref(gT),{additionalProperties:!1}))},{$id:"GeometrySchema"}),Z_=/^geometry\/(.*)\.geojson$/,yT={name:"core:geometry",schema:z_,intoBundle:function*(e){if(e.geometry!=null)for(let r of je(e.geometry))yield{path:`geometry/${r}.geojson`,contents:e.geometry[r]}},fromBundle:(e,r,t)=>{let o=e.match(Z_)?.[1];if(o)return{geometry:{[o]:t(r)}}},references:[fT,hT,gT],integrityCheck:mT};d();var R2=h.Object({type:h.Literal("file"),name:h.String({description:"The name of the file."})},{$id:"ManifestFile"}),bT=h.Recursive(e=>h.Object({type:h.Literal("folder"),name:h.String({description:"The name of the folder."}),children:h.Array(h.Union([e,h.Ref(R2)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),xT=h.Object({name:h.String({description:"The name of the map."}),version:h.Literal("3.0.0",{description:"The version of the manifest."}),orgId:h.Optional(h.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:h.Optional(h.String({description:"The identifier of the map that this MVF is for."})),contents:h.Array(h.Union([h.Ref(bT),h.Ref(R2)]),{minItems:1,description:"The contents of the MVF bundle."}),time:h.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:h.Optional(h.Unsafe(h.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:h.Optional(h.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:h.Optional(h.Ref(Ae,{description:"The default floor ID of the map."})),language:h.Optional(h.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),vT=Qr(Pr(Gr,h.Ref(xT)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),X_=h.Object({manifest:h.Ref(vT)}),IT={name:"core:manifest",intoBundle:function*(e){e.manifest!=null&&(yield{path:"manifest.geojson",contents:e.manifest})},fromBundle:(e,r,t)=>{if(e==="manifest.geojson")return{manifest:t(r)}},schema:X_,references:[R2,bT,xT,vT]};d();d();d();d();var _2=class extends de{constructor(t){super(`Unable to dereference schema with $id '${t.$ref}'`);u(this,"schema");this.schema=t}};function Y_(e,r){let t=r.find(o=>o.$id===e.$ref);if(t===void 0)throw new _2(e);return Tl(t,r)}function xy(e,r){return!Ge.IsString(e.$id)||r.some(t=>t.$id===e.$id)||r.push(e),r}function Tl(e,r){return e[j]==="This"||e[j]==="Ref"?Y_(e,r):e}d();function J_(e,r,t){let o=e.get(r);if(o!==void 0)return o;let n=wi(r,t);return e.set(r,n),n}function vy(){let e=new WeakMap;return{HasTransform:(r,t)=>J_(e,r,t)}}function Ut(e,r,t){try{return E.IsTransform(e)?e[Ft].Decode(t):t}catch(o){throw new Il(e,r,t,o)}}function K_(e,r,t,o,n){return Ge.IsArray(o)?Ut(e,t,o.map((i,a)=>Pi(e.items,r,`${t}/${a}`,i,n))):Ut(e,t,o)}function Q_(e,r,t,o,n){if(!Ge.IsObject(o)||Or(o))return Ut(e,t,o);let i=ba(e),a=i.map(f=>f[0]),l={...o};for(let[f,g]of i)f in l&&(l[f]=Pi(g,r,`${t}/${f}`,l[f],n));if(!E.IsTransform(e.unevaluatedProperties))return Ut(e,t,l);let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,m={...l};for(let f of c)a.includes(f)||(m[f]=Ut(p,`${t}/${f}`,m[f]));return Ut(e,t,m)}function q_(e,r,t,o,n){return Ut(e,t,Pi(e.not,r,t,o,n))}function eB(e,r,t,o,n){if(!Ge.IsObject(o))return Ut(e,t,o);let i=gr(e),a={...o};for(let m of i)Ge.HasPropertyKey(a,m)&&(Ge.IsUndefined(a[m])&&(!E.IsUndefined(e.properties[m])||ot.IsExactOptionalProperty(a,m))||(a[m]=Pi(e.properties[m],r,`${t}/${m}`,a[m],n)));if(!E.IsSchema(e.additionalProperties))return Ut(e,t,a);let l=Object.getOwnPropertyNames(a),c=e.additionalProperties,p={...a};for(let m of l)i.includes(m)||(p[m]=Ut(c,`${t}/${m}`,p[m]));return Ut(e,t,p)}function tB(e,r,t,o,n){if(!Ge.IsObject(o))return Ut(e,t,o);let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),l={...o};for(let f of Object.getOwnPropertyNames(o))a.test(f)&&(l[f]=Pi(e.patternProperties[i],r,`${t}/${f}`,l[f],n));if(!E.IsSchema(e.additionalProperties))return Ut(e,t,l);let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,m={...l};for(let f of c)a.test(f)||(m[f]=Ut(p,`${t}/${f}`,m[f]));return Ut(e,t,m)}function rB(e,r,t,o,n){let i=Tl(e,r);return Ut(e,t,Pi(i,r,t,o,n))}function oB(e,r,t,o,n){let i=Tl(e,r);return Ut(e,t,Pi(i,r,t,o,n))}function nB(e,r,t,o,n){return Ge.IsArray(o)&&Ge.IsArray(e.items)?Ut(e,t,e.items.map((i,a)=>Pi(i,r,`${t}/${a}`,o[a],n))):Ut(e,t,o)}function iB(e,r,t,o,n){for(let i of e.anyOf){if(!En.Check(i,r,o))continue;let a=Pi(i,r,t,o,n);return Ut(e,t,a)}return Ut(e,t,o)}function Pi(e,r,t,o,n){if(!n.HasTransform(e,r))return o;let i=xy(e,r),a=e;switch(e[j]){case"Array":return K_(a,i,t,o,n);case"Intersect":return Q_(a,i,t,o,n);case"Not":return q_(a,i,t,o,n);case"Object":return eB(a,i,t,o,n);case"Record":return tB(a,i,t,o,n);case"Ref":return rB(a,i,t,o,n);case"Symbol":return Ut(a,t,o);case"This":return oB(a,i,t,o,n);case"Tuple":return nB(a,i,t,o,n);case"Union":return iB(a,i,t,o,n);default:return Ut(a,t,o)}}function ST(e,r,t){let o=vy();return Pi(e,r,"",t,o)}d();function $r(e,r,t){try{return E.IsTransform(e)?e[Ft].Encode(t):t}catch(o){throw new Sl(e,r,t,o)}}function sB(e,r,t,o,n){let i=$r(e,t,o);return Ge.IsArray(i)?i.map((a,l)=>Fi(e.items,r,`${t}/${l}`,a,n)):i}function aB(e,r,t,o,n){let i=$r(e,t,o);if(!Ge.IsObject(o)||Or(o))return i;let a=ba(e),l=a.map(g=>g[0]),c={...i};for(let[g,b]of a)g in c&&(c[g]=Fi(b,r,`${t}/${g}`,c[g],n));if(!E.IsTransform(e.unevaluatedProperties))return c;let p=Object.getOwnPropertyNames(c),m=e.unevaluatedProperties,f={...c};for(let g of p)l.includes(g)||(f[g]=$r(m,`${t}/${g}`,f[g]));return f}function lB(e,r,t,o){return $r(e.not,t,$r(e,t,o))}function cB(e,r,t,o,n){let i=$r(e,t,o);if(!Ge.IsObject(i))return i;let a=gr(e),l={...i};for(let f of a)Ge.HasPropertyKey(l,f)&&(Ge.IsUndefined(l[f])&&(!E.IsUndefined(e.properties[f])||ot.IsExactOptionalProperty(l,f))||(l[f]=Fi(e.properties[f],r,`${t}/${f}`,l[f],n)));if(!E.IsSchema(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,m={...l};for(let f of c)a.includes(f)||(m[f]=$r(p,`${t}/${f}`,m[f]));return m}function pB(e,r,t,o,n){let i=$r(e,t,o);if(!Ge.IsObject(o))return i;let a=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(a),c={...i};for(let g of Object.getOwnPropertyNames(o))l.test(g)&&(c[g]=Fi(e.patternProperties[a],r,`${t}/${g}`,c[g],n));if(!E.IsSchema(e.additionalProperties))return c;let p=Object.getOwnPropertyNames(c),m=e.additionalProperties,f={...c};for(let g of p)l.test(g)||(f[g]=$r(m,`${t}/${g}`,f[g]));return f}function dB(e,r,t,o,n){let i=Tl(e,r),a=Fi(i,r,t,o,n);return $r(e,t,a)}function uB(e,r,t,o,n){let i=Tl(e,r),a=Fi(i,r,t,o,n);return $r(e,t,a)}function mB(e,r,t,o,n){let i=$r(e,t,o);return Ge.IsArray(e.items)?e.items.map((a,l)=>Fi(a,r,`${t}/${l}`,i[l],n)):[]}function fB(e,r,t,o,n){for(let i of e.anyOf){if(!En.Check(i,r,o))continue;let a=Fi(i,r,t,o,n);return $r(e,t,a)}for(let i of e.anyOf){let a=Fi(i,r,t,o,n);if(En.Check(e,r,a))return $r(e,t,a)}return $r(e,t,o)}function Fi(e,r,t,o,n){if(!n.HasTransform(e,r))return o;let i=xy(e,r),a=e;switch(e[j]){case"Array":return sB(a,i,t,o,n);case"Intersect":return aB(a,i,t,o,n);case"Not":return lB(a,i,t,o);case"Object":return cB(a,i,t,o,n);case"Record":return pB(a,i,t,o,n);case"Ref":return dB(a,i,t,o,n);case"This":return uB(a,i,t,o,n);case"Tuple":return mB(a,i,t,o,n);case"Union":return fB(a,i,t,o,n);default:return $r(a,t,o)}}function CT(e,r,t){let o=vy();return Fi(e,r,"",t,o)}d();var B2=class{constructor(r,t,o,n){this.schema=r,this.references=t,this.checkFunc=o,this.code=n,this.hasTransform=wi(r,t)}Code(){return this.code}Errors(r){return Ii(this.schema,this.references,r)}Check(r){return this.checkFunc(r)}Decode(r){if(!this.checkFunc(r))throw new fp(this.schema,r,this.Errors(r).First());return this.hasTransform?hp(this.schema,this.references,r):r}Encode(r){let t=this.hasTransform?Jg(this.schema,this.references,r):r;if(!this.checkFunc(t))throw new gp(this.schema,r,this.Errors(r).First());return t}},Cs;(function(e){function r(i){return i===36}e.DollarSign=r;function t(i){return i===95}e.IsUnderscore=t;function o(i){return i>=65&&i<=90||i>=97&&i<=122}e.IsAlpha=o;function n(i){return i>=48&&i<=57}e.IsNumeric=n})(Cs||(Cs={}));var Iy;(function(e){function r(i){return i.length===0?!1:Cs.IsNumeric(i.charCodeAt(0))}function t(i){if(r(i))return!1;for(let a=0;a<i.length;a++){let l=i.charCodeAt(a);if(!(Cs.IsAlpha(l)||Cs.IsNumeric(l)||Cs.DollarSign(l)||Cs.IsUnderscore(l)))return!1}return!0}function o(i){return i.replace(/'/g,"\\'")}function n(i,a){return t(a)?`${i}.${a}`:`${i}['${o(a)}']`}e.Encode=n})(Iy||(Iy={}));var N2;(function(e){function r(t){let o=[];for(let n=0;n<t.length;n++){let i=t.charCodeAt(n);Cs.IsNumeric(i)||Cs.IsAlpha(i)?o.push(t.charAt(n)):o.push(`_${i}_`)}return o.join("").replace(/__/g,"_")}e.Encode=r})(N2||(N2={}));var j2;(function(e){function r(t){return t.replace(/'/g,"\\'")}e.Escape=r})(j2||(j2={}));var G2=class extends de{constructor(r){super("Unknown type"),this.schema=r}},Sy=class extends de{constructor(r){super("Preflight validation check failed to guard for the given schema"),this.schema=r}},Ml;(function(e){function r(a,l,c){return ot.ExactOptionalPropertyTypes?`('${l}' in ${a} ? ${c} : true)`:`(${Iy.Encode(a,l)} !== undefined ? ${c} : true)`}e.IsExactOptionalProperty=r;function t(a){return ot.AllowArrayObject?`(typeof ${a} === 'object' && ${a} !== null)`:`(typeof ${a} === 'object' && ${a} !== null && !Array.isArray(${a}))`}e.IsObjectLike=t;function o(a){return ot.AllowArrayObject?`(typeof ${a} === 'object' && ${a} !== null && !(${a} instanceof Date) && !(${a} instanceof Uint8Array))`:`(typeof ${a} === 'object' && ${a} !== null && !Array.isArray(${a}) && !(${a} instanceof Date) && !(${a} instanceof Uint8Array))`}e.IsRecordLike=o;function n(a){return ot.AllowNaN?`typeof ${a} === 'number'`:`Number.isFinite(${a})`}e.IsNumberLike=n;function i(a){return ot.AllowNullVoid?`(${a} === undefined || ${a} === null)`:`${a} === undefined`}e.IsVoidLike=i})(Ml||(Ml={}));var Cy;(function(e){function r(k){return k[j]==="Any"||k[j]==="Unknown"}function*t(k,H,F){yield"true"}function*o(k,H,F){yield`Array.isArray(${F})`;let[Q,Y]=[Ke("value","any"),Ke("acc","number")];le(k.maxItems)&&(yield`${F}.length <= ${k.maxItems}`),le(k.minItems)&&(yield`${F}.length >= ${k.minItems}`);let q=Me(k.items,H,"value");if(yield`${F}.every((${Q}) => ${q})`,Be(k.contains)||le(k.minContains)||le(k.maxContains)){let Pe=Be(k.contains)?k.contains:st(),Lt=Me(Pe,H,"value"),Uo=le(k.minContains)?[`(count >= ${k.minContains})`]:[],Xr=le(k.maxContains)?[`(count <= ${k.maxContains})`]:[],lo=`const count = value.reduce((${Y}, ${Q}) => ${Lt} ? acc + 1 : acc, 0)`,al=["(count > 0)",...Uo,...Xr].join(" && ");yield`((${Q}) => { ${lo}; return ${al}})(${F})`}k.uniqueItems===!0&&(yield`((${Q}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${F})`)}function*n(k,H,F){yield`(typeof value === 'object' && Symbol.asyncIterator in ${F})`}function*i(k,H,F){yield`(typeof ${F} === 'bigint')`,wr(k.exclusiveMaximum)&&(yield`${F} < BigInt(${k.exclusiveMaximum})`),wr(k.exclusiveMinimum)&&(yield`${F} > BigInt(${k.exclusiveMinimum})`),wr(k.maximum)&&(yield`${F} <= BigInt(${k.maximum})`),wr(k.minimum)&&(yield`${F} >= BigInt(${k.minimum})`),wr(k.multipleOf)&&(yield`(${F} % BigInt(${k.multipleOf})) === 0`)}function*a(k,H,F){yield`(typeof ${F} === 'boolean')`}function*l(k,H,F){yield*we(k.returns,H,`${F}.prototype`)}function*c(k,H,F){yield`(${F} instanceof Date) && Number.isFinite(${F}.getTime())`,le(k.exclusiveMaximumTimestamp)&&(yield`${F}.getTime() < ${k.exclusiveMaximumTimestamp}`),le(k.exclusiveMinimumTimestamp)&&(yield`${F}.getTime() > ${k.exclusiveMinimumTimestamp}`),le(k.maximumTimestamp)&&(yield`${F}.getTime() <= ${k.maximumTimestamp}`),le(k.minimumTimestamp)&&(yield`${F}.getTime() >= ${k.minimumTimestamp}`),le(k.multipleOfTimestamp)&&(yield`(${F}.getTime() % ${k.multipleOfTimestamp}) === 0`)}function*p(k,H,F){yield`(typeof ${F} === 'function')`}function*m(k,H,F){yield`Number.isInteger(${F})`,le(k.exclusiveMaximum)&&(yield`${F} < ${k.exclusiveMaximum}`),le(k.exclusiveMinimum)&&(yield`${F} > ${k.exclusiveMinimum}`),le(k.maximum)&&(yield`${F} <= ${k.maximum}`),le(k.minimum)&&(yield`${F} >= ${k.minimum}`),le(k.multipleOf)&&(yield`(${F} % ${k.multipleOf}) === 0`)}function*f(k,H,F){let Q=k.allOf.map(Y=>Me(Y,H,F)).join(" && ");if(k.unevaluatedProperties===!1){let Y=Ze(`${new RegExp(gs(k))};`),q=`Object.getOwnPropertyNames(${F}).every(key => ${Y}.test(key))`;yield`(${Q} && ${q})`}else if(Be(k.unevaluatedProperties)){let Y=Ze(`${new RegExp(gs(k))};`),q=`Object.getOwnPropertyNames(${F}).every(key => ${Y}.test(key) || ${Me(k.unevaluatedProperties,H,`${F}[key]`)})`;yield`(${Q} && ${q})`}else yield`(${Q})`}function*g(k,H,F){yield`(typeof value === 'object' && Symbol.iterator in ${F})`}function*b(k,H,F){typeof k.const=="number"||typeof k.const=="boolean"?yield`(${F} === ${k.const})`:yield`(${F} === '${j2.Escape(k.const)}')`}function*x(k,H,F){yield"false"}function*C(k,H,F){yield`(!${Me(k.not,H,F)})`}function*v(k,H,F){yield`(${F} === null)`}function*I(k,H,F){yield Ml.IsNumberLike(F),le(k.exclusiveMaximum)&&(yield`${F} < ${k.exclusiveMaximum}`),le(k.exclusiveMinimum)&&(yield`${F} > ${k.exclusiveMinimum}`),le(k.maximum)&&(yield`${F} <= ${k.maximum}`),le(k.minimum)&&(yield`${F} >= ${k.minimum}`),le(k.multipleOf)&&(yield`(${F} % ${k.multipleOf}) === 0`)}function*M(k,H,F){yield Ml.IsObjectLike(F),le(k.minProperties)&&(yield`Object.getOwnPropertyNames(${F}).length >= ${k.minProperties}`),le(k.maxProperties)&&(yield`Object.getOwnPropertyNames(${F}).length <= ${k.maxProperties}`);let Q=Object.getOwnPropertyNames(k.properties);for(let Y of Q){let q=Iy.Encode(F,Y),Pe=k.properties[Y];if(k.required&&k.required.includes(Y))yield*we(Pe,H,q),(bs(Pe)||r(Pe))&&(yield`('${Y}' in ${F})`);else{let Lt=Me(Pe,H,q);yield Ml.IsExactOptionalProperty(F,Y,Lt)}}if(k.additionalProperties===!1)if(k.required&&k.required.length===Q.length)yield`Object.getOwnPropertyNames(${F}).length === ${Q.length}`;else{let Y=`[${Q.map(q=>`'${q}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${F}).every(key => ${Y}.includes(key))`}if(typeof k.additionalProperties=="object"){let Y=Me(k.additionalProperties,H,`${F}[key]`),q=`[${Q.map(Pe=>`'${Pe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${F}).every(key => ${q}.includes(key) || ${Y}))`}}function*O(k,H,F){yield`(typeof value === 'object' && typeof ${F}.then === 'function')`}function*T(k,H,F){yield Ml.IsRecordLike(F),le(k.minProperties)&&(yield`Object.getOwnPropertyNames(${F}).length >= ${k.minProperties}`),le(k.maxProperties)&&(yield`Object.getOwnPropertyNames(${F}).length <= ${k.maxProperties}`);let[Q,Y]=Object.entries(k.patternProperties)[0],q=Ze(`${new RegExp(Q)}`),Pe=Me(Y,H,"value"),Lt=Be(k.additionalProperties)?Me(k.additionalProperties,H,F):k.additionalProperties===!1?"false":"true",Uo=`(${q}.test(key) ? ${Pe} : ${Lt})`;yield`(Object.entries(${F}).every(([key, value]) => ${Uo}))`}function*P(k,H,F){let Q=He(k,H);if(ie.functions.has(k.$ref))return yield`${tt(k.$ref)}(${F})`;yield*we(Q,H,F)}function*B(k,H,F){let Q=Ze(`${new RegExp(k.source,k.flags)};`);yield`(typeof ${F} === 'string')`,le(k.maxLength)&&(yield`${F}.length <= ${k.maxLength}`),le(k.minLength)&&(yield`${F}.length >= ${k.minLength}`),yield`${Q}.test(${F})`}function*G(k,H,F){yield`(typeof ${F} === 'string')`,le(k.maxLength)&&(yield`${F}.length <= ${k.maxLength}`),le(k.minLength)&&(yield`${F}.length >= ${k.minLength}`),k.pattern!==void 0&&(yield`${Ze(`${new RegExp(k.pattern)};`)}.test(${F})`),k.format!==void 0&&(yield`format('${k.format}', ${F})`)}function*A(k,H,F){yield`(typeof ${F} === 'symbol')`}function*N(k,H,F){yield`(typeof ${F} === 'string')`,yield`${Ze(`${new RegExp(k.pattern)};`)}.test(${F})`}function*z(k,H,F){yield`${tt(k.$ref)}(${F})`}function*Z(k,H,F){if(yield`Array.isArray(${F})`,k.items===void 0)return yield`${F}.length === 0`;yield`(${F}.length === ${k.maxItems})`;for(let Q=0;Q<k.items.length;Q++)yield`${Me(k.items[Q],H,`${F}[${Q}]`)}`}function*oe(k,H,F){yield`${F} === undefined`}function*J(k,H,F){yield`(${k.anyOf.map(Y=>Me(Y,H,F)).join(" || ")})`}function*fe(k,H,F){yield`${F} instanceof Uint8Array`,le(k.maxByteLength)&&(yield`(${F}.length <= ${k.maxByteLength})`),le(k.minByteLength)&&(yield`(${F}.length >= ${k.minByteLength})`)}function*ye(k,H,F){yield"true"}function*Te(k,H,F){yield Ml.IsVoidLike(F)}function*ve(k,H,F){let Q=ie.instances.size;ie.instances.set(Q,k),yield`kind('${k[j]}', ${Q}, ${F})`}function*we(k,H,F,Q=!0){let Y=_e(k.$id)?[...H,k]:H,q=k;if(Q&&_e(k.$id)){let Pe=tt(k.$id);if(ie.functions.has(Pe))return yield`${Pe}(${F})`;{let Lt=rt(Pe,k,H,"value",!1);return ie.functions.set(Pe,Lt),yield`${Pe}(${F})`}}switch(q[j]){case"Any":return yield*t(q,Y,F);case"Array":return yield*o(q,Y,F);case"AsyncIterator":return yield*n(q,Y,F);case"BigInt":return yield*i(q,Y,F);case"Boolean":return yield*a(q,Y,F);case"Constructor":return yield*l(q,Y,F);case"Date":return yield*c(q,Y,F);case"Function":return yield*p(q,Y,F);case"Integer":return yield*m(q,Y,F);case"Intersect":return yield*f(q,Y,F);case"Iterator":return yield*g(q,Y,F);case"Literal":return yield*b(q,Y,F);case"Never":return yield*x(q,Y,F);case"Not":return yield*C(q,Y,F);case"Null":return yield*v(q,Y,F);case"Number":return yield*I(q,Y,F);case"Object":return yield*M(q,Y,F);case"Promise":return yield*O(q,Y,F);case"Record":return yield*T(q,Y,F);case"Ref":return yield*P(q,Y,F);case"RegExp":return yield*B(q,Y,F);case"String":return yield*G(q,Y,F);case"Symbol":return yield*A(q,Y,F);case"TemplateLiteral":return yield*N(q,Y,F);case"This":return yield*z(q,Y,F);case"Tuple":return yield*Z(q,Y,F);case"Undefined":return yield*oe(q,Y,F);case"Union":return yield*J(q,Y,F);case"Uint8Array":return yield*fe(q,Y,F);case"Unknown":return yield*ye(q,Y,F);case"Void":return yield*Te(q,Y,F);default:if(!hr.Has(q[j]))throw new G2(k);return yield*ve(q,Y,F)}}let ie={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Me(k,H,F,Q=!0){return`(${[...we(k,H,F,Q)].join(" && ")})`}function tt(k){return`check_${N2.Encode(k)}`}function Ze(k){let H=`local_${ie.variables.size}`;return ie.variables.set(H,`const ${H} = ${k}`),H}function rt(k,H,F,Q,Y=!0){let[q,Pe]=[`
|
|
2
|
+
`,lo=>"".padStart(lo," ")],Lt=Ke("value","any"),Uo=be("boolean"),Xr=[...we(H,F,Q,Y)].map(lo=>`${Pe(4)}${lo}`).join(` &&${q}`);return`function ${k}(${Lt})${Uo} {${q}${Pe(2)}return (${q}${Xr}${q}${Pe(2)})
|
|
3
|
+
}`}function Ke(k,H){let F=ie.language==="typescript"?`: ${H}`:"";return`${k}${F}`}function be(k){return ie.language==="typescript"?`: ${k}`:""}function gt(k,H,F){let Q=rt("check",k,H,"value"),Y=Ke("value","any"),q=be("boolean"),Pe=[...ie.functions.values()],Lt=[...ie.variables.values()],Uo=_e(k.$id)?`return function check(${Y})${q} {
|
|
4
|
+
return ${tt(k.$id)}(value)
|
|
5
|
+
}`:`return ${Q}`;return[...Lt,...Pe,Uo].join(`
|
|
6
|
+
`)}function wt(...k){let H={language:"javascript"},[F,Q,Y]=k.length===2&&xe(k[1])?[k[0],k[1],H]:k.length===2&&!xe(k[1])?[k[0],[],k[1]]:k.length===3?[k[0],k[1],k[2]]:k.length===1?[k[0],[],H]:[null,[],H];if(ie.language=Y.language,ie.variables.clear(),ie.functions.clear(),ie.instances.clear(),!Be(F))throw new Sy(F);for(let q of Q)if(!Be(q))throw new Sy(q);return gt(F,Q,Y)}e.Code=wt;function Kt(k,H=[]){let F=wt(k,H,{language:"javascript"}),Q=globalThis.Function("kind","format","hash",F),Y=new Map(ie.instances);function q(Xr,lo,al){if(!hr.Has(Xr)||!Y.has(lo))return!1;let Xb=hr.Get(Xr),Yb=Y.get(lo);return Xb(Yb,al)}function Pe(Xr,lo){return po.Has(Xr)?po.Get(Xr)(lo):!1}function Lt(Xr){return Ia(Xr)}let Uo=Q(q,Pe,Lt);return new B2(k,H,Uo,F)}e.Compile=Kt})(Cy||(Cy={}));d();d();d();var hB=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,gB=[0,31,28,31,30,31,30,31,31,30,31,30,31],yB=e=>e%4===0&&(e%100!==0||e%400===0),Ty=e=>{let r=hB.exec(e);if(!r)return!1;let t=+r[1],o=+r[2],n=+r[3];return o>=1&&o<=12&&n>=1&&n<=(o===2&&yB(t)?29:gB[o])};d();var bB=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,My=e=>{let r=bB.exec(e);if(!r)return!1;let t=+r[1],o=+r[2],n=+r[3],i=r[4],a=r[5]==="-"?-1:1,l=+(r[6]||0),c=+(r[7]||0);if(l>23||c>59||!i)return!1;if(t<=23&&o<=59&&n<60)return!0;let p=o-c*a,m=t-l*a-(p<0?1:0);return(m===23||m===-1)&&(p===59||p===-1)&&n<61};var xB=/t|\s/i,TT=e=>{let r=e.split(xB);return r.length===2&&Ty(r[0])&&My(r[1])};d();var vB=/\/|:/,IB=/^(?:[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,MT=e=>vB.test(e)&&IB.test(e);var SB=[["date",Ty],["time",My],["date-time",TT],["uri",MT]],wT=()=>{for(let[e,r]of SB)try{Hg.Format(e,r)}catch(t){if(t instanceof qu)continue;throw t}};d();var U2=h.Record(h.String(),h.Unknown(),{$id:"Extra"}),Ln=h.Object({extra:h.Optional(h.Ref(U2))}),V2=[U2];d();d();d();d();d();d();var ze=e=>Object.entries(e);var CB=e=>{let r=new Map;for(let[t,o]of ze(e.geometry??{}))r.set(t,new Map(o?.features.map(n=>[n.properties.id,n])));return r},sr=e=>{let r=CB(e);return(o,n)=>{let i=r.get(o);if(i==null)return re({kind:go.UnknownFloorError,properties:{floorId:o}});let a=i.get(n);return a==null?re({kind:go.UnknownGeometryError,properties:{floorId:o,geometryId:n}}):ee(a)}};d();var rn=h.Object({geometryId:h.Ref(Ur)},{$id:"WithGeometryId"}),Op=h.Object({geometryIds:h.Array(h.Ref(Ur))},{$id:"WithGeometryIds"}),H2=[rn,Op];d();d();d();var OT=e=>e instanceof Error?e:new Error(String(e));var Pp=e=>(...r)=>{try{return ee(e(...r))}catch(t){return re(OT(t))}};var PT=Pp((e,r)=>{let t={};for(let o of r)for(let n of o.intoBundle(e))t[n.path]=vp(JSON.stringify(n.contents));return t}),$2=async(e,r,t)=>PT(e,r).andThenAsync(o=>new Promise(n=>{oT(o,{...t,consume:!0},(i,a)=>{n(i?re(i):ee(a))})})),TB=Pp(nT),W2=(e,r,t)=>PT(e,r).andThen(o=>TB(o,t));d();d();function wy(e,r,t=[]){let o={...e};for(let[n,i]of Object.entries(r))if(i!==void 0)if(n in o){let a=n;if(Array.isArray(i)&&i.length>0){let l=MB(i[0],t);if(l){let c=o[a];if(!Array.isArray(c))throw new Error(`Expected array at ${n}, got ${typeof c}`);let p=new Map(i.map(g=>[FT(g,l),g])),f=c.map(g=>{let b=p.get(FT(g,l));return b?wy(g,b,t):g});o[a]=f}else o[a]=i}else{let l=o[a];typeof l=="object"&&l!==null&&typeof i=="object"&&i!==null?Object.keys(i).length===0?o[a]=i:o[a]=wy(l,i,t):o[n]=i}}else o[n]=i;return o}function MB(e,r){function t(o){if(typeof o!="object"||o===null)return null;for(let n of r)if(n in o&&typeof o[n]<"u")return[n];if(Array.isArray(o))return null;for(let[n,i]of Object.entries(o)){let a=t(i);if(a)return[n,...a]}return null}return t(e)}function FT(e,r){return r.reduce((t,o)=>{if(t&&typeof t=="object")return t[o]},e)}var wB=e=>e,OB=e=>JSON.parse(A2(e)),ET=(e,r)=>r.some(t=>t.fromBundle(e.name,new Uint8Array,wB)!==void 0),DT=Pp((e,r)=>{let t={};for(let o of Object.keys(e)){let n=e[o];for(let i of r){let a=i.fromBundle(o,n,OB);if(a){t=wy(t,a,[]);break}}}return t}),z2=async(e,r)=>new Promise(t=>iT(e,{filter:o=>ET(o,r)},(o,n)=>{t(o?re(o):ee(n))})).then(t=>t.andThen(o=>DT(o,r))),PB=Pp(sT),Z2=(e,r)=>PB(e,{filter:t=>ET(t,r)}).andThen(t=>DT(t,r));d();var FB=e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string",EB=e=>{if(e.length<2)return!1;let r=e.filter(FB);if(r.length!==e.length)return!1;let t=r[0].$ref;return r.slice(1).every(o=>o.$ref===t)},Oy=e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&EB(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([r,t])=>[r,Oy(t)])):Array.isArray(e)?e.map(Oy):e;d();var Py=e=>typeof e=="object"&&e!=null&&"$ref"in e?{...e,$ref:`#/definitions/${e.$ref}`}:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([r,t])=>[r,Py(t)])):Array.isArray(e)?e.map(Py):e;var Fp;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(Fp||(Fp={}));var DB=e=>({next(){for(let t of e){let o=t.next();if(!o.done)return o}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),kB=(...e)=>{let r=new Map;for(let t of DB(e)){if(!t.$id)continue;let o=r.get(t.$id);if(o!=null&&o!==t)return re({kind:Fp.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:t});r.set(t.$id,t)}return ee(r)},br,Ep,Ro,Lr,X2=class X2{constructor(r,t,o,n){S(this,br);S(this,Ep);S(this,Ro,[]);S(this,Lr);w(this,br,r),w(this,Ep,t),w(this,Ro,o),w(this,Lr,n),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(r,t="CoreMVF",o=!1){let n=h.Composite(r.extensions.map(a=>a.schema),{$id:t});if(!E.IsSchema(n))return re({kind:Fp.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let i=kB(p2.values(),d2.values(),l2.values(),V2.values(),Y2.values(),H2.values(),r.extensions.flatMap(a=>a.references??[]).values());if(!i.isOk())return i;try{wT();let a=o?null:Cy.Compile(n,[...i.value.values()]);return ee(new X2(n,a,r.extensions,i.value))}catch(a){return a instanceof de?re({kind:Fp.TypeboxError,message:a.message,original:a}):re({kind:Fp.UnknownError,message:"An unknown error occurred while compiling the schema",original:a})}}is(r){return s(this,Ep)?.Check(r)??En.Check(s(this,br),[...s(this,Lr).values()],r)}parse(r){return this.is(r)?ee(r):re(s(this,Ep)?.Errors(r)??En.Errors(s(this,br),[...s(this,Lr).values()],r))}decode(r){try{return ee(ST(s(this,br),[...s(this,Lr).values()],r))}catch(t){return re(t)}}encode(r){try{return ee(CT(s(this,br),[...s(this,Lr).values()],r))}catch(t){return re(t)}}verify(r){for(let t of s(this,Ro))if(t.integrityCheck){let o=t.integrityCheck(r);if(o.isErr())return re(o.error)}return ee(!0)}jsonSchema(){let r=JSON.parse(JSON.stringify([s(this,br),...s(this,Lr).values()])),t=Oy(Py({$id:`#/definitions/${s(this,br).$id??"CoreMVF"}`,$schema:"http://json-schema.org/draft-07/schema#",references:r}));return JSON.stringify(t,null,2)}async compress(r){return this.encode(r).andThen(t=>this.parse(t)).andThenAsync(t=>$2(t,s(this,Ro))).then(t=>t.mapErr(o=>lm(s(this,br).$id??"CoreMVF",o,[...s(this,Lr).values()])))}async compressUnsafe(r){return this.encode(r).andThenAsync(t=>$2(t,s(this,Ro))).then(t=>t.mapErr(o=>lm(s(this,br).$id??"CoreMVF",o,[...s(this,Lr).values()])))}compressSync(r){return this.encode(r).andThen(t=>this.parse(t)).andThen(t=>W2(t,s(this,Ro))).mapErr(t=>lm(s(this,br).$id??"CoreMVF",t,[...s(this,Lr).values()]))}compressUnsafeSync(r){return this.encode(r).andThen(t=>W2(t,s(this,Ro))).mapErr(t=>lm(s(this,br).$id??"CoreMVF",t,[...s(this,Lr).values()]))}async decompress(r){return z2(r,s(this,Ro)).then(t=>t.andThen(o=>this.parse(o)).andThen(o=>this.decode(o)).mapErr(o=>cm(s(this,br).$id??"CoreMVF",o,[...s(this,Lr).values()])))}async decompressUnsafe(r){return z2(r,s(this,Ro)).then(t=>t.andThen(o=>this.decode(o)).mapErr(o=>cm(s(this,br).$id??"CoreMVF",o,[...s(this,Lr).values()])))}decompressSync(r){return Z2(r,s(this,Ro)).andThen(t=>this.parse(t)).andThen(t=>this.decode(t)).mapErr(t=>cm(s(this,br).$id??"CoreMVF",t,[...s(this,Lr).values()]))}decompressUnsafeSync(r){return Z2(r,s(this,Ro)).andThen(t=>this.decode(t)).mapErr(t=>cm(s(this,br).$id??"CoreMVF",t,[...s(this,Lr).values()]))}};br=new WeakMap,Ep=new WeakMap,Ro=new WeakMap,Lr=new WeakMap;var Fy=X2;var Dp,Ey=class{constructor(){S(this,Dp,[]);this.extend=this.extend.bind(this)}extend(r){return s(this,Dp).push(r),this}extendOptional(r){let t={...r,schema:h.Partial(r.schema)};return s(this,Dp).push(t),this}build(r){return Fy.create(this,void 0,r?.cspSafe)}get extensions(){return s(this,Dp)}};Dp=new WeakMap;d();d();d();d();var kp=h.Object({geometryId:h.Ref(Ur),floorId:h.Ref(Ae)},{$id:"GeometryAnchor"}),LB=h.Object({geometryAnchor:h.Ref(kp)}),pm=(e,r)=>h.Object({geometryAnchors:h.Array(h.Ref(kp),e)},r),Y2=[kp];d();d();d();var kT=(e,r)=>h.Unsafe(h.Transform(h.String(r)).Decode(t=>e.includes(t)?t:"unknown").Encode(t=>t)),yo=(e,r)=>{let t=kT(e,r),o=[...e,"unknown"],n=Object.freeze(Object.fromEntries([...e,"unknown"].map(i=>[i,i])));return{schema:t,values:o,record:n}};var LT=()=>new Ey().extend(uT).extend(yT).extend(IT);d();d();d();d();d();d();var dm;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(dm||(dm={}));var AT=e=>{if(e.annotations==null)return ee(!0);let r=zt(e.annotations,n=>n.id,"annotations");if(r.isErr())return r;let t=sr(e),o=new Set(je(e.annotationSymbols??{}));for(let n of je(e.annotations)){let i=e.annotations[n];if(i!=null)for(let a of i){if(!o.has(a.symbolKey))return re({kind:dm.AnnotationUnknownSymbolError,properties:{annotationId:a.id,symbolKey:a.symbolKey}});let l=t(n,a.geometryId);if(l.isErr())return l;if(l.value.geometry.type!=="Point")return re({kind:dm.AnnotationNonPointGeometryError,properties:{annotationId:a.id,floorId:n,geometryId:a.geometryId}})}}return ee(!0)};var RT=Wt("a","AnnotationId"),J2=h.Intersect([rn,h.Object({id:h.Ref(RT,{description:"The unique identifier for the annotation."}),externalId:h.Optional(h.String({description:"The external identifier for the annotation."})),symbolKey:h.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),_T=h.Object({url:h.String({format:"uri",description:"The URL for the symbol."}),name:h.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),AB=h.Object({annotations:Zt(h.Record(Ae,h.Array(h.Ref(J2)),{additionalProperties:!1})),annotationSymbols:Zt(h.Record(h.Index(J2,["symbolKey"]),h.Ref(_T)))},{$id:"AnnotationsSchema"}),RB=/^annotations\/(.*)\.json$/,BT={name:"ext:mvf-annotations",schema:AB,intoBundle:function*(e){if(e.annotations!=null)for(let r of je(e.annotations))yield{path:`annotations/${r}.json`,contents:e.annotations[r]};e.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:e.annotationSymbols})},fromBundle:(e,r,t)=>{if(e==="annotation-symbols.json")return{annotationSymbols:t(r)};let o=e.match(RB)?.[1];if(o)return{annotations:{[o]:t(r)}}},references:[RT,J2,_T],integrityCheck:AT};d();d();d();var Ts=Wt("lcat","LocationCategoryId"),K2=h.Intersect([h.Object({id:h.Ref(Ts),parent:h.Optional(h.Ref(Ts))}),xl(["name"]),Ln],{$id:"LocationCategory"}),NT=[Ts,K2];d();d();var wl;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(wl||(wl={}));var jT=e=>{if(e.locationCategories==null&&e.locations==null)return ee(!0);if(e.locationCategories!=null){let n=zt(e.locationCategories,i=>i.id,"locationCategories");if(n.isErr())return n}if(e.locations!=null){let n=zt(e.locations,i=>i.id,"locations");if(n.isErr())return n}if(e.locationInstances!=null){let n=zt(e.locationInstances,i=>i.id,"locationInstances");if(n.isErr())return n}let r=new Set(e.locationCategories?.map(n=>n.id)??[]);for(let n of e.locationCategories??[])if(n.parent!=null&&!r.has(n.parent))return re({kind:wl.UnknownParentCategoryError,properties:{categoryId:n.id,parentCategoryId:n.parent}});let t=sr(e);for(let n of e.locations??[]){for(let i of n.categories)if(!r.has(i))return re({kind:wl.UnknownCategoryError,properties:{locationId:n.id,categoryId:i}});for(let i of n.geometryAnchors){let a=t(i.floorId,i.geometryId);if(a.isErr())return a}}let o=new Set(e.locations?.map(n=>n.id)??[]);for(let n of e.locationInstances??[]){if(!o.has(n.parentId))return re({kind:wl.UnknownParentLocationError,properties:{locationInstanceId:n.id,parentLocationId:n.parentId}});for(let i of n.categories??[])if(!r.has(i))return re({kind:wl.UnknownCategoryError,properties:{locationId:n.id,categoryId:i}});for(let i of n.geometryAnchors??[]){let a=t(i.floorId,i.geometryId);if(a.isErr())return a}}return ee(!0)};d();var Ms=Wt("loc","LocationId"),Dy=Wt("loci","LocationInstanceId"),GT=h.Object({name:h.String(),url:h.String({format:"uri"})},{$id:"LocationSocial"}),UT=h.Object({url:h.String({format:"uri"})},{$id:"LocationImage"}),Q2=h.Object({label:h.String(),url:h.String({format:"uri"})},{$id:"LocationLink"}),q2=h.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),VT=h.Union([h.Literal("Sunday"),h.Literal("Monday"),h.Literal("Tuesday"),h.Literal("Wednesday"),h.Literal("Thursday"),h.Literal("Friday"),h.Literal("Saturday")],{$id:"OpeningHoursDay"}),_B="PublicHolidays",ex=h.Union([VT,h.Literal(_B)],{$id:"OpeningHoursDayOrPublicHoliday"}),ky=h.Object({"@type":h.Optional(h.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:h.Optional(h.Ref(q2,{description:"The time the opening hours start"})),closes:h.Optional(h.Ref(q2,{description:"The time the opening hours end"})),dayOfWeek:h.Optional(h.Union([h.Ref(ex),h.Array(h.Ref(ex))],{description:"The days of the week the opening hours apply to"})),validFrom:h.Optional(h.String({format:"date",description:"The date the opening hours start, in ISO 8601 format"})),validTo:h.Optional(h.String({format:"date",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),Ly=h.Intersect([h.Object({id:h.Ref(Ms),categories:h.Array(h.Ref(Ts)),logo:h.Optional(h.String({format:"uri"})),phone:h.Optional(h.String()),social:h.Array(h.Ref(GT)),images:h.Array(h.Ref(UT)),links:h.Array(h.Ref(Q2)),website:h.Optional(h.Ref(Q2)),openingHours:h.Optional(h.Array(h.Ref(ky)))}),xl(["name"]),pm(),Ln],{$id:"Location"}),tx=h.Intersect([h.Object({id:h.Ref(Dy),parentId:h.Ref(Ms)}),h.Partial(h.Omit(Ly,["id","parentId","details"])),Fo],{$id:"LocationInstance",description:"A location instance is a particular instance of an location that has some properties different from the parent."}),Ay=[Ms,Dy,GT,UT,Q2,q2,VT,ex,ky,Ly,tx];var BB=h.Object({locations:h.Array(h.Ref(Ly)),locationCategories:h.Array(h.Ref(K2)),locationInstances:h.Optional(h.Array(h.Ref(tx)))},{$id:"LocationsExtensionSchema"}),HT="locations.json",$T="location-categories.json",WT="location-instances.json",zT={name:"ext:locations",schema:BB,intoBundle:function*(e){e.locations!=null&&(yield{path:HT,contents:e.locations}),e.locationCategories!=null&&(yield{path:$T,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:WT,contents:e.locationInstances})},fromBundle:(e,r,t)=>{if(e===HT)return{locations:t(r)};if(e===$T)return{locationCategories:t(r)};if(e===WT)return{locationInstances:t(r)}},references:[...NT,...Ay],integrityCheck:jT};d();d();var An;(function(e){e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling",e.EnterpriseVenueWithUnknownTopLocationError="EnterpriseVenueWithUnknownTopLocationError",e.EnterpriseLocationWithInvalidPrimaryCategory="EnterpriseLocationWithInvalidPrimaryCategory"})(An||(An={}));var ZT=e=>{if(e.cms==null)return ee(!0);let r=e.cms,t=zt(e.cms.categories,g=>g.id,"cms.categories");if(t.isErr())return t;let o=new Set(e.locationCategories?.map(g=>g.id)??[]);for(let g of r.categories??[])if(!o.has(g.categoryId))return re({kind:An.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:g.id,locationCategoryId:g.categoryId}});let n=zt(e.cms.locations,g=>g.id,"cms.locations");if(n.isErr())return n;let i=new Map(e.locations?.map(g=>[g.id,g])??[]);for(let g of r.locations??[]){if(!i.has(g.locationId))return re({kind:An.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:g.id,locationId:g.locationId}});for(let b of g.siblingGroups??[])for(let x of b.siblings??[])if(!i.has(x))return re({kind:An.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:g.id,siblingLocationId:x,label:b.label}});if(g.primaryCategory!=null){let b=i.get(g.locationId);if(b!=null&&!b.categories.includes(g.primaryCategory))return re({kind:An.EnterpriseLocationWithInvalidPrimaryCategory,properties:{enterpriseLocationId:g.id,locationId:g.locationId,primaryCategory:g.primaryCategory}})}}if(r.venue?.topLocations!=null){for(let g of r.venue.topLocations)if(!i.has(g))return re({kind:An.EnterpriseVenueWithUnknownTopLocationError,properties:{locationId:g}})}let a=new Set(e.cms.locations?.map(g=>g.id)??[]),l=zt(e.cms.locationInstances,g=>g.id,"cms.locationInstances");if(l.isErr())return l;let c=new Set(e.locationInstances?.map(g=>g.id)??[]);for(let g of r.locationInstances??[]){if(!a.has(g.parentId))return re({kind:An.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:g.id,enterpriseLocationId:g.parentId}});if(!c.has(g.locationInstanceId))return re({kind:An.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:g.id,locationInstanceId:g.locationInstanceId}});for(let b of g.siblingGroups??[])for(let x of b.siblings??[])if(!i.has(x))return re({kind:An.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:g.id,siblingLocationId:x,label:b.label}})}let p=kn(e),m=sr(e),f=zt(e.cms.floorText,g=>g.properties.id,"cms.floorText");if(f.isErr())return f;for(let[g,b]of ze(r.floorText??{})){let x=p(g);if(x.isErr())return x;for(let C of b.features){if(!("geometryId"in C.properties))continue;let v=m(g,C.properties.geometryId);if(v.isErr())return v}}for(let[g,b]of ze(r.textures??{})){let x=p(g);if(x.isErr())return x;for(let C of b){let v=m(g,C.geometryId);if(v.isErr())return v}}for(let[g,b]of ze(r.layers??{})){let x=p(g);if(x.isErr())return x;for(let C of je(b??{})){let v=m(g,C);if(v.isErr())return v}}for(let[g,b]of ze(r.textAreas??{})){let x=p(g);if(x.isErr())return x;for(let C of b.features)if("geometryId"in C.properties){let v=m(g,C.properties.geometryId);if(v.isErr())return v}}return ee(!0)};d();d();var um=Wt("el","EnterpriseLocationId"),rx=Wt("ec","EnterpriseCategoryId"),ox=Wt("eli","EnterpriseLocationInstanceId"),nx=Wt("ev","EnterpriseVenueId"),ix=Wt("eft","EnterpriseFloorTextId"),XT=[um,rx,ox,nx,ix];var YT=h.Object({id:h.Ref(rx),categoryId:h.Ref(Ts),color:h.Optional(h.String()),sortOrder:h.Number(),iconFromDefaultList:h.Optional(h.Union([h.String(),h.Null()])),picture:h.Optional(h.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),sx=h.Object({categories:h.Optional(h.Array(h.Ref(YT)))},{$id:"EnterpriseCategoriesSchema"}),JT=[YT,sx];d();var KT=yo(["left","center","right"]),NB=KT.schema,Bde=KT.values,ax=h.Object({id:h.Ref(ix),text:h.String(),visible:h.Boolean({default:!0}),fontSize:h.Number({default:12,exclusiveMinimum:0}),fontFamily:h.String({default:"Droid Sans"}),color:h.String({default:"black"}),rotation:h.Number({minimum:0,maximum:360}),align:NB},{$id:"FloorTextCommonProperties"}),lx=h.Intersect([h.Ref(ax),rn],{$id:"AnchoredFloorTextProperties"}),cx=h.Intersect([h.Ref(ax),h.Object({verticalOffset:h.Number()})],{$id:"FloatingFloorTextProperties"}),QT=h.Union([h.Ref(lx),h.Ref(cx)],{$id:"FloorTextProperties"}),qT=Pr(Gr,h.Ref(QT),{$id:"FloorTextFeature"}),jB=Pr(Gr,h.Ref(lx),{$id:"AnchoredFloorTextFeature"}),GB=Pr(Gr,h.Ref(cx),{$id:"FloatingFloorTextFeature"}),eM=Qr(h.Ref(qT),{$id:"EnterpriseFloorTextFeatureCollection"}),tM=h.Record(Ae,h.Ref(eM),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),px=h.Object({floorText:h.Optional(h.Ref(tM))},{$id:"EnterpriseFloorTextSchema"}),rM=[ax,lx,cx,QT,qT,jB,GB,eM,tM,px];d();var oM=Zt(h.Record(Ur,h.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),nM=Zt(h.Record(Ae,h.Ref(oM),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),dx=h.Object({layers:h.Optional(h.Ref(nM))},{$id:"EnterpriseLayersSchema"}),iM=[oM,nM,dx];d();d();d();var ux=yo(["closed-temporarily","new","pop-up","coming-soon","relocated"]),UB=ux.schema,Xde=ux.values,Yde=ux.record,mx=h.Object({type:UB,start:h.Optional(h.String({format:"date",description:"The start date of the state"})),end:h.Optional(h.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),fx=h.Object({label:h.String(),siblings:h.Array(h.Ref(Ms))},{$id:"SiblingGroup"}),Ry=h.Object({name:h.String(),code:h.String()},{$id:"Language"}),sM=[mx,fx,Ry];var _y=h.Object({id:h.Ref(um),locationId:h.Ref(Ms),cmsId:h.String(),type:h.String(),sortOrder:h.Number(),tags:h.Optional(h.Array(h.String())),picture:h.Optional(h.String({format:"uri",description:"The picture of the location"})),states:h.Optional(h.Array(h.Ref(mx),{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:h.Optional(h.Array(h.Ref(fx))),gallery:h.Optional(h.Array(h.Object({caption:h.Optional(h.String()),image:h.String({format:"uri"}),embeddedUrl:h.Optional(h.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:h.Optional(h.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:h.Optional(h.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:h.Optional(h.Boolean({description:"Whether to show the logo of the location"})),primaryCategory:h.Optional(h.Ref(Ts))},{$id:"EnterpriseLocation"}),hx=h.Object({locations:h.Optional(h.Array(h.Ref(_y)))},{$id:"EnterpriseLocationsSchema"}),aM=[_y,hx];var lM=h.Intersect([h.Object({id:h.Ref(ox),parentId:h.Ref(um),locationInstanceId:h.Ref(Dy)}),h.Partial(h.Omit(_y,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),gx=h.Object({locationInstances:h.Optional(h.Array(h.Ref(lM)))},{$id:"EnterpriseLocationInstancesSchema"}),cM=[lM,gx];d();var yx=yo(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),pM=yx.schema,fue=yx.values,hue=yx.record,bx=h.Object({maxWidth:h.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:h.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:h.Ref(pM),rotation:h.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),dM=h.Intersect([h.Ref(bx),rn],{$id:"EnterpriseAnchoredTextAreaProperties"}),uM=h.Intersect([h.Ref(bx),h.Object({verticalOffset:h.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),mM=h.Union([dM,uM],{$id:"EnterpriseTextAreaProperties"}),fM=Pr(h.Ref(Gr),mM,{$id:"EnterpriseTextAreaFeature"}),hM=Qr(h.Ref(fM),{$id:"EnterpriseTextAreaCollection"}),gM=h.Record(Ae,h.Ref(hM),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),yM=h.Object({textAreas:h.Optional(h.Ref(gM))},{$id:"EnterpriseTextAreasSchema"}),bM=[pM,bx,dM,uM,mM,fM,hM,gM];d();var xx=h.Object({u:h.Number(),v:h.Number()},{$id:"EnterpriseTextureUV"}),vx=yo(["top","side"],{$id:"EnterpriseTextureFace"}),xM=vx.schema,vue=vx.values,Iue=vx.record,Ix=yo(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),vM=Ix.schema,Sue=Ix.values,Cue=Ix.record,IM=h.Tuple([ap,lp,ap,lp],{$id:"EnterpriseTextureBounds"}),SM=h.Intersect([h.Object({repeat:h.Ref(xx),offset:h.Ref(xx),rotation:h.Number({minimum:0,maximum:360}),path:h.String({format:"uri"}),face:h.Ref(xM),surface:h.Ref(vM),bounds:h.Ref(IM)},{$id:"EnterpriseTextureProperties"}),rn],{$id:"EnterpriseTexture"}),CM=h.Array(h.Ref(SM),{$id:"EnterpriseTextures"}),TM=h.Record(Ae,h.Ref(CM),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),Sx=h.Object({textures:h.Optional(h.Ref(TM))},{$id:"EnterpriseTexturesSchema"}),MM=[SM,CM,Sx,xx,xM,vM,IM,TM];d();var wM=h.Intersect([h.Object({id:h.Ref(nx),slug:h.String(),defaultLanguage:h.Ref(Ry),languages:h.Array(h.Ref(Ry)),countrycode:h.Optional(h.String()),logo:h.Optional(h.String({format:"uri"})),mappedinWebUrl:h.Optional(h.String({format:"uri"})),topLocations:h.Optional(h.Array(h.Ref(Ms))),operationHours:h.Optional(h.Array(h.Ref(ky))),coverImage:h.Optional(h.String({format:"uri"}))}),xl(["name"]),Ln],{$id:"EnterpriseVenue"}),Cx=h.Object({venue:h.Optional(h.Ref(wM))},{$id:"EnterpriseVenueSchema"}),OM=[wM,Cx];var FM=h.Intersect([Cx,hx,gx,sx,Sx,px,dx,yM],{$id:"CMSProperties"}),PM=h.Object({cms:h.Optional(h.Ref(FM))},{$id:"CMSExtensionSchema"}),VB=/^cms\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,EM={name:"ext:cms",schema:PM,intoBundle:function*(e){if(e.cms==null)return;let r=e.cms;for(let t of je(r))switch(t){case"floorText":for(let o of je(r.floorText??{}))yield{path:`cms/floorText/${o}.geojson`,contents:(r.floorText??{})[o]};continue;case"textures":for(let o of je(r.textures??{}))yield{path:`cms/textures/${o}.json`,contents:(r.textures??{})[o]};continue;case"textAreas":for(let o of je(r.textAreas??{}))yield{path:`cms/textAreas/${o}.geojson`,contents:(r.textAreas??{})[o]};continue;default:yield{path:`cms/${t}.json`,contents:r[t]};continue}},fromBundle:(e,r,t)=>{let o=e.match(VB);if(!o)return;let[,n,i]=o,a=t(r);switch(n){case"floorText":case"textures":case"textAreas":return{cms:{[n]:{[i]:a}}};default:return{cms:{[i]:a}}}},references:[FM,PM,...OM,...aM,...cM,...JT,...MM,...iM,...rM,...bM,...XT,...sM,...Ay],integrityCheck:ZT};d();d();d();d();var Rn;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Rn||(Rn={}));var DM=e=>{let{navigationFlags:r}=e;if(!r||Object.keys(r).length===0)return ee(!0);let t=Object.entries(r).map(([i,a])=>({key:i,...a})).sort((i,a)=>i.index!==a.index?i.index-a.index:i.bit-a.bit),o=0,n=-1;for(let i of t){if(i.bit===n)return re({kind:Rn.NavigationFlagDuplicateBit,properties:{index:i.index,bit:i.bit,path:`navigationFlags.${i.key}`}});if(i.index!=o){if(n!=31)return re({kind:Rn.NavigationFlagMissingDeclaration,properties:{index:o,bit:n+1,path:"navigationFlags"}});if(i.index!=o+1||i.bit!=0)return re({kind:Rn.NavigationFlagMissingDeclaration,properties:{index:o+1,bit:0,path:"navigationFlags"}});o=i.index,n=0}else{if(i.bit!==n+1)return re({kind:Rn.NavigationFlagMissingDeclaration,properties:{index:i.index,bit:n+1,path:"navigationFlags"}});n=i.bit}}return ee(!0)};d();function Ca(e,r){return r&&(e.flags[r.index]&1<<r.bit)!==0}d();var kM=2**32-1,mm=e=>{let r=Object.keys(e.navigationFlags??{}).length;if(r===0)return{index:-1,flag:0};let t=Math.floor(r/32),o=r%32;return{index:t,flag:2**o-1}},Lp=(e,r,t)=>{if(r.index==-1&&e.length===0)return ee(!0);let o=r.flag>0||r.index===-1?r.index+1:r.index;if(e.length!==o)return re({kind:Rn.NavigationFlagIncorrectFlagsLength,properties:{expected:o,actual:e.length,path:t}});for(let n=0;n<e.length;n++){let i=e[n];if(n<r.index){if(i>kM)return re({kind:Rn.NavigationFlagValueTooBig,properties:{index:n,flagValue:i,expectedMaxFlagValue:kM,path:t}});continue}else if(i>r.flag)return re({kind:Rn.NavigationFlagValueTooBig,properties:{index:n,flagValue:i,expectedMaxFlagValue:r.flag,path:t}})}return ee(!0)};var HB=h.Object({index:h.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:h.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),LM=h.Intersect([HB,Fo],{$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.'}),Tx={accessible:"accessible",outdoors:"outdoors"},AM=h.Record(h.String(),LM,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),$B=h.Object({navigationFlags:h.Ref(AM)},{$id:"NavigationFlagsSchema"}),By=h.Array(h.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),Mx=h.Object({flags:h.Ref(By)},{$id:"WithFlags"}),Ol=h.Intersect([kp,Mx],{$id:"FlaggedGeometryAnchor"}),WB=h.Object({geometryAnchor:Ol},{$id:"WithFlaggedGeometryAnchor"}),zB=h.Object({geometryAnchors:h.Array(Ol)},{$id:"WithFlaggedGeometryAnchors"}),RM={name:"ext:mvf-navigation-flags",schema:$B,intoBundle:function*(e){e.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:e.navigationFlags})},fromBundle:(e,r,t)=>e!=="navigationFlags.json"?void 0:{navigationFlags:t(r)},references:[LM,AM,By,Ol,WB,zB],integrityCheck:DM};d();var _M=e=>{if(e.connections==null)return ee(!0);let r=zt(e.connections,n=>n.id,"connections");if(r.isErr())return r;let t=sr(e),o=mm(e);for(let[n,i]of e.connections.entries()){for(let[a,l]of i.entrances.entries()){let c=t(l.floorId,l.geometryId);if(c.isErr())return c;let p=Lp(l.flags,o,`connections[${n}].entrances[${a}]`);if(p.isErr())return p}for(let[a,l]of i.exits.entries()){let c=t(l.floorId,l.geometryId);if(c.isErr())return c;let p=Lp(l.flags,o,`connections[${n}].exits[${a}]`);if(p.isErr())return p}}return ee(!0)};var NM=Wt("c","ConnectionId"),{schema:ZB,values:Mme,record:XB}=yo(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),jM=ZB;var wx=XB,GM=h.Intersect([h.Object({id:h.Ref(NM,{description:"The unique identifier for the connection."}),entrances:h.Array(h.Ref(Ol)),exits:h.Array(h.Ref(Ol)),entryCost:h.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:h.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:h.Ref(jM,{description:"The type of connection."})}),Fo,Ln],{$id:"ConnectionsProperties"}),UM=h.Array(h.Ref(GM),{$id:"ConnectionsCollection"}),YB=h.Object({connections:h.Ref(UM)},{$id:"ConnectionsExtensionSchema"}),BM="connections.json",VM={name:"ext:connections",schema:YB,intoBundle:function*(e){e.connections!=null&&(yield{path:BM,contents:e.connections})},fromBundle:(e,r,t)=>{if(e===BM)return{connections:t(r)}},references:[GM,UM,jM,NM,Ol,By],integrityCheck:_M};d();d();var HM=e=>{if(e.defaultStyle==null)return ee(!0);let r=sr(e);for(let t of Object.values(e.defaultStyle))if(t!=null)for(let o of t.geometryAnchors){let n=r(o.floorId,o.geometryId);if(n.isErr())return n}return ee(!0)};var $M=h.Intersect([pm(),Ln,h.Object({altitude:h.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:h.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:h.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:h.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:h.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:h.Optional(h.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),WM=h.Record(h.String(),h.Ref($M),{$id:"DefaultStyleCollection",additionalProperties:!1}),JB=h.Object({defaultStyle:h.Ref(WM)},{$id:"DefaultStyleSchema"}),zM={name:"ext:mvf-default-style",schema:JB,intoBundle:function*(e){e.defaultStyle!=null&&(yield{path:"default-style.json",contents:e.defaultStyle})},fromBundle:(e,r,t)=>{if(e==="default-style.json")return{defaultStyle:t(r)}},references:[$M,WM],integrityCheck:HM};d();d();d();d();var Ny;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(Ny||(Ny={}));var ZM=e=>{if(e.floorStacks==null)return ee(!0);let r=zt(e.floorStacks,o=>o.id,"floorStacks");if(r.isErr())return r;let t=kn(e);for(let o of e.floorStacks){for(let n of o.floors){let i=t(n);if(i.isErr())return i}if(o.defaultFloor!=null&&!o.floors.includes(o.defaultFloor))return re({kind:Ny.InvalidDefaultFloorError,properties:{floorStackId:o.id,floorId:o.defaultFloor}})}return ee(!0)};var fm=Wt("fs","FloorStackId"),YM=h.Intersect([h.Object({id:h.Ref(fm,{description:"The unique identifier for the floor stack."}),floors:h.Array(h.Ref(Ae),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:h.Optional(h.Ref(Ae,{description:"The default floor for the floor stack."}))}),Fo],{$id:"FloorStacksProperties"}),JM=h.Array(h.Ref(YM),{$id:"FloorStackCollection"}),KB=h.Object({floorStacks:h.Ref(JM)},{$id:"FloorStackExtensionSchema"}),XM="floor-stacks.json",KM={name:"ext:floor-stacks",schema:KB,intoBundle:function*(e){e.floorStacks!=null&&(yield{path:XM,contents:e.floorStacks})},fromBundle:(e,r,t)=>{if(e===XM)return{floorStacks:t(r)}},references:[fm,YM,JM],integrityCheck:ZM};d();d();var hm;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(hm||(hm={}));var QM=e=>{if(e.facade==null)return ee(!0);if(e.floorStacks==null)return re({kind:hm.MissingFloorStackError,properties:null});let r=new Set(e.floorStacks.map(n=>n.id)),t=sr(e),o=kn(e);for(let[n,i]of ze(e.facade)){if(i==null)continue;let a=o(n);if(a.isErr())return a;for(let l of i){let{floorStackId:c,geometryIds:p}=l;if(!r.has(c))return re({kind:hm.UnknownFloorStackError,properties:{floorStackId:c}});for(let m of p){let f=t(n,m);if(f.isErr())return f}}}return ee(!0)};var qM=h.Intersect([h.Object({floorStackId:h.Ref(fm)}),Op],{$id:"Facade"}),QB=h.Object({facade:Zt(h.Record(Ae,h.Array(h.Ref(qM)),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),qB=/^facade\/(.*)\.json$/,e7={name:"ext:facade",schema:QB,intoBundle:function*(e){if(e.facade!=null)for(let r of je(e.facade))yield{path:`facade/${r}.json`,contents:e.facade[r]}},fromBundle:(e,r,t)=>{let o=e.match(qB)?.[1];if(o)return{facade:{[o]:t(r)}}},references:[fm,qM],integrityCheck:QM};d();d();var t7=e=>{if(e.floorImages==null)return ee(!0);let r=sr(e);for(let[t,o]of ze(e.floorImages))if(o!=null)for(let n of o.features){if(!("geometryId"in n.properties))continue;let i=n.properties.geometryId,a=r(t,i);if(a.isErr())return a}return ee(!0)};var Ox=h.Object({path:h.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:h.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:h.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:h.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),r7=h.Intersect([h.Ref(Ox),rn],{$id:"AnchoredFloorImageProperties"}),o7=h.Intersect([h.Ref(Ox),h.Object({verticalOffset:h.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),n7=h.Union([r7,o7],{$id:"FloorImageProperties"}),i7=Pr(h.Ref(Gr),n7,{$id:"FloorImageFeature"}),s7=Qr(h.Ref(i7),{$id:"FloorImageCollection"}),eN=h.Object({floorImages:Zt(h.Record(Ae,h.Ref(s7),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),tN=/^floorImages\/(.*)\.geojson$/,a7={name:"ext:floor-images",schema:eN,intoBundle:function*(e){if(e.floorImages!=null)for(let r of je(e.floorImages))yield{path:`floorImages/${r}.geojson`,contents:e.floorImages[r]}},fromBundle:(e,r,t)=>{let o=e.match(tN)?.[1];if(o)return{floorImages:{[o]:t(r)}}},references:[Ox,r7,o7,n7,i7,s7],integrityCheck:t7};d();d();var l7=e=>{if(e.kinds==null)return ee(!0);let r=sr(e);for(let[t,o]of ze(e.kinds))if(o!=null)for(let n of je(o)){let i=r(t,n);if(i.isErr())return i}return ee(!0)};var{values:Bfe,schema:rN,record:Nfe}=yo(["room","hallway","wall","object","poi","area","window"],{$id:"Kind"}),c7=rN;var p7=Zt(h.Record(Ur,h.Ref(c7),{additionalProperties:!1,$id:"GeometryKinds"})),oN=h.Object({kinds:Zt(h.Record(Ae,h.Ref(p7),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),nN=/^kinds\/(.*)\.json$/,d7={name:"ext:kinds",schema:oN,intoBundle:function*(e){if(e.kinds!=null)for(let r of je(e.kinds))yield{path:`kinds/${r}.json`,contents:e.kinds[r]}},fromBundle:(e,r,t)=>{let o=e.match(nN)?.[1];if(o)return{kinds:{[o]:t(r)}}},references:[c7,p7],integrityCheck:l7};d();d();d();var jy;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(jy||(jy={}));var u7=e=>{if(e.nodes==null)return ee(!0);let r=zt(e.nodes,n=>n.properties.id,"nodes");if(r.isErr())return r;let t=sr(e),o=mm(e);for(let[n,i]of ze(e.nodes)){if(i==null)continue;let a=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 m=t(n,p);if(m.isErr())return m}for(let[p,m]of c.properties.neighbors.entries()){if(!a.has(m.id))return re({kind:jy.UnknownNeighbor,properties:{floorId:n,nodeId:c.properties.id,neighborId:m.id}});let f=Lp(m.flags,o,`nodes["${n}"].features[${l}].properties.neighbors[${p}]`);if(f.isErr())return f}}}return ee(!0)};var Px=Wt("n","NodeId"),m7=h.Intersect([h.Object({id:h.Ref(Px,{description:"The unique identifier for the node."}),extraCost:h.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),Mx],{$id:"NodeNeighbor"}),f7=h.Intersect([h.Object({id:h.Ref(Px,{description:"The unique identifier for the node."}),neighbors:h.Array(h.Ref(m7),{description:"The neighbors of the node."})}),Op],{$id:"NodeProperties"}),h7=Pr(h.Ref(Gr),f7,{$id:"NodeFeature"}),g7=Qr(h.Ref(h7),{$id:"NodeCollection"}),iN=h.Object({nodes:Zt(h.Record(Ae,h.Ref(g7),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),sN=/^nodes\/(.*)\.json$/,y7={name:"ext:nodes",schema:iN,intoBundle:function*(e){if(e.nodes!=null)for(let r of je(e.nodes))yield{path:`nodes/${r}.json`,contents:e.nodes[r]}},fromBundle:(e,r,t)=>{let o=e.match(sN)?.[1];if(o)return{nodes:{[o]:t(r)}}},references:[Px,m7,f7,h7,g7],integrityCheck:u7};d();d();d();var Gy;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(Gy||(Gy={}));var b7=e=>{if(e.outdoors==null)return ee(!0);let r=kn(e);for(let t of e.outdoors.floors){let o=r(t);if(o.isErr())return o;if(e.floorStacks!=null){for(let n of e.floorStacks)if(n.floors.includes(t))return re({kind:Gy.FloorInFloorStackError,properties:{floorId:t,floorStackId:n.id}})}}return ee(!0)};var v7=h.Object({floors:h.Array(h.Ref(Ae),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),aN=h.Object({outdoors:h.Ref(v7)},{$id:"OutdoorsExtensionSchema"}),x7="outdoors.json",I7={name:"ext:outdoors",schema:aN,intoBundle:function*(e){e.outdoors!=null&&(yield{path:x7,contents:e.outdoors})},fromBundle:(e,r,t)=>{if(e===x7)return{outdoors:t(r)}},references:[v7],integrityCheck:b7};d();d();d();var Uy;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(Uy||(Uy={}));var S7=e=>{if(e.tileset==null)return ee(!0);let r=new Set;if(r.add(e.tileset.default.key),e.tileset.others)for(let t of e.tileset.others){if(r.has(t.key))return re({kind:Uy.TilesetDuplicateKeyError,properties:{key:t.key}});r.add(t.key)}return ee(!0)};var Fx=h.Object({key:h.String({minLength:1,description:"Unique identifier for the tileset style."}),name:h.String({minLength:1,description:"Display name of the tileset style."}),url:h.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),C7=h.Object({default:h.Ref(Fx,{description:"The default tileset style, which should be used."}),others:h.Optional(h.Array(h.Ref(Fx,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),lN=h.Object({tileset:h.Ref(C7)},{$id:"TilesetExtensionSchema"}),T7={name:"ext:mvf-tileset",schema:lN,intoBundle:function*(e){e.tileset!=null&&(yield{path:"tileset.json",contents:e.tileset})},fromBundle:(e,r,t)=>{if(e==="tileset.json")return{tileset:t(r)}},references:[Fx,C7],integrityCheck:S7};d();var M7=h.Object({},{$id:"WalkableProperties"}),w7=h.Object({},{$id:"NonWalkableProperties"}),O7=Zt(h.Record(Ur,h.Ref(M7),{$id:"WalkableGeometries",additionalProperties:!1})),P7=Zt(h.Record(Ur,h.Ref(w7),{$id:"NonWalkableGeometries",additionalProperties:!1})),cN=h.Object({walkable:Zt(h.Record(Ae,h.Ref(O7),{additionalProperties:!1})),nonwalkable:Zt(h.Record(Ae,h.Ref(P7),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),pN=/^walkable\/(.*)\.json$/,dN=/^nonwalkable\/(.*)\.json$/,F7={name:"ext:mvf-traversability",schema:cN,intoBundle:function*(e){if(e.walkable!=null)for(let r of je(e.walkable))yield{path:`walkable/${r}.json`,contents:e.walkable[r]};if(e.nonwalkable!=null)for(let r of je(e.nonwalkable))yield{path:`nonwalkable/${r}.json`,contents:e.nonwalkable[r]}},fromBundle:(e,r,t)=>{let o=e.match(pN)?.[1];if(o!=null)return{walkable:{[o]:t(r)}};let n=e.match(dN)?.[1];if(n!=null)return{nonwalkable:{[n]:t(r)}}},references:[M7,w7,O7,P7]};d();d();function E7(e){return e.replace(/^g_/,"s_")}function uN(e){return e.replace(/^g_/,"o_")}function mN(e){return e.replace(/^g_/,"w_")}function D7(e){return e.replace(/^loci_/,"eli_")}function ym(e){return e.replace(/^loc_/,"el_")}function Vy(e){return e.replace(/^lcat_/,"ec_")}function fN(e){return e.replace(/^g_/,"ar_")}function hN(e,r,t){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let o=[],n=0,i=e.geometry.type.replace("Multi","");for(let a of e.geometry.coordinates)o.push({...e,geometry:{type:i,coordinates:a},properties:{...e.properties,id:`${r}-${n++}`,kind:t}});return o}default:return[{...e,properties:{...e.properties,id:r,kind:t}}]}}function gm(e,r,t,o){let n=new Map;for(let{feature:i,floorId:a}of e){let l=i.properties.id,c=o.get(l);if(r.has(l)){let p=hN(i,t(l),c),m=p.map(g=>g.properties.id),f=m.map(g=>({geometryId:g,floorId:a}));n.set(l,{ids:m,features:p,anchors:f})}}return n}function k7(e){let r={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!e.geometry)return r;let t=new Map(Object.values(e.kinds??{}).filter(c=>c!==void 0).flatMap(ze)),o=ze(e.geometry).flatMap(([c,p])=>(p?.features??[]).map(m=>({feature:m,floorId:c}))).flat(),n=new Set(Object.values(e.walkable??{}).filter(c=>c!==void 0).flatMap(je)),i=new Set(Object.values(e.nonwalkable??{}).filter(c=>c!==void 0).flatMap(je)),a=new Set(Array.from(t.entries()).filter(([c,p])=>p==="area").map(([c])=>c)),l=new Set(Array.from(t.entries()).filter(([c,p])=>p==="window").map(([c])=>c));return n.size>0&&(r.space=gm(o,n,E7,t)),i.size>0&&(r.obstruction=gm(o,i,uN,t)),a.size>0&&(r.area=gm(o,a,fN,t)),l.size>0&&(r.window=gm(o,l,mN,t)),n.size===0&&i.size===0&&a.size===0&&(r.space=gm(o,new Set(o.map(c=>c.feature.properties.id)),E7,t)),r}function L7(e){let{nodesByGeometryId:r,incomingEdgesByNodeId:t}=gN(e),o=k7(e),n=yN(e),i=e.navigationFlags??{};return{geometryMaps:o,nodesByGeometryId:r,geometryFeatureById:n,navigationFlags:i,incomingEdgesByNodeId:t}}function gN(e){let r=new Map,t=new Map;for(let o of Object.values(e.nodes??{}))for(let n of o?.features??[]){if(n.properties.geometryIds.length>0)for(let i of n.properties.geometryIds){let a=r.get(i)??[];a.push(n.properties.id),r.set(i,a)}if(n.properties.neighbors.length>0)for(let i of n.properties.neighbors){let a=t.get(i.id);a!=null?a.push(i):t.set(i.id,[i])}}return{nodesByGeometryId:r,incomingEdgesByNodeId:t}}function yN(e){let r=new Map;for(let t of Object.values(e.geometry??{}))for(let o of t?.features??[])r.set(o.properties.id,o);return r}d();function A7(e,r){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let t={};for(let[o,n]of ze(e.annotations)){if(!n||n.length===0||!e.geometry[o]||e.geometry[o].features.length===0)continue;let i=new Map(e.geometry[o].features.map(l=>[l.properties.id,l])),a={type:"FeatureCollection",features:[]};for(let l of n){let c=i.get(l.geometryId);if(!c||c.geometry.type!=="Point")continue;let p={id:l.id,externalId:l.externalId,symbolId:l.symbolKey};a.features.push({type:"Feature",geometry:c.geometry,properties:p})}t[o]=a}return{annotation:t}}d();function R7(e,{nodesByGeometryId:r}){let t={"connection.json":[],entrance:{}},o=e.navigationFlags?.[Tx.accessible],n=e.navigationFlags?.[Tx.outdoors],i=new Map(Object.values(e.geometry??{}).flatMap(a=>a?.features??[]).map(a=>[a.properties.id,a]));for(let a of e.connections??[]){if(Ex(a,i)){let m=bN(a,i,r,n);for(let[f,g]of m)t.entrance[f]||(t.entrance[f]={type:"FeatureCollection",features:[]}),t.entrance[f].features.push(g);continue}let l=o!=null&&a.entrances.some(m=>Ca(m,o))&&a.exits.some(m=>Ca(m,o)),c=Array.from(new Set([...a.entrances.map(m=>r.get(m.geometryId)),...a.exits.map(m=>r.get(m.geometryId))].flat().filter(m=>m!=null))),p={id:a.id,externalId:a.details?.externalId??"",type:a.type,accessible:l,nodes:c};a.details?.name&&(p.details={name:a.details.name}),a.extra&&(p.extra=a.extra),t["connection.json"].push(p)}return t}function Ex(e,r){return e.type==wx.door&&e.entrances.every(t=>r.get(t.geometryId)?.geometry.type==="LineString")}function bN(e,r,t,o){if(e.type!==wx.door)return[];let n=[];for(let i of e.entrances){let a=r.get(i.geometryId);if(a?.geometry.type==="LineString"){let l={type:"Feature",geometry:a.geometry,properties:{id:e.id,externalId:e.details?.externalId??"",isExterior:xN(e,o)}},c=e.details;c&&(l.properties.details={name:c.name,description:c.description},c.icon&&(l.properties.details.images=[{url:c.icon,altText:`${c.name} icon`}]));let p=t.get(i.geometryId);p&&p.length>0&&(l.properties.node=p[0]),n.push([i.floorId,l])}}return n}function xN(e,r){return e.entrances.some(t=>Ca(t,r))||e.exits.some(t=>Ca(t,r))}d();function B7(e,{geometryMaps:r,nodesByGeometryId:t}){let o={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"English",code:"en"},languages:[]}},n=e.manifest?.features[0];n&&(o.venue.defaultFloor=n.properties.defaultFloor,o.venue.tzid=n.properties.tzid,o.venue.name=n.properties.name,o.venue.defaultLanguage={name:n.properties.language??"English",code:n.properties.language??"en"});let i=e.cms?.venue;i&&(o.venue={...o.venue,slug:i.slug,name:i.details?.name??o.venue.name??n.properties.name,externalId:i.details?.externalId??"",defaultLanguage:i.defaultLanguage,languages:i.languages??[],countrycode:i.countrycode,coverImage:i.coverImage,logo:i.logo,icon:i.details?.icon,extra:i.extra,mappedinWebUrl:i.mappedinWebUrl,operationHours:i.operationHours,topLocations:i.topLocations});let a=new Map,l=e.locations??[],c=e.cms?.locations??[],p=e.cms?.categories??[],m=new Map((p??[]).map(O=>[O.categoryId,O]));if(l.length>0){let O=new Map(c.map(T=>[T.locationId,T]));for(let T of l){let P=O.get(T.id)??{};if(T){let B=T.details,G={id:P?.cmsId!==void 0?`el_${P?.cmsId}`:ym(T.id),name:B.name,externalId:B.externalId??"",type:P.type??"location",sortOrder:P.sortOrder??0,amenity:P.amenity,description:B.description,extra:T.extra,links:T.links,operationHours:T.openingHours,gallery:P.gallery,logo:T.logo,shortName:B.shortName,picture:P.picture,showFloatingLabelWhenImagePresent:P.showFloatingLabelWhenImagePresent,showLogo:P.showLogo,siblingGroups:P.siblingGroups,states:P.states,tags:P.tags,spaces:[],nodes:[],polygons:[]};if(T.phone&&(G.phone={number:T.phone}),P.primaryCategory){let N=m.get(P.primaryCategory);N&&(G.primaryCategory=N.id)}let A=_7(T.social);T.website&&(A.website=T.website.url),G.social=A;for(let N of T.geometryAnchors){let z=r.space.get(N.geometryId);if(z){let oe=new Set(z.features.filter(J=>J.geometry.type==="Polygon").map(J=>J.properties.id));for(let J of z.anchors)G.spaces.push({floor:J.floorId,id:J.geometryId}),oe.has(J.geometryId)&&G.polygons.push({map:J.floorId,id:J.geometryId})}let Z=t.get(N.geometryId);for(let oe of Z??[])G.nodes.push({map:N.floorId,id:oe})}o.locations.push(G);for(let N of T.categories)a.set(N,[...a.get(N)??[],T.id])}}}let f=e.cms?.locationInstances??[],g=e.locationInstances;if(g){let O=new Map(f.map(P=>[P.locationInstanceId,P])),T=[];for(let P of g){let B=O.get(P.id)??{};if(P){let G={id:D7(P.id),parent:B.parentId??ym(P.parentId),name:P.details?.name,externalId:P.details?.externalId,type:B.type,sortOrder:B.sortOrder,amenity:B.amenity,description:P.details?.description,extra:P.extra,links:P.links,operationHours:P.openingHours,gallery:B.gallery,picture:B.picture,showFloatingLabelWhenImagePresent:B.showFloatingLabelWhenImagePresent,showLogo:B.showLogo,siblingGroups:B.siblingGroups,states:B.states,tags:B.tags,logo:P.logo,shortName:P.details?.shortName};P.phone&&(G.phone={number:P.phone});let A=_7(P.social??[]);if(P.website&&(A.website=P.website.url),Object.keys(A).length>0&&(G.social=A),P.geometryAnchors?.length){let N=P.geometryAnchors.flatMap(z=>r.space.get(z.geometryId)?.anchors??[]);N.length>0&&(G.spaces=N.map(z=>({floor:z.floorId,id:z.geometryId})))}if(P.geometryAnchors){G.spaces=[],G.polygons=[],G.nodes=[];for(let N of P.geometryAnchors){let z=r.space.get(N.geometryId);if(z){let oe=new Set(z.features.filter(J=>J.geometry.type==="Polygon").map(J=>J.properties.id));for(let J of z.anchors)G.spaces.push({floor:J.floorId,id:J.geometryId}),oe.has(J.geometryId)&&G.polygons.push({map:J.floorId,id:J.geometryId})}let Z=t.get(N.geometryId);for(let oe of Z??[])G.nodes.push({map:N.floorId,id:oe})}}T.push(G)}}T.length>0&&(o.locationInstances=T)}let b=e.locationCategories;if(b){let O=[],T=new Map(b.map(A=>[A.id,A])),P=new Map((p??[]).map(A=>[A.categoryId,A])),B=new Map;for(let A of b){let N=T.get(A.parent);if(N){let z=B.get(N.id)??[];z.push(A.id),B.set(N.id,z)}}for(let A of b){let N=P.get(A.id);if(A){let z=(B.get(A.id)??[]).map(Vy),Z={id:Vy(A.id),name:A.details.name,externalId:A.details.externalId??"",sortOrder:N?.sortOrder??0,children:z,locations:(a.get(A.id)??[]).map(ym),icon:A.details.icon,picture:N?.picture,color:N?.color,extra:A.extra,iconFromDefaultList:N?.iconFromDefaultList};O.push(Z)}}o.categories=O;let G={};for(let A of l)G[ym(A.id)]=A.categories.map(Vy).filter(N=>N!==void 0);o.categoryPriorities=G}let x={};for(let[O,T]of Object.entries(e.defaultStyle??{}))if(T.buffer){let P=T.geometryAnchors.flatMap(B=>r.space.get(B.geometryId)?.anchors??[]);x[O]={edgeOffset:T.buffer,geometryAnchors:P}}Object.keys(x).length>0&&(o.enterpriseStyles=x);let C=new Map;for(let O of Object.values(e.cms?.layers??{}))if(O)for(let[T,P]of ze(O)){if(typeof P!="string")continue;let B=C.get(P)??{name:P,id:`ely_${P}`,spaces:[]};B.spaces.push(...r.space.get(T)?.anchors.map(G=>({floorId:G.floorId,spaceId:G.geometryId}))??[]),C.set(P,B)}C.size>0&&(o.layers=Array.from(C.values()));let v=[];for(let O of Object.values(e.cms?.textures??{}))for(let T of O){let P=r.space.get(T.geometryId)?.anchors;!P||P.length<1||T.face==="unknown"||T.surface==="unknown"||v.push({repeat:T.repeat,offset:T.offset,rotation:T.rotation,path:T.path,face:T.face,surface:T.surface,bounds:T.bounds,geometryAnchors:P})}v.length>0&&(o.textures=v);let I={};for(let[O,T]of Object.entries(e.cms?.floorText??{})){let P={type:"FeatureCollection",features:[]};for(let B of T.features){if(B.properties.align==="unknown")continue;let G={align:B.properties.align,color:B.properties.color,fontFamily:B.properties.fontFamily,fontSize:B.properties.fontSize,rotation:B.properties.rotation,text:B.properties.text,visible:B.properties.visible};"geometryId"in B.properties?G.geometryId=B.properties.geometryId:G.verticalOffset=B.properties.verticalOffset,P.features.push({type:"Feature",geometry:B.geometry,properties:G})}P.features.length>0&&(I[O]=P)}Object.keys(I).length>0&&(o.floorText=I);let M={enterprise:o};if(e.cms?.textAreas){let O={};for(let[T,P]of ze(e.cms.textAreas)){let B={type:"FeatureCollection",features:[]};for(let G of P.features){if(G.properties.align==="unknown")continue;let A={align:G.properties.align,maxWidth:G.properties.maxWidth,maxHeight:G.properties.maxHeight,rotation:G.properties.rotation};"geometryId"in G.properties?A.anchorId=G.properties.geometryId:A.verticalOffset=G.properties.verticalOffset;let N={type:"Feature",geometry:G.geometry,properties:A};B.features.push(N)}O[T]=B}M.textAreas=O}return M}var vN=["facebook","instagram","twitter"];function _7(e){let r={};for(let{name:t,url:o}of e){let n=t.toLowerCase();vN.includes(n)&&(r[n]=o)}return r}d();var IN=e=>`fc_${e.slice(3)}`;function N7(e,{geometryMaps:r}){if(!e.facade)return{};let t={},o={};for(let[n,i]of ze(e.facade))if(i)for(let a of Object.values(i)){let{floorStackId:l,geometryIds:c}=a,p=IN(l);o[l]??(o[l]={id:p,spaces:[]}),o[l].spaces.push(...c.map(m=>({floorId:n,spaceId:r.space.get(m)?.ids[0]??""})))}return Object.keys(o).length>0&&(t.facade=o),t}d();function j7(e,r={}){let t={type:"FeatureCollection",features:[]},o=[];for(let n of e.floors.features)o.push({id:n.properties.id.replace(/^f_/,"m_"),externalId:n.properties.details?.externalId??"",elevation:n.properties.elevation,name:n.properties.details?.name??"",shortName:n.properties.details?.shortName??"",subtitle:n.properties.subtitle}),t.features.push({type:"Feature",geometry:n.geometry,properties:{id:n.properties.id,externalId:n.properties.details?.externalId??"",elevation:n.properties.elevation,name:n.properties.details?.name??"",shortName:n.properties.details?.shortName??"",subtitle:n.properties.subtitle}});return{"floor.geojson":t,"map.geojson":o}}d();function G7(e,{geometryMaps:r}){let t={},o={};for(let[n,i]of ze(e.floorImages??{})){let a={features:[],type:"FeatureCollection"};for(let l of i?.features??[])if("verticalOffset"in l.properties)a.features.push(l);else{let{geometryId:c,...p}=l.properties,m=r.space.get(c)?.ids[0]??r.obstruction.get(c)?.ids[0];if(!m)continue;let f={geometry:l.geometry,properties:{...p,anchorId:m},type:l.type};a.features.push(f)}o[n]=a}return Object.keys(o).length>0&&(t.floorImages=o),t}d();function U7(e,r={}){let t=[];for(let n of e?.floorStacks??[]){let i={id:n.id,floors:n.floors,maps:n.floors,externalId:n.details?.externalId??"",name:n.details?.name??"",shortName:n.details?.shortName??"",type:"Building"};n.defaultFloor&&(i.defaultFloor=n.defaultFloor),t.push(i)}if(e.outdoors){let n={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};t.push(n)}return{"floorstack.json":t,"mapstack.geojson":t}}d();d();var W7=Ec($7(),1),wN=e=>{let r=e.geometry.coordinates[0],t=0;for(let o=0;o<r.length-1;o++)t+=r[o][0]*r[o+1][1]-r[o+1][0]*r[o][1];return Math.abs(t/2)},ON=(e,r)=>{let[t,o]=e,n=r.geometry.coordinates[0],i=!1;for(let a=0,l=n.length-1;a<n.length;l=a++){let[c,p]=n[a],[m,f]=n[l];p>o!=f>o&&t<(m-c)*(o-p)/(f-p)+c&&(i=!i)}return i},PN=e=>{let r=e.geometry.coordinates[0],t=0,o=0;for(let n=0;n<r.length-1;n++)t+=r[n][0],o+=r[n][1];return{geometry:{coordinates:[t/(r.length-1),o/(r.length-1)]}}},FN=e=>{let r=wN(e),t=Number.isFinite(r)?Math.max(r,1):1;return Math.sqrt(t)*1e-6},$y=e=>{try{let t=PN(e).geometry.coordinates;if(!ON(t,e)){let n=(0,W7.default)(e.geometry.coordinates,FN(e));return ee([n[0],n[1]])}return ee(t)}catch{return re(new Error("Unable to calculate center of polygon"))}};function Ax(e){return e?.geometry?.type==="Polygon"}function z7(e,{geometryMaps:r,nodesByGeometryId:t}){let o=AN(e.defaultStyle),n={},i={},a={},l={};for(let p of je(e.geometry)){let m=e.geometry[p];if(!m)continue;let f=[],g=[],b=[],x=[];for(let C of m.features){let v=C.properties.id,I=o.has(v),M=t.get(v)??[];for(let O of r.space.get(v)?.features??[])f.push(EN(O,M));for(let O of r.obstruction.get(v)?.features??[])g.push(DN(O,I));for(let O of r.area.get(v)?.features??[])b.push(kN(O,M));for(let O of r.window.get(v)?.features??[])x.push(LN(O))}f.length>0&&(n[p]={type:"FeatureCollection",features:f.filter(C=>C!==null)}),g.length>0&&(i[p]={type:"FeatureCollection",features:g.filter(C=>C!==null)}),b.length>0&&(a[p]={type:"FeatureCollection",features:b.filter(C=>C!==null)}),x.length>0&&(l[p]={type:"FeatureCollection",features:x.filter(C=>C!==null)})}let c={space:n,obstruction:i};return Object.keys(a).length>0&&(c.area=a),Object.keys(l).length>0&&(c.window=l),c}function EN(e,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let t={type:"Feature",geometry:e.geometry,properties:{destinationNodes:r,id:e.properties.id,externalId:e.properties.details?.externalId??"",kind:e.properties.kind}};return e.properties.details&&(t.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?`${e.properties.details.name} icon`:"icon"}]:void 0}),Ax(t)&&(t.properties.center=$y(t).unwrapOr(void 0)),t}function DN(e,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let t=e.properties,o={type:"Feature",geometry:e.geometry,properties:{id:t.id,externalId:t.details?.externalId??"",entrances:[],kind:t.kind,footprintComponent:r}};return Ax(o)&&(o.properties.center=$y(o).unwrapOr(void 0)),t.details&&(o.properties.details={name:t.details.name,description:t.details.description,images:t.details.icon?[{url:t.details.icon,altText:t.details.name?`${t.details.name} icon`:"icon"}]:void 0}),o}function kN(e,r){if(e.geometry.type!=="Polygon")return null;let t=e.properties,o={type:"Feature",geometry:e.geometry,properties:{id:t.id,externalId:t.details?.externalId??"",destinationNodes:r}};return Ax(o)&&(o.properties.center=$y(o).unwrapOr(void 0)),t.details&&(o.properties.details={name:t.details.name,description:t.details.description,images:t.details.icon?[{url:t.details.icon,altText:t.details.name?`${t.details.name} icon`:"icon"}]:void 0}),o}function LN(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}function AN(e){let r=[...e?.ExteriorWalls?.geometryAnchors??[],...e?.Walls?.geometryAnchors??[]];return new Set(r.map(o=>o.geometryId))}d();function Z7(e,{geometryMaps:r,geometryFeatureById:t}){if(!e.locationCategories&&!e.locations)return{};let o={};if(e.locationCategories?.length){let n=[];for(let i of e.locationCategories){let a={id:i.id,name:i.details.name,icon:i.details.icon??""};i.parent&&(a.parent=i.parent),n.push(a)}o["category.json"]=n}if(e.locations?.length){let n=RN(e,{geometryFeatureById:t}),i=[];for(let a of e.locations){let l={id:a.id,name:a.details.name,categories:a.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:a.links,openingHoursSpecification:a.openingHours??[],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};i.push(l);for(let{geometryId:c,floorId:p}of a.geometryAnchors)l.spaces.push(...r.space.get(c)?.ids.map(m=>({id:m,floor:p}))??[]),l.obstructions.push(...r.obstruction.get(c)?.ids.map(m=>({id:m,floor:p}))??[]),l.areas.push(...r.area.get(c)?.ids.map(m=>({id:m,floor:p}))??[]),l.entrances.push(...n.entrancesByGeometryId.get(c)??[]),l.connections.push(...n.connectionsByGeometryId.get(c)??[]),l.annotations.push(...n.annotationsByGeometryId.get(c)??[])}o["location.json"]=i}return o}function RN(e,{geometryFeatureById:r}){let t={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(e.annotations)for(let[o,n]of ze(e.annotations))for(let i of n??[]){let a=i.geometryId,l=i.id,c=t.annotationsByGeometryId.get(a)??[];c.push({floor:o,id:l}),t.annotationsByGeometryId.set(a,c)}if(e.connections)for(let o of e.connections){let n=Ex(o,r),i=Array.from(new Map([...o.entrances,...o.exits].map(a=>[`${a.geometryId}_${a.floorId}`,a])).values());for(let a of i){let l=a.geometryId;if(n){let c=t.entrancesByGeometryId.get(l)??[];c.push({floor:a.floorId,id:o.id}),t.entrancesByGeometryId.set(l,c)}else{let c=t.connectionsByGeometryId.get(l)??[];c.push(o.id),t.connectionsByGeometryId.set(l,c)}}}return t}d();function X7(e,r){let t={features:[],type:"FeatureCollection"},o={"manifest.geojson":t},n=e.manifest;if(n.features.length>0){let i=n.features[0],a=i.properties,l={type:"Feature",geometry:i.geometry,properties:{folder_struct:[],version:"2.0.0",time:a.time,name:a.name,naturalBearing:a.naturalBearing,tzid:a.tzid,map:a.mapId,org_id:a.orgId,language:a.language}};t.features.push(l)}return o}d();function Y7(e,{geometryMaps:r,navigationFlags:t,incomingEdgesByNodeId:o}){let n={"node.geojson":{type:"FeatureCollection",features:[]}},i=n["node.geojson"].features,a=new Map;for(let p of e.floors?.features??[])a.set(p.properties.id,p.properties.elevation);let l=new Map;for(let p of Object.values(e.nodes??{}))for(let m of p?.features??[])for(let f of m.properties.geometryIds)l.set(f,[...l.get(f)??[],m.properties.id]);let c=new Map;for(let p of e.connections??[]){let m=p.exits.map(f=>({...f,nodes:l.get(f.geometryId)??[]}));for(let f of p.entrances){let g=l.get(f.geometryId)??[];for(let b of g)for(let x of m){let C=Math.abs((a.get(f.floorId)??0)-(a.get(x.floorId)??0))*p.floorCostMultiplier,v=c.get(b)??[];v.push(...x.nodes.map(I=>({id:I,weight:C+p.entryCost}))),c.set(b,v)}}}for(let[p,m]of ze(e.nodes??{}))for(let f of m?.features??[]){let g=r.space.get(f.properties.geometryIds[0])?.features[0],b=g?.geometry.type==="Point"&&g?.properties.details?.externalId?g.properties.details.externalId:"",x=o.get(f.properties.id)??[],C=Object.keys(t??{}),v=[];for(let M of x)for(let O of C)Ca(M,t[O])&&v.push(t[O]);let I={type:"Feature",geometry:f.geometry,properties:{id:f.properties.id,floor:p,space:f.properties.geometryIds.map(M=>r.space.get(M)?.ids).flat().filter(M=>M!==void 0),neighbors:[...f.properties.neighbors.map(M=>({id:M.id,weight:M.extraCost})),...c.get(f.properties.id)??[]],map:p,externalId:b,flags:v.length>0?_N(v):void 0}};i.push(I)}return n}function _N(e){if(e==null||e.length===0)return;let r=new Array(Math.max(...e.map(t=>t.index))+1).fill(0);for(let t of e)r[t.index]|=1<<t.bit;return r}d();function BN(e,r){let t={};for(let o of e){let n=r.get(o);n&&(t[n]??(t[n]=[]),t[n].push(o))}return t}function J7(e,{geometryMaps:r}){if(!e.defaultStyle)return{};let t={},o={};t["styles.json"]=o;let n=[...Array.from(r.space.values()).map(a=>a.features),...Array.from(r.obstruction.values()).map(a=>a.features)],i=new Map(n.flatMap(a=>a.map(l=>[l.properties.id,l.geometry.type])));for(let[a,l]of ze(e.defaultStyle)){let c=BN(l.geometryAnchors.flatMap(p=>[...r.space.get(p.geometryId)?.ids??[],...r.obstruction.get(p.geometryId)?.ids??[]]),i);if(c.Point&&c.Point.length>0){let p={points:Array.from(c.Point.values()),showImage:l.extra?.showImage!==void 0?l.extra?.showImage===!0:l.opacity!==0};o[`${a}.Point`]=p}if(c.LineString&&c.LineString.length>0){let p={lineStrings:Array.from(c.LineString.values()),altitude:l.altitude,color:l.color,height:l.height,opacity:l.opacity,width:l.buffer};o[`${a}.LineString`]=p}if(c.Polygon&&c.Polygon.length>0){let p={polygons:Array.from(c.Polygon.values()),altitude:l.altitude,color:l.color,height:l.height,opacity:l.opacity};l.extra?.showImage!==void 0&&(p.showImage=l.extra.showImage===!0),o[`${a}.Polygon`]=p}}return t}var NN=LT().extendOptional(RM).extendOptional(y7).extendOptional(VM).extendOptional(d7).extendOptional(F7).extendOptional(zM).extendOptional(KM).extendOptional(I7).extendOptional(T7).extendOptional(a7).extendOptional(e7).extendOptional(BT).extendOptional(zT).extendOptional(EM).build({cspSafe:!0}).expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function K7(e){let r=L7(e),t=j7(e,r),o=z7(e,r),n=Y7(e,r),i=R7(e,r),a=J7(e,r),l=U7(e,r),c=G7(e,r),p=N7(e,r),m=A7(e,r),f=Z7(e,r),g=B7(e,r),b=X7(e,r);return{...t,...o,...n,...i,...a,...l,"tileset.json":e.tileset,...c,...p,...m,...f,...g,...b}}function Rx(e){let r=NN.decompressUnsafeSync(e);return r.isOk()?ee(K7(r.value)):re(r.error)}d();function Ap(e){return e.endsWith("/")?e:`${e}/`}d();var Rp="https://app.mappedin.com/",Q7="https://auth.mappedin.com/";d();d();var jN=e=>{let r=Date.now();return e-r},Wy=(e,r)=>jN(e)<=r*60*1e3;var e6=60,t6=e6*60*1e3,q7="accessTokens";async function bm(e,r=!1){let t=`${e.key}`,o=rs.getInstance(),n=o?.loadSessionData(q7)||{},i=Math.floor(Date.now()/1e3);if(n[t]&&!Wy(n[t].expiresTimestamp*1e3,e6))return n[t];let a=r?await GN(e,i):await UN(e,i),l={...n,[t]:a};return o?.saveSessionData(q7,l),a}async function GN(e,r){let t=`${e.baseAuthUri??Q7}oauth2/token`,o=await _n()(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:e.key,client_secret:e.secret})});if(!o.ok)throw new Error(`${o.status} ${o.statusText}: ${await o.text()}`);let n=await o.json();return{accessToken:n.access_token,expiresTimestamp:r+n.expires_in}}async function UN(e,r){let t=`${e.baseAuthUri?Ap(e.baseAuthUri):Rp}api/v1/api-key/token`,o=await _n()(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e.key,secret:e.secret})});if(!o.ok)throw new Error(`${o.status} ${o.statusText}: ${await o.text()}`);let n=await o.json();return{accessToken:n.access_token,expiresTimestamp:r+n.expires_in}}d();var o6=60,n6=o6*60*1e3,r6="miSasTokens";async function _x(e,r){let t=`${r}__${e.mapId}`,o=rs.getInstance(),n=o?.loadSessionData(r6)||{};if(n[t]&&!Wy(n[t].expires,o6))return n[t];let i=await VN(e,r),a={...n,[t]:{token:i.token,expires:new Date(i.expires).getTime()}};return o?.saveSessionData(r6,a),i}async function VN(e,r){let t=`${e.baseUri?Ap(e.baseUri):Rp}api/v1/venue/${e.mapId}/sas-token`,o=await _n()(t,{method:"GET",headers:{Authorization:`Bearer ${r}`}});if(!o.ok)throw new Error(`${o.status} ${o.statusText}: ${await o.text()}`);let n=await o.json();return{token:n.token,expires:new Date(n.expires).getTime()}}var i6=globalThis.fetch,HN=y?.env?.npm_package_version;function _n(){if(i6==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return i6}var Bx={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function a6(e){let r={...Bx,...e};return r.headers={...r.headers,"mappedin-sdk-version":HN},r.things=[],"platformString"in e&&(r.headers={...r.headers,"mappedin-platform-version":e.platformString}),r.noAuth||(r.accessToken?r.authorization=`Bearer ${r.accessToken}`:r.clientId&&r.clientSecret&&(r.authorization=`Basic ${globalThis.btoa(`${r.clientId}:${r.clientSecret}`)}`)),r.language=r.language?.toLowerCase(),r}function $N(e,r,t=!1){let o={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};t&&delete o.language;let{headers:n}=e;n["Content-Type"]=n["Content-Type"]||"text/json",e.accessToken?n.Authorization=`Bearer ${e.accessToken}`:e.noAuth||e.clientId&&e.clientSecret&&(n["x-mappedin-key"]=btoa(e.clientId),n["x-mappedin-secret"]=btoa(e.clientSecret));let i={method:"GET",headers:n};return e.secure&&(r+="&withcdntoken"),{req:i,url:r}}async function WN(e,r,t=!1){let o=$N(e,r,t),n=await _n()(o.url,o.req);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return n.json()}var zN=e=>{let r=e!=null&&typeof e=="object"&&"perspectives"in e&&e.perspectives!=null&&typeof e.perspectives=="object"?e.perspectives:null;if(r==null||Object.keys(r).length===0)return L.warn("No perspectives available in response!"),null;let t={};for(let[o,n]of Object.entries(r)){let i="url"in n&&typeof n.url=="string"?n.url:null,a="locale_packs"in n&&typeof n.locale_packs=="object"?n.locale_packs:null;if(i==null||a==null){L.warn(`Perspective ${o} is missing url or locale_packs!`);continue}t[o]={url:i,locale_packs:a}}return t};async function ZN(e,r="exports/mvf/1/bundle"){let t=a6({baseUri:"https://api-gateway.mappedin.com/",...Bx,...e}),o=`${t.baseUri+r}?venue=${t.venue}&version=${t.version??"2.0.0"}`;t.headers["Content-Type"]="application/zip";let n=await WN(t,o),i=n.url,a=n.locale_packs,l=t.perspective??Bx.perspective,c=zN(n);if(l!=null&&l!==""&&c!=null){let p=c[l];p==null?L.warn(`Perspective ${l} not found in response! Loading default perspective instead.`):(L.log(`Loading perspective "${l}"`),i=p.url,a=p.locale_packs)}return{url:i,localePacks:a,updated_at:n.updated_at}}var _p=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function Nx(e,{signal:r}){let t=await(await _n()(e,{signal:r})).arrayBuffer();return new Uint8Array(t)}async function Bp(e){let t=(await import("./browser-4FMFOYKX.js")).unzipSync(e),o={};if(t["enterprise/"]!=null){o.enterprise={};let n=t["enterprise/locations.json"];n&&(o.enterprise.locations=JSON.parse(_p().decode(n)));let i=t["enterprise/locationInstances.json"];i&&(o.enterprise.locationInstances=JSON.parse(_p().decode(i)));let a=t["enterprise/categories.json"];a&&(o.enterprise.categories=JSON.parse(_p().decode(a)))}return t["floorstack.json"]&&(o["floorstack.json"]=JSON.parse(_p().decode(t["floorstack.json"]))),t["floor.geojson"]&&(o["floor.geojson"]=JSON.parse(_p().decode(t["floor.geojson"]))),t["manifest.json"]&&(o["manifest.geojson"]=JSON.parse(_p().decode(t["manifest.json"]))),o}async function l6(e,{signal:r}){try{let t=await(await _n()(e,{signal:r})).arrayBuffer();if(r.aborted)return;let o=new Uint8Array(t);return await Bp(o)}catch(t){let o=new Error("downloadLanguagePack failed");throw o.cause=t,o}}function XN(e){let{mvfVersion:r,useDraftData:t}=e;if(r==="3.0.0")return t?"exports/mvf3-draft/1/bundle":"exports/mvf3/1/bundle";if(r==null||r==="2.0.0")return t?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle";if(r==="2.0.0-c")return t?"exports/mvf2c-draft/1/bundle":"exports/mvf2c/1/bundle";throw new Error(`Unsupported MVF version: ${r}`)}async function jx(e){return new Promise(async(r,t)=>{try{let o=XN(e),{url:n,localePacks:i}=await ZN(e,o),a=await _n()(n).then(c=>c.arrayBuffer()),l=new Uint8Array(a);r({compressed:l,localePacks:i})}catch(o){t(o)}})}async function Gx(e,r){return new Promise(async(t,o)=>{try{let{url:n}=await YN(e,r),i=await _n()(n).then(l=>l.arrayBuffer()),a=new Uint8Array(i);t(a)}catch(n){o(n)}})}async function YN(e,r){let t=new URL(`${e.baseUri?Ap(e.baseUri):Rp}api/v1/venue/${e.mapId}/mvf`);e.viewId&&t.searchParams.set("configId",e.viewId),e.mvfVersion&&t.searchParams.set("version",e.mvfVersion);let o=await _n()(t.toString(),{headers:{Authorization:`Bearer ${r}`}});if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return o.json()}function Ux(e){let r=new TextDecoder,t=r.decode.bind(r);try{let o={"connection.json":JSON.parse(t(e["connection.json"])),"manifest.geojson":JSON.parse(t(e["manifest.geojson"])),"map.geojson":e["map.geojson"]?JSON.parse(t(e["map.geojson"])):void 0,"mapstack.geojson":e["mapstack.geojson"]?JSON.parse(t(e["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(t(e["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":e["tileset.json"]?JSON.parse(t(e["tileset.json"])):void 0,"navigationFlags.json":e["navigationFlags.json"]?JSON.parse(t(e["navigationFlags.json"])):void 0};if(e.enterprise!=null&&(o.enterprise={},e.enterprise?.["locations.json"]&&(o.enterprise.locations=JSON.parse(t(e.enterprise?.["locations.json"]))),e.enterprise?.["categories.json"]&&(o.enterprise.categories=JSON.parse(t(e.enterprise?.["categories.json"]))),e.enterprise?.["venue.json"]&&(o.enterprise.venue=JSON.parse(t(e.enterprise?.["venue.json"]))),e.enterprise?.["layers.json"]&&(o.enterprise.layers=JSON.parse(t(e.enterprise?.["layers.json"]))),e.enterprise?.["locationInstances.json"]&&(o.enterprise.locationInstances=JSON.parse(t(e.enterprise?.["locationInstances.json"]))),e.enterprise?.["enterpriseStyles.json"]&&(o.enterprise.enterpriseStyles=JSON.parse(t(e.enterprise?.["enterpriseStyles.json"]))),e.enterprise?.["textures.json"]&&(o.enterprise.textures=JSON.parse(t(e.enterprise?.["textures.json"]))),e.enterprise?.["floorText.json"]&&(o.enterprise.floorText=JSON.parse(t(e.enterprise?.["floorText.json"]))),e.enterprise?.["categoryPriorities.json"]&&(o.enterprise.categoryPriorities=JSON.parse(t(e.enterprise?.["categoryPriorities.json"])))),e["floorstack.json"]!=null?o["floorstack.json"]=JSON.parse(t(e["floorstack.json"])):e["mapstack.json"]!=null&&(o["mapstack.json"]=JSON.parse(t(e["mapstack.json"]))),o["floorstack.json"]==null&&o["mapstack.json"]==null&&o["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(e["floor.geojson"]&&(o["floor.geojson"]=JSON.parse(t(e["floor.geojson"]))),o["floor.geojson"]==null&&o["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in e&&(o["styles.json"]=JSON.parse(t(e["styles.json"]))),"shapes.json"in e&&(o["shapes.json"]=JSON.parse(t(e["shapes.json"]))),"location.json"in e&&(o["location.json"]=JSON.parse(t(e["location.json"]))),"category.json"in e&&(o["category.json"]=JSON.parse(t(e["category.json"]))),e.annotation!=null){o.annotation={};let i=Object.keys(e.annotation);for(let a of i){let l=a.replace(/\.json|\.geojson/g,"");o.annotation[l]=JSON.parse(t(e.annotation[a]))}}let n=Object.keys(e.space);for(let i of n){let a=i.replace(/\.json|\.geojson/g,"");o.space[a]=JSON.parse(t(e.space[i]))}if(e.obstruction!=null){let i=Object.keys(e.obstruction);for(let a of i){let l=a.replace(/\.json|\.geojson/g,"");o.obstruction[l]=JSON.parse(t(e.obstruction[a]))}}else o.obstruction={};if(e.entrance!=null){let i=Object.keys(e.entrance);for(let a of i){let l=a.replace(/\.json|\.geojson/g,"");o.entrance[l]=JSON.parse(t(e.entrance[a]))}}else o.entrance={};if("floorImages"in e&&e.floorImages!=null){o.floorImages={};for(let i of Object.keys(e.floorImages)){let a=i.replace(/\.json|\.geojson/g,"");o.floorImages[a]=JSON.parse(t(e.floorImages[i]))}}if("textAreas"in e&&e.textAreas!=null){o.textAreas={};for(let i of Object.keys(e.textAreas)){let a=i.replace(/\.json|\.geojson/g,"");o.textAreas[a]=JSON.parse(t(e.textAreas[i]))}}if("facade"in e&&e.facade!=null){o.facade={};for(let i of Object.keys(e.facade)){let a=i.replace(/\.json|\.geojson/g,"");o.facade[a]=JSON.parse(t(e.facade[i]))}}if("area"in e&&e.area!=null){o.area={};for(let i of Object.keys(e.area)){let a=i.replace(/\.json|\.geojson/g,"");o.area[a]=JSON.parse(t(e.area[i]))}}return o}catch(o){throw L.error(o),new Error("MVF parsing failed! Probably encountered a bad file.")}}function JN(e){if(e==null||typeof e!="object")return!1;let r=["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&&r.push("styles.json"),"shapes.json"in e&&r.push("shapes.json");for(let t of r)if(e[t]==null||e[t][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function Vx(e){return new Promise(async(r,t)=>{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 n=(await import("./browser-4FMFOYKX.js")).unzipSync(e);if(!JN(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let i={},a=Object.keys(n);for(let l of a){if(n[l].length===0)continue;let c=l.split("/");if(c.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(c.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(c.length===1){i[c[0]]=n[l];continue}if(c[0]==="image"){L.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else i[c[0]]==null&&(i[c[0]]={}),i[c[0]][c[1]]=n[l]}r(i)}catch(o){t(o)}})}function Ma(){let e="us",r={};function t(){return tj(oj(e),r)}return{updateByUserOption(o){o.environment&&(e=o.environment),o.baseUri&&(r.baseUri=o.baseUri),o.baseAuthUri&&(r.baseAuthUri=o.baseAuthUri),o.analytics?.baseUri&&(r.analyticsBaseUri=o.analytics?.baseUri)},updateTileServerBaseUrl(o){r.tileServerUri=o},updateEnvironment(o){e=o},setEnterprise(o){(e==="us"||e==="us-enterprise")&&(e=o?"us-enterprise":"us")},getBaseUri(){return t().baseUri},getBaseAuthUri(){return t().baseAuthUri},getAnalyticsBaseUri(){return t().analyticsBaseUri},getTileServerUri(){return t().tileServerUri},reset(){e="us",r={}},__getState:t}}var c6=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"}),KN=Object.freeze({...c6,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),QN=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"}),qN=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"}),ej=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 tj(e,r){return{...e,...r}}var rj={eu:QN,us:c6,"us-enterprise":KN,"us-staging-enterprise":qN,"us-staging-self-serve":ej};function oj(e){return rj[e]}var zy=e=>{let r=Object.values(e["floorstack.json"]??e["mapstack.json"]??{});return r.length===1?[]:r.filter(t=>t.type!=="Outdoor").map(t=>t.id.replace("fs_","").replace("ms_",""))},s6=async e=>{let r=performance.now(),t=Rx(e);return L.log(`Parsed MVFv3 in ${performance.now()-r}ms`),t.inspectErr(n=>{throw L.error(n),new Error("MVFv3 parsing failed!")}),t.unwrap()};async function Zy(e,r="2.0.0"){switch(r){case"2.0.0":case"2.0.0-c":try{let t=await Vx(e);return Ux(t)}catch{return s6(e)}case"3.0.0":return s6(e);default:throw new Error(`Unsupported MVF version: ${r}`)}}d();d();d();function on(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")}function _o(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")}function Np(e){return e.type==="Feature"?e.geometry:e}function p6(e,r){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function nj(e,r,t){t===void 0&&(t={});for(var o=on(e),n=_o(r),i=0;i<n.length-1;i++){var a=!1;if(t.ignoreEndVertices&&(i===0&&(a="start"),i===n.length-2&&(a="end"),i===0&&i+1===n.length-1&&(a="both")),ij(n[i],n[i+1],o,a,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function ij(e,r,t,o,n){var i=t[0],a=t[1],l=e[0],c=e[1],p=r[0],m=r[1],f=t[0]-l,g=t[1]-c,b=p-l,x=m-c,C=f*x-g*b;if(n!==null){if(Math.abs(C)>n)return!1}else if(C!==0)return!1;if(o){if(o==="start")return Math.abs(b)>=Math.abs(x)?b>0?l<i&&i<=p:p<=i&&i<l:x>0?c<a&&a<=m:m<=a&&a<c;if(o==="end")return Math.abs(b)>=Math.abs(x)?b>0?l<=i&&i<p:p<i&&i<=l:x>0?c<=a&&a<m:m<a&&a<=c;if(o==="both")return Math.abs(b)>=Math.abs(x)?b>0?l<i&&i<p:p<i&&i<l:x>0?c<a&&a<m:m<a&&a<c}else return Math.abs(b)>=Math.abs(x)?b>0?l<=i&&i<=p:p<=i&&i<=l:x>0?c<=a&&a<=m:m<=a&&a<=c;return!1}var d6=nj;d();function sj(e,r){r===void 0&&(r={});var t=Rc(e),o=(t[0]+t[2])/2,n=(t[1]+t[3])/2;return pi([o,n],r.properties,r)}var jp=sj;d();d();function aj(e,r,t){t===void 0&&(t={});var o=on(e),n=on(r),i=co(n[1]-o[1]),a=co(n[0]-o[0]),l=co(o[1]),c=co(n[1]),p=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(l)*Math.cos(c);return _3(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),t.units)}var wa=aj;function Xy(e,r){return r===void 0&&(r={}),j3(e,function(t,o){var n=o.geometry.coordinates;return t+wa(n[0],n[1],r)},0)}d();d();d();function Yy(e,r,t){if(t===void 0&&(t={}),t.final===!0)return lj(e,r);var o=on(e),n=on(r),i=co(o[0]),a=co(n[0]),l=co(o[1]),c=co(n[1]),p=Math.sin(a-i)*Math.cos(c),m=Math.cos(l)*Math.sin(c)-Math.sin(l)*Math.cos(c)*Math.cos(a-i);return xu(Math.atan2(p,m))}function lj(e,r){var t=Yy(r,e);return t=(t+180)%360,t}d();function Pl(e,r,t,o){o===void 0&&(o={});var n=on(e),i=co(n[0]),a=co(n[1]),l=co(t),c=B3(r,o.units),p=Math.asin(Math.sin(a)*Math.cos(c)+Math.cos(a)*Math.sin(c)*Math.cos(l)),m=i+Math.atan2(Math.sin(l)*Math.sin(c)*Math.cos(a),Math.cos(c)-Math.sin(a)*Math.sin(p)),f=xu(m),g=xu(p);return pi([f,g],o.properties)}d();d();function cj(e){if(!e)throw new Error("geojson is required");var r=[];return di(e,function(t){pj(t,r)}),pl(r)}function pj(e,r){var t=[],o=e.geometry;if(o!==null){switch(o.type){case"Polygon":t=_o(o);break;case"LineString":t=[_o(o)]}t.forEach(function(n){var i=dj(n,e.properties);i.forEach(function(a){a.id=r.length,r.push(a)})})}}function dj(e,r){var t=[];return e.reduce(function(o,n){var i=os([o,n],r);return i.bbox=uj(o,n),t.push(i),n}),t}function uj(e,r){var t=e[0],o=e[1],n=r[0],i=r[1],a=t<n?t:n,l=o<i?o:i,c=t>n?t:n,p=o>i?o:i;return[a,l,c,p]}var Hx=cj;var F6=Ec(O6(),1);function jj(e,r){var t={},o=[];if(e.type==="LineString"&&(e=t0(e)),r.type==="LineString"&&(r=t0(r)),e.type==="Feature"&&r.type==="Feature"&&e.geometry!==null&&r.geometry!==null&&e.geometry.type==="LineString"&&r.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&r.geometry.coordinates.length===2){var n=P6(e,r);return n&&o.push(n),pl(o)}var i=(0,F6.default)();return i.load(Hx(r)),r0(Hx(e),function(a){r0(i.search(a),function(l){var c=P6(a,l);if(c){var p=_o(c).join(",");t[p]||(t[p]=!0,o.push(c))}})}),pl(o)}function P6(e,r){var t=_o(e),o=_o(r);if(t.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(o.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var n=t[0][0],i=t[0][1],a=t[1][0],l=t[1][1],c=o[0][0],p=o[0][1],m=o[1][0],f=o[1][1],g=(f-p)*(a-n)-(m-c)*(l-i),b=(m-c)*(i-p)-(f-p)*(n-c),x=(a-n)*(i-p)-(l-i)*(n-c);if(g===0)return null;var C=b/g,v=x/g;if(C>=0&&C<=1&&v>=0&&v<=1){var I=n+C*(a-n),M=i+C*(l-i);return pi([I,M])}return null}var Up=jj;function Gj(e,r,t){t===void 0&&(t={});var o=pi([1/0,1/0],{dist:1/0}),n=0;return di(e,function(i){for(var a=_o(i),l=0;l<a.length-1;l++){var c=pi(a[l]);c.properties.dist=wa(r,c,t);var p=pi(a[l+1]);p.properties.dist=wa(r,p,t);var m=wa(c,p,t),f=Math.max(c.properties.dist,p.properties.dist),g=Yy(c,p),b=Pl(r,f,g+90,t),x=Pl(r,f,g-90,t),C=Up(os([b.geometry.coordinates,x.geometry.coordinates]),os([c.geometry.coordinates,p.geometry.coordinates])),v=null;C.features.length>0&&(v=C.features[0],v.properties.dist=wa(r,v,t),v.properties.location=n+wa(c,v,t)),c.properties.dist<o.properties.dist&&(o=c,o.properties.index=l,o.properties.location=n),p.properties.dist<o.properties.dist&&(o=p,o.properties.index=l+1,o.properties.location=n+m),v&&v.properties.dist<o.properties.dist&&(o=v,o.properties.index=l),n+=m}}),o}var vm=Gj;function Uj(e,r,t){var o=_o(t);if(p6(t)!=="LineString")throw new Error("line must be a LineString");var n=vm(t,e),i=vm(t,r),a;n.properties.index<=i.properties.index?a=[n,i]:a=[i,n];for(var l=[a[0].geometry.coordinates],c=a[0].properties.index+1;c<a[1].properties.index+1;c++)l.push(o[c]);return l.push(a[1].geometry.coordinates),os(l,t.properties)}var rv=Uj;var Vj=1e-7;function ov(e){return{type:"Point",coordinates:e}}function Hj(e,r){let{coordinates:t}=r.geometry,{coordinates:o}=e.geometry,n=t.map(i=>vm(e,ov(i)));return o.reduce((i,a)=>{let l=rv(ov(a),n[0],e),c=rv(ov(a),n[1],e),p=Xy(l)<Xy(c)?l:c;return p.properties={...e.properties,entrances:[]},i.concat([p])},[])}function nv(e,r){return r.reduce((t,o)=>{let n={epsilon:Vj},i=t.obstructions.findIndex(l=>d6(jp(o),l,n)),a=t.obstructions[i];if(a){let[l,c]=Hj(a,o);t.entrances.push(o),t.obstructions.splice(i,1,l,c)}return t},{obstructions:[e],entrances:[]})}d();d();d();var lr=class{constructor(r){u(this,"id");this.id=r}};d();d();var Vp=class Vp{constructor(r,t,o){u(this,"__type",Vp.__type);u(this,"id",nt());u(this,"latitude");u(this,"longitude");u(this,"floorId");u(this,"verticalOffset");if(typeof r=="object")this.latitude=r.latitude,this.longitude=r.longitude,this.floorId=r.floorId,this.verticalOffset=r.verticalOffset??0;else{if(t==null)throw new Error("Coordinate longitude is required.");this.latitude=r,this.longitude=t,this.floorId=o,this.verticalOffset=0}}static is(r){return r.__type===Vp.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(r){return this.latitude===r.latitude&&this.longitude===r.longitude&&this.floorId===r.floorId}toJSON(){return{__type:Vp.__type,latitude:this.latitude,longitude:this.longitude,floorId:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};u(Vp,"__type","coordinate");var iv=Vp,ce=iv;function sv(e){let r=e.enterprise?.locations?.reduce((n,i)=>(n[i.id]=i,n),{})||{};for(let n of e.enterprise?.locationInstances||[])r[n.id]=n;let t={};for(let n of e["floorstack.json"]||[])t[n.id]=n;let o={};for(let n of e["floor.geojson"]?.features||[])n.properties&&n.properties.id&&(o[n.properties.id]=n.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":r,"enterprise-category":e.enterprise?.categories?.reduce((n,i)=>(n[i.id]=i,n),{})||{},"floor-stack":t,floor:o}}}function E6(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}function D6(e){return!!e.split("?")[1]?.includes("sv=")}function xr(e,r){let t=e?.properties?.id||"unknown";if(e.geometry==null)return L.error(`Cannot get the center coordinate for "${t}" because it has no geometry.`),new ce({latitude:0,longitude:0,floorId:r});try{if(e.geometry.type==="LineString"){let[[o,n],[i,a]]=e.geometry.coordinates,l=(o+i)/2,c=(n+a)/2;return new ce({latitude:c,longitude:l,floorId:r})}else if(e.geometry.type==="Point"){let[o,n]=e.geometry.coordinates;return new ce({latitude:n,longitude:o,floorId:r})}else if(e.geometry.type==="Polygon"){let o=e;if(o.properties.center!=null){let[n,i]=o.properties.center;return new ce({latitude:i,longitude:n,floorId:r})}}}catch{}try{let[o,n]=jp(e).geometry.coordinates;return new ce({latitude:n,longitude:o,floorId:r})}catch(o){return L.error(`Failed to get center coordinate for "${t}" ${o instanceof Error?o.stack:""}`),new ce({latitude:0,longitude:0,floorId:r})}}function k6(e,r){return r&&(e.flags[r.index]&1<<r.bit)!==0}var Bn,vr,Fl,ws,Hp=class Hp extends lr{constructor(t,o){super(o.mvfData.properties.id);u(this,"__type",Hp.__type);S(this,Bn);S(this,vr,{});S(this,Fl);S(this,ws);w(this,Bn,t),w(this,Fl,o.floorId),w(this,ws,o.mvfData)}static is(t){return t.__type===Hp.__type}get locations(){return s(this,vr).locations?s(this,vr).locations:(s(this,vr).locations=(s(this,Bn).locationIdsByNodeId[this.id]||[]).map(t=>s(this,Bn).getById("enterprise-location",t)).filter(Boolean),s(this,vr).locations)}get space(){return s(this,Bn).getById("space",s(this,Bn).spaceIdsByNodeId[this.id]?.[0])}get floor(){let t=s(this,Bn).getById("floor",s(this,Fl));if(t==null)throw new Error(`Floor ${s(this,Fl)} not found!`);return t}get coordinate(){return s(this,vr).coordinate==null&&(s(this,vr).coordinate=xr(s(this,ws),s(this,Fl))),s(this,vr).coordinate}get externalId(){return s(this,ws).properties.externalId??""}get neighbors(){if(s(this,vr).neighbors==null){let t=s(this,ws).properties.neighbors.map(o=>{let n=s(this,Bn).getById("node",o.id);if(n==null)throw new Error(`Node ${o.id} not found!`);return n});s(this,vr).neighbors=t}return s(this,vr).neighbors}get navigationFlags(){if(s(this,vr).navigationFlags==null){let t=[],o=s(this,ws).properties.flags;if(o!=null&&o.length>0)for(let[n,i]of Object.entries(s(this,Bn).navigationFlags))o.length>i.index&&o[i.index]!=null&&k6({flags:o},i)&&t.push(n);s(this,vr).navigationFlags=Object.freeze(t)}return s(this,vr).navigationFlags}get geoJSON(){return{...s(this,ws),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Hp.__type,id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(t=>t.id)}}destroy(){for(let t of Object.keys(s(this,vr)))delete s(this,vr)[t]}};Bn=new WeakMap,vr=new WeakMap,Fl=new WeakMap,ws=new WeakMap,u(Hp,"__type","node");var av=Hp,nn=av;d();d();d();d();var Im,Os,$p=class $p extends lr{constructor(t){super(String(nt()));u(this,"__type",$p.__type);S(this,Im,{});S(this,Os);w(this,Os,t.mvfData)}static is(t){return t.__type===$p.__type}get url(){return s(this,Os).url}get name(){if("displayName"in s(this,Os))return s(this,Os).displayName;if("label"in s(this,Os))return s(this,Os).label}toJSON(){return{__type:$p.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(s(this,Im)))delete s(this,Im)[t]}};Im=new WeakMap,Os=new WeakMap,u($p,"__type","hyperlink");var lv=$p,El=lv;d();d();function Sm(e){return typeof e=="string"?e:e.id}function pv(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}var cv=8,Di=e=>typeof e=="number"?e.toFixed(cv):pv(e)?e[1].toFixed(cv)+"-"+e[0].toFixed(cv):e.map(r=>Di(r)).join("-"),$j=e=>{let r=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,t=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return r.test(e)||t.test(e)},qy=e=>{if(!$j(e))return null;let r="";e.startsWith("https://")?(r="https://",e=e.slice(8)):e.startsWith("http://")&&(r="http://",e=e.slice(7));let[t,o,n]=e.split("/");return{origin:r+t,mapId:o,fileName:n}};var Cm,Pa,Dl,Wp=class Wp extends lr{constructor(t){super(String(nt()));u(this,"__type",Wp.__type);S(this,Cm,{});S(this,Pa);S(this,Dl);w(this,Pa,t.mvfData),w(this,Dl,t.mapData)}static is(t){return t.__type===Wp.__type}get url(){let t=s(this,Pa).url;if(s(this,Dl).tokenManager==null)return t;let o=qy(s(this,Pa).url);if(o==null)return t;let n=o.mapId;try{if(s(this,Dl).tokenManager.isEnterpriseMode())return t;let i=s(this,Dl).tokenManager.getSasToken(n).token;if(i==null||i==="")throw new Error("SAS token empty!");return`${t}?${i}`}catch(i){return L.error("Error getting SAS token for image",{error:i,url:t}),t}}get name(){return s(this,Pa).altText}get altText(){return s(this,Pa).altText}toJSON(){return{__type:Wp.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(s(this,Cm)))delete s(this,Cm)[t]}};Cm=new WeakMap,Pa=new WeakMap,Dl=new WeakMap,u(Wp,"__type","image");var dv=Wp,kl=dv;d();var Ll,Nn=class{constructor(r,t){u(this,"id");S(this,Ll);this.id=r}get geoJSONBoundingBox(){return s(this,Ll)?s(this,Ll):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(w(this,Ll,Rc(this.geoJSON)),s(this,Ll))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};Ll=new WeakMap;var zp,Ps,Fs,Ar=class extends Nn{constructor(t,o){super(o.properties.id,t);S(this,zp);S(this,Ps);S(this,Fs,{});w(this,zp,t),w(this,Ps,o)}get externalId(){return s(this,Ps).properties.externalId??""}get name(){let t=s(this,Ps).properties.details?.name??"";return t===""&&(t=this.locationProfiles.find(o=>o.name&&o.name.length>0)?.name??""),t}get description(){let t=s(this,Ps).properties.details?.description??"";return t===""&&(t=this.locationProfiles.find(o=>o.description&&o.description.length>0)?.description??""),t}get images(){if(s(this,Fs).images!=null)return s(this,Fs).images;let t=s(this,Ps).properties.details?.images?.map(o=>new kl({mvfData:o,mapData:s(this,zp)}))??[];return(t==null||t.length===0)&&(t=this.locationProfiles.find(o=>o.images.length>0)?.images??[]),s(this,Fs).images=t,t}get links(){if(s(this,Fs).links!=null)return s(this,Fs).links;let t=s(this,Ps).properties.details?.links?.map(o=>new El({mvfData:o}))??[];return(t==null||t.length===0)&&(t=this.locationProfiles.find(o=>o.links.length>0)?.links??[]),s(this,Fs).links=t,t}get locationProfiles(){return s(this,zp).locationProfilesByAttachedFeatureId[this.id]??[]}};zp=new WeakMap,Ps=new WeakMap,Fs=new WeakMap;var Tm,Al,Xp,Yp,Zp=class Zp extends Ar{constructor(t,o){super(t,o.mvfData);u(this,"__type",Zp.__type);S(this,Tm);S(this,Al);S(this,Xp,{});S(this,Yp);w(this,Tm,t),w(this,Al,o.floorId),w(this,Yp,o.mvfData)}static is(t){return t.__type===Zp.__type}get center(){return s(this,Xp).center==null&&(s(this,Xp).center=xr(s(this,Yp),s(this,Al))),s(this,Xp).center}get floor(){let t=s(this,Tm).getById("floor",s(this,Al));if(t==null)throw new Error(`Floor ${s(this,Al)} not found!`);return t}get geoJSON(){return{...s(this,Yp),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{__type:Zp.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Tm=new WeakMap,Al=new WeakMap,Xp=new WeakMap,Yp=new WeakMap,u(Zp,"__type","area");var uv=Zp,jn=uv;d();var Rl,Es,_l,Bl,Jp=class Jp extends Ar{constructor(t,o){super(t,o.mvfData);u(this,"__type",Jp.__type);S(this,Rl);S(this,Es);S(this,_l);S(this,Bl);w(this,Es,{}),w(this,Bl,o.mvfData),w(this,Rl,t),w(this,_l,o.floorId)}static is(t){return t.__type===Jp.__type}get floor(){let t=s(this,Rl).getById("floor",s(this,_l));if(t==null)throw new Error(`Floor ${s(this,_l)} not found!`);return t}get center(){return s(this,Es).center==null&&(s(this,Es).center=xr(s(this,Bl),s(this,_l))),s(this,Es).center}get isExterior(){if(s(this,Bl).properties.isExterior)return!0;let t=s(this,Rl).obstructionIdByEntranceId[this.id];return s(this,Rl).getMVFFeatureById("obstruction",t)?.properties.footprintComponent??!1}get geoJSON(){return{...s(this,Bl),properties:null}}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Jp.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of Object.keys(s(this,Es)))delete s(this,Es)[t]}};Rl=new WeakMap,Es=new WeakMap,_l=new WeakMap,Bl=new WeakMap,u(Jp,"__type","door");var mv=Jp,Gn=mv;d();var Fa,Nl,Bo,Ds,Kp=class Kp extends Ar{constructor(t,o){super(t,o.mvfData);u(this,"__type",Kp.__type);S(this,Fa);S(this,Nl);S(this,Bo,{});S(this,Ds);w(this,Fa,t),w(this,Nl,o.floorId),w(this,Ds,o.mvfData)}static is(t){return t.__type===Kp.__type}get type(){return zj(s(this,Ds).properties.kind)}get locations(){if(s(this,Bo).locations)return s(this,Bo).locations;s(this,Bo).locations=[];let t=s(this,Fa).mvfLocationsBySpaceId[s(this,Ds).properties.id];if(t?.length>0)for(let o of t){let n=s(this,Fa).getById("enterprise-location",o.id);n&&s(this,Bo).locations.push(n)}return s(this,Bo).locations}get floor(){let t=s(this,Fa).getById("floor",s(this,Nl));if(t==null)throw new Error(`Floor ${s(this,Nl)} not found!`);return t}get doors(){return s(this,Ds).properties.destinationNodes.reduce((t,o)=>{let n=s(this,Fa).doorsByNodeId[o];return n&&t.push(n),t},[])}get center(){return s(this,Bo).center==null&&(s(this,Bo).center=xr(s(this,Ds),s(this,Nl))),s(this,Bo).center}get geoJSON(){return{...s(this,Ds),properties:null}}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Kp.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of Object.keys(s(this,Bo)))delete s(this,Bo)[t]}};Fa=new WeakMap,Nl=new WeakMap,Bo=new WeakMap,Ds=new WeakMap,u(Kp,"__type","space");var fv=Kp,Wj=["room","hallway","exterior","void","gate"];function zj(e){if(e==null||e==="default")return"room";let r=e.toLowerCase();return Wj.includes(r)?r:"room"}var cr=fv;d();var sn,ct,No,qp,e1,Qp=class Qp extends Nn{constructor(t,o){super(o.mvfData.properties.id,t);S(this,qp);u(this,"__type",Qp.__type);S(this,sn);S(this,ct,{});S(this,No);w(this,sn,t),w(this,No,o.mvfData)}static is(t){return t.__type===Qp.__type}get focusTarget(){return this}get name(){if(!("name"in s(this,No).properties))return s(this,No).properties.externalId??"";let t=W(this,qp,e1).call(this,"name");return typeof t=="string"?t:""}get shortName(){if(!("shortName"in s(this,No).properties))return s(this,No).properties.externalId??"";let t=W(this,qp,e1).call(this,"shortName");return typeof t=="string"?t:""}get subtitle(){let t=W(this,qp,e1).call(this,"subtitle");return typeof t=="string"?t:""}get externalId(){return s(this,No).properties.externalId??""}get elevation(){return s(this,No).properties.elevation}get spaces(){if(s(this,ct).spaces==null){let t=s(this,sn).spaces.filter(o=>o.floor.id===this.id);s(this,ct).spaces=t}return s(this,ct).spaces}get geoJSON(){return{type:"Feature",properties:null,geometry:s(this,No).geometry??{type:"Polygon",coordinates:[]}}}get objects(){if(s(this,ct).objects==null){let t=s(this,sn).objects.filter(o=>o.floor.id===this.id);s(this,ct).objects=t}return s(this,ct).objects}get connections(){if(s(this,ct).connections==null){let t=s(this,sn).connections.filter(o=>o.floors.includes(this));s(this,ct).connections=t}return s(this,ct).connections}get doors(){if(s(this,ct).doors==null){let t=s(this,sn).doors.filter(o=>o.floor.id===this.id);s(this,ct).doors=t}return s(this,ct).doors}get annotations(){if(s(this,ct).annotations==null){let t=s(this,sn).annotations.filter(o=>o.floor.id===this.id);s(this,ct).annotations=t}return s(this,ct).annotations}get pois(){if(s(this,ct).pois==null){let t=s(this,sn).pointsOfInterest.filter(o=>o.floor.id===this.id);s(this,ct).pois=t}return s(this,ct).pois}get floorStack(){if(s(this,ct).floorStack==null){let t=s(this,sn).floorStacks.find(o=>o.floors.includes(this));s(this,ct).floorStack=t}return s(this,ct).floorStack}get center(){return s(this,ct).center==null&&(s(this,ct).center=xr(s(this,No),this.id)),s(this,ct).center}toJSON(){return{__type:Qp.__type,id:this.id,name:this.name,shortName:this.shortName,subtitle:this.subtitle,elevation:this.elevation,spaces:this.spaces.map(t=>t.id),objects:this.objects.map(t=>t.id),connections:this.connections.map(t=>t.id),doors:this.doors.map(t=>t.id),annotations:this.annotations.map(t=>t.id),pois:this.pois.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(s(this,ct)))delete s(this,ct)[t]}};sn=new WeakMap,ct=new WeakMap,No=new WeakMap,qp=new WeakSet,e1=function(t){let o=s(this,No).properties[t];return s(this,sn).getPropTranslation(this.__type,t,this.id,o)},u(Qp,"__type","floor");var hv=Qp,bo=hv;d();d();d();function ed(e){let r;if(cr.is(e)||Gn.is(e)||xo.is(e)||jn.is(e)||an.is(e))r=e.center;else if(ks.is(e)||Ls.is(e))r=e.coordinate;else if(ce.is(e))r=e;else if(nn.is(e))r=e.coordinate;else if(ki.is(e))r=e.coordinates[0];else return;return r}d();d();var Mm={debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!0,floorGap:10}},Li="ExteriorWalls",Ea="Walls",L6=0,td="InteriorDoors",rd="ExteriorDoors",Xt="GeometryLayer",Ai="LabelsLayer",Un="MarkersLayer",od="FootprintLayer",Da="OcclusionLayer",gv="AreasLayer",nd="ImagesLayer",jl="FacadesLayer",Ri="PathsLayer";var A6=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com","https://staging.mappedin.com","https://mappedin-staging.auth0.com/userinfo","https://mappedin.com","https://mappedin.auth0.com/userinfo"],Zj={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};var Xj=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors"]),Yj=new Set(["style","enabled","layersHiddenByGeometry","lowDpi"]);function yv(e){e.outdoorView?.enabled&&!e.outdoorView?.token&&L.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function bv(e,r){let t=e?.outdoorView?.token||r.outdoorViewToken,o={...Mm,...e,outdoorView:{enabled:e?.outdoorView?.enabled===void 0?!!t:e?.outdoorView?.enabled,layersHiddenByGeometry:Mm.outdoorView?.layersHiddenByGeometry,...e?.outdoorView},bearing:e?.bearing??r.naturalBearing??0,imagePlacementOptions:{...Mm.imagePlacementOptions,...e?.imagePlacementOptions},multiFloorView:{...Mm.multiFloorView,...e?.multiFloorView}};return t&&o.outdoorView&&(o.outdoorView.token=t),o}function R6(e){let r={remove_watermark:!1};if(e)try{let t=Zh(e);Object.assign(r,t.capabilities)}catch(t){L.error("Error decoding capabilities from token",t)}return r}function _6(e){let r=Object.fromEntries(Object.entries(e).filter(([t])=>Xj.has(t)));return r.outdoorView&&(r.outdoorView=Object.fromEntries(Object.entries(r.outdoorView).filter(([t])=>Yj.has(t)))),r}var ka,ln,As,id=class id extends Ar{constructor(t,o){let n=Object.values(o.mvfDataByFloorId)[0];super(t,n);u(this,"__type",id.__type);S(this,ka);S(this,ln);S(this,As);w(this,ln,{}),w(this,ka,t),w(this,As,o.mvfDataByFloorId)}static is(t){return t.__type===id.__type}get accessible(){return Object.values(s(this,As))[0].properties.accessible??!1}get type(){return Object.values(s(this,As))[0].properties.kind?.split(".")[1]??"unknown"}get extra(){return Object.values(s(this,As))[0].properties.extra}get coordinates(){return s(this,ln).coordinates==null&&(s(this,ln).coordinates=Object.entries(s(this,As)).map(([t,o])=>xr(o,t))),s(this,ln).coordinates}get nodes(){return Object.values(s(this,As))[0].properties.nodes.map(t=>s(this,ka).getById("node",t))}get floors(){return this.coordinates.map(t=>t.floorId?s(this,ka).getById("floor",t.floorId):void 0).filter(Mu)}get locationProfiles(){if(s(this,ln).locationProfiles!=null)return s(this,ln).locationProfiles;let t=super.locationProfiles;if(t==null||t.length===0){let o=[this.coordinates[0]?.longitude??0,this.coordinates[0]?.latitude??0],n=Di(o),i=s(this,ka).mvfConnectionIdsByLatLon[n]??[];for(let a of i){let l=s(this,ka).locationProfilesByAttachedFeatureId[a];if(l!=null){t=l;break}}}return s(this,ln).locationProfiles=t??[],t}get focusTarget(){return this.coordinates}toJSON(){return{__type:id.__type,id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(t=>t.toJSON()),floors:this.floors.map(t=>t.id),extra:this.extra}}destroy(){for(let t of Object.keys(s(this,ln)))delete s(this,ln)[t]}};ka=new WeakMap,ln=new WeakMap,As=new WeakMap,u(id,"__type","connection");var xv=id,La=xv;d();var wm,Gl,Aa,Ul,sd=class sd extends Ar{constructor(t,o){super(t,o.mvfData);u(this,"__type",sd.__type);S(this,wm);S(this,Gl);S(this,Aa,{});S(this,Ul);w(this,wm,t),w(this,Gl,o.floorId),w(this,Ul,o.mvfData)}static is(t){return t.__type===sd.__type}get type(){let t=s(this,Ul).properties.kind;return t==null&&(t="object"),t==="Desks"&&(t="desk"),t.toLowerCase()}get floor(){let t=s(this,wm).getById("floor",s(this,Gl));if(t==null)throw new Error(`Floor ${s(this,Gl)} not found!`);return t}get center(){return s(this,Aa).center==null&&(s(this,Aa).center=xr(s(this,Ul),s(this,Gl))),s(this,Aa).center}get geoJSON(){return{...s(this,Ul),properties:null}}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{__type:sd.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of globalThis.Object.keys(s(this,Aa)))s(this,Aa)[t]=null}};wm=new WeakMap,Gl=new WeakMap,Aa=new WeakMap,Ul=new WeakMap,u(sd,"__type","object");var vv=sd,xo=vv;d();var Om,Vl,Ra,ld,ad=class ad extends Ar{constructor(t,o){super(t,o.mvfData);u(this,"__type",ad.__type);S(this,Om);S(this,Vl);S(this,Ra,{});S(this,ld);w(this,Om,t),w(this,ld,o.mvfData),w(this,Vl,o.floorId)}static is(t){return t.__type===ad.__type}get floor(){let t=s(this,Om).getById("floor",s(this,Vl));if(t==null)throw new Error(`Floor ${s(this,Vl)} not found!`);return t}get coordinate(){return s(this,Ra).coordinate==null&&(s(this,Ra).coordinate=xr(s(this,ld),s(this,Vl))),s(this,Ra).coordinate}get geoJSON(){return{...s(this,ld),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:ad.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let t in s(this,Ra))s(this,Ra)[t]=null}};Om=new WeakMap,Vl=new WeakMap,Ra=new WeakMap,ld=new WeakMap,u(ad,"__type","point-of-interest");var Iv=ad,ks=Iv;d();var Pm,Hl,_a,$l,Fm,Cv,cd=class cd extends Ar{constructor(t,o){super(t,o.mvfData);S(this,Fm);u(this,"__type",cd.__type);S(this,Pm);S(this,Hl);S(this,_a,{});S(this,$l);w(this,Pm,t),w(this,Hl,o.floorId),w(this,$l,o.mvfData)}static is(t){return t.__type===cd.__type}get group(){return W(this,Fm,Cv).call(this).group}get type(){return W(this,Fm,Cv).call(this).type}get coordinate(){return s(this,_a).coordinate==null&&(s(this,_a).coordinate=xr(s(this,$l),s(this,Hl))),s(this,_a).coordinate}get floor(){let t=s(this,Pm).getById("floor",s(this,Hl));if(t==null)throw new Error(`Floor ${s(this,Hl)} not found!`);return t}get geoJSON(){return{...s(this,$l),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:cd.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let t of Object.keys(s(this,_a)))delete s(this,_a)[t]}};Pm=new WeakMap,Hl=new WeakMap,_a=new WeakMap,$l=new WeakMap,Fm=new WeakSet,Cv=function(){let[t,o]=s(this,$l).properties.symbolId.split("--");return{group:t,type:o}},u(cd,"__type","annotation");var Sv=cd,Ls=Sv;d();var Ba,cn,Vn,dd,Em,Mv,pd=class pd extends Nn{constructor(t,o){super(o.mvfData.id,t);S(this,Em);u(this,"__type",pd.__type);S(this,Ba);S(this,cn,{});S(this,Vn);S(this,dd);w(this,Ba,t),w(this,Vn,o.mvfData),w(this,dd,o.facadeId)}static is(t){return t.__type===pd.__type}get type(){return s(this,Vn).type}get name(){let t=W(this,Em,Mv).call(this,"name");return typeof t=="string"?t:""}get shortName(){let t=W(this,Em,Mv).call(this,"shortName");return typeof t=="string"?t:""}get externalId(){return s(this,Vn).externalId??""}get floors(){if(s(this,cn).floors==null){let t=(s(this,Vn).floors??s(this,Vn).maps??[]).reduce((o,n)=>{let i=s(this,Ba).floorsById[n];return i&&o.push(i),o},[]);t.length===0&&L.error(`Floor stack ${this.id} has no floors`),s(this,cn).floors=t.sort((o,n)=>o.elevation-n.elevation)}return s(this,cn).floors}get defaultFloor(){if(s(this,cn).defaultFloor!=null)return s(this,cn).defaultFloor;let t=s(this,Vn).defaultFloor?s(this,Ba).getById("floor",s(this,Vn).defaultFloor):void 0;return s(this,cn).defaultFloor=t||this.floors.reduce((o,n)=>Math.abs(n.elevation)<Math.abs(o.elevation)?n:o),s(this,cn).defaultFloor}get facade(){return s(this,dd)?s(this,Ba).facadesById[s(this,dd)]:void 0}toJSON(){return{__type:pd.__type,id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(s(this,cn)))delete s(this,cn)[t]}};Ba=new WeakMap,cn=new WeakMap,Vn=new WeakMap,dd=new WeakMap,Em=new WeakSet,Mv=function(t){return s(this,Ba).getPropTranslation(this.__type,t,this.id,s(this,Vn)[t])},u(pd,"__type","floor-stack");var Tv=pd,t1=Tv;d();var md,Wl,fd,_i,ud=class ud extends Nn{constructor(t,o){super(o.mvfData.id,t);u(this,"__type",ud.__type);S(this,md);S(this,Wl);S(this,fd);S(this,_i,{});w(this,md,o.mvfData),w(this,Wl,t),w(this,fd,o.floorStackId)}static is(t){return t.__type===ud.__type}get floorStack(){return s(this,Wl).getById("floor-stack",s(this,fd))}get spaces(){if(!s(this,_i).spaces){s(this,_i).spaces=[];for(let t of s(this,md).spaces){let o=s(this,Wl).getById("space",t.spaceId);o&&s(this,_i).spaces.push(o)}}return s(this,_i).spaces}get center(){if(!s(this,_i).center){let t={type:"FeatureCollection",features:[]};for(let n of this.spaces){let i=s(this,Wl).mvfSpacesById[n.id];i&&t.features.push(i)}if(t.features.length===0)throw new fr("No geometry found for facade!");let o=jp(t);s(this,_i).center=new ce({latitude:o.geometry.coordinates[1],longitude:o.geometry.coordinates[0],floorId:s(this,md).spaces[0].floorId})}return s(this,_i).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}toJSON(){return{id:this.id,__type:ud.__type,floorStackId:s(this,fd),floorStack:this.floorStack,spaces:this.spaces}}};md=new WeakMap,Wl=new WeakMap,fd=new WeakMap,_i=new WeakMap,u(ud,"__type","facade");var wv=ud,an=wv;d();var Jj=new Set(["wall","area"]),Kj=new Set(["void","desk-entrance"]),Qj=(e,r)=>{let t={},o={},n={},i={},a={},l={};for(let c of e["location.json"]||[]){let p=new zl(r,{mvfData:c});if(t[c.id]=p,c.externalId&&(i[c.externalId]==null&&(i[c.externalId]=[]),i[c.externalId].push(p)),c.categories)for(let f of c.categories)a[f]==null&&(a[f]=[]),a[f].push(p);let m=[...c.obstructions?.map(f=>f.id)??[],...c.spaces?.map(f=>f.id)??[],...c.annotations?.map(f=>f.id)??[],...c.connections??[],...c.entrances?.map(f=>f.id)??[],...c.areas?.map(f=>f.id)??[]];for(let f of m)f&&(l[f]==null&&(l[f]=[]),l[f].push(p))}for(let c of e["category.json"]||[]){let p=new o1(r,{mvfData:c});o[c.id]=p,c.parent&&(n[c.parent]==null&&(n[c.parent]=[]),n[c.parent].push(p))}return{locationCategoriesByParentId:n,locationProfilesById:t,locationCategoriesById:o,locationProfilesByExternalId:i,locationProfilesByCategoryId:a,locationProfilesByAttachedFeatureId:l}},qj=(e,r,t)=>{let o={},n={},i={},a={},l={},c={},p={},m={},f={},g={},b={},x=globalThis.Object.keys(e.space);for(let C of x){let v=e.space[C];if(v!=null){for(let I of v.features)if(b[I.properties.id]=C,c[I.properties.id]=I,I.properties.kind==="desk-entrance"&&(l[I.properties.externalId]==null&&(l[I.properties.externalId]=[]),l[I.properties.externalId].push(...I.properties.destinationNodes)),!("kind"in I.properties&&I.properties.kind==null||Kj.has(I.properties.kind??""))){if(I.properties.kind?.includes("connection")){let M=Di(I.geometry.coordinates);f[M]==null&&(f[M]=[]),f[M].push(I.properties.id);continue}if(I.properties.kind==="poi"||I.geometry.type==="Point"&&I.properties.kind==null){let M=new ks(t,{floorId:C,mvfData:I});i[I.properties.id]=M,m[C]||(m[C]=[]),m[C].push(I),I.properties.externalId&&(a[I.properties.externalId]==null&&(a[I.properties.externalId]=[]),a[I.properties.externalId].push(M))}else if(I.geometry.type==="Point")L.warn("Encountered a point space with an unknown kind!",I.properties.kind);else{let M=new cr(t,{floorId:C,mvfData:I});o[I.properties.id]=M,I.properties.externalId&&(n[I.properties.externalId]==null&&(n[I.properties.externalId]=[]),n[I.properties.externalId].push(M)),p[C]||(p[C]=[]),p[C].push(I)}}}}for(let C in f){let v=f[C],I={};for(let O of v){let T=b[O],P=c[O],B=r?.["n_"+P.properties.id.split("s_")[1]];I[T]={...P,properties:{...P.properties,accessible:B?.accessible===!0}}}let M=new La(t,{mvfDataByFloorId:I});g[M.id]=M}return{spacesById:o,spacesByExternalId:n,poisById:i,poisByExternalId:a,connectionsById:g,objectEntranceNodeIdsByObstructionId:l,mvfSpacesById:c,connectionIdsByLatLon:f,mvfSpacesByFloorId:p,mvfPoisByFloorId:m}},eG=(e,r)=>{let t={},o={},n={},i={};for(let a of e["node.geojson"].features){n[a.properties.id]=a;let l=new nn(r,{mvfData:a,floorId:a.properties.floor??a.properties.map});t[a.properties.id]=l,a.properties.externalId&&(o[a.properties.externalId]==null&&(o[a.properties.externalId]=[]),o[a.properties.externalId].push(l));let c=a.properties.floor??a.properties.map;i[c]||(i[c]=[]),i[c].push(a)}return{nodesById:t,nodesByExternalId:o,mvfNodesById:n,mvfNodesByFloorId:i}},tG=(e,r)=>{let t={},o={},n={},i={},a=globalThis.Object.keys(e.obstruction);for(let l of a){let c=e.obstruction[l];if(c!=null)for(let p of c.features){n[p.properties.id]=p;for(let f of p.properties.entrances)i[f]=p.properties.id;if(Jj.has(p.properties.kind?.toLowerCase()??""))continue;let m=new xo(r,{floorId:l,mvfData:p});t[p.properties.id]=m,p.properties.externalId&&(o[p.properties.externalId]==null&&(o[p.properties.externalId]=[]),o[p.properties.externalId].push(m))}}return{objectsById:t,objectsByExternalId:o,mvfObstructionById:n,obstructionIdByEntranceId:i}},rG=(e,r)=>{let t={},o={},n={};if("floor.geojson"in e&&e["floor.geojson"]!=null)for(let i of e["floor.geojson"].features){n[i.properties.id]=i.properties;let a=new bo(r,{mvfData:i});t[i.properties.id]=a,i.properties.externalId&&(o[i.properties.externalId]==null&&(o[i.properties.externalId]=[]),o[i.properties.externalId].push(a))}else for(let i of e["map.geojson"]){n[i.id]=i;let a=new bo(r,{mvfData:{properties:i}});t[i.id]=a}return{floorsById:t,floorsByExternalId:o,mvfFloorsById:n}},oG=(e,r)=>{let t={},o={},n={},i={},a={},l=e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"];if(l!=null)for(let c of l){let p=e.facade?.[c.id],m=new t1(r,{mvfData:c,facadeId:p?.id});if(t[c.id]=m,c.externalId&&(o[c.externalId]==null&&(o[c.externalId]=[]),o[c.externalId].push(m)),n[c.id]=c,p){let f=new an(r,{mvfData:p,floorStackId:c.id});i[p.id]=f;for(let g of p.spaces)a[g.spaceId]=f}}return{floorStacksById:t,floorStacksByExternalId:o,mvfFloorStacksById:n,facadesById:i,facadesBySpaceId:a}},nG=(e,r)=>{let t={},o={},n=e["connection.json"].reduce((i,a)=>{a.nodes.forEach(c=>i[c]=a),t[a.id]=a;let l=r?.[a.nodes[0]];if(l!=null){let c=Di(l.geometry.coordinates);o[c]==null&&(o[c]=[]),o[c].push(a.id)}return i},{});return{mvfConnectionsById:t,mvfConnectionsByNodeId:n,mvfConnectionIdsByLatLon:o}},iG=(e,r)=>{let t={},o={},n={},i={},a={},l=globalThis.Object.keys(e.entrance);for(let c of l){let p=e.entrance[c];if(p!=null)for(let m of p.features){i[m.properties.id]=m;let f=new Gn(r,{floorId:c,mvfData:m});m.properties.node&&(n[m.properties.node]=f),t[m.properties.id]=f,m.properties.externalId&&(o[m.properties.externalId]==null&&(o[m.properties.externalId]=[]),o[m.properties.externalId].push(f)),a[c]||(a[c]=[]),a[c].push(m)}}return{doorsById:t,doorsByExternalId:o,doorsByNodeId:n,mvfEntrancesById:i,mvfEntrancesByFloorId:a}},sG=(e,r,t)=>{if(e.textAreas!=null)for(let o in e.textAreas){let n=e.textAreas[o]?.features;if(n!=null){for(let i of n)if("anchorId"in i.properties){let a=i?.properties,l=r[a.anchorId]||t[a.anchorId];if(l!=null&&a!=null){let c=l.properties;c.textArea=a,c.textArea&&(c.textArea.position=i.geometry.coordinates)}}}}},aG=(e,r,t)=>{if(e.floorImages!=null)for(let o in e.floorImages){let n=e.floorImages[o]?.features;if(n!=null){for(let i of n)if("anchorId"in i.properties){let a=i?.properties,l=r[a.anchorId]||t[a.anchorId];if(l!=null&&a!=null){let c=l.properties;c.image=a,c.image&&(c.image.position=i.geometry.coordinates)}}}}},lG=(e,r)=>{if(e.enterprise?.enterpriseStyles==null)return;let t=e.enterprise?.enterpriseStyles;for(let o in t){let n=t[o];n.geometryAnchors.forEach(i=>{let a=r[i.geometryId];if(a!=null){let l=a.properties;l.style={styleId:o,edgeOffset:n.edgeOffset}}})}},cG=(e,r,t)=>{if(!(e.enterprise==null||e.enterprise.textures==null))for(let o of e.enterprise.textures)for(let n of o.geometryAnchors){let i=r[n.geometryId]||t[n.geometryId];if(i!=null){let a=i.properties;a.textures==null&&(a.textures=[]),a.textures.push(o)}}},pG=(e,r)=>{let t={},o={},n={};if(e.annotation==null)return{annotationsById:t,mvfAnnotationsById:o,mvfAnnotationsByFloorId:n};let i=globalThis.Object.keys(e.annotation);for(let a of i){let l=e.annotation[a];if(l!=null)for(let c of l.features){o[c.properties.id]=c;let p=new Ls(r,{floorId:a,mvfData:c});t[c.properties.id]=p,n[a]||(n[a]=[]),n[a].push(c)}}return{annotationsById:t,mvfAnnotationsById:o,mvfAnnotationsByFloorId:n}},dG=(e,r)=>{let t={},o={},n={};if(e.area==null)return{areasById:t,areasByExternalId:o,mvfAreasById:n};let i=globalThis.Object.keys(e.area);for(let a of i){let l=e.area[a];if(l!=null)for(let c of l.features){n[c.properties.id]=c;let p=new jn(r,{floorId:a,mvfData:c});t[c.properties.id]=p,c.properties.externalId&&(o[c.properties.externalId]==null&&(o[c.properties.externalId]=[]),o[c.properties.externalId].push(p))}}return{areasById:t,areasByExternalId:o,mvfAreasById:n}},B6=(e,r)=>{let t={},o={},n={},i={},a=(e.enterprise?.locations??[]).reduce((M,O)=>(M[O.id]=O,M),{}),l={},c={},p={},m={},f={},g={},b=e.enterprise?.venue||{},x={},C={},v={};for(let M of e.enterprise?.categories??[]){let O=new r1(r,{mvfData:M});l[M.id]=O,M.externalId&&(c[M.externalId]==null&&(c[M.externalId]=[]),c[M.externalId].push(O)),p[M.id]=M,M.locations.forEach(T=>{f[T]==null&&(f[T]=[]),f[T].push(M.id)})}let I={};for(let M of e.enterprise?.locationInstances??[]){let O=a[M.parent],T=Object.keys(O),P={};for(let G of T)P[G]=void 0;let B={...P,polygons:[],nodes:[],...M};I[B.parent]==null&&(I[B.parent]=[]),I[B.parent].push(new ki(r,{mvfData:B,categoryIds:e.enterprise?.categoryPriorities?.[B.id]||f[B.id],parentId:M.parent})),x[B.id]=M}for(let M in e.space){let O=e.space[M];if(O!=null)for(let T of O.features){for(let P of T.properties.destinationNodes)C[P]==null&&(C[P]=[]),C[P].push(T.properties.id);v[T.properties.id]=T.properties.destinationNodes}}for(let M of e.enterprise?.locations??[]){let O=new ki(r,{mvfData:M,categoryIds:e.enterprise?.categoryPriorities?.[M.id]||f[M.id],locationInstances:I[M.id]});n[M.id]=O,M.externalId&&(i[M.externalId]==null&&(i[M.externalId]=[]),i[M.externalId].push(O)),M.nodes.forEach(T=>{g[T.id]==null&&(g[T.id]=[]),g[T.id].push(M.id)});for(let T of M.polygons)m[T.id]==null&&(m[T.id]=[]),m[T.id].push(M)}if(r.enterpriseMode===!0){for(let M in r.mvfConnectionsById){let O={},T=r.mvfConnectionsById[M];for(let P of r.mvfConnectionsById[M].nodes){let B=r.nodesById[P];B!=null&&(O[B.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[B.coordinate.longitude,B.coordinate.latitude]},properties:{id:M,externalId:T.externalId,kind:"enterprise."+T.type,destinationNodes:[],flags:"",type:T.type,nodes:T.nodes,accessible:T.accessible,extra:T.extra,details:T.details}})}Object.keys(O).length>0&&(t[M]=new La(r,{mvfDataByFloorId:O}),T.externalId&&(o[T.externalId]==null&&(o[T.externalId]=[]),o[T.externalId].push(t[M])))}r.connectionsById=t}return{spaceIdsByNodeId:C,connectionsByExternalId:o,locationIdsByNodeId:g,mvfLocationsBySpaceId:m,mvfLocationsById:a,mvfCategoriesById:p,locationsById:n,locationsByExternalId:i,locationInstancesById:x,categoriesById:l,categoriesByExternalId:c,destinationNodesIdsBySpaceId:v,venue:b}},N6=(e,r)=>{let{nodesById:t,nodesByExternalId:o,mvfNodesById:n,mvfNodesByFloorId:i}=eG(e,r),{mvfConnectionsById:a,mvfConnectionsByNodeId:l,mvfConnectionIdsByLatLon:c}=nG(e,n),{spacesById:p,spacesByExternalId:m,poisById:f,poisByExternalId:g,mvfSpacesById:b,objectEntranceNodeIdsByObstructionId:x,connectionsById:C,connectionIdsByLatLon:v,mvfSpacesByFloorId:I,mvfPoisByFloorId:M}=qj(e,l,r),{objectsById:O,objectsByExternalId:T,mvfObstructionById:P,obstructionIdByEntranceId:B}=tG(e,r),{floorsById:G,floorsByExternalId:A,mvfFloorsById:N}=rG(e,r),{floorStacksById:z,floorStacksByExternalId:Z,mvfFloorStacksById:oe,facadesById:J,facadesBySpaceId:fe}=oG(e,r),{doorsById:ye,doorsByExternalId:Te,doorsByNodeId:ve,mvfEntrancesById:we,mvfEntrancesByFloorId:ie}=iG(e,r),{annotationsById:Me,mvfAnnotationsById:tt,mvfAnnotationsByFloorId:Ze}=pG(e,r),{areasById:rt,areasByExternalId:Ke,mvfAreasById:be}=dG(e,r);aG(e,b,P),sG(e,b,P),lG(e,b),cG(e,b,P);let{locationCategoriesByParentId:gt,locationProfilesById:wt,locationCategoriesById:Kt,locationProfilesByExternalId:k,locationProfilesByCategoryId:H,locationProfilesByAttachedFeatureId:F}=Qj(e,r);return{spacesById:p,spacesByExternalId:m,nodesById:t,nodesByExternalId:o,objectsById:O,objectsByExternalId:T,floorsById:G,floorsByExternalId:A,floorStacksById:z,floorStacksByExternalId:Z,facadesById:J,facadesBySpaceId:fe,connectionsById:C,doorsById:ye,doorsByExternalId:Te,doorsByNodeId:ve,poisById:f,poisByExternalId:g,annotationsById:Me,areasById:rt,areasByExternalId:Ke,objectEntranceNodeIdsByObstructionId:x,obstructionIdByEntranceId:B,connectionIdsByLatLon:v,locationProfilesById:wt,locationCategoriesById:Kt,locationProfilesByExternalId:k,locationProfilesByCategoryId:H,locationCategoriesByParentId:gt,mvfSpacesById:b,mvfNodesById:n,mvfObstructionById:P,mvfFloorsById:N,mvfFloorStacksById:oe,mvfConnectionsById:a,mvfConnectionsByNodeId:l,mvfEntrancesById:we,mvfAnnotationsById:tt,mvfNodesByFloorId:i,mvfSpacesByFloorId:I,mvfPoisByFloorId:M,mvfAreasById:be,mvfEntrancesByFloorId:ie,mvfAnnotationsByFloorId:Ze,locationProfilesByAttachedFeatureId:F,mvfConnectionIdsByLatLon:c}};d();var uG=new Set(["polygons"]),pn,pt,zr,Dm,hd=class hd extends lr{constructor(t,o){super(o.mvfData.externalId);u(this,"__type",hd.__type);u(this,"description");u(this,"name","");u(this,"amenity");u(this,"externalId","");u(this,"extra");u(this,"gallery");u(this,"instances");u(this,"logo");u(this,"operationHours");u(this,"phone");u(this,"picture");u(this,"shortName");u(this,"showFloatingLabelWhenImagePresent");u(this,"showLogo");u(this,"siblingGroups");u(this,"social");u(this,"sortOrder",-1);u(this,"states");u(this,"tags");u(this,"type","");u(this,"hidden",!1);u(this,"primaryCategory");S(this,pn);S(this,pt,{});S(this,zr);S(this,Dm);w(this,pn,t),w(this,zr,o.mvfData),w(this,Dm,o.categoryIds||[]),this.instances=o.locationInstances||[];for(let n in o.mvfData)!uG.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{enumerable:!0,get(){if(o.parentId){let i=s(this,pn).locationsById[o.parentId];return s(this,zr)[n]!=null?s(this,pn).getPropTranslation(this.__type,n,s(this,zr).id,s(this,zr)[n]):s(this,pn).getPropTranslation(this.__type,n,s(this,zr).id,i[n])}return s(this,pn).getPropTranslation(this.__type,n,s(this,zr).id,s(this,zr)[n])}})}static is(t){return t.__type===hd.__type}get focusTarget(){return this.spaces}get categories(){return s(this,pt).categories?s(this,pt).categories:(s(this,pt).categories=(s(this,Dm).map(t=>s(this,pn).getById("enterprise-category",t))||[]).filter(Boolean),s(this,pt).categories)}get coordinates(){if(s(this,pt).coordinates)return s(this,pt).coordinates;s(this,pt).coordinates=[];for(let t=0;t<this.nodes.length;t++)s(this,pt).coordinates.push(this.nodes[t].coordinate);return s(this,pt).coordinates}get nodes(){if(s(this,pt).nodes)return s(this,pt).nodes;s(this,pt).nodes=[];for(let t=0;t<s(this,zr).nodes.length;t++){let o=s(this,pn).getById("node",s(this,zr).nodes[t].id);o&&s(this,pt).nodes.push(o)}return s(this,pt).nodes}get points(){if(s(this,pt).points)return s(this,pt).points;s(this,pt).points=[];for(let t=0;t<s(this,zr).spaces.length;t++){let o=s(this,pn).getById("point-of-interest",s(this,zr).spaces[t].id);o&&s(this,pt).points.push(o)}return s(this,pt).points}get spaces(){if(s(this,pt).spaces)return s(this,pt).spaces;s(this,pt).spaces=[];for(let t=0;t<s(this,zr).polygons.length;t++){let o=s(this,pn).getById("space",s(this,zr).polygons[t].id);o&&s(this,pt).spaces.push(o)}return s(this,pt).spaces}toJSON(){return{__type:hd.__type,id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,pt)))delete s(this,pt)[t]}};pn=new WeakMap,pt=new WeakMap,zr=new WeakMap,Dm=new WeakMap,u(hd,"__type","enterprise-location");var Ov=hd,ki=Ov;d();var mG=new Set,Zl,eo,Bi,gd=class gd extends lr{constructor(t,o){super(o.mvfData.externalId);u(this,"__type",gd.__type);u(this,"name","");u(this,"color");u(this,"externalId","");u(this,"extra");u(this,"icon");u(this,"iconFromDefaultList");u(this,"sortOrder",-1);u(this,"picture");S(this,Zl);S(this,eo,{});S(this,Bi);w(this,Zl,t),w(this,Bi,o.mvfData);for(let n in o.mvfData)!mG.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return s(this,Zl).getPropTranslation(this.__type,n,s(this,Bi).id,s(this,Bi)[n])}})}static is(t){return t.__type===gd.__type}get children(){if(s(this,eo).children)return s(this,eo).children;s(this,eo).children=[];for(let t=0;t<s(this,Bi).children.length;t++){let o=s(this,Zl).getById("enterprise-category",s(this,Bi).children[t]);o&&s(this,eo).children.push(o)}return s(this,eo).children}get locations(){if(s(this,eo).locations)return s(this,eo).locations;s(this,eo).locations=[];for(let t=0;t<s(this,Bi).locations.length;t++){let o=s(this,Zl).getById("enterprise-location",s(this,Bi).locations[t]);o&&s(this,eo).locations.push(o)}return s(this,eo).locations}toJSON(){return{__type:gd.__type,id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,eo)))delete s(this,eo)[t]}};Zl=new WeakMap,eo=new WeakMap,Bi=new WeakMap,u(gd,"__type","enterprise-category");var Pv=gd,r1=Pv;d();var fG=new Set,km,bd,yd=class yd extends lr{constructor(t,o){super(o.mvfData.externalId);u(this,"__type",yd.__type);u(this,"countrycode");u(this,"coverImage");u(this,"externalId","");u(this,"defaultLanguage",{code:"en",name:"English"});u(this,"defaultFloor");u(this,"extra");u(this,"icon");u(this,"languages",[]);u(this,"links",[]);u(this,"logo");u(this,"mappedinWebUrl");u(this,"operationHours");u(this,"slug","");u(this,"topLocations");u(this,"tzid");S(this,km,{});S(this,bd);w(this,bd,o.mvfData);for(let n in o.mvfData)!fG.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=o.mvfData[n])}static is(t){return t.__type===yd.__type}get name(){return s(this,bd).name??""}get defaultMap(){return s(this,bd).defaultMap??this.defaultFloor??""}toJSON(){return{__type:yd.__type,id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,km)))delete s(this,km)[t]}};km=new WeakMap,bd=new WeakMap,u(yd,"__type","enterprise-venue");var Fv=yd,Ev=Fv;d();d();function Lm(e,r,t=[]){let o={...e};for(let[n,i]of Object.entries(r))if(i!==void 0)if(n in o){let a=n;if(Array.isArray(i)&&i.length>0){let l=hG(i[0],t);if(l){let c=o[a];if(!Array.isArray(c))throw new Error(`Expected array at ${n}, got ${typeof c}`);let p=new Map(i.map(g=>[j6(g,l),g])),f=c.map(g=>{let b=p.get(j6(g,l));return b?Lm(g,b,t):g});o[a]=f}else o[a]=i}else{let l=o[a];typeof l=="object"&&l!==null&&typeof i=="object"&&i!==null?Object.keys(i).length===0?o[a]=i:o[a]=Lm(l,i,t):o[n]=i}}else o[n]=i;return o}function hG(e,r){function t(o){if(typeof o!="object"||o===null)return null;for(let n of r)if(n in o&&typeof o[n]<"u")return[n];if(Array.isArray(o))return null;for(let[n,i]of Object.entries(o)){let a=t(i);if(a)return[n,...a]}return null}return t(e)}function j6(e,r){return r.reduce((t,o)=>{if(t&&typeof t=="object")return t[o]},e)}d();d();d();d();d();var G6=(i=>(i.Departure="Departure",i.TakeConnection="TakeConnection",i.ExitConnection="ExitConnection",i.Turn="Turn",i.Arrival="Arrival",i))(G6||{}),Dv=(a=>(a.Straight="Straight",a.Right="Right",a.SlightRight="SlightRight",a.Left="Left",a.SlightLeft="SlightLeft",a.Back="Back",a))(Dv||{}),U6=(p=>(p.stairs="stairs",p.elevator="elevator",p.escalator="escalator",p.door="door",p.ramp="ramp",p.slide="slide",p.portal="portal",p.security="security",p.shuttle="shuttle",p))(U6||{}),n1=(t=>(t.Exterior="exterior-walls",t.Interior="interior-walls",t))(n1||{}),i1=(t=>(t.Interior="interior-doors",t.Exterior="exterior-doors",t))(i1||{});function dn(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}function gG(e){return new Map(e.map(r=>{let{properties:t}=r,{id:o}=t;return[o,r]}))}var kv=(e,r)=>{let t=gG(r),o={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:e[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let n of e){let i=[n.geometry.coordinates],a=(n.properties.entrances||[]).reduce((l,c)=>(t.has(c)&&l.push(t.get(c)),l),[]);if(a.length){let{entrances:l,obstructions:c}=nv(n,a);i=c.map(p=>p.geometry.coordinates),o.entrances.features.push(...l)}o.walls.geometry.coordinates.push(...i)}return o};function V6(e,r){return((r-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function H6(e,r){let t="Left";return e<=-Math.PI/4?t="Right":e<=-r?t="SlightRight":e<=r?t="Straight":e<=Math.PI/4?t="SlightLeft":t="Left",t}function $6(e){let r={};for(let t in e){let o=e[t];if(o!=null){if(o.id=t,"polygons"in o)for(let n of o.polygons)r[n]=o;else if("lineStrings"in o)for(let n of o.lineStrings)r[n]=o;else if("points"in o)for(let n of o.points)r[n]=o}}return r}function s1(e,r){return e.reduce((t,o)=>{let n=r[o.properties.id];if(n==null)return t;if("textures"in o.properties&&Array.isArray(o.properties.textures)&&o.properties.textures.length>0){let i={...n,id:n.id+"-textures"};t.set(i,[o])}else t.has(n)||t.set(n,[]),t.get(n).push(o);return t},new Map)}function xd(e,r={}){let t={...e,flipImageToFaceCamera:r?.flipImagesToFaceCamera??!0},o=r?.style?.shading??r?.shadingAndOutlines;if(o===!0?t.shading={start:.1,end:.15,intensity:.4}:typeof o=="object"&&(t.shading={start:o.start,end:o.end,intensity:o.intensity}),t.outline=r?.style?.outlines??r?.shadingAndOutlines,"lineStrings"in e){let n=r?.style?.wallTopColor??r?.wallTopColor;n!=null&&(t.topColor=n)}return t}var W6=(e,r)=>{let o=(r.currentMap?.currentFloor).layers.get(Xt);switch(e){case"interior-walls":return o?.layers.get(Ea);case"exterior-walls":return o?.layers.get(Li);case"interior-doors":return o?.layers.get(td);case"exterior-doors":return o?.layers.get(rd);default:return typeof e=="string"?e:e.id}};function Lv(e){return new Promise(r=>{e.onComplete(r),e.onStop(r)})}function a1(e){return e.bbox?e.bbox:Rc(e)}function z6(e,r){return[Math.min(e[0],r[0]),Math.min(e[1],r[1]),Math.max(e[2],r[2]),Math.max(e[3],r[3])]}function Av(e,r,t){return e.floorId&&r.has(e.floorId)?r.get(e.floorId):t}function vd(e){if(cr.is(e)||xo.is(e))return e.id}function Z6(e,r,t){let o=e.coordinates.length===2&&e.coordinates[0].floorId!==e.coordinates[1].floorId,n=!0;if(o&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let i=r?.getById("floor",e.coordinates[0].floorId),a=r?.getById("floor",e.coordinates[1].floorId);if(i&&a){let l=t.getState(i),c=t.getState(a);l!=null&&c!=null&&(n=l.visible&&c.visible&&l.altitude!==c.altitude)}}else{let i=e.coordinates[0].floorId!=null?r?.getById("floor",e.coordinates[0].floorId):void 0;n=i?t.getState(i)?.visible??!0:!0}return n}function X6(e,r){let t=e.properties.path.split("/"),o=t[t.length-1].split(".")[0],n=atob(o);return"img_"+Jh(n).toString()+"-"+r}var Y6=Math.PI*.1,to,vo,jo,Rs,Xl,Sd,un,J6,Id,K6,Na=class{constructor(r,t,o,n,i){S(this,un);u(this,"id");S(this,to,{});S(this,vo);S(this,jo);u(this,"departure");u(this,"destination");S(this,Rs);S(this,Xl);S(this,Sd);this.id=i?.id??nt(),w(this,vo,t),w(this,jo,r.features),this.departure=o,this.destination=n}get path(){return s(this,jo).map(r=>s(this,vo).getById("node",r.properties.id)).filter(Boolean)}get coordinates(){return s(this,to).coordinates?s(this,to).coordinates:(s(this,to).coordinates=s(this,jo).map(r=>new ce(r.geometry.coordinates[1],r.geometry.coordinates[0],r.properties.groupBy)),s(this,to).coordinates)}get distance(){return s(this,to).distance?s(this,to).distance:(s(this,to).distance=s(this,jo).reduce((r,t)=>r+(t.properties.distance||0),0),s(this,to).distance)}get instructions(){if(s(this,jo).length<2)return[];if(s(this,to).instructions)return s(this,to).instructions;let r=[],t=0;for(let o=0;o<s(this,jo).length;o++){let n=s(this,jo)[o],i=s(this,jo)[o-1],a=s(this,jo)[o+1],l=new ce(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),c=W(this,un,J6).call(this,{prevDirection:i,direction:n,nextDirection:a});t+=i?.properties.distance||0;for(let p of c)p&&(r.push({action:p,distance:t,coordinate:l,node:s(this,vo).getById("node",n.properties.id)}),t=0)}return s(this,to).instructions=r,s(this,to).instructions}toJSON(){return{id:this.id,directions:s(this,jo),__type:"directions",from:this.departure,to:this.destination}}};to=new WeakMap,vo=new WeakMap,jo=new WeakMap,Rs=new WeakMap,Xl=new WeakMap,Sd=new WeakMap,un=new WeakSet,J6=function(r){let{prevDirection:t,direction:o,nextDirection:n}=r,i=t&&s(this,vo).getById("floor",t.properties.groupBy),a=s(this,vo).getById("floor",o.properties.groupBy),l=n&&s(this,vo).getById("floor",n.properties.groupBy),c=[];t||c.push({type:"Departure"});let p=s(this,vo).getMVFFeatureByNodeId("connection",o.properties.id),m=p?s(this,vo).getById("connection",p.id):void 0,f=p&&p.nodes.length>1,g=s(this,vo).enterpriseMode&&(!o.properties.destination||!p?.nodes.includes(o.properties.destination)||!p?.nodes.includes(o.properties.id));if(p&&!(!f||g))if(!s(this,Rs)||s(this,Rs)==="exit")c.push(W(this,un,Id).call(this,"TakeConnection",a,l,m,p)),w(this,Rs,"take"),w(this,Xl,m),w(this,Sd,p);else{let x=s(this,vo).getMVFFeatureByNodeId("connection",t?.properties.id??""),C=s(this,vo).getById("connection",x?.id??"");c.push(W(this,un,Id).call(this,"ExitConnection",a,i,C,x)),w(this,Rs,"exit"),w(this,Xl,m),w(this,Sd,p)}else s(this,Rs)==="take"?(c.push(W(this,un,Id).call(this,"ExitConnection",a,i,s(this,Xl),s(this,Sd))),w(this,Rs,"exit"),w(this,Xl,m)):l&&a?.id!==l.id?c.push(W(this,un,Id).call(this,"TakeConnection",a,l,m)):i&&i.id!==a?.id?c.push(W(this,un,Id).call(this,"ExitConnection",a,i,m)):c.push(W(this,un,K6).call(this,t,o));return n||c.push({type:"Arrival"}),c},Id=function(r,t,o,n,i){let a="none",l=t?t.elevation:0;if(l!=null&&o?.elevation!=null){let p=l-o.elevation;p>0?a="down":p<0&&(a="up")}let c=n?.type??i?.type??"stairs";return{type:r,fromFloor:t,toFloor:o,direction:a,connection:n,connectionType:c}},K6=function(r,t){let o=t.properties.edges;if(!o||o.filter(a=>a.destination.properties.id!==r?.properties.id&&a.destination.properties.id!==t.properties.destination).length===0)return null;let i=r?-V6(r.properties.angle,t.properties.angle):0;return Math.abs(i)>=Y6?{type:"Turn",bearing:H6(i,Y6),referencePosition:"At"}:null};d();d();d();d();d();d();d();var Yl=class{constructor({origin:r,destination:t,distance:o=0,angle:n=0,pathWeight:i=0,multiplicativeDistanceWeightScaling:a=!0}){u(this,"origin");u(this,"destination");u(this,"distance");u(this,"angle");u(this,"weight");if(this.origin=r,this.destination=t,this.distance=o,this.angle=n,this.weight=i||0,a?r.properties.floor===t.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):r.properties.map===t.properties.map&&(this.weight=this.weight>=0?this.distance+this.weight:0),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};d();d();d();function _s(e,r,t){if(t===void 0&&(t={}),!e)throw new Error("point is required");if(!r)throw new Error("polygon is required");var o=on(e),n=Np(r),i=n.type,a=r.bbox,l=n.coordinates;if(a&&yG(o,a)===!1)return!1;i==="Polygon"&&(l=[l]);for(var c=!1,p=0;p<l.length&&!c;p++)if(Q6(o,l[p][0],t.ignoreBoundary)){for(var m=!1,f=1;f<l[p].length&&!m;)Q6(o,l[p][f],!t.ignoreBoundary)&&(m=!0),f++;m||(c=!0)}return c}function Q6(e,r,t){var o=!1;r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]&&(r=r.slice(0,r.length-1));for(var n=0,i=r.length-1;n<r.length;i=n++){var a=r[n][0],l=r[n][1],c=r[i][0],p=r[i][1],m=e[1]*(a-c)+l*(c-e[0])+p*(e[0]-a)===0&&(a-e[0])*(c-e[0])<=0&&(l-e[1])*(p-e[1])<=0;if(m)return!t;var f=l>e[1]!=p>e[1]&&e[0]<(c-a)*(e[1]-l)/(p-l)+a;f&&(o=!o)}return o}function yG(e,r){return r[0]<=e[0]&&r[1]<=e[1]&&r[2]>=e[0]&&r[3]>=e[1]}d();d();function Bs([e,r],[t,o]){let n=r-o,i=e-t;return(Math.atan2(i,n)+Math.PI*3)%(Math.PI*2)}d();var bG=63710088e-1;function Hn(e,r){let[t,o]=e.map(m=>m*Math.PI/180),[n,i]=r.map(m=>m*Math.PI/180),a=i-o,l=n-t,c=Math.sin(a/2)*Math.sin(a/2)+Math.cos(o)*Math.cos(i)*Math.sin(l/2)*Math.sin(l/2),p=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return bG*p}d();d();function l1(e,r,t,o){let[n,i]=e,[a,l]=r,[c,p]=t,[m,f]=o;if(i===l&&n===a||p===f&&c===m)return null;let g=(m-c)*(l-i)-(f-p)*(a-n);if(g===0)return null;let b=((f-p)*(n-c)-(m-c)*(i-p))/g,x=((l-i)*(n-c)-(a-n)*(i-p))/g;if(b<0||b>1||x<0||x>1)return null;let C=i+b*(l-i);return[n+b*(a-n),C]}d();function Rv(e,r,t,o){let n=Pl(e,t/1e3,o),i=Pl(r,t/1e3,o);return[n.geometry.coordinates,i.geometry.coordinates]}d();function _v(e){let r=e*(180/Math.PI);return r=r%360,r>180?r-=360:r<-180&&(r+=360),Object.is(r,-0)?0:r}var q6=111e3;function c1(e,r,t=[],o=0){let n=!0,i=e.geometry.coordinates,a=r.geometry.coordinates,l=_v(Bs(i,a)-Math.PI/2),c=_v(Bs(i,a)+Math.PI/2),p=o/q6,m=o/(q6*Math.cos(i[1]*Math.PI/180)),f=Math.min(i[1],a[1])-p,g=Math.max(i[1],a[1])+p,b=Math.min(i[0],a[0])-m,x=Math.max(i[0],a[0])+m;for(let C of t)if(!(Math.max(C[0][1],C[1][1])<f||Math.min(C[0][1],C[1][1])>g||Math.max(C[0][0],C[1][0])<b||Math.min(C[0][0],C[1][0])>x)){if(o>0){let v=Rv(i,a,o,l),I=Rv(i,a,o,c);if(l1(v[0],v[1],C[0],C[1])||l1(I[0],I[1],C[0],C[1]))return n=!1,!1}else if(l1(i,a,C[0],C[1]))return n=!1,!1}return n}var Nv=.4,Jl,Rr,Bv,ew,tw,rw,ow,nw,iw,d1,p1=class{constructor({nodes:r,groupBy:t,multiplicativeDistanceWeightScaling:o}){S(this,Rr);u(this,"edges",{});u(this,"nodesById");u(this,"nodesByGroup",new Map);S(this,Jl);u(this,"hasLineOfSight",(r,t,o=[],n=Nv)=>c1({type:"Feature",properties:{id:"origin",neighbors:[]},geometry:{type:"Point",coordinates:r}},{type:"Feature",properties:{id:"destination",neighbors:[]},geometry:{type:"Point",coordinates:t}},o,n)===!0);S(this,d1,(r,t)=>{let o=0;for(let n of t)(!n[s(this,Jl)]||n[s(this,Jl)]===r.properties[s(this,Jl)])&&_s(r.geometry.coordinates,n.geometry.geometry)&&(o+=Math.max(0,n.cost));return o});w(this,Jl,t);let{features:n}=r;this.nodesById=W(this,Rr,ew).call(this,n),W(this,Rr,tw).call(this),W(this,Rr,rw).call(this,n,t,{multiplicativeDistanceWeightScaling:o})}getShortestEuclideanDistance(r,t){return t.reduce((o,n)=>{let i=Hn(r.geometry.coordinates,n.geometry.coordinates);return Math.min(o,i)},Number.MAX_VALUE)}dijkstraFindWithinTravelDistance(r,t,o,n,i){let a=this.nodesById[r];if(!a)return[];let l=[],c={},p={},m=new Set,f=[];for(l.push({node:a,distance:0}),c[a.properties.id]=null,p[a.properties.id]=0;l.length>0;){l.sort((C,v)=>C.distance-v.distance);let g=l.shift();if(!g)break;let b=g.node,x=g.distance;if(!m.has(b.properties.id)){m.add(b.properties.id),b.properties.id!=null&&o.includes(b.properties.id?.toString())&&(i?this.hasLineOfSight(a.geometry.coordinates,b.geometry.coordinates,n)&&f.push({feature:b,distance:x}):f.push({feature:b,distance:x}));for(let C of this.edges[b.properties.id]){let v=C.destination,I=x+C.distance,M=p[b.properties.id]+C.weight;I>t||m.has(v.properties.id)||p[v.properties.id]!==void 0&&M>=p[v.properties.id]||(p[v.properties.id]=M,c[v.properties.id]=C,l.push({node:v,distance:I}))}}}return f.sort((g,b)=>g.distance-b.distance)}aStar({originIds:r,destinationNodeIds:t,disabledConnectionNodeIds:o,zones:n,overrideEdgeWeights:i}){let a=W(this,Rr,Bv).call(this,r),l=W(this,Rr,Bv).call(this,t);if(a.length===0||l.length===0)return[];let{frontier:c,cameFrom:p,costSoFar:m}=W(this,Rr,ow).call(this,a,l);for(;c.length>0;){let f=c.shift();if(!f)break;if(W(this,Rr,nw).call(this,f.origin,l))return W(this,Rr,iw).call(this,p,f.origin.properties.id);for(let g of this.edges[f.origin.properties.id]){let b=i?.get(g)??g.weight;if(o?.has(g.origin.properties.id)&&g.destination.properties.map!==g.origin.properties.map)continue;let x=m[f.origin.properties.id]+b+s(this,d1).call(this,g.destination,n);if(x!==1/0&&(m[g.destination.properties.id]==null||x<m[g.destination.properties.id])){let C=x+this.getShortestEuclideanDistance(g.destination,l);m[g.destination.properties.id]=x,p[g.destination.properties.id]=g,c.push({origin:g.destination,priority:C})}}c.sort((g,b)=>g.priority-b.priority)}return[]}};Jl=new WeakMap,Rr=new WeakSet,Bv=function(r){return r.map(t=>this.nodesById[t]).filter(Boolean)},ew=function(r){return r.reduce((t,o)=>(t[o.properties.id]=o,t),{})},tw=function(){for(let r in this.nodesById)this.nodesById.hasOwnProperty(r)&&(this.nodesById[r].properties.neighbors=this.nodesById[r].properties.neighbors.filter(({id:t})=>!!this.nodesById[t]))},rw=function(r,t,o){r.forEach(n=>{let i=t==="default"?t:n.properties[t];this.nodesByGroup.has(i)||this.nodesByGroup.set(i,[]),this.nodesByGroup.get(i).push(n),this.edges[n.properties.id]=n.properties.neighbors.map(({id:a,weight:l})=>{let c=this.nodesById[a],p=Hn(n.geometry.coordinates,c.geometry.coordinates),m=Bs(n.geometry.coordinates,c.geometry.coordinates);return new Yl({origin:n,destination:c,pathWeight:l,distance:p,angle:m,multiplicativeDistanceWeightScaling:o?.multiplicativeDistanceWeightScaling})})})},ow=function(r,t){let o=[],n={},i={};return r.forEach(a=>{let l=this.getShortestEuclideanDistance(a,t);o.push({origin:a,priority:l}),n[a.properties.id]=null,i[a.properties.id]=0}),o.sort((a,l)=>a.priority-l.priority),{frontier:o,cameFrom:n,costSoFar:i}},nw=function(r,t){return t.some(o=>o.properties.id===r.properties.id)},iw=function(r,t){let o=[],n=r[t];for(;n;)o.push(n),n=r[n.origin.properties.id];return o.reverse()},d1=new WeakMap;var Cd=class{constructor({nodes:r,geojsonCollection:t,groupBy:o="default",multiplicativeDistanceWeightScaling:n}){u(this,"groupBy");u(this,"graph");u(this,"geometryEdgesByMapId",new Map);u(this,"generatePath",r=>{let{destination:t}=r[r.length-1],o={type:"FeatureCollection",features:[]};for(let i=0;i<r.length;i++){let{origin:a,destination:l}=r[i],c={id:a.properties.id,angle:r[i].angle,distance:r[i].distance,destination:l.properties.id,edges:this.graph.edges[a.properties.id]};this.groupBy!=="default"&&(c.groupBy=a.properties[this.groupBy]),o.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:c})}let n={id:t.properties.id,edges:this.graph.edges[t.properties.id]};return this.groupBy!=="default"&&(n.groupBy=t.properties[this.groupBy]),o.features.push({type:"Feature",geometry:{type:"Point",coordinates:[t.geometry.coordinates[0],t.geometry.coordinates[1]]},properties:n}),o});u(this,"findNearestNodesOnGraph",(r,t,o,n,i=!1)=>this.graph.dijkstraFindWithinTravelDistance(r,t,n,this.geometryEdgesByMapId.get(o)??[],i));u(this,"hasLineOfSight",(r,t,o,n)=>this.graph.hasLineOfSight(r,t,this.geometryEdgesByMapId.get(o),n));u(this,"getDistance",(r,t)=>Hn(r,t));u(this,"getAngle",(r,t)=>Bs(r,t));this.groupBy=o,this.graph=new p1({nodes:r,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:n}),(t?.features||[]).forEach(a=>{let l=null;if(a.geometry.type==="LineString"?l=a.geometry.coordinates:a.geometry.type==="Polygon"&&(l=a.geometry.coordinates.flat()),l){let c=this.groupBy==="default"?this.groupBy:a.properties[this.groupBy];this.geometryEdgesByMapId.has(c)||this.geometryEdgesByMapId.set(c,[]),l.forEach((p,m)=>{this.geometryEdgesByMapId.get(c).push([p,l[m+1]||l[0]])})}})}getDirections({zones:r,originIds:t,destinationNodeIds:o,disabledConnectionNodeIds:n,simplify:i,multiplicativeDistanceWeightScaling:a,overrideEdgeWeights:l}){let c=i?.enabled??!0,p=r??[],m=this.graph.aStar({originIds:t,destinationNodeIds:o,zones:p,disabledConnectionNodeIds:new Set(n),overrideEdgeWeights:l});return m.length===0?{type:"FeatureCollection",features:[]}:(c&&(m=this.simplifyAllSteps(m,i?.bufferRadius??Nv,a)),this.generatePath(m))}simplifyAllSteps(r,t,o){let n=[],i=[r[0]];for(let p=1;p<r.length;p++)if(this.groupBy!=="default"&&r[p].origin.properties[this.groupBy]!==r[p-1].origin.properties[this.groupBy]){let m=r[p-1].origin.properties[this.groupBy],f=this.geometryEdgesByMapId.get(m)??[];n.push(...this.simplifySteps(i,f,t,o)),i=[r[p]]}else i.push(r[p]);let a=r[r.length-1],l=this.groupBy==="default"?this.groupBy:a.origin.properties[this.groupBy],c=this.geometryEdgesByMapId.get(l)??[];return n.push(...this.simplifySteps(i,c,t,o)),n}simplifySteps(r,t,o,n){if(r.length<3)return r;let i=[r[0]],a=1;for(let l=a+2;l<r.length;l++)if(r[a].origin.properties.preventSmoothing||!c1(r[a].origin,r[l].origin,t,o)){let c=l-1;i.push(new Yl({...r[a],destination:r[c].origin,distance:Hn(r[a].origin.geometry.coordinates,r[c].origin.geometry.coordinates),angle:Bs(r[a].origin.geometry.coordinates,r[c].origin.geometry.coordinates)})),a=c}return i.push(new Yl({...r[a],destination:r[r.length-1].origin,distance:Hn(r[a].origin.geometry.coordinates,r[r.length-1].origin.geometry.coordinates),angle:Bs(r[a].origin.geometry.coordinates,r[r.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:n}),r[r.length-1]),i}};d();var Tt=new WeakMap;function Td(e,r){if(Tt.has(e))return Tt.get(e);if(zl.is(e)){let t=[];for(let o of e.navigationTarget){let n=Td(o,r);t.push(...n)}return Tt.set(e,t),t}else if(Ls.is(e)){let t=r.Query.__LEGACY_NEAREST_SYNC(e,r.getByType("node")),o=t?.[0]?.feature.id?[t[0].feature.id]:[];return Tt.set(e,o),o}else if(ce.is(e)){let t=r.Query.__LEGACY_NEAREST_SYNC(e,r.getByType("node"),{lineOfSight:!0}),o=t?.[0]?.feature.id?[t[0].feature.id]:[];return Tt.set(e,o),o}else if(ks.is(e)){let t=r.Query.__LEGACY_NEAREST_SYNC(e,r.getByType("node"));return t?.[0]?.feature.id?[t[0].feature.id]:[]}else if(Gn.is(e)){let t=r?.getMVFFeatureById("entrance",e.id),o=t?.properties.node?[t?.properties.node]:[];return Tt.set(e,o),o}else if(jn.is(e)){let o=r?.getMVFFeatureById("area",e.id)?.properties.destinationNodes??[];return Tt.set(e,o),o}else if(cr.is(e)){let t=r?.getMVFFeatureById("space",e.id);if(t==null)return[];let o=t.properties.destinationNodes;return Tt.set(e,o),o}else if(La.is(e)){let t=[];for(let o of e.coordinates){let n=r.Query.__LEGACY_NEAREST_SYNC(o,r.getByType("node"));n?.[0]?.feature.id&&t.push(n[0].feature.id)}return Tt.set(e,t),t}else if(xo.is(e)){let t=r?.objectEntranceNodeIdsByObstructionId[e.id];return Tt.set(e,t??[]),t??[]}else if(an.is(e)){let t=e.spaces.flatMap(o=>r?.getMVFFeatureById("space",o.id)?.properties.destinationNodes??[]).filter(o=>typeof o=="string");return Tt.set(e,t),t}else if(ki.is(e)){let t=e.nodes.map(o=>o.id);return Tt.set(e,t),t}else if(nn.is(e)){let t=[e.id];return Tt.set(e,t),t}else return[]}async function ja(e,r){if(Tt.has(e))return Tt.get(e);if(zl.is(e)){let t=[];for(let o of e.navigationTarget){let n=await ja(o,r);t.push(...n)}return Tt.set(e,t),t}else if(Ls.is(e)){let t=await r.Query.nearest(e,r.getByType("node")),o=t?.[0]?.feature.id?[t[0].feature.id]:[];return Tt.set(e,o),o}else if(ce.is(e)){let t=await r.Query.nearest(e,r.getByType("node"),{lineOfSight:!0}),o=t?.[0]?.feature.id?[t[0].feature.id]:[];return Tt.set(e,o),o}else if(ks.is(e)){let t=await r.Query.nearest(e,r.getByType("node")),o=t?.[0]?.feature.id?[t[0].feature.id]:[];return Tt.set(e,o),o}else if(Gn.is(e)){let t=r?.getMVFFeatureById("entrance",e.id),o=t?.properties.node?[t?.properties.node]:[];return Tt.set(e,o),o}else if(jn.is(e)){let o=r?.getMVFFeatureById("area",e.id)?.properties.destinationNodes??[];return Tt.set(e,o),o}else if(cr.is(e)){let t=r?.getMVFFeatureById("space",e.id);if(t==null)return[];let o=t.properties.destinationNodes;return Tt.set(e,o),o}else if(La.is(e)){let t=[];for(let o of e.coordinates){let n=await r.Query.nearest(o,r.getByType("node"));n?.[0]?.feature.id&&t.push(n[0].feature.id)}return Tt.set(e,t),t}else if(xo.is(e)){let t=r?.objectEntranceNodeIdsByObstructionId[e.id];return Tt.set(e,t??[]),t??[]}else{if(an.is(e))return e.spaces.flatMap(t=>r?.getMVFFeatureById("space",t.id)?.properties.destinationNodes??[]).filter(t=>typeof t=="string");if(ki.is(e)){let t=e.nodes.map(o=>o.id);return Tt.set(e,t),t}else if(nn.is(e)){let t=[e.id];return Tt.set(e,t),t}else return[]}}function sw(e,r,t){let o=e.features[0]?.properties.id,n=r[0];if(r.length>1){for(let i of r)if((t.get(i)??[]).includes(o)){n=i;break}}return n}function aw(e,r,t){let o=e.features[e.features.length-1]?.properties.id,n=r[0];if(r.length>1){for(let i of r)if((t.get(i)??[]).includes(o)){n=i;break}}return n}var Am,u1,Md=class{constructor({nodes:r,geojsonCollection:t,connections:o,groupBy:n,multiplicativeDistanceWeightScaling:i}){u(this,"navigator");u(this,"connections");u(this,"getDirections",async(r,t,o,n)=>{let i=[],a=[],l=new Map;for(let c of r){let p=await ja(c,n);for(let m of p)i.push(m),l.set(c,p)}for(let c of t){let p=await ja(c,n);for(let m of p)a.push(m),l.set(c,p)}return s(this,Am).call(this,r,t,i,a,o,n,l)});u(this,"getDirectionsSync",(r,t,o,n)=>{let i=[],a=[],l=new Map;for(let c of r){let p=Td(c,n);for(let m of p)i.push(m),l.set(c,p)}for(let c of t){let p=Td(c,n);for(let m of p)a.push(m),l.set(c,p)}return s(this,Am).call(this,r,t,i,a,o,n,l)});S(this,Am,(r,t,o,n,i,a,l)=>{let c=this.getDisabledConnectionNodeIds(i.accessible).filter(C=>!o.includes(C)&&!n.includes(C)),p=new Map,m={...i.connectionIdWeightMap};for(let C of i.excludedConnections)m[C.id]=1/0;for(let C in m){let v=a.getById("connection",C);v&&s(this,u1).call(this,v,m[C],p)}let f=this.navigator.getDirections({zones:i.zones.map(C=>({geometry:C.geometry,cost:C.cost,map:C.floor?.id})),originIds:o,destinationNodeIds:n,disabledConnectionNodeIds:c,simplify:{enabled:i.smoothing.enabled,bufferRadius:i.smoothing.radius},overrideEdgeWeights:p,multiplicativeDistanceWeightScaling:!a.enterpriseMode});this.addCoordinateDirections(f,r,t);let g=sw(f,r,l),b=aw(f,t,l),x=new Na(f,a,g,b);if(!(x.distance===0&&new Set([...o,...n]).size===o.length+n.length))return x});u(this,"getDisabledConnectionNodeIds",r=>r===!1?[]:this.connections.reduce((t,o)=>o.accessible?t:t.concat(o.nodes),[]));S(this,u1,(r,t,o)=>{if(r.nodes.length<2)return;let n=new Set(r.nodes.map(i=>i.id));for(let i of r.nodes){let a=this.navigator.graph.edges[i.id];if(a)for(let l of a)n.has(l.destination.properties.id)&&o.set(l,t)}});u(this,"addCoordinateDirections",(r,[t],[o])=>{if(r.features.length){if(ce.is(t)){let n=this.createDirectionFeature(t,this.navigator.getAngle([t.longitude,t.latitude],r.features[0].geometry.coordinates),this.navigator.getDistance([t.longitude,t.latitude],r.features[0].geometry.coordinates));r.features.splice(0,0,n)}if(ce.is(o)){let n=this.createDirectionFeature(o,0,0),i=r.features[r.features.length-1];i.properties.distance=this.navigator.getDistance(i.geometry.coordinates,[o.longitude,o.latitude]),i.properties.angle=this.navigator.getAngle(i.geometry.coordinates,[o.longitude,o.latitude]),r.features.push(n)}}});u(this,"createDirectionFeature",(r,t,o)=>({type:"Feature",geometry:{type:"Point",coordinates:[r.longitude,r.latitude]},properties:{groupBy:r.floorId,id:r.id,angle:t,distance:o,edges:[]}}));this.navigator=new Cd({nodes:r,geojsonCollection:this.createCollection(t),groupBy:n,multiplicativeDistanceWeightScaling:i}),this.connections=o}createCollection(r){return{type:"FeatureCollection",features:Object.entries(r).reduce((t,[o,n])=>t.concat(n.features.map(i=>(i.properties.map=o,i))),[])}}};Am=new WeakMap,u1=new WeakMap;d();d();d();d();d();d();function lw(e){let r=+this._x.call(null,e),t=+this._y.call(null,e);return cw(this.cover(r,t),r,t,e)}function cw(e,r,t,o){if(isNaN(r)||isNaN(t))return e;var n,i=e._root,a={data:o},l=e._x0,c=e._y0,p=e._x1,m=e._y1,f,g,b,x,C,v,I,M;if(!i)return e._root=a,e;for(;i.length;)if((C=r>=(f=(l+p)/2))?l=f:p=f,(v=t>=(g=(c+m)/2))?c=g:m=g,n=i,!(i=i[I=v<<1|C]))return n[I]=a,e;if(b=+e._x.call(null,i.data),x=+e._y.call(null,i.data),r===b&&t===x)return a.next=i,n?n[I]=a:e._root=a,e;do n=n?n[I]=new Array(4):e._root=new Array(4),(C=r>=(f=(l+p)/2))?l=f:p=f,(v=t>=(g=(c+m)/2))?c=g:m=g;while((I=v<<1|C)===(M=(x>=g)<<1|b>=f));return n[M]=i,n[I]=a,e}function pw(e){var r,t,o=e.length,n,i,a=new Array(o),l=new Array(o),c=1/0,p=1/0,m=-1/0,f=-1/0;for(t=0;t<o;++t)isNaN(n=+this._x.call(null,r=e[t]))||isNaN(i=+this._y.call(null,r))||(a[t]=n,l[t]=i,n<c&&(c=n),n>m&&(m=n),i<p&&(p=i),i>f&&(f=i));if(c>m||p>f)return this;for(this.cover(c,p).cover(m,f),t=0;t<o;++t)cw(this,a[t],l[t],e[t]);return this}d();function dw(e,r){if(isNaN(e=+e)||isNaN(r=+r))return this;var t=this._x0,o=this._y0,n=this._x1,i=this._y1;if(isNaN(t))n=(t=Math.floor(e))+1,i=(o=Math.floor(r))+1;else{for(var a=n-t||1,l=this._root,c,p;t>e||e>=n||o>r||r>=i;)switch(p=(r<o)<<1|e<t,c=new Array(4),c[p]=l,l=c,a*=2,p){case 0:n=t+a,i=o+a;break;case 1:t=n-a,i=o+a;break;case 2:n=t+a,o=i-a;break;case 3:t=n-a,o=i-a;break}this._root&&this._root.length&&(this._root=l)}return this._x0=t,this._y0=o,this._x1=n,this._y1=i,this}d();function uw(){var e=[];return this.visit(function(r){if(!r.length)do e.push(r.data);while(r=r.next)}),e}d();function mw(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]]}d();d();function Ir(e,r,t,o,n){this.node=e,this.x0=r,this.y0=t,this.x1=o,this.y1=n}function fw(e,r,t){var o,n=this._x0,i=this._y0,a,l,c,p,m=this._x1,f=this._y1,g=[],b=this._root,x,C;for(b&&g.push(new Ir(b,n,i,m,f)),t==null?t=1/0:(n=e-t,i=r-t,m=e+t,f=r+t,t*=t);x=g.pop();)if(!(!(b=x.node)||(a=x.x0)>m||(l=x.y0)>f||(c=x.x1)<n||(p=x.y1)<i))if(b.length){var v=(a+c)/2,I=(l+p)/2;g.push(new Ir(b[3],v,I,c,p),new Ir(b[2],a,I,v,p),new Ir(b[1],v,l,c,I),new Ir(b[0],a,l,v,I)),(C=(r>=I)<<1|e>=v)&&(x=g[g.length-1],g[g.length-1]=g[g.length-1-C],g[g.length-1-C]=x)}else{var M=e-+this._x.call(null,b.data),O=r-+this._y.call(null,b.data),T=M*M+O*O;if(T<t){var P=Math.sqrt(t=T);n=e-P,i=r-P,m=e+P,f=r+P,o=b.data}}return o}d();function hw(e){if(isNaN(m=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var r,t=this._root,o,n,i,a=this._x0,l=this._y0,c=this._x1,p=this._y1,m,f,g,b,x,C,v,I;if(!t)return this;if(t.length)for(;;){if((x=m>=(g=(a+c)/2))?a=g:c=g,(C=f>=(b=(l+p)/2))?l=b:p=b,r=t,!(t=t[v=C<<1|x]))return this;if(!t.length)break;(r[v+1&3]||r[v+2&3]||r[v+3&3])&&(o=r,I=v)}for(;t.data!==e;)if(n=t,!(t=t.next))return this;return(i=t.next)&&delete t.next,n?(i?n.next=i:delete n.next,this):r?(i?r[v]=i:delete r[v],(t=r[0]||r[1]||r[2]||r[3])&&t===(r[3]||r[2]||r[1]||r[0])&&!t.length&&(o?o[I]=t:this._root=t),this):(this._root=i,this)}function gw(e){for(var r=0,t=e.length;r<t;++r)this.remove(e[r]);return this}d();function yw(){return this._root}d();function bw(){var e=0;return this.visit(function(r){if(!r.length)do++e;while(r=r.next)}),e}d();function xw(e){var r=[],t,o=this._root,n,i,a,l,c;for(o&&r.push(new Ir(o,this._x0,this._y0,this._x1,this._y1));t=r.pop();)if(!e(o=t.node,i=t.x0,a=t.y0,l=t.x1,c=t.y1)&&o.length){var p=(i+l)/2,m=(a+c)/2;(n=o[3])&&r.push(new Ir(n,p,m,l,c)),(n=o[2])&&r.push(new Ir(n,i,m,p,c)),(n=o[1])&&r.push(new Ir(n,p,a,l,m)),(n=o[0])&&r.push(new Ir(n,i,a,p,m))}return this}d();function vw(e){var r=[],t=[],o;for(this._root&&r.push(new Ir(this._root,this._x0,this._y0,this._x1,this._y1));o=r.pop();){var n=o.node;if(n.length){var i,a=o.x0,l=o.y0,c=o.x1,p=o.y1,m=(a+c)/2,f=(l+p)/2;(i=n[0])&&r.push(new Ir(i,a,l,m,f)),(i=n[1])&&r.push(new Ir(i,m,l,c,f)),(i=n[2])&&r.push(new Ir(i,a,f,m,p)),(i=n[3])&&r.push(new Ir(i,m,f,c,p))}t.push(o)}for(;o=t.pop();)e(o.node,o.x0,o.y0,o.x1,o.y1);return this}d();function Iw(e){return e[0]}function Sw(e){return arguments.length?(this._x=e,this):this._x}d();function Cw(e){return e[1]}function Tw(e){return arguments.length?(this._y=e,this):this._y}function Rm(e,r,t){var o=new jv(r??Iw,t??Cw,NaN,NaN,NaN,NaN);return e==null?o:o.addAll(e)}function jv(e,r,t,o,n,i){this._x=e,this._y=r,this._x0=t,this._y0=o,this._x1=n,this._y1=i,this._root=void 0}function Mw(e){for(var r={data:e.data},t=r;e=e.next;)t=t.next={data:e.data};return r}var ro=Rm.prototype=jv.prototype;ro.copy=function(){var e=new jv(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root,t,o;if(!r)return e;if(!r.length)return e._root=Mw(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var n=0;n<4;++n)(o=r.source[n])&&(o.length?t.push({source:o,target:r.target[n]=new Array(4)}):r.target[n]=Mw(o));return e};ro.add=lw;ro.addAll=pw;ro.cover=dw;ro.data=uw;ro.extent=mw;ro.find=fw;ro.remove=hw;ro.removeAll=gw;ro.root=yw;ro.size=bw;ro.visit=xw;ro.visitAfter=vw;ro.x=Sw;ro.y=Tw;d();function Gv(e,r,t,o=0,n=0,i=0,a=0){if(t===void 0){t=e.root();let c=e.extent();if(c&&([[o,n],[i,a]]=c,r(t,o,n,i,a)))return!0;if(!t)return!1}let l=[[o,n,(i+o)/2,(a+n)/2],[(i+o)/2,n,i,(a+n)/2],[o,(a+n)/2,(i+o)/2,a],[(i+o)/2,(a+n)/2,i,a]];for(let c=0;c<4;c++){let p=t[c];if(p){let[m,f,g,b]=l[c];r(p,m,f,g,b)||Gv(e,r,p,m,f,g,b)}}return!1}var ww=1e3,xG=.1,$n,_m,Io,Kl,m1=class{constructor(r,t){S(this,$n,{});S(this,_m,new Map);u(this,"getMaxSearchRadiusForFloorId",(r,t)=>{let o=s(this,_m).get(s(this,Io).mapName)?.get(t);if(o)return o;let n=this.getNodeTreeByTypeAndFloorId(r,s(this,Io).mapName,t);if(typeof n.extent=="function")if(n.extent()){let[[i,a],[l,c]]=n.extent(),p=l-i,m=c-a;o=Math.max(p,m)}else o=ww;else o=ww;return s(this,_m).set(s(this,Io).mapName,new Map([[t,o]])),o});S(this,Io);S(this,Kl);w(this,Io,r),w(this,Kl,t)}searchWithIncludedIds(r,t,o,n,i,a,l=!1){let{x:c,y:p}=s(this,Kl).call(this,r),m=c-a,f=c+a,g=p-a,b=p+a,x=this.getNodeTreeByTypeAndFloorId(t,o,n),C=[],v=new Set;return Gv(x,(I,M,O,T,P)=>{let B=M>=f||O>=b||T<m||P<g;if("data"in I){let G=I.data,A=G.properties.parentId||G.properties.id;if(i.includes(A)&&!v.has(A)){v.add(A);let N=Hn(r,G.geometry.coordinates);N<=a&&(l?s(this,Io).directions.navigator.hasLineOfSight(r,G.geometry.coordinates,n,xG)&&C.push({node:G,distance:N}):C.push({node:G,distance:N}))}}return B}),C.sort((I,M)=>I.distance-M.distance)}getNodeTreeByTypeAndFloorId(r,t,o){if(s(this,$n)[r]||(s(this,$n)[r]={}),s(this,$n)[r][t]?.[o])return s(this,$n)[r][t][o];s(this,$n)[r][t]||(s(this,$n)[r][t]={}),s(this,$n)[r][t][o]=Rm();let n=s(this,$n)[r][t][o];n.x(a=>s(this,Kl).call(this,a.geometry.coordinates).x),n.y(a=>s(this,Kl).call(this,a.geometry.coordinates).y);let i=[];switch(r){case"space":i=s(this,Io).mvfSpacesByFloorId[o].flatMap(l=>l.properties.destinationNodes).map(l=>{let c=s(this,Io).mvfNodesById[l];return c?{...c,properties:{id:c.properties.id,parentId:c.properties.space[0]}}:null});break;case"node":i=s(this,Io).mvfNodesByFloorId[o]?.filter(l=>l.properties.neighbors.length>0)||[];break;case"point-of-interest":i=s(this,Io).mvfPoisByFloorId[o]||[];break;case"door":i=s(this,Io).mvfEntrancesByFloorId[o]||[];break;case"annotation":i=s(this,Io).mvfAnnotationsByFloorId[o]||[];break}return i?.length>0&&n.addAll(i),n}};$n=new WeakMap,_m=new WeakMap,Io=new WeakMap,Kl=new WeakMap;var wd=50,Ow=111319.9,Uv=!1,Pw=X.object({limit:X.enum(["same-floor","same-elevation"]).optional(),mode:X.enum(["travel-distance","absolute-distance"]).optional(),lineOfSight:X.boolean().optional().or(X.literal("auto")),maxDistance:X.number().optional()}),Fw={lineOfSight:Uv,mode:"travel-distance",maxDistance:wd,limit:"same-floor"},pr,Nm,f1,jm,Vv,Od,h1,g1,Bm=class{constructor(r){S(this,jm);S(this,pr);S(this,Nm);S(this,f1,([r,t])=>{let[o,n]=[s(this,pr).mapCenter.longitude,s(this,pr).mapCenter.latitude],i=Ow,a=Ow*Math.cos(t*Math.PI/180),l=(r-o)*a,c=(t-n)*i;return{x:l,y:c}});u(this,"__LEGACY_NEAREST_SYNC",(r,t,o)=>{let n={...Fw,...o};try{Pw.parse(n)}catch(m){L.error(m);return}let i=ed(r);if(!i)return;let a=W(this,jm,Vv).call(this,i,n),l=[],c={},p=[];for(let m of t){let f=Td(m,s(this,pr));if(f)for(let g of f)c[g]||(c[g]=[]),c[g].push(m),p.push(g)}return o?.mode==="absolute-distance"?l=s(this,Od).call(this,i,a,t,n):l=s(this,g1).call(this,r,a,p,c,n),l.sort((m,f)=>m.distance-f.distance)});S(this,Od,(r,t,o,n)=>{let i=[],a=new Set(o.map(l=>l.__type));for(let l of t)for(let c of a){let p=s(this,Nm).searchWithIncludedIds([r.longitude,r.latitude],c,s(this,pr).mapName,l,o.filter(m=>m.__type===c).map(m=>m.id),n?.maxDistance??wd,n?.lineOfSight==="auto"?Uv:n?.lineOfSight);if(p)for(let m of p)i.push({distance:m.distance,feature:s(this,pr).getById(c,m.node.properties.parentId)||s(this,pr).getById(c,m.node.properties.id)})}return i});S(this,h1,async(r,t,o,n,i)=>{let a=[];for(let l of t){let c,p=0;if(!nn.is(r)){let m=s(this,Od).call(this,r.anchorTarget,[l],s(this,pr).getByType("node").filter(f=>f.floor.id===l),{limit:"same-floor",lineOfSight:i?.lineOfSight??!0,mode:"absolute-distance",maxDistance:i?.maxDistance??wd});m.length>0&&(c=m[0].feature,p=m[0].distance)}if(c){let m=new Set,f=s(this,pr).directions.navigator.findNearestNodesOnGraph(c.id,(i?.maxDistance??wd)-p,l,o,!1);for(let g of f)for(let b of n[g.feature.properties.id])m.has(b.id)||(a.push({distance:g.distance+p,feature:b}),m.add(b.id))}}return a});S(this,g1,(r,t,o,n,i)=>{let a=[];for(let l of t){let c;if(nn.is(r)||(c=this.__LEGACY_NEAREST_SYNC(r,s(this,pr).getByType("node"),{lineOfSight:i?.lineOfSight??!0,mode:"absolute-distance",maxDistance:i?.maxDistance??wd})?.[0].feature),c){let p=s(this,pr).directions.navigator.findNearestNodesOnGraph(c.id,i?.maxDistance??wd,l,o,i?.lineOfSight==="auto"?Uv:i?.lineOfSight);for(let m of p)for(let f of n[m.feature.properties.id])a.push({distance:m.distance,feature:f})}}return a});w(this,pr,r),w(this,Nm,new m1(s(this,pr),s(this,f1)))}async nearest(r,t,o){let n={...Fw,...o};try{Pw.parse(n)}catch(f){L.error(f);return}let i=ed(r);if(!i)return;let a=W(this,jm,Vv).call(this,i,n),l=[],c={},p=[],m=[];if(o?.mode==="absolute-distance")l=s(this,Od).call(this,i,a,t,n);else{for(let f of t)m.push(ja(f,s(this,pr)).then(g=>{if(g)for(let b of g)c[b]||(c[b]=[]),c[b].push(f),p.push(b)}));await Promise.all(m),l=await s(this,h1).call(this,r,a,p,c,n)}return l.sort((f,g)=>f.distance-g.distance)}};pr=new WeakMap,Nm=new WeakMap,f1=new WeakMap,jm=new WeakSet,Vv=function(r,t){let o=r.floorId?[r.floorId]:[];if(r.floorId==null)for(let n of s(this,pr).getByType("floor-stack")){let i=n.defaultFloor;i&&o.push(i.id)}else if(t?.limit==="same-elevation"){let n=s(this,pr).floorsById[r.floorId];if(n){let i=n?.elevation;i&&(o=s(this,pr).getByType("floor-stack").map(a=>a.floors.find(l=>l.elevation===i)?.id).filter(Boolean))}}return o},Od=new WeakMap,h1=new WeakMap,g1=new WeakMap;d();d();var Gm,y1=class{constructor(r){S(this,Gm);w(this,Gm,r||[])}get raw(){return s(this,Gm)}};Gm=new WeakMap;var _r,ne,xt,Pd=class Pd extends lr{constructor(t,o){super(o.mvfData.id);u(this,"__type",Pd.__type);u(this,"id","loc_");u(this,"name","");u(this,"externalId");u(this,"description");u(this,"logo");u(this,"phone");u(this,"social",[]);u(this,"images",[]);u(this,"links",[]);u(this,"website");u(this,"icon");S(this,_r);S(this,ne,{});S(this,xt);w(this,_r,t),w(this,xt,o.mvfData);for(let n in o.mvfData)n==="links"?this.links=o.mvfData.links.map(i=>new El({mvfData:i})):n==="pictures"?this.images=o.mvfData.pictures.map(i=>i.url?new kl({mvfData:{...i,url:i.url??""},mapData:s(this,_r)}):void 0).filter(i=>i!=null):n==="website"?o.mvfData.website&&(this.website=new El({mvfData:o.mvfData.website})):n==="icon"?o.mvfData.icon&&(this.icon=new kl({mvfData:{url:o.mvfData.icon},mapData:s(this,_r)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)||Object.defineProperty(this,n,{enumerable:!0,get(){return s(this,xt)[n]}})}static is(t){return t.__type===Pd.__type}get spaces(){if(s(this,ne).spaces)return s(this,ne).spaces;if(s(this,xt).spaces==null)return s(this,ne).spaces=[],s(this,ne).spaces;s(this,ne).spaces=[];for(let t=0;t<s(this,xt).spaces.length;t++){let o=s(this,_r).getById("space",s(this,xt).spaces[t].id);o&&s(this,ne).spaces.push(o)}return s(this,ne).spaces}get points(){if(s(this,ne).points)return s(this,ne).points;if(s(this,xt).spaces==null)return s(this,ne).points=[],s(this,ne).points;s(this,ne).points=[];for(let t=0;t<s(this,xt).spaces.length;t++){let o=s(this,_r).getById("point-of-interest",s(this,xt).spaces[t].id);o&&s(this,ne).points.push(o)}return s(this,ne).points}get doors(){if(s(this,ne).doors)return s(this,ne).doors;if(s(this,xt).entrances==null)return s(this,ne).doors=[],s(this,ne).doors;s(this,ne).doors=[];for(let t=0;t<s(this,xt).entrances.length;t++){let o=s(this,_r).getById("door",s(this,xt).entrances[t].id);o&&s(this,ne).doors.push(o)}return s(this,ne).doors}get connections(){if(s(this,ne).connections)return s(this,ne).connections;if(s(this,xt).connections==null)return s(this,ne).connections=[],s(this,ne).connections;let t=new Set;for(let o=0;o<s(this,xt).connections.length;o++){let n=s(this,xt).connections[o],i=s(this,_r).mvfConnectionsById[n],l=(i==null?[]:i.nodes).map(c=>s(this,_r).getById("node",c)).filter(Boolean);for(let c of l){if(c==null)continue;let p=Di([c.coordinate.longitude,c.coordinate.latitude]),f=(s(this,_r).connectionSpaceIdsByLatLon[p]??[]).map(g=>s(this,_r).connectionsById[g]).filter(g=>g!=null);for(let g of f)t.add(g)}}return s(this,ne).connections=Array.from(t),s(this,ne).connections}get annotations(){if(s(this,ne).annotations)return s(this,ne).annotations;if(s(this,xt).annotations==null)return s(this,ne).annotations=[],s(this,ne).annotations;s(this,ne).annotations=[];for(let t=0;t<s(this,xt).annotations.length;t++){let o=s(this,_r).getById("annotation",s(this,xt).annotations[t].id);o&&s(this,ne).annotations.push(o)}return s(this,ne).annotations}get categories(){return s(this,ne).categories?s(this,ne).categories:s(this,xt).categories==null?(s(this,ne).categories=[],s(this,ne).categories):(s(this,ne).categories=s(this,xt).categories.map(t=>s(this,_r).getById("location-category",t)).filter(t=>t!=null),s(this,ne).categories)}get mapObjects(){return s(this,ne).mapObjects?s(this,ne).mapObjects:s(this,xt).obstructions==null?(s(this,ne).mapObjects=[],s(this,ne).mapObjects):(s(this,ne).mapObjects=s(this,xt).obstructions.map(t=>s(this,_r).getById("object",t.id)).filter(t=>t!=null),s(this,ne).mapObjects)}get areas(){return s(this,ne).areas?s(this,ne).areas:s(this,xt).areas==null?(s(this,ne).areas=[],s(this,ne).areas):(s(this,ne).areas=s(this,xt).areas.map(t=>s(this,_r).getById("area",t.id)).filter(t=>t!=null),s(this,ne).areas)}get focusTarget(){if(s(this,ne).focusTarget)return s(this,ne).focusTarget;let t=[];for(let o of this.spaces)t.push(o);for(let o of this.connections)t.push(...o.coordinates);for(let o of this.doors)t.push(o.focusTarget);for(let o of this.mapObjects)t.push(o.focusTarget);for(let o of this.annotations)t.push(o.focusTarget);for(let o of this.points)t.push(o.focusTarget);for(let o of this.areas)t.push(o.focusTarget);return s(this,ne).focusTarget=t,t}get openingHours(){return s(this,ne).openingHours?s(this,ne).openingHours:(s(this,ne).openingHours=new y1(s(this,xt).openingHoursSpecification??[]),s(this,ne).openingHours)}get navigationTarget(){if(s(this,ne).navigationTarget)return s(this,ne).navigationTarget;let t=[];for(let o of this.spaces)t.push(o);for(let o of this.connections)t.push(...o.coordinates);for(let o of this.doors)t.push(o.focusTarget);for(let o of this.mapObjects)t.push(o.focusTarget);for(let o of this.annotations)t.push(o.focusTarget);for(let o of this.points)t.push(o.focusTarget);return s(this,ne).navigationTarget=t,t}toJSON(){return{__type:Pd.__type,id:this.id,name:this.name}}};_r=new WeakMap,ne=new WeakMap,xt=new WeakMap,u(Pd,"__type","location-profile");var Hv=Pd,zl=Hv;d();var Ga,So,Ql,Fd=class Fd extends lr{constructor(t,o){super(o.mvfData.id);u(this,"__type",Fd.__type);u(this,"id","cat_");u(this,"name","");u(this,"icon","");S(this,Ga);S(this,So,{});S(this,Ql);w(this,Ga,t),w(this,Ql,o.mvfData);for(let n in o.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)||Object.defineProperty(this,n,{enumerable:!0,get(){return s(this,Ql)[n]}})}static is(t){return t.__type===Fd.__type}get parent(){return s(this,So).parent?s(this,So).parent:(s(this,So).parent=s(this,Ql).parent?s(this,Ga).getById("location-category",s(this,Ql).parent):void 0,s(this,So).parent)}get children(){return s(this,So).children?s(this,So).children:(s(this,So).children=s(this,Ga).locationCategoriesByParentId[this.id]||[],s(this,So).children)}get locationProfiles(){if(s(this,So).locationProfiles)return s(this,So).locationProfiles;let t=[];for(let o of s(this,Ga).locationProfilesByCategoryId[this.id]||[]){let n=s(this,Ga).getById("location-profile",o.id);n&&t.push(n)}return s(this,So).locationProfiles=t,t}toJSON(){return{__type:Fd.__type,id:this.id,name:this.name}}};Ga=new WeakMap,So=new WeakMap,Ql=new WeakMap,u(Fd,"__type","location-category");var $v=Fd,o1=$v;var pe,b1,Dw,Ed,ql=class extends Ie{constructor(t,o){super();S(this,b1);u(this,"Analytics");S(this,pe,{});u(this,"Query");u(this,"mvf");u(this,"outdoorViewToken");u(this,"objectEntranceNodeIdsByObstructionId");u(this,"obstructionIdByEntranceId");u(this,"venue");u(this,"tokenManager");u(this,"directions");u(this,"enterpriseMode",!1);u(this,"nodesById");u(this,"spacesById");u(this,"floorsById");u(this,"floorStacksById");u(this,"facadesById");u(this,"facadesBySpaceId");u(this,"connectionsById");u(this,"objectsById");u(this,"doorsById");u(this,"pointsOfInterestById");u(this,"annotationsById");u(this,"areasById");u(this,"locationProfilesById");u(this,"locationCategoriesById");u(this,"locationProfilesByExternalId");u(this,"locationProfilesByCategoryId");u(this,"locationCategoriesByParentId");u(this,"doorsByNodeId");u(this,"mvfAnnotationsById");u(this,"mvfConnectionsById");u(this,"mvfConnectionsByNodeId");u(this,"mvfConnectionIdsByLatLon");u(this,"mvfEntrancesById");u(this,"mvfNodesById");u(this,"mvfObstructionById");u(this,"mvfSpacesById");u(this,"mvfFloorsById");u(this,"mvfFloorStacksById");u(this,"mvfAreasById");u(this,"spacesByExternalId");u(this,"nodesByExternalId");u(this,"objectsByExternalId");u(this,"poisByExternalId");u(this,"floorsByExternalId");u(this,"floorStacksByExternalId");u(this,"doorsByExternalId");u(this,"areasByExternalId");u(this,"connectionSpaceIdsByLatLon",{});u(this,"locationProfilesByAttachedFeatureId",{});u(this,"locationsById",{});u(this,"categoriesById",{});u(this,"mvfLocationsBySpaceId",{});u(this,"locationIdsByNodeId",{});u(this,"spaceIdsByNodeId",{});u(this,"connectionsByExternalId",{});u(this,"locationsByExternalId",{});u(this,"categoriesByExternalId",{});u(this,"destinationNodesIdsBySpaceId",{});u(this,"mvfNodesByFloorId");u(this,"mvfSpacesByFloorId");u(this,"mvfPoisByFloorId");u(this,"mvfEntrancesByFloorId");u(this,"mvfAnnotationsByFloorId");u(this,"localePacksUrls");u(this,"currentLanguage");u(this,"languagePacks",{});u(this,"tilesets",{});u(this,"navigationFlags");u(this,"binaryBundle");u(this,"envControl");u(this,"getMapDataOptions");u(this,"propTranslationCache",new Map);S(this,Ed);u(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",(t,o,n)=>this.__LEGACY_GET_DIRECTIONS_SYNC(t,o,{...n,multiDestination:!0}));u(this,"__LEGACY_GET_DIRECTIONS_SYNC",(t,o,n)=>{let{accessible:i=!1,multiDestination:a=!1}=n||{},l=Ew(this.enterpriseMode,n),c=n?.zones||[],p={accessible:i,zones:c,smoothing:l,excludedConnections:n?.excludedConnections||[],connectionIdWeightMap:n?.connectionIdWeightMap||{}};if(a&&Array.isArray(o)){let m=Array.isArray(t)?t:[t],f=[];for(let g of o){let b=Array.isArray(g)?g:[g],x=this.directions.getDirectionsSync(m,b,p,this);if(!x){L.error("getDirections failed due to missing directions for one of the segments");return}m=b,f.push(x)}return f}else{let m=Array.isArray(t)?t:[t],f=Array.isArray(o)?o:[o];if(Array.isArray(f[0])){L.error("getDirections does not support multi-destination without multisegment option");return}m[0].id&&f[0].id&&this.Analytics.sendGetDirectionsEvent(m[0].id,f[0].id,i);try{return this.directions.getDirectionsSync(m,f,p,this)}catch(g){L.error("Unable to get directions",g);return}}});u(this,"getDirections",async(t,o,n)=>{let{accessible:i=!1}=n||{},a=Ew(this.enterpriseMode,n),l=n?.zones||[],c={accessible:i,zones:l,smoothing:a,excludedConnections:n?.excludedConnections||[],connectionIdWeightMap:n?.connectionIdWeightMap||{}},p=Array.isArray(t)?t:[t],m=Array.isArray(o)?o:[o];if(Array.isArray(m[0])){L.error("getDirections does not support multi-destination without multisegment option");return}p[0].id&&m[0].id&&this.Analytics.sendGetDirectionsEvent(p[0].id,m[0].id,i);try{return this.directions.getDirections(p,m,c,this)}catch(f){L.error("Unable to get directions",f);return}});u(this,"getDirectionsMultiDestination",async(t,o,n)=>Promise.resolve(this.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(t,o,n)));u(this,"transformImageRequest",async t=>{if(this.enterpriseMode||!this.getMapDataOptions)return{url:t};if(!E6(t))return{url:t};if(D6(t))return{url:t};let o=qy(t);if(!o)return{url:t};try{let i=(await this.tokenManager?.getSasTokensAsync())?.[o.mapId];if(i==null)throw new Error("SAS token not found");let[a]=t.split("?");return{url:`${a}?${i.token}`}}catch(n){return L.error("Failed to append SAS token to image request. Requests for private images may fail.",n),{url:t}}});let n=o?.env??Ma();if(this.envControl=n,this.binaryBundle=o?.binaryBundle,this.Analytics=new $c,this.localePacksUrls=o?.localePacksUrls??{},this.mvf=t,this.outdoorViewToken=o?.outdoorViewToken,this.getMapDataOptions=o?.getMapDataOptions,t["tileset.json"]?.default!=null&&(this.tilesets[t["tileset.json"].default.key]=t["tileset.json"].default,n.updateTileServerBaseUrl(t["tileset.json"].default.url),t["tileset.json"].others!=null))for(let a of t["tileset.json"].others)this.tilesets[a.key]=a;this.navigationFlags=t["navigationFlags.json"]??{},this.enterpriseMode=o?.enterprise??!1,this.tokenManager=o?.tokenManager;let i=N6(t,this);if(this.nodesById=i.nodesById,this.spacesById=i.spacesById,this.floorsById=i.floorsById,this.floorStacksById=i.floorStacksById,this.facadesById=i.facadesById,this.facadesBySpaceId=i.facadesBySpaceId,this.connectionsById=i.connectionsById,this.objectsById=i.objectsById,this.doorsById=i.doorsById,this.pointsOfInterestById=i.poisById,this.annotationsById=i.annotationsById,this.areasById=i.areasById,this.locationProfilesById=i.locationProfilesById,this.locationCategoriesById=i.locationCategoriesById,this.locationProfilesByCategoryId=i.locationProfilesByCategoryId,this.locationCategoriesByParentId=i.locationCategoriesByParentId,this.spacesByExternalId=i.spacesByExternalId,this.nodesByExternalId=i.nodesByExternalId,this.objectsByExternalId=i.objectsByExternalId,this.floorsByExternalId=i.floorsByExternalId,this.locationProfilesByExternalId=i.locationProfilesByExternalId,this.floorStacksByExternalId=i.floorStacksByExternalId,this.poisByExternalId=i.poisByExternalId,this.doorsByExternalId=i.doorsByExternalId,this.areasByExternalId=i.areasByExternalId,this.mvfAnnotationsById=i.mvfAnnotationsById,this.mvfConnectionsById=i.mvfConnectionsById,this.mvfConnectionsByNodeId=i.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=i.mvfConnectionIdsByLatLon,this.mvfEntrancesById=i.mvfEntrancesById,this.mvfNodesById=i.mvfNodesById,this.mvfObstructionById=i.mvfObstructionById,this.mvfSpacesById=i.mvfSpacesById,this.mvfFloorsById=i.mvfFloorsById,this.mvfFloorStacksById=i.mvfFloorStacksById,this.mvfNodesByFloorId=i.mvfNodesByFloorId,this.mvfSpacesByFloorId=i.mvfSpacesByFloorId,this.mvfPoisByFloorId=i.mvfPoisByFloorId,this.mvfEntrancesByFloorId=i.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=i.mvfAnnotationsByFloorId,this.mvfAreasById=i.mvfAreasById,this.doorsByNodeId=i.doorsByNodeId,this.objectEntranceNodeIdsByObstructionId=i.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=i.obstructionIdByEntranceId,this.connectionSpaceIdsByLatLon=i.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=i.locationProfilesByAttachedFeatureId,this.enterpriseMode||Um()){let a=B6(t,this);if(this.locationsById=a.locationsById,this.categoriesById=a.categoriesById,this.mvfLocationsBySpaceId=a.mvfLocationsBySpaceId,this.locationIdsByNodeId=a.locationIdsByNodeId,this.spaceIdsByNodeId=a.spaceIdsByNodeId,this.connectionsByExternalId=a.connectionsByExternalId,this.locationsByExternalId=a.locationsByExternalId,this.categoriesByExternalId=a.categoriesByExternalId,this.destinationNodesIdsBySpaceId=a.destinationNodesIdsBySpaceId,a.venue.name!=null){this.venue=new Ev(this,{mvfData:a.venue});let l={};for(let c in a.mvfLocationsById)l[c]=a.mvfLocationsById[c];for(let c in a.locationInstancesById)l[c]=a.locationInstancesById[c];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":l,"enterprise-category":a.mvfCategoriesById,"floor-stack":i.mvfFloorStacksById,floor:i.mvfFloorsById}},o?.languagePacks?.forEach(({language:c,localePack:p})=>{this.languagePacks[c.code]=sv(p)}),this.currentLanguage=this.venue.defaultLanguage}}this.directions=new Md({nodes:t["node.geojson"],geojsonCollection:t.enterprise?t.space:t.obstruction,connections:t["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode}),this.Query=new Bm(this)}getEnv(){let t=this;return{get baseUri(){return t.envControl.getBaseUri()},get baseAuthUri(){return t.envControl.getBaseAuthUri()},get analyticsBaseUri(){return t.envControl.getAnalyticsBaseUri()},get tileServerUri(){return t.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){return this.mvf["manifest.geojson"].features[0].properties.org_id??""}get mapCenter(){return new ce(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){return this.mvf["manifest.geojson"].features[0].properties.naturalBearing??0}get spaces(){return s(this,pe).spaces==null&&(s(this,pe).spaces=globalThis.Object.values(this.spacesById)),s(this,pe).spaces}get objects(){return s(this,pe).objects==null&&(s(this,pe).objects=globalThis.Object.values(this.objectsById)),s(this,pe).objects}get connections(){return s(this,pe).connections==null&&(s(this,pe).connections=globalThis.Object.values(this.connectionsById)),s(this,pe).connections}get floors(){return s(this,pe).floors==null&&(s(this,pe).floors=globalThis.Object.values(this.floorsById)),s(this,pe).floors}get floorStacks(){return s(this,pe).floorStacks==null&&(s(this,pe).floorStacks=globalThis.Object.values(this.floorStacksById)),s(this,pe).floorStacks}get facades(){return s(this,pe).facades==null&&(s(this,pe).facades=globalThis.Object.values(this.facadesById)),s(this,pe).facades}get doors(){return s(this,pe).doors==null&&(s(this,pe).doors=globalThis.Object.values(this.doorsById)),s(this,pe).doors}get pointsOfInterest(){return s(this,pe).pointsOfInterest==null&&(s(this,pe).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),s(this,pe).pointsOfInterest}get annotations(){return s(this,pe).annotations==null&&(s(this,pe).annotations=globalThis.Object.values(this.annotationsById)),s(this,pe).annotations}get areas(){return s(this,pe).areas==null&&(s(this,pe).areas=globalThis.Object.values(this.areasById)),s(this,pe).areas}get nodes(){return s(this,pe).nodes==null&&(s(this,pe).nodes=globalThis.Object.values(this.nodesById)),s(this,pe).nodes}get locations(){return s(this,pe).locations==null&&(s(this,pe).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return s(this,pe).categories==null&&(s(this,pe).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return s(this,pe).locationProfiles==null&&(s(this,pe).locationProfiles=globalThis.Object.values(this.locationProfilesById)),s(this,pe).locationProfiles}get locationCategories(){return s(this,pe).locationCategories==null&&(s(this,pe).locationCategories=globalThis.Object.values(this.locationCategoriesById)),s(this,pe).locationCategories}get mvfFloors(){return s(this,pe).mvfFloors==null&&(s(this,pe).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),s(this,pe).mvfFloors}get mvfFloorStacks(){return s(this,pe).mvfFloorStacks==null&&(s(this,pe).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),s(this,pe).mvfFloorStacks}getByType(t){switch(t){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(t,o){let n={"location-profile":this.locationProfilesById,"location-category":this.locationCategoriesById,space:this.spacesById,floor:this.floorsById,"floor-stack":this.floorStacksById,facade:this.facadesById,node:this.nodesById,door:this.doorsById,connection:this.connectionsById,"mvf-connection":l=>W(this,b1,Dw).call(this,this.mvfConnectionsById[l]),object:this.objectsById,"point-of-interest":this.pointsOfInterestById,annotation:this.annotationsById,area:this.areasById,"enterprise-location":this.locationsById,"enterprise-category":this.categoriesById},i=l=>{let c=n[l];if(c!=null)return typeof c=="function"?c(o):c[o]},a=()=>{for(let l of Object.keys(n)){let c=i(l);if(c!=null)return c}};return t==="unknown"?a():i(t)}getByExternalId(t,o){switch(t){case"location-profile":return this.locationProfilesByExternalId[o]??[];case"location-category":return[];case"space":return this.spacesByExternalId[o]??[];case"floor":return this.floorsByExternalId[o]??[];case"floor-stack":return this.floorStacksByExternalId[o]??[];case"node":return this.nodesByExternalId[o]??[];case"door":return this.doorsByExternalId[o]??[];case"connection":return this.connectionsByExternalId[o]??[];case"object":return this.objectsByExternalId[o]??[];case"point-of-interest":return this.poisByExternalId[o]??[];case"area":return this.areasByExternalId[o]??[];case"enterprise-location":return this.locationsByExternalId[o]??[];case"enterprise-category":return this.categoriesByExternalId[o]??[];default:return[]}}getMapDataById(t){return this.spacesById[t]??this.floorsById[t]??this.floorStacksById[t]??this.facadesById[t]??this.nodesById[t]??this.doorsById[t]??this.connectionsById[t]??this.objectsById[t]??this.pointsOfInterestById[t]??this.annotationsById[t]??this.areasById[t]}getMVFFeatureById(t,o){switch(t){case"space":return this.mvfSpacesById[o];case"node":return this.mvfNodesById[o];case"obstruction":return this.mvfObstructionById[o];case"floor":return this.mvfFloorsById[o];case"floor-stack":return this.mvfFloorStacksById[o];case"connection":return this.mvfConnectionsById[o];case"entrance":return this.mvfEntrancesById[o];case"annotation":return this.mvfAnnotationsById[o];case"area":return this.mvfAreasById[o];default:throw new Error(`Unknown MVF feature type: ${t}`)}}getMVFFeatureByNodeId(t,o){switch(t){case"connection":return this.mvfConnectionsByNodeId[o];default:throw new Error(`Unsupported MVF feature type: ${t}`)}}getMVFFeatureByType(t){switch(t){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error(`Unsupported MVF feature type: ${t}`)}}getPropTranslation(t,o,n,i){if(!this.currentLanguage)return i;let{code:a}=this.currentLanguage,l=this.languagePacks[a]?.optimized?.[t];if(l){let c=l[n];if(c!=null&&c[o]!==void 0){let p=c[o];if(p!=null&&typeof p=="object"){if(typeof i=="object"&&typeof p=="object"&&!Array.isArray(p)){let m=Jh(a+t+n+o.toString());if(this.propTranslationCache.has(m))return this.propTranslationCache.get(m);let f=Lm(i,p,["id"]);return this.propTranslationCache.set(m,f),f}return p}return p}}return i}findPreferredLanguage(t){if(!this.venue)return;let o=Wv(this.venue,t);return t?.languageCode!=null&&t.languageCode.toLowerCase()!==o.code.toLowerCase()&&L.warn(`Language code "${t.languageCode}" could not be found in the venue. Using "${o.code}" instead.`),o}async changeLanguage(t){let o=t.toLowerCase();if(!o){L.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){L.error("Changing the language is not supported for this map.");return}let n=this.currentLanguage.code,i=this.venue?.languages.find(({code:l})=>l.toLowerCase()===o.toLowerCase());if(!i){L.warn(`Language code "${o}" could not be found in the venue.`);return}if(n===i.code)return;let a=this.languagePacks[i.code];if(!a){let l=this.localePacksUrls[i.code];if(!l){L.error(`Locale pack URL not found for language code "${i.code}".`);return}s(this,Ed)&&s(this,Ed).abort();let c=new AbortController;w(this,Ed,c);let p;try{p=await l6(l,{signal:c.signal})}catch(m){L.error(`Failed to download language pack for language code "${i.code}".`,m);return}if(!p||c.signal.aborted)return;a=sv(p),this.languagePacks[i.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=i,this.publish("language-change",this.currentLanguage)}getDistance(t,o){let n=ed(t),i=ed(o);return Hn([n.longitude,n.latitude],[i.longitude,i.latitude])}async toJSONBundle({downloadLanguagePacks:t=!0}={}){let o=[];if(t&&this.enterpriseMode){let n=new AbortController;for(let i of this.venue?.languages||[])try{if(this.localePacksUrls[i.code]){let a=await Nx(this.localePacksUrls[i.code],{signal:n.signal}),l=await Bp(a);l&&o.push({language:{code:i.code,name:i.name},localePack:l})}}catch(a){L.warn("failed downloading language pack",a)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:o,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:t=!0}={}){if(!this.binaryBundle){L.error("binary bundle not found");return}let o=[];if(t&&this.enterpriseMode){let n=new AbortController;for(let i of this.venue?.languages||[])try{if(this.localePacksUrls[i.code]){let a=await Nx(this.localePacksUrls[i.code],{signal:n.signal});a&&o.push({language:{code:i.code,name:i.name},localePack:a})}}catch(a){L.warn("failed downloading language pack",a)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:o,main:this.binaryBundle}}destroy(){for(let t of globalThis.Object.keys(s(this,pe)))s(this,pe)[t]=null;this.propTranslationCache.clear()}};pe=new WeakMap,b1=new WeakSet,Dw=function(t){let o=t?.nodes?.[0],n=this.getById("node",o);if(n==null)return;let i=Di([n.coordinate.longitude,n.coordinate.latitude]);return this.connectionSpaceIdsByLatLon[i]?.map(l=>this.connectionsById[l]).find(l=>l!=null)},Ed=new WeakMap;var Ew=(e,r)=>{let t=!e,o=r?.smoothing,i=o!=null?typeof o=="object"?o.enabled??t:o:t,a=typeof o=="object"?o.radius:void 0;return{enabled:i,radius:a??.75}};d();d();d();d();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var kw="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=";d();d();var Lw=!1;function Aw(){Lw=!0}function Rw(){return Lw}var x1=class{constructor(r){u(this,"backgroundAlpha",1);u(this,"backgroundColor",new qt);u(this,"width",0);u(this,"height",0);u(this,"options",{});u(this,"renderer");u(this,"enabledLayers",new Set([0,1]));u(this,"handleWebGLContextCreationError",r=>{this.options.onWebGLContextCreationError?.(r)});u(this,"handleWebGLContextLost",r=>{this.options.onWebGLContextLost?.(r)});u(this,"handleWebGLContextRestored",r=>{this.options.onWebGLContextRestored?.(r)});try{this.options=r,Rw()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new qt,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),readRenderTargetPixelsAsync:()=>Promise.resolve([]),setRenderTarget:()=>{},setClearColor:()=>{},clear:()=>{},render:()=>{},clearStencil:()=>{},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 M3({canvas:r.canvas,alpha:r.alpha||!1,stencil:!0,antialias:typeof r.antialias=="boolean"?r.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new qt(r.backgroundColor??"#ffffff"),this.backgroundAlpha=r.backgroundAlpha??1}catch(t){L.error(t),r.onWebGLRendererError&&r.onWebGLRendererError(t)}this.domElement()?.addEventListener("webglcontextlost",this.handleWebGLContextLost),this.domElement()?.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),this.domElement()?.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){this.renderer&&this.renderer.dispose?.(),this.domElement()?.removeEventListener("webglcontextlost",this.handleWebGLContextLost),this.domElement()?.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),this.domElement()?.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(r,t){if(this.renderer){this.renderer.state.reset(),t.layers.disableAll();for(let o of this.enabledLayers.values())t.layers.enable(o);this.renderer.clearStencil(),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(r,t),this.renderer.clearDepth(),t.layers.disableAll(),t.layers.enable(eg.ALWAYS_ON_TOP),this.renderer.render(r,t),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(r,t){y.env.NODE_ENV==="test"||!this.renderer||(this.width=r,this.height=t,this.renderer.setSize(r,t,!1))}setBackgroundColor(r,t){this.backgroundColor=r,this.backgroundAlpha=t}domElement(){return this.renderer?.domElement}};d();d();var _w='"use strict";(()=>{var Je=Object.defineProperty;var gt=(r,e,t)=>e in r?Je(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var _t=(r,e)=>{for(var t in e)Je(r,t,{get:e[t],enumerable:!0})};var w=(r,e,t)=>gt(r,typeof e!="symbol"?e+"":e,t);function Qe(r,e){return e.x+e.w<r.x+r.w&&e.x>r.x&&e.y>r.y&&e.y+e.h<r.y+r.h}function Ke(r,e){let[t,s]=e;return t>=r.x&&t<=r.x+r.w&&s>=r.y&&s<=r.y+r.h}function Ge(r,e){let t=e.x,s=e.y,n=e.x+e.w,a=e.y+e.h,o=r.x,i=r.y,u=r.x+r.w,l=r.y+r.h;return t<u&&o<n&&s<l&&i<a}function $(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}var b=class{constructor(e,t,s,n,a){w(this,"x");w(this,"y");w(this,"w");w(this,"h");w(this,"userData");this.userData=typeof a>"u"?null:a,this.x=e,this.y=t,this.w=s,this.h=n}contains(e){return e===this?!1:Qe(this,e)}intersects(e){return Ge(this,e)}intersectsPoint(e){return Ke(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var Re=class r{constructor(e,t){w(this,"topLeft");w(this,"topRight");w(this,"bottomLeft");w(this,"bottomRight");w(this,"divided",!1);w(this,"boundary");w(this,"capacity",16);w(this,"objects",[]);w(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:s,h:n}=this.boundary;this.topLeft=new r(new b(e,t,s/2,n/2),this),this.topRight=new r(new b(e+s/2,t,s/2,n/2),this),this.bottomLeft=new r(new b(e,t+n/2,s/2,n/2),this),this.bottomRight=new r(new b(e+s/2,t+n/2,s/2,n/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&($(t,this.topLeft.queryRect(e)),$(t,this.topRight.queryRect(e)),$(t,this.bottomLeft.queryRect(e)),$(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&($(t,this.topLeft.queryPoint(e)),$(t,this.topRight.queryPoint(e)),$(t,this.bottomLeft.queryPoint(e)),$(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 xe={};_t(xe,{BRAND:()=>Ut,DIRTY:()=>J,EMPTY_PATH:()=>kt,INVALID:()=>p,NEVER:()=>Ar,OK:()=>T,ParseStatus:()=>k,Schema:()=>_,ZodAny:()=>U,ZodArray:()=>z,ZodBigInt:()=>K,ZodBoolean:()=>G,ZodBranded:()=>Se,ZodCatch:()=>de,ZodDate:()=>H,ZodDefault:()=>ce,ZodDiscriminatedUnion:()=>Ee,ZodEffects:()=>j,ZodEnum:()=>ie,ZodError:()=>C,ZodFirstPartyTypeKind:()=>m,ZodFunction:()=>Pe,ZodIntersection:()=>se,ZodIssueCode:()=>c,ZodLazy:()=>ne,ZodLiteral:()=>ae,ZodMap:()=>ge,ZodNaN:()=>ve,ZodNativeEnum:()=>oe,ZodNever:()=>E,ZodNull:()=>te,ZodNullable:()=>Z,ZodNumber:()=>Q,ZodObject:()=>S,ZodOptional:()=>I,ZodParsedType:()=>f,ZodPipeline:()=>Ae,ZodPromise:()=>W,ZodReadonly:()=>ue,ZodRecord:()=>Me,ZodSchema:()=>_,ZodSet:()=>_e,ZodString:()=>F,ZodSymbol:()=>me,ZodTransformer:()=>j,ZodTuple:()=>P,ZodType:()=>_,ZodUndefined:()=>ee,ZodUnion:()=>re,ZodUnknown:()=>D,ZodVoid:()=>ye,addIssueToContext:()=>d,any:()=>Ht,array:()=>sr,bigint:()=>Xt,boolean:()=>dt,coerce:()=>Sr,custom:()=>it,date:()=>Jt,datetimeRegex:()=>nt,defaultErrorMap:()=>L,discriminatedUnion:()=>or,effect:()=>vr,enum:()=>yr,function:()=>hr,getErrorMap:()=>fe,getParsedType:()=>M,instanceof:()=>qt,intersection:()=>cr,isAborted:()=>Ne,isAsync:()=>he,isDirty:()=>je,isValid:()=>B,late:()=>Wt,lazy:()=>pr,literal:()=>mr,makeIssue:()=>Ce,map:()=>lr,nan:()=>Yt,nativeEnum:()=>gr,never:()=>tr,null:()=>Gt,nullable:()=>br,number:()=>ct,object:()=>nr,objectUtil:()=>ze,oboolean:()=>Cr,onumber:()=>Rr,optional:()=>xr,ostring:()=>Tr,pipeline:()=>wr,preprocess:()=>kr,promise:()=>_r,quotelessJson:()=>vt,record:()=>ur,set:()=>fr,setErrorMap:()=>bt,strictObject:()=>ar,string:()=>ot,symbol:()=>Qt,transformer:()=>vr,tuple:()=>dr,undefined:()=>Kt,union:()=>ir,unknown:()=>er,util:()=>v,void:()=>rr});var v;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{let a={};for(let o of n)a[o]=o;return a},r.getValidEnumValues=n=>{let a=r.objectKeys(n).filter(i=>typeof n[n[i]]!="number"),o={};for(let i of a)o[i]=n[i];return r.objectValues(o)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.push(o);return a},r.find=(n,a)=>{for(let o of n)if(a(o))return o},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(o=>typeof o=="string"?`\'${o}\'`:o).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(v||(v={}));var ze;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(ze||(ze={}));var f=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),M=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}};var c=v.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"]),vt=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),C=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(t(o));else{let i=s,u=0;for(;u<o.path.length;){let l=o.path[u];u===o.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(t(o))):i[l]=i[l]||{_errors:[]},i=i[l],u++}}};return n(this),s}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,v.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};C.create=r=>new C(r);var xt=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,v.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(r.options)}, received \'${r.received}\'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:v.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(r)}return{message:t}},L=xt;var He=L;function bt(r){He=r}function fe(){return He}var Ce=r=>{let{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],o={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let i="",u=s.filter(l=>!!l).slice().reverse();for(let l of u)i=l(o,{data:e,defaultError:i}).message;return{...n,path:a,message:i}},kt=[];function d(r,e){let t=fe(),s=Ce({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===L?void 0:L].filter(n=>!!n)});r.common.issues.push(s)}var k=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let n of t){if(n.status==="aborted")return p;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let n of t){let a=await n.key,o=await n.value;s.push({key:a,value:o})}return r.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let n of t){let{key:a,value:o}=n;if(a.status==="aborted"||o.status==="aborted")return p;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[a.value]=o.value)}return{status:e.value,value:s}}},p=Object.freeze({status:"aborted"}),J=r=>({status:"dirty",value:r}),T=r=>({status:"valid",value:r}),Ne=r=>r.status==="aborted",je=r=>r.status==="dirty",B=r=>r.status==="valid",he=r=>typeof Promise<"u"&&r instanceof Promise;var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));var N=class{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},et=(r,e)=>{if(B(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new C(r.common.issues);return this._error=t,this._error}}};function y(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(o,i)=>{let{message:u}=r;return o.code==="invalid_enum_value"?{message:u??i.defaultError}:typeof i.data>"u"?{message:u??s??i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:u??t??i.defaultError}},description:n}}var _=class{get description(){return this._def.description}_getType(e){return M(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:M(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:M(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(he(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){let s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:M(e)},n=this._parseSync({data:e,path:s.path,parent:s});return et(s,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:M(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:t});return B(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>B(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:M(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(he(n)?n:Promise.resolve(n));return et(s,a)}refine(e,t){let s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{let o=e(n),i=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(i(),!1)):o?!0:(i(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new j({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return I.create(this,this._def)}nullable(){return Z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return z.create(this)}promise(){return W.create(this,this._def)}or(e){return re.create([this,e],this._def)}and(e){return se.create(this,e,this._def)}transform(e){return new j({...y(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new ce({...y(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new Se({typeName:m.ZodBranded,type:this,...y(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new de({...y(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ae.create(this,e)}readonly(){return ue.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},wt=/^c[^\\s-]{8,}$/i,Tt=/^[0-9a-z]+$/,Rt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ct=/^[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,St=/^[a-z0-9_-]{21}$/i,At=/^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/,Ot=/^[-+]?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)?)??$/,It=/^(?!\\.)(?!.*\\.\\.)([A-Z0-9_\'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i,Nt="^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$",Be,jt=/^(?:(?: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])$/,Et=/^(?:(?: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])$/,Mt=/^(([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]))$/,Pt=/^(([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])$/,Zt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$t=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,rt="((\\\\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])))",Lt=new RegExp(`^${rt}$`);function st(r){let e="[0-5]\\\\d";r.precision?e=`${e}\\\\.\\\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\\\.\\\\d+)?`);let t=r.precision?"+":"?";return`([01]\\\\d|2[0-3]):[0-5]\\\\d(:${e})${t}`}function Vt(r){return new RegExp(`^${st(r)}$`)}function nt(r){let e=`${rt}T${st(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\\\d{2}:?\\\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Dt(r,e){return!!((e==="v4"||!e)&&jt.test(r)||(e==="v6"||!e)&&Mt.test(r))}function zt(r,e){if(!At.test(r))return!1;try{let[t]=r.split("."),s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Bt(r,e){return!!((e==="v4"||!e)&&Et.test(r)||(e==="v6"||!e)&&Pt.test(r))}var F=class r extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),p}let s=new k,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,i=e.data.length<a.value;(o||i)&&(n=this._getOrReturnCtx(e,n),o?d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")It.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Be||(Be=new RegExp(Nt,"u")),Be.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")Ct.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")St.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")wt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")Tt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")Rt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),d(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?nt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?Lt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?Vt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?Ot.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Dt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?zt(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"jwt",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?Bt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cidr",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?Zt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?$t.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64url",code:c.invalid_string,message:a.message}),s.dirty()):v.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...h.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...h.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...h.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};F.create=r=>new F({checks:[],typeName:m.ZodString,coerce:r?.coerce??!1,...y(r)});function Ft(r,e){let t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=Number.parseInt(r.toFixed(n).replace(".","")),o=Number.parseInt(e.toFixed(n).replace(".",""));return a%o/10**n}var Q=class r extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),p}let s,n=new k;for(let a of this._def.checks)a.kind==="int"?v.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Ft(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_finite,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Q.create=r=>new Q({checks:[],typeName:m.ZodNumber,coerce:r?.coerce||!1,...y(r)});var K=class r extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let s,n=new k;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:f.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};K.create=r=>new K({checks:[],typeName:m.ZodBigInt,coerce:r?.coerce??!1,...y(r)});var G=class extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.boolean,received:s.parsedType}),p}return T(e.data)}};G.create=r=>new G({typeName:m.ZodBoolean,coerce:r?.coerce||!1,...y(r)});var H=class r extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),p}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_date}),p}let s=new k,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):v.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};H.create=r=>new H({checks:[],coerce:r?.coerce||!1,typeName:m.ZodDate,...y(r)});var me=class extends _{_parse(e){if(this._getType(e)!==f.symbol){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.symbol,received:s.parsedType}),p}return T(e.data)}};me.create=r=>new me({typeName:m.ZodSymbol,...y(r)});var ee=class extends _{_parse(e){if(this._getType(e)!==f.undefined){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.undefined,received:s.parsedType}),p}return T(e.data)}};ee.create=r=>new ee({typeName:m.ZodUndefined,...y(r)});var te=class extends _{_parse(e){if(this._getType(e)!==f.null){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.null,received:s.parsedType}),p}return T(e.data)}};te.create=r=>new te({typeName:m.ZodNull,...y(r)});var U=class extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return T(e.data)}};U.create=r=>new U({typeName:m.ZodAny,...y(r)});var D=class extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return T(e.data)}};D.create=r=>new D({typeName:m.ZodUnknown,...y(r)});var E=class extends _{_parse(e){let t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),p}};E.create=r=>new E({typeName:m.ZodNever,...y(r)});var ye=class extends _{_parse(e){if(this._getType(e)!==f.undefined){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.void,received:s.parsedType}),p}return T(e.data)}};ye.create=r=>new ye({typeName:m.ZodVoid,...y(r)});var z=class r extends _{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return d(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),p;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(o||i)&&(d(t,{code:o?c.too_big:c.too_small,minimum:i?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(d(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(d(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((o,i)=>n.type._parseAsync(new N(t,o,t.path,i)))).then(o=>k.mergeArray(s,o));let a=[...t.data].map((o,i)=>n.type._parseSync(new N(t,o,t.path,i)));return k.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}};z.create=(r,e)=>new z({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...y(e)});function pe(r){if(r instanceof S){let e={};for(let t in r.shape){let s=r.shape[t];e[t]=I.create(pe(s))}return new S({...r._def,shape:()=>e})}else return r instanceof z?new z({...r._def,type:pe(r.element)}):r instanceof I?I.create(pe(r.unwrap())):r instanceof Z?Z.create(pe(r.unwrap())):r instanceof P?P.create(r.items.map(e=>pe(e))):r}var S=class r extends _{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){let l=this._getOrReturnCtx(e);return d(l,{code:c.invalid_type,expected:f.object,received:l.parsedType}),p}let{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof E&&this._def.unknownKeys==="strip"))for(let l in n.data)o.includes(l)||i.push(l);let u=[];for(let l of o){let g=a[l],R=n.data[l];u.push({key:{status:"valid",value:l},value:g._parse(new N(n,R,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof E){let l=this._def.unknownKeys;if(l==="passthrough")for(let g of i)u.push({key:{status:"valid",value:g},value:{status:"valid",value:n.data[g]}});else if(l==="strict")i.length>0&&(d(n,{code:c.unrecognized_keys,keys:i}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let g of i){let R=n.data[g];u.push({key:{status:"valid",value:g},value:l._parse(new N(n,R,n.path,g)),alwaysSet:g in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let g of u){let R=await g.key,Oe=await g.value;l.push({key:R,value:Oe,alwaysSet:g.alwaysSet})}return l}).then(l=>k.mergeObjectSync(s,l)):k.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{let n=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};for(let s of v.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new r({...this._def,shape:()=>t})}omit(e){let t={};for(let s of v.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new r({...this._def,shape:()=>t})}deepPartial(){return pe(this)}partial(e){let t={};for(let s of v.objectKeys(this.shape)){let n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new r({...this._def,shape:()=>t})}required(e){let t={};for(let s of v.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof I;)a=a._def.innerType;t[s]=a}return new r({...this._def,shape:()=>t})}keyof(){return at(v.objectKeys(this.shape))}};S.create=(r,e)=>new S({shape:()=>r,unknownKeys:"strip",catchall:E.create(),typeName:m.ZodObject,...y(e)});S.strictCreate=(r,e)=>new S({shape:()=>r,unknownKeys:"strict",catchall:E.create(),typeName:m.ZodObject,...y(e)});S.lazycreate=(r,e)=>new S({shape:r,unknownKeys:"strip",catchall:E.create(),typeName:m.ZodObject,...y(e)});var re=class extends _{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(let i of a)if(i.result.status==="valid")return i.result;for(let i of a)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let o=a.map(i=>new C(i.ctx.common.issues));return d(t,{code:c.invalid_union,unionErrors:o}),p}if(t.common.async)return Promise.all(s.map(async a=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(n);{let a,o=[];for(let u of s){let l={...t,common:{...t.common,issues:[]},parent:null},g=u._parseSync({data:t.data,path:t.path,parent:l});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let i=o.map(u=>new C(u));return d(t,{code:c.invalid_union,unionErrors:i}),p}}get options(){return this._def.options}};re.create=(r,e)=>new re({options:r,typeName:m.ZodUnion,...y(e)});var V=r=>r instanceof ne?V(r.schema):r instanceof j?V(r.innerType()):r instanceof ae?[r.value]:r instanceof ie?r.options:r instanceof oe?v.objectValues(r.enum):r instanceof ce?V(r._def.innerType):r instanceof ee?[void 0]:r instanceof te?[null]:r instanceof I?[void 0,...V(r.unwrap())]:r instanceof Z?[null,...V(r.unwrap())]:r instanceof Se||r instanceof ue?V(r.unwrap()):r instanceof de?V(r._def.innerType):[],Ee=class r extends _{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return d(t,{code:c.invalid_type,expected:f.object,received:t.parsedType}),p;let s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(d(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let n=new Map;for(let a of t){let o=V(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \\`${e}\\` could not be extracted from all schema options`);for(let i of o){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,a)}}return new r({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(s)})}};function Fe(r,e){let t=M(r),s=M(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){let n=v.objectKeys(e),a=v.objectKeys(r).filter(i=>n.indexOf(i)!==-1),o={...r,...e};for(let i of a){let u=Fe(r[i],e[i]);if(!u.valid)return{valid:!1};o[i]=u.data}return{valid:!0,data:o}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<r.length;a++){let o=r[a],i=e[a],u=Fe(o,i);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===f.date&&s===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var se=class extends _{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=(a,o)=>{if(Ne(a)||Ne(o))return p;let i=Fe(a.value,o.value);return i.valid?((je(a)||je(o))&&t.dirty(),{status:t.value,value:i.data}):(d(s,{code:c.invalid_intersection_types}),p)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,o])=>n(a,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};se.create=(r,e,t)=>new se({left:r,right:e,typeName:m.ZodIntersection,...y(t)});var P=class r extends _{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return d(s,{code:c.invalid_type,expected:f.array,received:s.parsedType}),p;if(s.data.length<this._def.items.length)return d(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&s.data.length>this._def.items.length&&(d(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...s.data].map((o,i)=>{let u=this._def.items[i]||this._def.rest;return u?u._parse(new N(s,o,s.path,i)):null}).filter(o=>!!o);return s.common.async?Promise.all(a).then(o=>k.mergeArray(t,o)):k.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};P.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new P({items:r,typeName:m.ZodTuple,rest:null,...y(e)})};var Me=class r extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return d(s,{code:c.invalid_type,expected:f.object,received:s.parsedType}),p;let n=[],a=this._def.keyType,o=this._def.valueType;for(let i in s.data)n.push({key:a._parse(new N(s,i,s.path,i)),value:o._parse(new N(s,s.data[i],s.path,i)),alwaysSet:i in s.data});return s.common.async?k.mergeObjectAsync(t,n):k.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof _?new r({keyType:e,valueType:t,typeName:m.ZodRecord,...y(s)}):new r({keyType:F.create(),valueType:e,typeName:m.ZodRecord,...y(t)})}},ge=class extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return d(s,{code:c.invalid_type,expected:f.map,received:s.parsedType}),p;let n=this._def.keyType,a=this._def.valueType,o=[...s.data.entries()].map(([i,u],l)=>({key:n._parse(new N(s,i,s.path,[l,"key"])),value:a._parse(new N(s,u,s.path,[l,"value"]))}));if(s.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let u of o){let l=await u.key,g=await u.value;if(l.status==="aborted"||g.status==="aborted")return p;(l.status==="dirty"||g.status==="dirty")&&t.dirty(),i.set(l.value,g.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let u of o){let l=u.key,g=u.value;if(l.status==="aborted"||g.status==="aborted")return p;(l.status==="dirty"||g.status==="dirty")&&t.dirty(),i.set(l.value,g.value)}return{status:t.value,value:i}}}};ge.create=(r,e,t)=>new ge({valueType:e,keyType:r,typeName:m.ZodMap,...y(t)});var _e=class r extends _{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return d(s,{code:c.invalid_type,expected:f.set,received:s.parsedType}),p;let n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(d(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(d(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function o(u){let l=new Set;for(let g of u){if(g.status==="aborted")return p;g.status==="dirty"&&t.dirty(),l.add(g.value)}return{status:t.value,value:l}}let i=[...s.data.values()].map((u,l)=>a._parse(new N(s,u,s.path,l)));return s.common.async?Promise.all(i).then(u=>o(u)):o(i)}min(e,t){return new r({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};_e.create=(r,e)=>new _e({valueType:r,minSize:null,maxSize:null,typeName:m.ZodSet,...y(e)});var Pe=class r extends _{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return d(t,{code:c.invalid_type,expected:f.function,received:t.parsedType}),p;function s(i,u){return Ce({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fe(),L].filter(l=>!!l),issueData:{code:c.invalid_arguments,argumentsError:u}})}function n(i,u){return Ce({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fe(),L].filter(l=>!!l),issueData:{code:c.invalid_return_type,returnTypeError:u}})}let a={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof W){let i=this;return T(async function(...u){let l=new C([]),g=await i._def.args.parseAsync(u,a).catch(be=>{throw l.addIssue(s(u,be)),l}),R=await Reflect.apply(o,this,g);return await i._def.returns._def.type.parseAsync(R,a).catch(be=>{throw l.addIssue(n(R,be)),l})})}else{let i=this;return T(function(...u){let l=i._def.args.safeParse(u,a);if(!l.success)throw new C([s(u,l.error)]);let g=Reflect.apply(o,this,l.data),R=i._def.returns.safeParse(g,a);if(!R.success)throw new C([n(g,R.error)]);return R.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:P.create(e).rest(D.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new r({args:e||P.create([]).rest(D.create()),returns:t||D.create(),typeName:m.ZodFunction,...y(s)})}},ne=class extends _{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};ne.create=(r,e)=>new ne({getter:r,typeName:m.ZodLazy,...y(e)});var ae=class extends _{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}};ae.create=(r,e)=>new ae({value:r,typeName:m.ZodLiteral,...y(e)});function at(r,e){return new ie({values:r,typeName:m.ZodEnum,...y(e)})}var ie=class r extends _{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return d(t,{expected:v.joinValues(s),received:t.parsedType,code:c.invalid_type}),p}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return d(t,{received:t.data,code:c.invalid_enum_value,options:s}),p}return T(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}};ie.create=at;var oe=class extends _{_parse(e){let t=v.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){let n=v.objectValues(t);return d(s,{expected:v.joinValues(n),received:s.parsedType,code:c.invalid_type}),p}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=v.objectValues(t);return d(s,{received:s.data,code:c.invalid_enum_value,options:n}),p}return T(e.data)}get enum(){return this._def.values}};oe.create=(r,e)=>new oe({values:r,typeName:m.ZodNativeEnum,...y(e)});var W=class extends _{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return d(t,{code:c.invalid_type,expected:f.promise,received:t.parsedType}),p;let s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return T(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};W.create=(r,e)=>new W({type:r,typeName:m.ZodPromise,...y(e)});var j=class extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:o=>{d(s,o),o.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let o=n.transform(s.data,a);if(s.common.async)return Promise.resolve(o).then(async i=>{if(t.value==="aborted")return p;let u=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return u.status==="aborted"?p:u.status==="dirty"?J(u.value):t.value==="dirty"?J(u.value):u});{if(t.value==="aborted")return p;let i=this._def.schema._parseSync({data:o,path:s.path,parent:s});return i.status==="aborted"?p:i.status==="dirty"?J(i.value):t.value==="dirty"?J(i.value):i}}if(n.type==="refinement"){let o=i=>{let u=n.refinement(i,a);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?p:(i.status==="dirty"&&t.dirty(),o(i.value),{status:t.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?p:(i.status==="dirty"&&t.dirty(),o(i.value).then(()=>({status:t.value,value:i.value}))))}if(n.type==="transform")if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!B(o))return p;let i=n.transform(o.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>B(o)?Promise.resolve(n.transform(o.value,a)).then(i=>({status:t.value,value:i})):p);v.assertNever(n)}};j.create=(r,e,t)=>new j({schema:r,typeName:m.ZodEffects,effect:e,...y(t)});j.createWithPreprocess=(r,e,t)=>new j({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,...y(t)});var I=class extends _{_parse(e){return this._getType(e)===f.undefined?T(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};I.create=(r,e)=>new I({innerType:r,typeName:m.ZodOptional,...y(e)});var Z=class extends _{_parse(e){return this._getType(e)===f.null?T(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Z.create=(r,e)=>new Z({innerType:r,typeName:m.ZodNullable,...y(e)});var ce=class extends _{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};ce.create=(r,e)=>new ce({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});var de=class extends _{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return he(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new C(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new C(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};de.create=(r,e)=>new de({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});var ve=class extends _{_parse(e){if(this._getType(e)!==f.nan){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.nan,received:s.parsedType}),p}return{status:"valid",value:e.data}}};ve.create=r=>new ve({typeName:m.ZodNaN,...y(r)});var Ut=Symbol("zod_brand"),Se=class extends _{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},Ae=class r extends _{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?p:a.status==="dirty"?(t.dirty(),J(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{let n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?p:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new r({in:e,out:t,typeName:m.ZodPipeline})}},ue=class extends _{_parse(e){let t=this._def.innerType._parse(e),s=n=>(B(n)&&(n.value=Object.freeze(n.value)),n);return he(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}};ue.create=(r,e)=>new ue({innerType:r,typeName:m.ZodReadonly,...y(e)});function tt(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function it(r,e={},t){return r?U.create().superRefine((s,n)=>{let a=r(s);if(a instanceof Promise)return a.then(o=>{if(!o){let i=tt(e,s),u=i.fatal??t??!0;n.addIssue({code:"custom",...i,fatal:u})}});if(!a){let o=tt(e,s),i=o.fatal??t??!0;n.addIssue({code:"custom",...o,fatal:i})}}):U.create()}var Wt={object:S.lazycreate},m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));var qt=(r,e={message:`Input not instance of ${r.name}`})=>it(t=>t instanceof r,e),ot=F.create,ct=Q.create,Yt=ve.create,Xt=K.create,dt=G.create,Jt=H.create,Qt=me.create,Kt=ee.create,Gt=te.create,Ht=U.create,er=D.create,tr=E.create,rr=ye.create,sr=z.create,nr=S.create,ar=S.strictCreate,ir=re.create,or=Ee.create,cr=se.create,dr=P.create,ur=Me.create,lr=ge.create,fr=_e.create,hr=Pe.create,pr=ne.create,mr=ae.create,yr=ie.create,gr=oe.create,_r=W.create,vr=j.create,xr=I.create,br=Z.create,kr=j.createWithPreprocess,wr=Ae.create,Tr=()=>ot().optional(),Rr=()=>ct().optional(),Cr=()=>dt().optional(),Sr={string:r=>F.create({...r,coerce:!0}),number:r=>Q.create({...r,coerce:!0}),boolean:r=>G.create({...r,coerce:!0}),bigint:r=>K.create({...r,coerce:!0}),date:r=>H.create({...r,coerce:!0})};var Ar=p;var Os=xe.union([xe.enum(["low","medium","high","always-visible"]),xe.number()]);var Ze=5;var q=200,$e=10;function ut(r,e,t,s,n,a,o="-1"){let i=1/0,u=1/0,l=-1/0,g=-1/0,R=new b(-$e,0,5,t),Oe=new b(-$e,0,e,5),be=new b(e-5,0,e+$e,t),ft=new b(0,t-5,e,t+$e),ht=Or(e,t,s,n,a),pt=[R,Oe,be,ft],Ue=new b(-q,-q,e+q*2,t+q*2);for(let x of r){let we,Te;for(let A=0;A<x.bboxes.length;A++){if(x.bboxes[A]==null||(we=x.bboxes[A].boundingBox,Te=x.bboxes[A].index,x.lockedToStrategyIndex!==-1&&Te!==x.lockedToStrategyIndex))continue;let[Ie,O,Y,We]=we,[X,mt,qe,yt]=[x.y-Ie,x.y+O,x.x-Y,x.x+We],Ve=qe,De=X,Ye=yt-qe,Xe=mt-X;i=Math.min(i,Ve)-q,u=Math.min(u,De)-q,l=Math.max(l,Ve+Ye)+q,g=Math.max(g,De+Xe)+q,x.bboxes[A].boundingRect=new b(Ve,De,Ye,Xe)}}let le={msgId:o,colliders:new Array(r.length),debug:[]},Le=new Re(new b(i,u,l-i,g-u)),ke;for(let x=0;x<r.length;x++)if(ke=r[x],le.colliders[x]=[-1,0],ke.enabledAndVisible){let[we,Te,A]=[1/0,-1,void 0];for(let{index:Ie,boundingRect:O}of ke.bboxes){if(O==null)continue;let Y=[];if(Y=Le.queryRect(O).filter(X=>O.intersects(X)),ke.shouldCollideWithScreenEdges&&pt.forEach(X=>{O.intersects(X)&&Y.push(X)}),O.intersects(ht)){le.colliders[x]=[-1,0,O];break}if(Y.length<=we&&(A=O,Te=Ie,we=Y.length),Y.length===0){Le.insert(O),le.colliders[x]=[Ie,Ue.contains(O)?0:1,O];break}}ke.rank===Ze&&A!=null&&(Le.insert(A),le.colliders[x]=[Te,Ue.contains(A)?0:1,A])}else le.colliders[x]=[-1,0];return le}function Or(r,e,t,s,n){switch(n){case"top-right":return new b(r-t,0,t,s);case"bottom-left":return new b(0,e-s,t,s);case"bottom-right":return new b(r-t,e-s,t,s);case"top-left":return new b(0,0,t,s)}}function lt(r){let e=r[0].map(t=>{let s=t[0].map(n=>({index:n[4],boundingBox:[n[0],n[1],n[2],n[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?Ze:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:s,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:r[3],totalHeight:r[2],watermarkWidth:r[4],watermarkHeight:r[5],watermarkPosition:r[6],colliders:e,devicePixelRatio:r[1]}}self.onmessage=r=>{let e=lt(r.data);self.postMessage(ut(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';d();d();d();d();d();function Bw(e,r){return r.x+r.w<e.x+e.w&&r.x>e.x&&r.y>e.y&&r.y+r.h<e.y+e.h}d();function Nw(e,r){let[t,o]=r;return t>=e.x&&t<=e.x+e.w&&o>=e.y&&o<=e.y+e.h}d();function jw(e,r){let t=r.x,o=r.y,n=r.x+r.w,i=r.y+r.h,a=e.x,l=e.y,c=e.x+e.w,p=e.y+e.h;return t<c&&a<n&&o<p&&l<i}d();function Ns(e,r){for(let t=0;t<r.length;t++)e.push(r[t])}d();var qe=class{constructor(r,t,o,n,i){u(this,"x");u(this,"y");u(this,"w");u(this,"h");u(this,"userData");this.userData=typeof i>"u"?null:i,this.x=r,this.y=t,this.w=o,this.h=n}contains(r){return r===this?!1:Bw(this,r)}intersects(r){return jw(this,r)}intersectsPoint(r){return Nw(this,r)}draw(r){r.fillStyle="rgba(123,222,26, 0.8)",r.fillRect(this.x,this.y,this.w,this.h)}};var mn=class e{constructor(r,t){u(this,"topLeft");u(this,"topRight");u(this,"bottomLeft");u(this,"bottomRight");u(this,"divided",!1);u(this,"boundary");u(this,"capacity",16);u(this,"objects",[]);u(this,"parent");this.parent=t,this.boundary=r}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:r,y:t,w:o,h:n}=this.boundary;this.topLeft=new e(new qe(r,t,o/2,n/2),this),this.topRight=new e(new qe(r+o/2,t,o/2,n/2),this),this.bottomLeft=new e(new qe(r,t+n/2,o/2,n/2),this),this.bottomRight=new e(new qe(r+o/2,t+n/2,o/2,n/2),this),this.divided=!0}queryRect(r){let t=[];if(this.boundary.intersects(r))t.push(...this.objects);else return[];return this.divided&&(Ns(t,this.topLeft.queryRect(r)),Ns(t,this.topRight.queryRect(r)),Ns(t,this.bottomLeft.queryRect(r)),Ns(t,this.bottomRight.queryRect(r))),t}queryPoint(r){let t=[];if(this.boundary.intersectsPoint(r))t.push(...this.objects);else return[];return this.divided&&(Ns(t,this.topLeft.queryPoint(r)),Ns(t,this.topRight.queryPoint(r)),Ns(t,this.bottomLeft.queryPoint(r)),Ns(t,this.bottomRight.queryPoint(r))),t}insert(r){return(this.parent?!this.boundary.contains(r):!this.boundary.intersects(r))?!1:this.objects.length<this.capacity?(this.objects.push(r),!0):(this.divided||this.subdivide(),(this.topLeft.insert(r)||this.topRight.insert(r)||this.bottomLeft.insert(r)||this.bottomRight.insert(r))===!1&&this.objects.push(r),!0)}drawObjects(r){this.objects.forEach(t=>t.draw(r)),this.divided&&(this.topLeft.drawObjects(r),this.topRight.drawObjects(r),this.bottomLeft.drawObjects(r),this.bottomRight.drawObjects(r))}draw(r){r.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(r),this.topRight.draw(r),this.bottomLeft.draw(r),this.bottomRight.draw(r)),r.strokeStyle="black",r.lineWidth=4,r.stroke()}};d();function Gw(e,r,t){let o,n,i,a=null,l=0;t||(t={});let c=function(){l=t.leading===!1?0:Date.now(),a=null,i=e.apply(o,n),a||(o=n=null)};return function(){let p=Date.now();!l&&t.leading===!1&&(l=p);let m=r-(p-l);return o=globalThis,n=arguments,m<=0||m>r?(a&&(clearTimeout(a),a=null),l=p,i=e.apply(o,n),a||(o=n=null)):!a&&t.trailing!==!1&&(a=setTimeout(c,m)),i}}function Uw(e){let r=e[0].map(t=>{let o=t[0].map(n=>({index:n[4],boundingBox:[n[0],n[1],n[2],n[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?_c:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:o,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:e[3],totalHeight:e[2],watermarkWidth:e[4],watermarkHeight:e[5],watermarkPosition:e[6],colliders:r,devicePixelRatio:e[1]}}d();d();var Ua=200,v1=10;function Vw(e,r,t,o,n,i,a="-1"){let l=1/0,c=1/0,p=-1/0,m=-1/0,f=new qe(-v1,0,5,t),g=new qe(-v1,0,r,5),b=new qe(r-5,0,r+v1,t),x=new qe(0,t-5,r,t+v1),C=IG(r,t,o,n,i),v=[f,g,b,x],I=new qe(-Ua,-Ua,r+Ua*2,t+Ua*2);for(let P of e){let B,G;for(let A=0;A<P.bboxes.length;A++){if(P.bboxes[A]==null||(B=P.bboxes[A].boundingBox,G=P.bboxes[A].index,P.lockedToStrategyIndex!==-1&&G!==P.lockedToStrategyIndex))continue;let[N,z,Z,oe]=B,[J,fe,ye,Te]=[P.y-N,P.y+z,P.x-Z,P.x+oe],ve=ye,we=J,ie=Te-ye,Me=fe-J;l=Math.min(l,ve)-Ua,c=Math.min(c,we)-Ua,p=Math.max(p,ve+ie)+Ua,m=Math.max(m,we+Me)+Ua,P.bboxes[A].boundingRect=new qe(ve,we,ie,Me)}}let M={msgId:a,colliders:new Array(e.length),debug:[]},O=new mn(new qe(l,c,p-l,m-c)),T;for(let P=0;P<e.length;P++)if(T=e[P],M.colliders[P]=[-1,0],T.enabledAndVisible){let[B,G,A]=[1/0,-1,void 0];for(let{index:N,boundingRect:z}of T.bboxes){if(z==null)continue;let Z=[];if(Z=O.queryRect(z).filter(J=>z.intersects(J)),T.shouldCollideWithScreenEdges&&v.forEach(J=>{z.intersects(J)&&Z.push(J)}),z.intersects(C)){M.colliders[P]=[-1,0,z];break}if(Z.length<=B&&(A=z,G=N,B=Z.length),Z.length===0){O.insert(z),M.colliders[P]=[N,I.contains(z)?0:1,z];break}}T.rank===_c&&A!=null&&(O.insert(A),M.colliders[P]=[G,I.contains(A)?0:1,A])}else M.colliders[P]=[-1,0];return M}function IG(e,r,t,o,n){switch(n){case"top-right":return new qe(e-t,0,t,o);case"bottom-left":return new qe(0,r-o,t,o);case"bottom-right":return new qe(e-t,r-o,t,o);case"top-left":return new qe(0,0,t,o)}}var Vm=class{constructor(){u(this,"onerror",()=>{});u(this,"onmessage",()=>{});u(this,"postMessage",r=>{let t=Uw(r);this.onmessage({data:Vw(t.colliders,t.totalWidth,t.totalHeight,t.watermarkWidth,t.watermarkHeight,t.watermarkPosition,t.msgId)})});u(this,"terminate",()=>{})}};var Hm=!1,SG=150,I1=class extends Ie{constructor(t,o,n=!0){super();u(this,"worker");u(this,"debugContext");u(this,"debugCanvas");u(this,"collidersDirty",!0);u(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);u(this,"visibleCollidersQTree",new mn(new qe(0,0,0,0)));u(this,"interactiveCollidersQTree",new mn(new qe(0,0,0,0)));u(this,"coreState");u(this,"postMessage");u(this,"showCollisionBoxes",()=>{Hm=!0,this.debugCanvas.style.display="block"});u(this,"hideCollisionBoxes",()=>{Hm=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"});u(this,"currentMsgId","");u(this,"working",!1);u(this,"_postMessage",()=>{this.worker.postMessage(this.packedMessage)});u(this,"componentArray",[]);u(this,"update",(t,o,n="bottom-left",i=!1)=>{let a=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let l;for(let c of this.coreState.geometry2DIdsInScene){let p=this.coreState.geometry2DMap.get(c);p&&(l=p.components[0],this.componentArray.push(l))}this.resize(t,o,n),this.collidersDirty=!1,a=!0}else a=this.componentArray.some(l=>l.collisionDirty===!0);a&&this.componentArray.sort((l,c)=>c.rank-l.rank);for(let l=0;l<this.componentArray.length;l++)if(this.packedMessage){let c=this.componentArray[l].toPackedMessage(i&&!a);this.packedMessage[0][l]==null&&(this.packedMessage[0][l]=[]),this.packedMessage[0][l][0]==null&&(this.packedMessage[0][l][0]=[]),this.packedMessage[0][l][0]=c.bboxes,this.packedMessage[0][l][1]=c.enabled&&this.componentArray[l].visible&&!this.componentArray[l].isOccluded?1:0,this.packedMessage[0][l][2]=c.rank===_c?1:0,this.packedMessage[0][l][3]=c.x,this.packedMessage[0][l][4]=c.y,this.packedMessage[0][l][5]=c.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][l][6]=c.lockedToStrategyIndex}this.working||this.postMessage()});u(this,"resolve",t=>{if(this.working=!1,this.collidersDirty||!t.data)return;let o=t.data.colliders,n=-1,i,a,l,c=new qe(0,0,this.debugCanvas.width,this.debugCanvas.height);this.visibleCollidersQTree=new mn(c),this.interactiveCollidersQTree=new mn(c);for(let p=0;p<this.componentArray.length;p++){let m=this.componentArray[p];o[p]!=null&&(n=o[p][0],i=o[p][2],m.offscreen=o[p][1]===1,n!==-1&&i!=null?(l=new qe(i.x,i.y,i.w,i.h,{entityId:m.id}),this.visibleCollidersQTree.insert(l),a=this.coreState.geometry2DMap.get(m.id),a?.components[1]!=null&&this.interactiveCollidersQTree.insert(l),(m.canShow===!1||m.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in m&&(m.visibilityNeedsUpdate="show"),n!==-1&&n!==m.currentStrategyIndex&&(m.activeBoundingBox=l,m.onStrategySelected(n))):((m.canShow===!0||m.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in m&&(m.visibilityNeedsUpdate="hide"),n!==-1&&n!==m.currentStrategyIndex&&m.onStrategySelected(n)))}Hm&&this.drawDebug(),this.publish("visibility-changed")});u(this,"drawDebug",()=>{Hm&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))});u(this,"destroy",()=>{this.worker.terminate()});this.worker=n===!1?new Vm:ec!==""?new Worker(ec):new Worker(URL.createObjectURL(new Blob([_w],{type:"text/javascript"}))),this.worker.onerror=()=>{this.worker=new Vm,this.worker.onmessage=i=>this.resolve(i)},this.coreState=o,this.debugCanvas=t,this.debugContext=t.getContext("2d"),this.worker.onmessage=i=>this.resolve(i),this.postMessage=Gw(this._postMessage,SG,!1),Hm?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(t,o,n){this.packedMessage[6]=n,this.packedMessage[5]=o,this.packedMessage[4]=t,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};d();d();d();d();var S1=class{constructor(r){u(this,"type");u(this,"event");this.type=0,this.event=r}get timestamp(){return this.event.timeStamp}},C1=class{constructor(){u(this,"taps",[])}add(r){this.lastPointerDown&&r.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(r)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){return this.isSingleTap&&this.lastPointerDown?.type===1}get isSingleTapWithOneFinger(){return this.isSingleTap&&this.lastPointerDown?.type===0}get isDoubleTapWithOneFinger(){return this.isDoubleTap&&this.taps[0]?.type===0&&this.taps[1]?.type===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(r){this.taps=this.taps.filter(t=>r-t.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};d();function Zv(e){let r=new Set;for(let t of e){let o=t.object;for(;o.visible&&o.parent&&o.parent.visible===!0&&!r.has(o.parent);)o=o.parent,o instanceof nr&&o.type==="group-container"&&o.visible&&o.components[0]&&r.add(o)}return Array.from(r)}var Dd,$m=class extends Ie{constructor(t,o,n,i,a){super();u(this,"raycaster",new ai);u(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});u(this,"coreState");u(this,"camera");u(this,"worldPlane");u(this,"_quadtree",new mn(new qe(0,0,0,0)));u(this,"_container");u(this,"lastPointerEvent");u(this,"cursor","grab");u(this,"touchesCount",0);u(this,"isUserInteracting");u(this,"hasTouched",!1);S(this,Dd);u(this,"onPointerMoveRaf",t=>{this.lastPointerEvent=t,s(this,Dd)&&cancelAnimationFrame(s(this,Dd)),w(this,Dd,requestAnimationFrame(()=>{this.onPointerMove(t)}))});u(this,"onPointerMove",t=>{t.preventDefault(),this.updateInteractionStateIfPanning(t),(t.pointerType!=="touch"||t.pointerType===void 0&&this.hasTouched)&&this.handleHover(t),this.handleCursor()});u(this,"tapsControl",new C1);u(this,"onPointerDown",t=>{t.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:t.timeStamp,offsetX:t.offsetX,offsetY:t.offsetY},this.lastPointerEvent=t,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),t.pointerType==="touch"&&(this.tapsControl.add(new S1(t)),this.touchesCount=Math.max(0,this.touchesCount+1)))});u(this,"clickTimeout");u(this,"onPointerUp",t=>{this.tapsControl.discardOutsideOfWaitWindow(t.timeStamp),this.lastPointerEvent=t,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(t);let{mouseDownStart:o}=this.state.interaction;!o||this.state.interaction.distanceFromMouseDown==null||(Date.now()<o.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(t.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",t),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(t),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",t),this.flush()):this.handleClick(t)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())});u(this,"dirty3D",!0);u(this,"cachedHitBoxes",{entities:[]});u(this,"ndcPoint",new Se);u(this,"debugPanel");this.isUserInteracting=a,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=n,this._container=t,this.coreState=o,this.worldPlane=i,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(t){this._quadtree=t}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let t=this.state.hovered3DEntity.components[2];t&&(t.dirty=!0)}}getThreeDIntersectsFromXY(t){this.raycaster.setFromCamera(t,this.camera),this.raycaster.layers.enable(0);let o=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(i=>i.object?.name==="worldPlane"||i.object?.visible),n=o.findIndex(i=>i.object?.name==="worldPlane");return n!==-1&&o.push(o.splice(n,1)[0]),o}getGroupContainerIntersectsFromXY(t){let o=this.getThreeDIntersectsFromXY(t),n;return o!=null&&o.length>0&&(n=Zv(o)),n}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(t){let o=t||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!o||this.isUserInteracting())return;let{entity3D:n,entity2D:i,position:a,groupContainers:l}=this.intersect(o);(this.detect3DEntityHover(n)||this.detect2DEntityHover(i)||this.detect3DContainerHover(l))&&(this.state.hovered3DEntity=n,this.state.lastHover=n,this.state.hovered2DEntity=i,this.state.hovered3DContainers=l,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:l})),this.handleCursor()}handleCursor(){let t=!!(this.state.hovered3DEntity&&this.state.hovered3DEntity?.components[2]||this.state.hovered2DEntity),o=!!this.state.interaction.mouseDownStart,n=this.state.interaction.isPanning,i=MG(t,n,o);this.cursor!==i&&(this.cursor=i,i==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(t){return this.state.hovered2DEntity!==t}handleClick(t){let o=this.intersect(t);this.publish("click",{entity2D:o.entity2D,entity3D:o.entity3D,position:o.position,groupContainers:o.groupContainers,pointerEvent:{button:t.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[];let t;for(let o of this.coreState.geometry3DIdsInScene)t=this.coreState.geometry3DMap.get(o),(t?.type==="geometry"||t?.type==="model"||t?.type==="path"||t?.type==="custom-geometry")&&t.components[0].mesh&&!this.cachedHitBoxes.entities.includes(t.components[0].mesh)&&this.cachedHitBoxes.entities.push(t.components[0].mesh);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(t){let{offsetX:o,offsetY:n}=t,i=[o,n],a=this._quadtree.queryPoint(i),[l]=a.filter(I=>I.intersectsPoint(i));this.ndcPoint.x=o/this._container.clientWidth*2-1,this.ndcPoint.y=-(n/this._container.clientHeight)*2+1;let c=this.getThreeDIntersectsFromXY(this.ndcPoint),p=c[0]?.point,m=[],f=[],g=c.filter(I=>I.object.name!=="worldPlane");for(let I of g)I.object instanceof Oe&&I.object.material.depthTest===!1?m.push(I):f.push(I);let b=m[0]??f[0]??void 0,x,C;if(b!=null){if(x=OG(b.object,this.coreState.geometry3DMap),!x){let I=b?.instanceId??b?.batchId;x=I!=null&&b?.object.userData.entities?this.coreState.geometry3DMap.get(b?.object.userData.entities[I]):this.coreState.geometry3DMap.get(b?.object.userData.entityId)}x?.components[2]&&(C=x)}let v=Zv(g);return{entity2D:l?.userData?.entityId==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(l?.userData.entityId),entity3D:C,position:p,groupContainers:v.length>0?v:void 0}}detect3DEntityHover(t){return this.state.lastHover!==t&&(this.state.lastHover&&Ww(this.state.lastHover,!1,this.coreState),t&&Ww(t,!0,this.coreState)),this.state.hovered3DEntity!==t}detect3DContainerHover(t){return!w3(this.state.hovered3DContainers,t)}updateInteractionStateIfPanning(t){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(t.offsetX-this.state.interaction.mouseDownStart.offsetX,2)+Math.pow(t.offsetY-this.state.interaction.mouseDownStart.offsetY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.worldPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let t=document.createElement("div");t.style.position="absolute",t.style.top="0",t.style.right="0",t.style.backgroundColor="white",t.style.padding="10px",document.body.append(t),t.id="interaction-debug-panel",this.debugPanel=t,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",o=>{this.queueDebugMessage(`CLICK
|
|
7
|
+
3D: ${o.entity3D?.id}
|
|
8
|
+
2D: ${o.entity2D?.id}
|
|
9
|
+
Pos: ${o.position?.toArray().join(", ")}`,"#fdffb6")}),this.on("hover",o=>{this.queueDebugMessage(`HOVER
|
|
10
|
+
3D: ${o.entity3D?.id}
|
|
11
|
+
2D: ${o.entity2D?.id}
|
|
12
|
+
Pos: ${o.position?.toArray().join(", ")}`,"#caffbf")})}get _state(){return this.state}queueDebugMessage(t,o){let n=document.createElement("pre");n.style.maxWidth="300px",n.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",n.style.backgroundColor=o,n.textContent=t,this.debugPanel?.prepend(n),setTimeout(()=>{n.style.opacity="0",setTimeout(()=>{n.remove()},500)},2500)}getCursor(){return this.cursor}};Dd=new WeakMap;function Ww(e,r,t){let o=e.components[2];o&&o.hover!==!0&&(o.hover=r?"user-interaction":!1,o.dirty=!0);let n=e.components[0].textMesh?.userData.entityId;if(!n)return;let i=t.geometry3DMap.get(n);i?.type==="text3d"&&(i.components[1].hoverByPolygon=r,i.components[1].dirty=!0)}function MG(e,r,t){return r?"grabbing":e?"pointer":t?"grabbing":"grab"}function wG(e){let r=e;for(;r?.parent;){if(r instanceof sa)return;if(r.userData.isSingleModel)return r;r=r.parent}}function OG(e,r){let t=wG(e);return t?r.get(t.userData.entityId):void 0}d();d();var tc,Ni,T1,Ha,zw,zm,M1,Zw,Xw,Zm,w1,Xm,Ym,O1,Wm=class{constructor(r){S(this,Ha);S(this,tc,null);S(this,Ni);u(this,"getCurrentSceneGLTF",async r=>{let t={onlyVisible:!0,binary:!0,light:!0,scale:1,...r},o=await W(this,Ha,zw).call(this),n=s(this,T1).call(this,t),i=await o.parseAsync(n,{trs:!1,maxTextureSize:1/0,onlyVisible:t.onlyVisible,binary:t.binary,scale:t.scale}),a;if(i instanceof ArrayBuffer)a=new Blob([i],{type:"application/octet-stream"});else{let l=JSON.stringify(i,null,2);a=new Blob([l],{type:"text/plain"})}return a});S(this,T1,r=>{let{scale:t,light:o,onlyVisible:n}=r,i=new sa,a=new Qt().setFromObject(s(this,Ni).entityScene);if(s(this,zm).call(this,s(this,Ni).entityScene,i,n),o){let l=new zh(16777215,.3*Math.PI);l.position.set(0,Math.max(a.max.x,a.max.y)*t*.5,a.max.y*t*4),l.lookAt(0,0,-1),l.target.position.set(0,0,-1),l.add(l.target),i.add(l)}return i});S(this,zm,(r,t,o)=>{r.material&&(r instanceof Hh?W(this,Ha,Zw).call(this,r).forEach(n=>t.add(n)):r instanceof gu&&t.add(W(this,Ha,Xw).call(this,r))),r.children.forEach(n=>{(!o||n.visible)&&s(this,zm).call(this,n,t,o)})});S(this,M1,(r,t,o)=>{let n=new I3({color:new qt(r),metalness:0});return n.opacity=t,n.transparent=o,n});S(this,Zm,r=>{let{geometry:t,material:o,position:n,rotation:i,quaternion:a,scale:l}=r;if(!t?.isBufferGeometry)return r;let c=t.attributes.position,p=t.attributes.normal,m=t.attributes.uv;return s(this,w1).call(this,c,p),s(this,Ym).call(this,n,l,i,a),m&&s(this,O1).call(this,m),o?.map&&t.type==="PlaneGeometry"&&(r.side=Qi),r});S(this,w1,(r,t)=>{let o=new ae,n=new ae;for(let i=0;i<r.count;i++)o.fromBufferAttribute(r,i),s(this,Xm).call(this,o),r.setXYZ(i,o.x,o.y,o.z),t&&(n.fromBufferAttribute(t,i),s(this,Xm).call(this,n),t.setXYZ(i,n.x,n.y,n.z))});S(this,Xm,r=>{let t=r.y;r.y=r.z,r.z=-t});S(this,Ym,(r,t,o,n)=>{let i=r.y;r.y=r.z,r.z=-i;let a=t.y;if(t.y=t.z,t.z=a,o instanceof Dc)o.order="YXZ",o.set(o.x,o.y,o.z,o.order);else{let l=n.y;n.set(n.x,n.z,-l,n.w)}});S(this,O1,r=>{for(let t=0;t<r.count;t++){let o=r.getX(t),n=r.getY(t);r.setXY(t,o,n)}});w(this,Ni,r),s(this,Ni).entityScene=r.entityScene,s(this,Ni).geometry3DMap=r.geometry3DMap}destroy(){w(this,tc,null)}};tc=new WeakMap,Ni=new WeakMap,T1=new WeakMap,Ha=new WeakSet,zw=async function(){if(!s(this,tc)){let{GLTFExporter:r}=await import("./GLTFExporter-RSA32FAS.js");w(this,tc,new r)}return s(this,tc)},zm=new WeakMap,M1=new WeakMap,Zw=function(r){let t=[],n=(r.userData?.entities?Object.values(r.userData?.entities):[]).map(a=>s(this,Ni).geometry3DMap.get(a)),i=new Map;return n.forEach(a=>{if(!a||!(a instanceof yt))return;let l=a.components[1],c=a.components[2];if(!l.visible||l instanceof fi&&l.opacity===0||l instanceof Cu||l instanceof ng)return;let m=`${c?.hover?l.hoverColor||s(this,Ni).hoverColor:l.color}-${l.opacity}-${Number(l.visible)}`;i.has(m)||i.set(m,[]),i.get(m)?.push(a)}),i.forEach((a,l)=>{let[c,p,m]=l.split("-"),f=a.reduce((C,v)=>{if(v.type==="custom-geometry")return C;let I=v.components[0];return"geometry"in I&&I.geometry instanceof Vh&&C.push(I.geometry),C},[]),g=s(this,M1).call(this,c,Number(p),r.material.transparent),b=mi(f,!0),x=new Oe(b,g);x.position.copy(r.position),x.rotation.copy(r.rotation),x.scale.copy(r.scale),x.visible=!!m,s(this,Ym).call(this,x.position,x.scale,x.rotation,x.quaternion),t.push(s(this,Zm).call(this,x))}),t},Xw=function(r){let t=r.geometry.clone(),o=r.material,n=new Mr({color:o.color,side:Qi});n.opacity=o.opacity,n.transparent=o.transparent;let i=new gu(t,n);return i.position.copy(r.position),i.rotation.copy(r.rotation),i.scale.copy(r.scale),i.visible=r.visible,s(this,Zm).call(this,i)},Zm=new WeakMap,w1=new WeakMap,Xm=new WeakMap,Ym=new WeakMap,O1=new WeakMap;d();d();var PG="gray",FG=.1,Jm=100,Yv=new ui.ClipperOffset;function EG(e,r){Yv.Clear(),r/=2;let t=e.map(n=>({X:n.x*Jm,Y:n.y*Jm}));Yv.AddPath(t,ui.JoinType.jtMiter,ui.EndType.etClosedPolygon);let o=new ui.Paths;return Yv.Execute(o,r*Jm),o.length?o.map(i=>i.map(a=>({x:a.X/Jm,y:a.Y/Jm}))):[e]}function P1(e,r,t){let{color:o=PG,opacity:n=1,altitude:i=0,height:a=FG}=t||{};Array.isArray(n)&&(n=1);let l={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:a+i},center:{x:0,y:0,z:(a+i)/2}},p=e.geometry.coordinates[0].map(b=>{let x=r(b[1],b[0]);return l.min.x=Math.min(l.min.x,x.x),l.min.y=Math.min(l.min.y,x.y),l.max.x=Math.max(l.max.x,x.x),l.max.y=Math.max(l.max.y,x.y),x});e.properties?.style?.edgeOffset!=null&&e.properties.style.edgeOffset!==0||e.properties?.image!=null?p=EG(p,e.properties?.style?.edgeOffset||0):p=[p];let m=[];for(let b of p){let x=new la;x.moveTo(b[0].x,b[0].y),b.slice(1).forEach(M=>x.lineTo(M.x,M.y)),x.lineTo(b[0].x,b[0].y);let C=e.geometry.coordinates.slice(1);x.holes=C.map(M=>{let O=M.map(P=>r(P[1],P[0])),T=new kc;return T.moveTo(O[0].x,O[0].y),O.slice(1).forEach(P=>T.lineTo(P.x,P.y)),T.lineTo(O[0].x,O[0].y),T});let v=Iu(t?.bevel,a),I=new ca(x,v);I.userData={style:{color:o,opacity:n},usedBevelSettings:v},m.push(I)}if(m.length===1)return m[0];let f=mi(m);m.forEach(b=>b.dispose());let g=Iu(t?.bevel,a);return f.userData={style:{color:o,opacity:n},usedBevelSettings:g,_split:!0},f}d();var DG="gray",kG=.1;function F1(e,r,t){let{color:o=DG,opacity:n=1,altitude:i=0,height:a=kG}=t||{};Array.isArray(n)&&(n=1);let l={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:a+i}},c=Iu(t?.bevel,a),p=[];e.geometry.coordinates.forEach(f=>{let g=new la,b=f[0].map(v=>{let I=r(v[1],v[0]);return l.min.x=Math.min(l.min.x,I.x),l.min.y=Math.min(l.min.y,I.y),l.max.x=Math.max(l.max.x,I.x),l.max.y=Math.max(l.max.y,I.y),I});g.moveTo(b[0].x,b[0].y),b.slice(1).forEach(v=>g.lineTo(v.x,v.y)),g.lineTo(b[0].x,b[0].y);let x=f.slice(1);g.holes=x.map(v=>{let I=v.map(O=>r(O[1],O[0])),M=new kc;return M.moveTo(I[0].x,I[0].y),I.slice(1).forEach(O=>M.lineTo(O.x,O.y)),M.lineTo(I[0].x,I[0].y),M});let C=new ca(g,c);p.push(C)});let m=mi(p);return p.forEach(f=>f.dispose()),m.translate(0,0,i||0),m.userData={style:{color:o,opacity:n},usedBevelSettings:c},m}d();var no=100,LG=.22,AG=.01;function Yw(e,r,t={}){let{width:o=LG,height:n=AG,color:i="gray",opacity:a=1,altitude:l=0}=t,c={min:{x:1/0,y:1/0,z:l},max:{x:-1/0,y:-1/0,z:l+n}},p={bevelEnabled:!1,depth:n},m=new ui.ClipperOffset,f=e.geometry.coordinates.map(C=>C.map(v=>r(v[1],v[0])));m.AddPaths(f.map(C=>C.map(v=>({X:v.x*no,Y:v.y*no}))),ui.JoinType.jsMiter,ui.EndType.etOpenRound);let g=new ui.PolyTree;m.Execute(g,o/2*no);let b=[];for(let C of g.m_AllPolys){let v=new la;if(C.IsHole())continue;c.min.x=Math.min(c.min.x,C.m_polygon[0].X),c.min.y=Math.min(c.min.y,C.m_polygon[0].Y),c.max.x=Math.max(c.max.x,C.m_polygon[0].X),c.max.y=Math.max(c.max.y,C.m_polygon[0].Y);let I=C.m_polygon;v.moveTo(I[0].X/no,I[0].Y/no),I.slice(1).forEach(M=>v.lineTo(M.X/no,M.Y/no)),v.lineTo(I[0].X/no,I[0].Y/no),v.holes=C.m_Childs.map(M=>{let O=new kc,T=M.m_polygon;return O.moveTo(T[0].X/no,T[0].Y/no),T.slice(1).forEach(P=>O.lineTo(P.X/no,P.Y/no)),O.lineTo(T[0].X/no,T[0].Y/no),O}),b.push(new ca(v,p))}let x=mi(b);return x.translate(0,0,l||0),x.userData={style:{color:i,opacity:a}},m.Clear(),x}d();d();var kd=D.object({type:D.enum(["Point"]),coordinates:D.array(D.number()).min(2).max(3)});var Jv=D.object({rotation:D.array(D.number()).length(3).optional(),altitude:D.number().optional(),scale:D.array(D.number()).length(3).optional(),interactive:D.boolean().optional(),verticalOffset:D.number().optional(),id:D.union([D.number(),D.string()]).optional()}),RG=D.object({type:D.enum(["Feature"]),geometry:kd,properties:Jv}),_G=D.object({type:D.enum(["FeatureCollection"]),features:D.array(RG)}),Kv=D.object({color:D.string()}),BG=D.object({url:D.string(),color:D.string().optional(),opacity:D.number().optional(),material:D.record(D.string(),Kv).optional()});function Kw(e,r,t){D.union([D.number(),D.string()]).parse(e),_G.parse(r),BG.parse(t)}var Km,Qm,$a=class{constructor(r){u(this,"mesh");u(this,"type","model");u(this,"positionDirty",!0);u(this,"outline");u(this,"geometry");u(this,"material");u(this,"feature");u(this,"instanceIndex",-1);u(this,"visible",!0);u(this,"color",new qt);u(this,"position",new ae);S(this,Km,0);S(this,Qm,1);this.feature=r}setOpacity(){}setColor(){}get altitude(){return s(this,Km)}set altitude(r){this.mesh&&(this.mesh.position.z=r,w(this,Km,r))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(r){this.mesh&&this.mesh.rotation.set(Le.degToRad(r[0]),Le.degToRad(r[1]),Le.degToRad(r[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(r){this.mesh&&this.mesh.scale.set(r[0],r[1],r[2])}get opacity(){return s(this,Qm)}set opacity(r){if(this.mesh){if(this.mesh.children[0]instanceof aa){for(let t of this.mesh.children)if(t instanceof aa){t.userData?.originalOpacity===void 0&&(t.userData.originalOpacity=t.material.opacity);let o=cl(r,0,t.userData?.originalOpacity,0,1);t.material.opacity=o,t.material.transparent=o<1,t.material.needsUpdate=!0}}else this.mesh?.traverse(t=>{t instanceof Oe&&t.material&&(Array.isArray(t.material)?t.material.forEach(o=>{Jw(o,r)}):Jw(t.material,r))});w(this,Qm,r)}}};Km=new WeakMap,Qm=new WeakMap;function Jw(e,r){e.opacity!==r&&(r===1?(e.opacity=1,e.transparent=!1):(e.opacity=r,e.transparent=!0),e.needsUpdate=!0)}d();function E1(e){let r=e.components[0],t=e.components[1];t.opacity!=null&&t.opacity!==r.opacity&&(r.opacity=t.opacity);let o=t.material,n=t.color;if(o||n){let l=NG(n,o);r.mesh?.traverse(c=>{c instanceof Oe&&c.material&&(Array.isArray(c.material)?c.material.forEach(p=>{l[p.name]?p.color.set(l[p.name].color):p.color.set(n)}):l[c.material.name]?c.material.color.set(l[c.material.name].color):c.material.color.set(n))})}let i=r.feature.geometry.coordinates[2]??0,a=t.verticalOffset+i;r.altitude!==a&&(r.altitude=a),t.visible!==r.visible&&(r.visible=t.visible),t.rotation&&r.setRotation(t.rotation),t.scale&&r.setScale(t.scale)}function NG(e,r){let t={};if(e&&Object.assign(t,{Default:{color:e},Fabric:{color:e},Mpdn_Logo:{color:e},CouchLogo:{color:e}}),r)for(let o in r)r[o].color&&(t[o]?t[o].color=r[o].color:t[o]={color:r[o].color});return t}function Qw(e,r){let t=e.components[0],n=e.components[1].verticalOffset??0,i=t.feature.geometry.coordinates.slice();i[2]=(i[2]??0)+n,t.mesh?t.mesh.position.copy(r(i)):t.position.copy(r(i))}function qw(e){return e instanceof or?e.material:null}function e9(e){return e.side===Kb?"back":e.side===fu?"front":"double"}function t9(e,r){e.side=r==="back"?Kb:r==="front"?fu:Qi}function jG(e){let{color:r,opacity:t,topColor:o,texture:n,topTexture:i}=e;return`${r}${t}${o||""}${n||""}${i||""}`}var D1=class extends Ie{constructor(t,o){super();u(this,"state");u(this,"convertTo3DMapPosition");u(this,"loader");u(this,"optimizePromise",[]);this.state=t,this.convertTo3DMapPosition=o}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:t}=await import("./GLTFLoader-FLMCN6TW.js");return this.loader=new t,this.loader}createEntityFromFeature(t,o,n){let i=new or(o),a=o?.properties?.bevel,l=n&&"bevel"in n?n.bevel:void 0,c;l?c={...a,...l}:a&&(c=a);let p=new yt(i,new fi({...n,url:o.properties?.image?.path,bevel:c}));return n?.outline&&(p.components[3]=new uS(hS(n.color))),n?.focusable&&(p.components[4]=new Tu),p.id=t,p}createModelFromFeature(t,o,n){let i=new $a(o),a={...n};o.properties.verticalOffset!=null&&(a.verticalOffset=o.properties.verticalOffset),o.properties.rotation!=null&&(a.rotation=o.properties.rotation),o.properties.scale!=null&&(a.scale=o.properties.scale);let l=new ng(a),c=new yt(i,l);return c.id=t,c}populateEntityMesh(t,o){let n=t.components[0];n.geometry=o,n.batchedProps={range:{start:0,count:1/0,indexCount:1/0,indexStart:0,vertexCount:1/0,vertexStart:0,reservedVertexCount:1/0,reservedIndexCount:1/0},geometryId:-1,positionCount:o.attributes.position.count},n.currentHeight=t.components[1].height,n.dirty=!1}async populateModelGroup(t,o,n){let i=new qi,a=new Dc,l=new Uh,c=new ae,p=new pa,m=await this.getGLTFLoader(),f=new Promise(g=>{m.load(o,b=>{"entities3D"in n.userData&&(n.userData.entities3D.size>1?b.scene.traverse(x=>{let C=x;if("isMesh"in C&&C.isMesh===!0){let v=new aa(C.geometry,C.material,t.size);v.userData={entities:{}},p.add(v),n.add(p)}}):(b.scene.traverse(x=>{"isMesh"in x&&x.isMesh===!0&&(x.position.set(0,0,0),x.rotation.set(0,0,0),x.scale.set(1,1,1),x.updateMatrix())}),p.add(b.scene),n.add(p),p.userData.isSingleModel=!0,p.userData.entityId=t.values().next().value,p.userData.type="model")),g()})});return this.optimizePromise.push(f.then(()=>{let g=0,b;for(let x of t.values()){if(b=this.state.geometry3DMap.get(x),!b||b?.type!=="model")continue;let C=b.components[0],v=b.components[1],I=b.components[0].feature;C.mesh=p,C.instanceIndex=g,E1(b),b.components[1].dirty=!1;let{x:M,y:O}=this.convertTo3DMapPosition(I.geometry.coordinates[1],I.geometry.coordinates[0],0);C.position.set(M,O,C.altitude),a.set(Le.degToRad(v.rotation?.[0]??Vc[0]),Le.degToRad(v.rotation?.[1]??Vc[1]),Le.degToRad(v.rotation?.[2]??Vc[2])),c.set(v.scale?.[0]??Uc[0],v.scale?.[1]??Uc[1],v.scale?.[2]??Uc[2]),l.setFromEuler(a),i.compose(C.position,l,c),p.children.forEach(T=>{!b||b?.type!=="model"||!(T instanceof aa)||(T.setMatrixAt(g,i),T.userData.entities[g]=b.id)}),C.mesh.userData.isSingleModel&&(C.mesh.matrix.copy(i),C.mesh.matrix.decompose(C.mesh.position,C.mesh.quaternion,C.mesh.scale)),g++}this.publish("model-loaded")})),p}populateEntityGroup(t){let o,n,i,a;for(let l of t.values())a=this.state.geometry3DMap.get(l),a.components[0]instanceof or&&(n=a.components[0].feature,i=a.components[1],n.geometry.type==="Polygon"?(o=P1(n,this.convertTo3DMapPosition,i),n.properties?.textures&&n.properties.textures.length>0&&gS(o,n.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(a,o)):n.geometry.type==="MultiPolygon"?(o=F1(n,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,o)):n.geometry.type==="LineString"?(o=_S(n,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,o)):n.geometry.type==="MultiLineString"&&(o=Yw(n,this.convertTo3DMapPosition,i),this.populateEntityMesh(a,o)));return t}update(){for(let t of this.state.geometryGroupIdsToLoad.values()){let o=this.state.geometry3DMap.get(t);if(o instanceof Cn&&o.userData.dirty){if(o.userData.modelURL)o.userData.modelURL&&(this.populateModelGroup(o.userData.entities3D,o.userData.modelURL,o),o.userData.dirty=!1);else try{this.populateEntityGroup(o.userData.entities3D)}catch(a){L.warn(a)}let n,i={};for(let a of o.userData.entities3D.values()){n=this.state.geometry3DMap.get(a);let l=n?.components[0];if(n?.type==="geometry"){let c=n.components[1],p=jG(c);i[p]===void 0&&(i[p]={style:c,entities:[]}),i[p].entities.push(n)}else l&&"mesh"in l&&l.mesh&&l.mesh?.parent!==o&&o.add(l.mesh)}for(let a in i){let l=fS(i[a].entities,i[a].style);o.add(l)}for(let a of o.userData.entities3D.values())if(n=this.state.geometry3DMap.get(a),n!=null&&n.entities2D.size>0)for(let l of n.entities2D.values())l&&(n.attach(l),this.publish("geometry-2d-added"));this.publish("geometry-group-added"),o.userData.dirty=!1}}return Promise.resolve()}};d();var k1=class{constructor(r,t){u(this,"state");u(this,"dirty",!0);u(this,"domTree");this.state=r,this.domTree=t}update(){if(this.dirty){let r;for(let t of Array.from(this.domTree.children))if(r=this.state.geometry2DMap.get(t.userData.entityId),r){let o=r.components[0];(!o.enabled||!o.visible||!this.state.geometry2DIdsInScene.has(t.userData.entityId))&&this.domTree.removeChild(t)}else this.domTree.removeChild(t);for(let t of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(t),r){let o=r.components[0];o instanceof is&&o.enabled&&o.markerContainer&&!this.domTree.contains(o.markerContainer)&&(o.markerContainer.userData={entityId:r.id},this.domTree.appendChild(o.markerContainer),o.updateDimensions())}this.dirty=!1}}};d();var L1=class{constructor(r,t){u(this,"state");u(this,"project");this.state=r,this.project=t}update(){let r,t=0,o,n;for(let i of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(i),r){n=r.components[0];let a=r.attachedTo?this.state.geometry3DMap.get(r.attachedTo):void 0;if(a instanceof yt)if(this.state.geometry3DIdsInScene.has(a.id)){o=a.components[1],n=r.components[0],(o.dirty||r.components[0].attachedDirty)&&(t=o.height,r.setAltitude(t));let l=o.visible;n.visible!==l&&(n.visible=l)}else n.visible===!0&&(n.visible=!1);this.project(r.components[0].projection,r.position),r.components[0].attachedDirty=!1}}};d();d();var GG=function(){let r,t;return o=>{if((!t||!t)&&(r=document.createElement("canvas"),r.width=500*o,r.height=500*o,r.style.width="500px",r.style.height="500px",t=r.getContext("2d")),!t)throw new Error("Could not get 2D context");return{measureCanvas:r,measureCanvasContext:t}}}(),r9=({text:e,size:r,maxWidth:t,pixelRatio:o,maxLines:n=2,lineHeight:i=1.2,options:a={strokeText:!0}})=>{let l=`bold ${r*o}px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif`,{measureCanvasContext:c}=GG(o);c.font=l;let p=[],m=e.split(" "),f=0,g=0,b=0;for(;g<m.length;){let I=m[g];if(f===n&&f>0){p[f-1]+="...";break}if(p[f]==null&&(p[f]=I,g++),m.length===1){p[f]=I;break}if(m[g]==null)break;let{width:M}=c.measureText(p[f]+" "+m[g]);M<=t*o?(p[f]+=" "+m[g],g++):f++}p.forEach(I=>{let{width:M}=c.measureText(I);b=Math.max(M,b)});let x=r*o*i,C=p.length*x;return{maxWidth:b,maxHeight:C,lines:p.length,draw:(I,M,O)=>{p.length===1?(a.strokeText&&I.strokeText(p[0],M,O),I.fillText(p[0],M,O)):(a.strokeText&&(I.strokeText(p[0],M,O-x/2),I.strokeText(p[1],M,O+x/2)),I.fillText(p[0],M,O-x/2),I.fillText(p[1],M,O+x/2))}}};d();function o9(e){let r=new Image;return e&&(/<svg[\s\S]*>/i.test(e)?r.src=`data:image/svg+xml;base64,${btoa(e)}`:r.src=e),r}var A1=class extends Ie{constructor(t,o,n){super();u(this,"dirty",!1);u(this,"state");u(this,"colliderContext");u(this,"colliderCanvas");u(this,"transformRequestFunc");u(this,"transformRequest",async t=>this.transformRequestFunc?await this.transformRequestFunc(t):{url:t});u(this,"pinCache",{});u(this,"imageCache",{});u(this,"imagePromiseCache",{});u(this,"imageDimensionsCache",{});u(this,"textCache",{});u(this,"update",t=>{let o=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let n,i,a,l,c,p,m;for(let f of this.state.geometry2DIdsInScene)if(m=this.state.geometry2DMap.get(f),m!=null&&(p=m.components[0],p instanceof ns&&!m.disposed)){if(c=p.appearance.iconVisibleAtZoomLevel,p.appearance.icon!=null&&c&&t>=c!==p.iconVisible&&(p.iconVisible=t>=c,p.dirty=!0),(p.dirty||this.dirty)&&p.calculateMarkerSize(),i={active:p.appearance.pinColor,inactive:p.appearance.pinColorInactive},a={active:p.appearance.pinOutlineColor,inactive:p.appearance.pinOutlineColorInactive},l=ci(p.markerSize,2),n=`${i.active}-${i.inactive}-${a.active}-${a.inactive}-${l}-${p.iconVisible}`,p.labelCacheId=n,(!this.pinCache[n]||this.dirty)&&(this.prepare(p,n,this.colliderContext),p.dirty=!0),(p.appearance.icon&&(!p.imageHash||p.markerDirty)||this.dirty)&&this.cacheImage(p),this.textCache[p.id]==null||p.textDirty||this.dirty){p.dirty=!0,this.textCache[p.id]={};let{textDrawFn:b,width:x,height:C}=this.processText(p.text,p.appearance.textSize,p.appearance.maxWidth,p.appearance.maxLines,p.appearance.lineHeight);["left","center","right"].forEach(v=>{this.textCache[p.id][v]=this.textToCanvas(b,p.appearance.textSize,v,x,C,p.appearance.textColor,p.appearance.textOutlineColor)}),p.dimensions={width:Math.ceil(x/o),height:Math.ceil(C/o)}}let g=1;if(p.appearance.iconScale)if(typeof p.appearance.iconScale=="number")g=p.appearance.iconScale;else{let{on:b,input:x,output:C,easing:v}=p.appearance.iconScale;b==="zoom-level"?g=L3(t,x,C,v??"linear"):L.warn(`Unsupported interpolation property: ${b}`)}p.recomputeCurrentStrategy(p.iconVisible?g:1),p.canShow&&p.visible&&(p.enabled||p.visibilityNeedsUpdate!==!1)&&this.draw(p,n,this.colliderContext),p.textDirty=!1,p.markerDirty=!1}this.dirty=!1});u(this,"processText",(t,o,n,i,a)=>{let l=this.state.pixelRatio,{draw:c,maxWidth:p,maxHeight:m}=r9({text:t,size:o,pixelRatio:l,maxWidth:n,maxLines:i,lineHeight:a});return{textDrawFn:c,width:p+2.5*l*2,height:m+2.5*l*2}});u(this,"textToCanvas",(t,o,n,i,a,l,c)=>{let p=this.state.pixelRatio,m,f=i,g=a;window.OffscreenCanvas!=null&&!J3()?m=new OffscreenCanvas(f,g):(m=document.createElement("canvas"),m.width=f,m.height=g,m.style.width=f+"px",m.style.height=g+"px");let b=m.getContext("2d",{willReadFrequently:!0});if(!b)return;let x=2.5*p;b.textAlign=n,b.font=`bold ${o*p}px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif`,b.textBaseline="middle",b.lineJoin="miter",b.miterLimit=2,b.strokeStyle="white",b.lineWidth=x,b.fillStyle=l,b.strokeStyle=c;let C=n==="left"?x/2:n==="center"?f/2:f-x/2;return t(b,C,(g+x/2)/2),m});u(this,"cacheImage",t=>{if(!t.appearance.icon)return;let o=rS(t.appearance.icon);this.imagePromiseCache[o]||(this.imagePromiseCache[o]=new Promise(n=>{this.transformRequest(t.appearance.icon).then(i=>{let a=o9(i.url);a.onload=()=>{this.imageCache[o]=a,this.publish("img:loaded"),n(a)}})})),t.imageHash!==o&&(t.imageHash=o,this.imagePromiseCache[o].then(()=>{t.dirty=!0}))});u(this,"createPinCanvas",(t,o,n,i,a=1)=>{let l,c=this.state.pixelRatio,p=t.totalMarkerSize*2*c*a;window.OffscreenCanvas!=null?l=new OffscreenCanvas(p,p):(l=document.createElement("canvas"),l.width=p,l.height=p,l.style.width=p/c+"px",l.style.height=p/c+"px");let m=l.getContext("2d");return m.shadowColor="rgba(0,0,0,0.3)",m.shadowOffsetY=2*c,m.shadowBlur=5*c,m.beginPath(),m.arc(p/2,p/2,(o/2+2.5*c/2)*a,0,2*Math.PI),m.fillStyle=n,m.fill(),m.beginPath(),m.arc(p/2,p/2,o/2*a,0,2*Math.PI),m.shadowColor="transparent",m.fillStyle=i,m.fill(),l});u(this,"prepare",(t,o,n)=>{let i=this.state.pixelRatio;n.lineWidth=4*i;let a=typeof t.appearance.iconScale=="number"?[t.appearance.iconScale]:t.appearance.iconScale==null?[]:t.appearance.iconScale.output,l=a.length>0?Math.max(...a):void 0,c=this.createPinCanvas(t,t.markerSize,t.appearance.pinOutlineColor,t.appearance.pinColor,l),p=this.createPinCanvas(t,t.iconVisible?t.markerSize:3.5*i,t.appearance.pinOutlineColorInactive,t.appearance.pinColorInactive,l);this.pinCache[o]=[c,p]});this.state=t,this.colliderCanvas=o,this.colliderContext=o.getContext("2d"),this.transformRequestFunc=n}draw(t,o,n){if(!t.canShow||!t.visible)return;n.save(),n.globalAlpha=t.opacity;let i=this.state.pixelRatio,a=t.projection.x*i,l=t.projection.y*i,c=t.style.pinVisibility===1?this.pinCache[o][0]:this.pinCache[o][1];if(n.drawImage(c,a-t.scaledMarkerSize*i,l-t.scaledMarkerSize*i,t.scaledMarkerSize*2*i,t.scaledMarkerSize*2*i),t.appearance.icon&&t.iconVisible&&t.imageHash&&t.appearance.iconSize&&this.imageCache[t.imageHash]){let p=this.imageCache[t.imageHash],m=(t.scaledMarkerSize-t.scaledIconPadding)*i,f=t.appearance.iconFit,g=m,b=m,x=`${t.imageHash}_${f}`;if(this.imageDimensionsCache[x])g=this.imageDimensionsCache[x].width,b=this.imageDimensionsCache[x].height;else{let C=p.width*i,v=p.height*i;if(f==="contain"){let I=Math.sqrt(C**2+v**2),M=m/I;g=C*M,b=v*M}if(f==="cover"){let I=m/C,M=m/v,O=Math.max(I,M);g=C*O,b=v*O}}n.save(),n.beginPath(),n.arc(a,l,m/2,0,2*Math.PI),n.closePath(),t?.appearance?.iconOverflow!=="visible"&&n.clip(),n.drawImage(p,a-g/2,l-b/2,g,b),n.restore()}t.style.textLabelVisible&&t.style.textAlign!=null&&t.style.left!=null&&t.style.top!=null&&n.drawImage(this.textCache[t.id][t.style.textAlign],a+t.style.left*i,l+t.style.top*i),n.restore()}};d();d();var rc=class rc{constructor(){u(this,"loader");this.loader=new Lc}static getInstance(){return rc.instance||(rc.instance=new rc),rc.instance}getLoader(){return this.loader}load(r){return new Promise((t,o)=>{this.loader.load(r,t,void 0,o)})}};u(rc,"instance");var qv=rc,Wa=qv.getInstance();function WG(e,r){let t=e.components[2],o=e.components[1];return t?.hover?[o.hoverColor||r,o.hoverColor||r]:[o.color,o.topColor||o.color]}var oc,qm,R1=class extends Ie{constructor(t,o){super();S(this,oc);u(this,"state");u(this,"convertTo3DMapPosition");u(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=o,this.state=t}processTextures(t,o,n){if(o.texture!==t.texture&&o.texture!==""&&W(this,oc,qm).call(this,o.texture,t,"texture"),o.topTexture!==t.topTexture&&o.topTexture!==""&&W(this,oc,qm).call(this,o.topTexture,t,"topTexture"),(t.texture==null||t.topTexture==null)&&Array.isArray(t.feature.properties?.textures)&&t.feature.properties.textures.length>0)for(let i of t.feature.properties.textures)i.face==="top"&&t.topTexture!==i.path?W(this,oc,qm).call(this,i.path,t,"topTexture"):i.face==="side"&&t.texture!==i.path&&W(this,oc,qm).call(this,i.path,t,"texture"),t.blendTexture=!0;(t.texture!=null||t.topTexture!=null)&&(n?.hover&&t.texturesVisible?t.hideTextures():t.texturesVisible||t.showTextures(),o.texture===""&&t.removeSideTexture(),o.topTexture===""&&t.removeTopTexture())}update(){let t,o,n;for(let i of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(i),n&&(n.type==="geometry"||n.type==="custom-geometry")&&(n.components[1]?.dirty||n.components[2]?.dirty)){let a=n.components[0],l=n.components[1];o=n.components[2];let c=WG(n,this.state.hoverColor);a.setColor(c[0],c[1]);let p=qw(a);if(l.visible!==a.visible&&(a.visible=l.visible,a instanceof or&&a.textMesh)){let f=this.state.geometry3DMap.get(a.textMesh.userData.entityId);f?.type==="text3d"&&f.components[0].polygonEntityId!=null&&(f.components[0].visible=l.visible)}l.altitude!==a.altitude&&(a.altitude=l.altitude);let m=l.opacity*jc(n);m!==a.opacity&&(a.opacity=m),l.renderOrder!==a.renderOrder&&(a.renderOrder=l.renderOrder),p&&l.side!==e9(p)&&t9(p,l.side),a instanceof or&&l.shading!=null&&(l.shading?.start!==p?.getGradientShading().start||l.shading?.end!==p?.getGradientShading().end||l.shading?.intensity!==p?.getGradientShading().intensity)&&p?.setGradientShading(l.shading?.start??0,l.shading?.end??0,l.shading?.intensity??0),l.dirty=!1,a instanceof or&&this.processTextures(a,l,o),n.components[2]&&(n.components[2].dirty=!1)}else if(n?.type==="model")n.components[1].dirty&&(E1(n),n.components[1].dirty=!1),n.components[0].positionDirty&&(Qw(n,this.convertTo3DMapPosition),n.components[0].positionDirty=!1);else if(n?.type==="image"&&n.components[1]?.dirty){t=n.components[0];let a=n.components[1];a.visible!==t.visible&&(t.visible=a.visible),a.dirty=!1}else if(n?.type==="text3d"&&n.components[1]?.dirty&&n.components[0].polygonEntityId!=null){t=n.components[0];let a=n.components[1];a.visible!=null&&a.visible!==t.visible&&(t.visible=a.visible);let{textMesh:l}=t;if(l){Object.assign(l,a.getState());let c=a.hoverColor??this.state.text3dHoverColor;l.color=a.hoverByPolygon?c:a.color??Gc.color,l.outlineColor=a.hoverByPolygon?c:a.outlineColor??Gc.outlineColor,l.strokeColor=a.hoverByPolygon?c:a.strokeColor??Gc.strokeColor}a.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async t=>{(await t).dispose()}),this.textureLoadingCache.clear()}};oc=new WeakSet,qm=async function(t,o,n){if(!(!t||!o.showTextures))if(this.textureLoadingCache.has(t)){n==="topTexture"?o.topTexture=await this.textureLoadingCache.get(t):o.texture=await this.textureLoadingCache.get(t),o.showTextures();return}else{let i=new Promise((a,l)=>{Wa.getLoader().load(t,c=>{n==="topTexture"?o.topTexture=c:o.texture=c,o.showTextures(),this.publish("texture-loaded"),a(c)},void 0,()=>{L.error(`Failed to load texture: ${t}`),l(`Failed to load texture: ${t}`)})});this.textureLoadingCache.set(t,i)}};d();var _1=class extends Ie{constructor(t){super();u(this,"state");u(this,"animating",new Map);u(this,"isAnimating",!1);u(this,"startTime",-1);u(this,"showDuration",300);u(this,"hideDuration",250);u(this,"update",()=>{this.animating.clear();let t,o;for(let n of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(n),t&&(o=t.components[0],o instanceof ns&&(o.visibilityNeedsUpdate==="show"?(o.canShow=!0,this.animating.set(o,[o.opacity,1])):o.visibilityNeedsUpdate==="hide"&&this.animating.set(o,[o.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")});u(this,"playAnimations");this.state=t,this.playAnimations=this._playAnimations}_playAnimations(){let t=performance.now();for(let[o,[n,i]]of this.animating.entries()){let a=i===1?this.showDuration:this.hideDuration,l=(t-this.startTime)/a;o.opacity=cl(l,0,1,n,i,i===0?E3:D3),t-this.startTime>=a&&(i===1?o.canShow=!0:i===0&&(o.canShow=!1),o.visibilityNeedsUpdate=!1,this.animating.delete(o))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};d();var B1=class extends Ie{constructor(t,o,n,i,a,l,c){super();u(this,"state");u(this,"renderer");u(this,"mode");u(this,"scene");u(this,"cameraObject");u(this,"viewCamera");u(this,"systems");u(this,"needs2DRecompute",!1);u(this,"twoDdirty",!0);u(this,"threeDdirty",!0);u(this,"frameId",null);u(this,"twoDFrameId",null);u(this,"animationFrameId",null);u(this,"nextFrame",null);u(this,"update",(t=!1)=>{if(this.renderer?.renderer==null)return Promise.resolve();if(t){let o=this.commitRenderState();return this.paint(),o}else return this.frameId?Promise.resolve():new Promise((o,n)=>{this.frameId=requestAnimationFrame(()=>this.renderer?.renderer==null?o():this.mode==="standalone"?this.commitRenderState()?.then(()=>{this.paint(),o()}).catch(i=>{n(i)}):o())})});u(this,"animate2D",()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})});u(this,"drawEntities2D",()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))});u(this,"updateEntities2D",()=>{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())})});u(this,"commitRenderState",()=>{try{let t=[];this.frameId=null,this.publish("pre-render"),this.state.internalTweenGroup.update(),this.state.externalTweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),q3(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),this.state.geometryGroupIdsToLoad.clear(),Q3(this.state.entityScene,this.state.geometry3DIdsInScene,this.state.geometryGroupIdsToLoad),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let o=this.systems.meshOptimizationSystem.update();o&&t.push(o),this.systems.borderSystem.update(),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),t.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isCameraMoving(),this.systems.cameraSystem.lastCameraStoppedMovingTime()),this.systems.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 n=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!n)}),this.systems.drawSystem.update(),this.systems.geometryDisposalSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.systems.cameraSystem.stateDirty&&(this.publish("camera-state-change"),this.systems.cameraSystem.stateDirty=!1),this.publish("post-render"),Promise.all(t)}catch(t){return Promise.reject(t)}});this.renderer=t,this.state=o,this.mode=n,this.scene=i,this.cameraObject=a,this.viewCamera=l,this.systems=c,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(){this.renderer?.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)}};d();var zG=D.object({interactive:D.boolean().optional(),id:D.string().optional(),width:D.union([D.number(),D.object({on:D.literal("zoom-level").optional(),input:D.array(D.number()).nonempty(),output:D.array(D.number()).nonempty(),easing:D.string().optional()})]).optional(),accentColor:D.string().optional(),displayArrowsOnPath:D.boolean().optional(),animateArrowsOnPath:D.boolean().optional(),visibleThroughGeometry:D.boolean().optional(),dashed:D.boolean().optional()}),ZG=D.object({type:D.enum(["Feature"]),geometry:kd,properties:D.object({parentId:D.any().optional()})});function n9(e,r){D.object({features:D.array(ZG)}).parse(e),zG.parse(r)}var ef,za=class{constructor(r,t){u(this,"type","path");u(this,"mesh",new pa);u(this,"material");u(this,"geometry");u(this,"outline");u(this,"feature");u(this,"options");u(this,"width",{on:"zoom-level",input:[17,22],output:[.8,.4]});u(this,"breakpoint",0);u(this,"altitudeBreakpoints");u(this,"accentColor","blue");u(this,"completeFraction",1);u(this,"altitudeAdjustment",1);u(this,"displayArrowsOnPath",!1);u(this,"animateArrowsOnPath",!1);u(this,"visibleThroughGeometry",!1);u(this,"dashed",!1);u(this,"isVertical",!1);u(this,"dirty",!0);u(this,"materialDirty",!0);u(this,"position",new ae);S(this,ef,0);this.feature=r,this.options=t||{},this.width=t?.width??this.width,this.accentColor=t?.accentColor??this.accentColor,this.displayArrowsOnPath=t?.displayArrowsOnPath??this.displayArrowsOnPath,this.animateArrowsOnPath=t?.animateArrowsOnPath??this.animateArrowsOnPath,this.visibleThroughGeometry=t?.visibleThroughGeometry??this.visibleThroughGeometry,this.dashed=t?.dashed??this.dashed}setColor(){}setOpacity(){}set visible(r){this.mesh&&(this.mesh.visible=r)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return s(this,ef)}set altitude(r){this.mesh&&(this.mesh.position.z=r,w(this,ef,r))}set complete(r){this.material&&(this.material.uniforms.complete.value=r,this.material.needsUpdate=!0)}};ef=new WeakMap;d();d();d();var Co=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut: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)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut: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)}}),Back:Object.freeze({In:function(e){var r=1.70158;return e===1?1:e*e*((r+1)*e-r)},Out:function(e){var r=1.70158;return e===0?0:--e*e*((r+1)*e+r)+1},InOut:function(e){var r=2.5949095;return(e*=2)<1?.5*(e*e*((r+1)*e-r)):.5*((e-=2)*e*((r+1)*e+r)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Co.Bounce.Out(1-e)},Out: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},InOut:function(e){return e<.5?Co.Bounce.In(e*2)*.5:Co.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(r){return Math.pow(r,e)},Out:function(r){return 1-Math.pow(1-r,e)},InOut:function(r){return r<.5?Math.pow(r*2,e)/2:(1-Math.pow(2-r*2,e))/2+.5}}}}),tf=function(){return performance.now()},N1=function(){function e(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,r)}return e.prototype.getAll=function(){var r=this;return Object.keys(this._tweens).map(function(t){return r._tweens[t]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var r,t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];for(var n=0,i=t;n<i.length;n++){var a=i[n];(r=a._group)===null||r===void 0||r.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},e.prototype.remove=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var o=0,n=r;o<n.length;o++){var i=n[o];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(r){return!r.isPlaying()})},e.prototype.update=function(r,t){r===void 0&&(r=tf()),t===void 0&&(t=!0);var o=Object.keys(this._tweens);if(o.length!==0)for(;o.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<o.length;n++){var i=this._tweens[o[n]],a=!t;i&&i.update(r,a)===!1&&!t&&this.remove(i)}o=Object.keys(this._tweensAddedDuringUpdate)}},e}(),Ld={Linear:function(e,r){var t=e.length-1,o=t*r,n=Math.floor(o),i=Ld.Utils.Linear;return r<0?i(e[0],e[1],o):r>1?i(e[t],e[t-1],t-o):i(e[n],e[n+1>t?t:n+1],o-n)},Bezier:function(e,r){for(var t=0,o=e.length-1,n=Math.pow,i=Ld.Utils.Bernstein,a=0;a<=o;a++)t+=n(1-r,o-a)*n(r,a)*e[a]*i(o,a);return t},CatmullRom:function(e,r){var t=e.length-1,o=t*r,n=Math.floor(o),i=Ld.Utils.CatmullRom;return e[0]===e[t]?(r<0&&(n=Math.floor(o=t*(1+r))),i(e[(n-1+t)%t],e[n],e[(n+1)%t],e[(n+2)%t],o-n)):r<0?e[0]-(i(e[0],e[0],e[1],e[1],-o)-e[0]):r>1?e[t]-(i(e[t],e[t],e[t-1],e[t-1],o-t)-e[t]):i(e[n?n-1:0],e[n],e[t<n+1?t:n+1],e[t<n+2?t:n+2],o-n)},Utils:{Linear:function(e,r,t){return(r-e)*t+e},Bernstein:function(e,r){var t=Ld.Utils.Factorial;return t(e)/t(r)/t(e-r)},Factorial:function(){var e=[1];return function(r){var t=1;if(e[r])return e[r];for(var o=r;o>1;o--)t*=o;return e[r]=t,t}}(),CatmullRom:function(e,r,t,o,n){var i=(t-e)*.5,a=(o-r)*.5,l=n*n,c=n*l;return(2*r-2*t+i+a)*c+(-3*r+3*t-2*i-a)*l+i*n+r}}},i9=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),eI=new N1,Wn=function(){function e(r,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Co.Linear.None,this._interpolationFunction=Ld.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=i9.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=r,typeof t=="object"?(this._group=t,t.add(this)):t===!0&&(this._group=eI,eI.add(this))}return 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(r,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=r,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(r){return r===void 0&&(r=1e3),this._duration=r<0?0:r,this},e.prototype.dynamic=function(r){return r===void 0&&(r=!1),this._isDynamic=r,this},e.prototype.start=function(r,t){if(r===void 0&&(r=tf()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var o in this._valuesStartRepeat)this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=r,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var i in this._valuesEnd)n[i]=this._valuesEnd[i];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(r){return this.start(r,!0)},e.prototype._setupProperties=function(r,t,o,n,i){for(var a in o){var l=r[a],c=Array.isArray(l),p=c?"array":typeof l,m=!c&&Array.isArray(o[a]);if(!(p==="undefined"||p==="function")){if(m){var f=o[a];if(f.length===0)continue;for(var g=[l],b=0,x=f.length;b<x;b+=1){var C=this._handleRelativeValue(l,f[b]);if(isNaN(C)){m=!1,console.warn("Found invalid interpolation list. Skipping.");break}g.push(C)}m&&(o[a]=g)}if((p==="object"||c)&&l&&!m){t[a]=c?[]:{};var v=l;for(var I in v)t[a][I]=v[I];n[a]=c?[]:{};var f=o[a];if(!this._isDynamic){var M={};for(var I in f)M[I]=f[I];o[a]=f=M}this._setupProperties(v,t[a],f,n[a],i)}else(typeof t[a]>"u"||i)&&(t[a]=l),c||(t[a]*=1),m?n[a]=o[a].slice().reverse():n[a]=t[a]||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(r){return r===void 0&&(r=tf()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=r,this)},e.prototype.resume=function(r){return r===void 0&&(r=tf()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=r-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var r=0,t=this._chainedTweens.length;r<t;r++)this._chainedTweens[r].stop();return this},e.prototype.group=function(r){return r?(r.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var r;return(r=this._group)===null||r===void 0||r.remove(this),this},e.prototype.delay=function(r){return r===void 0&&(r=0),this._delayTime=r,this},e.prototype.repeat=function(r){return r===void 0&&(r=0),this._initialRepeat=r,this._repeat=r,this},e.prototype.repeatDelay=function(r){return this._repeatDelayTime=r,this},e.prototype.yoyo=function(r){return r===void 0&&(r=!1),this._yoyo=r,this},e.prototype.easing=function(r){return r===void 0&&(r=Co.Linear.None),this._easingFunction=r,this},e.prototype.interpolation=function(r){return r===void 0&&(r=Ld.Linear),this._interpolationFunction=r,this},e.prototype.chain=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return this._chainedTweens=r,this},e.prototype.onStart=function(r){return this._onStartCallback=r,this},e.prototype.onEveryStart=function(r){return this._onEveryStartCallback=r,this},e.prototype.onUpdate=function(r){return this._onUpdateCallback=r,this},e.prototype.onRepeat=function(r){return this._onRepeatCallback=r,this},e.prototype.onComplete=function(r){return this._onCompleteCallback=r,this},e.prototype.onStop=function(r){return this._onStopCallback=r,this},e.prototype.update=function(r,t){var o=this,n;if(r===void 0&&(r=tf()),t===void 0&&(t=e.autoStartOnUpdate),this._isPaused)return!0;var i;if(!this._goToEnd&&!this._isPlaying)if(t)this.start(r,!0);else return!1;if(this._goToEnd=!1,r<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 a=r-this._startTime,l=this._duration+((n=this._repeatDelayTime)!==null&&n!==void 0?n:this._delayTime),c=this._duration+this._repeat*l,p=function(){if(o._duration===0||a>c)return 1;var C=Math.trunc(a/l),v=a-C*l,I=Math.min(v/o._duration,1);return I===0&&a===o._duration?1:I},m=p(),f=this._easingFunction(m);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,m),this._duration===0||a>=this._duration)if(this._repeat>0){var g=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=g);for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*g,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var b=0,x=this._chainedTweens.length;b<x;b++)this._chainedTweens[b].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(r,t,o,n){for(var i in o)if(t[i]!==void 0){var a=t[i]||0,l=o[i],c=Array.isArray(r[i]),p=Array.isArray(l),m=!c&&p;m?r[i]=this._interpolationFunction(l,n):typeof l=="object"&&l?this._updateProperties(r[i],a,l,n):(l=this._handleRelativeValue(a,l),typeof l=="number"&&(r[i]=a+(l-a)*n))}},e.prototype._handleRelativeValue=function(r,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?r+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(r){var t=this._valuesStartRepeat[r],o=this._valuesEnd[r];typeof o=="string"?this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(o):this._valuesStartRepeat[r]=this._valuesEnd[r],this._valuesEnd[r]=t},e.autoStartOnUpdate=!1,e}();var R4e=i9.nextId,ji=eI,_4e=ji.getAll.bind(ji),B4e=ji.removeAll.bind(ji),N4e=ji.add.bind(ji),j4e=ji.remove.bind(ji),G4e=ji.update.bind(ji);d();d();d();var s9=(e,r)=>(r-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,a9=(e,r)=>new Se(e.clientX-r.offsetLeft,e.clientY-r.offsetTop),tI=(e,r)=>Math.atan2(r.y-e.y,r.x-e.x),rf=(e,r)=>Math.sqrt((r.y-e.y)**2+(r.x-e.x)**2),rI=(e,r)=>new Se((e.x+r.x)/2,(e.y+r.y)/2),oI=e=>{let r=0,{wheelDelta:t,detail:o}=e;return t!==void 0?r=t:o!==void 0&&(r=-o),r};var j1=class{constructor(r,t){u(this,"input1");u(this,"input2");u(this,"lastAngle");u(this,"lastDistance");u(this,"totalDistance");u(this,"first");u(this,"second");this.input1=r,this.input2=t,this.lastAngle=tI(r,t),this.lastDistance=rf(r,t),this.totalDistance=0,this.first=r,this.second=t}update(r,t){let o=rf(r,t);this.input1=r,this.input2=t;let n=tI(r,t);this.lastAngle=n,this.lastDistance=o,this.totalDistance+=(rf(this.first,r)+rf(this.second,t))/2,this.first=rI(this.first,r),this.second=rI(this.second,t)}};d();var of=class{constructor(r,t,o){u(this,"touch");u(this,"camera");u(this,"cameraPlane");u(this,"viewCoordinate");u(this,"snapHolderMatrix");u(this,"snapCamera");u(this,"cameraPosition");u(this,"raycaster");u(this,"worldCoordinate");u(this,"snapshotted",!1);this.touch=r,this.camera=t,this.cameraPlane=o,this.viewCoordinate={x:r.x,y:r.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 r=new Se(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new ai,this.raycaster.setFromCamera(r,this.snapCamera);let t=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=t&&t.length>0?t[0].point:null,this.snapshotted=!0}updateAnchorState(r,t){this.camera=r,this.snapCamera=r.clone(),this.snapHolderMatrix=r.matrixWorld.clone(),this.updateViewCoordinate(t),this.snapshotCameraState()}updateViewCoordinate(r){this.viewCoordinate={x:r.x,y:r.y}}reUnproject(){let r=new Se(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster?.setFromCamera(r,this.snapCamera);let t=this.raycaster?.intersectObject(this.cameraPlane,!0)[0];return t?t.point:void 0}};var zn={};na(zn,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>YG,CLIPPING_RADIUS:()=>nf,CONTROL_OPTIONS:()=>XG,DEFAULT_ANIMATION_DURATION:()=>lI,DEFAULT_BEARING:()=>eU,DEFAULT_MAX_ZOOM_LEVEL:()=>QG,DEFAULT_MIN_ZOOM_LEVEL:()=>cI,DEFAULT_PITCH:()=>qG,DEFAULT_ZOOM_LEVEL:()=>KG,EVENTS:()=>H1,MAPLIBRE_TILE_SIZE:()=>G1,MAX_LAT:()=>iI,MAX_MERCATOR_ZOOM_LEVEL:()=>V1,MIN_LAT:()=>nI,MIN_MERCATOR_ZOOM_LEVEL:()=>U1,ROOM_MERCATOR_ZOOM_LEVEL:()=>JG,TWO_PI:()=>sI,WHEEL_ZOOM_MULTIPLIER:()=>aI,ZRANGE:()=>Ad});d();var G1=512,nI=-85.051129,iI=85.051129,nf=1e4,XG={chain:"chain",cancel:"cancel"},sI=Math.PI*2,Ad=100,aI=1e4,U1=0,V1=24,YG=17,JG=20,lI=200,H1=["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"],KG=18,cI=12,QG=22,qG=0,eU=0;var $1=!1,tU=!1;var W1,nc=class extends Ie{constructor(t,o,n,i,a){super();u(this,"dirty",!1);u(this,"zoomDirty",!1);u(this,"rotationDirty",!1);u(this,"panDirty",!1);u(this,"stateDirty",!1);S(this,W1,cI);u(this,"zoomSpeed",5);u(this,"rotateSpeed",100);u(this,"enabled",!0);u(this,"enableZoom",!0);u(this,"enablePan",!0);u(this,"enablePedestal",!1);u(this,"maxPedestal",1/0);u(this,"minPedestal",0);u(this,"enableRotate",!0);u(this,"minZoomAltitude",0);u(this,"maxZoomAltitude",1/0);u(this,"ignoreZoomLimits",!1);u(this,"zoomFactor",1);u(this,"panBounds",{min:new ae(1/0,1/0),max:new ae(-1/0,-1/0),center:new ae(0,0,0),radius:1/0});u(this,"minTilt",0);u(this,"maxTilt",1.2);u(this,"MOUSE_BUTTONS",{ORBIT:Bh.RIGHT,ZOOM:Bh.MIDDLE,PAN:Bh.LEFT});u(this,"camera");u(this,"scene");u(this,"renderer");u(this,"elevation");u(this,"orbit");u(this,"cameraPlane");u(this,"raycaster",new ai);u(this,"rendererState");u(this,"options");u(this,"state",-1);u(this,"intersection");u(this,"viewState",null);u(this,"tweens",new Map);u(this,"clock",new C3(!0));u(this,"coords",{mouse:new Se,rotateStart:new Se,rotateEnd:new Se,rotateDelta:new Se,panStart:new ae,panCameraStart:new ae,panEnd:new ae,panDelta:new ae,initialShiftPos:new Se,initialPedestal:0,floorAnchor:new ae});u(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});u(this,"scrollTimer",null);u(this,"lastWheelTime",0);u(this,"resetZoom",!1);u(this,"zoomStart");u(this,"pedestalScaleFactor",1);u(this,"isUserZooming",!1);u(this,"stayInsideBounds",!0);u(this,"userInteracting",!1);u(this,"cameraMoving",!1);u(this,"lastCameraMoveTime",Date.now());u(this,"raycastToFloor",t=>{this.raycaster.setFromCamera(t,this.camera);let o=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return o?o.point:new ae});u(this,"isUserInteracting",()=>this.userInteracting);u(this,"getPosition",()=>new ae(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z));u(this,"getPedestal",()=>this.orbit.position.z);u(this,"pan",(t,o)=>{isNaN(t)||isNaN(o)||(this.setPosition(this.orbit.position.x+t,this.orbit.position.y+o),this.publish("position-updated"))});u(this,"postRender",()=>{(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"))});u(this,"isCameraMoving",()=>this.cameraMoving);u(this,"lastCameraStoppedMovingTime",()=>this.lastCameraMoveTime);u(this,"setPosition",(t,o)=>{t===void 0||o===void 0||isNaN(t)||isNaN(o)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(t,o),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0,this.stateDirty=!0)});u(this,"updateCameraPosition",(t,o)=>{let n=t-this.panBounds.center.x,i=o-this.panBounds.center.y,a=Math.sqrt(n*n+i*i);if(this.stayInsideBounds&&a>this.panBounds.radius){let l=Math.atan2(i,n),c={x:Math.cos(l)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(l)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=c.x,this.orbit.position.y=c.y}else this.orbit.position.x=t,this.orbit.position.y=o});u(this,"tilt",t=>{if(isNaN(t))return;this.state===-1&&this.publish("rotate-start");let o=this.stayInsideBounds?Math.max(Math.min(t+this.getTilt(),this.maxTilt),this.minTilt):t+this.getTilt();o!==this.elevation.rotation.x&&(this.elevation.rotation.x=o,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end"),this.stateDirty=!0});u(this,"zoomIn",(t,o,n)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i/1.5},t,o,n)});u(this,"zoomOut",(t,o,n)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i*1.5},t,o,n)});u(this,"getRotation",()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2));u(this,"cancelAnimation",()=>{let t=Array.from(this.tweens.keys()),o=t[t.length-1];o.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(o)});u(this,"animateCamera",(t,o,n,i,a,l)=>{let c={interruptible:!0,...l},p={},m={},f=this.getPosition();if(t.position!=null&&(t.position.x!==void 0&&(p.x=f.x,m.x=t.position.x),t.position.y!==void 0&&(p.y=f.y,m.y=t.position.y),t.position.z!==void 0&&(p.z=f.z,m.z=t.position.z)),t.zoom!==void 0&&(p.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?m.zoom=t.zoom:m.zoom=Math.min(Math.max(t.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),t.rotation!==void 0){let{start:O,end:T}=Yh(this.getRotation(),t.rotation);p.rotation=O,m.rotation=T}t.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?m.tilt=t.tilt:m.tilt=Math.max(Math.min(t.tilt,this.maxTilt),this.minTilt));let g=p.zoom!==m.zoom,b=p.rotation!==m.rotation,x=p.tilt!==m.tilt,C=new Wn(p).to(m,y.env.TESTING?0:o).onUpdate(O=>{this.setMulti({x:O.x,y:O.y,z:O.z},O.zoom,O.rotation,O.tilt)}).onComplete(()=>{this.completeTween(C),this.publish("multi-end",{zooming:g,rotating:b,tilting:x}),i&&i()}).onStart(()=>{this.state!==7&&(this.state=7,C.state=7,this.publish("multi-start",{zooming:g,rotating:b,tilting:x})),this.publish("change")});this.rendererState.internalTweenGroup.add(C);let v=Array.from(this.tweens.entries()),I=v[v.length-1],M=!1;return I!=null&&(I[1].interruptible?(typeof I[1].cancelledCallback=="function"&&I[1].cancelledCallback(),this.completeTween(I[0])):(M=!0,I[0].chain(C))),this.tweens.set(C,{cancelledCallback:a,interruptible:c.interruptible}),n?C.easing(n):C.easing(Co.Quadratic.In),!t.doNotAutoStart&&!M&&(C.start(),this.publish("change")),C.cameraAnimation=!0,C});u(this,"setMulti",(t,o,n,i,a=!0)=>{this.state===-1&&this.publish("multi-start");let l=!1;t!=null&&(t.x!==void 0&&!isNaN(t.x)&&t.y!==void 0&&!isNaN(t.y)&&(this.updateCameraPosition(t.x,t.y),l=!0),t.z!==void 0&&!isNaN(t.z)&&(this.setPedestal(t.z,!0,!1),l=!0)),l&&this.publish("position-updated");let c={zooming:!1,tilting:!!o,rotating:!1};if(o!==void 0&&!isNaN(o)){let p=this.stayInsideBounds?Math.min(Math.max(o,this.getZoomScaledMin()),this.getZoomScaledMax()):o;p!==this.camera.position.z&&(c.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?o>nf&&(this.camera.near=o-nf,this.camera.far=o+nf):(this.camera.near=o/Ad,this.camera.far=o*Ad),this.camera.updateProjectionMatrix())}if(n!==void 0&&!isNaN(n)&&n!==this.getRotation()&&(c.rotating=!0,this.orbit.rotation.z=-n,this.publish("rotation-updated")),i!==void 0&&!isNaN(i)){let p=this.stayInsideBounds?Math.max(Math.min(i,this.maxTilt),this.minTilt):i;p!==this.elevation.rotation.x&&(c.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",c),this.stateDirty=!0});u(this,"getZoomScaledMin",()=>this.minZoomAltitude*this.zoomFactor);u(this,"getZoomScaledMax",()=>{let t=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,t)});u(this,"setRotation",(t,o)=>{if(isNaN(t))return;this.state===-1&&!o&&this.publish("rotate-start");let n=-(t%sI);n!==this.orbit.rotation.z&&(this.orbit.rotation.z=n,o||this.publish("rotation-updated")),o||this.publish("change"),this.state===-1&&!o&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0,o||(this.stateDirty=!0)});u(this,"setZoomAltitude",t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let o=this.stayInsideBounds?Math.min(Math.max(t,this.getZoomScaledMin()),this.getZoomScaledMax()):t;o!==this.camera.position.z&&(this.camera.position.z=o,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=o/Ad,this.camera.far=o*Ad,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0,this.stateDirty=!0});u(this,"setZoomLevel",t=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(t))});u(this,"getZoomAltitude",()=>this.camera.position.z);u(this,"getZoomLevel",()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()));u(this,"setTilt",(t,o)=>{if(isNaN(t))return;this.state===-1&&!o&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(t,this.maxTilt),this.minTilt):t;n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,o||this.publish("tilt-updated")),o||this.publish("change"),this.state===-1&&!o&&this.publish("rotate-end"),this.dirty=!0,o||(this.stateDirty=!0)});u(this,"getTilt",()=>this.elevation.rotation.x);u(this,"setCameraPlaneElevation",t=>{this.cameraPlane.position.z=t});u(this,"zoom",t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let o=this.getZoomAltitude()-t;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(o,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):o,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.stateDirty=!0});u(this,"getProjectionScaleFactor",(t,o,n)=>c0(t,o,n));u(this,"update",()=>{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())});u(this,"setPedestal",(t,o=!1,n=!0)=>{typeof t=="number"&&!isNaN(t)&&(this.orbit.position.z=t,o&&(this.publishPedestalChangeEvent(t),this.publish("pedestal-change",{pedestal:t})),this.publish("change"),this.dirty=!0,n&&(this.stateDirty=!0))});u(this,"dispose",()=>{for(let t of H1)t.endsWith("start")?(this.off(t,this.setCameraMoving),t.startsWith("user")&&this.off(t,this.setUserInteracting)):(t.endsWith("end")||t.endsWith("cancel"))&&(this.off(t,this.unsetCameraMoving),t.startsWith("user")&&this.off(t,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane),this.destroy()});u(this,"createCameraPlane",()=>{let t=$1?2e3:1e10,o=$1?100:1,n=new ts(t,t,o,o),i=new Mr({color:0,wireframe:$1,visible:$1}),a=new Oe(n,i);return this.scene.add(a),a});u(this,"addEventListeners",()=>{let{domElement:t}=this.renderer;for(let o of H1)o.endsWith("start")?(this.on(o,this.setCameraMoving),o.startsWith("user")&&this.on(o,this.setUserInteracting)):(o.endsWith("end")||o.endsWith("cancel"))&&(this.on(o,this.unsetCameraMoving),o.startsWith("user")&&this.on(o,this.unsetUserInteracting));t.addEventListener("contextmenu",this.onContextMenu,!1),t.addEventListener("mousedown",this.onMouseDown,!1),t.addEventListener("wheel",this.onMouseWheel,{passive:!1}),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchmove",this.onTouchMove,!1)});u(this,"addMouseEventListeners",()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)});u(this,"addMouseMoveEventListeners",()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)});u(this,"removeMouseMoveEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)});u(this,"removeEventListeners",()=>{let{domElement:t}=this.renderer;t.removeEventListener("contextmenu",this.onContextMenu,!1),t.removeEventListener("mousedown",this.onMouseDown,!1),t.removeEventListener("wheel",this.onMouseWheel,!1),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});u(this,"removeMouseUpEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});u(this,"onContextMenu",t=>{t.preventDefault()});u(this,"onMouseUp",()=>{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}});u(this,"onMouseMove",t=>{if(this.enabled!==!1)if(t.preventDefault(),this.mouseToScene(t),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(t)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(t)});u(this,"onTouchStart",t=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(t),t.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(t),this.state=9):this.enablePan&&(this.handleTouchStartPan(t),this.state=6);break;case 2:this.touch.inputs=new j1(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}});u(this,"onTouchMove",t=>{if(this.enabled!==!1)switch(this.touchToScene(t),t.touches.length){case 2:t.preventDefault(),t.stopPropagation();let o={...this.touch.inputs.first},n={...this.touch.inputs.second},i=new Se(this.touch.touches[0].x,this.touch.touches[0].y),a=new Se(this.touch.touches[1].x,this.touch.touches[1].y);if(this.touch.inputs.update(this.touch.touches[0],this.touch.touches[1]),this.enableRotate&&this.state===4)this.handleTouchMoveTilt(t);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let l=o.y<i.y&&n.y<a.y,c=o.y>i.y&&n.y>a.y;this.enableRotate&&this.state!==4&&(c||l)?(this.handleTouchStartTilt(t),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(t.preventDefault(),t.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(t):this.enablePan&&this.state===6&&this.handleTouchMovePan(t);break;default:this.state=-1}});u(this,"onTouchEnd",t=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}t.touches.length?this.onTouchStart(t):this.state=-1}});u(this,"handleTouchMovePan",t=>{let o=Object.hasOwn(t,"x")?new Se(t.x,t.y):this.touch.touches[0],n=this.raycastToFloor(o);this.coords.panEnd.set(n.x,n.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});u(this,"handleTouchStartDolly",()=>{let t=this.touch.touches[0].x-this.touch.touches[1].x,o=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let n=new Se(this.touch.touches[0].x-t/2,this.touch.touches[0].y-o/2);this.coords.floorAnchor=this.raycastToFloor(n),this.orbit.updateMatrixWorld(),this.touch.anchor1=new of(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new of(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")});u(this,"handleMouseMovePan",()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(t.x,t.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0});u(this,"handleTouchStartTilt",t=>{this.coords.rotateStart.set(t.touches[1].clientX,t.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")});u(this,"handleTouchMovePedestal",t=>{this.handleMouseMovePedestal(t.touches[0])});u(this,"handleTouchMoveTilt",t=>{this.coords.rotateEnd.set(t.touches[1].clientX,t.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)});u(this,"handleTouchMoveDolly",()=>{let t=this.touch.inputs.first,o=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:t.x,y:t.y},this.touch.anchor2.viewCoordinate={x:o.x,y:o.y};let n=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);n&&this.setCameraFromTransformMatrix(n),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,t),this.touch.anchor2.updateAnchorState(this.camera,o)});u(this,"handleTouchEnd",()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1});u(this,"handleTouchStartPan",t=>{let o=Object.hasOwn(t,"x")?new Se(t.x,t.y):this.touch.touches[0],n=this.raycastToFloor(o);this.coords.panStart.set(n.x,n.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")});u(this,"handleTouchStartPedestal",t=>{this.handleMouseDownPedestal(t.touches[0])});u(this,"onMouseDown",t=>{if(this.enabled!==!1){if(this.mouseToScene(t),t.preventDefault(),this.state===3&&this.publish("zoom-end"),t.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else t.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(t),this.state=8));this.state!==-1&&this.addMouseEventListeners()}});u(this,"onMouseWheel",t=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(t.preventDefault(),t.stopPropagation(),this.mouseToScene(t),this.canScrollZoom(t)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(t)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(t))});u(this,"handleMouseWheel",t=>{if(this.publish("zoom-start"),!this.canScrollZoom(t)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let o=this.getZoomAltitude(),n=o-oI(t)*o/aI*this.zoomSpeed;if(this.setZoomAltitude(n),this.enablePan){let i=n/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-i),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")});u(this,"setCameraFromTransformMatrix",t=>{this.orbit.updateMatrixWorld();let o=new Dc;o.setFromRotationMatrix(t,"ZYX");let n=(t.elements[14]-this.cameraPlane.position.z)/Math.cos(o.x),i=o.z,a=new ae(0,0,1);a.applyEuler(o),a.setLength(n);let l=new ae;l.setFromMatrixPosition(t),l.sub(a),this.enablePan&&this.setPosition(l.x,l.y),this.enableZoom&&this.setZoomAltitude(n),this.enableRotate&&this.setRotation(-i)});u(this,"makeTransformFromTouchAnchors",(t,o)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let n=this.camera.projectionMatrix.clone(),i=t.worldCoordinate,a=o.worldCoordinate,l=t.reUnproject(),c=o.reUnproject();if(!l||!c||!i||!a)return null;let p=t.viewCoordinate,m=o.viewCoordinate,f=a.x-i.x,g=a.y-i.y,b=Math.atan2(g,f),x=c.x-l.x,C=c.y-l.y,v=Math.atan2(C,x),I=s9(b,v),M=new qi;M.makeRotationZ(-I);let O=M.clone();O.multiply(t.snapHolderMatrix);let T=(CO,TO,MO)=>CO.elements[(TO-1)*4+MO-1],P=T(n,1,1)*T(O,1,1)-p.x*T(n,3,4)*T(O,3,1),B=T(n,1,1)*T(O,1,2)-p.x*T(n,3,4)*T(O,3,2),G=T(n,1,1)*T(O,1,3)-p.x*T(n,3,4)*T(O,3,3),A=i.x*P+i.y*B+i.z*G,N=T(n,2,2)*T(O,2,1)-p.y*T(n,3,4)*T(O,3,1),z=T(n,2,2)*T(O,2,2)-p.y*T(n,3,4)*T(O,3,2),Z=T(n,2,2)*T(O,2,3)-p.y*T(n,3,4)*T(O,3,3),oe=i.x*N+i.y*z+i.z*Z,J=T(n,1,1)*T(O,1,1)-m.x*T(n,3,4)*T(O,3,1),fe=T(n,1,1)*T(O,1,2)-m.x*T(n,3,4)*T(O,3,2),ye=T(n,1,1)*T(O,1,3)-m.x*T(n,3,4)*T(O,3,3),Te=a.x*J+a.y*fe+a.z*ye,ve=T(n,2,2)*T(O,2,1)-m.y*T(n,3,4)*T(O,3,1),we=T(n,2,2)*T(O,2,2)-m.y*T(n,3,4)*T(O,3,2),ie=T(n,2,2)*T(O,2,3)-m.y*T(n,3,4)*T(O,3,3),Me=a.x*ve+a.y*we+a.z*ie,tt=Math.abs(J-P),Ze=Math.abs(fe-B),rt=Math.abs(ye-G),Ke=Math.abs(J-N),be=Math.abs(fe-z),gt=Math.abs(ye-Z),wt=Math.abs(ve-P),Kt=Math.abs(we-B),k=Math.abs(ie-G),H=Math.abs(ve-N),F=Math.abs(we-z),Q=Math.abs(ie-Z),Y=Math.min(tt+Ze+rt,Ke+be+gt),q=Math.min(wt+Kt+k,H+F+Q);Y<q&&(J=ve,fe=we,ye=ie,Te=Me);let Pe=N*G-P*Z,Lt=z*G-B*Z,Uo=oe*G-A*Z,Xr=J*Z-N*ye,lo=fe*Z-z*ye,al=Te*Z-oe*ye,Xb=(al*Lt-Uo*lo)/(Xr*Lt-Pe*lo),Yb=(al*Pe-Uo*Xr)/(lo*Pe-Lt*Xr),t3=z*P-B*N,vO=Z*P-G*N,IO=oe*P-A*N,r3=fe*N-z*J,SO=ye*N-Z*J,o3=((Te*N-oe*J)*t3-IO*r3)/(SO*t3-vO*r3),_h=O.clone();return _h.elements[12]=Xb,_h.elements[13]=Yb,_h.elements[14]=o3,o3>0?_h:null});u(this,"updateTouchOrigin",()=>{let t=this.renderer.domElement;this.touch.origin.offsetLeft=t.getBoundingClientRect().left,this.touch.origin.offsetTop=t.getBoundingClientRect().top});u(this,"touchToScene",t=>{this.touch.touches=[];for(let o=0,n=t.touches.length;o<n;o++){let i=t.touches[o],a=a9(i,this.touch.origin);this.touch.touches.push(new Se(a.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(a.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]});u(this,"canScrollZoom",t=>{let o=oI(t),n=this.getZoomAltitude();return!(o<0&&n===this.getZoomScaledMax()||o>0&&n===this.getZoomScaledMin())});u(this,"mouseToScene",t=>{let o=this.getMousePos(t);return this.coords.mouse.x=o.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(o.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse});u(this,"getMousePos",t=>({x:t.offsetX,y:t.offsetY}));u(this,"handleMouseDownRotate",t=>{this.coords.rotateStart.set(t.clientX,t.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")});u(this,"handleMouseDownPan",()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(t.x,t.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")});u(this,"handleMouseDownPedestal",t=>{let o=new Se(t.clientX,t.clientY);this.coords.initialShiftPos=o,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=c0(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")});u(this,"handleMouseMovePedestal",t=>{let o={x:t.clientX,y:t.clientY},n=this.coords.initialPedestal+this.pedestalScaleFactor*(o.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(n<this.minPedestal?n=Math.max(n,this.minPedestal):n>this.maxPedestal&&(n=Math.min(n,this.maxPedestal))),n!==this.getPedestal()&&this.setPedestal(n,!0)});u(this,"handleMouseMoveRotate",t=>{this.coords.rotateEnd.set(t.clientX,t.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")});u(this,"publishUserZoomDebounced",Su(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));u(this,"publishUserZoomEvent",()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())});u(this,"setCameraMoving",()=>{this.cameraMoving=!0});u(this,"unsetCameraMoving",()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()});u(this,"setUserInteracting",()=>{this.userInteracting=!0});u(this,"unsetUserInteracting",()=>{this.userInteracting=!1});u(this,"publishPedestalChangeEvent",t=>{this.publish("pedestal-change",{pedestal:t,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})});u(this,"convertAltitudeToZoomLevel",t=>{let[,o]=this.center,i=t*2*Math.tan(Le.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(Le.degToRad(o))*2*Math.PI*Jb/i;return Le.clamp(Math.log2(a/512),U1,V1)});u(this,"convertZoomLevelToAltitude",t=>{let[,o]=this.center,n=Le.clamp(t,U1,V1),i=Math.pow(2,n),a=Le.clamp(o,nI,iI),l=i*512;return Math.cos(Le.degToRad(a))*Math.PI*2*Jb/l*this.options.canvasHeight/2/Math.tan(Le.degToRad(this.camera.fov)/2)});u(this,"completeTween",t=>{t.isPlaying()&&t.stop(),this.rendererState.internalTweenGroup.remove(t),this.tweens.delete(t)});u(this,"debugContainer",new es);this.camera=t,this.renderer=n,this.rendererState=i,this.scene=o,this.options=a,this.elevation=t.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=t.position.z,a.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(t){this.minZoomAltitude=this.convertZoomLevelToAltitude(t),this.stateDirty=!0}get defaultMinZoomLevel(){return s(this,W1)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(t){this.maxZoomAltitude=this.convertZoomLevelToAltitude(t),this.stateDirty=!0}get scrollPercent(){let t=this.minPedestal,o=this.maxPedestal,n=this.getPedestal();return n=Math.min(n,o),n=Math.max(n,t),(n-t)/(o-t)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){let t=this.getPosition(),{lat:o,lon:n}=tg(this.rendererState.center?.[1]??0,this.rendererState.center?.[0]??0,t.x,t.y);return[n,o]}setCenter(t,o){let{x:n,y:i}=rg(this.rendererState.center?.[1]??0,this.rendererState.center?.[0]??0,o,t);this.setPosition(n,i)}get isAnimating(){return this.rendererState.internalTweenGroup.getAll().some(t=>t.cameraAnimation)}getCameraFrameForCoordinates(t,o){let n=o.minZoom!==void 0?o.minZoom:this.minZoomAltitude,i=o.maxZoom!==void 0?o.maxZoom:this.maxZoomAltitude,a=this.options.canvasWidth,l=this.options.canvasHeight,c=this.getRotation(),p=this.getTilt(),m=this.getPosition();this.setRotation(o.rotation||c,!0),this.setTilt(o.tilt||p,!0);let f=l9(t,{canvasWidth:a,canvasHeight:l,paddingOption:o.padding,verticalPadding:o.verticalPadding,minZoom:n,maxZoom:i,position:m,camera:this.camera,orbit:this.orbit});return this.setRotation(c,!0),this.setTilt(p,!0),{center:f.position,zoomLevel:this.convertAltitudeToZoomLevel(f.zoom)}}focusOn(t,o){if(tU){this.debugContainer&&_t(this.debugContainer);let v=new Sn(4,4,4),I=new Mr({color:65280,depthTest:!1}),M=new aa(v,I,t.length),O=new qi;t.forEach((T,P)=>{O.setPosition(T),M.setMatrixAt(P,O)}),M.instanceMatrix.needsUpdate=!0,this.debugContainer.add(M),this.scene.add(this.debugContainer)}let n=o.curve,i=o.callback,a=o.cancelledCallback,l=o.minZoom!==void 0?o.minZoom:this.minZoomAltitude,c=o.maxZoom!==void 0?o.maxZoom:this.maxZoomAltitude,p=this.options.canvasWidth,m=this.options.canvasHeight,f;o.duration!==void 0?f=o.duration:y.env.TESTING==="true"?f=0:f=lI;let g=o.padding,b=this.getRotation(),x=this.getTilt();o.rotation!=null&&this.setRotation(o.rotation),o.tilt!=null&&this.setTilt(o.tilt);let C=l9(t,{canvasHeight:m,paddingOption:g,canvasWidth:p,minZoom:l,maxZoom:c,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:o.verticalPadding});this.setRotation(b),this.setTilt(x),this.animateCamera({position:C.position,tilt:o.tilt,rotation:o.rotation,zoom:C.zoom},f,n,i,a,o)}resize(t,o){this.options.canvasWidth=t,this.options.canvasHeight=o}};W1=new WeakMap,u(nc,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);function l9(e,{canvasWidth:r,orbit:t,paddingOption:o,verticalPadding:n=0,canvasHeight:i,minZoom:a,maxZoom:l,camera:c,position:p}){let m={zoom:a,position:p};if(e.length===0)return m;for(let Pe of nc.CAMERA_FRAME_PADDING_SIDES)typeof o[Pe]!="number"&&(o[Pe]=0);let f=o.type==="portion"?{top:o.top*i,bottom:o.bottom*i,left:o.left*r,right:o.right*r,type:"pixel"}:o;if(f.left+f.right>=r||f.top+f.bottom>=i)return m;t.updateMatrixWorld();let g=c.matrixWorldInverse,b=c.fov*(Math.PI/180)/2,x=b,v=Math.atan(Math.tan(b)*(r/i)),I=new ae(1/0,1/0,1/0),M=new ae(-1/0,-1/0,-1/0),O=new Qt,T=new ae;for(let Pe=0,Lt=e.length;Pe<Lt;Pe++)T.copy(e[Pe]),O.expandByPoint(T),T.applyMatrix4(g),I.min(T),M.max(T),T.copy(e[Pe]),T.z-=n,T.applyMatrix4(g),I.min(T),M.max(T),T.copy(e[Pe]),T.z+=n,T.applyMatrix4(g),I.min(T),M.max(T);let P=M.x-I.x,B=M.y-I.y,G=r-f.left-f.right,A=i-f.top-f.bottom,N=(M.x+I.x)/2,z=(M.y+I.y)/2,Z=P/G,oe=B/A,J=a,fe=l,ye=J*Math.tan(v)*2,Te=fe*Math.tan(v)*2,ve=ye/r,we=Te/r,ie=Math.max(Z,oe);ie=Le.clamp(ie,ve,we);let Me=G*ie,tt=A*ie,Ze={min:{x:N-Me/2-f.left*ie,y:z-tt/2-f.bottom*ie},max:{x:N+Me/2+f.right*ie,y:z+tt/2+f.top*ie}},rt=(Ze.min.x+Ze.max.x)/2,Ke=(Ze.min.y+Ze.max.y)/2,be=O.getCenter(new ae),gt=Math.abs(rt-Ze.min.x),wt=Math.abs(Ke-Ze.min.y),Kt=gt/Math.tan(v),k=wt/Math.tan(x),H=new ae;H.set(rt,Ke,M.z+Math.max(Kt,k)),H.applyMatrix4(c.matrixWorld);let F=new ae;F.set(rt,Ke,M.z),F.applyMatrix4(c.matrixWorld);let Q=new ae().subVectors(F,H),Y=(be.z-H.z)/Q.z,q=new ae().copy(H).add(Q.clone().multiplyScalar(Y));return F.set(q.x,q.y,q.z),H.sub(F),{position:q,zoom:H.length()}}d();var rU=300,sf,af,z1=class{constructor(r){u(this,"state");S(this,sf,new ae);S(this,af,new ae);this.state=r}update(r){let t,o;this.state.cameraObject.getWorldPosition(s(this,af));for(let n of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(n),t&&(o=t.components[0],o&&"containerEl"in o&&o.markerContainer!=null)){if(o.visibilityNeedsUpdate!==!1&&(o.visibilityNeedsUpdate==="show"?o.canShow=!0:o.canShow=!1),(o.canShow&&o.visible===!0||o.animation?.pending===!0)&&!o.offscreen)if(o.options.zIndex!=null)o.markerContainer.style.transform=`translate3D(${o.projection.x}px, ${o.projection.y}px, ${o.options.zIndex}px)`;else{t.object3d.getWorldPosition(s(this,sf));let i=s(this,af).distanceTo(s(this,sf));o.markerContainer.style.transform=`translate3D(${o.projection.x}px, ${o.projection.y}px, ${-i}px)`}if(o.canShow===!0&&o.visible===!0?o.markerContainer.style.pointerEvents=r?"none":o.pointerEvents:o.markerContainer.style.pointerEvents="none",o.currentStrategyIndex===-1&&o.visible&&o.visibilityNeedsUpdate==="show")continue;o.visibilityNeedsUpdate!==!1&&!o.offscreen&&(o.visibilityNeedsUpdate==="show"&&(o.markerContainer.style.opacity="0"),o.animation&&o.animation.cancel(),o.animation=o.markerContainer.animate([{opacity:o.canShow&&o.visible?"1":"0"}],{duration:rU,easing:"ease-in-out",fill:"forwards"}),o.visibilityNeedsUpdate=!1)}}};sf=new WeakMap,af=new WeakMap;d();var Z1=class extends Ie{constructor(t,o){super();u(this,"state");u(this,"dirty",!0);u(this,"domTree");u(this,"observers",new Map);u(this,"updateDimensions",t=>{t.forEach(o=>{let i=o.target.parentElement?.getAttribute("data-marker-id");if(i){let a=this.state.geometry2DMap.get(i),l=a?.components[0];a&&l instanceof is&&(l.updateDimensions(o.contentRect.width,o.contentRect.height),l.collisionDirty=!0)}}),this.publish("dimensions-update")});this.state=t,this.domTree=o}setupObserver(){if(this.observers){for(let n of this.observers.values())n.disconnect();this.observers.clear()}let t,o;for(let n of this.domTree.children){let i=n.getAttribute("data-marker-id");if(i!=null&&(t=this.state.geometry2DMap.get(i),o=t.components[0],o.options?.dynamicResize)){let a=new ResizeObserver(this.updateDimensions);a.observe(o.containerEl),this.observers.set(n.userData.entityId,a)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let t of this.observers.values())t.disconnect();this.observers.clear()}};d();var oU=0,nU=90,iU=(y.env.NODE_ENV==="test",!1),Gi={linear:Co.Linear.None,"ease-in":Co.Quadratic.In,"ease-out":Co.Quadratic.Out,"ease-in-out":Co.Quadratic.InOut},sU=-50,se,he,js,lf,cf,dI,X1=class{constructor(r,t,o){S(this,cf);S(this,se);S(this,he);S(this,js);S(this,lf);w(this,se,r),w(this,he,t),w(this,js,o),s(this,se).map&&s(this,se).map.transform.setMinElevationForCurrentTile(sU),s(this,he).cameraSystem.on("pedestal-change",({pedestal:n})=>{s(this,he).cameraSystem.setCameraPlaneElevation(n)})}get center(){return s(this,se).mode==="outdoors-overlay"&&s(this,se).map?s(this,se).map.getCenter?.().toArray():s(this,he).cameraSystem.center}setCenter(r){if(s(this,se).mode==="outdoors-overlay"&&s(this,se).map){s(this,se).map?.setCenter(r),s(this,he).interactionSystem.handleHover();return}s(this,he).cameraSystem.setCenter(r[0],r[1]),s(this,he).interactionSystem.handleHover()}get zoomLevel(){return s(this,se).mode==="outdoors-overlay"&&s(this,se).map?s(this,se).map?.getZoom():s(this,he).cameraSystem.getZoomLevel()}setZoomLevel(r){s(this,se).mode==="outdoors-overlay"&&s(this,se).map&&s(this,se).map?.setZoom(r),s(this,he).cameraSystem.setZoomLevel(li(r,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}getState(){return{zoomLevel:this.zoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,minPitch:this.minPitch,maxPitch:this.maxPitch,autoMinZoomLevel:this.autoMinZoomLevel,panMode:this.panMode,screenOffsets:this.insetsPadding,center:this.center,bearing:this.bearing,pitch:this.pitch,elevation:this.elevation}}get isAnimating(){return s(this,he).cameraSystem.isAnimating}cancelAnimation(){s(this,he).cameraSystem.cancelAnimation()}get maxZoomLevel(){return s(this,he).cameraSystem.maxZoomLevel}get minZoomLevel(){return s(this,he).cameraSystem.minZoomLevel}setAutoMinZoomLevel(r){s(this,he).panBoundsSystem.autoMinZoomLevel=r,r&&(s(this,he).panBoundsSystem.dirty=!0,s(this,he).panBoundsSystem.update())}get autoMinZoomLevel(){return s(this,he).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(r,t=!1){t&&this.setAutoMinZoomLevel(!1);let o=li(r,zn.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,`setMinZoomLevel was clamped. minZoomLevel must be between ${zn.MIN_MERCATOR_ZOOM_LEVEL} and maxZoomLevel.`);s(this,he).cameraSystem.setMinZoomLevel(o),this.zoomLevel<o&&this.setZoomLevel(o),s(this,se).map?.setMinZoom(o)}setMaxZoomLevel(r){let t=li(r,this.minZoomLevel,zn.MAX_MERCATOR_ZOOM_LEVEL,`setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ${zn.MAX_MERCATOR_ZOOM_LEVEL}.`);s(this,he).cameraSystem.setMaxZoomLevel(t),this.zoomLevel>t&&this.setZoomLevel(t),s(this,se).map?.setMaxZoom(t)}get maxPitch(){return s(this,se).mode==="outdoors-overlay"&&s(this,se).map?s(this,se).map?.getMaxPitch?.():Le.radToDeg(s(this,he).cameraSystem.maxTilt)}get minPitch(){return s(this,se).mode==="outdoors-overlay"&&s(this,se).map?s(this,se).map?.getMinPitch?.():Le.radToDeg(s(this,he).cameraSystem.minTilt)}setMinPitch(r){let t=Math.max(oU,r);s(this,se).map?.setMinPitch(t),s(this,he).cameraSystem.minTilt=Le.degToRad(t)}setMaxPitch(r){let t=Math.min(nU,r);s(this,se).map?.setMaxPitch(t),s(this,he).cameraSystem.maxTilt=Le.degToRad(t)}get bearing(){return s(this,se).mode==="outdoors-overlay"&&s(this,se).map?s(this,se).map?.getBearing():Le.radToDeg(s(this,he).cameraSystem.getRotation())}setBearing(r){if(s(this,se).mode==="outdoors-overlay"&&s(this,se).map){s(this,se).map?.setBearing(r);return}s(this,he).cameraSystem.setRotation(Le.degToRad(r))}get pitch(){return s(this,se).mode==="outdoors-overlay"&&s(this,se).map?s(this,se).map?.getPitch():Le.radToDeg(s(this,he).cameraSystem.getTilt())}setPitch(r){if(s(this,se).mode==="outdoors-overlay"&&s(this,se).map){s(this,se).map?.setPitch(r);return}s(this,he).cameraSystem.setTilt(Le.degToRad(li(r,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 s(this,he).cameraSystem.getPedestal()}setElevation(r){s(this,he).cameraSystem.setPedestal(r,!0)}animateElevation(r,t){return s(this,lf)&&s(this,lf).stop(),new Promise(o=>{s(this,he).cameraSystem.animateCamera({position:{z:r}},t?.duration||300,Gi[t?.easing||"ease-in-out"],o,o,{interruptible:t?.interruptible??!0})})}get insetsPadding(){return s(this,js).insetsPadding}get panMode(){return s(this,he).cameraSystem.enablePan===!1&&s(this,he).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(r){if(r!=="default"&&r!=="elevation")throw new Error("Invalid pan mode");r!==this.panMode&&(r==="default"?(s(this,he).cameraSystem.enablePan=!0,s(this,he).cameraSystem.enablePedestal=!1):(s(this,he).cameraSystem.enablePan=!1,s(this,he).cameraSystem.enablePedestal=!0))}setInsetPadding(r){s(this,js).insetsPadding=Object.assign({},s(this,js).insetsPadding,r)}animateTo(r){if(s(this,se).mode==="outdoors-overlay"&&s(this,se).map)return s(this,se).map?.flyTo({center:r.center??this.center,zoom:r.zoomLevel??this.zoomLevel,bearing:r.bearing??this.bearing,pitch:r.pitch??this.pitch,duration:r.duration??600}),Promise.resolve();let t=r.center?s(this,se).convertTo3DMapPosition(r.center[1],r.center[0],r.center[2]||this.elevation):void 0,o=r.zoomLevel!==void 0?s(this,he).cameraSystem.convertZoomLevelToAltitude(li(r.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,n=r.bearing!==void 0?Le.degToRad(r.bearing):void 0,i=r.pitch!==void 0?Le.degToRad(li(r.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(a=>{s(this,he).cameraSystem.animateCamera({position:t,zoom:o,rotation:n,tilt:i},r.duration||0,Gi[r.easing||"ease-in-out"],()=>{s(this,he).interactionSystem.handleHover(),a()},a,{interruptible:r?.interruptible??!0})})}getCameraFrameForCoordinates(r,t){let o=W(this,cf,dI).call(this,t||{},()=>Promise.resolve()),{pointCloud:n}=c9(r,s(this,se),s(this,js).geometry3DMap);if(n.length===0)return L.error("No valid coordinates found in targets:",r),{center:this.center,zoomLevel:this.zoomLevel};let{center:i,zoomLevel:a}=s(this,he).cameraSystem.getCameraFrameForCoordinates(n,o);return{center:s(this,se).convert3DMapPositionToCoordinate(i),zoomLevel:a}}focusOn(r,t){let{pointCloud:o,geoBounds:n,firstPosition:i}=c9(r,s(this,se),s(this,js).geometry3DMap);return o.length===0?(L.error("No valid coordinates found in targets:",r),Promise.resolve()):s(this,se).mode==="outdoors-overlay"&&s(this,se).map?(o.length===1&&i?s(this,se).map?.flyTo({center:[i[0],i[1]],duration:t?.duration||s(this,se).map.getBearing(),animate:!0,bearing:t?.bearing===void 0?s(this,se).map.getBearing():t?.bearing,pitch:t?.pitch===void 0?s(this,se).map.getPitch():t?.pitch,zoom:t?.maxZoomLevel||s(this,se).map.getMaxZoom()}):(iU&&aU(s(this,se),n),s(this,se).map?.fitBounds(n,{duration:t?.duration??zn.DEFAULT_ANIMATION_DURATION,bearing:t?.bearing===void 0?s(this,se).map.getBearing():t?.bearing,pitch:t?.pitch===void 0?s(this,se).map.getPitch():t?.pitch,maxZoom:t?.maxZoomLevel??s(this,se).map.getMaxZoom()})),s(this,he).interactionSystem.handleHover(),Promise.resolve()):new Promise(a=>{s(this,he).cameraSystem.focusOn(o,W(this,cf,dI).call(this,t||{},a))})}};se=new WeakMap,he=new WeakMap,js=new WeakMap,lf=new WeakMap,cf=new WeakSet,dI=function(r,t){return{minZoom:r?.maxZoomLevel===void 0?void 0:s(this,he).cameraSystem.convertZoomLevelToAltitude(li(r.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:r?.minZoomLevel===void 0?void 0:s(this,he).cameraSystem.convertZoomLevelToAltitude(li(r.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:r?.padding?Object.assign({},qh,r?.padding):this.insetsPadding,curve:Gi[r?.easing||"ease-in-out"],rotation:r?.bearing===void 0?void 0:Le.degToRad(r.bearing),tilt:r?.pitch!==void 0?Le.degToRad(li(r.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:r?.duration,callback:()=>{s(this,he).interactionSystem.handleHover(),t()},cancelledCallback:t,interruptible:r?.interruptible??!0,verticalPadding:r?.verticalPadding}};function pI(e,r){e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[0]),e[3]=Math.max(e[3],r[1])}function c9(e,r,t){let o=[],n=[1/0,1/0,-1/0,-1/0],i=null;if(!e||!Array.isArray(e)||e.length===0)return{pointCloud:o,geoBounds:n,firstPosition:i};let a=r.getSystems().renderSystem;(a.threeDdirty||a.twoDdirty)&&r.renderSync();for(let l of e)if(typeof l=="string"){let c=t.get(l);if(!c){L.error("Entity not found with id:",l);continue}let p=new Qt;Y3(r,"userData"in c?c.userData.entityId??c.id:c.id,o,p,c instanceof nr?c.position.z:void 0);let m=r.convert3DMapPositionToCoordinate(p.min),f=r.convert3DMapPositionToCoordinate(p.max);pI(n,m),pI(n,f),i||(i=r.convert3DMapPositionToCoordinate(p.getCenter(new ae)))}else o.push(r.convertTo3DMapPosition(l[1],l[0],l[2]||0)),pI(n,l),i||(i=l);return{pointCloud:o,geoBounds:n,firstPosition:i}}function aU(e,r){let t=[[r[0],r[1]],[r[0],r[3]],[r[2],r[3]],[r[2],r[1]],[r[0],r[1]]];e.map?.getLayer("bounds-outline")&&e.map.removeLayer("bounds-outline"),e.map?.getSource("bounds-source")&&e.map.removeSource("bounds-source"),e.map?.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:t}}}),e.map?.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}d();d();var p9=`uniform vec4 uSize;
|
|
13
|
+
varying vec2 vUv;
|
|
14
|
+
void main() {
|
|
15
|
+
vUv = uv;
|
|
16
|
+
// Scale the position by the size of the quad
|
|
17
|
+
// and shift to top left corner for 0,0
|
|
18
|
+
vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);
|
|
19
|
+
// Apply width .x and height .y of image
|
|
20
|
+
transformed += vec2(uSize.x, -uSize.y);
|
|
21
|
+
// Apply left .w and top .z offset
|
|
22
|
+
transformed += vec2(uSize.w, -uSize.z) * 2.0;
|
|
23
|
+
gl_Position = vec4(transformed, 1.0, 1.0);
|
|
24
|
+
}`;d();var d9=`varying vec2 vUv;
|
|
25
|
+
uniform sampler2D uTexture;
|
|
26
|
+
uniform float uOpacity;
|
|
27
|
+
void main() {
|
|
28
|
+
#ifndef debug
|
|
29
|
+
vec4 texture = texture2D(uTexture, vUv);
|
|
30
|
+
gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);
|
|
31
|
+
#else
|
|
32
|
+
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
|
33
|
+
#endif
|
|
34
|
+
}`;d();var u9=4.291666666666667,m9=15,f9=25,h9=43/60;d();var g9=["horizontal","icon"],lU=new Map([[g9[0],`<svg viewBox="0 0 206 48">
|
|
35
|
+
<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"/>
|
|
36
|
+
<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"/>
|
|
37
|
+
<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"/>
|
|
38
|
+
<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"/>
|
|
39
|
+
</svg>`],[g9[1],`<svg viewBox="0 0 43 60">
|
|
40
|
+
<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"/>
|
|
41
|
+
<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"/>
|
|
42
|
+
<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"/>
|
|
43
|
+
</svg>`]]),cU=/<svg([^>]*)>/g;function y9(e,r,t,o){let n=lU.get(e);return n?n.replace(cU,`<svg$1 width="${t}" height="${o}" xmlns="http://www.w3.org/2000/svg" style="fill: ${r};">`):""}var b9=!1,ft,Gs,Rd,dr,io,ic,Zn,Ui,Y1=class extends Ie{constructor(t,o,n){super();S(this,ft,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window?.open("https://www.mappedin.com")},interactive:!0,visible:!0});S(this,Gs);S(this,Rd);S(this,dr);S(this,io);S(this,ic);S(this,Zn,0);S(this,Ui,0);u(this,"dirty",!0);u(this,"getPositionAlignedCanvasCoordinates",(t,o)=>({"top-left":{x:0,y:0},"top-right":{x:t,y:0},"bottom-left":{x:0,y:o},"bottom-right":{x:t,y:o},center:{x:t/2,y:o/2},top:{x:t/2,y:0},bottom:{x:t/2,y:o},left:{x:0,y:o/2},right:{x:t,y:o/2}})[s(this,ft).position]);u(this,"getPositionAlignedPadding",()=>{let t=s(this,ft).padding;if(typeof t=="number")return{"top-left":{x:t,y:t},"top-right":{x:-t,y:t},"bottom-left":{x:t,y:-t},"bottom-right":{x:-t,y:-t},center:{x:0,y:0},top:{x:0,y:t},bottom:{x:0,y:-t},left:{x:t,y:0},right:{x:-t,y:0}}[s(this,ft).position];let o={top:t.top??0,right:t.right??0,bottom:t.bottom??0,left:t.left??0};return{x:o.left-o.right,y:o.top-o.bottom}});n&&Object.entries(n).forEach(([i,a])=>{a!==void 0&&(s(this,ft)[i]=a)}),w(this,Rd,t),w(this,Gs,o)}get color(){return s(this,ft).color==="light"?"white":"#293136"}get iconName(){return s(this,ft).iconOnly?"icon":"horizontal"}get minWidth(){return s(this,ft).iconOnly?m9:75}get defaultWidth(){return s(this,ft).iconOnly?f9:150}get aspectRatio(){return s(this,ft).iconOnly?h9:u9}get options(){return{...s(this,ft)}}set options(t){w(this,ft,{padding:t.padding||s(this,ft).padding,position:t.position||s(this,ft).position,iconOnly:t.iconOnly||s(this,ft).iconOnly,color:t.color||s(this,ft).color,scale:t.scale||s(this,ft).scale,onClick:s(this,ft).onClick,interactive:t.interactive??s(this,ft).interactive,visible:t.visible??s(this,ft).visible})}get icon(){return y9(this.iconName,this.color,s(this,Zn)*s(this,Gs).pixelRatio,s(this,Ui)*s(this,Gs).pixelRatio)}setSize(t,o){s(this,io)&&(s(this,io).uniforms.uSize.value.x=t,s(this,io).uniforms.uSize.value.y=o)}setXY(t,o){s(this,io)&&(s(this,io).uniforms.uSize.value.w=t,s(this,io).uniforms.uSize.value.z=o)}get width(){return s(this,Zn)}get height(){return s(this,Ui)}getPositionAlignedOffset(t,o){return{"top-left":{x:0,y:0},"top-right":{x:-t,y:0},"bottom-left":{x:0,y:-o},"bottom-right":{x:-t,y:-o},center:{x:-(t/2),y:-(o/2)},top:{x:-(t/2),y:0},bottom:{x:-(t/2),y:-o},left:{x:0,y:-(o/2)},right:{x:-t,y:-(o/2)}}[s(this,ft).position]}insertIntoQuadTree(t){s(this,ic)!=null&&typeof s(this,ft).onClick=="function"&&s(this,ft).interactive&&t.insert(s(this,ic))}resize(t,o){if(s(this,ft).visible!==!0)return;let n=this.getPositionAlignedCanvasCoordinates(t,o),i=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(s(this,Zn),s(this,Ui)),l=Math.min(t-s(this,Zn),Math.max(0,n.x+i.x+a.x)),c=Math.min(o-s(this,Ui),Math.max(0,n.y+i.y+a.y));this.setSize(s(this,Zn)/t,s(this,Ui)/o),this.setXY(l/t,c/o),w(this,ic,new qe(l,c,s(this,Zn),s(this,Ui),{entityId:"watermark"}))}update(){this.dirty&&(s(this,ft).visible===!0?(w(this,Zn,Math.min(s(this,Gs).canvasWidth,Math.max(this.minWidth,this.defaultWidth*s(this,ft).scale))),w(this,Ui,s(this,Zn)/this.aspectRatio),Wa.getLoader().load(`data:image/svg+xml;base64,${btoa(this.icon)}`,t=>{if(w(this,io,new ia({uniforms:{uTexture:{value:t},uSize:{value:new u3(0,0,0,0)},uOpacity:{value:.7}},vertexShader:p9,fragmentShader:d9,depthWrite:!1,depthTest:!1,defines:{debug:b9},wireframe:b9,transparent:!0,visible:!0})),s(this,dr))s(this,dr).visible=!0,s(this,dr).material=s(this,io),s(this,dr).material.needsUpdate=!0;else{let o=new ts(2,2,1,1);w(this,dr,new Oe(o,s(this,io))),s(this,dr).position.set(0,0,-1),s(this,dr).frustumCulled=!1,s(this,dr).renderOrder=999;let n=new Sn(1,1,1),i=new Oe(n,new Mr({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));i.frustumCulled=!1,i.layers.set(1),s(this,dr).add(i),s(this,Rd).add(s(this,dr))}this.resize(s(this,Gs).canvasWidth,s(this,Gs).canvasHeight),this.publish("texture-loaded")})):s(this,dr)&&(s(this,dr).visible=!1),this.dirty=!1)}destroy(){s(this,dr)&&(s(this,Rd).remove(s(this,dr)),_t(s(this,dr))),w(this,dr,void 0),s(this,io)&&s(this,io).dispose(),w(this,io,void 0),w(this,ic,void 0)}};ft=new WeakMap,Gs=new WeakMap,Rd=new WeakMap,dr=new WeakMap,io=new WeakMap,ic=new WeakMap,Zn=new WeakMap,Ui=new WeakMap;d();var J1=100,uU=!1,Q1=class extends Ie{constructor(t,o){super();u(this,"currentTotalBoundingBox");u(this,"state");u(this,"cameraSystem");u(this,"debugMesh",null);u(this,"dirty",!0);u(this,"autoMinZoomLevel",!0);this.state=t,this.cameraSystem=o}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new Qt,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new ae(0,0,0),new ae(J1*2,J1*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(J1)));let t=new Qt().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(t);let o=t.getSize(new ae),n=Math.max(o.x,o.y,o.z);for(let a of this.state.geometry2DMap.values())a.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(a.position),a.positionDirty=!1);let i=K1.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(n,J1)).getBoundingSphere(mU).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new ae),min:K1.min,max:K1.max,radius:i},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,uU&&this.state.entityScene.parent instanceof sa){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new es,this.debugMesh.add(new Oe(new Wh(this.cameraSystem.panBounds.radius),new Mr({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let a=new ae;K1.getSize(a);let l=new Sn(a.x,a.y,a.z),c=new Mr({color:65280,wireframe:!0,transparent:!0,opacity:.5}),p=new Oe(l,c);p.position.copy(this.currentTotalBoundingBox.getCenter(new ae)),this.debugMesh.add(p)}}}},K1=new Qt,mU=new f3;d();var uI="\xA9 Mappedin",fU="https://info.mappedin.com/feedback",fI=["top-left","top-right","bottom-left","bottom-right"],hU=640,gU=()=>`<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>
|
|
44
|
+
<circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>
|
|
45
|
+
<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'/>
|
|
46
|
+
</svg>`,mI={custom:[],position:"bottom-right",feedback:!0},_d,q1=class{constructor(r,t={}){u(this,"controlContainerEl");u(this,"controlPositions");u(this,"compact");S(this,_d);u(this,"attribContainerEl");u(this,"attribInnerEl");u(this,"attribButtonEl");u(this,"feedbackLinkEl");u(this,"attribHTML",uI);u(this,"customAttributions",[]);u(this,"toggleAttribution",r=>{this.attribContainerEl!=null&&(r.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",""))))});w(this,_d,!!t.outdoorEnabled),this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),r.appendChild(this.controlContainerEl),this.controlPositions=fI.reduce((o,n)=>{let i=document.createElement("div");return i.classList.add(`mappedin-ctrl-${n}`),this.controlContainerEl.appendChild(i),o[n]=i,o},{})}addAttributionControl(r=mI){let t=r.position&&fI.includes(r.position)?r.position:mI.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib",`mappedin-ctrl-attrib-${t}`),this.attribContainerEl.open=!0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[t].appendChild(this.attribContainerEl),this.attribButtonEl=document.createElement("summary"),this.attribButtonEl.addEventListener("click",this.toggleAttribution),this.attribButtonEl.classList.add("mappedin-ctrl-attrib-button"),this.attribButtonEl.title="Toggle attribution",this.attribButtonEl.ariaLabel="Toggle attribution",this.attribButtonEl.tabIndex=0,this.attribButtonEl.innerHTML=gU(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribHTML=s(this,_d)?uI:"",this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),(r.feedback??mI.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=fU,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)),r.custom&&(this.customAttributions=r.custom),this.updateAttributionDisplay()}updateAttribution(r){if(!r.style||!this.attribInnerEl||!this.attribContainerEl)return;let t=s(this,_d)?[uI]:[],o=r.style.sourceCaches;for(let n in o){let i=o[n];if(i.used||i.usedForTerrain){let a=i.getSource();a.attribution&&t.indexOf(a.attribution)<0&&t.push(a.attribution)}}t=t.filter(n=>String(n).trim()),t=t.filter((n,i)=>{for(let a=i+1;a<t.length;a++)if(t[a].indexOf(n)>=0)return!1;return!0}),this.attribHTML=t.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let r=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=r)}resizeAttribution(r){this.attribContainerEl&&(r<=hU||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(r){this.resizeAttribution(r)}updateData(r){this.updateAttribution(r)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};_d=new WeakMap;d();var pf,df,Bd=class{constructor(r,t){u(this,"mesh");u(this,"type","custom-geometry");u(this,"dirty",!0);u(this,"feature");u(this,"builder");u(this,"outline");S(this,pf,1);u(this,"color",new qt);S(this,df,0);this.mesh=new pa,this.feature=r,this.builder=t}get visible(){return this.mesh.visible}set visible(r){this.mesh.visible=r}set opacity(r){w(this,pf,r)}get opacity(){return s(this,pf)}setColor(r){this.color.set(r)}get position(){return this.mesh?.position}get altitude(){return s(this,df)}set altitude(r){this.mesh&&(this.mesh.position.z=r,w(this,df,r))}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(r){this.mesh&&(this.mesh.renderOrder=r)}};pf=new WeakMap,df=new WeakMap;d();var eb=class{constructor(r,t){u(this,"state");u(this,"convertTo3DMapPosition");this.state=r,this.convertTo3DMapPosition=t}update(){let r,t;for(let o of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(o);n?.type==="custom-geometry"&&(r=n.components[0],t=n.components[1],r.dirty&&t.visible!==!1&&(r.position.copy(this.convertTo3DMapPosition(r.feature.geometry.coordinates[1],r.feature.geometry.coordinates[0],t.altitude)),r.builder.setup(r.mesh),r.mesh.traverse(i=>{i.userData={...i.userData,entityId:o,type:"custom-geometry"}}),r.dirty=!1),t.visible!==!1&&r.builder.update(r.mesh))}}};d();d();function x9(e){return e.children.some(r=>r.userData.isOutline)}function v9(e,r){let t=e.userData.entities3D.values().next().value;return t?r.geometry3DMap.get(t)?.components[3]!==void 0:!1}function tb(e,r,t,o){let i=e.getAttribute("position").array,a=-1/0;for(let l=0;l<r.count;l++){let p=(r.start+l)*3,m=i[p+2];a=Math.max(a,m)}for(let l=0;l<r.count;l++){let p=(r.start+l)*3,m=i[p+2];Math.abs(m-a)<1e-4?i[p+2]=Math.max(t+o,2e-4+o):i[p+2]=o}e.attributes.position.needsUpdate=!0}d();function hI(e){let r=new Vh,t=e.mesh?.geometry;if(!t||!e.batchedProps?.range)return;let o=e.batchedProps.range,n=o.start,i=o.count,a=t.getAttribute("position");if(a){let p=new Float32Array(i*3);for(let m=0;m<i;m++){let f=n+m;p[m*3]=a.array[f*3],p[m*3+1]=a.array[f*3+1],p[m*3+2]=a.array[f*3+2]}r.setAttribute("position",new Yr(p,3))}let l=t.getAttribute("normal");if(l){let p=new Float32Array(i*3);for(let m=0;m<i;m++){let f=n+m;p[m*3]=l.array[f*3],p[m*3+1]=l.array[f*3+1],p[m*3+2]=l.array[f*3+2]}r.setAttribute("normal",new Yr(p,3))}let c=t.getAttribute("uv");if(c){let p=new Float32Array(i*2);for(let m=0;m<i;m++){let f=n+m;p[m*2]=c.array[f*2],p[m*2+1]=c.array[f*2+1]}r.setAttribute("uv",new Yr(p,2))}if(t.index){let p=t.index,m=new Uint32Array(i);for(let f=0;f<i;f++)m[f]=p.array[n+f];r.setIndex(new Yr(m,1))}return r}function I9(e,r){let t=hI(e);if(!t||!e.mesh)return;e.mesh.deleteInstance(e.instanceIndex),e.mesh.optimize();let o=r.addGeometry(t);r.addInstance(o);let n=r.getGeometryIdAt(o),i=r.getGeometryRangeAt(n);return i&&e.batchedProps&&(e.batchedProps.range=i),t.dispose(),o}d();d();var S9=`// Modified from https://github.com/mrdoob/three.js/blob/dev/src/renderers/shaders/ShaderLib/linedashed.glsl.js
|
|
47
|
+
uniform float scale;
|
|
48
|
+
attribute float lineDistance;
|
|
49
|
+
|
|
50
|
+
varying float vLineDistance;
|
|
51
|
+
attribute float visibility;
|
|
52
|
+
varying vec4 v_color;
|
|
53
|
+
|
|
54
|
+
#include <common>
|
|
55
|
+
#include <uv_pars_vertex>
|
|
56
|
+
#include <color_pars_vertex>
|
|
57
|
+
#include <fog_pars_vertex>
|
|
58
|
+
#include <morphtarget_pars_vertex>
|
|
59
|
+
#include <logdepthbuf_pars_vertex>
|
|
60
|
+
#include <clipping_planes_pars_vertex>
|
|
61
|
+
|
|
62
|
+
void main() {
|
|
63
|
+
|
|
64
|
+
vLineDistance = scale * lineDistance;
|
|
65
|
+
v_color = color;
|
|
66
|
+
|
|
67
|
+
#include <uv_vertex>
|
|
68
|
+
#include <color_vertex>
|
|
69
|
+
#include <morphinstance_vertex>
|
|
70
|
+
#include <morphcolor_vertex>
|
|
71
|
+
#include <begin_vertex>
|
|
72
|
+
#include <morphtarget_vertex>
|
|
73
|
+
#include <project_vertex>
|
|
74
|
+
if (visibility < 0.5) {
|
|
75
|
+
gl_Position = vec4(-2.0, -2.0, -2.0, 1.0);
|
|
76
|
+
}
|
|
77
|
+
#include <logdepthbuf_vertex>
|
|
78
|
+
#include <clipping_planes_vertex>
|
|
79
|
+
#include <fog_vertex>
|
|
80
|
+
|
|
81
|
+
}`;d();var C9=`// Modified from https://github.com/mrdoob/three.js/blob/dev/src/renderers/shaders/ShaderLib/linedashed.glsl.js
|
|
82
|
+
uniform vec3 diffuse;
|
|
83
|
+
uniform float opacity;
|
|
84
|
+
|
|
85
|
+
uniform float dashSize;
|
|
86
|
+
uniform float totalSize;
|
|
87
|
+
|
|
88
|
+
varying float vLineDistance;
|
|
89
|
+
varying vec4 v_color;
|
|
90
|
+
|
|
91
|
+
#include <common>
|
|
92
|
+
#include <color_pars_fragment>
|
|
93
|
+
#include <uv_pars_fragment>
|
|
94
|
+
#include <map_pars_fragment>
|
|
95
|
+
#include <fog_pars_fragment>
|
|
96
|
+
#include <logdepthbuf_pars_fragment>
|
|
97
|
+
#include <clipping_planes_pars_fragment>
|
|
98
|
+
|
|
99
|
+
void main() {
|
|
100
|
+
|
|
101
|
+
vec4 diffuseColor = vec4( diffuse, opacity );
|
|
102
|
+
#include <clipping_planes_fragment>
|
|
103
|
+
|
|
104
|
+
if ( mod( vLineDistance, totalSize ) > dashSize ) {
|
|
105
|
+
|
|
106
|
+
discard;
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
vec3 outgoingLight = vec3( 0.0 );
|
|
111
|
+
|
|
112
|
+
#include <logdepthbuf_fragment>
|
|
113
|
+
#include <map_fragment>
|
|
114
|
+
#include <color_fragment>
|
|
115
|
+
|
|
116
|
+
outgoingLight = diffuseColor.rgb; // simple shader
|
|
117
|
+
|
|
118
|
+
#include <opaque_fragment>
|
|
119
|
+
#include <tonemapping_fragment>
|
|
120
|
+
#include <colorspace_fragment>
|
|
121
|
+
#include <fog_fragment>
|
|
122
|
+
#include <premultiplied_alpha_fragment>
|
|
123
|
+
|
|
124
|
+
// Discard alpha lower than 0.01 to avoid opacity fighting
|
|
125
|
+
if (v_color.a <= 0.01) {
|
|
126
|
+
discard;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
`;var rb=class extends y3{constructor(r){super(r),this.onBeforeCompile=t=>{t.vertexShader=S9,t.fragmentShader=C9}}};var xU=80,sc,Nd,nb,ib,ob=class{constructor(r){u(this,"rendererState");u(this,"outlineOpacitiesDirty",!0);S(this,sc,!0);S(this,Nd,-1/0);S(this,nb,new Map);S(this,ib,new rb({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:fu}));this.rendererState=r}get geometries3DDirty(){return s(this,sc)}set geometries3DDirty(r){w(this,sc,r)}update(r,t=!0){let o;if(this.geometries3DDirty){for(let i of this.rendererState.geometry3DIdsInScene){let a=this.rendererState.geometry3DMap.get(i);if(a instanceof Cn&&v9(a,this.rendererState)&&!x9(a)&&a.userData.entities3D.size>0){let l=[];for(let v of a.userData.entities3D.values()){let I=this.rendererState.geometry3DMap.get(v);if(I instanceof yt&&I.type==="geometry"&&I.components[3]&&I.components[3].dirty===!0&&I.components[0].material!=null){let M=I.components[0].geometry,O=!1;M||(M=hI(I.components[0]),O=!0);let T=I.components[1];l.push([I.components[3],new x3(M,T.bevel?.enabled?1:xU)]),O&&(M?.dispose(),M=void 0)}}if(l.length===0)continue;let c=mi(l.map(v=>v[1]),!1);if(c==null)continue;let p=c.getAttribute("position"),m=new Float32Array(p.count*4),f=new Yr(m,4);c.setAttribute("color",f);let g=new Uint8Array(p.count);g.fill(0);let b=new Yr(g,1,!1);c.setAttribute("visibility",b);let x=0;for(let v=0;v<l.length;v++){let[I,M]=l[v],O=M.getAttribute("position").count;I.edgeColors=f,I.edgeVisibility=b,I.geometry=c,I.ranges={count:O,start:x},x+=O,M.dispose()}let C=new gu(c,s(this,ib));C.userData.isOutline=!0,a.add(C)}}w(this,sc,!1),this.outlineOpacitiesDirty=!0}for(let i of this.rendererState.geometry3DIdsInScene){let a=this.rendererState.geometry3DMap.get(i);if(a instanceof yt&&a.type==="geometry"&&a.components[3]&&a.components[3].dirty===!0&&a.components[0].material!=null&&a.parentObject3D instanceof Cn){let l=a.components[3].geometry;if(!l)continue;let c=a.components[3];if(!c)continue;let p=c.enabled&&a.components[1].visible;if(c.visible!==p&&(c.visible=p),!c.visible)continue;let m=c.edgeColors;if(!m||!c.ranges)continue;let f=new qt(c.color);for(let C=0;C<c.ranges.count;C++){let v=c.ranges.start+C;m.setXYZ(v,f.r,f.g,f.b)}let g=a.components[1].height,b=a.components[1].altitude;a.components[1]?.bevel?.enabled||tb(l,c.ranges,g,b),l.attributes.color.needsUpdate=!0,l.computeBoundingSphere(),c.dirty=!1}}let n=t?cl(r,16,19,0,1):s(this,Nd);if((n!==s(this,Nd)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let i of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(i),o?.type==="geometry"&&o.components[0]instanceof or){let a=o.components[3];if(a&&a.edgeColors&&a.geometry&&a.visible){let l=Math.min(n,o.components[1].opacity*jc(o));if(a.currentOpacity!==l){for(let c=0;c<a.ranges.count;c++){let p=a.ranges.start+c;a.edgeColors.setW(p,l)}a.geometry.attributes.color.needsUpdate=!0}}}}w(this,Nd,n),w(this,sc,!1),this.outlineOpacitiesDirty=!1}destroy(){s(this,nb).clear()}};sc=new WeakMap,Nd=new WeakMap,nb=new WeakMap,ib=new WeakMap;d();d();var sb=class extends Oe{constructor(){super(...arguments);u(this,"userData",{entityId:""})}},vU=D.object({flipImageToFaceCamera:D.boolean().optional(),url:D.string()}),IU=D.object({type:D.enum(["Feature"]),properties:D.object({width:D.number(),height:D.number(),rotation:D.number().min(0).max(360).optional(),verticalOffset:D.number().optional()}),geometry:kd});function T9(e,r,t){D.union([D.number(),D.string()]).parse(e),IU.parse(r),vU.parse(t)}var ab=class{constructor(r){u(this,"mesh",new pa);u(this,"imageMesh");u(this,"outline");u(this,"type","image");u(this,"instanceIndex",-1);u(this,"geometry");u(this,"material");u(this,"feature");u(this,"position",new ae);this.feature=r}get visible(){return this.mesh?.visible??!1}set visible(r){this.mesh&&(this.mesh.visible=r)}};d();function gI(e,r){return{x:e.x*Math.cos(r)-e.y*Math.sin(r),y:e.x*Math.sin(r)+e.y*Math.cos(r)}}function SU(e,r){return e.map(t=>gI(t,r))}function CU(e){let r=1/0,t=1/0,o=-1/0,n=-1/0;for(let i of e)r=Math.min(r,i.x),t=Math.min(t,i.y),o=Math.max(o,i.x),n=Math.max(n,i.y);return{minX:r,minY:t,maxX:o,maxY:n}}function TU(e,r){let t=!1;for(let o=0,n=r.length-1;o<r.length;n=o++){let i=r[o].x,a=r[o].y,l=r[n].x,c=r[n].y;a>e.y!=c>e.y&&e.x<(l-i)*(e.y-a)/(c-a)+i&&(t=!t)}return t}function M9(e,r,t,o,n){for(let i=0;i<n;i++)for(let a=0;a<o;a++)if(e[t+i][r+a]!==1)return!1;return!0}function MU(e,r,t){let o=e.maxX-e.minX,n=e.maxY-e.minY,i,a,l={...e};return o/n>r?(a=n/t,i=a*r,l.minX+=(o-i*t)/2):(i=o/t,a=i/r,l.minY+=(n-a*t)/2),{dx:i,dy:a,gridBounds:l}}function wU(e,r,t,o,n){let i=Array(t).fill(0).map(()=>Array(t).fill(0));for(let a=0;a<t;a++)for(let l=0;l<t;l++){let c={x:r.minX+l*o,y:r.minY+a*n};TU(c,e)&&(i[a][l]=1)}return i}function OU(e,r){let t=Array(r).fill(0).map(()=>Array(r).fill(0));for(let o=0;o<r;o++)for(let n=0;n<r;n++)if(e[o][n]===1){let i=0;for(let a=1;a<=Math.min(r-n,r-o)&&M9(e,n,o,a,a);a++)i=a;t[o][n]=i}return t}function PU(e,r,t,o,n,i){let a=0,l=0,c=0;for(let p=0;p<o;p++)for(let m=0;m<o;m++)if(e[p][m]===1){let f=Math.pow(r[p][m],2),g=t.minX+m*n,b=t.minY+p*i;a+=f,l+=g*f,c+=b*f}return{x:l/a,y:c/a}}function FU(e,r,t,o,n,i,a){let l=-1/0,c=null,p=e.length,m=Math.sqrt(Math.pow(r.maxX-r.minX,2)+Math.pow(r.maxY-r.minY,2));for(let f=0;f<p;f++)for(let g=0;g<p;g++)if(e[f][g]===1)for(let b=1;b<=p-g;b++){let x=b;if(!(x>p-f)&&M9(e,g,f,b,x)){let C=b*x,v=r.minX+(g+b/2)*t,I=r.minY+(f+x/2)*o,M={x:v,y:I},T=Math.sqrt(Math.pow(M.x-n.x,2)+Math.pow(M.y-n.y,2))/m,P=C*(1-i)-T*i*C;P>l&&(l=P,c={center:M,width:b*t*a,height:b*o*a})}}return c}function yI(e,r,t,o={}){let{scaleFactor:n=.9,centerPriority:i=.5,resolution:a=100,minimumSizeRatio:l=.5}=o,c=O3(t),p=e.width/e.height,m=SU(r,c),f=CU(m),{dx:g,dy:b,gridBounds:x}=MU(f,p,a),C=wU(m,x,a,g,b),v=OU(C,a),I=PU(C,v,x,a,g,b),M=FU(C,x,g,b,I,i,n);return!M||M.width<e.width*l||M.height<e.height*l?e:{...M,center:gI(M.center,-c),rotation:t,polygonCenter:gI(I,-c)}}var uf=Math.PI*2,EU=Math.PI/2,DU=Math.PI*1.5,kU=ci(EU,2),LU=ci(DU,2),AU=.01,w9=!1,lb=class extends Ie{constructor(t,o,n=0,i=0,a={}){super();u(this,"rendererState");u(this,"convertTo3DMapPosition");u(this,"initialBearing",0);u(this,"naturalBearing",0);u(this,"imagePlacementOptions");u(this,"imageLoadingCache",new Map);this.rendererState=t,this.convertTo3DMapPosition=o,this.initialBearing=n,this.naturalBearing=i,this.imagePlacementOptions=a}createImageMesh(t,o,n,i=0,a,l){let c={width:n.width,height:n.height,center:this.convertTo3DMapPosition(a),rotation:n.rotation??0},p=this.imagePlacementOptions.mode??"default",m=(()=>{switch(p){case"fit-nearest-90":let x=(this.initialBearing-this.naturalBearing+360)%180;return x>=45&&x<=135?yI(c,l,c.rotation+90,this.imagePlacementOptions):c;case"fit-initial-bearing":return yI(c,l,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return c}})();if(w9&&m.polygonCenter){let x=new Oe(new Wh(1),new si({color:65280}));x.position.set(m.polygonCenter.x,m.polygonCenter.y,i),this.rendererState.entityScene.add(x)}let f=new si({transparent:!0,depthWrite:!1,side:Qi}),g=new ts(m.width,m.height),b=new sb(g);if(b.visible=!1,b.renderOrder=1,this.getOrDownloadImage(o)?.then(x=>{f.map=x,f.needsUpdate=!0,f.map.colorSpace=Nh,b.visible=!0,this.publish("image-loaded")}),b.userData.entityId=t,b.material=f,w9){let x=new Oe(new ts(n.width,n.height),new si({color:"gray"}));b.add(x);let C=new T3;b.add(C),C.scale.set(10,10,10)}return b.position.set(m.center.x,m.center.y,i+AU),b.rotation.z=(-Le.degToRad(m.rotation)+uf)%uf,b}getOrDownloadImage(t){if(this.imageLoadingCache.has(t))return this.imageLoadingCache.get(t)?.promise;{let o=new Promise(n=>{Wa.getLoader().load(t,i=>{let a=this.imageLoadingCache.get(t);a&&!a.loaded&&(a.loaded=!0),n(i)})});return this.imageLoadingCache.set(t,{loaded:!1,promise:o}),o}}flipIfNeeded(t,o){if(t.imageMesh==null)return;let n=-o,i=t.imageMesh.rotation.z,a=ci((i-n+uf)%uf,2);a>kU&&a<LU&&(t.imageMesh.rotation.z=(i+Math.PI)%uf)}update(t){let o,n,i;for(let a of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(a),o?.type==="image"){if(n=o.components[0],i=o.components[1],i.url&&n.imageMesh==null){let l=this.convertTo3DMapPosition(n.feature.geometry.coordinates),c={x:l.x,y:l.y};n.imageMesh=this.createImageMesh(o.id,i.url,n.feature.properties,n.feature.properties.verticalOffset,n.feature.geometry.coordinates,[c]),n.mesh.add(n.imageMesh),n.position.copy(n.imageMesh.position)}n.imageMesh&&(i.flipImageToFaceCamera&&this.flipIfNeeded(n,t),n.imageMesh.material instanceof si&&i.dirty&&(n.imageMesh.material.opacity=i.opacity))}else if(o?.type==="geometry"){if(n=o.components[0],i=o.components[1],i.showImage&&n.feature.properties?.image&&n.imageMesh==null&&n.visible&&n.mesh!=null&&n.mesh.parent!=null&&n.feature.properties?.image.position!=null&&n.feature.geometry.coordinates!=null&&n.feature.geometry.coordinates.length>0){let l=n.feature.geometry.coordinates[0].map(p=>{let m=this.convertTo3DMapPosition(p);return{x:m.x,y:m.y}}),c=this.createImageMesh(a,n.feature.properties?.image.path,n.feature.properties?.image,i.height,n.feature.properties?.image.position,l);n.mesh.parent.add(c),n.imageMesh=c}if(n.imageMesh){if(!n.visible)n.imageMesh.visible=!1;else if(i.showImage&&!n.imageMesh.visible)if(i.url){let l=this.imageLoadingCache.get(i.url);l&&l.loaded&&(n.imageMesh.visible=!0)}else n.imageMesh.visible=!0;else!i.showImage&&n.imageMesh.visible&&(n.imageMesh.visible=!1);i.flipImageToFaceCamera&&this.flipIfNeeded(n,t)}}}};d();var RU=250,Za,cb=class extends Ie{constructor(t,o){super();u(this,"cameraDirty",!0);u(this,"focusablesDirty",!0);u(this,"state");u(this,"camera");u(this,"debugEl",null);u(this,"raycasters",[]);u(this,"collisions",new Map);u(this,"focusableEntities",new Set);u(this,"debugRaycasters",!1);S(this,Za);u(this,"update",(t=!1,o=Date.now())=>{this.focusablesDirty&&this.updateFocusableEntities(),!t&&(Date.now()-o>RU||(s(this,Za)&&cancelAnimationFrame(s(this,Za)),w(this,Za,requestAnimationFrame(()=>{this.updateRaf()}))))});this.state=t,this.camera=o,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let t=new Se(this.state.canvasWidth/2,this.state.canvasHeight/2),o=new Se(t.x/1.2,t.y/1.2),n=new Se(t.x+(t.x-o.x),o.y),i=new Se(o.x,t.y+(t.y-o.y)),a=new Se(n.x,i.y),l=new Se(t.x,t.y/1.5),c=new Se(t.x,t.y+(t.y-l.y));this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[t,l,c,o,n,i,a].map((p,m)=>{if(this.debugRaycasters){let C=document.createElement("div");C.style.position="absolute",C.style.top=p.y+"px",C.style.left=p.x+"px",C.style.width="10px",C.style.height="10px",C.style.backgroundColor="red",this.debugEl.append(C)}let f=p.x/this.state.canvasWidth*2-1,g=-(p.y/this.state.canvasHeight)*2+1,b=new Se(f,g),x=new ai;return x.setFromCamera(b,this.camera),[x,b,m===0?10:m<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let t,o,n;for(let i of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(i),n!=null){if(n.type==="group-container"&&n.components[1]!==void 0&&n.components[1]instanceof Tu){if(o=n.components[1],o.dirty===!0||o.focusMesh==null){o.focusMesh&&_t(o.focusMesh);let a=new Qt;a.setFromObject(n);let l=a.max.x-a.min.x,c=a.max.y-a.min.y,p=a.max.z-a.min.z;if(!isFinite(l)||!isFinite(c)||!isFinite(p)||isNaN(l)||isNaN(c)||isNaN(p)||l<=0||c<=0||p<=0)continue;let m=new Sn(l,c,p),f={transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters};if(this.debugRaycasters){let x=["red","green","blue","yellow","purple","orange","pink","brown","gray","black"];f.color=x[Math.floor(Math.random()*x.length)]}let g=new Mr(f),b=new Oe(m,g);b.position.set((a.min.x+a.max.x)/2,(a.min.y+a.max.y)/2,0),b.userData={entityId:n.userData.entityId},o.focusMesh=b,n.add(b),n.components[1].dirty=!1}this.focusableEntities.add(o.focusMesh)}else if(n.type==="geometry"&&n.components[4]&&n.components[4]instanceof Tu&&(t=n.components[0],o=n.components[4],t instanceof or&&t.geometry!=null&&(o.dirty===!0||o.focusMesh==null))){if(o.focusMesh==null){let a=new Oe(t.geometry);a.userData={entityId:n.id},o.focusMesh=a}this.focusableEntities.add(o.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.cameraDirty&&this.raycast()}raycast(){this.collisions.clear();for(let[o,n]of this.raycasters)o.setFromCamera(n,this.camera);for(let[o,n,i]of this.raycasters)o.intersectObjects(Array.from(this.focusableEntities.values())).forEach(l=>{if(l?.object!=null&&"isMesh"in l.object&&l?.object.isMesh){let c=l.object.userData.entityId,p=this.collisions.get(c)??0;this.collisions.set(c,p+i)}});let t=Array.from(this.collisions,([o,n])=>({entityId:o,weight:n})).sort((o,n)=>n.weight-o.weight).map(({entityId:o})=>o);this.publish("geometry-in-focus",t),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){s(this,Za)&&cancelAnimationFrame(s(this,Za)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Za=new WeakMap;d();d();d();d();function pb(e,r){r===void 0&&(r={});var t=Np(e);switch(!r.properties&&e.type==="Feature"&&(r.properties=e.properties),t.type){case"Polygon":return _U(t,r);case"MultiPolygon":return BU(t,r);default:throw new Error("invalid poly")}}function _U(e,r){r===void 0&&(r={});var t=Np(e),o=t.coordinates,n=r.properties?r.properties:e.type==="Feature"?e.properties:{};return O9(o,n)}function BU(e,r){r===void 0&&(r={});var t=Np(e),o=t.coordinates,n=r.properties?r.properties:e.type==="Feature"?e.properties:{},i=[];return o.forEach(function(a){i.push(O9(a,n))}),pl(i)}function O9(e,r){return e.length>1?A3(e,r):os(e[0],r)}function NU(e,r){var t=!0;return di(e,function(o){di(r,function(n){if(t===!1)return!1;t=jU(o.geometry,n.geometry)})}),t}function jU(e,r){switch(e.type){case"Point":switch(r.type){case"Point":return!HU(e.coordinates,r.coordinates);case"LineString":return!P9(r,e);case"Polygon":return!_s(e,r)}break;case"LineString":switch(r.type){case"Point":return!P9(e,r);case"LineString":return!GU(e,r);case"Polygon":return!F9(r,e)}break;case"Polygon":switch(r.type){case"Point":return!_s(r,e);case"LineString":return!F9(e,r);case"Polygon":return!UU(r,e)}}return!1}function P9(e,r){for(var t=0;t<e.coordinates.length-1;t++)if(VU(e.coordinates[t],e.coordinates[t+1],r.coordinates))return!0;return!1}function GU(e,r){var t=Up(e,r);return t.features.length>0}function F9(e,r){for(var t=0,o=r.coordinates;t<o.length;t++){var n=o[t];if(_s(n,e))return!0}var i=Up(r,pb(e));return i.features.length>0}function UU(e,r){for(var t=0,o=e.coordinates[0];t<o.length;t++){var n=o[t];if(_s(n,r))return!0}for(var i=0,a=r.coordinates[0];i<a.length;i++){var l=a[i];if(_s(l,e))return!0}var c=Up(pb(e),pb(r));return c.features.length>0}function VU(e,r,t){var o=t[0]-e[0],n=t[1]-e[1],i=r[0]-e[0],a=r[1]-e[1],l=o*a-n*i;return l!==0?!1:Math.abs(i)>=Math.abs(a)?i>0?e[0]<=t[0]&&t[0]<=r[0]:r[0]<=t[0]&&t[0]<=e[0]:a>0?e[1]<=t[1]&&t[1]<=r[1]:r[1]<=t[1]&&t[1]<=e[1]}function HU(e,r){return e[0]===r[0]&&e[1]===r[1]}var E9=NU;function bI(e,r){var t=!1;return di(e,function(o){di(r,function(n){if(t===!0)return!0;t=!E9(o.geometry,n.geometry)})}),t}var D9=20,$U=5e3,xI="outdoor-system-debug-container",k9=!1,Xn,At,mf,ac,Yn,jd,Xa,lc,fn,Gd,ff,hf,gf,Vi,db,cc,Jn,Ya,Ja,pc,mb,yf,bf,L9,A9,ub=class{constructor(r){S(this,Vi);S(this,Xn,!0);S(this,At);S(this,mf,"");S(this,ac,new Set);S(this,Yn,new Set);S(this,jd);S(this,Xa);S(this,lc);S(this,fn,null);S(this,Gd,!1);S(this,ff,r=>{if(!s(this,At))throw new Error("Map not initialized");let o=[[r[0],r[1]],[r[2],r[1]],[r[2],r[3]],[r[0],r[3]]].map(c=>s(this,At).project(c)),n=Math.max(...o.map(c=>c.x)),i=Math.min(...o.map(c=>c.x)),a=Math.max(...o.map(c=>c.y)),l=Math.min(...o.map(c=>c.y));return[new o0.default(i,l),new o0.default(n,a)]});S(this,hf,()=>{s(this,fn)&&(clearTimeout(s(this,fn)),w(this,fn,null),w(this,Xn,!1))});S(this,gf,()=>{s(this,fn)&&(clearTimeout(s(this,fn)),w(this,fn,null)),w(this,fn,setTimeout(()=>{s(this,hf).call(this)},$U))});S(this,cc,async()=>{if(k9&&s(this,Xa)){let r=s(this,ff).call(this,s(this,Xa));W(this,Vi,A9).call(this,r)}if(!(!s(this,At)||!s(this,Gd))&&s(this,Xn)&&!(!s(this,Yn)||s(this,Yn).size===0)){if(s(this,Ya)&&(s(this,mb).call(this),w(this,Ya,!1)),s(this,jd)){let r=s(this,At).project(s(this,jd)),t=s(this,At).queryRenderedFeatures(r,{layers:Array.from(s(this,Yn))});if(t.length>0){for(let o of t)s(this,Jn).push(["!=",["id"],o.id]);s(this,Jn).length>0&&s(this,Yn).forEach(o=>{s(this,At)?.setFilter(o,["all",...s(this,Jn)])}),w(this,Jn,[]),w(this,Ya,!1),w(this,Xn,!1)}}else if(s(this,Xa)&&s(this,lc)){let r=s(this,ff).call(this,s(this,Xa)),t=s(this,At).queryRenderedFeatures(r,{layers:Array.from(s(this,Yn))});if(t.length>0){w(this,Ya,!0),s(this,Ja).push(()=>{s(this,Jn).length>0&&(s(this,Yn).forEach(o=>{s(this,At)?.setFilter(o,["all",...s(this,Jn)])}),w(this,Xn,!1)),w(this,Jn,[])});for(let o=0;o<t.length;o+=D9){let n=t.slice(o,o+D9);s(this,Ja).push(()=>{for(let i of n)if(i.geometry!=null&&"coordinates"in i.geometry){if(s(this,lc)==null)return;let a;if(i.geometry.type==="Polygon"?a=Kh(i.geometry.coordinates):i.geometry.type==="MultiPolygon"&&(a=R3(i.geometry.coordinates)),!a)continue;for(let l of s(this,lc))if(bI(l,a)){s(this,Jn).push(["!=",["id"],i.id]);continue}}})}s(this,yf).call(this)}}}});S(this,Jn,[]);S(this,Ya,!1);S(this,Ja,[]);S(this,pc,null);S(this,mb,()=>{s(this,pc)&&(globalThis.cancelAnimationFrame(s(this,pc)),w(this,pc,null)),w(this,Ja,[])});S(this,yf,()=>{let r=s(this,Ja).pop();typeof r=="function"&&(r(),s(this,Ja).length>0&&w(this,pc,globalThis.requestAnimationFrame(s(this,yf)))),w(this,Ya,!1),s(this,hf).call(this)});S(this,bf,r=>{if(s(this,At)&&r&&r.dataType==="style"&&r.type==="styledata"&&s(this,ac).size>0){let t=r?.style?.stylesheet?.id;(!t||t!==s(this,mf))&&(w(this,mf,t),W(this,Vi,db).call(this),w(this,Xn,!0))}});r&&(w(this,At,r),s(this,At).on("styledata",s(this,bf)),s(this,At).on("render",s(this,cc)),w(this,Gd,s(this,At).loaded()),s(this,At).on("load",()=>{w(this,Gd,!0)})),k9&&W(this,Vi,L9).call(this)}hideLayersUnderPoint(r,t){s(this,gf).call(this),w(this,jd,r);for(let o of t)s(this,ac).add(o);w(this,Xn,!0),W(this,Vi,db).call(this),s(this,cc).call(this)}hideLayersIntersectingPolygons(r,t,o){s(this,fn)&&clearTimeout(s(this,fn)),s(this,gf).call(this),w(this,Xa,r),w(this,lc,t.reduce((n,i)=>{if(i.geometry.type==="Polygon"){let a=Kh(i.geometry.coordinates);n.push(a)}else i.geometry.type==="MultiPolygon"&&n.push(...i.geometry.coordinates.map(a=>Kh(a)));return n},[]));for(let n of o)s(this,ac).add(n);w(this,Xn,!0),W(this,Vi,db).call(this),s(this,cc).call(this)}destroy(){s(this,At)&&(s(this,At).off("styledata",s(this,bf)),s(this,At).off("render",s(this,cc)))}};Xn=new WeakMap,At=new WeakMap,mf=new WeakMap,ac=new WeakMap,Yn=new WeakMap,jd=new WeakMap,Xa=new WeakMap,lc=new WeakMap,fn=new WeakMap,Gd=new WeakMap,ff=new WeakMap,hf=new WeakMap,gf=new WeakMap,Vi=new WeakSet,db=function(){if(w(this,Yn,new Set),s(this,At))for(let r of s(this,ac))s(this,At).getLayer(r)&&s(this,Yn).add(r)},cc=new WeakMap,Jn=new WeakMap,Ya=new WeakMap,Ja=new WeakMap,pc=new WeakMap,mb=new WeakMap,yf=new WeakMap,bf=new WeakMap,L9=function(){if(!document.getElementById(xI)&&s(this,At)){let r=document.createElement("div");r.id=xI,r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.bottom="0",r.style.right="0",r.style.pointerEvents="none",r.style.zIndex="1000",s(this,At).getContainer().appendChild(r)}},A9=function(r){let t=document.getElementById(xI);if(!t)return;let o=document.getElementById("bbox");o==null&&(o=document.createElement("div"),o.id="bbox",o.style.position="absolute",t.appendChild(o));let n=[Math.min(r[0].x,r[1].x),Math.min(r[0].y,r[1].y)],i=[Math.max(r[0].x,r[1].x),Math.max(r[0].y,r[1].y)];o.style.top=n[1]+"px",o.style.left=n[0]+"px",o.style.width=i[0]-n[0]+"px",o.style.height=i[1]-n[1]+"px",o.style.border=`2px solid ${s(this,Xn)?"red":"blue"}`};d();d();d();d();var fb=`attribute float pathDistance;
|
|
130
|
+
attribute vec3 pathNormal;
|
|
131
|
+
attribute vec3 pathTangent;
|
|
132
|
+
|
|
133
|
+
uniform vec2 uvScale;
|
|
134
|
+
uniform float vertexes;
|
|
135
|
+
uniform float complete;
|
|
136
|
+
uniform float nearRadius;
|
|
137
|
+
uniform float farRadius;
|
|
138
|
+
uniform float nearZoom;
|
|
139
|
+
uniform float farZoom;
|
|
140
|
+
uniform float pulse;
|
|
141
|
+
uniform float pulseLength;
|
|
142
|
+
uniform bool pathIsVertical;
|
|
143
|
+
uniform bool displayArrowsOnPath;
|
|
144
|
+
uniform vec2 cameraParameters;
|
|
145
|
+
uniform float flattenFactor;
|
|
146
|
+
|
|
147
|
+
varying float zoomLevel;
|
|
148
|
+
varying float radius;
|
|
149
|
+
varying vec2 fragTexcoord;
|
|
150
|
+
varying float fragTopTextureU;
|
|
151
|
+
varying float fragPathDistance;
|
|
152
|
+
|
|
153
|
+
// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using
|
|
154
|
+
// linear interpolation/extrapolation.
|
|
155
|
+
//
|
|
156
|
+
// This performs a pure linear mapping y = mx + b where
|
|
157
|
+
// 'm = (yMax - yMin) / (xMax - xMin)',
|
|
158
|
+
// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.
|
|
159
|
+
float remap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
160
|
+
return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear
|
|
164
|
+
// interpolation, clamping result values outside [yMin, yMax].
|
|
165
|
+
float clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
166
|
+
return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
void main() {
|
|
170
|
+
fragPathDistance = pathDistance;
|
|
171
|
+
|
|
172
|
+
// We can get an origin point for the cross-section of the path by
|
|
173
|
+
// subtracting the surface normal times the radius, since the surface normal
|
|
174
|
+
// points strictly away from the centre.
|
|
175
|
+
vec3 origin = position - nearRadius * normal;
|
|
176
|
+
|
|
177
|
+
// Inflate the path along its surface normal to increase its radius from
|
|
178
|
+
// 'nearRadius' to 'farRadius' when the camera is at 'farZoom'.
|
|
179
|
+
vec3 adjustedPosition = position;
|
|
180
|
+
zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);
|
|
181
|
+
adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;
|
|
182
|
+
|
|
183
|
+
// Determine how far the path extends "up" or "down" in the direction of the
|
|
184
|
+
// path normal.
|
|
185
|
+
float height = dot(adjustedPosition - origin, pathNormal);
|
|
186
|
+
|
|
187
|
+
// Flatten the bottom half of the path entirely so that it's flat
|
|
188
|
+
// against the floor. This makes the path look nicer when it's
|
|
189
|
+
// semitransparent behind opaque geometry, so you don't see it
|
|
190
|
+
// peeking through.
|
|
191
|
+
float desiredHeight = max(height, 0.0);
|
|
192
|
+
|
|
193
|
+
desiredHeight = desiredHeight * flattenFactor;
|
|
194
|
+
|
|
195
|
+
float flattenMagnitude = height - desiredHeight;
|
|
196
|
+
adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;
|
|
197
|
+
|
|
198
|
+
// Transform the vertices into NDC.
|
|
199
|
+
vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);
|
|
200
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
201
|
+
|
|
202
|
+
fragTexcoord = uv;
|
|
203
|
+
|
|
204
|
+
// Compute a texture coordinate for mapping the arrow texture to the path.
|
|
205
|
+
// We don't want to use the u-value that Three.js provides, because the
|
|
206
|
+
// path may end up twisting arbitrarily -- but we want the arrow texture to
|
|
207
|
+
// always be on the top of the path.
|
|
208
|
+
vec3 bitangent = cross(normal, pathTangent);
|
|
209
|
+
fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;
|
|
210
|
+
|
|
211
|
+
radius = mix(nearRadius, farRadius, zoomLevel);
|
|
212
|
+
}
|
|
213
|
+
`;d();var vI=`#define ARROW_FADING_POINT 0.15
|
|
214
|
+
|
|
215
|
+
uniform float complete;
|
|
216
|
+
uniform float nearRadius;
|
|
217
|
+
uniform float farRadius;
|
|
218
|
+
uniform vec2 resolution;
|
|
219
|
+
uniform vec2 cameraParameters;
|
|
220
|
+
uniform vec3 color;
|
|
221
|
+
uniform float pathLength;
|
|
222
|
+
uniform bool showPulse;
|
|
223
|
+
uniform vec3 pulseColor;
|
|
224
|
+
uniform float pulse;
|
|
225
|
+
uniform float pulseLength;
|
|
226
|
+
uniform bool pathIsVertical;
|
|
227
|
+
uniform bool displayArrowsOnPath;
|
|
228
|
+
uniform float arrowAnimationTimer;
|
|
229
|
+
uniform float opacityMultiplier;
|
|
230
|
+
uniform bool dashed;
|
|
231
|
+
uniform sampler2D arrowTexture;
|
|
232
|
+
|
|
233
|
+
varying float zoomLevel;
|
|
234
|
+
varying float radius;
|
|
235
|
+
varying vec2 fragTexcoord;
|
|
236
|
+
varying float fragTopTextureU;
|
|
237
|
+
varying float fragPathDistance;
|
|
238
|
+
|
|
239
|
+
// How long the arrow should be, as a factor of pathRadius. Since we've
|
|
240
|
+
// mostly flattened the top of the path, values near 2.0 (the diameter)
|
|
241
|
+
// will probably look best.
|
|
242
|
+
const float arrowLength = 2.0;
|
|
243
|
+
|
|
244
|
+
// How much of a relative margin the arrow texture should have inside the
|
|
245
|
+
// area laid out for it. Useful to pull the arrow away from the edges of the
|
|
246
|
+
// path, which slope down.
|
|
247
|
+
const float arrowMargin = 0.1;
|
|
248
|
+
|
|
249
|
+
// How many arrow-lengths of space should be between arrows on a short path.
|
|
250
|
+
const float arrowSpacingOnShortPath = 6.0;
|
|
251
|
+
|
|
252
|
+
// How many arrow-lengths of space should be between arrows on a long path.
|
|
253
|
+
const float arrowSpacingOnLongPath = 7.5;
|
|
254
|
+
|
|
255
|
+
// How long a path must be to be considered "long", as a factor of
|
|
256
|
+
// the path radius.
|
|
257
|
+
const float longPathLength = 200.;
|
|
258
|
+
|
|
259
|
+
// How long a path must be to be considered "short", as a factor of the
|
|
260
|
+
// path radius.
|
|
261
|
+
const float shortPathLength = 75.;
|
|
262
|
+
|
|
263
|
+
// How much of the path's length the fade-in should comprise when going from
|
|
264
|
+
// zero opacity to full opacity.
|
|
265
|
+
const float completeLength = 0.1;
|
|
266
|
+
|
|
267
|
+
// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using
|
|
268
|
+
// linear interpolation/extrapolation.
|
|
269
|
+
//
|
|
270
|
+
// This performs a pure linear mapping 'y = mx + b' where
|
|
271
|
+
// 'm = (yMax - yMin) / (xMax - xMin)',
|
|
272
|
+
// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.
|
|
273
|
+
float remap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
274
|
+
return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear
|
|
278
|
+
// interpolation, clamping result values outside [yMin, yMax].
|
|
279
|
+
float clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
280
|
+
return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
void main(void) {
|
|
284
|
+
// Compute the opacity of the path based on the distance from the current
|
|
285
|
+
// fragment to the 'complete' value as it varies from 0.0 to 1.0.
|
|
286
|
+
// Fragments that are at the 'complete' value or past it will be fully
|
|
287
|
+
// transparent, while fragments that are at 'complete - completeLength'
|
|
288
|
+
// or before it will be fully opaque. However, we adjust the 'complete'
|
|
289
|
+
// value here so that it overshoots by one full 'completeLength', so that
|
|
290
|
+
// the entire path will be opaque when the 'complete' value is at 1.0.
|
|
291
|
+
float completeLocation = complete * (1.0 + completeLength);
|
|
292
|
+
float completeAmount = clampRemap(
|
|
293
|
+
fragPathDistance,
|
|
294
|
+
completeLocation - completeLength,
|
|
295
|
+
completeLocation,
|
|
296
|
+
0.0,
|
|
297
|
+
1.0
|
|
298
|
+
);
|
|
299
|
+
float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);
|
|
300
|
+
|
|
301
|
+
// 2020/01/09 Terence Dickson
|
|
302
|
+
// When we render the background and overlay for the mapbox outdoor context
|
|
303
|
+
// behind everything else in single-buffer rendering, the fact that the path
|
|
304
|
+
// writes to the depth buffer means that the background and overlay will not
|
|
305
|
+
// be drawn behind the path even when the path is still fading in. The effect
|
|
306
|
+
// is subtle and is only visible in single-buffer rendering so this quick fix
|
|
307
|
+
// prevents writes to the depth buffer for zero opacity fragments, which gets
|
|
308
|
+
// rid of the most visually-offensive ghosting.
|
|
309
|
+
if (opacity <= 0.0) {
|
|
310
|
+
discard;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Push in the texture coordinates so that they ramp up
|
|
314
|
+
// at 'arrowMargin' instead of at zero; this remapping looks somewhat
|
|
315
|
+
// like this:
|
|
316
|
+
// 1 ^ ___
|
|
317
|
+
// | /
|
|
318
|
+
// | /
|
|
319
|
+
// | /
|
|
320
|
+
// | /
|
|
321
|
+
// |___/
|
|
322
|
+
// 0 +---------->
|
|
323
|
+
// 0 ^ 1
|
|
324
|
+
// arrowMargin
|
|
325
|
+
// Making the arrows narrower on the path.
|
|
326
|
+
float u = fragTopTextureU;
|
|
327
|
+
u = clamp(
|
|
328
|
+
u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,
|
|
329
|
+
0.0,
|
|
330
|
+
1.0
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
float arrowSpacing = clampRemap(
|
|
334
|
+
pathLength,
|
|
335
|
+
shortPathLength * radius,
|
|
336
|
+
longPathLength * radius,
|
|
337
|
+
arrowSpacingOnShortPath,
|
|
338
|
+
arrowSpacingOnLongPath
|
|
339
|
+
);
|
|
340
|
+
|
|
341
|
+
// Reduce the spacing between arrows when the camera zooms out, as increasing
|
|
342
|
+
// the path radius will increase the arrow size and thus be able to fit
|
|
343
|
+
// fewer arrows on in total, and this secondary movement of the arrows
|
|
344
|
+
// "zooming off" the end of the path is unpleasant
|
|
345
|
+
float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);
|
|
346
|
+
float effectiveArrowSpacing =
|
|
347
|
+
arrowSpacing * 1.0 / expandAmount +
|
|
348
|
+
arrowMargin * 2.0;
|
|
349
|
+
|
|
350
|
+
float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);
|
|
351
|
+
|
|
352
|
+
// Adjust the slope of the vertical texture coordinate so that it goes
|
|
353
|
+
// from 0 to 1 along the length of the arrow plus the spacing between
|
|
354
|
+
// arrows, and adjust its x-intercept so that one arrow moves to the
|
|
355
|
+
// exact position of the next arrow as 'arrowAnimationTimer' goes
|
|
356
|
+
// from 0 to 1
|
|
357
|
+
float v = (
|
|
358
|
+
fragTexcoord.x * (pathLength / effectiveArrowLength)
|
|
359
|
+
- arrowAnimationTimer * (1. + effectiveArrowSpacing)
|
|
360
|
+
);
|
|
361
|
+
|
|
362
|
+
// Compute a "looping sawtooth" wave for determining the vertical texture
|
|
363
|
+
// coordinates of the arrow texture, roughly as follows:
|
|
364
|
+
// 3 ^ /
|
|
365
|
+
// | ___/
|
|
366
|
+
// 2 | /
|
|
367
|
+
// | ___/
|
|
368
|
+
// 1 | /
|
|
369
|
+
// |___/
|
|
370
|
+
// 0 +--------------->
|
|
371
|
+
// 0 ^ ^
|
|
372
|
+
// ^ |_|
|
|
373
|
+
// | effectiveArrowLength
|
|
374
|
+
// |___|
|
|
375
|
+
// effectiveArrowSpacing
|
|
376
|
+
//
|
|
377
|
+
// This is effectively equivalent to this sort of sawtooth wave:
|
|
378
|
+
// ^
|
|
379
|
+
// 1 | / / /
|
|
380
|
+
// |___/ ___/ ___/
|
|
381
|
+
// 0 +--------------->
|
|
382
|
+
//
|
|
383
|
+
// Causing the image of the arrow to repeat, with dead space (the bottom
|
|
384
|
+
// edge of the texture stretched out) between the arrows at the provided
|
|
385
|
+
// spacing. The reason why the "looping" design is preferred is because
|
|
386
|
+
// it takes advantage of WebGL's 'GL_REPEAT' texture wrapping behaviour
|
|
387
|
+
// to avoid the discontinuity that can end up causing visual artifacts.
|
|
388
|
+
if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {
|
|
389
|
+
v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));
|
|
390
|
+
} else {
|
|
391
|
+
v = ceil(v / (1. + effectiveArrowSpacing));
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Use the r-component of the texture to determine whether the arrow covers
|
|
395
|
+
// this fragment or not
|
|
396
|
+
vec2 sampleTexcoord = vec2(u, v);
|
|
397
|
+
float arrowAmount = 0.0;
|
|
398
|
+
vec3 secondColor = pulseColor;
|
|
399
|
+
|
|
400
|
+
if (displayArrowsOnPath) {
|
|
401
|
+
arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;
|
|
402
|
+
float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);
|
|
403
|
+
secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if (dashed) {
|
|
407
|
+
float dashLength = 0.1; // Adjust this value to change the dash length
|
|
408
|
+
float gapLength = 0.1; // Adjust this value to change the gap length
|
|
409
|
+
float totalLength = dashLength + gapLength;
|
|
410
|
+
float numSegments = ceil(1.0 / totalLength);
|
|
411
|
+
float adjustedTotalLength = 1.0 / numSegments;
|
|
412
|
+
float adjustedDashLength = adjustedTotalLength * (dashLength / (dashLength + gapLength));
|
|
413
|
+
float pattern = mod(fragPathDistance, adjustedTotalLength);
|
|
414
|
+
opacity = pattern < adjustedDashLength ? 1.0 : 0.0;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
if (showPulse) {
|
|
419
|
+
// Add the pulse color to the path by determining how far the current fragment
|
|
420
|
+
// is from 'pulse'
|
|
421
|
+
float pulseLocation = remap(
|
|
422
|
+
pulse,
|
|
423
|
+
0.0,
|
|
424
|
+
1.0,
|
|
425
|
+
-pulseLength,
|
|
426
|
+
1.0 + pulseLength
|
|
427
|
+
);
|
|
428
|
+
float pulseDistance = smoothstep(
|
|
429
|
+
0.0,
|
|
430
|
+
pulseLength,
|
|
431
|
+
abs(fragPathDistance - pulseLocation)
|
|
432
|
+
);
|
|
433
|
+
|
|
434
|
+
// Blend the pulse color to the path based on how close this fragment is to
|
|
435
|
+
// the 'pulse' value and whether it's covered by an arrow -- but if it's
|
|
436
|
+
// covered by *both*, then we go back to using the regular path color
|
|
437
|
+
// (making arrows look like "holes" when they're overlapping the pulse.)
|
|
438
|
+
float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);
|
|
439
|
+
|
|
440
|
+
gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);
|
|
441
|
+
} else if (displayArrowsOnPath) {
|
|
442
|
+
gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);
|
|
443
|
+
} else {
|
|
444
|
+
gl_FragColor = vec4(color, opacity * opacityMultiplier);
|
|
445
|
+
}
|
|
446
|
+
#include <colorspace_fragment>
|
|
447
|
+
}
|
|
448
|
+
`;d();var R9=`uniform float complete;
|
|
449
|
+
uniform float nearRadius;
|
|
450
|
+
uniform float farRadius;
|
|
451
|
+
varying float fragPathDistance;
|
|
452
|
+
const float completeLength = 0.1;
|
|
453
|
+
|
|
454
|
+
// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using
|
|
455
|
+
// linear interpolation/extrapolation.
|
|
456
|
+
//
|
|
457
|
+
// This performs a pure linear mapping 'y = mx + b' where
|
|
458
|
+
// 'm = (yMax - yMin) / (xMax - xMin)',
|
|
459
|
+
// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.
|
|
460
|
+
float remap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
461
|
+
return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear
|
|
465
|
+
// interpolation, clamping result values outside [yMin, yMax].
|
|
466
|
+
float clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {
|
|
467
|
+
return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
void main(void) {
|
|
471
|
+
// this ensures that the stencil mask moves along with the path above it, to avoid the progress bar effect
|
|
472
|
+
float completeLocation = complete * (1.0 + completeLength);
|
|
473
|
+
float completeAmount = clampRemap(
|
|
474
|
+
fragPathDistance,
|
|
475
|
+
completeLocation - completeLength,
|
|
476
|
+
completeLocation,
|
|
477
|
+
0.0,
|
|
478
|
+
1.0
|
|
479
|
+
);
|
|
480
|
+
float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);
|
|
481
|
+
|
|
482
|
+
// 2020/01/09 Terence Dickson
|
|
483
|
+
// When we render the background and overlay for the mapbox outdoor context
|
|
484
|
+
// behind everything else in single-buffer rendering, the fact that the path
|
|
485
|
+
// writes to the depth buffer means that the background and overlay will not
|
|
486
|
+
// be drawn behind the path even when the path is still fading in. The effect
|
|
487
|
+
// is subtle and is only visible in single-buffer rendering so this quick fix
|
|
488
|
+
// prevents writes to the depth buffer for zero opacity fragments, which gets
|
|
489
|
+
// rid of the most visually-offensive ghosting.
|
|
490
|
+
if (opacity <= 0.0) {
|
|
491
|
+
discard;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
gl_FragColor = vec4(0.0, 1.0, 0.0, opacity);
|
|
495
|
+
}`;var _9="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 zU=new Lc;function B9(e,r,t){let{breakpoint:o,width:n,accentColor:i,completeFraction:a,isVertical:l,visibleThroughGeometry:c,dashed:p}=r,{color:m}=t,f=!0,g=0,b=1/0,x=r.displayArrowsOnPath,C=!0,v=x,I=typeof n=="object"?Number(n.output[o])/2:n/2,M=typeof n=="object"?Number(n.output[o+1]??n.output[o])/2:n/2,O=(t.altitude??0)+ZU,T=0;e[0].z+=O;for(let H=1;H<e.length;++H){e[H].z+=O;let F=e[H].x-e[H-1].x,Q=e[H].z-e[H-1].z;if(l)T+=Math.sqrt(F*F+Q*Q);else{let Y=e[H].y-e[H-1].y;T+=Math.sqrt(F*F+Y*Y+Q*Q)}}if(!l){let H=e[0],F=e[e.length-1];e.push(F.clone().setZ(F.z-.01)),e.unshift(H.clone().setZ(H.z-.01))}let P=new d3;v&&(P=zU.load(_9),P.colorSpace=Nh);let B=new qt(m),G=new qt(i),A={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new Se(1,1)},cameraParameters:{type:"v2",value:new Se(g,0)},complete:{type:"f",value:f?0:1},color:{type:"c",value:B},pathLength:{type:"f",value:T},nearRadius:{type:"f",value:I},farRadius:{type:"f",value:M},nearZoom:{type:"f",value:g},farZoom:{type:"f",value:b},pulseColor:{type:"c",value:G},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:l},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:P},displayArrowsOnPath:{type:"b",value:x},showPulse:{type:"b",value:C},opacityMultiplier:{type:"f",value:1},dashed:{type:"b",value:p}},N=new b3(e);N.curveType="catmullrom",N.tension=0;let z=30,Z=8,oe=z*e.length,J=new v3(N,oe,I,Z,!1),fe=new Float32Array(J.attributes.position.count);for(let H=e.length;H<fe.length;H++)fe[H]=H;J.setAttribute("vertexIndex",new Yr(fe,1));let ye=new Float32Array(J.attributes.position.count),Te=new Yr(ye,1);for(let H=0;H<=oe;H++)for(let F=0;F<=Z;++F)Te.setX(H*(Z+1)+F,H/oe);J.setAttribute("pathDistance",Te);let ve=new Float32Array(J.attributes.normal.count*3),we=new Yr(ve,3);for(let H=0;H<oe;H++){let F=J.tangents[H];for(let Q=0;Q<=Z;++Q)we.setXYZ(H*(Z+1)+Q,F.x,F.y,F.z)}J.setAttribute("pathTangent",we);let ie=new Float32Array(J.attributes.normal.count*3),Me=new Yr(ie,3);for(let H=0;H<oe;H++){let F=J.tangents[H];var tt,Ze,rt;l?(tt=F.x*F.y,Ze=-1+F.y*F.y,rt=F.z*F.y):(tt=-F.x*F.z,Ze=-F.y*F.z,rt=1-F.z*F.z);let Q=Math.sqrt(tt*tt+Ze*Ze+rt*rt);Q===0&&(Q=1);let Y=tt/Q,q=Ze/Q,Pe=rt/Q;for(let Lt=0;Lt<=Z;++Lt)Me.setXYZ(H*(Z+1)+Lt,Y,q,Pe)}J.setAttribute("pathNormal",Me);let Ke=new ia({uniforms:A,vertexShader:fb,fragmentShader:vI});Ke.transparent=!0,Ke.alphaTest=.5,A.resolution.value.x=1,A.resolution.value.y=1,A.vertexes.value=fe.length,A.arrowTexture.value.wrapS=hu,A.arrowTexture.value.wrapT=hu,A.arrowTexture.value.anisotropy=16;let be=new Oe(J,Ke),gt=be.clone(),wt={...A,opacityMultiplier:{type:"f",value:.25}};wt.complete.value=1,gt.material=new ia({uniforms:wt,vertexShader:fb,fragmentShader:vI}),gt.material.transparent=!0,gt.material.alphaTest=.5,gt.material.depthWrite=!1,gt.material.depthTest=!1,wt.resolution.value.x=1,wt.resolution.value.y=1,wt.vertexes.value=fe.length,wt.arrowTexture.value.wrapS=hu,wt.arrowTexture.value.wrapT=hu,wt.arrowTexture.value.anisotropy=16,wt.complete.value=a,be.userData=gt.userData=r.mesh.userData;let Kt=r.mesh;if(!c){let H=new ia({uniforms:A,vertexShader:fb,fragmentShader:R9}),F=new Oe(J,H);F.name="stencil",F.material.colorWrite=!1,F.material.stencilWrite=!0,F.material.stencilRef=1,F.material.stencilFunc=c3,F.material.stencilZPass=Gh,F.material.stencilZFail=Gh,F.material.stencilFail=Gh,F.material.depthWrite=!1,F.material.depthTest=!1,F.userData=r.mesh.userData,Kt.add(F),Kt.add(gt),gt.renderOrder=0,be.renderOrder=1}if(Kt.add(be),l){let H=new Qt().setFromObject(be),F=new ae;H.getCenter(F),Kt.children.forEach(Q=>{Q.geometry.center(),Q.position.copy(F)})}c&&(be.material.stencilWrite=!0,be.material.stencilRef=1,be.material.stencilFunc=l3,be.material.stencilZPass=jh,be.material.stencilZFail=jh,be.material.stencilFail=jh,be.material.needsUpdate=!0,be.layers.disableAll(),be.layers.enable(eg.ALWAYS_ON_TOP)),J.computeBoundingBox();let k=new ae;return J.boundingBox.getCenter(k),{mesh:Kt,material:Ke,center:k}}var ZU=.15;var XU=.5,xf=class extends Ie{constructor(t,o,n,i){super();u(this,"rendererState");u(this,"verticalDistanceDirty",!0);u(this,"convertTo3DMapPosition");u(this,"getParentContainer");u(this,"convertZoomLevelToAltitude");this.rendererState=t,this.convertTo3DMapPosition=o,this.getParentContainer=n,this.convertZoomLevelToAltitude=i}update(t,o,n,i=0){let a,l=!1;for(let c of this.rendererState.geometry3DIdsInScene)if(a=this.rendererState.geometry3DMap.get(c),a&&a.type==="path"&&a.components[0].type==="path"){let p=a.components[0],m=a.components[1],f=p.isVertical&&this.verticalDistanceDirty;if(!(p instanceof za))continue;let g=[];if(p.dirty||m.dirty||f){if(p.mesh.parent!=null)for(let b=p.mesh.children.length-1;b>=0;b--)_t(p.mesh.children[0]);if(p.feature.features.length===2&&p.feature.features[0].properties.parentId&&p.feature.features[1].properties.parentId){let b=p.feature.features[0],x=p.feature.features[p.feature.features.length-1],C,v,I=b.geometry.coordinates[2]||0,M=x.geometry.coordinates[2]||0;b.properties.parentId&&(C=this.getParentContainer(b.properties.parentId,!0),C!=null&&C.altitude!=null&&(I+=C.altitude,p.isVertical=!0)),x.properties.parentId&&(v=this.getParentContainer(x.properties.parentId,!0),v!=null&&v.altitude!=null&&(M+=v.altitude,p.isVertical=!0));let O=this.convertTo3DMapPosition(b.geometry.coordinates[1],b.geometry.coordinates[0],I),T=this.convertTo3DMapPosition(x.geometry.coordinates[1],x.geometry.coordinates[0],M);Math.abs(O.z-T.z)>XU&&C!=null&&C.visible&&v!=null&&v.visible&&(g=[O,T])}else{let b=p.feature.features;for(let x=0;x<b.length;x++)if(x===0||!iS(b[x].geometry.coordinates,b[x-1].geometry.coordinates)){let C=this.convertTo3DMapPosition(b[x].geometry.coordinates[1],b[x].geometry.coordinates[0],b[x].geometry.coordinates[2]||0);g.push(C)}}if(g.length>1){let{mesh:b,material:x,center:C}=B9(g,p,{color:m.color,altitude:m.altitude});p.mesh=b,p.material=x,p.position=C}p.dirty&&typeof p.width=="object"&&p.width.on==="zoom-level"&&(p.altitudeBreakpoints=p.width.input.map(b=>this.convertZoomLevelToAltitude(b))),p.dirty=!1}m.dirty&&(p.mesh.children.forEach(b=>{b.name!=="stencil"&&(b.material.uniforms.color.value.set(m.color),b.material.visible=m.visible,b.material.needsUpdate=!0)}),p.mesh.position.z=m.altitude,m.dirty=!1),p.isVertical&&p.mesh.children.forEach(b=>{b.rotation.z=-i}),p.material&&(p.mesh.children.forEach(b=>{let x=b.material.uniforms;if(b.name==="stencil"){p.materialDirty&&(x.complete.value=p.completeFraction);return}if(typeof p.width=="object"&&p.width.on==="zoom-level"){p.altitudeBreakpoints&&p.altitudeBreakpoints.length>2&&L.warn("Path width interpolation does not yet support more than 2 breakpoints! This will be added in a future version. Path width will only use the first two breakpoints.");let C=k3(n,p.altitudeBreakpoints?.slice(0,2)??[t,o]);p.breakpoint=C,x.nearZoom.value=p.altitudeBreakpoints?.[C]??t,x.farZoom.value=p.altitudeBreakpoints?.[C+1]??o,x.nearRadius.value=Number(p.width.output[C])/2,x.farRadius.value=Number(p.width.output[C+1]??p.width.output[C])/2}x.cameraParameters.value.x=n,p.materialDirty&&(x.displayArrowsOnPath.value=p.displayArrowsOnPath,x.pulseColor.value.set(p.accentColor),x.complete.value=p.completeFraction,typeof p.width=="number"&&(x.nearZoom.value=t,x.farZoom.value=o,x.nearRadius.value=Number(p.width)/2,x.farRadius.value=Number(p.width)/2))}),p.displayArrowsOnPath&&p.animateArrowsOnPath&&(p.mesh.children.forEach(b=>{b.name!=="stencil"&&(b.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,b.material.needsUpdate=!0)}),l=!0),p.materialDirty=!1)}this.verticalDistanceDirty=!1,l&&this.publish("animate:path")}};d();var rr,Ud,Us,hb=class{constructor(r){u(this,"rendererState");u(this,"dirty",!1);S(this,rr);S(this,Ud);S(this,Us);this.rendererState=r}updateOne(r){if(r instanceof yt&&r.components[0]instanceof or&&r.components[1]instanceof fi&&r.parentObject3D instanceof Cn&&(w(this,rr,r.components[0]),w(this,Us,r.components[1]),s(this,rr).detached&&s(this,rr).dirty&&s(this,rr).mesh!=null&&s(this,rr).material!=null&&s(this,rr).batchedProps!=null)){w(this,Ud,r.parentObject3D),s(this,rr).visible=!1;let t=new qt(s(this,Us).color),o=s(this,Us).opacity*jc(r),n=new mS({color:t,side:Qi,opacity:o??1,transparent:o!==void 0?o<1:!1},1,s(this,rr).material.repeatYFactor),i=new jS(1,s(this,rr).batchedProps.positionCount,0,n),a=I9(s(this,rr),i);if(a==null)return;i.userData={entities:{0:r.id},detached:!0},s(this,rr).instanceIndex=a,s(this,rr).material.setColor(s(this,rr).instanceIndex,t,s(this,Us).topColor?new qt(s(this,Us).topColor):t),s(this,rr).mesh=i,s(this,rr).material=n,s(this,Ud).add(i),s(this,rr).dirty=!1}}update(){if(!this.dirty)return;let r;for(let t of this.rendererState.geometry3DIdsInScene)r=this.rendererState.geometry3DMap.get(t),this.updateOne(r);this.dirty=!1,this.cleanup()}cleanup(){w(this,rr,void 0),w(this,Ud,void 0),w(this,Us,void 0)}};rr=new WeakMap,Ud=new WeakMap,Us=new WeakMap;d();d();function N9(e,r,t){if(e.batchedProps?.range&&e.mesh){let o=r||1e-4,n=o/Math.max(t,1e-4);return tb(e.mesh.geometry,e.batchedProps.range,o,0),e.material&&(e.material.repeatYFactor=n),e.currentHeight=o,!0}return!1}function j9(e,r,t,o,n,i){return e.mesh&&e.instanceIndex!==-1?(e.mesh.getMatrixAt(e.instanceIndex,t),t.decompose(o,n,i),o.z=r,t.compose(o,n,i),e.mesh.setMatrixAt(e.instanceIndex,t),e.altitude=r,!0):!1}var Kn,Hi,yb,bb,xb,vb,gb=class{constructor(r){u(this,"rendererState");u(this,"dirty",!1);S(this,Kn);S(this,Hi);S(this,yb,new qi);S(this,bb,new ae);S(this,xb,new Uh);S(this,vb,new ae);this.rendererState=r}updateOne(r){if(r instanceof yt&&r.type==="geometry"&&r.components[1]?.dirty&&(w(this,Kn,r.components[0]),w(this,Hi,r.components[1]),r.type==="geometry")){let t=!1;s(this,Hi).height!==s(this,Kn).currentHeight&&(t=N9(s(this,Kn),s(this,Hi).height,s(this,Hi).initialHeight)),s(this,Hi).altitude!==s(this,Kn).altitude&&(t=j9(s(this,Kn),s(this,Hi).altitude,s(this,yb),s(this,bb),s(this,xb),s(this,vb))),t&&s(this,Kn).mesh!=null&&s(this,Kn).mesh.computeBoundingSphere()}}update(){let r;for(let t of this.rendererState.geometry3DIdsInScene)r=this.rendererState.geometry3DMap.get(t),this.updateOne(r);this.cleanup()}cleanup(){w(this,Kn,void 0),w(this,Hi,void 0)}};Kn=new WeakMap,Hi=new WeakMap,yb=new WeakMap,bb=new WeakMap,xb=new WeakMap,vb=new WeakMap;d();var YU={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},Ib=class{constructor(r){u(this,"state",YU);u(this,"core");this.core=r}update(r){let t={};for(let[o,n]of Object.entries(r))o in this.state&&this.state[o]!==r[o]&&(this.state[o]=n,t[o]=n);this.handleUpdate(t)}handleUpdate(r){r.showPolygonLabelTextAreaMesh!=null&&(r.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),r.showEnvMap!=null&&(r.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),r.showCollisionBoxes!=null&&(r.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};d();var vf=9,JU=!1,G9=.1;function KU(e,r,t){for(let o=0;o<r;o++){let n=(t&16711680)>>16,i=(t&65280)>>8,a=t&255;e[o*3]=n/255,e[o*3+1]=i/255,e[o*3+2]=a/255}}var Sb=class{constructor(r,t,o){u(this,"state");u(this,"renderer");u(this,"renderService");u(this,"pickingTexture");u(this,"pickingMaterial");u(this,"pixelBuffer");u(this,"width",0);u(this,"height",0);u(this,"scale",1/2);u(this,"color",1);u(this,"convertTo3DMapPosition");u(this,"destroyed",!1);u(this,"enabled",!1);u(this,"backgroundId",16777215);u(this,"resize",()=>{let r=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/r*this.scale),this.height=Math.floor(this.renderer.domElement.height/r*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new m3(this.width,this.height,{format:a3,type:s3,internalFormat:"RGBA"})});u(this,"shouldShowByXY",(r,t,o)=>{if(this.pixelBuffer==null)return!1;let n=r+(this.height-t-1)*this.width,i=this.pixelBuffer[n*4],a=this.pixelBuffer[n*4+1],l=this.pixelBuffer[n*4+2],c=i<<16|a<<8|l;return c===o||c===this.backgroundId});u(this,"activeOccluders",new Set);u(this,"update",()=>{if(!this.enabled||this.destroyed||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let r,t;for(let n of this.state.geometry3DIdsInScene){let i=this.state.geometry3DMap.get(n);if(i&&i instanceof nr&&i.userData.occluderFeature!=null&&i.userData.occluderId!=null&&(this.activeOccluders.add(i.userData.occluderId),i.userData.occluderDirty)){if(r=i.userData.occluderFeature,r.geometry.type==="Polygon"){let a=P1(r,this.convertTo3DMapPosition,{color:"white",height:G9});t=this.createOccluderMesh(a,i.userData.occluderId),i.add(t)}else if(r.geometry.type==="MultiPolygon"){let a=F1(r,this.convertTo3DMapPosition,{color:"white",height:G9});t=this.createOccluderMesh(a,i.userData.occluderId),i?.add(t)}i.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let o=new qt(this.backgroundId);this.renderer.setClearColor(o),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(vf),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(vf),JU?this.renderService.enabledLayers.add(vf):this.renderService.enabledLayers.delete(vf),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let n of this.state.geometry2DIdsInScene){let i=this.state.geometry2DMap.get(n);if(i&&i?.occluderId!=null&&this.activeOccluders.has(i?.occluderId)){let a=i.components[0].projection,l=Math.floor(a.x*this.scale),c=Math.floor(a.y*this.scale),p=this.shouldShowByXY(l,c,i.occluderId);i.components[0].isOccluded=!p}}}).catch(n=>{this.destroyed||L.error(n)})});if(this.state=r,this.convertTo3DMapPosition=t,o?.renderer==null)throw new Error("No Renderer");this.renderService=o,this.renderer=o.renderer,this.resize(),this.pickingMaterial=new ia({glslVersion:p3,vertexShader:`
|
|
496
|
+
attribute vec3 color;
|
|
497
|
+
varying vec3 vColor;
|
|
498
|
+
void main() {
|
|
499
|
+
vColor = color;
|
|
500
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
501
|
+
}
|
|
502
|
+
`,fragmentShader:`
|
|
503
|
+
varying vec3 vColor;
|
|
504
|
+
out vec4 fragColor;
|
|
505
|
+
|
|
506
|
+
void main() {
|
|
507
|
+
fragColor = vec4(vColor, 1.0);
|
|
508
|
+
}
|
|
509
|
+
`})}applyId(r,t){let o=r.attributes.position,n=new Float32Array(o.count*3);KU(n,o.count,t),r.setAttribute("color",new Yr(n,3))}createOccluderMesh(r,t){let o=new Oe(r,this.pickingMaterial);return o.layers.set(vf),this.applyId(o.geometry,t),o.userData.occluderId=t,o}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){this.destroyed=!0,this.pickingTexture?.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};d();var Cb=class{constructor(r){this.state=r;u(this,"dirty",!0)}update(){if(this.dirty){for(let r of this.state.geometry3DIdsInScene){let t=this.state.geometry3DMap.get(r);if(t instanceof yt&&t.type==="geometry"&&t.components[0]?.geometry!=null){let o=t.components[0];o.geometry&&(o.geometry.dispose(),o.geometry=void 0)}}this.dirty=!1}}};var U9=new ai;var{DEFAULT_PITCH:MI,DEFAULT_BEARING:wI,DEFAULT_ZOOM_LEVEL:OI,DEFAULT_MIN_ZOOM_LEVEL:QU,DEFAULT_MAX_ZOOM_LEVEL:qU}=zn,eV=Le.radToDeg(.6435011087932844),Vt,Rt,dc,If,Vd,Ka,uc,Hd,Br,SI,_,hn,mc,et,Qn,Ht,gn,Sr,R,Sf,ur,ht,V9,H9,$9,Vs,Cf,Tf,Mf,wf,$d,Tb,Of,Pf,Ff,fc,CI,hc,Ef,Df,so,ao,TI,Mb,wb,Wd,kf,II=class extends Ie{constructor(t,o={}){super();S(this,Br);u(this,"options");u(this,"container");u(this,"Debug");S(this,Vt);S(this,Rt);S(this,dc);S(this,If);S(this,Vd);S(this,Ka);S(this,uc);S(this,Hd);u(this,"rendererDomElement");S(this,_,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,geometryGroupIdsToLoad:new Set,entityScene:new nr("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:qh,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,internalTweenGroup:new N1,externalTweenGroup:new N1,cameraObject:new Qb,naturalBearing:0,containerOffset:[0,0],useStandaloneCamera:!1});S(this,hn,{});S(this,mc,new AbortController);u(this,"camera");S(this,et);S(this,Qn);S(this,Ht);S(this,gn);S(this,Sr);S(this,R,{});S(this,Sf,window.matchMedia("screen and (min-resolution: 2dppx)"));u(this,"map");S(this,ur,()=>{this.aborted||!s(this,R)?.renderSystem||(s(this,R).renderSystem.twoDdirty=!0)});S(this,ht,()=>{this.aborted||!s(this,R)?.renderSystem||(s(this,R).renderSystem.threeDdirty=!0)});S(this,Vs,"standalone");S(this,Cf,()=>{s(this,R).geometryDisposalSystem.dirty=!0,this.render()});S(this,Tf,t=>Math.trunc(t*10)/10);S(this,Mf,()=>{W(this,Br,SI).call(this,Nc()),s(this,R).twoDDrawSystem.dirty=!0,s(this,$d).call(this,void 0,void 0,!0)});S(this,wf,()=>{s(this,$d).call(this)});S(this,$d,(t,o,n=!1)=>{let i=t??this.rendererDomElement.clientWidth,a=o??this.rendererDomElement.clientHeight;if((i===0||a===0)&&!n)return;s(this,_).canvasWidth=i,s(this,_).canvasHeight=a,W(this,Br,SI).call(this,Nc()),s(this,fc).call(this),W(this,Br,$9).call(this),s(this,R).cameraSystem.resize(this.canvasWidth,this.canvasHeight),s(this,R).cameraSystem.dirty=!0,s(this,R).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),s(this,R).htmlControlsSystem.resize(this.canvasWidth),s(this,R).geometryInFocusSystem.resize(),s(this,R).occlusion2DSystem.resize();let{top:l,left:c}=this.container.getBoundingClientRect();s(this,_).containerOffset=[l,c],this.publish("resize"),this.render()});S(this,Tb,()=>{this.renderSync()});S(this,Of,new ae);S(this,Pf,(t,o)=>{let n=this.mode==="standalone"?s(this,Rt):this.viewCamera;if(s(this,Rt).position.z+this.camera.elevation>o.z){s(this,Of).copy(o);let i=s(this,Of).project(n),a=(i.x+1)/2*this.canvasWidth-0/2,l=(-i.y+1)/2*this.canvasHeight-0/2,c=s(this,Tf).call(this,a),p=s(this,Tf).call(this,l);t.x=c,t.y=p}else t.x=-1e3,t.y=-1e3});S(this,Ff,(t,o)=>{s(this,Sr).setBufferSize(t,o),s(this,Rt).aspect=t/o,s(this,Rt).updateProjectionMatrix(),s(this,Rt).updateMatrixWorld(!0),s(this,Vd).x=t,s(this,Vd).y=o});S(this,fc,()=>{let t=s(this,_).canvasWidth=this.rendererDomElement.clientWidth,o=s(this,_).canvasHeight=this.rendererDomElement.clientHeight,n=Math.floor(t*this.resolutionScale),i=Math.floor(o*this.resolutionScale);s(this,Ff).call(this,n,i),this.map?.resize(),s(this,_).shouldMeasureCanvas=!1});u(this,"getParentContainer",(t,o=!0)=>{if(!t)return o?s(this,_).entityScene:void 0;if(typeof t=="string"||typeof t=="number"){let n=s(this,_).geometry3DMap.get(t);return n instanceof nr?n:(L.warn(`Parent (${typeof t=="object"?t.id:t}) is not a valid container, adding to scene`),o?s(this,_).entityScene:void 0)}else if(t.type==="group-container"){let n=s(this,_).geometry3DMap.get(t.id);if(n instanceof nr)return n}return o?s(this,_).entityScene:void 0});u(this,"showCollisionBoxes",()=>{s(this,R).collisionSystem.showCollisionBoxes(),this.render()});u(this,"hideCollisionBoxes",()=>{s(this,R).collisionSystem.hideCollisionBoxes(),this.render()});u(this,"projectScreenXYToCoordinate",(t,o,n=!1)=>{let i=this.container.getBoundingClientRect(),a=(t-i.left)/s(this,_).canvasWidth*2-1,l=-((o-i.top)/s(this,_).canvasHeight)*2+1,c=new Se(a,l),p,m;if(n?(U9.setFromCamera(c,s(this,Rt)),p=U9.intersectObject(s(this,Ka),!1)[0]?.point):(p=s(this,R).interactionSystem.getThreeDIntersectsFromXY(c)?.[0]?.point,m=s(this,R).interactionSystem.getGroupContainerIntersectsFromXY(c)),p)return{coordinate:this.convert3DMapPositionToCoordinate(p),groupContainers:m}});u(this,"projectCoordinateToScreenXY",t=>{let o=this.convertTo3DMapPosition(t[1],t[0],t[2]||0),n=new Se;return s(this,Pf).call(this,n,o),{x:n.x,y:n.y}});u(this,"convert3DMapPositionToCoordinate",t=>{let{lat:o,lon:n}=tg(s(this,_).center?.[1]??0,s(this,_).center?.[0]??0,t.x,t.y);return[n,o,t.z]});u(this,"setBackgroundColor",(t,o)=>{s(this,Sr).setBackgroundColor(t,o)});u(this,"getMetresPerPixel",()=>{let t=this.container.clientWidth,o=this.container.clientHeight/2,n=this.projectScreenXYToCoordinate(0,o,!0),i=this.projectScreenXYToCoordinate(t,o,!0);return n==null||i==null?void 0:Xh(n.coordinate,i.coordinate)/t});u(this,"hideOutdoorLayersUnderPoint",(t,o)=>{!this.map||o?.length===0||(s(this,R).outdoorLayersSystem.hideLayersUnderPoint(t,o),this.render())});u(this,"hideOutdoorLayersIntersectingPolygons",(t,o,n)=>{s(this,R).outdoorLayersSystem.hideLayersIntersectingPolygons(t,o,n),this.render()});S(this,hc,new g3);S(this,Ef,new qi);S(this,Df,t=>{L.error("Render failed: ",t,t.stack??"No stack trace available"),this.publish("render-error",{error:t})});u(this,"render",()=>{if(!(s(this,R)?.renderSystem==null||this.aborted))if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return s(this,R).renderSystem.update().catch(s(this,Df))});u(this,"renderSync",()=>this.aborted?Promise.resolve():s(this,R).renderSystem.update(!0).catch(s(this,Df)));S(this,so,Su(()=>{this.publish("user-interaction-start",void 0)},0,!0));S(this,ao,Su(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));u(this,"on",(t,o)=>{this.aborted||(super.on(t,o),["outdoor-view-loaded","outdoor-style-loaded"].includes(t)&&this.mode==="standalone"&&y.env.NODE_ENV!=="test"&&(L.warn(`"${t}" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.`),this.publish(t)))});u(this,"off",(t,o)=>{super.off(t,o)});u(this,"getCursor",()=>s(this,R).interactionSystem.getCursor());S(this,Mb,()=>{if(s(this,_).entityScene.removeEventListener("childadded",s(this,ht)),s(this,_).entityScene.removeEventListener("childadded",s(this,ur)),s(this,_).entityScene.removeEventListener("childremoved",s(this,ht)),s(this,_).entityScene.removeEventListener("childremoved",s(this,ur)),window.removeEventListener("resize",s(this,wf),!1),s(this,Sf).removeEventListener("change",s(this,Mf)),this.map){for(let t in s(this,hn))for(let o of s(this,hn)[t])this.map.off(t,o);w(this,hn,{})}this._subscribers={}});S(this,wb,()=>{try{s(this,Vs)!=="outdoors-overlay"&&(this.map&&this.map.remove(),this.container&&this.rendererDomElement&&this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container&&(s(this,gn)&&this.container.contains(s(this,gn))&&this.container.removeChild(s(this,gn)),s(this,et)&&this.container.contains(s(this,et))&&this.container.removeChild(s(this,et)))}catch(t){L.warn("Error during DOM cleanup, some elements may not have been removed:",t)}});u(this,"destroy",()=>{s(this,R)&&(this.aborted||s(this,mc).abort(),s(this,Mb).call(this),this.remove("__scene"),s(this,R).renderSystem.destroy(),s(this,R).cameraSystem.dispose(),s(this,R).exporterSystem.destroy(),s(this,R).outdoorLayersSystem.destroy(),s(this,R).borderSystem.destroy(),s(this,R).drawSystem.destroy(),s(this,uc)&&s(this,uc).disconnect(),s(this,Sr).destroy(),s(this,Vt)?.traverse(t=>{_t(t),"dispose"in t&&typeof t.dispose=="function"&&t.dispose()}),w(this,Vt,void 0),s(this,R).htmlControlsSystem.destroy(),s(this,R).collisionSystem.destroy(),s(this,R).interactionSystem.destroy(),s(this,R).domMutationSystem.destroy(),s(this,R).geometryInFocusSystem.destroy(),s(this,R).occlusion2DSystem.destroy(),w(this,R,void 0),s(this,wb).call(this),w(this,Sr,void 0))});S(this,Wd,new ae);S(this,kf,new ae);if(w(this,mc,new AbortController),s(this,_).useStandaloneCamera=o.useStandaloneCamera??!1,s(this,_).naturalBearing=o.naturalBearing??0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!t.clientWidth||!t.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(o.mode==="outdoors-interleaved"||o.mode==="outdoors-overlay")&&o.map&&(w(this,Vs,o.mode),this.map=o.map),s(this,_).entityScene.addEventListener("childadded",()=>{s(this,ht).call(this),s(this,ur).call(this)}),s(this,_).entityScene.addEventListener("childremoved",()=>{s(this,ht).call(this),s(this,ur).call(this)}),s(this,_).geometry3DMap.set(s(this,_).entityScene.userData.entityId,s(this,_).entityScene),o.center&&(s(this,_).center=o.center?[...o.center]:[0,0]),this.options=o,this.container=t,W(this,Br,V9).call(this),W(this,Br,H9).call(this),s(this,R).htmlControlsSystem=new q1(this.container,{outdoorEnabled:!!this.map}),s(this,Vs)!=="outdoors-overlay"&&s(this,R).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),y.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),w(this,Sr,new x1({antialias:typeof o.antialias=="boolean"?o.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?o.gl?.canvas:void 0,onWebGLContextCreationError:o.onWebGLContextCreationError,onWebGLContextLost:o.onWebGLContextLost,onWebGLContextRestored:x=>{o.onWebGLContextRestored?.(x),s(this,ur).call(this),s(this,ht).call(this),this.render()},onWebGLRendererError:o.onWebGLRendererError,backgroundColor:o.backgroundColor||"#ffffff",backgroundAlpha:o.backgroundAlpha??1})),w(this,Vt,new sa),s(this,Vs)!=="standalone"&&s(this,Vt).add(sS()),s(this,Vt).add(s(this,_).entityScene);let n=window.__THREE_DEVTOOLS__;y.env.NODE_ENV==="dev"&&typeof n<"u"&&(n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Vt)})),n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Sr)}))),w(this,Rt,new Qb(eV,this.aspect,50,1e5)),s(this,_).cameraObject=s(this,Rt),w(this,If,new h3),s(this,Rt).renderOrder=999;let i=new es;i.add(s(this,Rt)),w(this,Hd,new es),s(this,Hd).add(i),s(this,Vt).add(s(this,Hd)),s(this,Rt).updateProjectionMatrix(),s(this,Rt).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:()=>0,georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=s(this,Sr).domElement(),w(this,Vd,new Se);let a=new ts(1e6,1e6),l=new Mr({color:0,visible:!1});w(this,Ka,new Oe(a,l)),s(this,Ka).name="worldPlane",s(this,Vt).add(s(this,Ka)),o.gl?.canvas||t.appendChild(this.rendererDomElement),window.addEventListener("resize",s(this,wf),!1),s(this,Sf).addEventListener("change",s(this,Mf)),typeof ResizeObserver=="function"&&y.env?.NODE_ENV!=="test"&&(w(this,uc,new ResizeObserver(z3(x=>{s(this,$d).call(this,x[0].contentRect.width,x[0].contentRect.height)},50))),s(this,uc)?.observe(t)),t.classList.add("mappedin-map"),this.rendererDomElement.style.width=globalThis.MappedinDebug?.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=globalThis.MappedinDebug?.TEST_IOS?"1920px":"100%",y.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),this.mode!=="outdoors-overlay"&&this.rendererDomElement.tabIndex!==void 0&&this.rendererDomElement.removeAttribute("tabindex"),s(this,_).canvasWidth=this.rendererDomElement.clientWidth,s(this,_).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let c=this.canvasWidth,p=this.canvasHeight;s(this,R).watermarkSystem=new Y1(s(this,Rt),s(this,_),o?.watermark),s(this,R).watermarkSystem.on("texture-loaded",this.render),s(this,_).shouldMeasureCanvas=!0,s(this,_).pixelRatio=this.resolutionScale,s(this,Ff).call(this,Math.floor(c*this.resolutionScale),Math.floor(p*this.resolutionScale));let m=new zh(16777215,.3*Math.PI);m.position.set(-150,-150,350),s(this,Vt).add(m);let f=new S3(16777215,.741*Math.PI);s(this,Vt).add(f),s(this,R).cameraSystem=new nc(s(this,Rt),s(this,Vt),s(this,Sr).renderer,s(this,_),{mode:this.mode,canvasHeight:p,canvasWidth:c}),s(this,R).cameraSystem.on("user-dolly-start",s(this,so)),s(this,R).cameraSystem.on("user-pan-start",s(this,so)),s(this,R).cameraSystem.on("user-rotate-start",s(this,so)),s(this,R).cameraSystem.on("user-zoom-start",s(this,so)),s(this,R).cameraSystem.on("user-tilt-start",s(this,so)),s(this,R).cameraSystem.on("user-pedestal-start",s(this,so)),s(this,R).cameraSystem.on("user-dolly-end",s(this,ao)),s(this,R).cameraSystem.on("user-pan-end",s(this,ao)),s(this,R).cameraSystem.on("user-rotate-end",s(this,ao)),s(this,R).cameraSystem.on("user-zoom-end",s(this,ao)),s(this,R).cameraSystem.on("user-tilt-end",s(this,ao)),s(this,R).cameraSystem.on("user-pedestal-end",s(this,ao)),s(this,R).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),s(this,R).geometryInFocusSystem&&(s(this,R).geometryInFocusSystem.cameraDirty=!0),this.render()}),this.onAbort(()=>{s(this,R).cameraSystem.off("user-dolly-start",s(this,so)),s(this,R).cameraSystem.off("user-pan-start",s(this,so)),s(this,R).cameraSystem.off("user-rotate-start",s(this,so)),s(this,R).cameraSystem.off("user-zoom-start",s(this,so)),s(this,R).cameraSystem.off("user-tilt-start",s(this,so)),s(this,R).cameraSystem.off("user-pedestal-start",s(this,so)),s(this,R).cameraSystem.off("user-dolly-end",s(this,ao)),s(this,R).cameraSystem.off("user-pan-end",s(this,ao)),s(this,R).cameraSystem.off("user-rotate-end",s(this,ao)),s(this,R).cameraSystem.off("user-zoom-end",s(this,ao)),s(this,R).cameraSystem.off("user-tilt-end",s(this,ao)),s(this,R).cameraSystem.off("user-pedestal-end",s(this,ao)),s(this,R).renderSystem.off("measure-canvas",s(this,fc)),s(this,R).cameraSystem.off("change",this.render)}),s(this,R).pathSystem=new xf(s(this,_),this.convertTo3DMapPosition,this.getParentContainer,s(this,R).cameraSystem.convertZoomLevelToAltitude),s(this,R).pathSystem.on("animate:path",this.render),this.onAbort(()=>{s(this,R).pathSystem.off("animate:path",this.render)}),s(this,R).panBoundsSystem=new Q1(s(this,_),s(this,R).cameraSystem);let g=()=>{let{panBounds:x,fov:C,convertAltitudeToZoomLevel:v}=s(this,R).cameraSystem;if(s(this,R).panBoundsSystem.autoMinZoomLevel){if(x.radius<=0)return;let I=Math.min(s(this,_).canvasWidth/s(this,_).canvasHeight,1),M=C*Math.PI/180*I,O=Math.tan(M/2),{radius:T,center:P}=s(this,R).cameraSystem.panBounds,B=T/O,G=this.getThreeCamera().getWorldPosition(new ae),A=P.distanceTo(G),N=Math.abs(G.z-P.z),z=B*N/A,Z=v(z);nS(Z,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(Z)}this.publish("pan-bounds-change",s(this,R).cameraSystem.panBounds)};s(this,R).panBoundsSystem.on("update",g),this.onAbort(()=>{s(this,R).panBoundsSystem.off("update",g)}),this.camera=new X1(this,s(this,R),s(this,_)),this.camera.setZoomLevel(o.zoomLevel??OI),this.camera.setBearing(o.bearing??wI),this.camera.setPitch(o.pitch??MI),this.camera.setMaxZoomLevel(qU),this.camera.setMinZoomLevel(QU),s(this,R).domVisiblitySystem=new k1(s(this,_),s(this,gn)),s(this,R).domMutationSystem=new Z1(s(this,_),s(this,gn)),s(this,R).domMutationSystem.on("dimensions-update",()=>{s(this,R).collisionSystem.collidersDirty=!0,this.render()}),s(this,R).domDrawSystem=new z1(s(this,_)),s(this,R).collisionSystem=new I1(s(this,Qn),s(this,_),(o.useCollisionWorker??!0)&&(o.useWorkers??!0)),s(this,R).twoDDrawSystem=new A1(s(this,_),s(this,Ht),o.transformImageRequest),s(this,R).twoDDrawSystem.on("img:loaded",this.render),s(this,R).interactionSystem=new $m(this.rendererDomElement,s(this,_),s(this,Rt),s(this,Ka),s(this,R).cameraSystem.isUserInteracting),s(this,R).interactionSystem.on("doubletap-with-onefinger",x=>{s(this,R).cameraSystem.enableZoom&&this.camera.animateTo({center:this.projectScreenXYToCoordinate(x.clientX,x.clientY)?.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:s0,easing:"ease-out"})}),s(this,R).interactionSystem.on("singletap-with-twofinger",()=>{s(this,R).cameraSystem.enableZoom&&this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:s0,easing:"ease-out"})}),s(this,R).interactionSystem.on("hover",this.render),s(this,R).interactionSystem.on("click",x=>{if(x.entity2D?.id==="watermark"&&typeof s(this,R).watermarkSystem.options.onClick=="function"&&s(this,R).watermarkSystem.options.interactive){s(this,R).watermarkSystem.options.onClick();return}let C=x.entity3D?[x.entity3D?.id]:[];x.entity3D?.parentObject3D?.userData?.entityId&&C.push(x.entity3D?.parentObject3D?.userData?.entityId),this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(x.position),geometry:C,paths:x.entity3D?.components[0]instanceof za?[x.entity3D.id]:[],markers:x.entity2D?.components[0]instanceof is?[x.entity2D.id]:[],models:x.entity3D?.components[0]instanceof $a?[x.entity3D.id]:[],labels:x.entity2D?.components[0]instanceof ns?[x.entity2D.id]:[],containers:Array.isArray(x.groupContainers)?x.groupContainers.map(v=>v.userData.entityId):[],pointerEvent:x.pointerEvent})}),s(this,R).interactionSystem.on("hover",x=>{x.position&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(x.position),geometry:x.entity3D?[x.entity3D?.id]:[],paths:x.entity3D?.components[0]instanceof za?[x.entity3D.id]:[],markers:x.entity2D?.components[0]instanceof is?[x.entity2D.id]:[],models:x.entity3D?.components[0]instanceof $a?[x.entity3D.id]:[],labels:x.entity2D?.components[0]instanceof ns?[x.entity2D.id]:[],containers:Array.isArray(x.groupContainers)?x.groupContainers.map(C=>C.userData.entityId):[]})}),s(this,R).geometryInFocusSystem=new cb(s(this,_),s(this,Rt));let b=x=>{this.publish("geometry-in-focus",x)};s(this,R).geometryInFocusSystem.on("geometry-in-focus",b),this.onAbort(()=>{s(this,R).geometryInFocusSystem.off("geometry-in-focus",b)}),s(this,R).twoDVisiblitySystem=new _1(s(this,_)),s(this,R).drawSystem=new R1(s(this,_),this.convertTo3DMapPosition),s(this,R).drawSystem.on("texture-loaded",this.render),s(this,R).twoDProjectionSystem=new L1(s(this,_),s(this,Pf)),s(this,R).exporterSystem=new Wm(s(this,_)),s(this,R).meshOptimizationSystem=new D1(s(this,_),this.convertTo3DMapPosition),s(this,R).meshOptimizationSystem.on("model-loaded",this.render),s(this,R).meshOptimizationSystem.on("geometry-2d-added",this.render),s(this,R).meshOptimizationSystem.on("geometry-group-added",s(this,Cf)),this.onAbort(()=>{s(this,R).meshOptimizationSystem.off("model-loaded",this.render),s(this,R).meshOptimizationSystem.off("geometry-2d-added",this.render),s(this,R).meshOptimizationSystem.off("geometry-group-added",s(this,Cf))}),s(this,R).meshDetachmentSystem=new hb(s(this,_)),s(this,R).meshModificationSystem=new gb(s(this,_)),s(this,R).geometryDisposalSystem=new Cb(s(this,_)),s(this,R).borderSystem=new BS(s(this,_),this.convertTo3DMapPosition),s(this,R).customGeometrySystem=new eb(s(this,_),this.convertTo3DMapPosition),s(this,R).outlineInterpolationSystem=new ob(s(this,_)),s(this,R).renderSystem=new B1(s(this,Sr),s(this,_),this.mode,s(this,Vt),s(this,Rt),this.viewCamera,s(this,R)),s(this,R).imageSystem=new lb(s(this,_),this.convertTo3DMapPosition,o.bearing,o.naturalBearing,o.imagePlacementOptions),s(this,R).text3DSystem=new lS(s(this,_),this.convertTo3DMapPosition,o.useWorkers??!0),s(this,R).text3DSystem.on("render",this.render),s(this,R).imageSystem.on("image-loaded",this.render),s(this,R).renderSystem.on("pre-render",()=>this.publish("pre-render")),s(this,R).renderSystem.on("post-render",()=>this.publish("post-render")),s(this,R).renderSystem.on("measure-canvas",s(this,fc)),this.onAbort(()=>{s(this,R).renderSystem.off("pre-render",()=>this.publish("pre-render")),s(this,R).renderSystem.off("post-render",()=>this.publish("post-render")),s(this,R).renderSystem.off("measure-canvas",s(this,fc))}),s(this,R).outdoorLayersSystem=new ub(this.map),s(this,R).occlusion2DSystem=new Sb(s(this,_),this.convertTo3DMapPosition,s(this,Sr)),o.occlusionEnabled&&s(this,R).occlusion2DSystem.enable(),this.Debug=new Ib(this),o.environment!==!1&&w(this,dc,W(this,Br,TI).call(this)),s(this,Tb).call(this)}get viewCamera(){return s(this,If)}get canvasWidth(){return s(this,_).canvasWidth}get canvasHeight(){return s(this,_).canvasHeight}get resolutionScale(){return this.map?._getClampedPixelRatio(this.canvasWidth,this.canvasHeight)??Nc()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return s(this,Vs)}addGroupContainer(t,o,n){if(!s(this,_).geometry3DMap.has(t)&&!s(this,_).geometry2DMap.has(t)){let i=new nr(t);i.addEventListener("childadded",()=>{s(this,ht).call(this),s(this,ur).call(this)}),i.addEventListener("childremoved",()=>{s(this,ht).call(this),s(this,ur).call(this)}),o?.visible!==void 0&&(i.visible=o.visible),o?.altitude!==void 0&&i.setAltitude(o.altitude),o?.interactive!==void 0&&wo(i,o.interactive,s(this,_)),o?.focusable!==void 0&&ag(i,o.focusable),o?.preloadGeometry!==void 0&&(i.userData.preloadGeometry=o.preloadGeometry),s(this,_).geometry3DMap.set(t,i);let a=this.getParentContainer(n);a instanceof nr&&a.addEntity(i),s(this,ht).call(this),this.render()}else L.error(`Group container with ID '${t}' already exists. The group container cannot be added.`);return{id:t,type:"group-container"}}addCustomGeometry(t,o,n,i,a){if(s(this,_).geometry3DMap.has(t))L.error(`Custom geometry with ID '${t}' already exists. The custom geometry cannot be added.`);else{let l=new Bd(o,n),c=new yt(l,new fi(i));i?.interactive!==void 0&&wo(c,i.interactive,s(this,_)),c.id=t,l.mesh.userData={entityId:t,type:"custom-geometry"},s(this,_).geometry3DMap.set(c.id,c);let p=this.getParentContainer(a);a&&p instanceof nr?p.addEntity(c):s(this,_).entityScene.addEntity(c),s(this,ht).call(this),this.render()}return{id:t,type:"custom-geometry"}}addGeometryGroup(t,o,n,i){if(!s(this,_).geometry3DMap.has(t)&&!s(this,_).geometry2DMap.has(t)){let a=new Cn(t);a.addEventListener("childadded",()=>{s(this,ht).call(this),s(this,ur).call(this)}),a.addEventListener("childremoved",()=>{s(this,ht).call(this),s(this,ur).call(this)}),a.userData.dirty=!0,s(this,_).geometry3DMap.set(t,a);for(let c of o.features){if(c.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(c.geometry.type))continue;let p=c?.id||c?.properties?.id||nt(),{visible:m,altitude:f,...g}=n||{color:NS},b=s(this,R).meshOptimizationSystem.createEntityFromFeature(p,c,{outline:!0,...g});s(this,_).geometry3DMap.set(p,b),a.userData.entities3D.add(p)}a.setVisible(n?.visible??!0),n?.altitude!=null&&a.setAltitude(n.altitude);let l=this.getParentContainer(i);l instanceof nr&&l.addEntity(a),s(this,ht).call(this),this.render()}else L.error(`Geometry group with ID '${t}' already exists. The geometry group cannot be added.`);return s(this,R).outlineInterpolationSystem.geometries3DDirty=!0,{id:t,type:"geometry-group"}}addOccluder(t,o){let n=this.getParentContainer(o),i=s(this,R).occlusion2DSystem.reserveOccluderId();return n?.addOccluderFeature(t,i),i}addImage(t,o,n,i){try{T9(t,o,n)}catch(a){L.error(a);return}if(!s(this,_).geometry3DMap.has(t)&&!s(this,_).geometry2DMap.has(t)){let a=new ab(o),l=new yt(a,new fi(n));l.id=t||nt(),a.mesh.userData={entityId:l.id,type:"path"},s(this,_).geometry3DMap.set(l.id,l);let c=this.getParentContainer(i);c instanceof nr&&c.addEntity(l),s(this,ht).call(this),this.render()}else L.error(`Image with ID '${t}' already exists. The image cannot be added.`);return{id:t,type:"image"}}addModelGroup(t,o,n,{parent:i,onComplete:a}={}){try{Kw(t,o,n)}catch(l){L.error(l);return}if(!s(this,_).geometry3DMap.has(t)&&!s(this,_).geometry2DMap.has(t)){let l=new Cn(t);l.addEventListener("childadded",()=>{s(this,ht).call(this),s(this,ur).call(this)}),l.addEventListener("childremoved",()=>{s(this,ht).call(this),s(this,ur).call(this)}),s(this,_).geometry3DMap.set(t,l),l.userData.dirty=!0,l.userData.modelURL=n.url;for(let p of o.features){let m=p.id||p.properties.id||nt(),f=s(this,R).meshOptimizationSystem.createModelFromFeature(m,p,{...n});(p.properties.interactive!==void 0||n.interactive!=null)&&wo(f,p.properties.interactive??n.interactive,s(this,_)),f.parentId=l.userData.entityId,s(this,_).geometry3DMap.set(m,f),l.userData.entities3D.add(m)}let c=this.getParentContainer(i);c instanceof nr&&c.addEntity(l),s(this,ht).call(this),this.render()?.then(a)}else L.error(`Model group with ID '${t}' already exists. The model group cannot be added.`);return{id:t,type:"geometry-group"}}addMarker2D(t,o,n,i){let a=n?.id;try{W3(t,o,n||{})}catch(l){L.error(l);return}if(a===void 0||!s(this,_).geometry2DMap.has(a)&&!s(this,_).geometry3DMap.has(a)){let l=W(this,Br,CI).call(this,t,new is(o,n),n?.occluderId,n?.verticalOffset);l.id=a||String(l.id),a=l.id,n?.interactive!=null&&n.interactive!=="pointer-events-auto"&&wo(l,n?.interactive,s(this,_));let c=typeof n?.attachTo=="string"||typeof n?.attachTo=="number"?s(this,_).geometry3DMap.get(n.attachTo):void 0;c instanceof yt&&c.attach(l),this.getParentContainer(i)?.addEntity(l),this.render()}else L.error(`Marker2D with ID '${a}' already exists. The marker cannot be added.`);return{id:a,type:"marker"}}addText3D(t,o,n,i){if(!s(this,_).geometry3DMap.has(t)&&!s(this,_).geometry2DMap.has(t)){let a=new ig({...o,properties:{...o.properties,id:t,content:o.properties.text}}),l=new yt(a,new Cu(n?.appearance));l.id=t,a.mesh.userData.entityId=t.toString(),a.mesh.userData.type="text3d",s(this,_).geometry3DMap.set(t,l);let c=this.getParentContainer(i);c instanceof nr&&c.addEntity(l),s(this,ht).call(this),this.render()}else L.error(`Text3D with ID '${t}' already exists. The text3d cannot be added.`);return{id:t,type:"text3d"}}labelText3D(t,o,n={}){try{if(!o||!t)throw new Error("content and meshGeometryId are required");dS.parse(n)}catch(p){L.error(p);return}let i=s(this,_).geometry3DMap.get(t);if(i?.type!=="geometry"){L.error(".labelText3D failed: target incorrect");return}let a=i?.components[0];if(!a.feature.properties.textArea)return;if(a.textEntityId){let p=s(this,_).geometry3DMap.get(a.textEntityId);if(p?.type!=="text3d"){L.error(".labelText3D failed: existing text3d not found");return}return{id:p.id,type:p.type}}let l=new ig({type:"Feature",geometry:{coordinates:a.feature.properties.textArea?.position,type:"Point"},properties:{textArea:a.feature.properties.textArea,content:o,id:nt()}});l.polygonEntityId=t;let c=new yt(l,new Cu(n?.appearance));return a.textEntityId=c.id.toString(),l.mesh.userData.entityId=c.id.toString(),l.mesh.userData.type="text3d",s(this,_).geometry3DMap.set(c.id.toString(),c),n.parentId&&this.getParentContainer(n.parentId)?.addEntity(c),this.render(),{id:c.id,type:"text3d"}}addLabel2D(t,o,n,i){let a=n?.id;try{H3(t,o,n||{})}catch(l){L.error(l);return}if(a===void 0||!s(this,_).geometry2DMap.has(a)&&!s(this,_).geometry3DMap.has(a)){let l=W(this,Br,CI).call(this,t,new ns(o,n||{},s(this,_)),n?.occluderId,n?.verticalOffset);l.id=a||String(l.id),a=l.id,n?.interactive!=null&&wo(l,n?.interactive,s(this,_));let c=typeof n?.attachTo=="string"||typeof n?.attachTo=="number"?s(this,_).geometry3DMap.get(n.attachTo):void 0;c instanceof yt&&c.attach(l),this.getParentContainer(i)?.addEntity(l),s(this,ur).call(this),this.render()}else L.error(`Label2D with ID '${a}' already exists. The label cannot be added.`);return{id:a,type:"label"}}addPath(t,o={},n){try{n9(t,o||{})}catch(c){L.error(c);return}let i=new za(t,kS(o)),a=new yt(i,new fi({color:o?.color??"#ff834c",altitude:o?.verticalOffset??.1}));a.id=o?.id||nt(),i.mesh.userData={entityId:a.id,type:"path"},s(this,_).geometry3DMap.set(a.id,a),o?.interactive!=null&&wo(a,o?.interactive,s(this,_));let l=this.getParentContainer(n);return l instanceof nr&&l.addEntity(a),s(this,ht).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(t){s(this,R).watermarkSystem.options=t,s(this,R).watermarkSystem.dirty=!0,s(this,R).collisionSystem.collidersDirty=!0,this.render()}remove(t){let o;if(typeof t=="string"||typeof t=="number"?(o=s(this,_).geometry2DMap.get(t),o==null&&(o=s(this,_).geometry3DMap.get(t))):typeof t.id=="string"||typeof t.id=="number"?(o=s(this,_).geometry2DMap.get(t.id),o==null&&(o=s(this,_).geometry3DMap.get(t.id))):o=t,o!=null){if(o.type==="custom-geometry")s(this,_).geometry3DMap.delete(o.id),o.object3d&&_t(o.object3d);else if(o.type==="group-container"){s(this,_).geometry3DMap.delete(o.userData.entityId);for(let i of o.childrenIds.values())this.remove(i),o.userData.entities2D.delete(i);let n=o.components[1];n&&n.focusMesh&&_t(n.focusMesh),_t(o)}else if(o.type==="geometry-group"){s(this,_).geometry3DMap.delete(o.userData.entityId);for(let n of o.userData.entities3D.values())this.remove(n),o.userData.entities3D.delete(n);_t(o)}else if(o.type==="geometry"||o.type==="model"||o.type==="path"){let n=o.components[0],i=o.components[4];if(o.entities2D.size>0){for(let l of o.entities2D.values())this.remove(l);o.removeAllEntities()}let a=o.parentObject3D?.userData.entityId??o.parentId;if(a){let l=s(this,_).geometry3DMap.get(a);l instanceof Cn&&l.userData.entities3D.delete(o.id)}if(o.object3d&&_t(o.object3d),o.type==="geometry"){let l=o.components[3];l&&(l.enabled=!1,l.dirty=!0)}i&&"focusMesh"in i&&i.focusMesh!=null&&_t(i.focusMesh),"textMesh"in n&&n.textMesh!=null&&this.remove(n.textMesh.userData.entityId),s(this,_).geometry3DMap.delete(o.id)}else if(o.type==="marker"||o.type==="label"){let n=o.attachedTo;if(n){let i=s(this,_).geometry3DMap.get(n);i instanceof yt&&i.detach(o)}o.object3d&&_t(o.object3d),o.type==="label"&&delete s(this,R).twoDDrawSystem.textCache[o.id],s(this,_).geometry2DMap.delete(o.id)}else if(o.type==="image")o.object3d&&_t(o.object3d),s(this,_).geometry3DMap.delete(o.id);else if(o.type==="text3d"){_t(o.object3d);let{batchedText:n,textMesh:i,polygonEntityId:a}=o.components[0];if(i&&(n&&n.removeText(i),_t(i)),a){s(this,R).text3DSystem.remove(a);let l=s(this,_).geometry3DMap.get(a);l?.type==="geometry"&&(l.components[0].textMesh=void 0,l.components[0].textEntityId=void 0)}s(this,_).geometry3DMap.delete(o.id)}s(this,ht).call(this),s(this,ur).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return s(this,Vt)}getThreeCamera(){return s(this,Rt)}async setEnvironment(t){if(s(this,Vt))if(t==="basic"){s(this,dc)||w(this,dc,W(this,Br,TI).call(this));let o=await s(this,dc);s(this,Vt).environment=o}else s(this,Vt).environment=null}getEnvironment(){return s(this,Vt)?.environment?"basic":!1}getCurrentSceneGLTF(t){return s(this,R).exporterSystem.getCurrentSceneGLTF(t)}getBoundingArea(t){(s(this,R).renderSystem.threeDdirty||s(this,R).renderSystem.twoDdirty)&&this.renderSync();let o=new Qt;if(t==null)o.setFromObject(s(this,_).entityScene);else{let n=Bc(s(this,_),t);if(n?.type==="geometry"&&n?.object3d!=null){let i=n.components[0],a=i instanceof or?i.geometry:void 0;i.mesh instanceof Hh&&a?(a.computeBoundingBox(),a.boundingBox&&o.union(a.boundingBox)):o.setFromObject(n.object3d)}else(n?.type==="geometry-group"||n?.type==="group-container")&&n?.userData.entityId!=null&&o.setFromObject(n)}if(ll(o))return X3(o).map(this.convert3DMapPositionToCoordinate)}hasState(t){return Bc(s(this,_),t)!=null}getState(t){if(t==null)return{type:"map-view",hoverColor:s(this,_).hoverColor,text3dHoverColor:s(this,_).text3dHoverColor};let o=Bc(s(this,_),t);if(o?.type==="custom-geometry"){let n=o.components[0],i=o.components[1];return{id:o.id,type:"custom-geometry",visible:i.visible,altitude:i.altitude,parent:o.parentObject3D?.userData.entityId,position:this.convert3DMapPositionToCoordinate(n.position)}}else if(o?.type==="geometry-group"){let n=Array.from(o.userData.entities3D.values()),i=n?.[0],a=i?this.getState(i):{};return{id:o.userData.entityId,type:"geometry-group",visible:o.visible,altitude:o.altitude,color:a?.color,initialColor:a?.initialColor,side:a?.side??"double",opacity:a?.opacity,height:a?.height,texture:a?.texture,topColor:a?.topColor,topTexture:a?.topTexture,interactive:a?.interactive,children:n,bevel:a?.bevel}}else{if(o?.type==="group-container")return{id:o.userData.entityId,type:"group-container",visible:o.visible,altitude:o.getWorldPosition(tV).z??0,opacity:o.opacity,interactive:!!o.components[0],children:Array.from(o.childrenIds.values()).map(n=>this.getState(n)).filter(Boolean)};if(o?.type==="label"){let n=o.components[0],i=o.object3d.parent,a=i?.userData.entityId;return{id:o.id,type:"label",text:n.text||"",parent:{id:a,type:i?.type},position:this.convert3DMapPositionToCoordinate(o.position),enabled:n.enabled,visible:n.visible,initialRank:vu(n.initialRank),options:{rank:vu(n.rank),appearance:n.appearance,interactive:o.components[1]!=null,verticalOffset:o.verticalOffset,attachTo:o.attachedTo}}}else if(o?.type==="marker"){let n=o.components[0],i=o.object3d.parent,a=i?.userData.entityId;return{id:o.id,type:"marker",enabled:n.enabled,visible:n.visible,placement:n.options.placement,dynamicResize:n.options.dynamicResize,parent:{id:a,type:i?.type},position:this.convert3DMapPositionToCoordinate(o.position),element:n.containerEl,initialRank:vu(n.initialRank),contentHTML:n.contentHtml,options:{rank:vu(n.rank),interactive:o.components[1]!=null||!1,verticalOffset:o.verticalOffset,attachTo:o.attachedTo,lowPriorityPin:n.options.lowPriorityPin}}}else if(o?.type==="geometry"){let{color:n,hoverColor:i,initialColor:a,initialTopColor:l,topColor:c,altitude:p}=o.components[1],m=o.components[0],f=o.components[1],g=o.components[1],b=o.components[2],x=o.components[3],C=o.parentObject3D;return{id:o.id,type:"geometry",opacity:g.opacity,initialColor:a,color:n,focusable:f!=null&&f.focusMesh!=null,initialTopColor:l,topColor:c,side:g.side,hoverColor:i,hovered:!!b?.hover,height:g.height,visible:g.visible,outline:x?.enabled,showImage:g.showImage,texture:g.texture,topTexture:g.topTexture,flipImageToFaceCamera:g.flipImageToFaceCamera,parent:{id:C?.userData.entityId,type:C?.type},altitude:p,bevel:g.bevel,position:this.convert3DMapPositionToCoordinate(m.position),interactive:o.components[2]!=null,borderVisible:g.borderVisible,borderColor:g.borderColor,borderWidth:g.borderWidth}}else if(o?.type==="model"){let n=o.components[0],i=o.components[1],a=o.components[2];return{id:o.id,type:"model",position:n.mesh?this.convert3DMapPositionToCoordinate(n.mesh?.getWorldPosition(new ae)):this.convert3DMapPositionToCoordinate(n.position),interactive:a!=null,material:i.material,parent:o.parentObject3D?.parent?{id:o.parentObject3D.parent.userData.entityId,type:o.parentObject3D.parent.type}:void 0,visible:i.visible,verticalOffset:i.verticalOffset,color:i.color,opacity:i.opacity,rotation:i.rotation??Vc,scale:i.scale??Uc}}else if(o?.type==="path"){let n=o.components[0],i=o.components[2],a=o.components[1];return{id:o.id,type:"path",position:this.convert3DMapPositionToCoordinate(n.position),visible:a.visible,interactive:i!=null,completeFraction:n.completeFraction,color:a.color,accentColor:n.accentColor,width:n.width,animateArrowsOnPath:n.animateArrowsOnPath,displayArrowsOnPath:n.displayArrowsOnPath,verticalOffset:a.altitude}}else if(o?.type==="image"){let n=o.components[0];return{id:o.id,type:"image",position:this.convert3DMapPositionToCoordinate(n.position),visible:o.components[1].visible,verticalOffset:n.feature.properties.verticalOffset??0,opacity:o.components[1].opacity,flipImageToFaceCamera:o.components[1].flipImageToFaceCamera,width:n.feature.properties.width??0,height:n.feature.properties.height??0,rotation:n.feature.properties.rotation??0}}else if(o?.type==="text3d"&&o.components[0]instanceof ig&&"textArea"in o.components[0].feature.properties){LS(o);let n=o.components[0],i=o.components[1],{textMesh:a}=n,l=n.mesh?.parent;l instanceof nr&&l.children.find(m=>m.type==="batchedtext")?.getWorldPosition(s(this,kf)),s(this,Wd).set(0,0,0);let c=a?a.getWorldPosition(s(this,Wd)):s(this,Wd);return Object.assign({},Gc,i.getState(),{id:o.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(c.add(s(this,kf))),visible:n.visible??!1,content:n.feature.properties.content??""})}else return}}setState(t,o){if(typeof t=="object"&&o==null){"hoverColor"in t&&(bu(t.hoverColor)?s(this,_).hoverColor=t.hoverColor??s(this,_).hoverColor:L.warn(`Failed to update global hover color. Invalid color "${t.hoverColor}".`)),"text3dHoverColor"in t&&(s(this,_).text3dHoverColor=t.text3dHoverColor??s(this,_).text3dHoverColor);return}let n=Bc(s(this,_),t);if(n!=null){if(n.type==="custom-geometry"){let i=s(this,_).geometry3DMap.get(n.id);if(i instanceof yt&&i.components[0]instanceof Bd){let a=o;da(n,s(this,_),a.visible),Hc(n,a.altitude),m0(n,a.position,this.convertTo3DMapPosition),f0(n,this.getParentContainer(a.parent,!1)),wo(n,a.interactive,s(this,_))&&s(this,ht).call(this)}}else if(n.type==="path"){let i=o;wo(n,i.interactive,s(this,_))&&s(this,ht).call(this),Hc(n,i.verticalOffset),DS(n,s(this,_),i)}else if(n.type==="model"){let i=o;wo(n,i.interactive,s(this,_))&&s(this,ht).call(this),da(n,s(this,_),i.visible),RS(n,i)}else if(n.type==="group-container"){let i=o;da(n,s(this,_),i.visible)&&(s(this,R).pathSystem.verticalDistanceDirty=!0,s(this,R).geometryInFocusSystem.focusablesDirty=!0),Hc(n,i.altitude)&&(s(this,R).pathSystem.verticalDistanceDirty=!0),wo(n,i.interactive,s(this,_))&&s(this,ht).call(this),sg(n,s(this,_),i.opacity)&&(s(this,R).outlineInterpolationSystem.outlineOpacitiesDirty=!0),i.preloadGeometry&&n.userData.preloadGeometry!==!0&&(n.userData.preloadGeometry=!0,s(this,R).outlineInterpolationSystem.geometries3DDirty=!0),ag(n,i.focusable)&&(s(this,R).geometryInFocusSystem.focusablesDirty=!0)}else if(n.type==="geometry-group"){let i=o;da(n,s(this,_),i.visible),yS(n,s(this,_),i),g0(n,s(this,_),i.outline),i.height!=null&&u0(n,s(this,_),i.height),Hc(n,i.altitude),wS(n,s(this,_),i),bS(n,s(this,_),i.shading),sg(n,s(this,_),i.opacity)&&(s(this,R).outlineInterpolationSystem.outlineOpacitiesDirty=!0),wo(n,i.interactive,s(this,_))&&(s(this,ht).call(this),s(this,ur).call(this)),y0(n,s(this,_),i.side)}else if(n.type==="geometry"){if(n.components[0]instanceof or){let i=o;da(n,s(this,_),i.visible),g0(n,s(this,_),i.outline),xS(n,i),ag(n,i.focusable)&&(s(this,R).geometryInFocusSystem.focusablesDirty=!0),FS(n,i.renderOrder)&&(s(this,R).meshDetachmentSystem.dirty=!0),PS(n,i.opacity)&&(s(this,R).meshDetachmentSystem.dirty=!0,s(this,R).interactionSystem.dirty3D=!0,s(this,R).outlineInterpolationSystem.outlineOpacitiesDirty=!0),h0(n,i.flipImageToFaceCamera),Hc(n,i.altitude),i.height!=null&&u0(n,s(this,_),i.height),OS(n,i)&&(s(this,R).meshDetachmentSystem.dirty=!0),vS(n,i),TS(n,i.hoverColor),wo(n,i.interactive,s(this,_)),MS(n,i.hovered),y0(n,s(this,_),i.side),ES(n,i)}s(this,ht).call(this)}else if(n.type==="label"||n.type==="marker"){let i=o;CS(n,o,s(this,_)),SS(n,o,s(this,_))&&(s(this,ur).call(this),s(this,R).domMutationSystem.dirty=!0),m0(n,i.position,this.convertTo3DMapPosition),f0(n,this.getParentContainer(i.parent,!1))&&(s(this,ur).call(this),s(this,R).panBoundsSystem.dirty=!0),IS(n,i.enabled),da(n,s(this,_),i.visible)}else if(n.type==="image"){let i=o;da(n,s(this,_),i.visible),sg(n,s(this,_),i.opacity),h0(n,i.flipImageToFaceCamera)}else if(n.type==="text3d"){let i=o;AS(n,s(this,_),i)}this.render()}}convertTo3DMapPosition(t,o,n=0,i){if(Array.isArray(t))return this.convertTo3DMapPosition(t[1],t[0],t[2]??n,typeof o=="function"?o:void 0);if(typeof o!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:a,y:l}=rg(s(this,_).center?.[1]??0,s(this,_).center?.[0]??0,t,o);return i?(i.set(a,l,n),i):new ae(a,l,n)}get backgroundColor(){return typeof s(this,Sr).backgroundColor=="string"?s(this,Sr).backgroundColor:`#${s(this,Sr).backgroundColor.getHexString()}`}get backgroundAlpha(){return s(this,Sr).backgroundAlpha}getThreeRenderer(){return s(this,Sr)}getCenter(t){let o=Array.isArray(t)?t:this.getBoundingArea(t);return o?oS(o):void 0}isInView(t){let o=Bc(s(this,_),t);if(s(this,Ef).identity().multiply(s(this,Rt).projectionMatrix).multiply(s(this,Rt).matrixWorldInverse),s(this,hc).setFromProjectionMatrix(s(this,Ef)),o instanceof n0)return s(this,hc).containsPoint(o.position);if(o instanceof yt){let n=o?.components[0];if(n instanceof Bd||n instanceof $a)return s(this,hc).containsPoint(this.convertTo3DMapPosition(n.feature.geometry.coordinates));if(n instanceof or){let i=new Qt(this.convertTo3DMapPosition(n.featureBbox[1],n.featureBbox[0],0),this.convertTo3DMapPosition(n.featureBbox[3],n.featureBbox[2],0));return s(this,hc).intersectsBox(i)}}return!1}queryGeometry2DInView(t){let{screenOffsets:o,fullyContains:n}=t??{},[i,a,l,c]=aS(this.container,o),p=new qe(i,a,l,c);return s(this,R).collisionSystem.visibleCollidersQTree.queryRect(p).filter(b=>n?p.contains(b):p.intersects(b)).map(b=>s(this,_).geometry2DMap.get(b.userData.entityId)).filter(b=>b!=null).filter(b=>b.components[0]instanceof ns||b.components[0]instanceof is).map(b=>b.id.toString())}onMapLibreEvent(t,o){if(!this.map){L.warn(`Tried to add event listener "${t}" but MapLibre map is not initialized.`);return}this.map.on(t,o),s(this,hn)[t]=s(this,hn)[t]||[],s(this,hn)[t].push(o)}offMapLibreEvent(t,o){!this.map||!Array.isArray(s(this,hn)[t])||(this.map.off(t,o),s(this,hn)[t]=s(this,hn)[t].filter(n=>n!==o))}get aborted(){return s(this,mc).signal.aborted}onAbort(t){s(this,mc).signal.addEventListener("abort",t,{once:!0})}getSystems(){return s(this,R)}getInternalState(){return s(this,_)}getInternalTweenGroup(){return s(this,_).internalTweenGroup}getExternalTweenGroup(){return s(this,_).externalTweenGroup}computeMinZOffsetBetweenContainers(t,o,n){if(!t||!o)return-1;Ac(t,"group-container"),Ac(o,"group-container");let i=og(t,this.getThreeCamera()),a=o.clone(),l=og(a,this.getThreeCamera());if(!ll(i)||!ll(l))return-1;let c=0,p;n&&this.container.querySelectorAll(".debug-box").forEach(f=>f.remove());do{if(c>1e4)return-1;if(c+=20,a.position.z=c,a.updateMatrixWorld(),l.makeEmpty(),og(a,s(this,Rt),l),p=i.intersectsBox(l),n){let m=p0(i,"blue",this.container),f=p0(l,p?"red":"green",this.container);m.classList.add("debug-box"),f.classList.add("debug-box")}}while(p);return c}};Vt=new WeakMap,Rt=new WeakMap,dc=new WeakMap,If=new WeakMap,Vd=new WeakMap,Ka=new WeakMap,uc=new WeakMap,Hd=new WeakMap,Br=new WeakSet,SI=function(t){s(this,Vs)!=="outdoors-overlay"&&this.map?.setPixelRatio(t),s(this,_).pixelRatio=this.resolutionScale},_=new WeakMap,hn=new WeakMap,mc=new WeakMap,et=new WeakMap,Qn=new WeakMap,Ht=new WeakMap,gn=new WeakMap,Sr=new WeakMap,R=new WeakMap,Sf=new WeakMap,ur=new WeakMap,ht=new WeakMap,V9=function(){w(this,et,document.createElement("div")),s(this,et).classList.add("mappedin__smart-collision-engine__container"),w(this,Qn,document.createElement("canvas")),s(this,Qn).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(s(this,et)),w(this,Ht,document.createElement("canvas")),s(this,Ht).classList.add("mappedin__smart-collision-engine__container"),s(this,Ht).width=s(this,et).clientWidth*this.resolutionScale,s(this,Ht).height=s(this,et).clientHeight*this.resolutionScale,s(this,Ht).style.width=s(this,et).clientWidth+"px",s(this,Ht).style.height=s(this,et).clientHeight+"px",s(this,et).appendChild(s(this,Qn)),s(this,et).appendChild(s(this,Ht)),s(this,Qn).width=s(this,et).clientWidth,s(this,Qn).height=s(this,et).clientHeight,s(this,Ht).width=s(this,et).clientWidth*this.resolutionScale,s(this,Ht).height=s(this,et).clientHeight*this.resolutionScale,s(this,Ht).style.width=s(this,et).clientWidth+"px",s(this,Ht).style.height=s(this,et).clientHeight+"px"},H9=function(){w(this,gn,document.createElement("div")),s(this,gn).classList.add("mappedin-2d-entities"),Object.assign(s(this,gn).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(s(this,gn))},$9=function(){s(this,Ht).width=s(this,et).clientWidth*this.resolutionScale,s(this,Ht).height=s(this,et).clientHeight*this.resolutionScale,s(this,Ht).style.width=s(this,et).clientWidth+"px",s(this,Ht).style.height=s(this,et).clientHeight+"px",s(this,Qn).width=s(this,et).clientWidth,s(this,Qn).height=s(this,et).clientHeight,s(this,Ht).width=s(this,et).clientWidth*this.resolutionScale,s(this,Ht).height=s(this,et).clientHeight*this.resolutionScale,s(this,Ht).style.width=s(this,et).clientWidth+"px",s(this,Ht).style.height=s(this,et).clientHeight+"px",s(this,R).collisionSystem.collidersDirty=!0},Vs=new WeakMap,Cf=new WeakMap,Tf=new WeakMap,Mf=new WeakMap,wf=new WeakMap,$d=new WeakMap,Tb=new WeakMap,Of=new WeakMap,Pf=new WeakMap,Ff=new WeakMap,fc=new WeakMap,CI=function(t,o,n,i){let a=new n0(o,this.convertTo3DMapPosition(t[1],t[0],t[2]||0),i);return a.occluderId=n??s(this,R).occlusion2DSystem.backgroundId,s(this,_).geometry2DMap.set(a.id,a),a},hc=new WeakMap,Ef=new WeakMap,Df=new WeakMap,so=new WeakMap,ao=new WeakMap,TI=async function(){return Wa.load(kw).then(t=>(s(this,Vt)&&(s(this,Vt).environment?.dispose(),t.mapping=i3,s(this,Vt).environment=t,this.render()),t))},Mb=new WeakMap,wb=new WeakMap,Wd=new WeakMap,kf=new WeakMap;var tV=new ae,PI=II;d();function rV(e,r){oV(e,r)(e.getScene(),r),nV(e,r),r.addFolder("Export").add({export:async()=>{let a=await e.getCurrentSceneGLTF({binary:!0}),l=new Blob([a],{type:"application/octet-stream"});var c=document.createElement("a");document.body.appendChild(c),c.style.display="none";let p=window.URL.createObjectURL(l);c.href=p,c.download="scene.glb",c.click(),window.URL.revokeObjectURL(p)}},"export");let n=r.addFolder("Camera"),i={get bearing(){return e.camera.bearing},set bearing(a){e.camera.setBearing(a)},get pitch(){return e.camera.pitch},set pitch(a){e.camera.setPitch(a)},get zoomLevel(){return e.camera.zoomLevel},set zoomLevel(a){e.camera.setZoomLevel(a)}};n.add(i,"bearing",-359,359,1),n.add(i,"pitch",e.camera.minPitch,e.camera.maxPitch,1),n.add(i,"zoomLevel",e.camera.minZoomLevel,e.camera.maxZoomLevel,.1)}function oV(e,r){let t=r;return function o(n,i){let a=i.addFolder(`${[n.type]} ${n.id.slice(0,16)}`);if(i.close(),n.type==="geometry"||n.type==="model"||n.type==="path"||n.type==="image"){let l={get height(){let c=e.getState(n.id);return c?.type==="geometry"?c.height:0},set height(c){e.getState(n.id)?.type==="geometry"&&e.setState(n,{height:c})},set flipImageToFaceCamera(c){e.getState(n.id)?.type==="image"&&e.setState(n,{flipImageToFaceCamera:c})},get flipImageToFaceCamera(){let c=e.getState(n.id);return c?.type==="image"?c.flipImageToFaceCamera:!1},set visible(c){let p=e.getState(n.id);(p?.type==="geometry"||p?.type==="path"||p?.type==="image")&&e.setState(n,{visible:c})},get visible(){let c=e.getState(n.id);return c?.type==="geometry"||c?.type==="path"||c?.type==="image"?c.visible:!1},set outline(c){e.getState(n.id)?.type==="geometry"&&e.setState(n,{outline:c})},get outline(){let c=e.getState(n.id);return c?.type==="geometry"?c.outline:!1},get opacity(){let c=e.getState(n.id);return c?.type==="geometry"?c.opacity:1},set opacity(c){let p=e.getState(n.id);p?.type==="geometry"&&e.setState(p,{opacity:c})},get color(){let c=e.getState(n.id);return c?.type==="geometry"&&c.color?G3(c.color).toHexString():"#ffffff"},set color(c){let p=e.getState(n.id);p?.type==="geometry"&&e.setState(p,{color:c})},set interactive(c){let p=e.getState(n.id);(p?.type==="geometry"||p?.type==="model"||p?.type==="path")&&(e.setState(n,{interactive:c}),t.controllersRecursive().forEach(m=>m.updateDisplay()))},get interactive(){let c=e.getState(n.id);return c?.type==="geometry"||c?.type==="model"||c?.type==="path"?c.interactive:!1},get completeFraction(){let c=e.getState(n.id);return c?.type==="path"?c.completeFraction:1},set completeFraction(c){let p=e.getState(n.id);p?.type==="path"&&e.setState(p,{completeFraction:c})},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=e.getState(n.id);c?.type==="model"||c?.type==="path"||c?.type==="image"?e.camera.focusOn([c.position]):c?.type==="geometry"&&e.camera.focusOn(e.getBoundingArea(c))}),a.add(l,"visible"),n.type==="image"?a.add(l,"flipImageToFaceCamera"):(a.add(l,"interactive"),n.type==="path"&&a.add(l,"completeFraction",0,1,.1),n.type!=="model"&&(a.addColor(l,"color"),a.add(l,"outline"))),n.type==="geometry"&&(a.add(l,"height"),a.add(l,"opacity",0,1,.1))}else if(n.type==="marker"){let l={get interactive(){let c=e.getState(n.id);return c?.type==="marker"?c.options?.interactive:!1},set interactive(c){let p=e.getState(n.id);p?.type==="marker"&&(e.setState(p,{options:{interactive:c}}),t.controllersRecursive().forEach(m=>m.updateDisplay()))},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=e.getState(n.id);c?.type==="marker"&&e.camera.focusOn([c.position])}),a.add(l,"interactive")}else if(n.type==="label"){let l={get interactive(){let c=e.getState(n.id);return c?.type==="label"?c.options?.interactive:!1},set interactive(c){let p=e.getState(n.id);p?.type==="label"&&(e.setState(p,{options:{interactive:c}}),t.controllersRecursive().forEach(m=>m.updateDisplay()))},get text(){let c=e.getState(n.id);return c?.type==="label"?c.text:""},set text(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:c})},get"Text Color"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.textColor:"#000000"},set"Text Color"(c){e.getState(n.id)?.type==="label"&&e.setState(n.id,{text:l.text,options:{appearance:{textColor:c}}})},get"Text Size"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.textSize:10},set"Text Size"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{textSize:c}}})},get"Icon Size"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.iconSize:10},set"Icon Size"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{iconSize:c}}})},get"Pin Color"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.pinColor:"#000000"},set"Pin Color"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{pinColor:c}}})},get"Pin Color Inactive"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.pinColorInactive:"#000000"},set"Pin Color Inactive"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{pinColorInactive:c}}})},get"Pin Outline Color"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.pinOutlineColor:"#000000"},set"Pin Outline Color"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{pinOutlineColor:c}}})},get"Pin Outline Color Inactive"(){let c=e.getState(n.id);return c?.type==="label"?c.options.appearance?.pinOutlineColorInactive:"#000000"},set"Pin Outline Color Inactive"(c){let p=e.getState(n.id);p?.type==="label"&&e.setState(p,{text:l.text,options:{appearance:{pinOutlineColorInactive:c}}})},focus:()=>{}};a.add(l,"focus").onChange(()=>{let c=e.getState(n.id);c?.type==="label"&&e.camera.focusOn([c.position])}),a.add(l,"interactive"),a.add(l,"text"),a.add(l,"Text Size",10,50),a.add(l,"Icon Size",10,50),a.addColor(l,"Text Color"),a.addColor(l,"Active Background Color"),a.addColor(l,"Inactive Background Color"),a.addColor(l,"Active Foreground Color"),a.addColor(l,"Inactive Foreground Color")}else if(n.type==="geometry-group"){let l={get opacity(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.opacity:1},set opacity(c){e.getState(n.id)?.type==="geometry-group"&&e.setState(n,{opacity:c})},set visible(c){e.getState(n.id)?.type==="geometry-group"&&e.setState(n,{visible:c})},get visible(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.visible:!1},set outline(c){e.getState(n.id)?.type==="geometry-group"&&e.setState(n,{outline:c})},get outline(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.outline:!1},set altitude(c){e.getState(n.id)?.type==="geometry-group"&&e.setState(n,{altitude:c})},get altitude(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.altitude:0},set interactive(c){e.getState(n.id)?.type==="geometry-group"&&(e.setState(n,{interactive:c}),t.controllersRecursive().forEach(m=>m.updateDisplay()))},get interactive(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.interactive:!1},get shadingStart(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.shading?.start??0:0},set shadingStart(c){let p=e.getState(n.id);p?.type==="geometry-group"&&e.setState(p,{shading:{start:c}})},get shadingEnd(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.shading?.end??0:0},set shadingEnd(c){let p=e.getState(n.id);p?.type==="geometry-group"&&e.setState(p,{shading:{end:c}})},get shadingIntensity(){let c=e.getState(n.id);return c?.type==="geometry-group"?c.shading?.intensity??0:0},set shadingIntensity(c){let p=e.getState(n.id);p?.type==="geometry-group"&&e.setState(p,{shading:{intensity:c}})}};a.add(l,"visible"),a.add(l,"opacity",0,1,.1),a.add(l,"interactive"),a.add(l,"outline"),a.add(l,"altitude",0,100,1),a.add(l,"shadingStart",0,1,.1),a.add(l,"shadingEnd",0,1,.1),a.add(l,"shadingIntensity",0,1,.1)}else if(n.type==="group-container"){let l={set visible(c){e.getState(n.id)?.type==="group-container"&&e.setState(n,{visible:c})},get visible(){let c=e.getState(n.id);return c?.type==="group-container"?c.visible:!1},set interactive(c){let p=e.getState(n.id);p?.type==="group-container"&&(e.setState(p,{interactive:c}),t.controllersRecursive().forEach(m=>m.updateDisplay()))},get interactive(){let c=e.getState(n.id);return c?.type==="group-container"?c.interactive:!1}};a.add(l,"visible"),a.add(l,"interactive")}if(a.close(),n.children)for(let l of n.children.values())o(l,a)}}function nV(e,r){let t=r.addFolder("Watermark"),o={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};t.add(o,"padding",0,100,1),t.add(o,"scale",.5,1.5,.1),t.add(o,"color",["dark","light"]),t.add(o,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),t.add(o,"iconOnly"),t.onChange(()=>{e.updateWatermark(o)})}var W9="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",sV="https://auth.mappedin.com/oauth2/token";var Ob="";function FI(e){Ob=e,Z3(e)}var ec="";function EI(e){ec=e}async function z9(e,r){let t=r?.useWorkers??!0,o={...r,watermark:r?.watermark,attribution:r?.attribution,antialias:r?.antialias,occlusionEnabled:r?.occlusionEnabled,transformImageRequest:r?.transformImageRequest,naturalBearing:r?.naturalBearing??0,imagePlacementOptions:r?.imagePlacementOptions,onWebGLContextCreationError:r?.onWebGLContextCreationError,onWebGLContextLost:r?.onWebGLContextLost,onWebGLContextRestored:r?.onWebGLContextRestored,onWebGLRendererError:r?.onWebGLRendererError,useStandaloneCamera:r?.useStandaloneCamera??!1,useCollisionWorker:r?.useCollisionWorker??!0,useWorkers:t};if(t===!0&&r?.outdoorView?.enabled){let{Map:n,MercatorCoordinate:i}=await import("./outdoor-context-v5-6IFFZHAJ.js"),a=r.outdoorView.headers;a==null&&(a=await tS(sV));let l=r.center||[0,0],c=new n({container:e,style:r.outdoorView.style||W9,center:l,attributionControl:!1,zoom:r.zoomLevel??OI,pitch:r.pitch??MI,bearing:r.bearing??wI,transformRequest:K3(a),trackResize:!1,pixelRatio:r.outdoorView.lowDpi?1:Nc(),canvasContextAttributes:{antialias:typeof r.antialias=="boolean"?r.antialias:!0,powerPreference:"high-performance"},interactive:!1,validateStyle:!1,centerClampedToGround:!1,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),p=c.painter.context.gl,m=new PI(e,{center:l,zoomLevel:c.getZoom(),pitch:c.getPitch(),bearing:c.getBearing(),gl:p,map:c,mode:"outdoors-interleaved",...o}),f={center:c.getCenter().toArray(),zoom:c.getZoom(),bearing:c.getBearing(),pitch:c.getPitch(),elevation:c.getCenterElevation()};c.setMinZoom(m.camera.minZoomLevel),c.setMaxZoom(m.camera.maxZoomLevel),c.setMaxPitch(m.camera.maxPitch),c.setMinPitch(m.camera.minPitch),m.on("camera-change",P=>{f.center=P.center,f.zoom=P.zoomLevel,f.bearing=P.bearing,f.pitch=P.pitch,f.elevation=P.elevation,c.jumpTo(f)});let g=i.fromLngLat(l,0),b=eS(g,m.viewCamera,()=>{m.renderSync()}),x=async()=>{c&&(c.addLayer(b),m.renderSync())};m.onMapLibreEvent("style.load",x);let C=!1,v=!1,I=()=>{c&&(C||(m.publish("outdoor-view-loaded"),C=!0),v||(v=!0,m.publish("outdoor-style-loaded")))};m.onMapLibreEvent("idle",I);let M=P=>{P&&(P.sourceDataType==="metadata"||P.sourceDataType==="visibility"||P.dataType==="style"||P.type==="terrain")&&m.getSystems().htmlControlsSystem.updateData(c)},O=P=>{c&&P&&P.dataType==="style"&&P.type==="styledata"&&(v=!1),M(P)};m.onMapLibreEvent("styledata",O),m.onMapLibreEvent("sourcedata",M),m.onMapLibreEvent("terrain",M);let T=P=>{if(P.error?.url===W9){L.error(`Failed to load outdoor view style, possibly due to invalid token "${a["x-mappedin-tiles-key"]}"`);return}L.warn(P)};return m.onMapLibreEvent("error",T),m}else return new PI(e,o)}d();d();d();d();var Lf=class Lf{constructor(r,t,o){u(this,"id");u(this,"text");u(this,"target");u(this,"__type",Lf.__type);this.id=r,this.text=t,this.target=o}static is(r){return r.__type===Lf.__type}get focusTarget(){return this.target.anchorTarget}};u(Lf,"__type","label");var Hs=Lf;d();var gc,zd=class zd{constructor(r,t,o){u(this,"id");S(this,gc);u(this,"__type",zd.__type);u(this,"contentEl");this.id=r,this.contentEl=t,w(this,gc,o)}get target(){return s(this,gc)}get coordinate(){return s(this,gc).anchorTarget}toJSON(){return{id:this.id,__type:zd.__type,target:this.target,coordinate:this.coordinate}}static is(r){return r.__type===zd.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(r){w(this,gc,r)}};gc=new WeakMap,u(zd,"__type","marker");var $i=zd;d();var Rf,_f,Af=class Af{constructor(r,t,o){S(this,Rf);S(this,_f);u(this,"target");u(this,"__type",Af.__type);w(this,Rf,r),w(this,_f,t),this.target=o}static is(r){return r.__type===Af.__type}get id(){return s(this,Rf)}get url(){return s(this,_f)}};Rf=new WeakMap,_f=new WeakMap,u(Af,"__type","image-3d");var yc=Af;d();var bc,Zd=class Zd{constructor(r,t,o){u(this,"id");u(this,"groupId");u(this,"__type",Zd.__type);S(this,bc);this.id=r,this.groupId=t,w(this,bc,o)}get target(){return s(this,bc)}static is(r){return r.__type===Zd.__type}updateTarget(r){w(this,bc,r)}toJSON(){return{id:this.id,__type:Zd.__type,groupId:this.groupId,target:s(this,bc)}}};bc=new WeakMap,u(Zd,"__type","model");var xc=Zd;d();var Bf=class Bf{constructor(r,t){u(this,"id");u(this,"coordinates");u(this,"__type",Bf.__type);this.id=r,this.coordinates=t}static is(r){return r.__type===Bf.__type}get focusTarget(){return this.coordinates}};u(Bf,"__type","path-segment");var Yd=Bf,Xd=class Xd{constructor(r,t,o,n){u(this,"id");u(this,"animation");u(this,"coordinates");u(this,"segments");u(this,"__type",Xd.__type);this.id=r,this.animation=t,this.coordinates=o,this.segments=n.map(({id:i,coordinates:a})=>new Yd(i.toString(),a))}static is(r){return r.__type===Xd.__type}get focusTarget(){return this.coordinates}toJSON(){return{__type:Xd.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};u(Xd,"__type","path");var yn=Xd;d();var aV=7,Qa,vc,Nf=class{constructor(r,t){S(this,Qa);S(this,vc);w(this,Qa,r),w(this,vc,t?.precision??aV)}toJSON(){return{center:this.center,bearing:this.bearing,pitch:this.pitch,zoomLevel:this.zoomLevel}}get center(){let r=s(this,Qa).center;if(s(this,vc)===-1)return r;let t=ci(r.latitude,s(this,vc)),o=ci(r.longitude,s(this,vc));return new ce({latitude:t,longitude:o,floorId:r.floorId,verticalOffset:r.verticalOffset})}get bearing(){return s(this,Qa).bearing}get pitch(){return s(this,Qa).pitch}get zoomLevel(){return ci(s(this,Qa).zoomLevel,5)}};Qa=new WeakMap,vc=new WeakMap;d();var jf=class jf{constructor(r){u(this,"id");u(this,"__type",jf.__type);this.id=r}static is(r){return r.__type===jf.__type}get focusTarget(){return this}};u(jf,"__type","shape");var $s=jf;d();var Gf=class Gf{constructor(r,t){u(this,"id");u(this,"target");u(this,"__type",Gf.__type);this.id=r,this.target=t}static is(r){return r.__type===Gf.__type}};u(Gf,"__type","text-3d");var qa=Gf;d();d();d();var lV=new Map([["search-16x16",`<svg viewBox="0 0 16 16">
|
|
510
|
+
<path
|
|
511
|
+
fillRule="evenodd"
|
|
512
|
+
clipRule="evenodd"
|
|
513
|
+
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"
|
|
514
|
+
stroke="none"
|
|
515
|
+
/>
|
|
516
|
+
</svg>`],["close-16x16",`<svg viewBox="0 0 16 16">
|
|
517
|
+
<path
|
|
518
|
+
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"
|
|
519
|
+
stroke="none"
|
|
520
|
+
/>
|
|
521
|
+
<path
|
|
522
|
+
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"
|
|
523
|
+
stroke="none"
|
|
524
|
+
/>
|
|
525
|
+
</svg>`],["empty-64x40",`<svg viewBox="0 0 64 40">
|
|
526
|
+
<g>
|
|
527
|
+
<g clipPath="url(#clip0_499_175492)">
|
|
528
|
+
<path
|
|
529
|
+
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"
|
|
530
|
+
stroke="none"
|
|
531
|
+
fill="#F5F5F5"
|
|
532
|
+
/>
|
|
533
|
+
<path
|
|
534
|
+
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"
|
|
535
|
+
fill="none"
|
|
536
|
+
/>
|
|
537
|
+
<path
|
|
538
|
+
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"
|
|
539
|
+
fill="#FAFAFA"
|
|
540
|
+
/>
|
|
541
|
+
</g>
|
|
542
|
+
<defs>
|
|
543
|
+
<clipPath id="clip0_499_175492">
|
|
544
|
+
<rect width="64" height="40" fill="white" />
|
|
545
|
+
</clipPath>
|
|
546
|
+
</defs>
|
|
547
|
+
</g>
|
|
548
|
+
</svg>`],["caret-12x12",`<svg viewBox="0 0 12 12">
|
|
549
|
+
<path
|
|
550
|
+
stroke="none"
|
|
551
|
+
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"
|
|
552
|
+
/>
|
|
553
|
+
</svg>`],["plus-16x16",`<svg viewBox="0 0 16 16">
|
|
554
|
+
<path
|
|
555
|
+
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"
|
|
556
|
+
stroke="none"
|
|
557
|
+
/>
|
|
558
|
+
</svg>`],["recenter-16x16",`<svg viewBox="0 0 16 16">
|
|
559
|
+
<g stroke="none">
|
|
560
|
+
<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" />
|
|
561
|
+
<path
|
|
562
|
+
fillRule="evenodd"
|
|
563
|
+
clipRule="evenodd"
|
|
564
|
+
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"
|
|
565
|
+
/>
|
|
566
|
+
<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" />
|
|
567
|
+
</g>
|
|
568
|
+
</svg>`],["minus-16x16",`<svg viewBox="0 0 16 16">
|
|
569
|
+
<path
|
|
570
|
+
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"
|
|
571
|
+
stroke="none"
|
|
572
|
+
/>
|
|
573
|
+
</svg>`],["logo-horizontal-206x48",`<svg viewBox="0 0 206 48">
|
|
574
|
+
<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" />
|
|
575
|
+
<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" />
|
|
576
|
+
<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" />
|
|
577
|
+
<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" />
|
|
578
|
+
</svg>`],["share-16x16",`<svg viewBox="0 0 16 16">
|
|
579
|
+
<path
|
|
580
|
+
fillRule="evenodd"
|
|
581
|
+
clipRule="evenodd"
|
|
582
|
+
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"
|
|
583
|
+
stroke="none"
|
|
584
|
+
/>
|
|
585
|
+
</svg>`],["checkmark-16x16",`<svg viewBox="0 0 16 16">
|
|
586
|
+
<path
|
|
587
|
+
fillRule="evenodd"
|
|
588
|
+
clipRule="evenodd"
|
|
589
|
+
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"
|
|
590
|
+
stroke="none"
|
|
591
|
+
/>
|
|
592
|
+
</svg>`],["arrow-right-16x16",`<svg viewBox="0 0 16 16">
|
|
593
|
+
<path
|
|
594
|
+
fillRule="evenodd"
|
|
595
|
+
clipRule="evenodd"
|
|
596
|
+
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"
|
|
597
|
+
stroke="none"
|
|
598
|
+
/>
|
|
599
|
+
</svg>`],["arrow-up-16x16",`<svg viewBox="0 0 16 16">
|
|
600
|
+
<path
|
|
601
|
+
fillRule="evenodd"
|
|
602
|
+
clipRule="evenodd"
|
|
603
|
+
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"
|
|
604
|
+
stroke="none"
|
|
605
|
+
/>
|
|
606
|
+
</svg>`],["connection-stairs-16x16",`<svg viewBox="0 0 16 16">
|
|
607
|
+
<g stroke="none">
|
|
608
|
+
<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" />
|
|
609
|
+
<path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />
|
|
610
|
+
<path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />
|
|
611
|
+
<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" />
|
|
612
|
+
</g>
|
|
613
|
+
</svg>`],["connection-stairs-14x14",`<svg viewBox="0 0 14 14">
|
|
614
|
+
<path
|
|
615
|
+
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"
|
|
616
|
+
stroke="none"
|
|
617
|
+
/>
|
|
618
|
+
</svg>`],["connection-stairs-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
619
|
+
<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" />
|
|
620
|
+
<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" />
|
|
621
|
+
<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" />
|
|
622
|
+
<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" />
|
|
623
|
+
</svg>`],["connection-escalator-16x16",`<svg viewBox="0 0 16 16">
|
|
624
|
+
<g stroke="none">
|
|
625
|
+
<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" />
|
|
626
|
+
<path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />
|
|
627
|
+
<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" />
|
|
628
|
+
</g>
|
|
629
|
+
</svg>`],["connection-escalator-14x14",`<svg viewBox="0 0 14 14">
|
|
630
|
+
<path
|
|
631
|
+
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"
|
|
632
|
+
stroke="none"
|
|
633
|
+
/>
|
|
634
|
+
<path
|
|
635
|
+
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"
|
|
636
|
+
stroke="none"
|
|
637
|
+
/>
|
|
638
|
+
</svg>`],["connection-elevator-16x16",`<svg viewBox="0 0 16 16">
|
|
639
|
+
<g stroke="none">
|
|
640
|
+
<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" />
|
|
641
|
+
<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" />
|
|
642
|
+
<path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />
|
|
643
|
+
<path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />
|
|
644
|
+
</g>
|
|
645
|
+
</svg>`],["connection-elevator-14x14",`<svg viewBox="0 0 14 14">
|
|
646
|
+
<path
|
|
647
|
+
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"
|
|
648
|
+
stroke="none"
|
|
649
|
+
/>
|
|
650
|
+
<path
|
|
651
|
+
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"
|
|
652
|
+
stroke="none"
|
|
653
|
+
/>
|
|
654
|
+
<path
|
|
655
|
+
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"
|
|
656
|
+
stroke="none"
|
|
657
|
+
/>
|
|
658
|
+
</svg>`],["connection-elevator-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
659
|
+
<circle cx="1.9375" cy="4.4375" r="0.9375" />
|
|
660
|
+
<circle cx="1.9375" cy="7.5625" r="0.9375" />
|
|
661
|
+
<path
|
|
662
|
+
fillRule="evenodd"
|
|
663
|
+
clipRule="evenodd"
|
|
664
|
+
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"
|
|
665
|
+
/>
|
|
666
|
+
</svg>`],["new-tab-14x14",`<svg viewBox="0 0 14 14">
|
|
667
|
+
<g stroke="none">
|
|
668
|
+
<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" />
|
|
669
|
+
<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" />
|
|
670
|
+
</g>
|
|
671
|
+
</svg>`],["compress-16x16",`<svg viewBox="0 0 16 16">
|
|
672
|
+
<g stroke="none">
|
|
673
|
+
<path
|
|
674
|
+
id="Vector"
|
|
675
|
+
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"
|
|
676
|
+
/>
|
|
677
|
+
</g>
|
|
678
|
+
</svg>`],["washroom-14x14",`<svg viewBox="0 0 14 14" stroke="none">
|
|
679
|
+
<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" />
|
|
680
|
+
<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" />
|
|
681
|
+
<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" />
|
|
682
|
+
<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" />
|
|
683
|
+
<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" />
|
|
684
|
+
</svg>`],["point-of-interest-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
685
|
+
<path
|
|
686
|
+
stroke="none"
|
|
687
|
+
id="Subtract"
|
|
688
|
+
// Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs
|
|
689
|
+
fill-rule="evenodd"
|
|
690
|
+
clip-rule="evenodd"
|
|
691
|
+
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"
|
|
692
|
+
/>
|
|
693
|
+
</svg>`],["flag-20x20",`<svg viewBox="0 0 20 20" stroke="none">
|
|
694
|
+
<path
|
|
695
|
+
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"
|
|
696
|
+
stroke="none"
|
|
697
|
+
/>
|
|
698
|
+
</svg>`],["link-16x16",`<svg viewBox="0 0 16 16" stroke="none">
|
|
699
|
+
<path
|
|
700
|
+
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"
|
|
701
|
+
stroke="none"
|
|
702
|
+
/>
|
|
703
|
+
</svg>`]]),cV=/<svg([^>]*)>/g;function Z9(e,r,t){let o=lV.get(e);return o?o.replace(cV,`<svg$1 style="fill:${r}; width:${t}px; height:${t}px">`):""}var pV=e=>`
|
|
704
|
+
<div class="pin-shadow" style="background: ${e}"></div>
|
|
705
|
+
<svg width="${20*.9}px" height="${48*.9}px" viewBox="0 0 20 48">
|
|
706
|
+
<path
|
|
707
|
+
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"
|
|
708
|
+
fill="${e}"
|
|
709
|
+
stroke="white"
|
|
710
|
+
strokeWidth="2"
|
|
711
|
+
/>
|
|
712
|
+
</svg>
|
|
713
|
+
`,dV=e=>`
|
|
714
|
+
<div class="pin-shadow" style="background: ${e}"></div>
|
|
715
|
+
<svg width="36" height="42" viewBox="-2 -2 40 46">
|
|
716
|
+
<path
|
|
717
|
+
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"
|
|
718
|
+
fill="none"
|
|
719
|
+
stroke="white"
|
|
720
|
+
strokeWidth="4"
|
|
721
|
+
/>
|
|
722
|
+
<path
|
|
723
|
+
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"
|
|
724
|
+
fill="${e}"
|
|
725
|
+
/>
|
|
726
|
+
</svg>
|
|
727
|
+
`,DI="#722ED1",kI="#1890FF",X9=({type:e="departure",color:r=kI})=>`<div class="dropped-pin-wrapper">
|
|
728
|
+
${e==="departure"?pV(r):dV(r)}
|
|
729
|
+
</div>`,uV=e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},Y9=({type:e="stairs",color:r=DI,direction:t="up"})=>{let o=uV("default"),n=o/2+2,i=t&&t!=="none";return`<div class="mappedin-connection-marker">
|
|
730
|
+
<div class="connection-circle"
|
|
731
|
+
role="button"
|
|
732
|
+
style="background:${r}; width:${o}px; height:${o}px;"
|
|
733
|
+
>
|
|
734
|
+
${Z9("connection-"+e+"-16x16","white",n)||""}
|
|
735
|
+
</div>
|
|
736
|
+
${i?`<div style="margin-left: -${o*.2}px;">
|
|
737
|
+
<div class="bouncey">
|
|
738
|
+
<div class="connection-circle"
|
|
739
|
+
role="button"
|
|
740
|
+
style="width: ${o}px; height: ${o}px;">
|
|
741
|
+
<div class="${t==="up"?"":"arrow--down"}">
|
|
742
|
+
<svg viewBox="0 0 16 16" style="fill: white; width: ${n}px; height: ${n}px">
|
|
743
|
+
<path
|
|
744
|
+
fillRule="evenodd"
|
|
745
|
+
clipRule="evenodd"
|
|
746
|
+
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"
|
|
747
|
+
stroke="none"
|
|
748
|
+
/>
|
|
749
|
+
</svg>
|
|
750
|
+
</div>
|
|
751
|
+
</div>
|
|
752
|
+
</div>
|
|
753
|
+
</div>`:""}
|
|
754
|
+
</div>`};d();var J9=async e=>new Promise(r=>setTimeout(r,e));var mV={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},fV={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},el={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:mV,inactivePathOptions:fV,markerOptions:{departureColor:kI,destinationColor:DI},animatePathDrawing:!0},Ws,qn,bn,Re,Hf,zs,Ic,Jt,ei,To,xn,tl,vt,K9,Q9,LI,Uf,Pb,Jd,AI,Kd,Vf=class{constructor(r,t,o){S(this,vt);S(this,Ws,new Map);S(this,qn);S(this,bn);S(this,Re,el);S(this,Hf);S(this,zs);S(this,Ic);S(this,Jt,[]);S(this,ei);S(this,To,new Map);S(this,xn,new Map);S(this,tl,new Map);S(this,Kd,r=>{if(s(this,Re).createMarkers?.connection&&r.markers.length>0){let{instruction:t}=s(this,Ws).get(r.markers[0]);t?.action.toFloor&&(s(this,Re).setMapOnConnectionClick&&this.currentMap.setFloor(t.action.toFloor.id,"navigation-connection-click"),s(this,bn).publish("navigation-connection-click",{instruction:t,fromFloor:t.action.fromFloor,toFloor:t.action.toFloor}))}});w(this,qn,r),w(this,Hf,o),w(this,bn,t)}get currentMap(){return s(this,Hf).call(this)}get isMultiFloor(){if(!s(this,Jt).length)return!1;let r=new Set;for(let t of s(this,Jt))for(let o of t.coordinates)if(o.floorId&&(r.add(o.floorId),r.size>1))return!0;return!1}getPathById(r){return s(this,To).get(r)}getMarkerById(r){return s(this,Ws).get(r)}get paths(){let r=new Set;return s(this,To).forEach(({path:t})=>r.add(t)),Array.from(r)}get activeDirections(){return s(this,tl).get(s(this,ei))}get activePath(){if(s(this,ei))return s(this,To).get(s(this,ei).id)?.path}get floorStacks(){let r=s(this,bn).getMapData();if(!s(this,Jt).length||!r)return[];let t=new Set;for(let o of s(this,Jt))for(let n of o.coordinates)if(n.floorId){let i=r.getById("floor",n.floorId);i&&t.add(i.floorStack)}return Array.from(t)}get floors(){let r=s(this,bn).getMapData();if(!s(this,Jt).length||!r)return[];let t=new Set;for(let o of s(this,Jt))for(let n of o.coordinates)if(n.floorId){let i=r.getById("floor",n.floorId);i&&t.add(i)}return Array.from(t)}setActivePathByIndex(r){let t=s(this,Jt)[r];if(!s(this,Jt).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,Jt)[r]){L.warn(`Direction #${r} does not exist`);return}let o=s(this,xn).get(t);if(!o){L.warn("The direction is not a part of muli-direcional path");return}W(this,vt,Pb).call(this,o)}setActivePath(r){if(!s(this,Jt).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,tl).get(r)){L.warn(`Path "${r.id}" is not a part of muli-direcional path`);return}W(this,vt,Pb).call(this,r)}setActivePathByDirections(r){if(!s(this,Jt).length){L.warn("[setActivePathByDirections] Cannot set an active path before drawing. Call Navigation.draw() first.");return}let t=s(this,xn).get(r);if(!t){let o=s(this,Jt).find(n=>n.id===r.id);if(!o){L.warn("[setActivePathByDirections] Cannot find directions for id");return}t=s(this,xn).get(o)}if(!t){L.warn("[setActivePathByDirections] Cannot find path for directions");return}W(this,vt,Pb).call(this,t)}drawSync(r,t={}){s(this,Ic)&&this.clear(),w(this,Ic,!0),W(this,vt,LI).call(this,t);let o=Array.isArray(r)?r:[r],n=o[0],i=o[o.length-1],a=n.coordinates[0];w(this,Jt,o),a.floorId&&s(this,Re).setMapToDeparture&&this.currentMap.setFloor(a.floorId),s(this,Re).createMarkers?.departure&&W(this,vt,Jd).call(this,n.coordinates[0],"departure",n.instructions[0]);for(let l=0;l<o.length;l++){let c=o[l],p=l?{...s(this,Re).inactivePathOptions}:{...s(this,Re).pathOptions};if(c.coordinates.length<2){L.warn("Directions must have at least 2 coordinates");return}let m=this.currentMap.Paths.add(c.coordinates,{...p,animateDrawing:s(this,Re).animatePathDrawing}),f=m.paths.map(b=>b.id.toString()),g=new yn(nt(),m.animation,c.coordinates,m.paths);for(let b of f){s(this,To).set(b,{path:g,entityIds:f});let x=l?{...s(this,Re).inactivePathOptions,altitude:0}:{...s(this,Re).pathOptions,altitude:.05};s(this,qn).setState(b,x)}s(this,To).set(g.id,{path:g,entityIds:f}),s(this,xn).set(c,g),s(this,tl).set(g,c),s(this,Re).createMarkers?.connection&&W(this,vt,AI).call(this,c.instructions,"connection"),l===0&&(w(this,ei,s(this,xn).get(s(this,Jt)[0])),s(this,qn).on("click",s(this,Kd)))}s(this,Re).createMarkers?.destination&&W(this,vt,Jd).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),s(this,bn).mapObjects.forEach(l=>{l.processFloorChange(l.currentFloorId)}),W(this,vt,Uf).call(this)}async draw(r,t={}){s(this,zs)&&this.clear(),W(this,vt,LI).call(this,t);let o=Array.isArray(r)?r:[r],i=o[0].coordinates[0];return w(this,Jt,o),i.floorId&&s(this,Re).setMapToDeparture&&this.currentMap.setFloor(i.floorId),W(this,vt,Q9).call(this,o)}clear(){s(this,Ws).forEach((r,t)=>{this.currentMap.Markers.remove(t.toString())}),s(this,Ws).clear(),s(this,To).forEach(({path:r,entityIds:t})=>{s(this,To).delete(r.id),t.forEach(o=>s(this,To).delete(o)),this.currentMap.Paths.remove(t)}),s(this,zs)&&(s(this,zs).cancel(),w(this,zs,void 0)),s(this,Ic)&&w(this,Ic,!1),w(this,Jt,[]),s(this,xn).clear(),s(this,tl).clear(),w(this,ei,void 0),s(this,qn).off("click",s(this,Kd)),s(this,bn).mapObjects.forEach(r=>{r.processFloorChange(r.currentFloorId)}),W(this,vt,Uf).call(this)}};Ws=new WeakMap,qn=new WeakMap,bn=new WeakMap,Re=new WeakMap,Hf=new WeakMap,zs=new WeakMap,Ic=new WeakMap,Jt=new WeakMap,ei=new WeakMap,To=new WeakMap,xn=new WeakMap,tl=new WeakMap,vt=new WeakSet,K9=function(r){return r!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(r.type)},Q9=function(r){let t=r[0],o=r[r.length-1],n=!1;return w(this,zs,{promise:new Promise(async i=>{if(y.env.NODE_ENV!=="test"&&await J9(500),n||!r.length){i();return}s(this,Re).createMarkers?.departure&&W(this,vt,Jd).call(this,t.coordinates[0],"departure",t.instructions[0]);for(let a=0;a<r.length;a++){let l=r[a],c=a?{...s(this,Re).inactivePathOptions}:{...s(this,Re).pathOptions};if(l.coordinates.length<2){L.warn("Directions must have at least 2 coordinates"),i();return}let p=this.currentMap.Paths.add(l.coordinates,{...c,animateDrawing:s(this,Re).animatePathDrawing}),m=p.paths.map(g=>g.id.toString()),f=new yn(nt(),p.animation,l.coordinates,p.paths);for(let g of m){s(this,To).set(g,{path:f,entityIds:m});let b=a?{...s(this,Re).inactivePathOptions,altitude:0}:{...s(this,Re).pathOptions,altitude:.05};s(this,qn).setState(g,b)}if(s(this,To).set(f.id,{path:f,entityIds:m}),s(this,xn).set(l,f),s(this,tl).set(f,l),y.env.NODE_ENV!=="test"&&await p.animation,n){i();return}s(this,Re).createMarkers?.connection&&W(this,vt,AI).call(this,l.instructions,"connection"),a===0&&(w(this,ei,s(this,xn).get(s(this,Jt)[0])),s(this,qn).on("click",s(this,Kd)))}if(s(this,Re).createMarkers?.destination&&W(this,vt,Jd).call(this,o.coordinates[o.coordinates.length-1],"destination",o.instructions[o.instructions.length-1]),n){i();return}s(this,bn).mapObjects.forEach(a=>{a.processFloorChange(a.currentFloorId)}),W(this,vt,Uf).call(this),i()}),cancel:()=>{n=!0}}),s(this,zs).promise},LI=function(r){w(this,Re,{setMapOnConnectionClick:r.setMapOnConnectionClick??el.setMapOnConnectionClick,setMapToDeparture:r.setMapToDeparture??el.setMapToDeparture,pathOptions:{...el.pathOptions,...r.pathOptions},inactivePathOptions:{...el.inactivePathOptions,...r.inactivePathOptions},createMarkers:{...el.createMarkers,...r.createMarkers},markerOptions:{...el.markerOptions,...r.markerOptions},animatePathDrawing:r.animatePathDrawing??el.animatePathDrawing})},Uf=function(){s(this,bn).publish("navigation-state-change",{isMultiFloor:this.isMultiFloor,floorStacks:this.floorStacks,floors:this.floors,activeDirections:this.activeDirections,activePath:this.activePath,paths:this.paths})},Pb=function(r){w(this,ei,r),s(this,Jt).forEach(t=>{let o=s(this,xn).get(t);if(o){let n=s(this,To).get(o.id),i=n.path.id===s(this,ei).id?{...s(this,Re).pathOptions,altitude:.05}:{...s(this,Re).inactivePathOptions,altitude:0};n.entityIds.forEach(a=>{s(this,qn).setState(a,i)})}}),s(this,bn).publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath}),W(this,vt,Uf).call(this)},Jd=function(r,t,o){if(t==="connection"&&o){let n=o.action.type==="ExitConnection"?s(this,Re).markerOptions.departureColor:s(this,Re).markerOptions.destinationColor,i;if(typeof s(this,Re).createMarkers?.connection=="function"){let l=s(this,Re).createMarkers.connection(o);s(this,qn).setState(l.id.toString(),{options:{interactive:!0}}),i={id:l.id,type:"marker"}}else i=this.currentMap.Markers.add(o.coordinate,Y9({type:o.action.connection?.type??o.action.connectionType,color:n,direction:o.action.direction}),{interactive:!0,placement:"top",rank:"always-visible"});let a=this.currentMap.Markers.getContentEl(i.id.toString());if(!a)throw new Error("marker component should exist");s(this,Ws).set(i.id,{instruction:o,marker:new $i(i.id.toString(),a,o.coordinate)})}else{let n=t==="departure"?s(this,Re).markerOptions.departureColor:s(this,Re).markerOptions.destinationColor,i;typeof s(this,Re).createMarkers?.departure=="function"&&t==="departure"?i={id:s(this,Re).createMarkers.departure(o).id,type:"marker"}:typeof s(this,Re).createMarkers?.destination=="function"&&t==="destination"?i={id:s(this,Re).createMarkers.destination(o).id,type:"marker"}:i=this.currentMap.Markers.add(r,X9({type:t,color:n}),{placement:"top",rank:"always-visible"}),s(this,Ws).set(i.id,void 0)}},AI=function(r,t){r.filter(n=>W(this,vt,K9).call(this,n.action)).forEach(n=>{W(this,vt,Jd).call(this,n.coordinate,t,n)})},Kd=new WeakMap;d();var ge,Wf,Zs,Fb,RI,$f=class{constructor(r){S(this,Zs);S(this,ge);S(this,Wf);u(this,"interactions",{set:r=>{r?.pan!=null&&(s(this,ge).getSystems().cameraSystem.enablePan=r.pan),r?.zoom!=null&&(s(this,ge).getSystems().cameraSystem.enableZoom=r.zoom),r?.bearingAndPitch!=null&&(s(this,ge).getSystems().cameraSystem.enableRotate=r.bearingAndPitch)},enable:()=>{s(this,ge).getSystems().cameraSystem.enablePan=!0,s(this,ge).getSystems().cameraSystem.enableZoom=!0,s(this,ge).getSystems().cameraSystem.enableRotate=!0},disable:()=>{s(this,ge).getSystems().cameraSystem.enablePan=!1,s(this,ge).getSystems().cameraSystem.enableZoom=!1,s(this,ge).getSystems().cameraSystem.enableRotate=!1}});u(this,"setMinPitch",r=>{s(this,ge).camera.setMinPitch(r)});u(this,"setMaxPitch",r=>{s(this,ge).camera.setMaxPitch(r)});u(this,"setMinZoomLevel",r=>{s(this,ge).camera.setMinZoomLevel(r,!0)});u(this,"setMaxZoomLevel",r=>{s(this,ge).camera.setMaxZoomLevel(r)});w(this,Wf,r),w(this,ge,r.core)}setScreenOffsets(r){s(this,ge).camera.setInsetPadding(r)}get screenOffsets(){return s(this,ge).camera.insetsPadding}get panMode(){return s(this,ge).camera.panMode}setPanMode(r){if(r!=="default"&&r!=="elevation")throw new Error("Invalid pan mode");r!==this.panMode&&s(this,ge).camera.setPanMode(r)}getFocusOnTransform(r,t){let o=s(this,ge).camera.getCameraFrameForCoordinates(W(this,Zs,RI).call(this,r),{pitch:t?.pitch,bearing:t?.bearing,padding:t?.screenOffsets||this.screenOffsets,maxZoomLevel:t?.maxZoomLevel,verticalPadding:t?.axisAlignedPadding?.vertical,minZoomLevel:t?.minZoomLevel,duration:t?.duration,easing:t?.easing});return{center:new ce(o.center[1],o.center[0]),zoomLevel:o.zoomLevel,bearing:t?.bearing??this.bearing,pitch:t?.pitch??this.pitch}}focusOn(r,t){return s(this,ge).camera.focusOn(W(this,Zs,RI).call(this,r),{pitch:t?.pitch,bearing:t?.bearing,padding:t?.screenOffsets||this.screenOffsets,maxZoomLevel:t?.maxZoomLevel,minZoomLevel:t?.minZoomLevel,duration:t?.duration,verticalPadding:t?.axisAlignedPadding?.vertical,easing:t?.easing})}animateTo(r,t){let{center:o,zoomLevel:n,bearing:i,pitch:a}=r,l=o??this.center;return s(this,ge).camera.animateTo({center:o!=null?[l.longitude,l.latitude,s(this,ge).camera.elevation]:void 0,zoomLevel:n,bearing:i,pitch:a,duration:t?.duration??600,easing:t?.easing})}set(r){let{center:t=this.center,zoomLevel:o=this.zoomLevel,bearing:n=this.bearing,pitch:i=this.pitch}=r,a=[t.longitude,t.latitude];s(this,ge).camera.setCenter(a),s(this,ge).camera.setZoomLevel(o),s(this,ge).camera.setBearing(n),s(this,ge).camera.setPitch(i)}get center(){let r=s(this,ge).camera.center;return new ce(r[1],r[0],void 0)}setAutoMinZoomLevel(r){s(this,ge).camera.setAutoMinZoomLevel(r)}get autoMinZoomLevel(){return s(this,ge).camera.autoMinZoomLevel}get zoomLevel(){return s(this,ge).camera.zoomLevel}get pitch(){return s(this,ge).camera.pitch}get minPitch(){return s(this,ge).camera.minPitch}get maxPitch(){return s(this,ge).camera.maxPitch}get bearing(){let r=s(this,ge).camera.bearing;return(r<0?r+360:r)%360}get minZoomLevel(){return s(this,ge).camera.minZoomLevel}get maxZoomLevel(){return s(this,ge).camera.maxZoomLevel}setElevation(r){s(this,ge).camera.setElevation(r)}get elevation(){return s(this,ge).camera.elevation}animateElevation(r,t){return s(this,ge).camera.animateElevation(r,t)}updateFacadesInView(){s(this,ge).getSystems().geometryInFocusSystem.raycast()}};ge=new WeakMap,Wf=new WeakMap,Zs=new WeakSet,Fb=function(r){let t=s(this,ge).camera.elevation;return ce.is(r)&&r.floorId!=null?s(this,ge).getState(r.floorId)?.altitude??t:bo.is(r)?s(this,ge).getState(r.id)?.altitude??t:"floor"in r&&bo.is(r.floor)?s(this,ge).getState(r.floor.id)?.altitude??t:t},RI=function(r){let t=[],n=(Array.isArray(r)?r:[r]).flatMap(i=>i?.focusTarget??[i]);for(let i of n)if(i!=null)if(ce.is(i)){let a=W(this,Zs,Fb).call(this,i);t.push([i.longitude,i.latitude,a])}else if(i?.id!=null){let a=W(this,Zs,Fb).call(this,i);if(bo.is(i)&&s(this,Wf).getMapDataInternal()?.enterpriseMode){t.push(i.id);continue}else if("geoJSON"in i&&i.geoJSON.geometry.coordinates.length>0){N3(i.geoJSON,c=>{t.push([c[0],c[1],a])});continue}let l=s(this,ge).getBoundingArea(i.id);if(l)t.push(...l.map(c=>[c[0],c[1],a]));else if("geoJSONBoundingBox"in i){let c=W(this,Zs,Fb).call(this,i);if(i.geoJSONBoundingBox!=null){let p=[[i.geoJSONBoundingBox[0],i.geoJSONBoundingBox[1],c],[i.geoJSONBoundingBox[2],i.geoJSONBoundingBox[3],c]];t.push(...p)}}}else pv(i)&&t.push(i);return t};d();var Qd,zf=class{constructor({currentMapGetter:r}){S(this,Qd);w(this,Qd,r)}get currentMap(){return s(this,Qd).call(this)}async getCurrentSceneGLTF(r){let t=s(this,Qd).call(this);return t?t?.Exporter.getCurrentSceneGLTF(r):(L.error("There is no map to export. Please load a map first."),new Blob)}};Qd=new WeakMap;d();var ti,Xf,Zf=class{constructor({currentMapGetter:r}){S(this,ti,new Map);S(this,Xf);w(this,Xf,r)}get currentMap(){return s(this,Xf).call(this)}getAll(){return Array.from(s(this,ti).values()).map(r=>r.label)}getById(r){return s(this,ti).get(r)}add(r,t,o){let n=r.anchorTarget,i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Labels.add(n,t,{...o,attachTo:vd(r),rank:o?.rank==null||o?.rank==="initial"?"medium":o.rank}),l=new Hs(a.id.toString(),t,r);return s(this,ti).set(l.id,{label:l,entityId:l.id}),l}__EXPERIMENTAL__all(r){let t=[];return this.currentMap?.Labels.all({onCreate:(o,n,i)=>{let a=new Hs(o.toString(),n,i);s(this,ti).set(a.id,{label:a,entityId:a.id}),t.push(a)},labelOptions:r}),t}remove(r){let t=s(this,ti).get(r.id);t&&(this.currentMap?.Labels.remove(t),s(this,ti).delete(r.id.toString()))}removeAll(){let r=[];return s(this,ti).forEach(({label:t})=>{this.remove(t),r.push(t),s(this,ti).delete(t.id.toString())}),r}};ti=new WeakMap,Xf=new WeakMap;d();d();var Eb={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},q9={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},e8={color:"red",opacity:.2,height:Eb.height+.1,visible:!0,borderVisible:!1,borderColor:"red",borderWidth:.1},t8=.5,ri=class{constructor(r,t,o=new Map){u(this,"containerId");u(this,"layers");u(this,"renderer");this.containerId=t,this.layers=o,this.renderer=r}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(r){this.renderer.setState(this.containerId,{visible:r})}},r8=0,Sc,Yf=class{constructor(r,t,o,n,i,a,l,c){u(this,"id");u(this,"name");u(this,"elevation");u(this,"containerId");u(this,"externalId");u(this,"metadata");u(this,"shortName");u(this,"subtitle");u(this,"occluderId");u(this,"loaded",!1);u(this,"styleMap",{});u(this,"obstructions");u(this,"entrances");u(this,"spaces");u(this,"floorImages");u(this,"floorText");u(this,"areas");u(this,"renderer");u(this,"mapObject");u(this,"options");u(this,"layers",new Map);u(this,"footprint");u(this,"floorStackId");u(this,"multiFloorView");u(this,"mapDataInternal");u(this,"facadesByStyleId",new Map);S(this,Sc);u(this,"load",()=>{if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let r=this.renderer.addGroupContainer(`${Ai}-${this.id}`,{},this.id);this.layers.set(Ai,new ri(this.renderer,r.id.toString()));let t=this.renderer.addGroupContainer(`${Un}-${this.id}`,{},this.id);this.layers.set(Un,new ri(this.renderer,t.id.toString()));let o=this.renderer.addGroupContainer(`${Xt}-${this.id}`,{},this.id);this.layers.set(Xt,new ri(this.renderer,o.id.toString()));let n=this.renderer.addGroupContainer(`${Ri}-${this.id}`,{},this.id);if(this.layers.set(Ri,new ri(this.renderer,n.id.toString())),this.footprint?.geometry!=null&&this.footprint?.geometry.coordinates.length!==0){let i=Eb;if(this.obstructions!=null&&this.obstructions.features.length>0){let c=this.obstructions.features.filter(p=>p.geometry.type==="LineString"&&p.properties.kind?.toLowerCase()==="wall"&&p.properties.footprintComponent===!0);c!=null&&c.length>0&&(i=this.styleMap[c[0].properties?.id])}let a=this.renderer.addGeometryGroup(`Footprint-${this.id}`,{features:[{geometry:this.footprint.geometry,properties:{id:`Footprint-Floor-${this.id}`}}]},{...i,height:this.multiFloorView?.floorGap??10,altitude:0,outline:this.options.style?.outlines??!0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":i.color,renderOrder:2},this.id);this.layers.set(od,new ri(this.renderer,a.id.toString()));let l=this.renderer.addGroupContainer(`${Da}-${this.id}`,{},this.id);this.layers.set(Da,new ri(this.renderer,l.id.toString()))}if(this.spaces!=null&&this.spaces.features.length>0){let i=[],a=new Map;this.spaces.features.filter(m=>m.geometry.type==="Polygon"&&m.properties.kind?.toLowerCase()!=="void").forEach(m=>{let f=this.mapDataInternal?.facadesBySpaceId[m.properties.id];if(f){let g=a.get(f.id)||[];a.set(f.id,[...g,m])}else i.push(m)});let l=s1(i,this.styleMap),c=this.renderer.addGroupContainer(`spaces-${this.id}`,{},o),p=0;for(let[m,f]of l){let g=this.renderer.addGeometryGroup(`Spaces-${this.id}-${p}`,{features:f},xd(m,this.options),c);p++;let b=c.id.toString();this.layers.get(Xt).layers.set(m.id||b,g.id.toString())}if(a.size>0){let m=this.renderer.addGroupContainer(`${jl}-${this.id}`,{},this.id);this.layers.set(jl,new ri(this.renderer,m.id.toString()));for(let[f,g]of a){let b=this.renderer.addGroupContainer(f,{focusable:!0},m),x=this.renderer.addGroupContainer(`${f}-geometry`,{},b),C=s1(g,this.styleMap),v=0;for(let[I,M]of C){let O=this.renderer.addGeometryGroup(`Facades-${this.id}-${f}-${v}`,{features:M},{...xd(I,this.options),renderOrder:3},x);v++;let T=I.id||O.id.toString();this.layers.get(jl).layers.set(`${f}-${T}`,O.id.toString()),this.facadesByStyleId.has(T)?this.facadesByStyleId.get(T)?.push(f):this.facadesByStyleId.set(T,[f])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let i=this.obstructions.features.filter(x=>x.geometry.type==="Polygon"&&(x.properties.kind==="object"||x.properties.kind==="unknown")),a=s1(i,this.styleMap),l=this.renderer.addGroupContainer(`objects-${this.id}`,{},o),c=0;for(let[x,C]of a){let v=this.renderer.addGeometryGroup(`Objects-${this.id}-${c}`,{features:C},xd(x,this.options),l);c++;let I=l.id.toString();this.layers.get(Xt).layers.set(x.id||I,v.id.toString())}let p=this.obstructions.features.filter(x=>x.geometry.type==="LineString"&&x.properties.kind?.toLowerCase()==="wall"&&x.properties.footprintComponent===!1),m=this.obstructions.features.filter(x=>x.geometry.type==="LineString"&&x.properties.kind?.toLowerCase()==="wall"&&x.properties.footprintComponent===!0),f=this.entrances,g=Eb,b=Eb;if(p!=null&&p.length>0){let x=this.styleMap[p[0].properties?.id];x!=null&&(g={...x}),b=g;let{walls:C,entrances:v}=kv(p,f?.features||[]),I=Math.max(g.height-.11,t8),M={...q9,height:I},O=this.renderer.addGeometryGroup(`InteriorDoors-${this.id}`,v,M,o);this.layers.get(Xt).layers.set(td,O.id.toString());let T=this.renderer.addGeometryGroup(`Walls-${this.id}`,{features:[C]},xd(g,this.options),o);this.layers.get(Xt).layers.set(Ea,T.id.toString())}if(m!=null&&m.length>0){let x=this.styleMap[m[0].properties?.id];x!=null&&(b={...x,id:Li});let{walls:C,entrances:v}=kv(m,f?.features||[]),I=Math.max(b.height-.11,t8),M={...q9,height:I},O=this.renderer.addGeometryGroup(`ExteriorDoors-${this.id}`,v,M,o);this.layers.get(Xt).layers.set(rd,O.id.toString());let T=this.renderer.addGeometryGroup(`ExteriorWalls-${this.id}`,{features:[C]},xd(b,this.options),o);this.layers.get(Xt).layers.set(Li,T.id.toString())}}if(this.floorImages!=null){let i=this.renderer.addGroupContainer(`images-${this.id}`,{},this.id);for(let a of this.floorImages.features||[])if(!("anchorId"in a.properties||"anchorId"in a.properties&&a.properties?.anchorId==null)){let l=X6(a,r8);this.mapObject.api.Image3D.add(new ce({latitude:a.geometry.coordinates[1],longitude:a.geometry.coordinates[0],floorId:this.id}),a.properties.path,{id:l,flipImageToFaceCamera:this.options.flipImagesToFaceCamera??!0,...a.properties}),r8++}this.layers.set(nd,new ri(this.renderer,i.id.toString()))}if(this.floorText!=null)for(let i of this.floorText.features||[]){let a=0;"geometryId"in i.properties?a=this.renderer.getState(i.properties.geometryId)?.height??0:a=i.properties.verticalOffset??0,this.renderer.addText3D(nt(),{...i,properties:{...i.properties,verticalOffset:a}},{},this.id)}if(this.areas!=null){let i=this.renderer.addGroupContainer(`areas-${this.id}`,{},this.id);this.layers.set(gv,new ri(this.renderer,i.id.toString()));let a=this.renderer.addGeometryGroup(`Areas-${this.id}`,{features:this.areas.features},{color:e8.color},i);for(let l of this.areas.features||[])this.renderer.setState(l.properties.id,{...e8,visible:!1});this.layers.get(gv).layers.set(a.id.toString(),a.id.toString())}return this.multiFloorView?.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorGap}),this.renderer.render(),this});this.mapObject=o,this.renderer=o.renderer,this.id=t.id,this.options=i;let p=this.renderer.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:i.preloadFloors?.map(m=>m.id).includes(t.id)},r);this.containerId=p.id.toString(),this.externalId=t.externalId,this.metadata=t.metadata,this.shortName=t.shortName,this.subtitle=t.subtitle,this.name=t.name,this.elevation=t.elevation,a!=null&&l!=null&&(this.styleMap=l,this.spaces=a.space[this.id],this.entrances=a.entrance[this.id],this.areas=a.area?.[this.id],this.obstructions=a.obstruction[this.id],this.floorImages=a.floorImages?.[this.id],this.floorText=a.enterprise?.floorText?.[this.id],this.footprint=a["floor.geojson"]?.features.find(m=>m.properties.id===t.id)),this.floorStackId=r,this.multiFloorView=n,this.mapDataInternal=c}get geoJSONBoundingBox(){if(s(this,Sc))return s(this,Sc);if(!this.footprint){L.warn(`Attempting to get bounding box with no footprint for floor ${this.id}`);return}return w(this,Sc,a1(this.footprint)),s(this,Sc)}addOccluder(){let r=this.layers.get(Da);if(r==null||r.containerId==null||this.footprint==null){L.warn(`Tried to add occluder to floor ${this.id} but the floor does not have an occlusion layer.`);return}this.occluderId=this.renderer.addOccluder(this.footprint,r.containerId)}get hasFacadeGeometry(){return this.facadesByStyleId.size>0}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(r){this.renderer.setState(this.containerId,{visible:r})}};Sc=new WeakMap;d();var qd,Jf=class{constructor(r,t,o,n){u(this,"id");u(this,"externalId");u(this,"name");u(this,"type");u(this,"floorIds");u(this,"defaultFloorId");u(this,"floorObjects",[]);u(this,"floorObjectsByElevation",new Map);u(this,"metadata");u(this,"containerId");u(this,"facade");u(this,"renderer");S(this,qd);this.id=r.id,this.externalId=r.externalId,this.name=r.name,this.type=r.type,this.metadata=r.metadata,this.floorIds=r.floors??r.maps,this.defaultFloorId=r.defaultFloor,this.renderer=o;let i=o.addGroupContainer(this.id,{visible:!0,interactive:!0},t);this.containerId=i.id.toString(),this.facade=n}get defaultFloor(){if(s(this,qd)==null){if(this.floorObjects.length===0)throw new fr(`No floors in floor stack (${this.id}). Could not get default floor.`);let r;this.defaultFloorId&&(r=this.floorObjects.find(t=>t.id===this.defaultFloorId)),r||(r=this.floorObjects.reduce((t,o)=>Math.abs(o.elevation)<Math.abs(t.elevation)?o:t)),w(this,qd,r)}return s(this,qd)}get isOutdoors(){return this.type?.toLowerCase()==="outdoor"?!0:this.facade!=null?!1:this.floorObjects.some(t=>t.hasFacadeGeometry)}addFloor(r){if(this.floorObjectsByElevation.has(r.elevation)){L.error(`Floor with same elevation ${r.elevation} already exists in Stack (${this.id}). Floor (${r.id}) will not be added.`);return}this.floorObjects.push(r),this.floorObjectsByElevation.set(r.elevation,r),this.facade&&this.renderer.setState(r.containerId,{focusable:!0})}loadAllFloors(){for(let r of this.floorObjects)r.load(),!this.isOutdoors&&!r.hasFacadeGeometry&&r.footprint!=null&&r.addOccluder()}};qd=new WeakMap;d();function BI(e,r,t,o){let n={outdoorOpacity:1,floorStates:[]},i=e.sort((m,f)=>m.elevation-f.elevation),a=Math.min(0,i[0].elevation),l=i[i.length-1].elevation,c,p;for(let m=a;m<=l;m++){let f=i.find(v=>v.elevation===m);if(f==null){m>=0&&(c==null?c=m:p=m);continue}let g=0,b=m<0?Math.abs(f.elevation)*t:t,x=!1;if(c===0&&p!=null){let v=t*p;g=-v,b=v,x=!0}else if(c!=null&&p!=null){let v=c,I=e.find(O=>O.elevation===v-1),M=n.floorStates.find(O=>O.floor===I);if(M){let O=t*(p-c+2);M.state.footprint={...M.state.footprint,altitude:0,height:O,visible:!0}}}c=void 0,p=void 0;let C={floor:f,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};n.floorStates.push(C),f.id===r.id?(C.state.visible=!0,C.state.geometry.visible=!0,C.state.labels.enabled=!0,C.state.markers.enabled=!0,C.state.occlusion.enabled=!0,(f.elevation<0||x)&&(f.elevation<0&&(n.outdoorOpacity=.2),C.state.footprint.height=b,C.state.footprint.altitude=g,C.state.footprint.visible=!0)):o.includes(f.id)&&f.elevation<r.elevation?(C.state.visible=!0,C.state.geometry.visible=!0,C.state.markers.enabled=!0,C.state.occlusion.enabled=!0,C.state.footprint.visible=!0,f.elevation<0?(C.state.footprint.height=b,C.state.footprint.altitude=g,n.outdoorOpacity=.2):(C.state.footprint.height=b,C.state.footprint.altitude=g)):r.elevation>0&&f.elevation<r.elevation&&f.elevation>=0&&(C.state.visible=!0,C.state.footprint.visible=!0,C.state.footprint.height=t,C.state.footprint.altitude=g)}return n}var Wi,Kf=class extends Ie{constructor(t,o,n,i){super();u(this,"floorStacksById",new Map);u(this,"floorsById",new Map);u(this,"startingFloorId","");u(this,"currentFloorId","");u(this,"currentFloorStackId","");u(this,"outdoorFloorStacks",new Set);u(this,"id");u(this,"renderer");u(this,"api");u(this,"mvf");u(this,"options",{});u(this,"styleMap");u(this,"animations",new Map);u(this,"Models",{add:(t,o,n)=>{let{floorId:i,scale:a,...l}=n,c=i?this.floorsById.get(i):this.currentFloor,p={...l};a!=null&&(p.scale=Array.isArray(n.scale)?n.scale:[n.scale,n.scale,n.scale]);let m=this.renderer.addModelGroup(t,{type:"FeatureCollection",features:o.map(f=>({type:"Feature",properties:{id:nt(),rotation:n.rotation,scale:p.scale,interactive:n.interactive,verticalOffset:f.verticalOffset+(n.verticalOffset??0)},geometry:{type:"Point",coordinates:dn(f)}}))},p,{parent:c.id});if(m==null)throw new fr("error creating model");return this.renderer.getState(m).children},remove:(t,o)=>{this.renderer.remove(t),this.renderer.getState(o).children.length===0&&this.renderer.remove(o)}});u(this,"Image3D",{add:(t,o,n)=>{let{floorId:i,flipImageToFaceCamera:a,...l}=n,c=i?this.floorsById.get(i):this.currentFloor,p={type:"Feature",properties:l,geometry:{type:"Point",coordinates:t}};return this.renderer.addImage(n.id??nt(),p,{url:o,flipImageToFaceCamera:a??!1},c.id)},remove:t=>{this.renderer.remove(t)},removeAll:()=>{}});u(this,"Markers",{add:(t,o,n)=>{let i=Av(t,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),{attachTo:a,...l}=n,c=l;l.rank==="initial"&&(c.rank="medium");let p=i.layers.get(Un),m=this.renderer.addMarker2D(dn(t),o,{...c,occluderId:i?.occluderId,attachTo:a},p?.containerId);if(!m)throw new fr("Failed to create Marker");return m},remove:t=>{this.renderer.remove(t)},getContentEl:t=>{let o=this.renderer.getState(t);if(o?.type==="marker")return o.element},removeAll:()=>{},setPosition:(t,o,n)=>{let i=this.renderer.getState(t),a=n?this.floorsById.get(n):this.currentFloor;if(!i){L.error(`Failed to retrieve state for Marker with id "${t}".`);return}if(i.type!=="marker"){L.error(`Geometry with id "${t}" is not of type "marker".`);return}this.renderer.setState(i,{position:o,parent:a?.layers.get(Un)?.containerId})},animateTo:(t,o,n,i)=>{let a=this.renderer.getState(t),l=n?this.floorsById.get(n):this.currentFloor;if(!a)return L.error(`Failed to retrieve state for Marker with id "${t}".`),Promise.resolve();if(a.type!=="marker")return L.error(`Geometry with id "${t}" is not of type "marker".`),Promise.resolve();let c={duration:1e3,easing:"ease-in-out",...i};this.cancelAnimation(t);let p=new Wn({lon:a.position[0],lat:a.position[1]}).to({lon:o[0],lat:o[1]},c.duration).easing(Gi[c.easing]).onUpdate(({lon:m,lat:f})=>{if(!this.renderer.getState(t))this.cancelAnimation(t);else{let b=l?.layers.get(Un)?.containerId;b&&this.Markers.setPosition(t,[m,f],b)}}).start();return this.renderer.getInternalTweenGroup().add(p),this.renderer.render(),this.animations.set(t,p),Lv(p).then(()=>{this.animations.delete(t)})}});u(this,"Exporter",{getCurrentSceneGLTF:async t=>this.renderer.getCurrentSceneGLTF(t)});u(this,"Shapes",{add:(t,o,n)=>{let i=n?.floorId?this.floorsById.get(n?.floorId):this.currentFloor,a="shape-"+nt();return this.renderer.addGeometryGroup(a,t,o,i.id),a},remove:t=>(this.renderer.remove(t.id),t.id)});u(this,"Text3D",{label:(t,o,n)=>{if(!this.api.getMapDataInternal()?.enterpriseMode){L.warn("Enterprise mode is not enabled, skipping label creation");return}let i=o8(this.renderer,t,o,n);if(i)return{textInfo:i,target:t}},labelAll:(t={})=>{if(!this.api.getMapDataInternal()?.enterpriseMode)return L.warn("Enterprise mode is not enabled, skipping label creation"),[];let o=this.api.getMapData();if(!o)return[];let n=[];return o.getByType("space").forEach(i=>{if(i.locations[0]){let a=o8(this.renderer,i,i.locations[0]?.name??i.name,t);a&&n.push({textInfo:a,target:i})}}),n},remove:t=>{if(!this.api.getMapDataInternal()?.enterpriseMode){L.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(t),t}});u(this,"Labels",{all:({onCreate:t,labelOptions:o={}})=>{for(let n of Object.entries(this.mvf.space)){let[i,a]=n;a&&a.features.forEach(l=>{let c=this.api.getMapData()?.getById("space",l.properties.id);if(!c)return;let p=this.styleMap[l.properties.id]?.showImage,m=l.properties.details?.images,g={icon:(p&&m?.[0]?.url?{icon:m[0].url}:{}).icon,...o.appearance},x=(i?this.floorsById.get(i):this.currentFloor).layers.get(Ai);if(l.properties.center&&c.name!==""){let C=this.renderer.addLabel2D(l.properties.center,c.name,{id:l.properties.id+"-label",...o,appearance:g,rank:o.rank,attachTo:vd(c)},cr.is(c)?c.id:x?.containerId);C&&t(C.id,c.name,c)}})}},add:(t,o,n={})=>{let{attachTo:i,...a}=n,l=Av(t,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),c=l.layers.get(Ai),p=this.renderer.addLabel2D(dn(t),o,{...a,occluderId:l.occluderId,attachTo:i},c?.containerId);if(!p)throw new fr("label creating failed");return p},remove:({entityId:t})=>{this.renderer.remove(t)},removeAll:()=>{}});u(this,"Paths",{add:(t,o)=>{let n=o?.animateDrawing??!0,i=[],a=t[0].floorId||"root",l=0;for(let p of t){let{floorId:m="root",latitude:f,longitude:g}=p;m!==a&&(l++,a=m),i[l]==null&&i.push({floorId:m,coordinates:[]});let b=m===p.floorId?p:new ce({longitude:g,latitude:f,floorId:m});i[l].coordinates.push(b)}let c=i.reduce((p,{floorId:m,coordinates:f},g)=>{if(g!==0){let C=i[g-1],v=C.coordinates[C.coordinates.length-1],I=f[0],M=dn(v),O=dn(I),T=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:C.floorId},geometry:{type:"Point",coordinates:M}},{type:"Feature",properties:{parentId:m},geometry:{type:"Point",coordinates:O}}]},o,this.id);T&&(n&&this.renderer.setState(T.id,{completeFraction:0}),p.push({...T,coordinates:[v,I]}))}if(f.length<2)return p;let b=this.floorsById.get(m)?.layers.get(Ri)?.containerId,x=this.renderer.addPath({type:"FeatureCollection",features:f.map(C=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:dn(C)}}))},o,b??m);return x&&(n&&this.renderer.setState(x.id,{completeFraction:0}),p.push({...x,coordinates:f})),p},[]);if(n){let p=[],m=this.api.getMapData();return c.forEach(f=>{let g=Z6(f,m,this.api);p.push(new Wn({fraction:0}).to({fraction:1},g?o?.drawDuration??1500:0).onUpdate(b=>{this.renderer.setState(f.id,{completeFraction:b.fraction})}))}),p.forEach((f,g)=>{g<p.length-1&&f.chain(p[g+1]),this.renderer.getInternalTweenGroup().add(f)}),p[0].start(),this.renderer.render(),this.animations.set(c[0].id.toString(),p[0]),{paths:c,animation:Lv(p[p.length-1]).then(()=>{this.animations.delete(c[0].id.toString())})}}else return{paths:c,animation:Promise.resolve()}},remove:t=>{t.forEach(o=>{this.cancelAnimation(o),this.renderer.remove(o)})}});S(this,Wi,{enabled:!1,floorGap:10,updateCameraElevationOnFloorChange:!0});this.renderer=i.core,this.api=i,this.id=t,this.renderer.addGroupContainer(t,{},"root"),this.options=n??{},this.mvf=o?.mvf??{};let a=$6(this.mvf["styles.json"]||{});if(this.styleMap=a,w(this,Wi,{enabled:!1,floorGap:10,updateCameraElevationOnFloorChange:!0,...n?.multiFloorView}),!o){this.id!=="outdoors-container"&&L.warn(`Map (${this.id}) created with no data.`);let p=new Jf({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(p.id,p),this.currentFloorStackId=p.id;let m=new Yf(p.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this,s(this,Wi),n??{});this.floorsById.set(m.id,m),p.addFloor(m),this.setFloor(m.id);return}let l=o.getMVFFeatureByType("floor-stack");if(l==null||l.length===0)throw new fr("MVF does not contain any Floor Stacks.");for(let p of l){let m=new Jf(p,this.id,this.renderer,this.mvf.facade?.[p.id]);if(m.floorIds.length!==0){for(let f of m.floorIds){let g=o.getMVFFeatureById("floor",f);if(g!=null){let b=this.mvf.space[g.id],x=this.mvf.obstruction[g.id];if((b==null||b.features.length===0)&&(x==null||x.features.length===0))continue;let C=new Yf(m.id,g,this,s(this,Wi),n??{},this.mvf,a,o);this.floorsById.set(C.id,C),m.addFloor(C)}}this.floorStacksById.set(p.id,m),this.currentFloorStackId||(this.currentFloorStackId=p.id)}}for(let[p]of Object.entries(o.facadesBySpaceId)){let m=o.getById("space",p);m&&(this.outdoorFloorStacks.add(m.floor.floorStack.id),this.floorsById.get(m.floor.id)?.setVisible(!0))}let c=this.mvf.enterprise?.venue.defaultMap;if(n?.initialFloor){let p=Sm(n.initialFloor);p&&this.floorsById.has(p)?c=p:L.error(`Invalid initial floor specified (${n.initialFloor}), using default behavior instead`)}c||(c=this.currentFloorStack.defaultFloor.id),this.startingFloorId=c}get currentFloorStack(){let t=this.floorStacksById.get(this.currentFloorStackId);if(!t)throw new fr(`Current floor stack with id "${this.currentFloorStackId}" not found`);return t}setFloorStack(t,o){if(this.currentFloorStackId===t)return;let n=this.floorStacksById.get(t);if(n==null){L.error(`Invalid floor stack passed to setFloorStack (${t}), the floor stack was not changed. Current floor stack is still ${this.currentFloorStack.id}.`);return}if(n.floorObjects.length===0){L.error(`Floor stack (${t}) has no floors. The floor stack was not changed. Current floor stack is still ${this.currentFloorStack.id}.`);return}this.setFloor(n.defaultFloor.id,o)}get currentFloor(){let t=this.floorsById.get(this.currentFloorId);if(!t)throw new fr(`Floor with id "${this.currentFloorId}" not found`);return t}get floors(){return Array.from(this.floorsById.values())}processFloorChange(t){if(this.api.manualFloorVisibility===!0)return;let o=this.api.getMapDataInternal()?.getById("floor",t),n=this.api.getMapDataInternal()?.getById("floor-stack",this.currentFloorStackId);if(o&&n)if(!s(this,Wi)?.enabled||o.floorStack.id!==n?.id)for(let i of this.floorStacksById.values())i.floorObjects.forEach(a=>{a.id!==t&&a.setVisible(!1)});else{let i=BI(n.floors,o,s(this,Wi).floorGap,this.api.Navigation?.floors?.map(a=>a.id)||[]);this.api?.Outdoor?.setOpacity(i.outdoorOpacity),i.floorStates.forEach(a=>{if(a.floor){let l=this.api.getMapData()?.getById("floor",a.floor.id);l&&this.api.updateState(l,a.state)}}),s(this,Wi).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(o.elevation*s(this,Wi).floorGap)}}setFloor(t,o){if(this.currentFloorId===t)return;if(!this.floorsById.get(t)){L.error(`Invalid floor passed to setFloor (${t}), the floor was not changed. Current floor is still ${this.currentFloor.id}`);return}let i=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:i,floorId:t,reason:o}),this.currentFloorStack&&this.processFloorChange(t),this.currentFloorId=t,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.updatePathLayersVisibility(),this.publish("floor-change",{reason:o,floorId:this.currentFloor.id,previousFloorId:i})}updatePathLayersVisibility(){let t=this.api.hidePathsNotOnCurrentFloor===!0&&!this.options.multiFloorView?.enabled;for(let o of this.floorsById.values()){let n=o.layers.get(Ri);if(!n)continue;let i=!t||o.id===this.currentFloor.id;n.setVisible(i)}}cancelAnimation(t){let o=this.animations.get(t);o&&(o.stop(),this.animations.delete(t),this.renderer.getInternalTweenGroup().remove(o))}loadAllFloors(){for(let t of this.floorStacksById.values())t.loadAllFloors()}};Wi=new WeakMap;function o8(e,r,t,o){return e.labelText3D(r.id,t??r.name,{...o,parentId:r.floor.id})}d();var vn,qf,Qf=class{constructor({currentMapGetter:r}){S(this,vn,new Map);S(this,qf);w(this,qf,r)}get currentMap(){return s(this,qf).call(this)}getAll(){return Array.from(s(this,vn).values()).map(({marker:r})=>r)}getById(r){return s(this,vn).get(r)}add(r,t,o){let n=r.anchorTarget;if(!n)throw new Error("get coordinate failed");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Markers.add(n,t,{...o,rank:o?.rank||"medium",dynamicResize:o?.dynamicResize??!0,attachTo:vd(r)});if(a==null)throw new Error("error creating marker");let l=i.Markers.getContentEl(a.id.toString());if(!l)throw new Error("marker component should exist");let c=new $i(a.id.toString(),l,r);return s(this,vn).set(c.id,{marker:c,entityId:a.id.toString()}),c}remove(r){let t=s(this,vn).get(r.id);t&&(this.currentMap?.Markers.remove(t.entityId),s(this,vn).delete(r.id.toString()))}removeAll(){let r=[];return s(this,vn).forEach(({marker:t})=>{this.remove(t),r.push(t),s(this,vn).delete(t.id.toString())}),r}setPosition(r,t){let o=t.anchorTarget;if(!o){L.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){L.error("Cannot determine the current map.");return}let i=s(this,vn).get(r.id);if(!i){L.error(`Cannot find the Marker with id "${r.id}".`);return}n.Markers.setPosition(i.entityId,dn(o),o.floorId??n.currentFloorId),i.marker.updateTarget(t)}animateTo(r,t,o){let n=t.anchorTarget;if(!n)return L.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return L.error("Cannot determine the current map."),Promise.resolve();let a=s(this,vn).get(r.id);return a?(a.marker.updateTarget(t),i.Markers.animateTo(a.entityId,dn(n),n.floorId??i.currentFloorId,o)):(L.error(`Cannot find the Marker with id "${r.id}".`),Promise.resolve())}};vn=new WeakMap,qf=new WeakMap;d();var Xs,th,eh=class{constructor({currentMapGetter:r}){S(this,Xs,new Map);S(this,th);w(this,th,r)}get currentMap(){return s(this,th).call(this)}getById(r){return s(this,Xs).get(r)}add(r,t,o){let n=r.anchorTarget;if(!n)throw new Error("Target does not implement IAnchorable.");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Image3D.add(dn(n),t,{...o,floorId:n.floorId,verticalOffset:n.verticalOffset+(o.verticalOffset??0)});if(!a)throw new Error("image component should exist");let l=new yc(a.id.toString(),t,r);return s(this,Xs).set(l.id,{image:l,entityId:a.id.toString()}),l}remove(r){let t=s(this,Xs).get(r.id);t&&(this.currentMap?.Image3D.remove(t.entityId),s(this,Xs).delete(r.id.toString()))}removeAll(){let r=[];return s(this,Xs).forEach(({image:t})=>{this.remove(t),r.push(t),s(this,Xs).delete(t.id.toString())}),r}};Xs=new WeakMap,th=new WeakMap;d();var zi,oh,rh=class{constructor({currentMapGetter:r}){S(this,zi,new Map);S(this,oh);w(this,oh,r)}get currentMap(){return s(this,oh).call(this)}getById(r){return s(this,zi).get(r)}add(r,t,o){let n=[r],i=n.reduce((c,p)=>p?(c.has(p.floorId)||c.set(p.floorId,[]),c.get(p.floorId)?.push(p),c):(L.error("Cannot determine coordinate from options."),c),new Map);if(!n.length)throw new Error("targets should not be empty when adding a model");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let l=[];return i.forEach((c,p)=>{let m=nt();a.Models.add(m,c,{...o,url:t,floorId:p}).forEach(g=>{let b=new xc(g.toString(),m,c[0]);s(this,zi).set(b.id,{model:b,entityId:g.toString(),groupId:m}),l.push(b)})}),l[0]}remove(r){let t=s(this,zi).get(r.id);t&&(this.currentMap?.Models.remove(t.entityId,t.groupId),s(this,zi).delete(r.id.toString()))}removeAll(){let r=[];return s(this,zi).forEach(({model:t})=>{let o=s(this,zi).get(t.id);o&&(r.push(t),this.currentMap?.Models.remove(o.entityId,o.groupId),s(this,zi).delete(t.id.toString()))}),r}};zi=new WeakMap,oh=new WeakMap;d();var Zi,ih,nh=class{constructor({currentMapGetter:r}){S(this,Zi,new Map);S(this,ih);w(this,ih,r)}get currentMap(){return s(this,ih).call(this)}getById(r){return s(this,Zi).get(r)}add(r,t){let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let n=o.Paths.add(r,t),i=n.paths.map(l=>l.id.toString()),a=new yn(nt(),n.animation,r,n.paths);for(let l of i)s(this,Zi).set(l,{path:a,entityIds:i});return s(this,Zi).set(a.id,{path:a,entityIds:i}),a}remove(r){let t=s(this,Zi).get(r.id);t&&(this.currentMap?.Paths.remove(t.entityIds),s(this,Zi).delete(r.id),t.entityIds.forEach(o=>s(this,Zi).delete(o)))}removeAll(){let r=[];return s(this,Zi).forEach(({path:t})=>{this.remove(t),r.push(t)}),r}};Zi=new WeakMap,ih=new WeakMap;d();d();var g8=Ec(wO(),1),y8=Ec($3(),1);d();var sh="blue-dot",n8="blue-dot-accuracy-ring";var NI="#2266ff",hV="#808080",i8="#f5f5f5";var s8={radius:10,color:NI,inactiveColor:hV,heading:{color:NI,opacity:.7,displayWhenInactive:!1},accuracyRing:{color:NI,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1,accuracyThreshold:50,initialState:"hidden"};d();var a8="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";d();var l8=(e,r,t=0)=>{if(Math.abs(e)>=Math.PI)throw new Error("Sector angle too wide!");let o=t/Math.tan(e/2),n=t/Math.sin(e/2),i=n+r,a=10,l=new la;l.moveTo(-n*Math.sin(e/2),n*Math.cos(e/2)-o);for(let c=0;c<a;c++)l.lineTo(-(i*Math.sin(e/2-e/a*c)),i*Math.cos(e/2-e/a*c)-o);for(let c=0;c<a;c++)l.lineTo(-(t*Math.sin(Math.PI/-2+Math.PI/a*c)),t*Math.cos(Math.PI/-2+Math.PI/a*c));return new ca(l,{depth:.1,bevelEnabled:!1,UVGenerator:yV(r)})},jI=(e,r,t)=>{let n=Math.sqrt(Math.pow(e,2)+Math.pow(r,2))/t;return n>1?n=1:n<0&&(n=0),new Se(0,n)},yV=e=>({generateTopUV:(r,t,o,n,i)=>{let a=t[o*3],l=t[o*3+1],c=t[n*3],p=t[n*3+1],m=t[i*3],f=t[i*3+1];return[jI(a,l,e),jI(c,p,e),jI(m,f,e)]},generateSideWallUV:()=>[new Se(0,1),new Se(0,1),new Se(0,1),new Se(0,1)]});function c8(e,r){if(r==null)return e;let t={latitude:e?.latitude,longitude:e?.longitude,accuracy:e?.accuracy,floor:e?.floor,heading:e?.heading,timestamp:e?.timestamp};return"latitude"in r&&(t.latitude=r?.latitude==null||r.latitude==="device"?e?.latitude:r.latitude),"longitude"in r&&(t.longitude=r.longitude==null||r.longitude==="device"?e?.longitude:r.longitude),"accuracy"in r&&(t.accuracy=r.accuracy==="device"?e?.accuracy:r.accuracy),"floor"in r&&(t.floor=r.floor==="device"?e?.floor:r.floor),"heading"in r&&(t.heading=r.heading==="device"?e?.heading:r.heading),"timestamp"in r&&(t.timestamp=r.timestamp),t}function bV([e,r],[t,o],[n,i]){let a=t-e,l=o-r,c=a**2+l**2;if(c===0)return;let p=((n-e)*a+(i-r)*l)/c,m;p<=0?m=[e,r]:p>=1?m=[t,o]:m=[e+p*a,r+p*l];let f=Xh([n,i],m);return{proportion:Math.max(0,Math.min(1,p)),intersection:m,distance:f}}function p8(e,r){if(e==null||e.length<2)return;let t=Number.MAX_SAFE_INTEGER,o,n=0,i=0;for(let a=0;a<e.length-1;a++){let l=e[a],c=e[a+1],p=bV(l,c,r);p!=null&&p.distance<t&&(t=p.distance,o=p.intersection,n=a,i=p.proportion)}if(o)return{intersection:o,distance:t,segmentIndex:n,proportion:i}}function d8(e,r){let t=new si({color:e,opacity:r,transparent:!0,depthTest:!1,depthWrite:!1}),o=.35,n=.35*4,i=l8(Math.PI/6,n,o);new Lc().load(a8,l=>{t.alphaMap=l,t.needsUpdate=!0});let a=new Oe(i,t);return a.position.z=-.05,a.renderOrder=0,a}function u8(e,r){let t=new $h(1,1,.05,32),o=new si({transparent:!0,color:e,opacity:r,depthTest:!1,depthWrite:!1}),n=new Oe(t,o);return n.scale.set(0,0,.05),n.renderOrder=1,n.rotation.x=Math.PI/2,n}function m8(e){let r=new $h(.35,.35,.07,32),t=new si({transparent:!0,color:i8,depthTest:!1,depthWrite:!1}),o=new Oe(r,t);o.renderOrder=2;let n=new $h(.35*.8,.35*.8,.01,32),i=new si({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),a=new Oe(n,i);return a.renderOrder=3,o.rotation.x=Math.PI/2,o.position.z=.07/2,a.rotation.x=Math.PI/2,a.position.z=.07,{outerMesh:o,innerMesh:a}}var b8=Ec(f8(),1);var Ee,Cr,Cc,Xi,Go,mr,Ys,Tc,Mc,wc,Ye,Mo,ah,Js,It,lh,ch,tu,Lb,Ab,Rb,ph,_b,dh,Bb,uh,Nb,oi,Ks,ru,jb,ol,ou,Yi,mh,Gb,Ub,nu=class extends Ie{constructor(t,o){super();S(this,Ee);S(this,Cr);S(this,Cc,null);u(this,"primaryGeometry");u(this,"secondaryGeometry");S(this,Xi);S(this,Go);S(this,mr);S(this,Ys);S(this,Tc);S(this,Mc);S(this,wc);S(this,Ye,s8);S(this,Mo,1);S(this,ah);S(this,Js);S(this,It,new kb);u(this,"bounds");u(this,"state","disabled");u(this,"following",!1);S(this,lh,t=>s(this,Cr).getMapData()?.getById("floor",t));S(this,ch,t=>{let o;if(t!=null){let n=s(this,Cr).currentMap?.currentFloorStack.floorObjectsByElevation.get(t);o=n?s(this,lh).call(this,n.id):void 0}return o});S(this,tu,()=>this.state!=="hidden"&&this.state!=="disabled");S(this,Lb,(t,o)=>{s(this,Nb).call(this),t.scale.set(s(this,Mo),s(this,Mo),s(this,Mo)),t.position.z=.07/2*s(this,Mo),o.scale.set(s(this,Mo),s(this,Mo),s(this,Mo)),o.position.z=.07*s(this,Mo),this.state==="active"?o.material.color.set(s(this,Ye).color):this.state==="inactive"&&o.material.color.set(s(this,Ye).inactiveColor)});S(this,Ab,t=>{let o=this.heading;if(o!=null){t.visible=!0,s(this,wc)&&s(this,wc).stop();let{start:n,end:i}=Yh(t.rotation.z,-Le.degToRad(o));w(this,wc,new Wn({rotation:n}).to({rotation:i},150).onUpdate(({rotation:l})=>{t.rotation.z=l}).start()),s(this,Ee).getInternalTweenGroup().add(s(this,wc)),t.scale.set(s(this,Mo),s(this,Mo),1);let a=this.state==="inactive"?s(this,Ye).inactiveColor:s(this,Ye).heading.color;t.material.color.set(a)}else t.visible=!1});S(this,Rb,(t,o)=>{if(this.state==="active"){let i=this.accuracy;i!=null?(t.visible=!0,s(this,Mc)&&s(this,Mc).stop(),w(this,Mc,new Wn({scale:t.scale.x}).to({scale:i/2},150).onUpdate(({scale:a})=>{t.scale.set(a,1,a)}).start()),s(this,Ee).getInternalTweenGroup().add(s(this,Mc))):t.visible=!1}else t.visible=!1;this.state==="active"||this.state==="inactive"&&s(this,Ye).heading.displayWhenInactive?s(this,Ab).call(this,o):o.visible=!1});S(this,ph,t=>{if(!s(this,tu).call(this))return;let[o,n]=t.children;!o||!n||s(this,Lb).call(this,o,n)});S(this,_b,t=>{if(!s(this,tu).call(this))return;let[,,o,n]=t.children;!o||!n||s(this,Rb).call(this,o,n)});S(this,dh,(t,o)=>{let n;try{n=CV.parse(c8(t,s(this,Go)))}catch(l){s(this,oi).call(this,"error"),L.error("BlueDot: Position parse failed",l instanceof D.ZodError?l.message:String(l));return}s(this,Ye).debug&&L.log("BlueDot: Parsed position",n);let{min:i,max:a}=this.bounds||{};if(i!=null&&a!=null&&isFinite(i.x)&&isFinite(i.y)&&isFinite(a.x)&&isFinite(a.y)){let l=s(this,Ee).convertTo3DMapPosition(n.latitude,n.longitude,0);if(!(l.x>=i.x&&l.x<=a.x&&l.y>=i.y&&l.y<=a.y)){L.warn(`BlueDot: Position [${n.longitude}, ${n.latitude}] is outside map bounds. Position update will be discarded.`);return}}if(s(this,Gb).call(this,n.accuracy)){if(o?.silent||s(this,oi).call(this,"position-update"),!s(this,tu).call(this)){L.warn(`BlueDot: Cannot update position because BlueDot state is '${this.state}'. BlueDot must be enabled first.`);return}s(this,Bb).call(this,n,o)}});S(this,Bb,(t,o)=>{w(this,mr,t),o?.silent||(s(this,uh).call(this),s(this,Cr).getMapDataInternal()?.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:t.latitude,longitude:t.longitude,floorLevel:t.floor?.elevation,accuracy:t.accuracy}}));let n,i=0;if(!this.primaryGeometry)n=[t.longitude,t.latitude,0],i=t.floor?.id?s(this,Ee).getState(t.floor?.id).altitude:0,s(this,It).matrixAutoUpdate=!1,s(this,It).userData.floorId=t.floor?.id,this.primaryGeometry=s(this,Ee).addCustomGeometry(sh,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:n}},{setup:c=>{let p=this.state==="inactive"?s(this,Ye).inactiveColor:s(this,Ye).color,{outerMesh:m,innerMesh:f}=m8(p);s(this,It).add(m),s(this,It).add(f),c.add(s(this,It));let g=s(this,It).userData.floorId?s(this,Ee).getState(s(this,It).userData.floorId):void 0;g?.altitude!=null?s(this,It).matrix.elements[14]=g?.altitude:s(this,It).matrix.identity(),s(this,ph).call(this,s(this,It))},update:()=>{let c=s(this,It).userData.floorId?s(this,Ee).getState(s(this,It).userData.floorId):void 0;c?.altitude!=null?s(this,It).matrix.elements[14]=c?.altitude:s(this,It).matrix.identity(),s(this,ph).call(this,s(this,It))}},{visible:!0,interactive:!0}),this.secondaryGeometry=s(this,Ee).addCustomGeometry(n8,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:n}},{setup:()=>{let c=u8(s(this,Ye).accuracyRing.color,s(this,Ye).accuracyRing.opacity),p=d8(s(this,Ye).heading.color,s(this,Ye).heading.opacity);s(this,It).add(c),s(this,It).add(p),p.visible=!1,c.visible=!1},update:()=>{s(this,_b).call(this,s(this,It))}},{visible:!0,interactive:!1});else{let c=s(this,Ee).getState(this.primaryGeometry);if(n=[c.position[0],c.position[1],0],s(this,It).userData.floorId){let p=s(this,Ee).getState(s(this,It).userData.floorId);i=(c.position[2]??0)+(p?.altitude??0)}}if(s(this,Tc)&&s(this,Tc).stop(),s(this,It).userData.floorId!==t.floor?.id){let c=t.floor?.id?s(this,Ee).getState(t.floor?.id).altitude:0,p=i;s(this,It).userData.floorId=t.floor?.id,n[2]=p-c}let a=[t.longitude,t.latitude,0],l=c=>{let p={position:c};this.primaryGeometry&&this.secondaryGeometry&&s(this,Ee).setState(this.primaryGeometry,p),this.secondaryGeometry&&s(this,Ee).setState(this.secondaryGeometry,p)};o?.animate===!1?l(a):(w(this,Tc,new Wn(n).to(a,1e3).easing(Co.Cubic.Out).onUpdate(l).start()),s(this,Ee).getInternalTweenGroup().add(s(this,Tc))),o?.silent||this.publish("blue-dot-position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),s(this,Ee).render()});u(this,"onPositionUpdate",t=>{if(this.state==="disabled")return;try{SV.parse(t)}catch(n){s(this,oi).call(this,"error"),L.error("BlueDot: Browser sent invalid position",n instanceof D.ZodError?n.message:String(n));return}w(this,Xi,{latitude:t.coords?.latitude,longitude:t.coords?.longitude,accuracy:t.coords?.accuracy,heading:t.coords?.heading,floor:s(this,ch).call(this,t.coords?.floorLevel),timestamp:t.timestamp});let o=s(this,Xi);if(s(this,ru)){let n=s(this,Ub).call(this,s(this,Xi));if(n===void 0){s(this,Ye).debug&&L.log("BlueDot: Position update discarded by position processor");return}o=n}s(this,dh).call(this,o)});u(this,"onPositionError",t=>{switch(s(this,oi).call(this,"error"),t.code){case t.PERMISSION_DENIED:L.error("Geolocation permission denied by the user.",t),s(this,Cr).getMapDataInternal()?.Analytics.sendWatchPositionDenied();break;case t.POSITION_UNAVAILABLE:L.error("Geolocation position unavailable.",t);break;case t.TIMEOUT:L.error("Geolocation request timed out.",t);break;default:L.error("An unknown geolocation error occurred.",t);break}this.publish("blue-dot-position-error",t)});S(this,uh,()=>{s(this,Ys)&&clearTimeout(s(this,Ys)),typeof s(this,Ye).timeout=="number"&&s(this,Ye).timeout<1/0&&w(this,Ys,setTimeout(()=>{s(this,Ye).debug&&L.log(`BlueDot: Position timed out after ${s(this,Ye).timeout}ms`),s(this,oi).call(this,"timeout"),s(this,Ee).render()},s(this,Ye).timeout))});S(this,Nb,()=>{let t=Math.round(s(this,Ee).camera.zoomLevel*1e5);if(t!==s(this,ah)){w(this,ah,t);let o=s(this,Ee).getMetresPerPixel()??1;w(this,Mo,Math.max(s(this,Ye).radius/(.35/o),1))}});S(this,oi,t=>{let o=IV[this.state].actions[t];if(o){switch(s(this,Ye).debug&&L.log(`BlueDot: Transitioning from ${this.state} to ${o} using ${t}`),o){case"hidden":case"disabled":this.primaryGeometry&&s(this,Ee).setState(this.primaryGeometry,{visible:!1}),this.secondaryGeometry&&s(this,Ee).setState(this.secondaryGeometry,{visible:!1});break;case"active":case"inactive":this.primaryGeometry&&s(this,Ee).setState(this.primaryGeometry,{visible:!0}),this.secondaryGeometry&&s(this,Ee).setState(this.secondaryGeometry,{visible:!0});break}this.state!==o&&(this.state=o,this.publish("blue-dot-state-change",{state:o,action:t}))}else L.warn(`BlueDot: Invalid state transition from ${this.state} to ${o} using ${t}`)});S(this,Ks);S(this,ru);S(this,jb,()=>{if(s(this,Ks)==null&&s(this,Cr).Navigation.activeDirections!=null){let o=(Array.isArray(s(this,Cr).Navigation.activeDirections)?s(this,Cr).Navigation.activeDirections.flatMap(n=>n.coordinates):s(this,Cr).Navigation.activeDirections.coordinates).filter(n=>n.floorId===s(this,Cr).currentFloor.id);w(this,Ks,(0,b8.default)(o.map(n=>({x:n.longitude,y:n.latitude})),1e-5).map(n=>[n.x,n.y]))}return s(this,Ks)});S(this,ol,()=>{s(this,Ee).camera.isAnimating&&s(this,Ee).camera.cancelAnimation(),s(this,Yi)&&(this.off("blue-dot-position-update",s(this,Yi)),w(this,Yi,void 0)),this.following=!1,w(this,Ks,void 0),s(this,Ee).off("user-interaction-start",s(this,ol)),s(this,Cr).off("navigation-active-path-change",s(this,ou)),this.publish("blue-dot-follow-change",{following:!1})});S(this,ou,()=>{w(this,Ks,void 0)});S(this,Yi);u(this,"follow",(t,o)=>{if(t===!1){s(this,ol).call(this);return}t!=="position-only"&&o?.bearing!=null&&L.warn(`BlueDot: Camera bearing option will be ignored in follow mode '${t}'. To control the bearing manually, use mode 'position-only'.`);let n={zoomLevel:o?.zoomLevel??21,bearing:t==="position-only"?o?.bearing:void 0,pitch:o?.pitch??45,duration:o?.duration??1e3,easing:o?.easing??"ease-in-out"};this.following?s(this,Yi)&&this.off("blue-dot-position-update",s(this,Yi)):(this.following=!0,s(this,Ee).on("user-interaction-start",s(this,ol)),s(this,Cr).on("navigation-active-path-change",s(this,ou))),w(this,Yi,i=>{let{coordinate:a,heading:l,floor:c}=i;if(n.center=[a.longitude,a.latitude],c!=null&&c.id!==s(this,Cr).currentFloor.id&&(s(this,Cr).currentMap.setFloor(c.id),w(this,Ks,void 0)),t==="position-and-heading")n.bearing=l??void 0;else if(t==="position-and-path-direction"){let p=s(this,jb).call(this);if(p!=null){let m=p8(p,[a.longitude,a.latitude]);if(m!=null){let f=p[m.segmentIndex],g=p[m.segmentIndex+1];n.bearing=P3(f,g)}}}s(this,Ee).camera.animateTo(n)}),this.on("blue-dot-position-update",s(this,Yi)),this.publish("blue-dot-follow-change",{following:!0,mode:t})});S(this,mh,t=>{this.bounds=t});S(this,Gb,t=>{if(t==null)return this.state!=="disabled";let o=t<=s(this,Ye).accuracyThreshold;return s(this,Ye).debug&&!o&&L.log(`BlueDot: Dropping position update with accuracy ${t}m (exceeds threshold ${s(this,Ye).accuracyThreshold}m)`),o});S(this,Ub,t=>{let o={latitude:s(this,mr)?.latitude,longitude:s(this,mr)?.longitude,accuracy:s(this,mr)?.accuracy,heading:s(this,mr)?.heading,floor:s(this,mr)?.floor,timestamp:s(this,mr)?.timestamp};try{return s(this,ru).call(this,o,t)}catch(n){return L.error("BlueDot: Position processor callback threw an error",n instanceof Error?n.message:String(n)),t}});w(this,Ee,t),w(this,Cr,o)}get heading(){return s(this,mr)?.heading}get accuracy(){return s(this,mr)?.accuracy}get coordinate(){if(s(this,mr)!=null)return(s(this,Js)==null||this.floor?.id!==s(this,Js).floorId||s(this,mr).latitude!==s(this,Js).latitude||s(this,mr).longitude!==s(this,Js).longitude)&&w(this,Js,new ce(s(this,mr).latitude,s(this,mr).longitude,this.floor?.id)),s(this,Js)}get floor(){return s(this,mr)?.floor}enable(t){w(this,Ye,(0,g8.default)({},t,s(this,Ye))),s(this,oi).call(this,"enable"),s(this,Ye).initialState==="inactive"&&s(this,oi).call(this,"initialize"),this.watchDevicePosition(s(this,Ye).watchDevicePosition),this.bounds||(this.bounds=s(this,Ee).getSystems().cameraSystem.panBounds,s(this,Ee).on("pan-bounds-change",s(this,mh)))}updateState(t){let o=s(this,Ye).watchDevicePosition;w(this,Ye,(0,y8.default)({},s(this,Ye),t)),t.watchDevicePosition!=null&&t.watchDevicePosition!==o&&this.watchDevicePosition(t.watchDevicePosition),t.timeout!=null&&this.state==="active"&&s(this,uh).call(this),s(this,Ee).render()}disable(){s(this,Ee).remove(s(this,It).id),w(this,It,new kb),this.primaryGeometry&&(s(this,Ee).remove(this.primaryGeometry.id),this.primaryGeometry=void 0),this.secondaryGeometry&&(s(this,Ee).remove(this.secondaryGeometry.id),this.secondaryGeometry=void 0),s(this,Ys)&&(clearTimeout(s(this,Ys)),w(this,Ys,void 0)),this.following&&s(this,ol).call(this),this.watchDevicePosition(!1),w(this,mr,void 0),w(this,Go,void 0),s(this,oi).call(this,"disable"),s(this,Ee).off("user-interaction-start",s(this,ol)),s(this,Cr).off("navigation-active-path-change",s(this,ou)),s(this,Ee).off("pan-bounds-change",s(this,mh))}watchDevicePosition(t){if(s(this,Cc)&&(navigator.geolocation.clearWatch(s(this,Cc)),w(this,Cc,null)),s(this,Xi)&&w(this,Xi,void 0),t){if(this.state==="disabled"){L.warn("BlueDot must be enabled before watching browser position.");return}w(this,Cc,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(t,o){t==null?w(this,Go,void 0):"coords"in t?w(this,Go,Object.assign({},s(this,Go),{latitude:t.coords.latitude,longitude:t.coords.longitude,accuracy:t.coords.accuracy,heading:t.coords.heading,floor:s(this,ch).call(this,t.coords.floorLevel),timestamp:t.timestamp})):(w(this,Go,Object.assign({},s(this,Go),t)),"floorOrFloorId"in t&&(s(this,Go).floor=typeof t.floorOrFloorId=="string"&&t.floorOrFloorId!=="device"?s(this,lh).call(this,t.floorOrFloorId):t.floorOrFloorId)),(s(this,Go)?.latitude!=null&&s(this,Go)?.longitude!=null||s(this,Xi)!=null)&&s(this,dh).call(this,s(this,Xi),o)}setPositionProcessor(t){w(this,ru,t)}};Ee=new WeakMap,Cr=new WeakMap,Cc=new WeakMap,Xi=new WeakMap,Go=new WeakMap,mr=new WeakMap,Ys=new WeakMap,Tc=new WeakMap,Mc=new WeakMap,wc=new WeakMap,Ye=new WeakMap,Mo=new WeakMap,ah=new WeakMap,Js=new WeakMap,It=new WeakMap,lh=new WeakMap,ch=new WeakMap,tu=new WeakMap,Lb=new WeakMap,Ab=new WeakMap,Rb=new WeakMap,ph=new WeakMap,_b=new WeakMap,dh=new WeakMap,Bb=new WeakMap,uh=new WeakMap,Nb=new WeakMap,oi=new WeakMap,Ks=new WeakMap,ru=new WeakMap,jb=new WeakMap,ol=new WeakMap,ou=new WeakMap,Yi=new WeakMap,mh=new WeakMap,Gb=new WeakMap,Ub=new WeakMap;var IV={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",initialize:"inactive",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"}}},SV=D.object({coords:D.object({latitude:D.number(),longitude:D.number(),accuracy:D.number(),altitude:D.number().optional().nullable(),altitudeAccuracy:D.number().optional().nullable(),heading:D.number().optional().nullable(),speed:D.number().optional().nullable(),floorLevel:D.number().optional().nullable()}),timestamp:D.number()}),CV=D.object({latitude:D.number(),longitude:D.number(),floor:D.custom().optional(),accuracy:D.number().optional(),heading:D.number().optional().nullable(),timestamp:D.number().optional()}),kb=class extends es{constructor(){super(...arguments);u(this,"children",[]);u(this,"userData",{})}};d();var Qs,hh,fh=class{constructor({currentMapGetter:r}){S(this,Qs,new Map);S(this,hh);w(this,hh,r)}get currentMap(){return s(this,hh).call(this)}getById(r){return s(this,Qs).get(r)}add(r,t,o){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let i=n.Shapes.add(r,t||{},{floorId:o?.id}),a=new $s(i);return s(this,Qs).set(a.id,a),a}remove(r){s(this,Qs).get(r.id)&&(this.currentMap?.Shapes.remove(r),s(this,Qs).delete(r.id.toString()))}removeAll(){let r=[];return s(this,Qs).forEach(t=>{this.remove(t),r.push(t.id),s(this,Qs).delete(t.id.toString())}),r}};Qs=new WeakMap,hh=new WeakMap;d();var yh,gh=class{constructor({currentMapGetter:r}){S(this,yh);w(this,yh,r)}get currentMap(){return s(this,yh).call(this)}setFromStyleCollection(r){for(let t in r)for(let o of this.currentMap?.floors||[]){if(r[t]==null||!o.layers.has(Xt))continue;let n=o.layers.get(Xt);if(n?.layers.has(t)&&"color"in r[t]){let l=n.layers.get(t);l&&this.currentMap?.renderer.setState(l,{color:r[t].color})}if(n&&t===Ea&&!(Li in r)){let l=n.layers.get(Li);l&&"color"in r[t]&&this.currentMap?.renderer.setState(l,{color:r[t].color})}if(!o.layers.has(jl))continue;let i=o.layers.get(jl),a=o.facadesByStyleId.get(t);if(a&&a.length>0)for(let l of a){let c=i.layers.get(`${l}-${t}`);c&&"color"in r[t]&&this.currentMap?.renderer.setState(c,{color:r[t].color})}}}};yh=new WeakMap;d();var GI={opacity:1},Zr,bh,xh,nl,qs,Oc,UI,x8,iu=class{constructor(r,t){S(this,Oc);S(this,Zr);S(this,bh,[]);S(this,xh,{opacity:"initial"});S(this,nl,{opacity:new Map});S(this,qs,new Set);w(this,Zr,r),w(this,bh,t||[]);let o=s(this,Zr).map;o&&o.on("idle",()=>{s(this,nl).opacity.size||W(this,Oc,UI).call(this,o)})}setStyle(r){if(s(this,Zr).map){s(this,Zr).map?.setStyle(r),s(this,qs).size&&(s(this,qs).clear(),this.hide()),W(this,Oc,x8).call(this),W(this,Oc,UI).call(this,s(this,Zr).map),this.setOpacity(s(this,xh).opacity),s(this,Zr).map?.moveLayer(i0);for(let[t,o,n]of s(this,bh)||[])s(this,Zr).hideOutdoorLayersIntersectingPolygons(t,o,n)}}get map(){return s(this,Zr).map}get enabled(){return!!s(this,Zr).map}get visible(){return s(this,qs).size===0}show(){let r=s(this,Zr).map;if(!r)return;let t=r.getStyle().layers;t&&(t.forEach(o=>{s(this,qs).has(o.id)&&r.setLayoutProperty(o.id,"visibility","visible")}),s(this,qs).clear())}hide(r=[]){let t=s(this,Zr).map;if(!t)return;let o=t.getStyle().layers;o&&o.forEach(n=>{let i=t.getLayoutProperty(n.id,"visibility");!r.includes(n.id)&&i!=="none"&&(t.setLayoutProperty(n.id,"visibility","none"),s(this,qs).add(n.id))})}setOpacity(r,t=[]){let o=s(this,Zr).map;if(!o)return;let n=s(this,Zr).map?.getStyle?.()?.layers;n&&o.once("idle",()=>{n.forEach(i=>{let a=o.getLayoutProperty(i.id,"visibility");if(!t.includes(i.id)&&a!=="none")try{let l=s(this,nl).opacity.get(i.id);l!==void 0&&(i.id==="background"||(i.type==="symbol"?(o.setPaintProperty(i.id,"icon-opacity",r==="initial"?l[0]:r),o.setPaintProperty(i.id,"text-opacity",r==="initial"?l[1]:r)):o.setPaintProperty(i.id,`${i.type}-opacity`,r==="initial"?l[0]:r)),s(this,xh).opacity=r)}catch(l){L.warn("Error setting opacity:",l)}})})}};Zr=new WeakMap,bh=new WeakMap,xh=new WeakMap,nl=new WeakMap,qs=new WeakMap,Oc=new WeakSet,UI=function(r){let t=r.getStyle().layers;t&&t.forEach(o=>{r.getLayoutProperty(o.id,"visibility")!=="none"&&(o.id==="background"||(o.type==="symbol"?s(this,nl).opacity.set(o.id,[r.getPaintProperty(o.id,"icon-opacity")??GI.opacity,r.getPaintProperty(o.id,"text-opacity")??GI.opacity]):s(this,nl).opacity.set(o.id,[r.getPaintProperty(o.id,`${o.type}-opacity`)??GI.opacity,void 0])))})},x8=function(){Object.values(s(this,nl)).forEach(r=>r.clear())};d();function TV(){d0(!1)}var ea,ta,il,vh=class{constructor({currentMapGetter:r}){S(this,ea);S(this,ta,new Map);S(this,il,new Map);w(this,ea,r)}labelAll(r={}){let t=[],o=new Set;return s(this,ea).call(this)?.Text3D.labelAll(r)?.forEach(({textInfo:n,target:i})=>{let a=n.id.toString(),l=s(this,il).get(a);if(l){o.has(a)||t.push(l.text3DView),o.add(a);return}o.add(a);let c=new qa(a,i);s(this,ta).set(c.id,{targetId:i.id,text3d:a,text3DView:c}),s(this,il).set(a,{text3DView:c}),t.push(c)}),t}label(r,t,o={}){if(s(this,ea).call(this))if(cr.is(r)){let i=s(this,ea).call(this)?.Text3D.label(r,t,o);if(!i)return;let a=i.textInfo.id.toString(),l=s(this,il).get(a);if(l)return l.text3DView;let c=new qa(a,i.target);return s(this,ta).set(c.id,{targetId:i.target.id,text3d:a,text3DView:c}),s(this,il).set(a,{text3DView:c}),c}else throw new Error("Non-space target is not supported")}remove(r){let t=typeof r=="string"?r:r.id,o=s(this,ta).get(t);o&&(s(this,ea).call(this)?.Text3D.remove(o.text3d),s(this,ta).delete(t),s(this,il).delete(o.text3d))}removeAll(){s(this,ta).forEach(r=>{s(this,ea).call(this)?.Text3D.remove(r.text3d)}),s(this,ta).clear()}};ea=new WeakMap,ta=new WeakMap,il=new WeakMap;d();d();d();function v8(e){try{let r=e.shape;if("type"in r){let t=r.type;if(t instanceof D.ZodOptional&&(t=t._def.innerType),"value"in t)return String(t.value);if(t instanceof D.ZodDefault&&"value"in t._def.innerType)return String(t._def.innerType.value)}return"unknown"}catch{return"unknown"}}function I8(e){if(e.success)return[];let r=e.error.flatten();return Object.keys(r.fieldErrors)}function S8(e,r){e.length>0&&L.warn(`${e.length} invalid field(s) in ${r??"unknown"} state: ${e.join(", ")}`)}function Dt(e,r,t){if(r==null||typeof r!="object")return{};let o=e.partial().safeParse(r);if(o.success)return o.data;let n=I8(o);t?.warn&&S8(n,v8(e));let i={};for(let a of Object.keys(r))!n.includes(a)&&a in e.shape&&(i[a]=r[a]);return i}function Tr(e,r,t){let o=e.safeParse(r);if(o.success)return o.data;if(t?.warn===!0){let n=I8(o);S8(n,v8(e))}return r}var C8="doors",Pc=X.object({type:X.literal(C8).default(C8),color:X.string().default("#ffffff"),topColor:X.string().optional(),texture:X.object({url:X.string().optional()}).optional(),topTexture:X.object({url:X.string().optional()}).optional(),visible:X.boolean().default(!1),opacity:X.number().default(1)}),oFe=Pc.partial(),nFe=Pc.strict();function T8(e){let{color:r,topColor:t,texture:o,topTexture:n,visible:i,opacity:a}=e;return Tr(Pc,{visible:i,color:r,topColor:t,opacity:a,texture:o?{url:o}:void 0,topTexture:n?{url:n}:void 0})}function Vb(e,r){let t={};return r==null||(e.color&&(e.color==="initial"?t.color=r.initialColor:t.color=e.color),e.topColor&&(e.topColor==="initial"?t.topColor=r.initialTopColor:t.topColor=e.topColor),e.visible!==void 0&&(t.visible=e.visible),e.texture?.url!==void 0&&(t.texture=e.texture.url),e.topTexture?.url!==void 0&&(t.topTexture=e.topTexture.url),e.opacity!==void 0&&(t.opacity=e.opacity)),t}d();var M8="facade",Ih=D.object({type:D.literal(M8).default(M8),opacity:D.number().default(1),visible:D.boolean().default(!0)}),cFe=Ih.partial(),pFe=Ih.strict();function w8(e){return Tr(Ih,{opacity:e.opacity,visible:e.visible})}d();var ra="floor",O8=`${ra}.footprint`,P8=`${ra}.geometry`,F8=`${ra}.labels`,E8=`${ra}.markers`,D8=`${ra}.images`,k8=`${ra}.occlusion`,L8=`${ra}.paths`,Sh=D.object({type:D.literal(O8).default(O8),altitude:D.number().default(0),visible:D.boolean().default(!1),height:D.number().default(0),opacity:D.number().default(1),side:D.enum(["double","front","back"]),color:D.string().default("#ffffff")}),Ch=D.object({type:D.literal(P8).default(P8),opacity:D.number().default(1),visible:D.boolean().default(!0)}),Th=D.object({type:D.literal(F8).default(F8),enabled:D.boolean().default(!0)}),Mh=D.object({type:D.literal(E8).default(E8),enabled:D.boolean().default(!0)}),wh=D.object({type:D.literal(D8).default(D8),visible:D.boolean().default(!0)}),Oh=D.object({type:D.literal(k8).default(k8),enabled:D.boolean().default(!0)}),Ph=D.object({type:D.literal(L8).default(L8),visible:D.boolean().default(!0)}),Fh=D.object({type:D.literal(ra).default(ra),visible:D.boolean().default(!1),altitude:D.number().default(0)}),MV=D.object({...Fh.shape,geometry:Ch,labels:Th,markers:Mh,images:wh,footprint:Sh,occlusion:Oh,paths:Ph}),yFe=D.object({...Fh.shape,geometry:Ch.partial(),labels:Th.partial(),markers:Mh.partial(),images:wh.partial(),footprint:Sh.partial(),occlusion:Oh.partial(),paths:Ph.partial()}).partial(),bFe=D.object({...Fh.shape,geometry:Ch.strict(),labels:Th.strict(),markers:Mh.strict(),images:wh.strict(),footprint:Sh.strict(),occlusion:Oh.strict(),paths:Ph.strict()});function A8(e,r,t){if(!r){L.error("Floor is not defined. Cannot get floor state.");return}let o=r.layers.get(Xt),n=o?t?.getState(o.containerId):void 0,i=r.layers.get(Ai),a=r.layers.get(Un),l=r.layers.get(od),c=l?t?.getState(l.containerId):void 0,p=r.layers.get(Da),m=p?t?.getState(p.containerId):void 0,f=r.layers.get(nd),g=f?t?.getState(f.containerId):void 0,b=r.layers.get(Ri),x=b?t?.getState(b.containerId):void 0;return Tr(MV,{geometry:{opacity:n?.opacity,visible:n?.visible},labels:{enabled:i?.visible},markers:{enabled:a?.visible},footprint:{altitude:c?.altitude,visible:c?.visible,height:c?.height,opacity:c?.opacity,side:c?.side,color:c?.color},images:{visible:g?.visible},occlusion:{enabled:m?.visible},paths:{visible:x?.visible},visible:e.visible,altitude:e.altitude})}d();var R8="geometry",su=D.object({type:D.literal(R8).default(R8),visible:D.boolean().default(!0),color:D.union([D.string(),D.literal("initial")]).default("#ffffff"),topColor:D.union([D.string(),D.literal("initial")]).optional(),hoverColor:D.union([D.string(),D.literal("initial")]).optional(),interactive:D.boolean().default(!1),opacity:D.number().default(1),height:D.number().default(0),altitude:D.number().default(0),texture:D.object({url:D.string()}).optional(),topTexture:D.object({url:D.string()}).optional(),flipImageToFaceCamera:D.boolean().default(!1),borderVisible:D.boolean().default(!1),borderColor:D.string().optional(),borderWidth:D.number().optional()}),CFe=su.partial(),TFe=su.strict();function _8(e,r){let t=r?.altitude?e.altitude+r.altitude:e.altitude,{interactive:o,hoverColor:n,color:i,visible:a,opacity:l,height:c,texture:p,topTexture:m,flipImageToFaceCamera:f,topColor:g,borderVisible:b,borderColor:x,borderWidth:C}=e;return Tr(su,{interactive:o,hoverColor:n,color:i,visible:a,opacity:l,height:c,texture:p?{url:e.texture}:void 0,topTexture:m?{url:m}:void 0,flipImageToFaceCamera:f,topColor:g,altitude:t,borderVisible:b,borderColor:x,borderWidth:C})}function B8(e,r,t){let o={};return r==null||(e.color&&(e.color==="initial"?o.color=r.initialColor:o.color=e.color),e.topColor&&(e.topColor==="initial"?o.topColor=r.initialTopColor:o.topColor=e.topColor),e.visible!==void 0&&(o.visible=e.visible),e.texture?.url!==void 0&&(o.texture=e.texture.url),e.topTexture?.url!==void 0&&(o.topTexture=e.topTexture.url),e.hoverColor!==void 0&&(o.hoverColor=e.hoverColor),e.interactive!==void 0&&(o.interactive=e.interactive),e.height!==void 0&&(o.height=e.height),e.opacity!==void 0&&(o.opacity=e.opacity),e.flipImageToFaceCamera!==void 0&&(o.flipImageToFaceCamera=e.flipImageToFaceCamera),e.altitude!==void 0&&(o.altitude=e.altitude-(t?.altitude??0)),e.borderVisible!==void 0&&(o.borderVisible=e.borderVisible),e.borderColor!==void 0&&(o.borderColor=e.borderColor),e.borderWidth!==void 0&&(o.borderWidth=e.borderWidth)),o}d();var VI="label",HI=X.object({type:X.literal(VI).default(VI),text:X.string(),rank:X.custom(e=>Qh.safeParse(e).success||e==="initial"),appearance:X.custom(e=>U3.safeParse(e).success).optional(),interactive:X.boolean().default(!1),enabled:X.boolean().default(!0)}),EFe=HI.partial();function N8(e){let{text:r,enabled:t,options:o}=e;return{type:VI,text:r??"",appearance:o?.appearance?V3(o.appearance):void 0,rank:o?.rank??"medium",enabled:t??!0,interactive:o?.interactive??!1}}function j8(e,r){let t={options:{}};if(!t.options)throw new Error("options should exist");return e.text&&(t.text=e.text),e.appearance&&(t.options.appearance=e.appearance),e.rank!=null&&(e.rank==="initial"?t.options.rank=r.initialRank||2:t.options.rank=e.rank),e.enabled!==void 0&&(t.enabled=e.enabled),e.interactive!==void 0&&(t.options.interactive=e.interactive),e.enabled!==void 0&&(t.enabled=e.enabled),t}d();var $I="marker",G8=new Set(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),WI=X.object({type:X.literal($I).default($I),rank:X.custom(e=>Qh.safeParse(e).success||e==="initial"),placement:X.custom(e=>typeof e=="string"?G8.has(e):Array.isArray(e)?e.every(r=>typeof r=="string"&&G8.has(r)):!1).optional(),interactive:X.union([X.boolean(),X.literal("pointer-events-auto")]).default(!1),dynamicResize:X.boolean().default(!0),enabled:X.boolean().default(!0),zIndex:X.number().optional(),lowPriorityPin:X.object({enabled:X.boolean().optional(),size:X.number().positive().optional(),color:X.string().optional()}).optional(),element:X.custom(e=>e instanceof HTMLElement,{message:"Must be an HTMLElement instance"}),contentHTML:X.string()}),_Fe=WI.omit({element:!0}).partial();function U8(e,r){let t=r?.target?r.target.anchorTarget:void 0,{enabled:o,placement:n,element:i,dynamicResize:a,contentHTML:l,options:c,position:p,parent:m}=e,f=typeof m=="object"?m.id:m;return t==null&&(t=new ce({latitude:p?.[1]??0,longitude:p?.[0]??0,floorId:f?.toString()})),{type:$I,rank:c?.rank??"medium",interactive:c?.interactive??!1,enabled:o??!0,element:i,placement:n??[],zIndex:c?.zIndex,dynamicResize:a??!0,lowPriorityPin:c?.lowPriorityPin,contentHTML:l??""}}function V8(e,r){let t={options:{}};if(!t.options)throw new Error("options should exist");return e.rank!=null&&(e.rank==="initial"?t.options.rank=r.initialRank||2:t.options.rank=e.rank),e.enabled!=null&&(t.enabled=e.enabled),e.interactive!=null&&(t.options.interactive=e.interactive),e.enabled!==null&&(t.enabled=e.enabled),e.contentHTML!==void 0&&(t.contentHTML=e.contentHTML),t}d();var H8="path",Hb={color:"#4b90e2",width:1,completeFraction:0,visible:!0,verticalOffset:.1},au=X.object({type:X.literal(H8).default(H8),color:X.string().default(Hb.color),width:X.union([X.number(),X.any()]),completeFraction:X.number().default(Hb.completeFraction),visible:X.boolean().default(Hb.visible),verticalOffset:X.number().default(Hb.verticalOffset)}),UFe=au.partial(),VFe=au.strict();function $8(e){let{color:r,visible:t,width:o,verticalOffset:n,completeFraction:i}=e;return Tr(au,{color:r,visible:t,width:o,verticalOffset:n,completeFraction:i})}d();var W8="shape",Eh=D.object({type:D.literal(W8).default(W8),visible:D.boolean().default(!0),altitude:D.number().default(0),color:D.string().default("#ffffff"),height:D.number().default(0),opacity:D.number().default(1),interactive:D.boolean().default(!1),bevel:D.object({enabled:D.boolean().optional(),thickness:D.number().optional(),size:D.number().optional(),offset:D.number().optional(),segments:D.number().optional()}).optional()}),XFe=Eh.partial(),YFe=Eh.strict();function z8(e){let{altitude:r,visible:t,color:o,opacity:n,interactive:i,height:a,children:l,bevel:c}=e;if(l==null||l.length<1){L.error("Expected at least one child for Shape. Cannot get shape state.");return}return Tr(Eh,{altitude:r,visible:t,color:o,height:a,opacity:n,interactive:i,bevel:c})}d();var Z8="text3d",X8=X.object({type:X.literal(Z8).default(Z8),position:X.custom(e=>e instanceof ce,{message:"Must be a Coordinate instance"})}),Y8=cS.extend({...X8.shape}),J8=pS.extend({...X8.shape}).partial(),rEe=Y8.strict();function K8(e){let{position:r,visible:t,color:o,flipToFaceCamera:n,font:i,fontSize:a,outlineColor:l,outlineOpacity:c,outlineBlur:p,outlineWidth:m,outlineOffsetX:f,outlineOffsetY:g,strokeWidth:b,strokeOpacity:x,strokeColor:C,fillOpacity:v,hoverColor:I}=e;return Tr(Y8,{position:new ce({latitude:r?.[1]??0,longitude:r?.[0]??0}),visible:t,color:o,flipToFaceCamera:n,font:i,fontSize:a,outlineColor:l,outlineOpacity:c,outlineBlur:p,outlineWidth:m,outlineOffsetX:f,outlineOffsetY:g,strokeWidth:b,strokeOpacity:x,strokeColor:C,fillOpacity:v,hoverColor:I})}d();var Q8="walls",lu=X.object({type:X.literal(Q8).default(Q8),color:X.string().default("#ffffff"),topColor:X.string().optional(),texture:X.object({url:X.string()}).or(X.undefined()),topTexture:X.object({url:X.string()}).or(X.undefined()),visible:X.boolean().default(!0),height:X.number().default(0),opacity:X.number().default(1)}),aEe=lu.partial(),lEe=lu.strict();function q8(e){let{color:r,topColor:t,texture:o,topTexture:n,visible:i,height:a,opacity:l}=e;return Tr(lu,{visible:i,color:r,topColor:t,texture:o?{url:o}:void 0,topTexture:n?{url:n}:void 0,height:a,opacity:l})}function zI(e,r){let t={};return r==null||(e.color&&(e.color==="initial"?t.color=r.initialColor:t.color=e.color),e.topColor&&(e.topColor==="initial"?t.topColor=r.initialTopColor:t.topColor=e.topColor),e.visible!==void 0&&(t.visible=e.visible),e.texture?.url!==void 0&&(t.texture=e.texture.url),e.topTexture?.url!==void 0&&(t.topTexture=e.topTexture.url),e.height!==void 0&&(t.height=e.height),e.opacity!==void 0&&(t.opacity=e.opacity)),t}d();var ZI="image3d",XI=D.object({type:D.literal(ZI).default(ZI),visible:D.boolean().default(!0),opacity:D.number().min(0).max(1).default(1),position:D.custom(e=>e instanceof ce,{message:"Must be a Coordinate instance"}),width:D.number().default(1),height:D.number().default(1),rotation:D.number().default(0),verticalOffset:D.number().default(0),flipImagesToFaceCamera:D.boolean().default(!1)}),mEe=XI.partial();function eO(e){let{position:r}=e;return{type:ZI,visible:e.visible??!0,opacity:e.opacity??1,position:new ce({latitude:r?.[1]??0,longitude:r?.[0]??0,verticalOffset:r?.[2]}),width:e.width??1,height:e.height??1,rotation:e.rotation??0,verticalOffset:e.verticalOffset??0,flipImagesToFaceCamera:e.flipImageToFaceCamera??!1}}d();var tO="model",YI=Jv.extend({type:D.literal(tO).default(tO),color:D.string().optional(),position:D.custom(e=>e instanceof ce,{message:"Must be a Coordinate instance"}),visible:D.boolean().default(!0),rotation:D.tuple([D.number(),D.number(),D.number()]).default([0,0,0]),scale:D.tuple([D.number(),D.number(),D.number()]).default([1,1,1]),verticalOffset:D.number().default(0),opacity:D.number().default(1),material:D.record(D.string(),Kv).optional(),interactive:D.boolean().default(!1)}),rO=YI.extend({scale:D.union([D.number(),D.tuple([D.number(),D.number(),D.number()])]),rotation:D.union([D.number(),D.tuple([D.number(),D.number(),D.number()])])}).partial(),vEe=YI.strict();function oO(e){let{color:r,position:t,rotation:o,scale:n,visible:i,interactive:a,opacity:l,material:c,verticalOffset:p,parent:m}=e,f=typeof m=="object"?m?.id?.toString():m?.toString();return Tr(YI,{color:r,position:new ce({latitude:t?.[1]??0,longitude:t?.[0]??0,verticalOffset:t?.[2],floorId:f}),rotation:o,scale:n,visible:i,interactive:a,opacity:l,material:c,verticalOffset:p})}d();d();var wV=new Map([["search-16x16",`<svg viewBox="0 0 16 16">
|
|
755
|
+
<path
|
|
756
|
+
fillRule="evenodd"
|
|
757
|
+
clipRule="evenodd"
|
|
758
|
+
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"
|
|
759
|
+
stroke="none"
|
|
760
|
+
/>
|
|
761
|
+
</svg>`],["close-16x16",`<svg viewBox="0 0 16 16">
|
|
762
|
+
<path
|
|
763
|
+
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"
|
|
764
|
+
stroke="none"
|
|
765
|
+
/>
|
|
766
|
+
<path
|
|
767
|
+
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"
|
|
768
|
+
stroke="none"
|
|
769
|
+
/>
|
|
770
|
+
</svg>`],["empty-64x40",`<svg viewBox="0 0 64 40">
|
|
771
|
+
<g>
|
|
772
|
+
<g clipPath="url(#clip0_499_175492)">
|
|
773
|
+
<path
|
|
774
|
+
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"
|
|
775
|
+
stroke="none"
|
|
776
|
+
fill="#F5F5F5"
|
|
777
|
+
/>
|
|
778
|
+
<path
|
|
779
|
+
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"
|
|
780
|
+
fill="none"
|
|
781
|
+
/>
|
|
782
|
+
<path
|
|
783
|
+
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"
|
|
784
|
+
fill="#FAFAFA"
|
|
785
|
+
/>
|
|
786
|
+
</g>
|
|
787
|
+
<defs>
|
|
788
|
+
<clipPath id="clip0_499_175492">
|
|
789
|
+
<rect width="64" height="40" fill="white" />
|
|
790
|
+
</clipPath>
|
|
791
|
+
</defs>
|
|
792
|
+
</g>
|
|
793
|
+
</svg>`],["caret-12x12",`<svg viewBox="0 0 12 12">
|
|
794
|
+
<path
|
|
795
|
+
stroke="none"
|
|
796
|
+
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"
|
|
797
|
+
/>
|
|
798
|
+
</svg>`],["plus-16x16",`<svg viewBox="0 0 16 16">
|
|
799
|
+
<path
|
|
800
|
+
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"
|
|
801
|
+
stroke="none"
|
|
802
|
+
/>
|
|
803
|
+
</svg>`],["recenter-16x16",`<svg viewBox="0 0 16 16">
|
|
804
|
+
<g stroke="none">
|
|
805
|
+
<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" />
|
|
806
|
+
<path
|
|
807
|
+
fillRule="evenodd"
|
|
808
|
+
clipRule="evenodd"
|
|
809
|
+
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"
|
|
810
|
+
/>
|
|
811
|
+
<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" />
|
|
812
|
+
</g>
|
|
813
|
+
</svg>`],["minus-16x16",`<svg viewBox="0 0 16 16">
|
|
814
|
+
<path
|
|
815
|
+
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"
|
|
816
|
+
stroke="none"
|
|
817
|
+
/>
|
|
818
|
+
</svg>`],["logo-horizontal-206x48",`<svg viewBox="0 0 206 48">
|
|
819
|
+
<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" />
|
|
820
|
+
<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" />
|
|
821
|
+
<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" />
|
|
822
|
+
<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" />
|
|
823
|
+
</svg>`],["share-16x16",`<svg viewBox="0 0 16 16">
|
|
824
|
+
<path
|
|
825
|
+
fillRule="evenodd"
|
|
826
|
+
clipRule="evenodd"
|
|
827
|
+
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"
|
|
828
|
+
stroke="none"
|
|
829
|
+
/>
|
|
830
|
+
</svg>`],["checkmark-16x16",`<svg viewBox="0 0 16 16">
|
|
831
|
+
<path
|
|
832
|
+
fillRule="evenodd"
|
|
833
|
+
clipRule="evenodd"
|
|
834
|
+
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"
|
|
835
|
+
stroke="none"
|
|
836
|
+
/>
|
|
837
|
+
</svg>`],["arrow-right-16x16",`<svg viewBox="0 0 16 16">
|
|
838
|
+
<path
|
|
839
|
+
fillRule="evenodd"
|
|
840
|
+
clipRule="evenodd"
|
|
841
|
+
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"
|
|
842
|
+
stroke="none"
|
|
843
|
+
/>
|
|
844
|
+
</svg>`],["arrow-up-16x16",`<svg viewBox="0 0 16 16">
|
|
845
|
+
<path
|
|
846
|
+
fillRule="evenodd"
|
|
847
|
+
clipRule="evenodd"
|
|
848
|
+
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"
|
|
849
|
+
stroke="none"
|
|
850
|
+
/>
|
|
851
|
+
</svg>`],["connection-stairs-16x16",`<svg viewBox="0 0 16 16">
|
|
852
|
+
<g stroke="none">
|
|
853
|
+
<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" />
|
|
854
|
+
<path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />
|
|
855
|
+
<path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />
|
|
856
|
+
<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" />
|
|
857
|
+
</g>
|
|
858
|
+
</svg>`],["connection-stairs-14x14",`<svg viewBox="0 0 14 14">
|
|
859
|
+
<path
|
|
860
|
+
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"
|
|
861
|
+
stroke="none"
|
|
862
|
+
/>
|
|
863
|
+
</svg>`],["connection-stairs-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
864
|
+
<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" />
|
|
865
|
+
<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" />
|
|
866
|
+
<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" />
|
|
867
|
+
<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" />
|
|
868
|
+
</svg>`],["connection-escalator-16x16",`<svg viewBox="0 0 16 16">
|
|
869
|
+
<g stroke="none">
|
|
870
|
+
<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" />
|
|
871
|
+
<path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />
|
|
872
|
+
<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" />
|
|
873
|
+
</g>
|
|
874
|
+
</svg>`],["connection-escalator-14x14",`<svg viewBox="0 0 14 14">
|
|
875
|
+
<path
|
|
876
|
+
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"
|
|
877
|
+
stroke="none"
|
|
878
|
+
/>
|
|
879
|
+
<path
|
|
880
|
+
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"
|
|
881
|
+
stroke="none"
|
|
882
|
+
/>
|
|
883
|
+
</svg>`],["connection-elevator-16x16",`<svg viewBox="0 0 16 16">
|
|
884
|
+
<g stroke="none">
|
|
885
|
+
<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" />
|
|
886
|
+
<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" />
|
|
887
|
+
<path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />
|
|
888
|
+
<path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />
|
|
889
|
+
</g>
|
|
890
|
+
</svg>`],["connection-elevator-14x14",`<svg viewBox="0 0 14 14">
|
|
891
|
+
<path
|
|
892
|
+
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"
|
|
893
|
+
stroke="none"
|
|
894
|
+
/>
|
|
895
|
+
<path
|
|
896
|
+
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"
|
|
897
|
+
stroke="none"
|
|
898
|
+
/>
|
|
899
|
+
<path
|
|
900
|
+
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"
|
|
901
|
+
stroke="none"
|
|
902
|
+
/>
|
|
903
|
+
</svg>`],["connection-elevator-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
904
|
+
<circle cx="1.9375" cy="4.4375" r="0.9375" />
|
|
905
|
+
<circle cx="1.9375" cy="7.5625" r="0.9375" />
|
|
906
|
+
<path
|
|
907
|
+
fillRule="evenodd"
|
|
908
|
+
clipRule="evenodd"
|
|
909
|
+
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"
|
|
910
|
+
/>
|
|
911
|
+
</svg>`],["new-tab-14x14",`<svg viewBox="0 0 14 14">
|
|
912
|
+
<g stroke="none">
|
|
913
|
+
<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" />
|
|
914
|
+
<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" />
|
|
915
|
+
</g>
|
|
916
|
+
</svg>`],["compress-16x16",`<svg viewBox="0 0 16 16">
|
|
917
|
+
<g stroke="none">
|
|
918
|
+
<path
|
|
919
|
+
id="Vector"
|
|
920
|
+
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"
|
|
921
|
+
/>
|
|
922
|
+
</g>
|
|
923
|
+
</svg>`],["washroom-14x14",`<svg viewBox="0 0 14 14" stroke="none">
|
|
924
|
+
<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" />
|
|
925
|
+
<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" />
|
|
926
|
+
<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" />
|
|
927
|
+
<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" />
|
|
928
|
+
<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" />
|
|
929
|
+
</svg>`],["point-of-interest-12x12",`<svg viewBox="0 0 12 12" stroke="none">
|
|
930
|
+
<path
|
|
931
|
+
stroke="none"
|
|
932
|
+
id="Subtract"
|
|
933
|
+
fill-rule="evenodd"
|
|
934
|
+
clip-rule="evenodd"
|
|
935
|
+
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"
|
|
936
|
+
/>
|
|
937
|
+
</svg>`],["flag-20x20",`<svg viewBox="0 0 20 20" stroke="none">
|
|
938
|
+
<path
|
|
939
|
+
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"
|
|
940
|
+
stroke="none"
|
|
941
|
+
/>
|
|
942
|
+
</svg>`],["link-16x16",`<svg viewBox="0 0 16 16" stroke="none">
|
|
943
|
+
<path
|
|
944
|
+
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"
|
|
945
|
+
stroke="none"
|
|
946
|
+
/>
|
|
947
|
+
</svg>`]]),OV=/<svg([^>]*)>/g;function nO(e,r,t){let o=wV.get(e);return o?o.replace(OV,`<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:${r}; width:${t}px; height:${t}px">`):""}var $b={default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"};function JI(e){let r=nO(PV(e),"white",12);return{appearance:{textColor:iO(e),pinColor:iO(e),icon:r,iconPadding:4,iconSize:12},interactive:!0,rank:EV(e)}}function PV(e){return e.__type==="connection"?FV(e.type):e.name.includes("Washroom")?"washroom-14x14":e.__type==="point-of-interest"?"point-of-interest-12x12":""}function FV(e){let r="";switch(e){case"elevator":r="connection-elevator-12x12";break;case"escalator":r="connection-escalator-12x12";break;case"stairs":r="connection-stairs-12x12";break}return r}function iO(e){return e.__type==="connection"?$b.connection:e.__type==="point-of-interest"?$b.point:"name"in e&&e.name.includes("Washroom")?$b.washroom:$b.default}function EV(e){return e.__type==="connection"?"high":(e.__type==="point-of-interest","medium")}var Wb=.05,kh,Lh,Dh=class extends Ie{constructor(t,o,n){super();u(this,"core");u(this,"mapObjects",[]);u(this,"id");u(this,"mapDataExternal",{});u(this,"mapsByFloorId",{});u(this,"mapData");u(this,"currentMap");u(this,"hiddenOutdoorGeometries",[]);u(this,"lastFacadeIntersected");S(this,kh,!1);S(this,Lh,!1);u(this,"mapView");u(this,"externalPubSub");u(this,"Camera");u(this,"Labels");u(this,"Text3D");u(this,"Markers");u(this,"Models");u(this,"Paths");u(this,"Exporter");u(this,"Navigation");u(this,"Outdoor");u(this,"BlueDot");u(this,"Shapes");u(this,"Style");u(this,"Image3D");u(this,"update",()=>{this.core.render()});this.core=t,this.mapView=o,this.externalPubSub=n,this.Camera=new $f(this),this.id=this.core.addGroupContainer("root").id.toString();let i=new Kf("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i,this.core.on("pre-render",()=>{n.publish("pre-render")}),this.core.on("post-render",()=>{n.publish("post-render")}),this.core.on("resize",()=>{n.publish("resize")}),this.core.on("render-error",({error:m})=>{n.publish("render-error",{error:new n3(m instanceof Error?m.message:"Unknown error")})});let a=m=>{let f=this.getMapDataObject(m);switch(f?.__type){case"facade":return f;case"floor":return f.floorStack.facade;default:return null}};this.core.on("geometry-in-focus",m=>{let f=new Set;for(let g of m){let b=a(g);b&&f.add(b)}n.publish("facades-in-view-change",{facades:Array.from(f)})}),this.core.getSystems().renderSystem.on("camera-state-change",()=>{n.publish("state-change-internal",{Camera:this.getCameraState()})});let l=new Nf(this.Camera,{precision:7});this.core.on("camera-change",()=>{n.publish("camera-change",l)});let c=m=>f=>{let g=[],b=[],x=[],C=[];f.labels.forEach(A=>{let N=this.Labels.getById(A.toString());N&&g.push(N.label)}),f.markers.forEach(A=>{let N=this.Markers.getById(A.toString())||this.Navigation.getMarkerById(A.toString());N&&b.push(N.marker)}),f.models.forEach(A=>{let N=this.Models.getById(A.toString());N&&x.push(N.model)}),f.paths.forEach(A=>{let N=this.Paths.getById(A.toString())||this.Navigation.getPathById(A.toString());N&&C.push(N.path)});let v=f.geometry.includes(sh),I=f.geometry.filter(A=>A!==sh),M;I.length>0&&(M=I.map(A=>this.getMapDataInternal()?.getById("space",A)).filter(Boolean)[0],M||(M=I.map(A=>this.getMapDataInternal()?.getById("object",A)).filter(Boolean)[0]),M||(M=I.map(A=>this.Shapes.getById(A)).filter(Boolean)[0]));let O=f.containers.reduce((A,N)=>{let z=this.getMapDataInternal()?.getById("floor",N);return z&&bo.is(z)&&A.push(z),A},[]),T,P=0;if(O.length>0){T=O[0].id;let A=this.core.getState(T);P=f.coordinate[2]?f.coordinate[2]-A.altitude:P}let B;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(A=>{this.core.setState(A.id,{hovered:!1})}),M&&cr.is(M)&&(B=I.map(A=>this.getMapDataInternal()?.facadesBySpaceId[A]).filter(Boolean)[0],B&&B.spaces.forEach(A=>{this.core.setState(A.id,{hovered:!0})})),this.lastFacadeIntersected=B;let G={coordinate:new ce({latitude:f.coordinate[1],longitude:f.coordinate[0],floorId:T,verticalOffset:P}),spaces:M&&cr.is(M)?[M]:[],objects:M&&xo.is(M)?[M]:[],shapes:M&&$s.is(M)?[M]:[],markers:b,labels:g,models:x,paths:C,floors:O,facades:B?[B]:[]};"pointerEvent"in f&&(G.pointerEvent=f.pointerEvent),v&&(m==="click"?this.BlueDot.publish("click",{coordinate:new ce({longitude:f.coordinate[0],latitude:f.coordinate[1]})}):m==="hover"&&this.BlueDot.publish("hover")),n.publish(m,G)};this.core.on("hover",c("hover")),this.core.on("click",c("click")),this.core.on("user-interaction-start",()=>{n.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{n.publish("user-interaction-end")});let p={currentMapGetter:()=>this.currentMap};this.Markers=new Qf(p),this.Models=new rh(p),this.Labels=new Zf(p),this.Text3D=new vh(p),this.Exporter=new zf(p),this.Paths=new nh(p),this.Navigation=new Vf(this.core,this,p.currentMapGetter),this.on("navigation-state-change",m=>{this.externalPubSub.publish("state-change-internal",{Navigation:m})}),this.on("navigation-connection-click",m=>{this.externalPubSub.publish("navigation-connection-click",m)}),this.on("navigation-active-path-change",m=>{this.externalPubSub.publish("navigation-active-path-change",m)}),this.BlueDot=new nu(this.core,this),this.BlueDot.on("blue-dot-position-update",()=>{this._publishBlueDotState({coordinate:this.BlueDot.coordinate,heading:this.BlueDot.heading,accuracy:this.BlueDot.accuracy,floor:this.BlueDot.floor})}),this.BlueDot.on("blue-dot-state-change",()=>{this._publishBlueDotState({state:this.BlueDot.state})}),this.BlueDot.on("blue-dot-follow-change",()=>{this._publishBlueDotState({following:this.BlueDot.following})}),this.Outdoor=new iu(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{n.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{n.publish("outdoor-style-loaded")})),this.Image3D=new eh(p),this.Shapes=new fh(p),this.Style=new gh(p)}get manualFloorVisibility(){return s(this,kh)}set manualFloorVisibility(t){w(this,kh,t),this.externalPubSub.publish("state-change-internal",{manualFloorVisibility:t})}get hidePathsNotOnCurrentFloor(){return s(this,Lh)}set hidePathsNotOnCurrentFloor(t){w(this,Lh,t),this.currentMap?.updatePathLayersVisibility()}preloadFloors(t){t.forEach(o=>{o instanceof bo&&this.core.setState(o.id,{preloadGeometry:!0})})}updateState(t,o){if(o==null||typeof o!="object")return;if(t==="interior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Xt);if(a){let l=a.layers.get(Ea);l&&this.core.hasState(l)&&this.core.setState(l,zI(Dt(lu,o,{warn:!0}),this.core.getState(l)))}});return}if(t==="exterior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Xt);if(a){let l=a.layers.get(Li);l&&this.core.hasState(l)&&this.core.setState(l,zI(Dt(lu,o,{warn:!0}),this.core.getState(l)))}});return}if(t==="interior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Xt);if(a){let l=a.layers.get(td);l&&this.core.hasState(l)&&this.core.setState(l,Vb(Dt(Pc,o,{warn:!0}),this.core.getState(l)))}});return}if(t==="exterior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Xt);if(a){let l=a.layers.get(rd);l&&this.core.hasState(l)&&this.core.setState(l,Vb(Dt(Pc,o,{warn:!0}),this.core.getState(l)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if(n.__type!==yn.__type&&!this.core.hasState(n.id)){L.warn(`Failed to update state for "${n.id}". No ${n.__type} found with that ID.`);return}if(Hs.is(n))return this.core.setState(n.id,j8(Dt(HI,o,{warn:!0}),this.core.getState(n.id)));if($i.is(n))return this.core.setState(n.id,V8(Dt(WI,o,{warn:!0}),this.core.getState(n.id)));if(cr.is(n)||xo.is(n)){let i=this.core.getState(n.id);if(i!=null){let a=i.parent&&i.parent.type==="geometry-group"?this.core.getState(i.parent):void 0;this.core.setState(n.id,B8(Dt(su,o,{warn:!0}),i,a))}}if(jn.is(n)&&this.core.setState(n.id,Dt(su,o,{warn:!0})),yc.is(n)&&this.core.setState(n.id,Dt(XI,o,{warn:!0})),Gn.is(n)&&this.core.setState(n.id,Vb(Dt(Pc,o,{warn:!0}),this.core.getState(n.id))),$s.is(n)&&this.core.setState(n.id,Dt(Eh,o,{warn:!0})),xc.is(n)){let{position:i,scale:a,rotation:l,...c}=Dt(rO,o,{warn:!0}),p=c;i&&(p.position=[i.longitude,i.latitude,i.verticalOffset]),a!=null&&(Array.isArray(a)?p.scale=a:p.scale=[a,a,a]),l!=null&&(Array.isArray(l)?p.rotation=l:p.rotation=[l,l,l]),i&&n.updateTarget(i),this.core.setState(n.id,p)}if(bo.is(n)){let i=this.currentMap.floorsById.get(n.id);if(i==null)return;let a=Dt(Fh,o,{warn:!0});this.core.setState(n.id,a);let l=i.layers.get(Xt);l!=null&&"geometry"in o&&o.geometry&&this.core.setState(l.containerId,Dt(Ch,o.geometry,{warn:!0}));let c=i.layers.get(Ai);if(c!=null&&"labels"in o&&o.labels){let x=Dt(Th,o.labels,{warn:!0});"enabled"in x&&typeof x.enabled=="boolean"&&c.setVisible(x.enabled)}let p=i.layers.get(Un);if(p!=null&&"markers"in o&&o.markers){let x=Dt(Mh,o.markers,{warn:!0});"enabled"in x&&typeof x.enabled=="boolean"&&p.setVisible(x.enabled)}let m=i.layers.get(od);m!=null&&"footprint"in o&&o.footprint&&this.core.setState(m.containerId,Dt(Sh,o.footprint,{warn:!0}));let f=i.layers.get(Da);if(f!=null&&"occlusion"in o&&o.occlusion){let x=Dt(Oh,o.occlusion,{warn:!0});"enabled"in x&&typeof x.enabled=="boolean"&&f.setVisible(x.enabled)}let g=i.layers.get(nd);if(g!=null&&"images"in o&&o.images){let x=Dt(wh,o.images,{warn:!0});"visible"in x&&typeof x.visible=="boolean"&&g.setVisible(x.visible)}let b=i.layers.get(Ri);if(b!=null&&"paths"in o&&o.paths!=null){let x=Dt(Ph,o.paths,{warn:!0});x.visible!=null&&typeof x.visible=="boolean"&&b.setVisible(x.visible)}}if(an.is(n)){let i=this.core.getState(n.id);for(let a of i.children)a.type==="group-container"&&this.core.setState(a.id,Dt(Ih,o,{warn:!0}))}if(qa.is(n)&&this.core.setState(n.id,Dt(J8,o,{warn:!0})),yn.is(n))for(let i of n.segments)this.core.setState(i.id,Dt(au,o,{warn:!0}));Yd.is(n)&&this.core.setState(n.id,Dt(au,o,{warn:!0}))}}getMapDataObject(t){return this.getMapDataInternal()?.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return ku(this.mapData)}getMapData(){return this.mapData}addMap(t,o){return new Promise(n=>{let i;try{i=ku(t)}catch(g){L.error("Error adding map",g),n(t);return}this.mapDataExternal[t.mapName]=t,this.mapData=t;let{mvf:a}=i,l=a["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new ce(l[1],l[0])});let c=a["manifest.geojson"].features[0].properties.name,p=new Kf(`mapObject-${c}`,i,o,this);this.currentMap=p,this.currentMap.loadAllFloors(),this.currentMap.setFloor(this.currentMap.startingFloorId);let m=this.core.getBoundingArea(p.currentFloor.id);m==null&&L.error("Could not determine bounding box for map:",p.currentFloor.id);let f=o?.outdoorView?.layersHiddenByGeometry??[];if(f.length>0){let g,b=[];for(let x of p.floorStacksById.values())if(x.defaultFloor.footprint&&x.defaultFloor.footprint.geometry!=null&&x.defaultFloor.footprint.geometry?.coordinates.length>0){let C=x.defaultFloor.footprint,v=a1(C);g==null?g=v:z6(g,v),b.push(C)}b.length>0&&g!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(g,b,f),this.hiddenOutdoorGeometries.push([g,b,f]))}if(this.mapObjects.push(p),i.getMVFFeatureByType("floor").forEach(g=>{this.mapsByFloorId[g.id]=p}),p.on("floor-change-start",g=>{this.externalPubSub.publish("floor-change-start",{reason:g.reason,floor:this.getMapDataInternal()?.getById("floor",g.floorId)??this.currentFloor,previousFloor:this.getMapDataInternal()?.getById("floor",g.previousFloorId)??this.currentFloor})}),p.on("floor-change",g=>{this.externalPubSub.publish("floor-change",{reason:g.reason,floor:this.currentFloor,previousFloor:this.getMapDataInternal()?.getById("floor",g.previousFloorId)??this.currentFloor}),this.externalPubSub.publish("state-change-internal",{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack})}),o?.zoomLevel!=null)this.core.camera.setZoomLevel(o.zoomLevel),n(t);else if(this.core.mode!=="outdoors-overlay"&&m){let g=o?.screenOffsets??{top:Wb*this.core.canvasHeight,left:Wb*this.core.canvasWidth,right:Wb*this.core.canvasWidth,bottom:Wb*this.core.canvasHeight};this.core.camera.focusOn(m,{duration:L6,padding:g}).then(()=>{this.Camera.setElevation(this.currentFloor.elevation),n(t)})}else n(t)})}setFloor(t,o){return this.currentMap.setFloor(Sm(t),o)}setFloorStack(t,o){return this.currentMap.setFloorStack(Sm(t),o)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){let t=this.currentMap.currentFloorStack.id;if(!t)throw new fr("Missing currentFloorStack.");let o=this.mapData?.getById("floor-stack",t);if(!o)throw new fr("FloorStack was not found in map data.");return o}get currentFloor(){let t=this.currentMap.currentFloor.id;if(!t)throw new fr("Missing currentFloor object from GeoJsonApi");let o=this.mapData?.getById("floor",t);if(!o)throw new fr("Missing currentFloor");return o}getState(t){typeof t=="object"&&yn.is(t)&&L.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let o=W6(t,this),n=this.core.getState(o);if(n){if(["interior-walls","exterior-walls"].includes(t)&&n.type==="geometry-group")return q8(n);if(["interior-doors","exterior-doors"].includes(t)&&n.type==="geometry-group")return T8(n);if(n.type==="geometry"){let i;return"parent"in n&&n.parent&&n.parent.type==="geometry-group"&&(i=this.core.getState(n.parent)),_8(n,i)}else{if(n.type==="label"&&n.options.appearance&&n.options.rank!==void 0&&n.options.interactive!==void 0)return N8(n);if(n.type==="marker"&&n.options?.rank!==void 0&&n.options.interactive!==void 0)return U8(n,this.Markers.getById(n.id.toString())?.marker);if(n.type==="model")return oO(n);if(n.type==="image")return eO(n);if(n.type==="text3d")return K8(n);if(n.type==="geometry-group"&&t&&typeof t!="string"&&$s.is(t))return z8(n);if(n.type==="path")return $8(n);if(n.type==="group-container"&&typeof t!="string"&&bo.is(t))return A8(n,this.currentMap.floorsById.get(t.id),this.core);if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&an.is(t)){let i=this.core.getState(n.children[0].id);return w8(i)}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return t?.type==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,o,n){if(n!=null){let p=this.core.projectScreenXYToCoordinate(t,o,!0);return p?new ce(p.coordinate[1],p.coordinate[0],n.id):void 0}let i=this.core.projectScreenXYToCoordinate(t,o);if(i==null||i.coordinate==null)return;let{coordinate:a,groupContainers:l}=i,c=l?.find(p=>{let m=p.userData.entityId.toString();return m.includes("f_")||m.includes("m_")})?.userData.entityId.toString();return new ce(a[1],a[0],c)}getScreenCoordinateFromCoordinate(t){let o=0;if(t.floorId!=null){let n=this.mapData?.getById("floor",t.floorId);n!=null&&(o=this.getState(n)?.altitude??0)}return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude,o])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}getInView(t,o){let n=this.core.queryGeometry2DInView({screenOffsets:o?.screenOffsets,fullyContains:o?.fullyContains});if(n.length===0)return[];let i=[];switch(t){case Hs.__type:i=n.map(a=>this.Labels.getById(a)).filter(a=>a!=null).map(a=>a.label);break;case $i.__type:i=n.map(a=>this.Markers.getById(a)).filter(a=>a!=null).map(a=>a.marker)}return i}__EXPERIMENTAL__auto(){let t=[],o=this.mapDataExternal[Object.keys(this.mapDataExternal)[0]];return[...o.getByType("connection"),...o.getByType("point-of-interest"),...o.getByType("space")].forEach(n=>{if(n.__type==="connection")n.coordinates.forEach(i=>{let a=n.name||n.externalId;if(a){let l=this.Labels.add(i,a,JI(n));t.push(l)}});else{n.__type==="space"&&n.name!==""&&this.updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let i=n.name;if(i){let a=this.Labels.add(n,i,JI(n));t.push(a)}}}),{labels:t}}tween(t){let o=new Wn(t);return this.core.getExternalTweenGroup().add(o),this.core.render(),o}removeTween(t){this.core.getExternalTweenGroup().remove(t)}tweenGroup(){return this.core.getExternalTweenGroup()}get __core(){return this.core}getCameraState(){return this.core.camera.getState()}getNavigationState(){return{isMultiFloor:this.Navigation.isMultiFloor,floorStacks:this.Navigation.floorStacks,floors:this.Navigation.floors,activeDirections:this.Navigation.activeDirections,activePath:this.Navigation.activePath,paths:this.Navigation.paths}}getAllState(){return{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack,Camera:this.getCameraState(),Navigation:this.getNavigationState(),manualFloorVisibility:this.manualFloorVisibility}}publishAllState(){this.externalPubSub.publish("state-change-internal",this.getAllState())}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Image3D.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}_publishBlueDotState(t){let o;if(t)o=t;else{let{state:n,following:i,heading:a,accuracy:l,coordinate:c,floor:p}=this.BlueDot;o={state:n,following:i,heading:a,accuracy:l,coordinate:c,floor:p}}this.externalPubSub.publish("state-change-internal",{BlueDot:o})}getOptimalVisualDistanceBetweenFloors(t,o=!1){let n=this.currentMap;if(!n){L.error("Cannot compute optimal visual distance between floors. Missing current map.");return}if(t.length<2){L.warn("Cannot compute optimal visual distance between floors. Must provide at least 2 floors.");return}let i=n.renderer.getInternalState().geometry3DMap.get(t[0].id),a=n.renderer.getInternalState().geometry3DMap.get(t[1].id);if(!i||!a){L.warn("Cannot compute optimal visual distance between floors. Floors not found in current map.");return}if(Ac(i,"group-container"),Ac(a,"group-container"),o){let c=new Qt;c.setFromObject(i);let p=new Qt;if(p.setFromObject(a),i.children.forEach(v=>{v instanceof Oe&&v.userData.debugBox&&_t(v)}),a.children.forEach(v=>{v instanceof Oe&&v.userData.debugBox&&_t(v)}),!ll(c)||!ll(p))return;let m=new Sn(c.max.x-c.min.x,c.max.y-c.min.y,c.max.z-c.min.z),f=new Mr({color:255,transparent:!0,opacity:.5}),g=new Oe(m,f);g.position.set((c.min.x+c.max.x)/2,(c.min.y+c.max.y)/2,(c.min.z+c.max.z)/2),g.userData.debugBox=!0;let b=new Sn(p.max.x-p.min.x,p.max.y-p.min.y,p.max.z-p.min.z),x=new Mr({color:"cyan",transparent:!0,opacity:.5}),C=new Oe(b,x);C.position.set((p.min.x+p.max.x)/2,(p.min.y+p.max.y)/2,(p.min.z+p.max.z)/2),C.userData.debugBox=!0,i.add(g),a.add(C)}let l=n.renderer.computeMinZOffsetBetweenContainers(i,a);if(l!==-1)return l}};kh=new WeakMap,Lh=new WeakMap;function DV(e){if(e===""){EI(""),FI("");return}FI(`${e}/${l0}`),EI(`${e}/${a0}`)}d();var zb=class{constructor(r){u(this,"state");u(this,"update");this.update=r.Debug.update.bind(r.Debug),this.state=r.Debug.state}};d();var sO=X.object({environment:X.union([X.literal("basic"),X.literal(!1)]).optional(),text3d:X.object({hoverColor:X.string().optional()}).optional(),geometry:X.object({hoverColor:X.string().optional()}).optional(),backgroundColor:X.string().optional(),backgroundAlpha:X.number().optional()}).strict();d();var KI=Ec($3(),1);var kV=(e,r)=>{let t={},o=(n,i,a)=>{for(let l in i){let c=n[l],p=i[l];typeof p=="object"&&!Array.isArray(p)&&p!==null&&typeof c=="object"&&!Array.isArray(c)&&c!==null?(a[l]={},o(c,p,a[l])):a[l]=c}};return o(e,r,t),t},aO=(e,r)=>{let t=kV(e,r),o=(0,KI.default)({},t,r),n=(0,KI.default)({},t),i=(a,l,c,p=n)=>{for(let m in l){let f=a[m],g=l[m];if(typeof g=="number"&&typeof f=="number")p[m]=f+(g-f)*c;else if(typeof g=="string"&&typeof f=="string"){if(bu(f)&&bu(g)){let b=e0(f),x=e0(g);b&&x?p[m]=F3([b[0]+(x[0]-b[0])*c,b[1]+(x[1]-b[1])*c,b[2]+(x[2]-b[2])*c]):L.warn(`Color "${m}" could not be animated!`)}}else typeof g=="object"&&g!==null&&typeof f=="object"&&f!==null?i(f,g,c,p[m]):L.warn(`Value "${m}" could not be animated!`)}};return a=>(a=Math.min(Math.max(a,0),1),a===0?e:a===1?o:(i(t,r,a),n))};var Fc,te,Ji,Ah=class{constructor(r){S(this,Fc);S(this,te);S(this,Ji);u(this,"Camera");u(this,"Labels");u(this,"Text3D");u(this,"Markers");u(this,"Image3D");u(this,"Models");u(this,"Paths");u(this,"Exporter");u(this,"Navigation");u(this,"__BlueDot");u(this,"Style");u(this,"Shapes");u(this,"Outdoor");u(this,"update",()=>{s(this,te).core.render()});u(this,"__LEGACY_GET_DIRECTIONS_SYNC",(r,t,o)=>s(this,te).getMapData()?.__LEGACY_GET_DIRECTIONS_SYNC(r,t,o)??void 0);u(this,"getDirections",(r,t,o)=>s(this,te).getMapData()?.getDirections(r,t,o)??Promise.resolve(void 0));u(this,"__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC",(r,t,o)=>s(this,te).getMapData()?.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(r,t,o)??void 0);u(this,"getDirectionsMultiDestination",(r,t,o)=>s(this,te).getMapData()?.getDirectionsMultiDestination(r,t,o)??Promise.resolve(void 0));u(this,"on",(r,t)=>{s(this,Fc).on(r,t)});u(this,"off",(r,t)=>{s(this,Fc).off(r,t)});u(this,"Debug");w(this,Fc,new Ie),w(this,Ji,r);let t=new Dh(r,this,s(this,Fc));w(this,te,t),this.Camera=s(this,te).Camera,this.Markers=s(this,te).Markers,this.Models=s(this,te).Models,this.Labels=s(this,te).Labels,this.Text3D=s(this,te).Text3D,this.Exporter=s(this,te).Exporter,this.Paths=s(this,te).Paths,this.Navigation=s(this,te).Navigation,this.__BlueDot=s(this,te).BlueDot,this.Shapes=s(this,te).Shapes,this.Style=s(this,te).Style,this.Outdoor=s(this,te).Outdoor,this.Image3D=s(this,te).Image3D,s(this,Ji).container.dataset.version=y.env.npm_package_version,this.Debug=new zb(s(this,te).core)}updateState(r,t){return s(this,te).updateState(r,t)}animateState(r,t,o){let n=s(this,te).getState(r);if(n==null)return L.warn(`Cannot animate state of ${r}.`),new Promise(p=>p({result:"completed"}));let i=aO(n,t),a=s(this,te).tween({percent:0}).to({percent:1},o?.duration??1e3).onUpdate(({percent:c})=>{s(this,te).updateState(r,i(c))});o?.easing&&o.easing in Gi&&a.easing(Gi[o.easing]);let l=new Promise(c=>{a.onComplete(()=>{s(this,te).removeTween(a),c({result:"completed"})}).onStop(()=>{s(this,te).removeTween(a),c({result:"cancelled"})}),a.start()});return l.cancel=()=>{a.stop(),s(this,te).updateState(r,i(0))},l}updateGlobalState(r){try{sO.parse(r)}catch(t){L.error("updateGlobalState",t);return}if(typeof r=="object"){let t={};if(r.text3d?.hoverColor&&(t.text3dHoverColor=r.text3d.hoverColor),r.geometry?.hoverColor&&(t.hoverColor=r.geometry.hoverColor),r.backgroundColor||r.backgroundAlpha!==void 0){let o=r.backgroundColor??s(this,te).core.backgroundColor,n=r.backgroundAlpha??s(this,te).core.backgroundAlpha;s(this,te).core.setBackgroundColor(o,n)}r.environment!=null&&s(this,te).core.setEnvironment(r.environment),s(this,te).core.setState(t)}}get options(){return _6(s(this,te).currentMap.options)}getGlobalState(){let r=s(this,te).core.getState();return{backgroundColor:s(this,te).core.backgroundColor,backgroundAlpha:s(this,te).core.backgroundAlpha,environment:s(this,te).core.getEnvironment(),geometry:{hoverColor:r.hoverColor},text3d:{hoverColor:r.text3dHoverColor}}}getMapData(){if(s(this,te).mapData==null)throw new fr("MapData not found.");return s(this,te).mapData}getDimensions(){return{width:s(this,Ji).canvasWidth,height:s(this,Ji).canvasHeight}}addMap(r,t){return s(this,te).addMap(r,t)}setFloor(r,t){return s(this,te).setFloor(r,t?.context)}setFloorStack(r,t){return s(this,te).setFloorStack(r,t?.context)}preloadFloors(r){s(this,te).preloadFloors(r)}tween(r){return s(this,te).tween(r)}removeTween(r){s(this,te).removeTween(r)}get tweenGroup(){return s(this,te).tweenGroup()}get currentFloorStack(){return s(this,te).currentFloorStack}get currentFloor(){return s(this,te).currentFloor}updateWatermark(r){s(this,te).updateWatermark(r)}getState(r){return s(this,te).getState(r)}setHoverColor(r){s(this,te).setHoverColor(r)}getHoverColor(){return s(this,te).getHoverColor()}convertAltitudeToMercatorZoomLevel(r){return s(this,te).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(r)}convertMercatorZoomLevelToAltitude(r){return s(this,te).core.getSystems().cameraSystem.convertZoomLevelToAltitude(r)}isInView(r){return s(this,te).isInView(r)}getInView(r,t){return s(this,te).getInView(r,t)}getDistance(r,t){return s(this,te).getMapData()?.getDistance(r,t)}createCoordinate(r,t,o){return typeof r=="object"?new ce(r):new ce(r,t,o?.id)}createCoordinateFromScreenCoordinate(r,t,o){return s(this,te).createCoordinateFromScreenCoordinate(r,t,o)}getScreenCoordinateFromCoordinate(r){return s(this,te).getScreenCoordinateFromCoordinate(r)}__EXPERIMENTAL__auto(){s(this,te).__EXPERIMENTAL__auto()}get __core(){if(y.env.INTERNAL==="true")return s(this,te).core;throw new Error("__core is not available.")}get container(){return s(this,Ji).container}publishAllState(){s(this,te).publishAllState()}clear(){s(this,te).clear()}destroy(){s(this,te).destroy()}async enableDebug(r={}){let{Inspector:t}=await import("./inspector-BHVDJXVZ.js");await new t(this,s(this,te)).enable(r)}async takeScreenshot(){return await s(this,Ji).renderSync(),s(this,Ji).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return s(this,te).manualFloorVisibility}set manualFloorVisibility(r){s(this,te).manualFloorVisibility=r}getOptimalVisualDistanceBetweenFloors(r){return s(this,te).getOptimalVisualDistanceBetweenFloors(r)}get __INTERNAL__hidePathsNotOnCurrentFloor(){return s(this,te).hidePathsNotOnCurrentFloor}set __INTERNAL__hidePathsNotOnCurrentFloor(r){s(this,te).hidePathsNotOnCurrentFloor=!!r}};Fc=new WeakMap,te=new WeakMap,Ji=new WeakMap;d();var LV=1e3*60*60*2,sl,pu,Mt,Ki,ni,In,ii,du,uu,Rh,kt,lO,cO,cu,Zb,QI,qI,e3,mu=class{constructor(r,t){S(this,kt);S(this,sl,new Ie);S(this,pu);S(this,Mt);S(this,Ki);S(this,ni);S(this,In);S(this,ii);S(this,du);S(this,uu);S(this,Rh,()=>{"key"in s(this,Mt)&&"secret"in s(this,Mt)&&W(this,kt,cu).call(this),W(this,kt,Zb).call(this)});u(this,"on",(r,t)=>s(this,sl).on(r,t));u(this,"off",(r,t)=>s(this,sl).off(r,t));w(this,pu,r),w(this,Mt,t)}setMapIds(r){w(this,pu,r)}setEnterprise(r){s(this,Mt).enterprise=r}async readySync(){if((!("key"in s(this,Mt))||!("secret"in s(this,Mt)))&&!("accessToken"in s(this,Mt))){L.error("No API keys or access token provided! Cannot preload tokens.");return}let r=[W(this,kt,cu).call(this),null];s(this,Mt).enterprise||(r[1]=this.getSasTokensAsync());let[t,o]=await Promise.all(r);W(this,kt,e3).call(this),W(this,kt,QI).call(this,t),o!=null&&W(this,kt,qI).call(this,o),yu()&&globalThis.addEventListener?.("focus",s(this,Rh))}async refreshing(){let r=[];return s(this,Ki)!=null&&r.push(s(this,Ki)),s(this,ni)!=null&&r.push(s(this,ni)),Promise.all(r)}getAccessTokenAsync(){return W(this,kt,cu).call(this)}getSasTokensAsync(){return W(this,kt,Zb).call(this)}getAccessToken(){return s(this,In)==null?(L.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):s(this,In)}getSasToken(r){return this.isEnterpriseMode()?(L.error("SAS tokens are not available in the enterprise mode!"),{token:""}):s(this,ii)==null?(L.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):r in s(this,ii).tokens?s(this,ii).tokens[r]:(L.error(`SAS token for map ${r} not found!`),{token:""})}isEnterpriseMode(){return s(this,Mt).enterprise??!1}destroy(){W(this,kt,e3).call(this),s(this,sl).destroy(),yu()&&globalThis.removeEventListener("focus",s(this,Rh))}};sl=new WeakMap,pu=new WeakMap,Mt=new WeakMap,Ki=new WeakMap,ni=new WeakMap,In=new WeakMap,ii=new WeakMap,du=new WeakMap,uu=new WeakMap,Rh=new WeakMap,kt=new WeakSet,lO=function(r){let t=r.token!==s(this,In)?.token;w(this,In,r),t&&s(this,sl).publish("access-token-refreshed",{accessToken:r})},cO=function(r){let t=JSON.stringify(r.tokens)!==JSON.stringify(s(this,ii)?.tokens);w(this,ii,r),t&&s(this,sl).publish("sas-tokens-refreshed",{sasTokens:r.tokens})},cu=async function(r=!1){if("accessToken"in s(this,Mt)&&typeof s(this,Mt).accessToken=="string"){let t={token:s(this,Mt).accessToken,expires:Date.now()+72e5};return w(this,In,t),t}if(!("key"in s(this,Mt))||!("secret"in s(this,Mt))||typeof s(this,Mt).key!="string"||typeof s(this,Mt).secret!="string")throw new Error("No API keys or access token provided!");return s(this,Ki)!=null?s(this,Ki):s(this,In)!=null&&s(this,In).expires!=null&&s(this,In).expires>Date.now()&&!r?s(this,In):(w(this,Ki,bm({...s(this,Mt),key:s(this,Mt).key,secret:s(this,Mt).secret},s(this,Mt).enterprise??!1).then(t=>{let o={token:t.accessToken,expires:t.expiresTimestamp*1e3};return W(this,kt,lO).call(this,o),o}).catch(t=>{throw t}).finally(()=>{w(this,Ki,void 0)})),s(this,Ki))},Zb=async function(r=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:s(this,ni)!=null?s(this,ni):s(this,ii)!=null&&s(this,ii).expires>Date.now()&&!r?s(this,ii):(w(this,ni,new Promise((t,o)=>{W(this,kt,cu).call(this).then(n=>{let i={},a=s(this,pu).map(l=>_x({...s(this,Mt),mapId:l},n.token).then(c=>{i[l]={token:c.token,expires:c.expires}}).catch(c=>{L.error(`Error getting SAS token for map ${l}:`,c)}));Promise.all(a).then(()=>{let l={tokens:i,expires:Math.min(...Object.values(i).map(c=>c.expires??1/0))};W(this,kt,cO).call(this,l),t(l)})}).catch(n=>{o(n)})})),s(this,ni).catch(t=>{throw t}).finally(()=>{w(this,ni,void 0)}),s(this,ni))},QI=function(r){if(!("key"in s(this,Mt))||!("secret"in s(this,Mt)))return;let t=r.expires!=null?r.expires-Date.now():LV;isFinite(t)&&w(this,du,setTimeout(()=>{W(this,kt,cu).call(this,!0).then(o=>{W(this,kt,QI).call(this,o)})},t-t6))},qI=function(r){let t=r.expires-Date.now();isFinite(t)&&w(this,uu,setTimeout(()=>{W(this,kt,Zb).call(this,!0).then(o=>{W(this,kt,qI).call(this,o)})},t-n6))},e3=function(){s(this,du)!=null&&clearTimeout(s(this,du)),s(this,uu)!=null&&clearTimeout(s(this,uu))};d();var AV=async(e,r)=>{let t=("mvfVersion"in(r??{})?r?.mvfVersion:void 0)??("options"in e&&"version"in(e.options??{})?e.options?.version:void 0),o={prefetchTokens:!0,...r||{},mvfVersion:t},n,i=Ma();i.updateByUserOption(o);let a={};if("type"in e&&typeof e.type=="string"){if(a.enterprise=e.options?.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){n=await Zy(e.main,o.mvfVersion),a.languagePacks=[];for(let x of e.languagePacks??[])x.localePack instanceof Uint8Array&&a.languagePacks.push({language:x.language,localePack:await Bp(x.localePack)})}else if(e.type==="json")n=e.main,a.languagePacks=e.languagePacks??[];else throw new Error("Invalid backup type");e.type==="binary"&&e.main instanceof Uint8Array&&(a.binaryBundle=e.main)}else n=e,a.enterprise=n.enterprise!=null;i.setEnterprise(a.enterprise??!1);let l=zy(n),c=l.length>0?l:[o.mapId];o.baseAuthUri=i.getBaseAuthUri();let p=new mu(c,{...o,enterprise:a.enterprise}),m;if("accessToken"in o&&o.accessToken)m=o.accessToken;else if("key"in o&&"secret"in o){let x;try{x=await p.getAccessTokenAsync()}catch(C){L.error("Failed getting token during hydrateMapData",C)}m=x?.token||""}if(a.outdoorViewToken=m,a.env=i,a.getMapDataOptions=o,o.prefetchTokens)try{await p.readySync()}catch(x){L.error("Failed to ready token manager!",x)}Um()&&(a.enterprise&&L.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),o.mvfVersion!=="3.0.0"&&L.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let f=new ql(n,a);m&&f.Analytics.init({accessToken:m,mapId:o.mapId,key:"key"in o?o.key:void 0,secret:"secret"in o?o.secret:void 0,...o.analytics,baseUri:i.getAnalyticsBaseUri(),context:o.analytics?.context});let g=new Du(f),b=f.findPreferredLanguage({languageCode:o.language,fallbackToNavigatorLanguage:!1});if(b)try{await g.changeLanguage(b.code)}catch{}return typeof r?.onMVFParsed=="function"&&r.onMVFParsed(n),g};d();var pO=(e,{id:r}={})=>{let t=Array.isArray(e)?e:[e];if(!t.every(i=>typeof i=="string"))return;let o=t.join(""),n=null;if(r){let i=document.getElementById(r);i instanceof HTMLStyleElement&&(n=i)}n==null&&(n=document.createElement("style")),r&&r!==""&&(n.id=r),n.textContent=o,document.head.appendChild(n)};var dO=`:root {
|
|
948
|
+
--pin-shadow-hover-scale: 0.9;
|
|
949
|
+
--pin-shadow-width: 12px;
|
|
950
|
+
--pin-shadow-height: 5px;
|
|
951
|
+
--pin-shadow-opacity: 0.35;
|
|
952
|
+
--pin-drop-animation-duration-ms: 250ms;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
@keyframes drop-pin {
|
|
956
|
+
0% {
|
|
957
|
+
transform: translateY(-200%);
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
100% {
|
|
961
|
+
transform: translateY(0);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
@keyframes pin-shadow {
|
|
966
|
+
0% {
|
|
967
|
+
transform: scale(var(--pin-shadow-hover-scale));
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
100% {
|
|
971
|
+
transform: scale(1);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
.mappedin-dropped-pin-wrapper {
|
|
976
|
+
position: relative;
|
|
977
|
+
|
|
978
|
+
width: fit-content;
|
|
979
|
+
height: fit-content;
|
|
980
|
+
width: 36px;
|
|
981
|
+
height: 42px;
|
|
982
|
+
|
|
983
|
+
& svg {
|
|
984
|
+
position: absolute;
|
|
985
|
+
left: calc(50% - var(--pin-shadow-width));
|
|
986
|
+
animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
& > .pin-shadow {
|
|
990
|
+
position: absolute;
|
|
991
|
+
left: calc(50% - (var(--pin-shadow-width) / 2));
|
|
992
|
+
bottom: 0;
|
|
993
|
+
|
|
994
|
+
height: var(--pin-shadow-height);
|
|
995
|
+
width: var(--pin-shadow-width);
|
|
996
|
+
border-radius: 100%;
|
|
997
|
+
|
|
998
|
+
opacity: var(--pin-shadow-opacity);
|
|
999
|
+
|
|
1000
|
+
animation: pin-shadow 250ms ease-in;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
@keyframes bounce {
|
|
1005
|
+
0% {
|
|
1006
|
+
transform: translateY(-10px);
|
|
1007
|
+
opacity: 0;
|
|
1008
|
+
}
|
|
1009
|
+
12.5% {
|
|
1010
|
+
transform: translateY(0);
|
|
1011
|
+
opacity: 1;
|
|
1012
|
+
}
|
|
1013
|
+
25% {
|
|
1014
|
+
transform: translateY(0);
|
|
1015
|
+
}
|
|
1016
|
+
37.5% {
|
|
1017
|
+
transform: translateY(-10px);
|
|
1018
|
+
}
|
|
1019
|
+
50% {
|
|
1020
|
+
transform: translateY(0);
|
|
1021
|
+
}
|
|
1022
|
+
62.5% {
|
|
1023
|
+
transform: translateY(-10px);
|
|
1024
|
+
}
|
|
1025
|
+
75% {
|
|
1026
|
+
transform: translateY(0);
|
|
1027
|
+
}
|
|
1028
|
+
87.5% {
|
|
1029
|
+
transform: translateY(-10px);
|
|
1030
|
+
}
|
|
1031
|
+
100% {
|
|
1032
|
+
transform: translateY(0);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
.mappedin-connection-marker {
|
|
1037
|
+
position: relative;
|
|
1038
|
+
display: flex;
|
|
1039
|
+
|
|
1040
|
+
.bouncey {
|
|
1041
|
+
animation: bounce 2.5s linear;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
.arrow--down {
|
|
1045
|
+
transform: rotate(180deg);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
.connection-circle {
|
|
1049
|
+
display: flex;
|
|
1050
|
+
box-sizing: border-box;
|
|
1051
|
+
justify-content: center;
|
|
1052
|
+
align-items: center;
|
|
1053
|
+
border-radius: 50%;
|
|
1054
|
+
border: 2px solid white;
|
|
1055
|
+
box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);
|
|
1056
|
+
background: #595959;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
`;var uO=`.mappedin-marker {
|
|
1060
|
+
font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
1061
|
+
font-weight: normal;
|
|
1062
|
+
top: 0;
|
|
1063
|
+
position: absolute;
|
|
1064
|
+
font-weight: bold;
|
|
1065
|
+
color: black;
|
|
1066
|
+
display: flex;
|
|
1067
|
+
flex-direction: row;
|
|
1068
|
+
will-change: transform, opacity;
|
|
1069
|
+
transition: opacity 150ms ease-in-out;
|
|
1070
|
+
justify-content: center;
|
|
1071
|
+
opacity: 0;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/* Low priority pin strategy styles */
|
|
1075
|
+
|
|
1076
|
+
/* Hide child elements as well */
|
|
1077
|
+
.mappedin-marker[data-placement='low-priority-pin'] > .mappedin-marker-content {
|
|
1078
|
+
visibility: hidden;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/* Create the pin using ::before pseudo-element */
|
|
1082
|
+
.mappedin-marker::before {
|
|
1083
|
+
content: '';
|
|
1084
|
+
display: none;
|
|
1085
|
+
border-radius: 50%;
|
|
1086
|
+
position: relative;
|
|
1087
|
+
/* Default values - will be overridden by inline styles */
|
|
1088
|
+
width: var(--mappedin-pin-size, 2px);
|
|
1089
|
+
height: var(--mappedin-pin-size, 2px);
|
|
1090
|
+
background-color: var(--pin-color, #666);
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
.mappedin-marker[data-placement='low-priority-pin']::before {
|
|
1094
|
+
display: block;
|
|
1095
|
+
}
|
|
1096
|
+
`;var mO=`.mappedin__smart-collision-engine__container {
|
|
1097
|
+
position: absolute;
|
|
1098
|
+
left: 0px;
|
|
1099
|
+
top: 0px;
|
|
1100
|
+
bottom: 0px;
|
|
1101
|
+
right: 0px;
|
|
1102
|
+
pointer-events: none;
|
|
1103
|
+
/* Enables colliders to use translate3D */
|
|
1104
|
+
transform-style: preserve-3d;
|
|
1105
|
+
font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
.mappedin__smart-collision-engine-debug__container {
|
|
1109
|
+
position: absolute;
|
|
1110
|
+
left: 0px;
|
|
1111
|
+
top: 0px;
|
|
1112
|
+
bottom: 0px;
|
|
1113
|
+
right: 0px;
|
|
1114
|
+
transition: opacity 300ms ease-in-out;
|
|
1115
|
+
pointer-events: none;
|
|
1116
|
+
will-change: opacity;
|
|
1117
|
+
&.interacting {
|
|
1118
|
+
opacity: 0.2;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
`;var fO=`.mappedin-map {
|
|
1122
|
+
.mappedin-interactive {
|
|
1123
|
+
cursor: grab;
|
|
1124
|
+
|
|
1125
|
+
&:active {
|
|
1126
|
+
cursor: grabbing;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
&.mappedin-interaction-hover {
|
|
1130
|
+
cursor: pointer;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
`;var hO=`.mappedin-map {
|
|
1135
|
+
.mappedin-control-container {
|
|
1136
|
+
position: absolute;
|
|
1137
|
+
left: 0px;
|
|
1138
|
+
top: 0px;
|
|
1139
|
+
bottom: 0px;
|
|
1140
|
+
right: 0px;
|
|
1141
|
+
pointer-events: none;
|
|
1142
|
+
font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
1143
|
+
|
|
1144
|
+
.mappedin-ctrl-top-left,
|
|
1145
|
+
.mappedin-ctrl-top-right,
|
|
1146
|
+
.mappedin-ctrl-bottom-left,
|
|
1147
|
+
.mappedin-ctrl-bottom-right {
|
|
1148
|
+
position: absolute;
|
|
1149
|
+
pointer-events: none;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
.mappedin-ctrl-top-left {
|
|
1153
|
+
top: 0;
|
|
1154
|
+
left: 0;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
.mappedin-ctrl-top-right {
|
|
1158
|
+
top: 0;
|
|
1159
|
+
right: 0;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
.mappedin-ctrl-bottom-left {
|
|
1163
|
+
bottom: 0;
|
|
1164
|
+
left: 0;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
.mappedin-ctrl-bottom-right {
|
|
1168
|
+
bottom: 0;
|
|
1169
|
+
right: 0;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
.mappedin-ctrl-attrib {
|
|
1173
|
+
display: block;
|
|
1174
|
+
position: relative;
|
|
1175
|
+
pointer-events: auto;
|
|
1176
|
+
font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
1177
|
+
padding: 3px 5px 1px 5px;
|
|
1178
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
1179
|
+
margin: 0;
|
|
1180
|
+
min-width: 11px;
|
|
1181
|
+
min-height: 11px;
|
|
1182
|
+
user-select: none;
|
|
1183
|
+
|
|
1184
|
+
summary.mappedin-ctrl-attrib-button {
|
|
1185
|
+
appearance: none;
|
|
1186
|
+
list-style: none;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
summary.mappedin-ctrl-attrib-button::-webkit-details-marker {
|
|
1190
|
+
display: none;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
&.mappedin-compact .mappedin-ctrl-attrib-button,
|
|
1194
|
+
&.mappedin-compact-show .mappedin-ctrl-attrib-inner {
|
|
1195
|
+
display: inline-block;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
&.mappedin-compact {
|
|
1199
|
+
background-color: transparent;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
&.mappedin-compact-show {
|
|
1203
|
+
min-width: 15px;
|
|
1204
|
+
min-height: 15px;
|
|
1205
|
+
box-sizing: border-box;
|
|
1206
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
.mappedin-ctrl-attrib-top-left {
|
|
1211
|
+
float: left;
|
|
1212
|
+
border-bottom-right-radius: 4px;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
.mappedin-ctrl-attrib-top-right {
|
|
1216
|
+
float: right;
|
|
1217
|
+
border-bottom-left-radius: 4px;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
.mappedin-ctrl-attrib-bottom-left {
|
|
1221
|
+
float: left;
|
|
1222
|
+
border-top-right-radius: 4px;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
.mappedin-ctrl-attrib-bottom-right {
|
|
1226
|
+
float: right;
|
|
1227
|
+
border-top-left-radius: 4px;
|
|
1228
|
+
}
|
|
1229
|
+
.mappedin-ctrl-attrib-top-left,
|
|
1230
|
+
.mappedin-ctrl-attrib-bottom-left {
|
|
1231
|
+
padding: 3px 5px 1px 20px;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
.mappedin-ctrl-attrib-inner {
|
|
1235
|
+
display: inline-block;
|
|
1236
|
+
margin-right: 12px;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
.mappedin-ctrl-attrib-inner,
|
|
1240
|
+
.mappedin-ctrl-attrib-inner a {
|
|
1241
|
+
color: rgba(0, 0, 0, 0.75);
|
|
1242
|
+
text-decoration: none;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
.mappedin-ctrl-attrib-inner-bold,
|
|
1246
|
+
.mappedin-ctrl-attrib-inner-bold a {
|
|
1247
|
+
font-weight: bold;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
.mappedin-ctrl-attrib-inner a:hover {
|
|
1251
|
+
color: #017ef1;
|
|
1252
|
+
text-decoration: underline;
|
|
1253
|
+
cursor: pointer;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
.mappedin-ctrl-attrib-button {
|
|
1257
|
+
display: none;
|
|
1258
|
+
cursor: pointer;
|
|
1259
|
+
position: absolute;
|
|
1260
|
+
width: 15px;
|
|
1261
|
+
height: 15px;
|
|
1262
|
+
box-sizing: border-box;
|
|
1263
|
+
border-radius: 50%;
|
|
1264
|
+
top: 0;
|
|
1265
|
+
right: 2px;
|
|
1266
|
+
border: 1px;
|
|
1267
|
+
}
|
|
1268
|
+
.mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,
|
|
1269
|
+
.mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {
|
|
1270
|
+
left: 2px;
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
`;var gO=`.maplibregl-map {
|
|
1275
|
+
font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
|
|
1276
|
+
overflow: hidden;
|
|
1277
|
+
position: relative;
|
|
1278
|
+
-webkit-tap-highlight-color: rgb(0 0 0 / 0%);
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
.maplibregl-canvas {
|
|
1282
|
+
position: absolute;
|
|
1283
|
+
left: 0;
|
|
1284
|
+
top: 0;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
.maplibregl-map:fullscreen {
|
|
1288
|
+
width: 100%;
|
|
1289
|
+
height: 100%;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
.maplibregl-ctrl-group button.maplibregl-ctrl-compass {
|
|
1293
|
+
touch-action: none;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
.maplibregl-canvas-container.maplibregl-interactive,
|
|
1297
|
+
.maplibregl-ctrl-group button.maplibregl-ctrl-compass {
|
|
1298
|
+
cursor: grab;
|
|
1299
|
+
user-select: none;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {
|
|
1303
|
+
cursor: pointer;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
.maplibregl-canvas-container.maplibregl-interactive:active,
|
|
1307
|
+
.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {
|
|
1308
|
+
cursor: grabbing;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,
|
|
1312
|
+
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {
|
|
1313
|
+
touch-action: pan-x pan-y;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
.maplibregl-canvas-container.maplibregl-touch-drag-pan,
|
|
1317
|
+
.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {
|
|
1318
|
+
touch-action: pinch-zoom;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,
|
|
1322
|
+
.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {
|
|
1323
|
+
touch-action: none;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,
|
|
1327
|
+
.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {
|
|
1328
|
+
touch-action: pan-x pan-y;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
.maplibregl-ctrl-top-left,
|
|
1332
|
+
.maplibregl-ctrl-top-right,
|
|
1333
|
+
.maplibregl-ctrl-bottom-left,
|
|
1334
|
+
.maplibregl-ctrl-bottom-right {
|
|
1335
|
+
position: absolute;
|
|
1336
|
+
pointer-events: none;
|
|
1337
|
+
z-index: 2;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
.maplibregl-ctrl-top-left {
|
|
1341
|
+
top: 0;
|
|
1342
|
+
left: 0;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
.maplibregl-ctrl-top-right {
|
|
1346
|
+
top: 0;
|
|
1347
|
+
right: 0;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
.maplibregl-ctrl-bottom-left {
|
|
1351
|
+
bottom: 0;
|
|
1352
|
+
left: 0;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
.maplibregl-ctrl-bottom-right {
|
|
1356
|
+
right: 0;
|
|
1357
|
+
bottom: 0;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
.maplibregl-ctrl {
|
|
1361
|
+
clear: both;
|
|
1362
|
+
pointer-events: auto;
|
|
1363
|
+
|
|
1364
|
+
/* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */
|
|
1365
|
+
transform: translate(0, 0);
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
.maplibregl-ctrl-top-left .maplibregl-ctrl {
|
|
1369
|
+
margin: 10px 0 0 10px;
|
|
1370
|
+
float: left;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
.maplibregl-ctrl-top-right .maplibregl-ctrl {
|
|
1374
|
+
margin: 10px 10px 0 0;
|
|
1375
|
+
float: right;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
.maplibregl-ctrl-bottom-left .maplibregl-ctrl {
|
|
1379
|
+
margin: 0 0 10px 10px;
|
|
1380
|
+
float: left;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
.maplibregl-ctrl-bottom-right .maplibregl-ctrl {
|
|
1384
|
+
margin: 0 10px 10px 0;
|
|
1385
|
+
float: right;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
.maplibregl-ctrl-group {
|
|
1389
|
+
border-radius: 4px;
|
|
1390
|
+
background: #fff;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
.maplibregl-ctrl-group:not(:empty) {
|
|
1394
|
+
box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
@media (forced-colors: active) {
|
|
1398
|
+
.maplibregl-ctrl-group:not(:empty) {
|
|
1399
|
+
box-shadow: 0 0 0 2px ButtonText;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
.maplibregl-ctrl-group button {
|
|
1404
|
+
width: 29px;
|
|
1405
|
+
height: 29px;
|
|
1406
|
+
display: block;
|
|
1407
|
+
padding: 0;
|
|
1408
|
+
outline: none;
|
|
1409
|
+
border: 0;
|
|
1410
|
+
box-sizing: border-box;
|
|
1411
|
+
background-color: transparent;
|
|
1412
|
+
cursor: pointer;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
.maplibregl-ctrl-group button + button {
|
|
1416
|
+
border-top: 1px solid #ddd;
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
.maplibregl-ctrl button .maplibregl-ctrl-icon {
|
|
1420
|
+
display: block;
|
|
1421
|
+
width: 100%;
|
|
1422
|
+
height: 100%;
|
|
1423
|
+
background-repeat: no-repeat;
|
|
1424
|
+
background-position: center center;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
@media (forced-colors: active) {
|
|
1428
|
+
.maplibregl-ctrl-icon {
|
|
1429
|
+
background-color: transparent;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
.maplibregl-ctrl-group button + button {
|
|
1433
|
+
border-top: 1px solid ButtonText;
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */
|
|
1438
|
+
.maplibregl-ctrl button::-moz-focus-inner {
|
|
1439
|
+
border: 0;
|
|
1440
|
+
padding: 0;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
.maplibregl-ctrl-attrib-button:focus,
|
|
1444
|
+
.maplibregl-ctrl-group button:focus {
|
|
1445
|
+
box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
.maplibregl-ctrl button:disabled {
|
|
1449
|
+
cursor: not-allowed;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {
|
|
1453
|
+
opacity: 0.25;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
@media (hover: hover) {
|
|
1457
|
+
.maplibregl-ctrl button:not(:disabled):hover {
|
|
1458
|
+
background-color: rgb(0 0 0/5%);
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
.maplibregl-ctrl button:not(:disabled):active {
|
|
1463
|
+
background-color: rgb(0 0 0/5%);
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
.maplibregl-ctrl-group button:focus:focus-visible {
|
|
1467
|
+
box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
.maplibregl-ctrl-group button:focus:not(:focus-visible) {
|
|
1471
|
+
box-shadow: none;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
.maplibregl-ctrl-group button:focus:first-child {
|
|
1475
|
+
border-radius: 4px 4px 0 0;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
.maplibregl-ctrl-group button:focus:last-child {
|
|
1479
|
+
border-radius: 0 0 4px 4px;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
.maplibregl-ctrl-group button:focus:only-child {
|
|
1483
|
+
border-radius: inherit;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
|
|
1487
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {
|
|
1491
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
@media (forced-colors: active) {
|
|
1495
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
|
|
1496
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {
|
|
1500
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
@media (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1505
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
|
|
1506
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {
|
|
1510
|
+
background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {
|
|
1515
|
+
background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {
|
|
1519
|
+
background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
@media (forced-colors: active) {
|
|
1523
|
+
.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {
|
|
1524
|
+
background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {
|
|
1528
|
+
background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
@media (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1533
|
+
.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {
|
|
1534
|
+
background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {
|
|
1538
|
+
background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {
|
|
1543
|
+
background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
@media (forced-colors: active) {
|
|
1547
|
+
.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {
|
|
1548
|
+
@svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {
|
|
1549
|
+
fill: #fff;
|
|
1550
|
+
#south { fill: #999; }
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
background-image: svg-inline(ctrl-compass-white);
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
@media (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1558
|
+
.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {
|
|
1559
|
+
background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
@svg-load ctrl-globe url("svg/maplibregl-ctrl-globe.svg") {
|
|
1564
|
+
stroke: #333;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
@svg-load ctrl-globe-enabled url("svg/maplibregl-ctrl-globe.svg") {
|
|
1568
|
+
stroke: #33b5e5;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon {
|
|
1572
|
+
background-image: svg-inline(ctrl-globe);
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon {
|
|
1576
|
+
background-image: svg-inline(ctrl-globe-enabled);
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {
|
|
1580
|
+
fill: #333;
|
|
1581
|
+
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {
|
|
1585
|
+
fill: #33b5e5;
|
|
1586
|
+
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {
|
|
1590
|
+
background-image: svg-inline(ctrl-terrain);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {
|
|
1594
|
+
background-image: svg-inline(ctrl-terrain-enabled);
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1598
|
+
fill: #333;
|
|
1599
|
+
#stroke { display: none; }
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1603
|
+
fill: #fff;
|
|
1604
|
+
#stroke { display: none; }
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1608
|
+
fill: #000;
|
|
1609
|
+
#stroke { display: none; }
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1613
|
+
fill: #aaa;
|
|
1614
|
+
#stroke { fill: #f00; }
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1618
|
+
fill: #999;
|
|
1619
|
+
#stroke { fill: #f00; }
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1623
|
+
fill: #666;
|
|
1624
|
+
#stroke { fill: #f00; }
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1628
|
+
fill: #33b5e5;
|
|
1629
|
+
#stroke { display: none; }
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1633
|
+
fill: #e58978;
|
|
1634
|
+
#stroke { display: none; }
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1638
|
+
fill: #33b5e5;
|
|
1639
|
+
#stroke { display: none; }
|
|
1640
|
+
#dot { display: none; }
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {
|
|
1644
|
+
fill: #e54e33;
|
|
1645
|
+
#stroke { display: none; }
|
|
1646
|
+
#dot { display: none; }
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {
|
|
1650
|
+
background-image: svg-inline(ctrl-geolocate);
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {
|
|
1654
|
+
background-image: svg-inline(ctrl-geolocate-disabled);
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {
|
|
1658
|
+
background-image: svg-inline(ctrl-geolocate-active);
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {
|
|
1662
|
+
background-image: svg-inline(ctrl-geolocate-active-error);
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {
|
|
1666
|
+
background-image: svg-inline(ctrl-geolocate-background);
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {
|
|
1670
|
+
background-image: svg-inline(ctrl-geolocate-background-error);
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {
|
|
1674
|
+
animation: maplibregl-spin 2s infinite linear;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
@media (forced-colors: active) {
|
|
1678
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {
|
|
1679
|
+
background-image: svg-inline(ctrl-geolocate-white);
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {
|
|
1683
|
+
background-image: svg-inline(ctrl-geolocate-disabled-white);
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {
|
|
1687
|
+
background-image: svg-inline(ctrl-geolocate-active);
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {
|
|
1691
|
+
background-image: svg-inline(ctrl-geolocate-active-error);
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {
|
|
1695
|
+
background-image: svg-inline(ctrl-geolocate-background);
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {
|
|
1699
|
+
background-image: svg-inline(ctrl-geolocate-background-error);
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
@media (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1704
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {
|
|
1705
|
+
background-image: svg-inline(ctrl-geolocate-black);
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {
|
|
1709
|
+
background-image: svg-inline(ctrl-geolocate-disabled-black);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
@keyframes maplibregl-spin {
|
|
1714
|
+
0% { transform: rotate(0deg); }
|
|
1715
|
+
100% { transform: rotate(360deg); }
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
a.maplibregl-ctrl-logo {
|
|
1719
|
+
width: 88px;
|
|
1720
|
+
height: 23px;
|
|
1721
|
+
margin: 0 0 -4px -4px;
|
|
1722
|
+
display: block;
|
|
1723
|
+
background-repeat: no-repeat;
|
|
1724
|
+
cursor: pointer;
|
|
1725
|
+
overflow: hidden;
|
|
1726
|
+
background-image: svg-load("svg/maplibregl-ctrl-logo.svg");
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
a.maplibregl-ctrl-logo.maplibregl-compact {
|
|
1730
|
+
width: 14px;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
@media (forced-colors: active) {
|
|
1734
|
+
a.maplibregl-ctrl-logo {
|
|
1735
|
+
@svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {
|
|
1736
|
+
#outline { opacity: 1; }
|
|
1737
|
+
#fill { opacity: 1; }
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
background-color: transparent;
|
|
1741
|
+
background-image: svg-inline(ctrl-logo-white);
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
@media (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1746
|
+
a.maplibregl-ctrl-logo {
|
|
1747
|
+
@svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {
|
|
1748
|
+
#outline { opacity: 1; fill: #fff; stroke: #fff; }
|
|
1749
|
+
#fill { opacity: 1; fill: #000; }
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
background-image: svg-inline(ctrl-logo-black);
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
.maplibregl-ctrl.maplibregl-ctrl-attrib {
|
|
1757
|
+
padding: 0 5px;
|
|
1758
|
+
background-color: rgb(255 255 255 / 50%);
|
|
1759
|
+
margin: 0;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
@media screen {
|
|
1763
|
+
.maplibregl-ctrl-attrib.maplibregl-compact {
|
|
1764
|
+
min-height: 20px;
|
|
1765
|
+
padding: 2px 24px 2px 0;
|
|
1766
|
+
margin: 10px;
|
|
1767
|
+
position: relative;
|
|
1768
|
+
background-color: #fff;
|
|
1769
|
+
color: #000;
|
|
1770
|
+
border-radius: 12px;
|
|
1771
|
+
box-sizing: content-box;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
.maplibregl-ctrl-attrib.maplibregl-compact-show {
|
|
1775
|
+
padding: 2px 28px 2px 8px;
|
|
1776
|
+
visibility: visible;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
.maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,
|
|
1780
|
+
.maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {
|
|
1781
|
+
padding: 2px 8px 2px 28px;
|
|
1782
|
+
border-radius: 12px;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {
|
|
1786
|
+
display: none;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
.maplibregl-ctrl-attrib-button {
|
|
1790
|
+
display: none;
|
|
1791
|
+
cursor: pointer;
|
|
1792
|
+
position: absolute;
|
|
1793
|
+
background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");
|
|
1794
|
+
background-color: rgb(255 255 255 / 50%);
|
|
1795
|
+
width: 24px;
|
|
1796
|
+
height: 24px;
|
|
1797
|
+
box-sizing: border-box;
|
|
1798
|
+
border-radius: 12px;
|
|
1799
|
+
outline: none;
|
|
1800
|
+
top: 0;
|
|
1801
|
+
right: 0;
|
|
1802
|
+
border: 0;
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {
|
|
1806
|
+
appearance: none;
|
|
1807
|
+
list-style: none;
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {
|
|
1811
|
+
display: none;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,
|
|
1815
|
+
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {
|
|
1816
|
+
left: 0;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,
|
|
1820
|
+
.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {
|
|
1821
|
+
display: block;
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {
|
|
1825
|
+
background-color: rgb(0 0 0 / 5%);
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
.maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1829
|
+
bottom: 0;
|
|
1830
|
+
right: 0;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
.maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1834
|
+
top: 0;
|
|
1835
|
+
right: 0;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
.maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1839
|
+
top: 0;
|
|
1840
|
+
left: 0;
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
.maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1844
|
+
bottom: 0;
|
|
1845
|
+
left: 0;
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
@media screen and (forced-colors: active) {
|
|
1850
|
+
.maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1851
|
+
background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
@media screen and (forced-colors: active) and (prefers-color-scheme: light) {
|
|
1856
|
+
.maplibregl-ctrl-attrib.maplibregl-compact::after {
|
|
1857
|
+
background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
.maplibregl-ctrl-attrib a {
|
|
1862
|
+
color: rgb(0 0 0 / 75%);
|
|
1863
|
+
text-decoration: none;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
.maplibregl-ctrl-attrib a:hover {
|
|
1867
|
+
color: inherit;
|
|
1868
|
+
text-decoration: underline;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
.maplibregl-attrib-empty {
|
|
1872
|
+
display: none;
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
.maplibregl-ctrl-scale {
|
|
1876
|
+
background-color: rgb(255 255 255 / 75%);
|
|
1877
|
+
font-size: 10px;
|
|
1878
|
+
border-width: medium 2px 2px;
|
|
1879
|
+
border-style: none solid solid;
|
|
1880
|
+
border-color: #333;
|
|
1881
|
+
padding: 0 5px;
|
|
1882
|
+
color: #333;
|
|
1883
|
+
box-sizing: border-box;
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
.maplibregl-popup {
|
|
1887
|
+
position: absolute;
|
|
1888
|
+
top: 0;
|
|
1889
|
+
left: 0;
|
|
1890
|
+
display: flex;
|
|
1891
|
+
will-change: transform;
|
|
1892
|
+
pointer-events: none;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
.maplibregl-popup-anchor-top,
|
|
1896
|
+
.maplibregl-popup-anchor-top-left,
|
|
1897
|
+
.maplibregl-popup-anchor-top-right {
|
|
1898
|
+
flex-direction: column;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
.maplibregl-popup-anchor-bottom,
|
|
1902
|
+
.maplibregl-popup-anchor-bottom-left,
|
|
1903
|
+
.maplibregl-popup-anchor-bottom-right {
|
|
1904
|
+
flex-direction: column-reverse;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
.maplibregl-popup-anchor-left {
|
|
1908
|
+
flex-direction: row;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
.maplibregl-popup-anchor-right {
|
|
1912
|
+
flex-direction: row-reverse;
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
.maplibregl-popup-tip {
|
|
1916
|
+
width: 0;
|
|
1917
|
+
height: 0;
|
|
1918
|
+
border: 10px solid transparent;
|
|
1919
|
+
z-index: 1;
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
.maplibregl-popup-anchor-top .maplibregl-popup-tip {
|
|
1923
|
+
align-self: center;
|
|
1924
|
+
border-top: none;
|
|
1925
|
+
border-bottom-color: #fff;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {
|
|
1929
|
+
align-self: flex-start;
|
|
1930
|
+
border-top: none;
|
|
1931
|
+
border-left: none;
|
|
1932
|
+
border-bottom-color: #fff;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
|
|
1936
|
+
align-self: flex-end;
|
|
1937
|
+
border-top: none;
|
|
1938
|
+
border-right: none;
|
|
1939
|
+
border-bottom-color: #fff;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
|
|
1943
|
+
align-self: center;
|
|
1944
|
+
border-bottom: none;
|
|
1945
|
+
border-top-color: #fff;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {
|
|
1949
|
+
align-self: flex-start;
|
|
1950
|
+
border-bottom: none;
|
|
1951
|
+
border-left: none;
|
|
1952
|
+
border-top-color: #fff;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
|
|
1956
|
+
align-self: flex-end;
|
|
1957
|
+
border-bottom: none;
|
|
1958
|
+
border-right: none;
|
|
1959
|
+
border-top-color: #fff;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
|
|
1963
|
+
align-self: center;
|
|
1964
|
+
border-left: none;
|
|
1965
|
+
border-right-color: #fff;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
|
|
1969
|
+
align-self: center;
|
|
1970
|
+
border-right: none;
|
|
1971
|
+
border-left-color: #fff;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
.maplibregl-popup-close-button {
|
|
1975
|
+
position: absolute;
|
|
1976
|
+
right: 0;
|
|
1977
|
+
top: 0;
|
|
1978
|
+
border: 0;
|
|
1979
|
+
border-radius: 0 3px 0 0;
|
|
1980
|
+
cursor: pointer;
|
|
1981
|
+
background-color: transparent;
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
.maplibregl-popup-close-button:hover {
|
|
1985
|
+
background-color: rgb(0 0 0 / 5%);
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
.maplibregl-popup-content {
|
|
1989
|
+
position: relative;
|
|
1990
|
+
background: #fff;
|
|
1991
|
+
border-radius: 3px;
|
|
1992
|
+
box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
|
|
1993
|
+
padding: 15px 10px;
|
|
1994
|
+
pointer-events: auto;
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
.maplibregl-popup-anchor-top-left .maplibregl-popup-content {
|
|
1998
|
+
border-top-left-radius: 0;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
.maplibregl-popup-anchor-top-right .maplibregl-popup-content {
|
|
2002
|
+
border-top-right-radius: 0;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {
|
|
2006
|
+
border-bottom-left-radius: 0;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {
|
|
2010
|
+
border-bottom-right-radius: 0;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
.maplibregl-popup-track-pointer {
|
|
2014
|
+
display: none;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
.maplibregl-popup-track-pointer * {
|
|
2018
|
+
pointer-events: none;
|
|
2019
|
+
user-select: none;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
.maplibregl-map:hover .maplibregl-popup-track-pointer {
|
|
2023
|
+
display: flex;
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
.maplibregl-map:active .maplibregl-popup-track-pointer {
|
|
2027
|
+
display: none;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
.maplibregl-marker {
|
|
2031
|
+
position: absolute;
|
|
2032
|
+
top: 0;
|
|
2033
|
+
left: 0;
|
|
2034
|
+
will-change: transform;
|
|
2035
|
+
transition: opacity 0.2s;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
.maplibregl-user-location-dot {
|
|
2039
|
+
background-color: #1da1f2;
|
|
2040
|
+
width: 15px;
|
|
2041
|
+
height: 15px;
|
|
2042
|
+
border-radius: 50%;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
.maplibregl-user-location-dot::before {
|
|
2046
|
+
background-color: #1da1f2;
|
|
2047
|
+
content: "";
|
|
2048
|
+
width: 15px;
|
|
2049
|
+
height: 15px;
|
|
2050
|
+
border-radius: 50%;
|
|
2051
|
+
position: absolute;
|
|
2052
|
+
animation: maplibregl-user-location-dot-pulse 2s infinite;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
.maplibregl-user-location-dot::after {
|
|
2056
|
+
border-radius: 50%;
|
|
2057
|
+
border: 2px solid #fff;
|
|
2058
|
+
content: "";
|
|
2059
|
+
height: 19px;
|
|
2060
|
+
left: -2px;
|
|
2061
|
+
position: absolute;
|
|
2062
|
+
top: -2px;
|
|
2063
|
+
width: 19px;
|
|
2064
|
+
box-sizing: border-box;
|
|
2065
|
+
box-shadow: 0 0 3px rgb(0 0 0 / 35%);
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
@keyframes maplibregl-user-location-dot-pulse {
|
|
2069
|
+
0% { transform: scale(1); opacity: 1; }
|
|
2070
|
+
70% { transform: scale(3); opacity: 0; }
|
|
2071
|
+
100% { transform: scale(1); opacity: 0; }
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
.maplibregl-user-location-dot-stale {
|
|
2075
|
+
background-color: #aaa;
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
.maplibregl-user-location-dot-stale::after {
|
|
2079
|
+
display: none;
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
.maplibregl-user-location-accuracy-circle {
|
|
2083
|
+
background-color: #1da1f233;
|
|
2084
|
+
width: 1px;
|
|
2085
|
+
height: 1px;
|
|
2086
|
+
border-radius: 100%;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
.maplibregl-crosshair,
|
|
2090
|
+
.maplibregl-crosshair .maplibregl-interactive,
|
|
2091
|
+
.maplibregl-crosshair .maplibregl-interactive:active {
|
|
2092
|
+
cursor: crosshair;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
.maplibregl-boxzoom {
|
|
2096
|
+
position: absolute;
|
|
2097
|
+
top: 0;
|
|
2098
|
+
left: 0;
|
|
2099
|
+
width: 0;
|
|
2100
|
+
height: 0;
|
|
2101
|
+
background: #fff;
|
|
2102
|
+
border: 2px dotted #202020;
|
|
2103
|
+
opacity: 0.5;
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
.maplibregl-cooperative-gesture-screen {
|
|
2107
|
+
background: rgba(0 0 0 / 40%);
|
|
2108
|
+
position: absolute;
|
|
2109
|
+
inset: 0;
|
|
2110
|
+
display: flex;
|
|
2111
|
+
justify-content: center;
|
|
2112
|
+
align-items: center;
|
|
2113
|
+
color: white;
|
|
2114
|
+
padding: 1rem;
|
|
2115
|
+
font-size: 1.4em;
|
|
2116
|
+
line-height: 1.2;
|
|
2117
|
+
opacity: 0;
|
|
2118
|
+
pointer-events: none;
|
|
2119
|
+
transition: opacity 1s ease 1s;
|
|
2120
|
+
z-index: 99999;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
.maplibregl-cooperative-gesture-screen.maplibregl-show {
|
|
2124
|
+
opacity: 1;
|
|
2125
|
+
transition: opacity 0.05s;
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {
|
|
2129
|
+
display: none;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
@media (hover: none), (pointer: coarse) {
|
|
2133
|
+
.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {
|
|
2134
|
+
display: none;
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {
|
|
2138
|
+
display: block;
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
.maplibregl-pseudo-fullscreen {
|
|
2143
|
+
position: fixed !important;
|
|
2144
|
+
width: 100% !important;
|
|
2145
|
+
height: 100% !important;
|
|
2146
|
+
top: 0 !important;
|
|
2147
|
+
left: 0 !important;
|
|
2148
|
+
z-index: 99999;
|
|
2149
|
+
}
|
|
2150
|
+
`;d();function UV(e){if(!(!e.languages||!yu()||!globalThis.navigator?.languages?.length))for(let r=0;r<globalThis.navigator.languages.length;r++){let t=e.languages.find(o=>o.code.toLowerCase()===globalThis.navigator.languages[r].toLowerCase());if(t)return{code:t.code,name:t.name}}}function Wv(e,r){let t=r?.languageCode??"",o=r?.fallbackToNavigatorLanguage??!0,n=e?.languages?.find(a=>a.code.toLowerCase()===t.toLowerCase()),i;if(n)i=n;else if(o??!0)try{let a=UV(e);a&&(i=a)}catch(a){L.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",a)}return i??e.defaultLanguage}var VV=[dO,uO,mO,fO,hO,gO],yO;function Kke(e){yO=e}var Qke=async(e,r)=>{let t,o=Ma();r&&o.updateByUserOption(r);try{r&&(t=(await bm({...r,baseAuthUri:o.getBaseAuthUri()})).accessToken)}catch(a){L.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new ql(e,{outdoorViewToken:t,languagePacks:r?.languagePacks,env:o});return new Du(n)},bO=!1;function qke(e){bO=e}var xO=!1;function eLe(e){xO=e}function Um(){return xO}var HV=async e=>{let r=bO,t,o=Ma();o.updateByUserOption(e);let n={prefetchTokens:!0,...e,fallbackToNavigatorLanguage:e.fallbackToNavigatorLanguage??!0},i=new mu([n.mapId],n);if("accessToken"in n&&n.accessToken){t=n.accessToken;let{aud:v,sub:I}=Zh(t);(A6.some(M=>v.includes(M))||I&&I.startsWith("client"))&&(r=!0,o.setEnterprise(r),i.setEnterprise(r))}else if("key"in n&&"secret"in n){if(n.key.startsWith("mipk_"))throw new Error(`Partner API keys detected!
|
|
2151
|
+
|
|
2152
|
+
Partner API keys should not be passed directly to the SDK. See https://developer.mappedin.com/docs/rest-apis/partner for more details.`);n.key.startsWith("mik_")||(r=!0,o.setEnterprise(r),i.setEnterprise(r)),n.baseAuthUri=o.getBaseAuthUri(),t=(await i.getAccessTokenAsync()).token}else throw new Error("Missing key or secret.");n.layoutId!=null&&(r?n.layoutId!=="draft"&&L.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):L.warn("layoutId is currently unsupported!")),n.baseUri=o.getBaseUri();let a=performance.now(),l,c;if(r){let v={...n,venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0",perspective:n.viewId,useDraftData:n.layoutId==="draft"},I=await jx(v);l=I.compressed,c=I.localePacks}else l=await Gx(n,t);let p=performance.now(),m=await Zy(l,n.mvfVersion),f=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(m);let g=zy(m);if(g.length>0?i.setMapIds(g):i.setMapIds([n.mapId]),n.prefetchTokens)try{await i.readySync()}catch(v){L.error("Failed to ready token manager!",v)}Um()&&(r&&L.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),n.mvfVersion!=="3.0.0"&&L.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let b=new ql(m,{env:o,outdoorViewToken:t,tokenManager:i,enterprise:r,localePacksUrls:c,binaryBundle:l,getMapDataOptions:n}),x=new Du(b,{search:e.search});b.Analytics.init({accessToken:t,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0,...n.analytics,baseUri:o.getAnalyticsBaseUri(),context:n.analytics?.context}),b.Analytics.sendGetMapDataEvent({parseDuration:f-p,downloadDuration:p-a,viewId:n.viewId});let C=b.findPreferredLanguage({languageCode:n.language,fallbackToNavigatorLanguage:n.fallbackToNavigatorLanguage});if(C)try{await x.changeLanguage(C.code)}catch{}return x},tLe=HV,$V=async()=>{if(ec===""||Ob==="")return!1;let e=[fetch(ec,{mode:"same-origin"}),fetch(Ob,{mode:"same-origin"})],[r,t]=[{ok:!1},{ok:!1}];try{[r,t]=await Promise.all(e)}catch{}return{collision:r.ok,maplibre:t.ok}},WV=async(e,r,t)=>{let o=performance.now(),n=bv(t,r);n&&yv(n),(n.injectStyles??!0)&&pO(VV,{id:"mappedin__styles"});let i=R6(r.outdoorViewToken??""),a=ku(r);n.outdoorView?.style&&a.envControl.updateTileServerBaseUrl(n.outdoorView?.style);let l=!1,c=!1,p=await $V();p&&(p.collision||(l=!0),p.maplibre||(c=!0));let m=await z9(e,{center:[r.mapCenter.longitude,r.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:n.style?.backgroundAlpha,backgroundColor:n.style?.backgroundColor,outdoorView:!c&&n.outdoorView?.token?{headers:{"x-mappedin-tiles-key":n.outdoorView?.token},style:r.getEnv().tileServerUri,enabled:!!n.outdoorView?.enabled,lowDpi:n.outdoorView?.lowDpi}:void 0,watermark:{...n.watermark,visible:n.watermark?.visible??(!a.enterpriseMode&&!i.remove_watermark),onClick:yO||void 0},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!n.antialiasing?.enabled,accessToken:r.outdoorViewToken,occlusionEnabled:!0,transformImageRequest:a.enterpriseMode?void 0:a.transformImageRequest,naturalBearing:r.naturalBearing,imagePlacementOptions:n.imagePlacementOptions,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:n.onWebGLContextRestored,onWebGLRendererError:n.onWebGLRendererError,useStandaloneCamera:n.useStandaloneCamera??!1,useWorkers:!(n.disableWorkers??!1),useCollisionWorker:!l}),f=new Ah(m);return await f.addMap(r,n),a.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-o,dimension:f.getDimensions(),collisionWorkerDisabled:l,outdoorsWorkerDisabled:c}),f},rLe=()=>y.env.npm_package_version,oLe=WV;export{ce as a,nn as b,El as c,kl as d,jn as e,Gn as f,cr as g,bo as h,Zj as i,La as j,xo as k,ks as l,Ls as m,t1 as n,an as o,ki as p,r1 as q,Ev as r,Ux as s,Vx as t,Zy as u,G6 as v,Dv as w,U6 as x,n1 as y,i1 as z,Na as A,zl as B,o1 as C,Aw as D,Gi as E,rV as F,BI as G,TV as H,VI as I,$I as J,DV as K,Ah as L,AV as M,Wv as N,Kke as O,Qke as P,qke as Q,eLe as R,Um as S,HV as T,tLe as U,$V as V,WV as W,rLe as X,oLe as Y};
|
|
2153
|
+
//# sourceMappingURL=chunk-WJDRJJIM.js.map
|