@mappedin/mappedin-js 6.0.1-beta.46 → 6.0.1-beta.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/THIRD_PARTY_LICENSES.txt +9289 -24606
  2. package/lib/esm/GLTFExporter-E2W4AY7T.js +2 -0
  3. package/lib/esm/GLTFExporter-E2W4AY7T.js.map +7 -0
  4. package/lib/esm/GLTFLoader-5VLIZ4BL.js +2 -0
  5. package/lib/esm/GLTFLoader-5VLIZ4BL.js.map +7 -0
  6. package/lib/esm/{browser-OJQDECWL.js → browser-RLBZMV2G.js} +2 -1
  7. package/lib/esm/browser-RLBZMV2G.js.map +7 -0
  8. package/lib/esm/chunk-AHC6OWNT.js +2 -0
  9. package/lib/esm/chunk-AHC6OWNT.js.map +7 -0
  10. package/lib/esm/chunk-F7Z3R7GK.js +3820 -0
  11. package/lib/esm/chunk-F7Z3R7GK.js.map +7 -0
  12. package/lib/esm/chunk-KDY73CVP.js +2 -0
  13. package/lib/esm/chunk-KDY73CVP.js.map +7 -0
  14. package/lib/esm/chunk-KTTWH67L.js +2229 -0
  15. package/lib/esm/chunk-KTTWH67L.js.map +7 -0
  16. package/lib/esm/chunk-QSFIJRMY.js +2 -0
  17. package/lib/esm/chunk-QSFIJRMY.js.map +7 -0
  18. package/lib/esm/{chunk-XIVNHXXU.js → chunk-SBJEVJF3.js} +2 -1
  19. package/lib/esm/chunk-SBJEVJF3.js.map +7 -0
  20. package/lib/esm/chunk-XFQBHAWO.js +578 -0
  21. package/lib/esm/chunk-XFQBHAWO.js.map +7 -0
  22. package/lib/esm/fonts/roboto-regular.ttf +0 -0
  23. package/lib/esm/index.css +2 -1
  24. package/lib/esm/index.css.map +7 -0
  25. package/lib/esm/index.d.ts +369 -153
  26. package/lib/esm/index.js +2 -1
  27. package/lib/esm/index.js.map +7 -0
  28. package/lib/esm/inspector-PKJEJRJY.js +483 -0
  29. package/lib/esm/inspector-PKJEJRJY.js.map +7 -0
  30. package/lib/esm/inspector-S63NMDZZ.css +2 -0
  31. package/lib/esm/inspector-S63NMDZZ.css.map +7 -0
  32. package/lib/esm/internal-DKUILLGA.js +2 -0
  33. package/lib/esm/internal-DKUILLGA.js.map +7 -0
  34. package/lib/esm/internal-WH523TQS.css +2 -0
  35. package/lib/esm/internal-WH523TQS.css.map +7 -0
  36. package/lib/esm/outdoor-context-v4-4RHE5GJB.js +2 -0
  37. package/lib/esm/outdoor-context-v4-4RHE5GJB.js.map +7 -0
  38. package/lib/esm/{roboto-regular-PKVZDOB2.js → roboto-regular-25PMWR2T.js} +2 -1
  39. package/lib/esm/roboto-regular-25PMWR2T.js.map +7 -0
  40. package/lib/esm/text3d-FHQNCDB4.js +253 -0
  41. package/lib/esm/text3d-FHQNCDB4.js.map +7 -0
  42. package/lib/esm/workers/collision-worker.csp.js +1 -1
  43. package/lib/esm/workers/maplibre-worker.csp.js +2 -1
  44. package/lib/index-rn.js +649 -0
  45. package/lib/index.css +2 -1
  46. package/package.json +12 -12
  47. package/lib/esm/GLTFExporter-AXJXTFZG.js +0 -1
  48. package/lib/esm/GLTFLoader-V2T33J7P.js +0 -1
  49. package/lib/esm/chunk-5XSHJ3NY.js +0 -1
  50. package/lib/esm/chunk-A6HW5N6M.js +0 -1
  51. package/lib/esm/chunk-GVMLK6WZ.js +0 -1
  52. package/lib/esm/chunk-MV2IWNRC.js +0 -1
  53. package/lib/esm/chunk-Q2KR5YO7.js +0 -1
  54. package/lib/esm/chunk-SRZSNPKD.js +0 -1
  55. package/lib/esm/inspector-4UPV6G6H.js +0 -1
  56. package/lib/esm/inspector-GOK26VAV.css +0 -1
  57. package/lib/esm/internal-7A3UJNAV.css +0 -1
  58. package/lib/esm/internal-NKXX4DDI.js +0 -1
  59. package/lib/esm/outdoor-context-v4-DTIGSNLG.js +0 -1
  60. package/lib/esm/text3d-Z4HFM4UG.js +0 -1
@@ -1 +0,0 @@
1
- import{$ as Ed,A as bE,B as vE,C as Ih,D as io,E as xE,F as XS,G as xs,H as IE,I as Md,J as SE,K as Is,L as o0,M as hr,N as YS,O as In,P as CE,Q as hu,R as Mi,S as Tt,T as at,U as Sh,V as KS,W as JS,X as ME,Y as Ch,Z as OE,_ as Od,a as VO,aa as EE,ba as To,ca as _E,d as $,da as AE,e as VS,ea as QS,f as e0,fa as i0,g as dE,ga as s0,h as wd,ha as kE,i as t0,ia as DE,j as fE,ja as FE,k as r0,ka as a0,l as du,la as LE,m as bs,ma as RE,n as mE,na as NE,o as hE,oa as BE,p as qS,pa as Ss,q as Et,qa as e3,r as De,ra as $E,s as fu,sa as jE,t as ZS,ta as yu,u as vs,ua as Ph,v as n0,va as _d,w as wa,wa as l0,x as mu,xa as Ad,y as yE,ya as kd,z as gE}from"./chunk-GVMLK6WZ.js";import{a as UY,ca as wE,k as PE,v as TE}from"./chunk-MV2IWNRC.js";import{a as zo}from"./chunk-XIVNHXXU.js";import{$ as tE,$a as cE,A as ZO,Aa as Ti,Ba as J1,C as XO,Ca as iE,D as Ye,Da as sE,E as Ee,Fa as wi,I as YO,J as KO,K as JO,L as xh,M as Ce,N as Xr,O as QO,P as Ci,Pa as Td,Q as Ca,R as Pa,S as Ft,Ta as Q1,U as Br,Ua as aE,V as Ta,W as eE,X as Ve,Y as Pi,Ya as lE,_ as pu,_a as gs,aa as zS,ab as uE,b as q1,c as Z1,ca as Vl,cb as pE,d as zO,e as Ia,f as HO,g as ms,ha as rE,ka as zl,la as nE,ma as Y1,na as HS,p as WO,pa as Pd,q as qO,r as X1,ua as oE,va as Hl,wa as K1,xa as WS,ya as hs,z as Sa,za as ys}from"./chunk-5XSHJ3NY.js";import{a as p,b as g}from"./chunk-A6HW5N6M.js";import{b as H,c as Ul,d as fs,e as m,f as c,g as M,h as _,i as ee,j as E}from"./chunk-Q2KR5YO7.js";var Fh=H(wt=>{"use strict";p();Object.defineProperty(wt,"__esModule",{value:!0});wt.regexpCode=wt.getEsmExportName=wt.getProperty=wt.safeStringify=wt.stringify=wt.strConcat=wt.addCodeArg=wt.str=wt._=wt.nil=wt._Code=wt.Name=wt.IDENTIFIER=wt._CodeOrName=void 0;var kh=class{};wt._CodeOrName=kh;wt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var gu=class extends kh{constructor(t){if(super(),!wt.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};wt.Name=gu;var Ho=class extends kh{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>"".concat(r).concat(n),"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof gu&&(r[n.str]=(r[n.str]||0)+1),r),{})}};wt._Code=Ho;wt.nil=new Ho("");function t7(e,...t){let r=[e[0]],n=0;for(;n<t.length;)o3(r,t[n]),r.push(e[++n]);return new Ho(r)}wt._=t7;var n3=new Ho("+");function r7(e,...t){let r=[Dh(e[0])],n=0;for(;n<t.length;)r.push(n3),o3(r,t[n]),r.push(n3,Dh(e[++n]));return ZY(r),new Ho(r)}wt.str=r7;function o3(e,t){t instanceof Ho?e.push(...t._items):t instanceof gu?e.push(t):e.push(KY(t))}wt.addCodeArg=o3;function ZY(e){let t=1;for(;t<e.length-1;){if(e[t]===n3){let r=XY(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function XY(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof gu||e[e.length-1]!=='"'?void 0:typeof t!="string"?"".concat(e.slice(0,-1)).concat(t,'"'):t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof gu))return'"'.concat(e).concat(t.slice(1))}var QE;function YY(e,t){return t.emptyStr()?e:e.emptyStr()?t:r7(QE||(QE=E(["","",""])),e,t)}wt.strConcat=YY;function KY(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Dh(Array.isArray(e)?e.join(","):e)}function JY(e){return new Ho(Dh(e))}wt.stringify=JY;function Dh(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}wt.safeStringify=Dh;var e7;function QY(e){return typeof e=="string"&&wt.IDENTIFIER.test(e)?new Ho(".".concat(e)):t7(e7||(e7=E(["[","]"])),e)}wt.getProperty=QY;function eK(e){if(typeof e=="string"&&wt.IDENTIFIER.test(e))return new Ho("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))}wt.getEsmExportName=eK;function tK(e){return new Ho(e.toString())}wt.regexpCode=tK});var a3=H(ao=>{"use strict";p();Object.defineProperty(ao,"__esModule",{value:!0});ao.ValueScope=ao.ValueScopeName=ao.Scope=ao.varKinds=ao.UsedValueState=void 0;var so=Fh(),i3=class extends Error{constructor(t){super('CodeGen: "code" for '.concat(t," not defined")),this.value=t.value}},p0;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(p0||(ao.UsedValueState=p0={}));ao.varKinds={const:new so.Name("const"),let:new so.Name("let"),var:new so.Name("var")};var d0=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof so.Name?t:this.name(t)}name(t){return new so.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return"".concat(t).concat(r.index++)}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error('CodeGen: prefix "'.concat(t,'" is not allowed in this scope'));return this._names[t]={prefix:t,index:0}}};ao.Scope=d0;var n7,f0=class extends so.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,so._)(n7||(n7=E([".","[","]"])),new so.Name(r),n)}};ao.ValueScopeName=f0;var o7,rK=(0,so._)(o7||(o7=E(["\n"],["\\n"]))),i7,s7,a7,s3=class extends d0{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?rK:so.nil}}get(){return this._scope}name(t){return new f0(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let d=a.get(s);if(d)return d}else a=this._values[i]=new Map;a.set(s,o);let l=this._scope[i]||(this._scope[i]=[]),u=l.length;return l[u]=r.ref,o.setValue(r,{property:i,itemIndex:u}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error('CodeGen: name "'.concat(n,'" has no value'));return(0,so._)(i7||(i7=E(["","",""])),t,n.scopePath)})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error('CodeGen: name "'.concat(o,'" has no value'));return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=so.nil;for(let s in t){let a=t[s];if(!a)continue;let l=n[s]=n[s]||new Map;a.forEach(u=>{if(l.has(u))return;l.set(u,p0.Started);let d=r(u);if(d){let f=this.opts.es5?ao.varKinds.var:ao.varKinds.const;i=(0,so._)(s7||(s7=E(["",""," "," = ",";",""])),i,f,u,d,this.opts._n)}else if(d=o==null?void 0:o(u))i=(0,so._)(a7||(a7=E(["","","",""])),i,d,this.opts._n);else throw new i3(u);l.set(u,p0.Completed)})}return i}};ao.ValueScope=s3});var Ze=H(Ke=>{"use strict";p();Object.defineProperty(Ke,"__esModule",{value:!0});Ke.or=Ke.and=Ke.not=Ke.CodeGen=Ke.operators=Ke.varKinds=Ke.ValueScopeName=Ke.ValueScope=Ke.Scope=Ke.Name=Ke.regexpCode=Ke.stringify=Ke.getProperty=Ke.nil=Ke.strConcat=Ke.str=Ke._=void 0;var lt=Fh(),Ei=a3(),Wl=Fh();Object.defineProperty(Ke,"_",{enumerable:!0,get:function(){return Wl._}});Object.defineProperty(Ke,"str",{enumerable:!0,get:function(){return Wl.str}});Object.defineProperty(Ke,"strConcat",{enumerable:!0,get:function(){return Wl.strConcat}});Object.defineProperty(Ke,"nil",{enumerable:!0,get:function(){return Wl.nil}});Object.defineProperty(Ke,"getProperty",{enumerable:!0,get:function(){return Wl.getProperty}});Object.defineProperty(Ke,"stringify",{enumerable:!0,get:function(){return Wl.stringify}});Object.defineProperty(Ke,"regexpCode",{enumerable:!0,get:function(){return Wl.regexpCode}});Object.defineProperty(Ke,"Name",{enumerable:!0,get:function(){return Wl.Name}});var g0=a3();Object.defineProperty(Ke,"Scope",{enumerable:!0,get:function(){return g0.Scope}});Object.defineProperty(Ke,"ValueScope",{enumerable:!0,get:function(){return g0.ValueScope}});Object.defineProperty(Ke,"ValueScopeName",{enumerable:!0,get:function(){return g0.ValueScopeName}});Object.defineProperty(Ke,"varKinds",{enumerable:!0,get:function(){return g0.varKinds}});Ke.operators={GT:new lt._Code(">"),GTE:new lt._Code(">="),LT:new lt._Code("<"),LTE:new lt._Code("<="),EQ:new lt._Code("==="),NEQ:new lt._Code("!=="),NOT:new lt._Code("!"),OR:new lt._Code("||"),AND:new lt._Code("&&"),ADD:new lt._Code("+")};var Ea=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},l3=class extends Ea{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Ei.varKinds.var:this.varKind,o=this.rhs===void 0?"":" = ".concat(this.rhs);return"".concat(n," ").concat(this.name).concat(o,";")+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Rd(this.rhs,t,r)),this}get names(){return this.rhs instanceof lt._CodeOrName?this.rhs.names:{}}},m0=class extends Ea{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return"".concat(this.lhs," = ").concat(this.rhs,";")+t}optimizeNames(t,r){if(!(this.lhs instanceof lt.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Rd(this.rhs,t,r),this}get names(){let t=this.lhs instanceof lt.Name?{}:{...this.lhs.names};return y0(t,this.rhs)}},c3=class extends m0{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return"".concat(this.lhs," ").concat(this.op,"= ").concat(this.rhs,";")+t}},u3=class extends Ea{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return"".concat(this.label,":")+t}},p3=class extends Ea{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){let r=this.label?" ".concat(this.label):"";return"break".concat(r,";")+t}},d3=class extends Ea{constructor(t){super(),this.error=t}render({_n:t}){return"throw ".concat(this.error,";")+t}get names(){return this.error.names}},f3=class extends Ea{constructor(t){super(),this.code=t}render({_n:t}){return"".concat(this.code,";")+t}optimizeNodes(){return"".concat(this.code)?this:void 0}optimizeNames(t,r){return this.code=Rd(this.code,t,r),this}get names(){return this.code instanceof lt._CodeOrName?this.code.names:{}}},Lh=class extends Ea{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(nK(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>xu(t,r.names),{})}},_a=class extends Lh{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},m3=class extends Lh{},Ld=class extends _a{};Ld.kind="else";var bu=class e extends _a{constructor(t,r){super(r),this.condition=t}render(t){let r="if(".concat(this.condition,")")+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Ld(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(m7(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Rd(this.condition,t,r),this}get names(){let t=super.names;return y0(t,this.condition),this.else&&xu(t,this.else.names),t}};bu.kind="if";var vu=class extends _a{};vu.kind="for";var h3=class extends vu{constructor(t){super(),this.iteration=t}render(t){return"for(".concat(this.iteration,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Rd(this.iteration,t,r),this}get names(){return xu(super.names,this.iteration.names)}},y3=class extends vu{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Ei.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return"for(".concat(r," ").concat(n,"=").concat(o,"; ").concat(n,"<").concat(i,"; ").concat(n,"++)")+super.render(t)}get names(){let t=y0(super.names,this.from);return y0(t,this.to)}},h0=class extends vu{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return"for(".concat(this.varKind," ").concat(this.name," ").concat(this.loop," ").concat(this.iterable,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Rd(this.iterable,t,r),this}get names(){return xu(super.names,this.iterable.names)}},Rh=class extends _a{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){let r=this.async?"async ":"";return"".concat(r,"function ").concat(this.name,"(").concat(this.args,")")+super.render(t)}};Rh.kind="func";var Nh=class extends Lh{render(t){return"return "+super.render(t)}};Nh.kind="return";var g3=class extends _a{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&xu(t,this.catch.names),this.finally&&xu(t,this.finally.names),t}},Bh=class extends _a{constructor(t){super(),this.error=t}render(t){return"catch(".concat(this.error,")")+super.render(t)}};Bh.kind="catch";var $h=class extends _a{render(t){return"finally"+super.render(t)}};$h.kind="finally";var l7,c7,u7,b3=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?"\n":""},this._extScope=t,this._scope=new Ei.Scope({parent:t}),this._nodes=[new m3]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new l3(t,i,n)),i}const(t,r,n){return this._def(Ei.varKinds.const,t,r,n)}let(t,r,n){return this._def(Ei.varKinds.let,t,r,n)}var(t,r,n){return this._def(Ei.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new m0(t,r,n))}add(t,r){return this._leafNode(new c3(t,Ke.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==lt.nil&&this._leafNode(new f3(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,lt.addCodeArg)(r,o));return r.push("}"),new lt._Code(r)}if(t,r,n){if(this._blockNode(new bu(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new bu(t))}else(){return this._elseNode(new Ld)}endIf(){return this._endBlockNode(bu,Ld)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new h3(t),r)}forRange(t,r,n,o,i=this.opts.es5?Ei.varKinds.var:Ei.varKinds.let){let s=this._scope.toName(t);return this._for(new y3(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Ei.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof lt.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,lt._)(l7||(l7=E(["",".length"])),s),a=>{this.var(i,(0,lt._)(c7||(c7=E(["","[","]"])),s,a)),n(i)})}return this._for(new h0("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Ei.varKinds.var:Ei.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,lt._)(u7||(u7=E(["Object.keys(",")"])),r),n);let i=this._scope.toName(t);return this._for(new h0("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(vu)}label(t){return this._leafNode(new u3(t))}break(t){return this._leafNode(new p3(t))}return(t){let r=new Nh;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Nh)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new g3;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Bh(i),r(i)}return n&&(this._currNode=o.finally=new $h,this.code(n)),this._endBlockNode(Bh,$h)}throw(t){return this._leafNode(new d3(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error("CodeGen: wrong number of nodes: ".concat(n," vs ").concat(t," expected"));return this._nodes.length=r,this}func(t,r=lt.nil,n,o){return this._blockNode(new Rh(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Rh)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error('CodeGen: not in block "'.concat(r?"".concat(t.kind,"/").concat(r.kind):t.kind,'"'))}_elseNode(t){let r=this._currNode;if(!(r instanceof bu))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};Ke.CodeGen=b3;function xu(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function y0(e,t){return t instanceof lt._CodeOrName?xu(e,t.names):e}function Rd(e,t,r){if(e instanceof lt.Name)return n(e);if(!o(e))return e;return new lt._Code(e._items.reduce((i,s)=>(s instanceof lt.Name&&(s=n(s)),s instanceof lt._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function o(i){return i instanceof lt._Code&&i._items.some(s=>s instanceof lt.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function nK(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}var p7;function m7(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,lt._)(p7||(p7=E(["!",""])),v3(e))}Ke.not=m7;var oK=h7(Ke.operators.AND);function iK(...e){return e.reduce(oK)}Ke.and=iK;var sK=h7(Ke.operators.OR);function aK(...e){return e.reduce(sK)}Ke.or=aK;var d7;function h7(e){return(t,r)=>t===lt.nil?r:r===lt.nil?t:(0,lt._)(d7||(d7=E([""," "," ",""])),v3(t),e,v3(r))}var f7;function v3(e){return e instanceof lt.Name?e:(0,lt._)(f7||(f7=E(["(",")"])),e)}});var Mt=H(Qe=>{"use strict";p();Object.defineProperty(Qe,"__esModule",{value:!0});Qe.checkStrictMode=Qe.getErrorPath=Qe.Type=Qe.useFunc=Qe.setEvaluated=Qe.evaluatedPropsToName=Qe.mergeEvaluated=Qe.eachItem=Qe.unescapeJsonPointer=Qe.escapeJsonPointer=Qe.escapeFragment=Qe.unescapeFragment=Qe.schemaRefOrVal=Qe.schemaHasRulesButRef=Qe.schemaHasRules=Qe.checkUnknownRules=Qe.alwaysValidSchema=Qe.toHash=void 0;var Wt=Ze(),lK=Fh();function cK(e){let t={};for(let r of e)t[r]=!0;return t}Qe.toHash=cK;function uK(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(R7(e,t),!N7(t,e.self.RULES.all))}Qe.alwaysValidSchema=uK;function R7(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||j7(e,'unknown keyword: "'.concat(i,'"'))}Qe.checkUnknownRules=R7;function N7(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}Qe.schemaHasRules=N7;function pK(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}Qe.schemaHasRulesButRef=pK;var b7,v7;function dK({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Wt._)(b7||(b7=E(["",""])),r)}return(0,Wt._)(v7||(v7=E(["","","",""])),e,t,(0,Wt.getProperty)(n))}Qe.schemaRefOrVal=dK;function fK(e){return B7(decodeURIComponent(e))}Qe.unescapeFragment=fK;function mK(e){return encodeURIComponent(I3(e))}Qe.escapeFragment=mK;function I3(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}Qe.escapeJsonPointer=I3;function B7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Qe.unescapeJsonPointer=B7;function hK(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}Qe.eachItem=hK;function y7({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let l=s===void 0?i:s instanceof Wt.Name?(i instanceof Wt.Name?e(o,i,s):t(o,i,s),s):i instanceof Wt.Name?(t(o,s,i),i):r(i,s);return a===Wt.Name&&!(l instanceof Wt.Name)?n(o,l):l}}var x7,I7,S7,C7,P7,T7,w7,M7,O7,E7;Qe.mergeEvaluated={props:y7({mergeNames:(e,t,r)=>e.if((0,Wt._)(x7||(x7=E([""," !== true && "," !== undefined"])),r,t),()=>{e.if((0,Wt._)(I7||(I7=E([""," === true"])),t),()=>e.assign(r,!0),()=>e.assign(r,(0,Wt._)(S7||(S7=E([""," || {}"])),r)).code((0,Wt._)(C7||(C7=E(["Object.assign(",", ",")"])),r,t)))}),mergeToName:(e,t,r)=>e.if((0,Wt._)(P7||(P7=E([""," !== true"])),r),()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Wt._)(T7||(T7=E([""," || {}"])),r)),S3(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:$7}),items:y7({mergeNames:(e,t,r)=>e.if((0,Wt._)(w7||(w7=E([""," !== true && "," !== undefined"])),r,t),()=>e.assign(r,(0,Wt._)(M7||(M7=E([""," === true ? true : "," > "," ? "," : ",""])),t,r,t,r,t))),mergeToName:(e,t,r)=>e.if((0,Wt._)(O7||(O7=E([""," !== true"])),r),()=>e.assign(r,t===!0?!0:(0,Wt._)(E7||(E7=E([""," > "," ? "," : ",""])),r,t,r,t))),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};var _7;function $7(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Wt._)(_7||(_7=E(["{}"]))));return t!==void 0&&S3(e,r,t),r}Qe.evaluatedPropsToName=$7;var A7;function S3(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Wt._)(A7||(A7=E(["","",""])),t,(0,Wt.getProperty)(n)),!0))}Qe.setEvaluated=S3;var g7={};function yK(e,t){return e.scopeValue("func",{ref:t,code:g7[t.code]||(g7[t.code]=new lK._Code(t.code))})}Qe.useFunc=yK;var x3;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(x3||(Qe.Type=x3={}));var k7,D7,F7,L7;function gK(e,t,r){if(e instanceof Wt.Name){let n=t===x3.Num;return r?n?(0,Wt._)(k7||(k7=E(['"[" + ',' + "]"'])),e):(0,Wt._)(D7||(D7=E(['"[\'" + ',' + "\']"'])),e):n?(0,Wt._)(F7||(F7=E(['"/" + ',""])),e):(0,Wt._)(L7||(L7=E(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return r?(0,Wt.getProperty)(e).toString():"/"+I3(e)}Qe.getErrorPath=gK;function j7(e,t,r=e.opts.strictSchema){if(r){if(t="strict mode: ".concat(t),r===!0)throw new Error(t);e.self.logger.warn(t)}}Qe.checkStrictMode=j7});var Aa=H(C3=>{"use strict";p();Object.defineProperty(C3,"__esModule",{value:!0});var Sn=Ze(),bK={data:new Sn.Name("data"),valCxt:new Sn.Name("valCxt"),instancePath:new Sn.Name("instancePath"),parentData:new Sn.Name("parentData"),parentDataProperty:new Sn.Name("parentDataProperty"),rootData:new Sn.Name("rootData"),dynamicAnchors:new Sn.Name("dynamicAnchors"),vErrors:new Sn.Name("vErrors"),errors:new Sn.Name("errors"),this:new Sn.Name("this"),self:new Sn.Name("self"),scope:new Sn.Name("scope"),json:new Sn.Name("json"),jsonPos:new Sn.Name("jsonPos"),jsonLen:new Sn.Name("jsonLen"),jsonPart:new Sn.Name("jsonPart")};C3.default=bK});var jh=H(Cn=>{"use strict";p();Object.defineProperty(Cn,"__esModule",{value:!0});Cn.extendErrors=Cn.resetErrorsCount=Cn.reportExtraError=Cn.reportError=Cn.keyword$DataError=Cn.keywordError=void 0;var yt=Ze(),b0=Mt(),Gn=Aa(),G7;Cn.keywordError={message:({keyword:e})=>(0,yt.str)(G7||(G7=E(['must pass "','" keyword validation'])),e)};var U7,V7;Cn.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,yt.str)(U7||(U7=E(['"','" keyword must be '," ($data)"])),e,t):(0,yt.str)(V7||(V7=E(['"','" keyword is invalid ($data)'])),e)};var z7;function vK(e,t=Cn.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,l=m6(e,t,r);(n!=null?n:s||a)?d6(i,l):f6(o,(0,yt._)(z7||(z7=E(["[","]"])),l))}Cn.reportError=vK;function xK(e,t=Cn.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=m6(e,t,r);d6(o,a),i||s||f6(n,Gn.default.vErrors)}Cn.reportExtraError=xK;var H7,W7;function IK(e,t){e.assign(Gn.default.errors,t),e.if((0,yt._)(H7||(H7=E([""," !== null"])),Gn.default.vErrors),()=>e.if(t,()=>e.assign((0,yt._)(W7||(W7=E(["",".length"])),Gn.default.vErrors),t),()=>e.assign(Gn.default.vErrors,null)))}Cn.resetErrorsCount=IK;var q7,Z7,X7,Y7,K7,J7,Q7;function SK({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,Gn.default.errors,a=>{e.const(s,(0,yt._)(q7||(q7=E(["","[","]"])),Gn.default.vErrors,a)),e.if((0,yt._)(Z7||(Z7=E(["",".instancePath === undefined"])),s),()=>e.assign((0,yt._)(X7||(X7=E(["",".instancePath"])),s),(0,yt.strConcat)(Gn.default.instancePath,i.errorPath))),e.assign((0,yt._)(Y7||(Y7=E(["",".schemaPath"])),s),(0,yt.str)(K7||(K7=E(["","/",""])),i.errSchemaPath,t)),i.opts.verbose&&(e.assign((0,yt._)(J7||(J7=E(["",".schema"])),s),r),e.assign((0,yt._)(Q7||(Q7=E(["",".data"])),s),n))})}Cn.extendErrors=SK;var e6,t6,r6,n6;function d6(e,t){let r=e.const("err",t);e.if((0,yt._)(e6||(e6=E([""," === null"])),Gn.default.vErrors),()=>e.assign(Gn.default.vErrors,(0,yt._)(t6||(t6=E(["[","]"])),r)),(0,yt._)(r6||(r6=E(["",".push(",")"])),Gn.default.vErrors,r)),e.code((0,yt._)(n6||(n6=E(["","++"])),Gn.default.errors))}var o6,i6;function f6(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,yt._)(o6||(o6=E(["new ","(",")"])),e.ValidationError,t)):(r.assign((0,yt._)(i6||(i6=E(["",".errors"])),n),t),r.return(!1))}var Iu={keyword:new yt.Name("keyword"),schemaPath:new yt.Name("schemaPath"),params:new yt.Name("params"),propertyName:new yt.Name("propertyName"),message:new yt.Name("message"),schema:new yt.Name("schema"),parentSchema:new yt.Name("parentSchema")},s6;function m6(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,yt._)(s6||(s6=E(["{}"]))):CK(e,t,r)}function CK(e,t,r={}){let{gen:n,it:o}=e,i=[PK(o,r),TK(e,r)];return wK(e,t,i),n.object(...i)}var a6;function PK({errorPath:e},{instancePath:t}){let r=t?(0,yt.str)(a6||(a6=E(["","",""])),e,(0,b0.getErrorPath)(t,b0.Type.Str)):e;return[Gn.default.instancePath,(0,yt.strConcat)(Gn.default.instancePath,r)]}var l6,c6;function TK({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,yt.str)(l6||(l6=E(["","/",""])),t,e);return r&&(o=(0,yt.str)(c6||(c6=E(["","",""])),o,(0,b0.getErrorPath)(r,b0.Type.Str))),[Iu.schemaPath,o]}var u6,p6;function wK(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:l,propertyName:u,topSchemaRef:d,schemaPath:f}=a;n.push([Iu.keyword,o],[Iu.params,typeof t=="function"?t(e):t||(0,yt._)(u6||(u6=E(["{}"])))]),l.messages&&n.push([Iu.message,typeof r=="function"?r(e):r]),l.verbose&&n.push([Iu.schema,s],[Iu.parentSchema,(0,yt._)(p6||(p6=E(["","",""])),d,f)],[Gn.default.data,i]),u&&n.push([Iu.propertyName,u])}});var g6=H(Nd=>{"use strict";p();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.boolOrEmptySchema=Nd.topBoolOrEmptySchema=void 0;var MK=jh(),OK=Ze(),EK=Aa(),_K={message:"boolean schema is false"},h6;function AK(e){let{gen:t,schema:r,validateName:n}=e;r===!1?y6(e,!1):typeof r=="object"&&r.$async===!0?t.return(EK.default.data):(t.assign((0,OK._)(h6||(h6=E(["",".errors"])),n),null),t.return(!0))}Nd.topBoolOrEmptySchema=AK;function kK(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),y6(e)):r.var(t,!0)}Nd.boolOrEmptySchema=kK;function y6(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,MK.reportError)(o,_K,void 0,t)}});var P3=H(Bd=>{"use strict";p();Object.defineProperty(Bd,"__esModule",{value:!0});Bd.getRules=Bd.isJSONType=void 0;var DK=["string","number","integer","boolean","null","object","array"],FK=new Set(DK);function LK(e){return typeof e=="string"&&FK.has(e)}Bd.isJSONType=LK;function RK(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Bd.getRules=RK});var T3=H(ql=>{"use strict";p();Object.defineProperty(ql,"__esModule",{value:!0});ql.shouldUseRule=ql.shouldUseGroup=ql.schemaHasRulesForType=void 0;function NK({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&b6(e,n)}ql.schemaHasRulesForType=NK;function b6(e,t){return t.rules.some(r=>v6(e,r))}ql.shouldUseGroup=b6;function v6(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}ql.shouldUseRule=v6});var Gh=H(Pn=>{"use strict";p();Object.defineProperty(Pn,"__esModule",{value:!0});Pn.reportTypeError=Pn.checkDataTypes=Pn.checkDataType=Pn.coerceAndCheckDataType=Pn.getJSONTypes=Pn.getSchemaTypes=Pn.DataType=void 0;var BK=P3(),$K=T3(),jK=jh(),qe=Ze(),Q6=Mt(),$d;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})($d||(Pn.DataType=$d={}));function GK(e){let t=e9(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Pn.getSchemaTypes=GK;function e9(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(BK.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Pn.getJSONTypes=e9;function UK(e,t){let{gen:r,data:n,opts:o}=e,i=VK(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,$K.schemaHasRulesForType)(e,t[0]));if(s){let a=M3(t,n,o.strictNumbers,$d.Wrong);r.if(a,()=>{i.length?zK(e,t,i):O3(e)})}return s}Pn.coerceAndCheckDataType=UK;var t9=new Set(["string","number","integer","boolean","null"]);function VK(e,t){return t?e.filter(r=>t9.has(r)||t==="array"&&r==="array"):[]}var x6,I6,S6,C6,P6,T6,w6,M6,O6,E6,_6,A6,k6,D6,F6,L6,R6,N6,B6,$6;function zK(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,qe._)(x6||(x6=E(["typeof ",""])),o)),a=n.let("coerced",(0,qe._)(I6||(I6=E(["undefined"]))));i.coerceTypes==="array"&&n.if((0,qe._)(S6||(S6=E([""," == 'object' && Array.isArray(",") && ",".length == 1"])),s,o,o),()=>n.assign(o,(0,qe._)(C6||(C6=E(["","[0]"])),o)).assign(s,(0,qe._)(P6||(P6=E(["typeof ",""])),o)).if(M3(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,qe._)(T6||(T6=E([""," !== undefined"])),a));for(let u of r)(t9.has(u)||u==="array"&&i.coerceTypes==="array")&&l(u);n.else(),O3(e),n.endIf(),n.if((0,qe._)(w6||(w6=E([""," !== undefined"])),a),()=>{n.assign(o,a),HK(e,a)});function l(u){switch(u){case"string":n.elseIf((0,qe._)(M6||(M6=E(["",' == "number" || ',' == "boolean"'])),s,s)).assign(a,(0,qe._)(O6||(O6=E(['"" + ',""])),o)).elseIf((0,qe._)(E6||(E6=E([""," === null"])),o)).assign(a,(0,qe._)(_6||(_6=E(['""']))));return;case"number":n.elseIf((0,qe._)(A6||(A6=E(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),s,o,s,o,o,o)).assign(a,(0,qe._)(k6||(k6=E(["+",""])),o));return;case"integer":n.elseIf((0,qe._)(D6||(D6=E(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),s,o,s,o,o,o,o)).assign(a,(0,qe._)(F6||(F6=E(["+",""])),o));return;case"boolean":n.elseIf((0,qe._)(L6||(L6=E(["",' === "false" || '," === 0 || "," === null"])),o,o,o)).assign(a,!1).elseIf((0,qe._)(R6||(R6=E(["",' === "true" || '," === 1"])),o,o)).assign(a,!0);return;case"null":n.elseIf((0,qe._)(N6||(N6=E(["",' === "" || '," === 0 || "," === false"])),o,o,o)),n.assign(a,null);return;case"array":n.elseIf((0,qe._)(B6||(B6=E(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),s,s,s,o)).assign(a,(0,qe._)($6||($6=E(["[","]"])),o))}}}var j6,G6;function HK({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,qe._)(j6||(j6=E([""," !== undefined"])),t),()=>e.assign((0,qe._)(G6||(G6=E(["","[","]"])),t,r),n))}var U6,V6,z6,H6,W6,q6,Z6;function w3(e,t,r,n=$d.Correct){let o=n===$d.Correct?qe.operators.EQ:qe.operators.NEQ,i;switch(e){case"null":return(0,qe._)(U6||(U6=E([""," "," null"])),t,o);case"array":i=(0,qe._)(V6||(V6=E(["Array.isArray(",")"])),t);break;case"object":i=(0,qe._)(z6||(z6=E([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":i=s((0,qe._)(H6||(H6=E(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":i=s();break;default:return(0,qe._)(W6||(W6=E(["typeof "," "," ",""])),t,o,e)}return n===$d.Correct?i:(0,qe.not)(i);function s(a=qe.nil){return(0,qe.and)((0,qe._)(q6||(q6=E(["typeof ",' == "number"'])),t),a,r?(0,qe._)(Z6||(Z6=E(["isFinite(",")"])),t):qe.nil)}}Pn.checkDataType=w3;var X6,Y6;function M3(e,t,r,n){if(e.length===1)return w3(e[0],t,r,n);let o,i=(0,Q6.toHash)(e);if(i.array&&i.object){let s=(0,qe._)(X6||(X6=E(["typeof ",' != "object"'])),t);o=i.null?s:(0,qe._)(Y6||(Y6=E(["!"," || ",""])),t,s),delete i.null,delete i.array,delete i.object}else o=qe.nil;i.number&&delete i.integer;for(let s in i)o=(0,qe.and)(o,w3(s,t,r,n));return o}Pn.checkDataTypes=M3;var K6,J6,WK={message:({schema:e})=>"must be ".concat(e),params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,qe._)(K6||(K6=E(["{type: ","}"])),e):(0,qe._)(J6||(J6=E(["{type: ","}"])),t)};function O3(e){let t=qK(e);(0,jK.reportError)(t,WK)}Pn.reportTypeError=O3;function qK(e){let{gen:t,data:r,schema:n}=e,o=(0,Q6.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var a9=H(v0=>{"use strict";p();Object.defineProperty(v0,"__esModule",{value:!0});v0.assignDefaults=void 0;var jd=Ze(),ZK=Mt();function XK(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)r9(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>r9(e,i,o.default))}v0.assignDefaults=XK;var n9,o9,i9,s9;function r9(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,jd._)(n9||(n9=E(["","",""])),i,(0,jd.getProperty)(t));if(o){(0,ZK.checkStrictMode)(e,"default is ignored for: ".concat(a));return}let l=(0,jd._)(o9||(o9=E([""," === undefined"])),a);s.useDefaults==="empty"&&(l=(0,jd._)(i9||(i9=E([""," || "," === null || ",' === ""'])),l,a,a)),n.if(l,(0,jd._)(s9||(s9=E([""," = ",""])),a,(0,jd.stringify)(r)))}});var Wo=H(Gt=>{"use strict";p();Object.defineProperty(Gt,"__esModule",{value:!0});Gt.validateUnion=Gt.validateArray=Gt.usePattern=Gt.callValidateCode=Gt.schemaProperties=Gt.allSchemaProperties=Gt.noPropertyInData=Gt.propertyInData=Gt.isOwnProperty=Gt.hasPropFunc=Gt.reportMissingProp=Gt.checkMissingProp=Gt.checkReportMissingProp=void 0;var er=Ze(),E3=Mt(),Zl=Aa(),YK=Mt(),l9;function KK(e,t){let{gen:r,data:n,it:o}=e;r.if(A3(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,er._)(l9||(l9=E(["",""])),t)},!0),e.error()})}Gt.checkReportMissingProp=KK;var c9;function JK({gen:e,data:t,it:{opts:r}},n,o){return(0,er.or)(...n.map(i=>(0,er.and)(A3(e,t,i,r.ownProperties),(0,er._)(c9||(c9=E([""," = ",""])),o,i))))}Gt.checkMissingProp=JK;function QK(e,t){e.setParams({missingProperty:t},!0),e.error()}Gt.reportMissingProp=QK;var u9;function C9(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,er._)(u9||(u9=E(["Object.prototype.hasOwnProperty"])))})}Gt.hasPropFunc=C9;var p9;function _3(e,t,r){return(0,er._)(p9||(p9=E(["",".call(",", ",")"])),C9(e),t,r)}Gt.isOwnProperty=_3;var d9,f9;function eJ(e,t,r,n){let o=(0,er._)(d9||(d9=E(["",""," !== undefined"])),t,(0,er.getProperty)(r));return n?(0,er._)(f9||(f9=E([""," && ",""])),o,_3(e,t,r)):o}Gt.propertyInData=eJ;var m9;function A3(e,t,r,n){let o=(0,er._)(m9||(m9=E(["",""," === undefined"])),t,(0,er.getProperty)(r));return n?(0,er.or)(o,(0,er.not)(_3(e,t,r))):o}Gt.noPropertyInData=A3;function P9(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}Gt.allSchemaProperties=P9;function tJ(e,t){return P9(t).filter(r=>!(0,E3.alwaysValidSchema)(e,t[r]))}Gt.schemaProperties=tJ;var h9,y9,g9,b9;function rJ({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,l,u){let d=u?(0,er._)(h9||(h9=E(["",", ",", ","",""])),e,t,n,o):t,f=[[Zl.default.instancePath,(0,er.strConcat)(Zl.default.instancePath,i)],[Zl.default.parentData,s.parentData],[Zl.default.parentDataProperty,s.parentDataProperty],[Zl.default.rootData,Zl.default.rootData]];s.opts.dynamicRef&&f.push([Zl.default.dynamicAnchors,Zl.default.dynamicAnchors]);let h=(0,er._)(y9||(y9=E(["",", ",""])),d,r.object(...f));return l!==er.nil?(0,er._)(g9||(g9=E(["",".call(",", ",")"])),a,l,h):(0,er._)(b9||(b9=E(["","(",")"])),a,h)}Gt.callValidateCode=rJ;var v9,nJ=(0,er._)(v9||(v9=E(["new RegExp"]))),x9;function oJ({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,er._)(x9||(x9=E(["","(",", ",")"])),o.code==="new RegExp"?nJ:(0,YK.useFunc)(e,o),r,n)})}Gt.usePattern=oJ;var I9;function iJ(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let l=t.const("len",(0,er._)(I9||(I9=E(["",".length"])),r));t.forRange("i",0,l,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:E3.Type.Num},i),t.if((0,er.not)(i),a)})}}Gt.validateArray=iJ;var S9;function sJ(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,E3.alwaysValidSchema)(o,l))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((l,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,er._)(S9||(S9=E([""," || ",""])),s,a)),e.mergeValidEvaluated(d,a)||t.if((0,er.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}Gt.validateUnion=sJ});var N9=H(Cs=>{"use strict";p();Object.defineProperty(Cs,"__esModule",{value:!0});Cs.validateKeywordUsage=Cs.validSchemaType=Cs.funcKeywordCode=Cs.macroKeywordCode=void 0;var Un=Ze(),Su=Aa(),aJ=Wo(),lJ=jh();function cJ(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),l=R9(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:Un.nil,errSchemaPath:"".concat(s.errSchemaPath,"/").concat(n),topSchemaRef:l,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Cs.macroKeywordCode=cJ;var w9,M9,O9,E9,_9,A9;function uJ(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:l}=e;dJ(l,t);let u=!a&&t.compile?t.compile.call(l.self,i,s,l):t.validate,d=R9(n,o,u),f=n.let("valid");e.block$data(f,h),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function h(){if(t.errors===!1)I(),t.modifying&&T9(e),x(()=>e.error());else{let C=t.async?b():v();t.modifying&&T9(e),x(()=>pJ(e,C))}}function b(){let C=n.let("ruleErrs",null);return n.try(()=>I((0,Un._)(w9||(w9=E(["await "])))),P=>n.assign(f,!1).if((0,Un._)(M9||(M9=E([""," instanceof ",""])),P,l.ValidationError),()=>n.assign(C,(0,Un._)(O9||(O9=E(["",".errors"])),P)),()=>n.throw(P))),C}function v(){let C=(0,Un._)(E9||(E9=E(["",".errors"])),d);return n.assign(C,null),I(Un.nil),C}function I(C=t.async?(0,Un._)(_9||(_9=E(["await "]))):Un.nil){let P=l.opts.passContext?Su.default.this:Su.default.self,w=!("compile"in t&&!a||t.schema===!1);n.assign(f,(0,Un._)(A9||(A9=E(["","",""])),C,(0,aJ.callValidateCode)(e,d,P,w)),t.modifying)}function x(C){var P;n.if((0,Un.not)((P=t.valid)!==null&&P!==void 0?P:f),C)}}Cs.funcKeywordCode=uJ;var k9;function T9(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Un._)(k9||(k9=E(["","[","]"])),n.parentData,n.parentDataProperty)))}var D9,F9,L9;function pJ(e,t){let{gen:r}=e;r.if((0,Un._)(D9||(D9=E(["Array.isArray(",")"])),t),()=>{r.assign(Su.default.vErrors,(0,Un._)(F9||(F9=E([""," === null ? "," : ",".concat(",")"])),Su.default.vErrors,t,Su.default.vErrors,t)).assign(Su.default.errors,(0,Un._)(L9||(L9=E(["",".length"])),Su.default.vErrors)),(0,lJ.extendErrors)(e)},()=>e.error())}function dJ({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function R9(e,t,r){if(r===void 0)throw new Error('keyword "'.concat(t,'" failed to compile'));return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Un.stringify)(r)})}function fJ(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Cs.validSchemaType=fJ;function mJ({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let s=o.dependencies;if(s!=null&&s.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error("parent schema must have dependencies of ".concat(i,": ").concat(s.join(",")));if(o.validateSchema&&!o.validateSchema(e[i])){let l='keyword "'.concat(i,'" value is invalid at path "').concat(n,'": ')+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}Cs.validateKeywordUsage=mJ});var z9=H(Xl=>{"use strict";p();Object.defineProperty(Xl,"__esModule",{value:!0});Xl.extendSubschemaMode=Xl.extendSubschemaData=Xl.getSubschema=void 0;var Ps=Ze(),V9=Mt(),B9,$9;function hJ(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,Ps._)(B9||(B9=E(["","",""])),e.schemaPath,(0,Ps.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:a[r],schemaPath:(0,Ps._)($9||($9=E(["","","",""])),e.schemaPath,(0,Ps.getProperty)(t),(0,Ps.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,V9.escapeFragment)(r))}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Xl.getSubschema=hJ;var j9,G9,U9;function yJ(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:f}=t,h=a.let("data",(0,Ps._)(j9||(j9=E(["","",""])),t.data,(0,Ps.getProperty)(r)),!0);l(h),e.errorPath=(0,Ps.str)(G9||(G9=E(["","",""])),u,(0,V9.getErrorPath)(r,n,f.jsPropertySyntax)),e.parentDataProperty=(0,Ps._)(U9||(U9=E(["",""])),r),e.dataPathArr=[...d,e.parentDataProperty]}if(o!==void 0){let u=o instanceof Ps.Name?o:a.let("data",o,!0);l(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function l(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Xl.extendSubschemaData=yJ;function gJ(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Xl.extendSubschemaMode=gJ});var k3=H((xMe,H9)=>{"use strict";p();H9.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var q9=H((SMe,W9)=>{"use strict";p();var Yl=W9.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};x0(t,n,o,e,"",e)};Yl.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Yl.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Yl.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Yl.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function x0(e,t,r,n,o,i,s,a,l,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,l,u);for(var d in n){var f=n[d];if(Array.isArray(f)){if(d in Yl.arrayKeywords)for(var h=0;h<f.length;h++)x0(e,t,r,f[h],o+"/"+d+"/"+h,i,o,d,n,h)}else if(d in Yl.propsKeywords){if(f&&typeof f=="object")for(var b in f)x0(e,t,r,f[b],o+"/"+d+"/"+bJ(b),i,o,d,n,b)}else(d in Yl.keywords||e.allKeys&&!(d in Yl.skipKeywords))&&x0(e,t,r,f,o+"/"+d,i,o,d,n)}r(n,o,i,s,a,l,u)}}function bJ(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Uh=H(lo=>{"use strict";p();Object.defineProperty(lo,"__esModule",{value:!0});lo.getSchemaRefs=lo.resolveUrl=lo.normalizeId=lo._getFullPath=lo.getFullPath=lo.inlineRef=void 0;var vJ=Mt(),xJ=k3(),IJ=q9(),SJ=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function CJ(e,t=!0){return typeof e=="boolean"?!0:t===!0?!D3(e):t?Z9(e)<=t:!1}lo.inlineRef=CJ;var PJ=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function D3(e){for(let t in e){if(PJ.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(D3)||typeof r=="object"&&D3(r))return!0}return!1}function Z9(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!SJ.has(r)&&(typeof e[r]=="object"&&(0,vJ.eachItem)(e[r],n=>t+=Z9(n)),t===1/0))return 1/0}return t}function X9(e,t="",r){r!==!1&&(t=Gd(t));let n=e.parse(t);return Y9(e,n)}lo.getFullPath=X9;function Y9(e,t){return e.serialize(t).split("#")[0]+"#"}lo._getFullPath=Y9;var TJ=/#\/?$/;function Gd(e){return e?e.replace(TJ,""):""}lo.normalizeId=Gd;function wJ(e,t,r){return r=Gd(r),e.resolve(t,r)}lo.resolveUrl=wJ;var MJ=/^[a-z_][-a-z0-9._]*$/i;function OJ(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Gd(e[r]||t),i={"":o},s=X9(n,o,!1),a={},l=new Set;return IJ(e,{allKeys:!0},(f,h,b,v)=>{if(v===void 0)return;let I=s+h,x=i[v];typeof f[r]=="string"&&(x=C.call(this,f[r])),P.call(this,f.$anchor),P.call(this,f.$dynamicAnchor),i[h]=x;function C(w){let T=this.opts.uriResolver.resolve;if(w=Gd(x?T(x,w):w),l.has(w))throw d(w);l.add(w);let O=this.refs[w];return typeof O=="string"&&(O=this.refs[O]),typeof O=="object"?u(f,O.schema,w):w!==Gd(I)&&(w[0]==="#"?(u(f,a[w],w),a[w]=f):this.refs[w]=I),w}function P(w){if(typeof w=="string"){if(!MJ.test(w))throw new Error('invalid anchor "'.concat(w,'"'));C.call(this,"#".concat(w))}}}),a;function u(f,h,b){if(h!==void 0&&!xJ(f,h))throw d(b)}function d(f){return new Error('reference "'.concat(f,'" resolves to more than one schema'))}}lo.getSchemaRefs=OJ});var Hh=H(Kl=>{"use strict";p();Object.defineProperty(Kl,"__esModule",{value:!0});Kl.getData=Kl.KeywordCxt=Kl.validateFunctionCode=void 0;var j_=g6(),K9=Gh(),L3=T3(),I0=Gh(),EJ=a9(),zh=N9(),F3=z9(),Te=Ze(),je=Aa(),_J=Uh(),ka=Mt(),Vh=jh();function AJ(e){if(V_(e)&&(z_(e),U_(e))){FJ(e);return}G_(e,()=>(0,j_.topBoolOrEmptySchema)(e))}Kl.validateFunctionCode=AJ;var t_,r_,n_;function G_({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,Te._)(t_||(t_=E(["",", ",""])),je.default.data,je.default.valCxt),n.$async,()=>{e.code((0,Te._)(r_||(r_=E(['"use strict"; ',""])),J9(r,o))),DJ(e,o),e.code(i)}):e.func(t,(0,Te._)(n_||(n_=E(["",", ",""])),je.default.data,kJ(o)),n.$async,()=>e.code(J9(r,o)).code(i))}var o_,i_;function kJ(e){return(0,Te._)(i_||(i_=E(["{",'="", ',", ",", ","=","","}={}"])),je.default.instancePath,je.default.parentData,je.default.parentDataProperty,je.default.rootData,je.default.data,e.dynamicRef?(0,Te._)(o_||(o_=E([", ","={}"])),je.default.dynamicAnchors):Te.nil)}var s_,a_,l_,c_,u_,p_,d_,f_,m_;function DJ(e,t){e.if(je.default.valCxt,()=>{e.var(je.default.instancePath,(0,Te._)(s_||(s_=E(["",".",""])),je.default.valCxt,je.default.instancePath)),e.var(je.default.parentData,(0,Te._)(a_||(a_=E(["",".",""])),je.default.valCxt,je.default.parentData)),e.var(je.default.parentDataProperty,(0,Te._)(l_||(l_=E(["",".",""])),je.default.valCxt,je.default.parentDataProperty)),e.var(je.default.rootData,(0,Te._)(c_||(c_=E(["",".",""])),je.default.valCxt,je.default.rootData)),t.dynamicRef&&e.var(je.default.dynamicAnchors,(0,Te._)(u_||(u_=E(["",".",""])),je.default.valCxt,je.default.dynamicAnchors))},()=>{e.var(je.default.instancePath,(0,Te._)(p_||(p_=E(['""'])))),e.var(je.default.parentData,(0,Te._)(d_||(d_=E(["undefined"])))),e.var(je.default.parentDataProperty,(0,Te._)(f_||(f_=E(["undefined"])))),e.var(je.default.rootData,je.default.data),t.dynamicRef&&e.var(je.default.dynamicAnchors,(0,Te._)(m_||(m_=E(["{}"]))))})}function FJ(e){let{schema:t,opts:r,gen:n}=e;G_(e,()=>{r.$comment&&t.$comment&&W_(e),$J(e),n.let(je.default.vErrors,null),n.let(je.default.errors,0),r.unevaluated&&LJ(e),H_(e),UJ(e)})}var h_,y_,g_,b_,v_,x_,I_;function LJ(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,Te._)(h_||(h_=E(["",".evaluated"])),r)),t.if((0,Te._)(y_||(y_=E(["",".dynamicProps"])),e.evaluated),()=>t.assign((0,Te._)(g_||(g_=E(["",".props"])),e.evaluated),(0,Te._)(b_||(b_=E(["undefined"]))))),t.if((0,Te._)(v_||(v_=E(["",".dynamicItems"])),e.evaluated),()=>t.assign((0,Te._)(x_||(x_=E(["",".items"])),e.evaluated),(0,Te._)(I_||(I_=E(["undefined"])))))}var S_;function J9(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,Te._)(S_||(S_=E(["/*# sourceURL="," */"])),r):Te.nil}function RJ(e,t){if(V_(e)&&(z_(e),U_(e))){NJ(e,t);return}(0,j_.boolOrEmptySchema)(e,t)}function U_({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function V_(e){return typeof e.schema!="boolean"}var C_;function NJ(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&W_(e),jJ(e),GJ(e);let i=n.const("_errs",je.default.errors);H_(e,i),n.var(t,(0,Te._)(C_||(C_=E([""," === ",""])),i,je.default.errors))}function z_(e){(0,ka.checkUnknownRules)(e),BJ(e)}function H_(e,t){if(e.opts.jtd)return Q9(e,[],!1,t);let r=(0,K9.getSchemaTypes)(e.schema),n=(0,K9.coerceAndCheckDataType)(e,r);Q9(e,r,!n,t)}function BJ(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,ka.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))}function $J(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ka.checkStrictMode)(e,"default is ignored in the schema root")}function jJ(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,_J.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function GJ(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}var P_,T_,w_;function W_({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,Te._)(P_||(P_=E(["",".logger.log(",")"])),je.default.self,i));else if(typeof o.$comment=="function"){let s=(0,Te.str)(T_||(T_=E(["","/$comment"])),n),a=e.scopeValue("root",{ref:t.root});e.code((0,Te._)(w_||(w_=E(["",".opts.$comment(",", ",", ",".schema)"])),je.default.self,i,s,a))}}var M_,O_,E_,__;function UJ(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,Te._)(M_||(M_=E([""," === 0"])),je.default.errors),()=>t.return(je.default.data),()=>t.throw((0,Te._)(O_||(O_=E(["new ","(",")"])),o,je.default.vErrors))):(t.assign((0,Te._)(E_||(E_=E(["",".errors"])),n),je.default.vErrors),i.unevaluated&&VJ(e),t.return((0,Te._)(__||(__=E([""," === 0"])),je.default.errors)))}var A_,k_;function VJ({gen:e,evaluated:t,props:r,items:n}){r instanceof Te.Name&&e.assign((0,Te._)(A_||(A_=E(["",".props"])),t),r),n instanceof Te.Name&&e.assign((0,Te._)(k_||(k_=E(["",".items"])),t),n)}var D_;function Q9(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:l,self:u}=e,{RULES:d}=u;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,ka.schemaHasRulesButRef)(i,d))){o.block(()=>Z_(e,"$ref",d.all.$ref.definition));return}l.jtd||zJ(e,t),o.block(()=>{for(let h of d.rules)f(h);f(d.post)});function f(h){(0,L3.shouldUseGroup)(i,h)&&(h.type?(o.if((0,I0.checkDataType)(h.type,s,l.strictNumbers)),e_(e,h),t.length===1&&t[0]===h.type&&r&&(o.else(),(0,I0.reportTypeError)(e)),o.endIf()):e_(e,h),a||o.if((0,Te._)(D_||(D_=E([""," === ",""])),je.default.errors,n||0)))}}function e_(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,EJ.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,L3.shouldUseRule)(n,i)&&Z_(e,i.keyword,i.definition,t.type)})}function zJ(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(HJ(e,t),e.opts.allowUnionTypes||WJ(e,t),qJ(e,e.dataTypes))}function HJ(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{q_(e.dataTypes,r)||R3(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),XJ(e,t)}}function WJ(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&R3(e,"use allowUnionTypes to allow union type keyword")}function qJ(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,L3.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>ZJ(t,s))&&R3(e,'missing type "'.concat(i.join(","),'" for keyword "').concat(n,'"'))}}}function ZJ(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function q_(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function XJ(e,t){let r=[];for(let n of e.dataTypes)q_(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function R3(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,ka.checkStrictMode)(e,t,e.opts.strictTypes)}var F_,L_,R_,N_,S0=class{constructor(t,r,n){if((0,zh.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ka.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",X_(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,zh.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error("".concat(n," value must be ").concat(JSON.stringify(r.schemaType)));("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",je.default.errors))}result(t,r,n){this.failResult((0,Te.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,Te.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,Te._)(F_||(F_=E([""," !== undefined && (",")"])),r,(0,Te.or)(this.invalid$data(),t)))}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Vh.reportExtraError:Vh.reportError)(this,this.def.error,r)}$dataError(){(0,Vh.reportError)(this,this.def.$dataError||Vh.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Vh.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=Te.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=Te.nil,r=Te.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,Te.or)((0,Te._)(L_||(L_=E([""," === undefined"])),o),r)),t!==Te.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==Te.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,Te.or)(s(),a());function s(){if(n.length){if(!(r instanceof Te.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,Te._)(R_||(R_=E(["",""])),(0,I0.checkDataTypes)(l,r,i.opts.strictNumbers,I0.DataType.Wrong))}return Te.nil}function a(){if(o.validateSchema){let l=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,Te._)(N_||(N_=E(["!","(",")"])),l,r)}return Te.nil}}subschema(t,r){let n=(0,F3.getSubschema)(this.it,t);(0,F3.extendSubschemaData)(n,this.it,t),(0,F3.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return RJ(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=ka.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=ka.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,Te.Name)),!0}};Kl.KeywordCxt=S0;function Z_(e,t,r,n){let o=new S0(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,zh.funcKeywordCode)(o,r):"macro"in r?(0,zh.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,zh.funcKeywordCode)(o,r)}var YJ=/^\/(?:[^~]|~0|~1)*$/,KJ=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/,B_,$_;function X_(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return je.default.rootData;if(e[0]==="/"){if(!YJ.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));o=e,i=je.default.rootData}else{let u=KJ.exec(e);if(!u)throw new Error("Invalid JSON-pointer: ".concat(e));let d=+u[1];if(o=u[2],o==="#"){if(d>=t)throw new Error(l("property/index",d));return n[t-d]}if(d>t)throw new Error(l("data",d));if(i=r[t-d],!o)return i}let s=i,a=o.split("/");for(let u of a)u&&(i=(0,Te._)(B_||(B_=E(["","",""])),i,(0,Te.getProperty)((0,ka.unescapeJsonPointer)(u))),s=(0,Te._)($_||($_=E([""," && ",""])),s,i));return s;function l(u,d){return"Cannot access ".concat(u," ").concat(d," levels up, current level is ").concat(t)}}Kl.getData=X_});var C0=H(B3=>{"use strict";p();Object.defineProperty(B3,"__esModule",{value:!0});var N3=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};B3.default=N3});var Wh=H(G3=>{"use strict";p();Object.defineProperty(G3,"__esModule",{value:!0});var $3=Uh(),j3=class extends Error{constructor(t,r,n,o){super(o||"can't resolve reference ".concat(n," from id ").concat(r)),this.missingRef=(0,$3.resolveUrl)(t,r,n),this.missingSchema=(0,$3.normalizeId)((0,$3.getFullPath)(t,this.missingRef))}};G3.default=j3});var T0=H(qo=>{"use strict";p();Object.defineProperty(qo,"__esModule",{value:!0});qo.resolveSchema=qo.getCompilingSchema=qo.resolveRef=qo.compileSchema=qo.SchemaEnv=void 0;var _i=Ze(),JJ=C0(),Cu=Aa(),Ai=Uh(),Y_=Mt(),QJ=Hh(),Ud=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Ai.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};qo.SchemaEnv=Ud;var K_,J_;function V3(e){let t=Q_.call(this,e);if(t)return t;let r=(0,Ai.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new _i.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:JJ.default,code:(0,_i._)(K_||(K_=E(['require("ajv/dist/runtime/validation_error").default'])))}));let l=s.scopeName("validate");e.validateName=l;let u={gen:s,allErrors:this.opts.allErrors,data:Cu.default.data,parentData:Cu.default.parentData,parentDataProperty:Cu.default.parentDataProperty,dataNames:[Cu.default.data],dataPathArr:[_i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,_i.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:_i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,_i._)(J_||(J_=E(['""']))),opts:this.opts,self:this},d;try{this._compilations.add(e),(0,QJ.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let f=s.toString();d="".concat(s.scopeRefs(Cu.default.scope),"return ").concat(f),this.opts.code.process&&(d=this.opts.code.process(d,e));let b=new Function("".concat(Cu.default.self),"".concat(Cu.default.scope),d)(this,this.scope.get());if(this.scope.value(l,{ref:b}),b.errors=null,b.schema=e.schema,b.schemaEnv=e,e.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:l,validateCode:f,scopeValues:s._values}),this.opts.unevaluated){let{props:v,items:I}=u;b.evaluated={props:v instanceof _i.Name?void 0:v,items:I instanceof _i.Name?void 0:I,dynamicProps:v instanceof _i.Name,dynamicItems:I instanceof _i.Name},b.source&&(b.source.evaluated=(0,_i.stringify)(b.evaluated))}return e.validate=b,e}catch(f){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),f}finally{this._compilations.delete(e)}}qo.compileSchema=V3;function eQ(e,t,r){var n;r=(0,Ai.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=nQ.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(i=new Ud({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=tQ.call(this,i)}qo.resolveRef=eQ;function tQ(e){return(0,Ai.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:V3.call(this,e)}function Q_(e){for(let t of this._compilations)if(rQ(t,e))return t}qo.getCompilingSchema=Q_;function rQ(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function nQ(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||P0.call(this,e,t)}function P0(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Ai._getFullPath)(this.opts.uriResolver,r),o=(0,Ai.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return U3.call(this,r,e);let i=(0,Ai.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=P0.call(this,e,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:U3.call(this,r,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||V3.call(this,s),i===(0,Ai.normalizeId)(t)){let{schema:a}=s,{schemaId:l}=this.opts,u=a[l];return u&&(o=(0,Ai.resolveUrl)(this.opts.uriResolver,o,u)),new Ud({schema:a,schemaId:l,root:e,baseId:o})}return U3.call(this,r,s)}}qo.resolveSchema=P0;var oQ=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function U3(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,Y_.unescapeFragment)(a)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!oQ.has(a)&&u&&(t=(0,Ai.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Y_.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Ai.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=P0.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new Ud({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var e8=H((RMe,iQ)=>{iQ.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var r8=H((NMe,t8)=>{"use strict";p();var sQ={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};t8.exports={HEX:sQ}});var u8=H(($Me,c8)=>{"use strict";p();var{HEX:aQ}=r8(),lQ=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function s8(e){if(l8(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(lQ)||[],[r]=t;return r?{host:uQ(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function z3(e,t=!1){let r="",n=!0;for(let o of e){if(aQ[o]===void 0)return;o!=="0"&&n===!0&&(n=!1),n||(r+=o)}return t&&r.length===0&&(r="0"),r}function cQ(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=!1;function l(){if(o.length){if(i===!1){let u=z3(o);if(u!==void 0)n.push(u);else return r.error=!0,!1}o.length=0}return!0}for(let u=0;u<e.length;u++){let d=e[u];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(a=!0),!l())break;if(t++,n.push(":"),t>7){r.error=!0;break}u-1>=0&&e[u-1]===":"&&(s=!0);continue}else if(d==="%"){if(!l())break;i=!0}else{o.push(d);continue}}return o.length&&(i?r.zone=o.join(""):a?n.push(o.join("")):n.push(z3(o))),r.address=n.join(""),r}function a8(e){if(l8(e,":")<2)return{host:e,isIPV6:!1};let t=cQ(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,escapedHost:n,isIPV6:!0}}}function uQ(e,t){let r="",n=!0,o=e.length;for(let i=0;i<o;i++){let s=e[i];s==="0"&&n?(i+1<=o&&e[i+1]===t||i+1===o)&&(r+=s,n=!1):(s===t?n=!0:n=!1,r+=s)}return r}function l8(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}var n8=/^\.\.?\//u,o8=/^\/\.(?:\/|$)/u,i8=/^\/\.\.(?:\/|$)/u,pQ=/^\/?(?:.|\n)*?(?=\/|$)/u;function dQ(e){let t=[];for(;e.length;)if(e.match(n8))e=e.replace(n8,"");else if(e.match(o8))e=e.replace(o8,"/");else if(e.match(i8))e=e.replace(i8,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(pQ);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}function fQ(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function mQ(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=s8(r);if(n.isIPV4)r=n.host;else{let o=a8(n.host);o.isIPV6===!0?r="[".concat(o.escapedHost,"]"):r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}c8.exports={recomposeAuthority:mQ,normalizeComponentEncoding:fQ,removeDotSegments:dQ,normalizeIPv4:s8,normalizeIPv6:a8,stringArrayToHexStripped:z3}});var y8=H((GMe,h8)=>{"use strict";p();var hQ=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,yQ=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function p8(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}function d8(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function f8(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function gQ(e){return e.secure=p8(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function bQ(e){if((e.port===(p8(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function vQ(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(yQ);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o="".concat(n,":").concat(t.nid||e.nid),i=H3[o];e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function xQ(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o="".concat(r,":").concat(t.nid||n),i=H3[o];i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path="".concat(n||t.nid,":").concat(a),t.skipEscape=!0,s}function IQ(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!hQ.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function SQ(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var m8={scheme:"http",domainHost:!0,parse:d8,serialize:f8},CQ={scheme:"https",domainHost:m8.domainHost,parse:d8,serialize:f8},w0={scheme:"ws",domainHost:!0,parse:gQ,serialize:bQ},PQ={scheme:"wss",domainHost:w0.domainHost,parse:w0.parse,serialize:w0.serialize},TQ={scheme:"urn",parse:vQ,serialize:xQ,skipNormalize:!0},wQ={scheme:"urn:uuid",parse:IQ,serialize:SQ,skipNormalize:!0},H3={http:m8,https:CQ,ws:w0,wss:PQ,urn:TQ,"urn:uuid":wQ};h8.exports=H3});var b8=H((VMe,O0)=>{"use strict";p();var{normalizeIPv6:MQ,normalizeIPv4:OQ,removeDotSegments:qh,recomposeAuthority:EQ,normalizeComponentEncoding:M0}=u8(),W3=y8();function _Q(e,t){return typeof e=="string"?e=Ts(Da(e,t),t):typeof e=="object"&&(e=Da(Ts(e,t),t)),e}function AQ(e,t,r){let n=Object.assign({scheme:"null"},r),o=g8(Da(e,n),Da(t,n),n,!0);return Ts(o,{...n,skipEscape:!0})}function g8(e,t,r,n){let o={};return n||(e=Da(Ts(e,r),r),t=Da(Ts(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=qh(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=qh(t.path||""),o.query=t.query):(t.path?(t.path.charAt(0)==="/"?o.path=qh(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=qh(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function kQ(e,t,r){return typeof e=="string"?(e=unescape(e),e=Ts(M0(Da(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Ts(M0(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Ts(M0(Da(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Ts(M0(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Ts(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=W3[(n.scheme||r.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let s=EQ(r);if(s!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(s),r.path&&r.path.charAt(0)!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=qh(a)),s===void 0&&(a=a.replace(/^\/\//u,"/%2F")),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var DQ=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function FQ(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||DQ[t])return!0;return!1}var LQ=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Da(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=e.indexOf("%")!==-1,i=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let s=e.match(LQ);if(s){if(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]),n.host){let l=OQ(n.host);if(l.isIPV4===!1){let u=MQ(l.host);n.host=u.host.toLowerCase(),i=u.isIPV6}else n.host=l.host,i=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=W3[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&i===!1&&FQ(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}(!a||a&&!a.skipNormalize)&&(o&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),o&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var q3={SCHEMES:W3,normalize:_Q,resolve:AQ,resolveComponents:g8,equal:kQ,serialize:Ts,parse:Da};O0.exports=q3;O0.exports.default=q3;O0.exports.fastUri=q3});var x8=H(Z3=>{"use strict";p();Object.defineProperty(Z3,"__esModule",{value:!0});var v8=b8();v8.code='require("ajv/dist/runtime/uri").default';Z3.default=v8});var O8=H(nn=>{"use strict";p();Object.defineProperty(nn,"__esModule",{value:!0});nn.CodeGen=nn.Name=nn.nil=nn.stringify=nn.str=nn._=nn.KeywordCxt=void 0;var RQ=Hh();Object.defineProperty(nn,"KeywordCxt",{enumerable:!0,get:function(){return RQ.KeywordCxt}});var Vd=Ze();Object.defineProperty(nn,"_",{enumerable:!0,get:function(){return Vd._}});Object.defineProperty(nn,"str",{enumerable:!0,get:function(){return Vd.str}});Object.defineProperty(nn,"stringify",{enumerable:!0,get:function(){return Vd.stringify}});Object.defineProperty(nn,"nil",{enumerable:!0,get:function(){return Vd.nil}});Object.defineProperty(nn,"Name",{enumerable:!0,get:function(){return Vd.Name}});Object.defineProperty(nn,"CodeGen",{enumerable:!0,get:function(){return Vd.CodeGen}});var NQ=C0(),T8=Wh(),BQ=P3(),Zh=T0(),$Q=Ze(),Xh=Uh(),E0=Gh(),Y3=Mt(),I8=e8(),jQ=x8(),w8=(e,t)=>new RegExp(e,t);w8.code="new RegExp";var GQ=["removeAdditional","useDefaults","coerceTypes"],UQ=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),VQ={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},zQ={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},S8=200;function HQ(e){var t,r,n,o,i,s,a,l,u,d,f,h,b,v,I,x,C,P,w,T,O,N,k,D,F;let z=e.strict,G=(t=e.code)===null||t===void 0?void 0:t.optimize,j=G===!0||G===void 0?1:G||0,K=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:w8,Z=(o=e.uriResolver)!==null&&o!==void 0?o:jQ.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:z)!==null&&s!==void 0?s:!0,strictNumbers:(l=(a=e.strictNumbers)!==null&&a!==void 0?a:z)!==null&&l!==void 0?l:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:z)!==null&&d!==void 0?d:"log",strictTuples:(h=(f=e.strictTuples)!==null&&f!==void 0?f:z)!==null&&h!==void 0?h:"log",strictRequired:(v=(b=e.strictRequired)!==null&&b!==void 0?b:z)!==null&&v!==void 0?v:!1,code:e.code?{...e.code,optimize:j,regExp:K}:{optimize:j,regExp:K},loopRequired:(I=e.loopRequired)!==null&&I!==void 0?I:S8,loopEnum:(x=e.loopEnum)!==null&&x!==void 0?x:S8,meta:(C=e.meta)!==null&&C!==void 0?C:!0,messages:(P=e.messages)!==null&&P!==void 0?P:!0,inlineRefs:(w=e.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(T=e.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(O=e.addUsedSchema)!==null&&O!==void 0?O:!0,validateSchema:(N=e.validateSchema)!==null&&N!==void 0?N:!0,validateFormats:(k=e.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(D=e.unicodeRegExp)!==null&&D!==void 0?D:!0,int32range:(F=e.int32range)!==null&&F!==void 0?F:!0,uriResolver:Z}}var Yh=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...HQ(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new $Q.ValueScope({scope:{},prefixes:UQ,es5:r,lines:n}),this.logger=KQ(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,BQ.getRules)(),C8.call(this,VQ,t,"NOT SUPPORTED"),C8.call(this,zQ,t,"DEPRECATED","warn"),this._metaOpts=XQ.call(this),t.formats&&qQ.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&ZQ.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),WQ.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=I8;n==="id"&&(o={...I8},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'.concat(t,'"'))}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(d,f){await i.call(this,d.$schema);let h=this._addSchema(d,f);return h.validate||s.call(this,h)}async function i(d){d&&!this.getSchema(d)&&await o.call(this,{$ref:d},!0)}async function s(d){try{return this._compileSchemaEnv(d)}catch(f){if(!(f instanceof T8.default))throw f;return a.call(this,f),await l.call(this,f.missingSchema),s.call(this,d)}}function a({missingSchema:d,missingRef:f}){if(this.refs[d])throw new Error("AnySchema ".concat(d," is loaded but ").concat(f," cannot be resolved"))}async function l(d){let f=await u.call(this,d);this.refs[d]||await i.call(this,f.$schema),this.refs[d]||this.addSchema(f,d,r)}async function u(d){let f=this._loading[d];if(f)return f;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error("schema ".concat(s," must be string"))}return r=(0,Xh.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=P8.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new Zh.SchemaEnv({schema:{},schemaId:n});if(r=Zh.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=P8.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Xh.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(QQ.call(this,n,r),!r)return(0,Y3.eachItem)(n,i=>X3.call(this,i)),this;tee.call(this,r);let o={...r,type:(0,E0.getJSONTypes)(r.type),schemaType:(0,E0.getJSONTypes)(r.schemaType)};return(0,Y3.eachItem)(n,o.type.length===0?i=>X3.call(this,i,o):i=>o.type.forEach(s=>X3.call(this,i,o,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>"".concat(n).concat(o.instancePath," ").concat(o.message)).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),s=t;for(let a of i)s=s[a];for(let a in n){let l=n[a];if(typeof l!="object")continue;let{$data:u}=l.definition,d=s[a];u&&d&&(s[a]=M8(d))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(t);if(l!==void 0)return l;n=(0,Xh.normalizeId)(s||n);let u=Xh.getSchemaRefs.call(this,t,n);return l=new Zh.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(l.schema,l),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),o&&this.validateSchema(t,!0),l}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error('schema with key or id "'.concat(t,'" already exists'))}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Zh.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Zh.compileSchema.call(this,t)}finally{this.opts=r}}};Yh.ValidationError=NQ.default;Yh.MissingRefError=T8.default;nn.default=Yh;function C8(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n]("".concat(r,": option ").concat(o,". ").concat(e[i]))}}function P8(e){return e=(0,Xh.normalizeId)(e),this.schemas[e]||this.refs[e]}function WQ(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function qQ(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function ZQ(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function XQ(){let e={...this.opts};for(let t of GQ)delete e[t];return e}var YQ={log(){},warn(){},error(){}};function KQ(e){if(e===!1)return YQ;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var JQ=/^[a-z_$][a-z0-9_$:-]*$/i;function QQ(e,t){let{RULES:r}=this;if((0,Y3.eachItem)(e,n=>{if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!JQ.test(n))throw new Error("Keyword ".concat(n," has invalid name"))}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function X3(e,t,r){var n;let o=t==null?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=o?i.post:i.rules.find(({type:l})=>l===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,E0.getJSONTypes)(t.type),schemaType:(0,E0.getJSONTypes)(t.schemaType)}};t.before?eee.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function eee(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn("rule ".concat(r," is not defined")))}function tee(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=M8(t)),e.validateSchema=this.compile(t,!0))}var ree={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function M8(e){return{anyOf:[e,ree]}}});var E8=H(K3=>{"use strict";p();Object.defineProperty(K3,"__esModule",{value:!0});var nee={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};K3.default=nee});var U8=H(Pu=>{"use strict";p();Object.defineProperty(Pu,"__esModule",{value:!0});Pu.callRef=Pu.getValidate=void 0;var oee=Wh(),_8=Wo(),co=Ze(),zd=Aa(),A8=T0(),_0=Mt(),k8,iee={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:l}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return f();let d=A8.resolveRef.call(l,u,o,r);if(d===void 0)throw new oee.default(n.opts.uriResolver,o,r);if(d instanceof A8.SchemaEnv)return h(d);return b(d);function f(){if(i===u)return A0(e,s,i,i.$async);let v=t.scopeValue("root",{ref:u});return A0(e,(0,co._)(k8||(k8=E(["",".validate"])),v),u,u.$async)}function h(v){let I=G8(e,v);A0(e,I,v,v.$async)}function b(v){let I=t.scopeValue("schema",a.code.source===!0?{ref:v,code:(0,co.stringify)(v)}:{ref:v}),x=t.name("valid"),C=e.subschema({schema:v,dataTypes:[],schemaPath:co.nil,topSchemaRef:I,errSchemaPath:r},x);e.mergeEvaluated(C),e.ok(x)}}},D8;function G8(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,co._)(D8||(D8=E(["",".validate"])),r.scopeValue("wrapper",{ref:t}))}Pu.getValidate=G8;var F8,L8,R8,N8,B8,$8,j8;function A0(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:l}=i,u=l.passContext?zd.default.this:co.nil;n?d():f();function d(){if(!a.$async)throw new Error("async schema referenced by sync schema");let v=o.let("valid");o.try(()=>{o.code((0,co._)(F8||(F8=E(["await ",""])),(0,_8.callValidateCode)(e,t,u))),b(t),s||o.assign(v,!0)},I=>{o.if((0,co._)(L8||(L8=E(["!("," instanceof ",")"])),I,i.ValidationError),()=>o.throw(I)),h(I),s||o.assign(v,!1)}),e.ok(v)}function f(){e.result((0,_8.callValidateCode)(e,t,u),()=>b(t),()=>h(t))}function h(v){let I=(0,co._)(R8||(R8=E(["",".errors"])),v);o.assign(zd.default.vErrors,(0,co._)(N8||(N8=E([""," === null ? "," : ",".concat(",")"])),zd.default.vErrors,I,zd.default.vErrors,I)),o.assign(zd.default.errors,(0,co._)(B8||(B8=E(["",".length"])),zd.default.vErrors))}function b(v){var I;if(!i.opts.unevaluated)return;let x=(I=r==null?void 0:r.validate)===null||I===void 0?void 0:I.evaluated;if(i.props!==!0)if(x&&!x.dynamicProps)x.props!==void 0&&(i.props=_0.mergeEvaluated.props(o,x.props,i.props));else{let C=o.var("props",(0,co._)($8||($8=E(["",".evaluated.props"])),v));i.props=_0.mergeEvaluated.props(o,C,i.props,co.Name)}if(i.items!==!0)if(x&&!x.dynamicItems)x.items!==void 0&&(i.items=_0.mergeEvaluated.items(o,x.items,i.items));else{let C=o.var("items",(0,co._)(j8||(j8=E(["",".evaluated.items"])),v));i.items=_0.mergeEvaluated.items(o,C,i.items,co.Name)}}}Pu.callRef=A0;Pu.default=iee});var V8=H(J3=>{"use strict";p();Object.defineProperty(J3,"__esModule",{value:!0});var see=E8(),aee=U8(),lee=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",see.default,aee.default];J3.default=lee});var q8=H(Q3=>{"use strict";p();Object.defineProperty(Q3,"__esModule",{value:!0});var k0=Ze(),Jl=k0.operators,D0={maximum:{okStr:"<=",ok:Jl.LTE,fail:Jl.GT},minimum:{okStr:">=",ok:Jl.GTE,fail:Jl.LT},exclusiveMaximum:{okStr:"<",ok:Jl.LT,fail:Jl.GTE},exclusiveMinimum:{okStr:">",ok:Jl.GT,fail:Jl.LTE}},z8,H8,cee={message:({keyword:e,schemaCode:t})=>(0,k0.str)(z8||(z8=E(["must be "," ",""])),D0[e].okStr,t),params:({keyword:e,schemaCode:t})=>(0,k0._)(H8||(H8=E(["{comparison: ",", limit: ","}"])),D0[e].okStr,t)},W8,uee={keyword:Object.keys(D0),type:"number",schemaType:"number",$data:!0,error:cee,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,k0._)(W8||(W8=E([""," "," "," || isNaN(",")"])),r,D0[t].fail,n,r))}};Q3.default=uee});var Q8=H(eC=>{"use strict";p();Object.defineProperty(eC,"__esModule",{value:!0});var Kh=Ze(),Z8,X8,pee={message:({schemaCode:e})=>(0,Kh.str)(Z8||(Z8=E(["must be multiple of ",""])),e),params:({schemaCode:e})=>(0,Kh._)(X8||(X8=E(["{multipleOf: ","}"])),e)},Y8,K8,J8,dee={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:pee,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,Kh._)(Y8||(Y8=E(["Math.abs(Math.round(",") - ",") > 1e-",""])),s,s,i):(0,Kh._)(K8||(K8=E([""," !== parseInt(",")"])),s,s);e.fail$data((0,Kh._)(J8||(J8=E(["("," === 0 || ("," = ","/",", ","))"])),n,s,r,n,a))}};eC.default=dee});var tA=H(tC=>{"use strict";p();Object.defineProperty(tC,"__esModule",{value:!0});function eA(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}tC.default=eA;eA.code='require("ajv/dist/runtime/ucs2length").default'});var aA=H(rC=>{"use strict";p();Object.defineProperty(rC,"__esModule",{value:!0});var Tu=Ze(),fee=Mt(),mee=tA(),rA,nA,hee={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Tu.str)(rA||(rA=E(["must NOT have "," than "," characters"])),r,t)},params:({schemaCode:e})=>(0,Tu._)(nA||(nA=E(["{limit: ","}"])),e)},oA,iA,sA,yee={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:hee,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?Tu.operators.GT:Tu.operators.LT,s=o.opts.unicode===!1?(0,Tu._)(oA||(oA=E(["",".length"])),r):(0,Tu._)(iA||(iA=E(["","(",")"])),(0,fee.useFunc)(e.gen,mee.default),r);e.fail$data((0,Tu._)(sA||(sA=E([""," "," ",""])),s,i,n))}};rC.default=yee});var dA=H(nC=>{"use strict";p();Object.defineProperty(nC,"__esModule",{value:!0});var gee=Wo(),F0=Ze(),lA,cA,bee={message:({schemaCode:e})=>(0,F0.str)(lA||(lA=E(['must match pattern "','"'])),e),params:({schemaCode:e})=>(0,F0._)(cA||(cA=E(["{pattern: ","}"])),e)},uA,pA,vee={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:bee,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,s=i.opts.unicodeRegExp?"u":"",a=r?(0,F0._)(uA||(uA=E(["(new RegExp(",", ","))"])),o,s):(0,gee.usePattern)(e,n);e.fail$data((0,F0._)(pA||(pA=E(["!",".test(",")"])),a,t))}};nC.default=vee});var yA=H(oC=>{"use strict";p();Object.defineProperty(oC,"__esModule",{value:!0});var Jh=Ze(),fA,mA,xee={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Jh.str)(fA||(fA=E(["must NOT have "," than "," properties"])),r,t)},params:({schemaCode:e})=>(0,Jh._)(mA||(mA=E(["{limit: ","}"])),e)},hA,Iee={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:xee,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?Jh.operators.GT:Jh.operators.LT;e.fail$data((0,Jh._)(hA||(hA=E(["Object.keys(",").length "," ",""])),r,o,n))}};oC.default=Iee});var vA=H(iC=>{"use strict";p();Object.defineProperty(iC,"__esModule",{value:!0});var Qh=Wo(),ey=Ze(),See=Mt(),gA,bA,Cee={message:({params:{missingProperty:e}})=>(0,ey.str)(gA||(gA=E(["must have required property '","'"])),e),params:({params:{missingProperty:e}})=>(0,ey._)(bA||(bA=E(["{missingProperty: ","}"])),e)},Pee={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Cee,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let l=r.length>=a.loopRequired;if(s.allErrors?u():d(),a.strictRequired){let b=e.parentSchema.properties,{definedProperties:v}=e.it;for(let I of r)if((b==null?void 0:b[I])===void 0&&!v.has(I)){let x=s.schemaEnv.baseId+s.errSchemaPath,C='required property "'.concat(I,'" is not defined at "').concat(x,'" (strictRequired)');(0,See.checkStrictMode)(s,C,s.opts.strictRequired)}}function u(){if(l||i)e.block$data(ey.nil,f);else for(let b of r)(0,Qh.checkReportMissingProp)(e,b)}function d(){let b=t.let("missing");if(l||i){let v=t.let("valid",!0);e.block$data(v,()=>h(b,v)),e.ok(v)}else t.if((0,Qh.checkMissingProp)(e,r,b)),(0,Qh.reportMissingProp)(e,b),t.else()}function f(){t.forOf("prop",n,b=>{e.setParams({missingProperty:b}),t.if((0,Qh.noPropertyInData)(t,o,b,a.ownProperties),()=>e.error())})}function h(b,v){e.setParams({missingProperty:b}),t.forOf(b,n,()=>{t.assign(v,(0,Qh.propertyInData)(t,o,b,a.ownProperties)),t.if((0,ey.not)(v),()=>{e.error(),t.break()})},ey.nil)}}};iC.default=Pee});var CA=H(sC=>{"use strict";p();Object.defineProperty(sC,"__esModule",{value:!0});var ty=Ze(),xA,IA,Tee={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,ty.str)(xA||(xA=E(["must NOT have "," than "," items"])),r,t)},params:({schemaCode:e})=>(0,ty._)(IA||(IA=E(["{limit: ","}"])),e)},SA,wee={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Tee,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?ty.operators.GT:ty.operators.LT;e.fail$data((0,ty._)(SA||(SA=E(["",".length "," ",""])),r,o,n))}};sC.default=wee});var L0=H(aC=>{"use strict";p();Object.defineProperty(aC,"__esModule",{value:!0});var PA=k3();PA.code='require("ajv/dist/runtime/equal").default';aC.default=PA});var UA=H(cC=>{"use strict";p();Object.defineProperty(cC,"__esModule",{value:!0});var lC=Gh(),on=Ze(),Mee=Mt(),Oee=L0(),TA,wA,Eee={message:({params:{i:e,j:t}})=>(0,on.str)(TA||(TA=E(["must NOT have duplicate items (items ## "," and "," are identical)"])),t,e),params:({params:{i:e,j:t}})=>(0,on._)(wA||(wA=E(["{i: ",", j: ","}"])),e,t)},MA,OA,EA,_A,AA,kA,DA,FA,LA,RA,NA,BA,$A,jA,GA,_ee={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Eee,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let l=t.let("valid"),u=i.items?(0,lC.getSchemaTypes)(i.items):[];e.block$data(l,d,(0,on._)(MA||(MA=E([""," === false"])),s)),e.ok(l);function d(){let v=t.let("i",(0,on._)(OA||(OA=E(["",".length"])),r)),I=t.let("j");e.setParams({i:v,j:I}),t.assign(l,!0),t.if((0,on._)(EA||(EA=E([""," > 1"])),v),()=>(f()?h:b)(v,I))}function f(){return u.length>0&&!u.some(v=>v==="object"||v==="array")}function h(v,I){let x=t.name("item"),C=(0,lC.checkDataTypes)(u,x,a.opts.strictNumbers,lC.DataType.Wrong),P=t.const("indices",(0,on._)(_A||(_A=E(["{}"]))));t.for((0,on._)(AA||(AA=E([";","--;"])),v),()=>{t.let(x,(0,on._)(kA||(kA=E(["","[","]"])),r,v)),t.if(C,(0,on._)(DA||(DA=E(["continue"])))),u.length>1&&t.if((0,on._)(FA||(FA=E(["typeof ",' == "string"'])),x),(0,on._)(LA||(LA=E(["",' += "_"'])),x)),t.if((0,on._)(RA||(RA=E(["typeof ","[",'] == "number"'])),P,x),()=>{t.assign(I,(0,on._)(NA||(NA=E(["","[","]"])),P,x)),e.error(),t.assign(l,!1).break()}).code((0,on._)(BA||(BA=E(["","[","] = ",""])),P,x,v))})}function b(v,I){let x=(0,Mee.useFunc)(t,Oee.default),C=t.name("outer");t.label(C).for((0,on._)($A||($A=E([";","--;"])),v),()=>t.for((0,on._)(jA||(jA=E([""," = ","; ","--;"])),I,v,I),()=>t.if((0,on._)(GA||(GA=E(["","(","[","], ","[","])"])),x,r,v,r,I),()=>{e.error(),t.assign(l,!1).break(C)})))}}};cC.default=_ee});var WA=H(pC=>{"use strict";p();Object.defineProperty(pC,"__esModule",{value:!0});var uC=Ze(),Aee=Mt(),kee=L0(),VA,Dee={message:"must be equal to constant",params:({schemaCode:e})=>(0,uC._)(VA||(VA=E(["{allowedValue: ","}"])),e)},zA,HA,Fee={keyword:"const",$data:!0,error:Dee,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,uC._)(zA||(zA=E(["!","(",", ",")"])),(0,Aee.useFunc)(t,kee.default),r,o)):e.fail((0,uC._)(HA||(HA=E([""," !== ",""])),i,r))}};pC.default=Fee});var KA=H(dC=>{"use strict";p();Object.defineProperty(dC,"__esModule",{value:!0});var ry=Ze(),Lee=Mt(),Ree=L0(),qA,Nee={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ry._)(qA||(qA=E(["{allowedValues: ","}"])),e)},ZA,XA,YA,Bee={keyword:"enum",schemaType:"array",$data:!0,error:Nee,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,l,u=()=>l!=null?l:l=(0,Lee.useFunc)(t,Ree.default),d;if(a||n)d=t.let("valid"),e.block$data(d,f);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let b=t.const("vSchema",i);d=(0,ry.or)(...o.map((v,I)=>h(b,I)))}e.pass(d);function f(){t.assign(d,!1),t.forOf("v",i,b=>t.if((0,ry._)(ZA||(ZA=E(["","(",", ",")"])),u(),r,b),()=>t.assign(d,!0).break()))}function h(b,v){let I=o[v];return typeof I=="object"&&I!==null?(0,ry._)(XA||(XA=E(["","(",", ","[","])"])),u(),r,b,v):(0,ry._)(YA||(YA=E([""," === ",""])),r,I)}}};dC.default=Bee});var JA=H(fC=>{"use strict";p();Object.defineProperty(fC,"__esModule",{value:!0});var $ee=q8(),jee=Q8(),Gee=aA(),Uee=dA(),Vee=yA(),zee=vA(),Hee=CA(),Wee=UA(),qee=WA(),Zee=KA(),Xee=[$ee.default,jee.default,Gee.default,Uee.default,Vee.default,zee.default,Hee.default,Wee.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},qee.default,Zee.default];fC.default=Xee});var hC=H(ny=>{"use strict";p();Object.defineProperty(ny,"__esModule",{value:!0});ny.validateAdditionalItems=void 0;var wu=Ze(),mC=Mt(),QA,ek,Yee={message:({params:{len:e}})=>(0,wu.str)(QA||(QA=E(["must NOT have more than "," items"])),e),params:({params:{len:e}})=>(0,wu._)(ek||(ek=E(["{limit: ","}"])),e)},Kee={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Yee,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,mC.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ok(e,n)}},tk,rk,nk;function ok(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,wu._)(tk||(tk=E(["",".length"])),o));if(n===!1)e.setParams({len:t.length}),e.pass((0,wu._)(rk||(rk=E([""," <= ",""])),a,t.length));else if(typeof n=="object"&&!(0,mC.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,wu._)(nk||(nk=E([""," <= ",""])),a,t.length));r.if((0,wu.not)(u),()=>l(u)),e.ok(u)}function l(u){r.forRange("i",t.length,a,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:mC.Type.Num},u),s.allErrors||r.if((0,wu.not)(u),()=>r.break())})}}ny.validateAdditionalItems=ok;ny.default=Kee});var yC=H(oy=>{"use strict";p();Object.defineProperty(oy,"__esModule",{value:!0});oy.validateTuple=void 0;var ik=Ze(),R0=Mt(),Jee=Wo(),Qee={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return lk(e,"additionalItems",t);r.items=!0,!(0,R0.alwaysValidSchema)(r,t)&&e.ok((0,Jee.validateArray)(e))}},sk,ak;function lk(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;d(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=R0.mergeEvaluated.items(n,r.length,a.items));let l=n.name("valid"),u=n.const("len",(0,ik._)(sk||(sk=E(["",".length"])),i));r.forEach((f,h)=>{(0,R0.alwaysValidSchema)(a,f)||(n.if((0,ik._)(ak||(ak=E([""," > ",""])),u,h),()=>e.subschema({keyword:s,schemaProp:h,dataProp:h},l)),e.ok(l))});function d(f){let{opts:h,errSchemaPath:b}=a,v=r.length,I=v===f.minItems&&(v===f.maxItems||f[t]===!1);if(h.strictTuples&&!I){let x='"'.concat(s,'" is ').concat(v,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(b,'"');(0,R0.checkStrictMode)(a,x,h.strictTuples)}}}oy.validateTuple=lk;oy.default=Qee});var ck=H(gC=>{"use strict";p();Object.defineProperty(gC,"__esModule",{value:!0});var ete=yC(),tte={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,ete.validateTuple)(e,"items")};gC.default=tte});var fk=H(bC=>{"use strict";p();Object.defineProperty(bC,"__esModule",{value:!0});var uk=Ze(),rte=Mt(),nte=Wo(),ote=hC(),pk,dk,ite={message:({params:{len:e}})=>(0,uk.str)(pk||(pk=E(["must NOT have more than "," items"])),e),params:({params:{len:e}})=>(0,uk._)(dk||(dk=E(["{limit: ","}"])),e)},ste={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:ite,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,rte.alwaysValidSchema)(n,t)&&(o?(0,ote.validateAdditionalItems)(e,o):e.ok((0,nte.validateArray)(e)))}};bC.default=ste});var wk=H(vC=>{"use strict";p();Object.defineProperty(vC,"__esModule",{value:!0});var Zo=Ze(),N0=Mt(),mk,hk,yk,gk,ate={message:({params:{min:e,max:t}})=>t===void 0?(0,Zo.str)(mk||(mk=E(["must contain at least "," valid item(s)"])),e):(0,Zo.str)(hk||(hk=E(["must contain at least "," and no more than "," valid item(s)"])),e,t),params:({params:{min:e,max:t}})=>t===void 0?(0,Zo._)(yk||(yk=E(["{minContains: ","}"])),e):(0,Zo._)(gk||(gk=E(["{minContains: ",", maxContains: ","}"])),e,t)},bk,vk,xk,Ik,Sk,Ck,Pk,Tk,lte={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ate,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:l,maxContains:u}=n;i.opts.next?(s=l===void 0?1:l,a=u):s=1;let d=t.const("len",(0,Zo._)(bk||(bk=E(["",".length"])),o));if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,N0.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,N0.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,N0.alwaysValidSchema)(i,r)){let I=(0,Zo._)(vk||(vk=E([""," >= ",""])),d,s);a!==void 0&&(I=(0,Zo._)(xk||(xk=E([""," && "," <= ",""])),I,d,a)),e.pass(I);return}i.items=!0;let f=t.name("valid");a===void 0&&s===1?b(f,()=>t.if(f,()=>t.break())):s===0?(t.let(f,!0),a!==void 0&&t.if((0,Zo._)(Ik||(Ik=E(["",".length > 0"])),o),h)):(t.let(f,!1),h()),e.result(f,()=>e.reset());function h(){let I=t.name("_valid"),x=t.let("count",0);b(I,()=>t.if(I,()=>v(x)))}function b(I,x){t.forRange("i",0,d,C=>{e.subschema({keyword:"contains",dataProp:C,dataPropType:N0.Type.Num,compositeRule:!0},I),x()})}function v(I){t.code((0,Zo._)(Sk||(Sk=E(["","++"])),I)),a===void 0?t.if((0,Zo._)(Ck||(Ck=E([""," >= ",""])),I,s),()=>t.assign(f,!0).break()):(t.if((0,Zo._)(Pk||(Pk=E([""," > ",""])),I,a),()=>t.assign(f,!1).break()),s===1?t.assign(f,!0):t.if((0,Zo._)(Tk||(Tk=E([""," >= ",""])),I,s),()=>t.assign(f,!0)))}}};vC.default=lte});var kk=H(ws=>{"use strict";p();Object.defineProperty(ws,"__esModule",{value:!0});ws.validateSchemaDeps=ws.validatePropertyDeps=ws.error=void 0;var xC=Ze(),cte=Mt(),iy=Wo(),Mk,Ok;ws.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,xC.str)(Mk||(Mk=E(["must have "," "," when property "," is present"])),n,r,e)},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,xC._)(Ok||(Ok=E(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),e,n,t,r)};var ute={keyword:"dependencies",type:"object",schemaType:"object",error:ws.error,code(e){let[t,r]=pte(e);_k(e,t),Ak(e,r)}};function pte({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}var Ek;function _k(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let l=(0,iy.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(l,()=>{for(let u of a)(0,iy.checkReportMissingProp)(e,u)}):(r.if((0,xC._)(Ek||(Ek=E([""," && (",")"])),l,(0,iy.checkMissingProp)(e,a,i))),(0,iy.reportMissingProp)(e,i),r.else())}}ws.validatePropertyDeps=_k;function Ak(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,cte.alwaysValidSchema)(i,t[a])||(r.if((0,iy.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let l=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(l,s)},()=>r.var(s,!0)),e.ok(s))}ws.validateSchemaDeps=Ak;ws.default=ute});var Lk=H(IC=>{"use strict";p();Object.defineProperty(IC,"__esModule",{value:!0});var Fk=Ze(),dte=Mt(),Dk,fte={message:"property name must be valid",params:({params:e})=>(0,Fk._)(Dk||(Dk=E(["{propertyName: ","}"])),e.propertyName)},mte={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:fte,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,dte.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,Fk.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};IC.default=mte});var CC=H(SC=>{"use strict";p();Object.defineProperty(SC,"__esModule",{value:!0});var B0=Wo(),ki=Ze(),hte=Aa(),$0=Mt(),Rk,yte={message:"must NOT have additional properties",params:({params:e})=>(0,ki._)(Rk||(Rk=E(["{additionalProperty: ","}"])),e.additionalProperty)},Nk,Bk,$k,jk,gte={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:yte,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,$0.alwaysValidSchema)(s,r))return;let u=(0,B0.allSchemaProperties)(n.properties),d=(0,B0.allSchemaProperties)(n.patternProperties);f(),e.ok((0,ki._)(Nk||(Nk=E([""," === ",""])),i,hte.default.errors));function f(){t.forIn("key",o,x=>{!u.length&&!d.length?v(x):t.if(h(x),()=>v(x))})}function h(x){let C;if(u.length>8){let P=(0,$0.schemaRefOrVal)(s,n.properties,"properties");C=(0,B0.isOwnProperty)(t,P,x)}else u.length?C=(0,ki.or)(...u.map(P=>(0,ki._)(Bk||(Bk=E([""," === ",""])),x,P))):C=ki.nil;return d.length&&(C=(0,ki.or)(C,...d.map(P=>(0,ki._)($k||($k=E(["",".test(",")"])),(0,B0.usePattern)(e,P),x)))),(0,ki.not)(C)}function b(x){t.code((0,ki._)(jk||(jk=E(["delete ","[","]"])),o,x))}function v(x){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){b(x);return}if(r===!1){e.setParams({additionalProperty:x}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,$0.alwaysValidSchema)(s,r)){let C=t.name("valid");l.removeAdditional==="failing"?(I(x,C,!1),t.if((0,ki.not)(C),()=>{e.reset(),b(x)})):(I(x,C),a||t.if((0,ki.not)(C),()=>t.break()))}}function I(x,C,P){let w={keyword:"additionalProperties",dataProp:x,dataPropType:$0.Type.Str};P===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(w,C)}}};SC.default=gte});var Vk=H(TC=>{"use strict";p();Object.defineProperty(TC,"__esModule",{value:!0});var bte=Hh(),Gk=Wo(),PC=Mt(),Uk=CC(),vte={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Uk.default.code(new bte.KeywordCxt(i,Uk.default,"additionalProperties"));let s=(0,Gk.allSchemaProperties)(r);for(let f of s)i.definedProperties.add(f);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=PC.mergeEvaluated.props(t,(0,PC.toHash)(s),i.props));let a=s.filter(f=>!(0,PC.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let l=t.name("valid");for(let f of a)u(f)?d(f):(t.if((0,Gk.propertyInData)(t,o,f,i.opts.ownProperties)),d(f),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(l);function u(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};TC.default=vte});var Xk=H(wC=>{"use strict";p();Object.defineProperty(wC,"__esModule",{value:!0});var zk=Wo(),j0=Ze(),Hk=Mt(),Wk=Mt(),qk,Zk,xte={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,zk.allSchemaProperties)(r),l=a.filter(I=>(0,Hk.alwaysValidSchema)(i,r[I]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof j0.Name)&&(i.props=(0,Wk.evaluatedPropsToName)(t,i.props));let{props:f}=i;h();function h(){for(let I of a)u&&b(I),i.allErrors?v(I):(t.var(d,!0),v(I),t.if(d))}function b(I){for(let x in u)new RegExp(I).test(x)&&(0,Hk.checkStrictMode)(i,"property ".concat(x," matches pattern ").concat(I," (use allowMatchingProperties)"))}function v(I){t.forIn("key",n,x=>{t.if((0,j0._)(qk||(qk=E(["",".test(",")"])),(0,zk.usePattern)(e,I),x),()=>{let C=l.includes(I);C||e.subschema({keyword:"patternProperties",schemaProp:I,dataProp:x,dataPropType:Wk.Type.Str},d),i.opts.unevaluated&&f!==!0?t.assign((0,j0._)(Zk||(Zk=E(["","[","]"])),f,x),!0):!C&&!i.allErrors&&t.if((0,j0.not)(d),()=>t.break())})})}}};wC.default=xte});var Yk=H(MC=>{"use strict";p();Object.defineProperty(MC,"__esModule",{value:!0});var Ite=Mt(),Ste={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,Ite.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};MC.default=Ste});var Kk=H(OC=>{"use strict";p();Object.defineProperty(OC,"__esModule",{value:!0});var Cte=Wo(),Pte={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Cte.validateUnion,error:{message:"must match a schema in anyOf"}};OC.default=Pte});var tD=H(EC=>{"use strict";p();Object.defineProperty(EC,"__esModule",{value:!0});var G0=Ze(),Tte=Mt(),Jk,wte={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,G0._)(Jk||(Jk=E(["{passingSchemas: ","}"])),e.passing)},Qk,eD,Mte={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:wte,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,f)=>{let h;(0,Tte.alwaysValidSchema)(o,d)?t.var(l,!0):h=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&t.if((0,G0._)(Qk||(Qk=E([""," && ",""])),l,s)).assign(s,!1).assign(a,(0,G0._)(eD||(eD=E(["[",", ","]"])),a,f)).else(),t.if(l,()=>{t.assign(s,!0),t.assign(a,f),h&&e.mergeEvaluated(h,G0.Name)})})}}};EC.default=Mte});var rD=H(_C=>{"use strict";p();Object.defineProperty(_C,"__esModule",{value:!0});var Ote=Mt(),Ete={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,s)=>{if((0,Ote.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};_C.default=Ete});var lD=H(AC=>{"use strict";p();Object.defineProperty(AC,"__esModule",{value:!0});var U0=Ze(),aD=Mt(),oD,iD,_te={message:({params:e})=>(0,U0.str)(oD||(oD=E(['must match "','" schema'])),e.ifClause),params:({params:e})=>(0,U0._)(iD||(iD=E(["{failingKeyword: ","}"])),e.ifClause)},sD,Ate={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:_te,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,aD.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=nD(n,"then"),i=nD(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),o&&i){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else o?t.if(a,u("then")):t.if((0,U0.not)(a),u("else"));e.pass(s,()=>e.error(!0));function l(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,f){return()=>{let h=e.subschema({keyword:d},a);t.assign(s,a),e.mergeValidEvaluated(h,s),f?t.assign(f,(0,U0._)(sD||(sD=E(["",""])),d)):e.setParams({ifClause:d})}}}};function nD(e,t){let r=e.schema[t];return r!==void 0&&!(0,aD.alwaysValidSchema)(e,r)}AC.default=Ate});var cD=H(kC=>{"use strict";p();Object.defineProperty(kC,"__esModule",{value:!0});var kte=Mt(),Dte={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,kte.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};kC.default=Dte});var uD=H(DC=>{"use strict";p();Object.defineProperty(DC,"__esModule",{value:!0});var Fte=hC(),Lte=ck(),Rte=yC(),Nte=fk(),Bte=wk(),$te=kk(),jte=Lk(),Gte=CC(),Ute=Vk(),Vte=Xk(),zte=Yk(),Hte=Kk(),Wte=tD(),qte=rD(),Zte=lD(),Xte=cD();function Yte(e=!1){let t=[zte.default,Hte.default,Wte.default,qte.default,Zte.default,Xte.default,jte.default,Gte.default,$te.default,Ute.default,Vte.default];return e?t.push(Lte.default,Nte.default):t.push(Fte.default,Rte.default),t.push(Bte.default),t}DC.default=Yte});var OD=H(FC=>{"use strict";p();Object.defineProperty(FC,"__esModule",{value:!0});var Mr=Ze(),pD,dD,Kte={message:({schemaCode:e})=>(0,Mr.str)(pD||(pD=E(['must match format "','"'])),e),params:({schemaCode:e})=>(0,Mr._)(dD||(dD=E(["{format: ","}"])),e)},fD,mD,hD,yD,gD,bD,vD,xD,ID,SD,CD,PD,TD,wD,MD,Jte={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Kte,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=a;if(!l.validateFormats)return;o?h():b();function h(){let v=r.scopeValue("formats",{ref:f.formats,code:l.code.formats}),I=r.const("fDef",(0,Mr._)(fD||(fD=E(["","[","]"])),v,s)),x=r.let("fType"),C=r.let("format");r.if((0,Mr._)(mD||(mD=E(["typeof ",' == "object" && !('," instanceof RegExp)"])),I,I),()=>r.assign(x,(0,Mr._)(hD||(hD=E(["",'.type || "string"'])),I)).assign(C,(0,Mr._)(yD||(yD=E(["",".validate"])),I)),()=>r.assign(x,(0,Mr._)(gD||(gD=E(['"string"'])))).assign(C,I)),e.fail$data((0,Mr.or)(P(),w()));function P(){return l.strictSchema===!1?Mr.nil:(0,Mr._)(bD||(bD=E([""," && !",""])),s,C)}function w(){let T=d.$async?(0,Mr._)(vD||(vD=E(["(",".async ? await ","(",") : ","(","))"])),I,C,n,C,n):(0,Mr._)(xD||(xD=E(["","(",")"])),C,n),O=(0,Mr._)(ID||(ID=E(["(typeof ",' == "function" ? '," : ",".test(","))"])),C,T,C,n);return(0,Mr._)(SD||(SD=E([""," && "," !== true && "," === "," && !",""])),C,C,x,t,O)}}function b(){let v=f.formats[i];if(!v){P();return}if(v===!0)return;let[I,x,C]=w(v);I===t&&e.pass(T());function P(){if(l.strictSchema===!1){f.logger.warn(O());return}throw new Error(O());function O(){return'unknown format "'.concat(i,'" ignored in schema at path "').concat(u,'"')}}function w(O){let N=O instanceof RegExp?(0,Mr.regexpCode)(O):l.code.formats?(0,Mr._)(CD||(CD=E(["","",""])),l.code.formats,(0,Mr.getProperty)(i)):void 0,k=r.scopeValue("formats",{key:i,ref:O,code:N});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,Mr._)(PD||(PD=E(["",".validate"])),k)]:["string",O,k]}function T(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Mr._)(TD||(TD=E(["await ","(",")"])),C,n)}return typeof x=="function"?(0,Mr._)(wD||(wD=E(["","(",")"])),C,n):(0,Mr._)(MD||(MD=E(["",".test(",")"])),C,n)}}}};FC.default=Jte});var ED=H(LC=>{"use strict";p();Object.defineProperty(LC,"__esModule",{value:!0});var Qte=OD(),ere=[Qte.default];LC.default=ere});var _D=H(Hd=>{"use strict";p();Object.defineProperty(Hd,"__esModule",{value:!0});Hd.contentVocabulary=Hd.metadataVocabulary=void 0;Hd.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Hd.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kD=H(RC=>{"use strict";p();Object.defineProperty(RC,"__esModule",{value:!0});var tre=V8(),rre=JA(),nre=uD(),ore=ED(),AD=_D(),ire=[tre.default,rre.default,(0,nre.default)(),ore.default,AD.metadataVocabulary,AD.contentVocabulary];RC.default=ire});var FD=H(V0=>{"use strict";p();Object.defineProperty(V0,"__esModule",{value:!0});V0.DiscrError=void 0;var DD;(function(e){e.Tag="tag",e.Mapping="mapping"})(DD||(V0.DiscrError=DD={}))});var jD=H(BC=>{"use strict";p();Object.defineProperty(BC,"__esModule",{value:!0});var Wd=Ze(),NC=FD(),LD=T0(),sre=Wh(),are=Mt(),RD,lre={message:({params:{discrError:e,tagName:t}})=>e===NC.DiscrError.Tag?'tag "'.concat(t,'" must be string'):'value of tag "'.concat(t,'" must be in oneOf'),params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Wd._)(RD||(RD=E(["{error: ",", tag: ",", tagValue: ","}"])),e,r,t)},ND,BD,$D,cre={keyword:"discriminator",type:"object",schemaType:"object",error:lre,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let l=t.let("valid",!1),u=t.const("tag",(0,Wd._)(ND||(ND=E(["","",""])),r,(0,Wd.getProperty)(a)));t.if((0,Wd._)(BD||(BD=E(["typeof ",' == "string"'])),u),()=>d(),()=>e.error(!1,{discrError:NC.DiscrError.Tag,tag:u,tagName:a})),e.ok(l);function d(){let b=h();t.if(!1);for(let v in b)t.elseIf((0,Wd._)($D||($D=E([""," === ",""])),u,v)),t.assign(l,f(b[v]));t.else(),e.error(!1,{discrError:NC.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function f(b){let v=t.name("valid"),I=e.subschema({keyword:"oneOf",schemaProp:b},v);return e.mergeEvaluated(I,Wd.Name),v}function h(){var b;let v={},I=C(o),x=!0;for(let T=0;T<s.length;T++){let O=s[T];if(O!=null&&O.$ref&&!(0,are.schemaHasRulesButRef)(O,i.self.RULES)){let k=O.$ref;if(O=LD.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,k),O instanceof LD.SchemaEnv&&(O=O.schema),O===void 0)throw new sre.default(i.opts.uriResolver,i.baseId,k)}let N=(b=O==null?void 0:O.properties)===null||b===void 0?void 0:b[a];if(typeof N!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(a,'"'));x=x&&(I||C(O)),P(N,T)}if(!x)throw new Error('discriminator: "'.concat(a,'" must be required'));return v;function C({required:T}){return Array.isArray(T)&&T.includes(a)}function P(T,O){if(T.const)w(T.const,O);else if(T.enum)for(let N of T.enum)w(N,O);else throw new Error('discriminator: "properties/'.concat(a,'" must have "const" or "enum"'))}function w(T,O){if(typeof T!="string"||T in v)throw new Error('discriminator: "'.concat(a,'" values must be unique strings'));v[T]=O}}}};BC.default=cre});var GD=H((U5e,ure)=>{ure.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var jC=H((tr,$C)=>{"use strict";p();Object.defineProperty(tr,"__esModule",{value:!0});tr.MissingRefError=tr.ValidationError=tr.CodeGen=tr.Name=tr.nil=tr.stringify=tr.str=tr._=tr.KeywordCxt=tr.Ajv=void 0;var pre=O8(),dre=kD(),fre=jD(),UD=GD(),mre=["/properties"],z0="http://json-schema.org/draft-07/schema",qd=class extends pre.default{_addVocabularies(){super._addVocabularies(),dre.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(fre.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(UD,mre):UD;this.addMetaSchema(t,z0,!1),this.refs["http://json-schema.org/schema"]=z0}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(z0)?z0:void 0)}};tr.Ajv=qd;$C.exports=tr=qd;$C.exports.Ajv=qd;Object.defineProperty(tr,"__esModule",{value:!0});tr.default=qd;var hre=Hh();Object.defineProperty(tr,"KeywordCxt",{enumerable:!0,get:function(){return hre.KeywordCxt}});var Zd=Ze();Object.defineProperty(tr,"_",{enumerable:!0,get:function(){return Zd._}});Object.defineProperty(tr,"str",{enumerable:!0,get:function(){return Zd.str}});Object.defineProperty(tr,"stringify",{enumerable:!0,get:function(){return Zd.stringify}});Object.defineProperty(tr,"nil",{enumerable:!0,get:function(){return Zd.nil}});Object.defineProperty(tr,"Name",{enumerable:!0,get:function(){return Zd.Name}});Object.defineProperty(tr,"CodeGen",{enumerable:!0,get:function(){return Zd.CodeGen}});var yre=C0();Object.defineProperty(tr,"ValidationError",{enumerable:!0,get:function(){return yre.default}});var gre=Wh();Object.defineProperty(tr,"MissingRefError",{enumerable:!0,get:function(){return gre.default}})});var ZD=H(Ms=>{"use strict";p();Object.defineProperty(Ms,"__esModule",{value:!0});Ms.formatNames=Ms.fastFormats=Ms.fullFormats=void 0;function Xd(e,t){return{validate:e,compare:t}}Ms.fullFormats={date:Xd(HD,VC),time:Xd(WD,zC),"date-time":Xd(Ire,qD),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Pre,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Are,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Tre,int32:{type:"number",validate:Ore},int64:{type:"number",validate:Ere},float:{type:"number",validate:zD},double:{type:"number",validate:zD},password:!0,binary:!0};Ms.fastFormats={...Ms.fullFormats,date:Xd(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,VC),time:Xd(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,zC),"date-time":Xd(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,qD),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Ms.formatNames=Object.keys(Ms.fullFormats);function bre(e){return e%4===0&&(e%100!==0||e%400===0)}var vre=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,xre=[0,31,28,31,30,31,30,31,31,30,31,30,31];function HD(e){let t=vre.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&bre(r)?29:xre[n])}function VC(e,t){if(e&&t)return e>t?1:e<t?-1:0}var GC=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function WD(e,t){let r=GC.exec(e);if(!r)return!1;let n=+r[1],o=+r[2],i=+r[3],s=r[5];return(n<=23&&o<=59&&i<=59||n===23&&o===59&&i===60)&&(!t||s!=="")}function zC(e,t){if(!(e&&t))return;let r=GC.exec(e),n=GC.exec(t);if(r&&n)return e=r[1]+r[2]+r[3]+(r[4]||""),t=n[1]+n[2]+n[3]+(n[4]||""),e>t?1:e<t?-1:0}var UC=/t|\s/i;function Ire(e){let t=e.split(UC);return t.length===2&&HD(t[0])&&WD(t[1],!0)}function qD(e,t){if(!(e&&t))return;let[r,n]=e.split(UC),[o,i]=t.split(UC),s=VC(r,o);if(s!==void 0)return s||zC(n,i)}var Sre=/\/|:/,Cre=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Pre(e){return Sre.test(e)&&Cre.test(e)}var VD=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Tre(e){return VD.lastIndex=0,VD.test(e)}var wre=-(2**31),Mre=2**31-1;function Ore(e){return Number.isInteger(e)&&e<=Mre&&e>=wre}function Ere(e){return Number.isInteger(e)}function zD(){return!0}var _re=/[^\\]\\Z/;function Are(e){if(_re.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var nF=H(Yd=>{"use strict";p();Object.defineProperty(Yd,"__esModule",{value:!0});Yd.formatLimitDefinition=void 0;var kre=jC(),Di=Ze(),Ql=Di.operators,H0={formatMaximum:{okStr:"<=",ok:Ql.LTE,fail:Ql.GT},formatMinimum:{okStr:">=",ok:Ql.GTE,fail:Ql.LT},formatExclusiveMaximum:{okStr:"<",ok:Ql.LT,fail:Ql.GTE},formatExclusiveMinimum:{okStr:">",ok:Ql.GT,fail:Ql.LTE}},XD,YD,Dre={message:({keyword:e,schemaCode:t})=>Di.str(XD||(XD=E(["should be "," ",""])),H0[e].okStr,t),params:({keyword:e,schemaCode:t})=>Di._(YD||(YD=E(["{comparison: ",", limit: ","}"])),H0[e].okStr,t)},KD,JD,QD,eF,tF,rF;Yd.formatLimitDefinition={keyword:Object.keys(H0),type:"string",schemaType:"string",$data:!0,error:Dre,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let l=new kre.KeywordCxt(i,a.RULES.all.format.definition,"format");l.$data?u():d();function u(){let h=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),b=t.const("fmt",Di._(KD||(KD=E(["","[","]"])),h,l.schemaCode));e.fail$data(Di.or(Di._(JD||(JD=E(["typeof ",' != "object"'])),b),Di._(QD||(QD=E([""," instanceof RegExp"])),b),Di._(eF||(eF=E(["typeof ",'.compare != "function"'])),b),f(b)))}function d(){let h=l.schema,b=a.formats[h];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error('"'.concat(o,'": format "').concat(h,'" does not define "compare" function'));let v=t.scopeValue("formats",{key:h,ref:b,code:s.code.formats?Di._(tF||(tF=E(["","",""])),s.code.formats,Di.getProperty(h)):void 0});e.fail$data(f(v))}function f(h){return Di._(rF||(rF=E(["",".compare(",", ",") "," 0"])),h,r,n,H0[o].fail)}},dependencies:["format"]};var Fre=e=>(e.addKeyword(Yd.formatLimitDefinition),e);Yd.default=Fre});var lF=H((sy,aF)=>{"use strict";p();Object.defineProperty(sy,"__esModule",{value:!0});var Kd=ZD(),Lre=nF(),HC=Ze(),oF=new HC.Name("fullFormats"),Rre=new HC.Name("fastFormats"),WC=(e,t={keywords:!0})=>{if(Array.isArray(t))return iF(e,t,Kd.fullFormats,oF),e;let[r,n]=t.mode==="fast"?[Kd.fastFormats,Rre]:[Kd.fullFormats,oF],o=t.formats||Kd.formatNames;return iF(e,o,r,n),t.keywords&&Lre.default(e),e};WC.get=(e,t="full")=>{let n=(t==="fast"?Kd.fastFormats:Kd.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};var sF;function iF(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=HC._(sF||(sF=E(['require("ajv-formats/dist/formats").',""])),n));for(let s of t)e.addFormat(s,r[s])}aF.exports=sy=WC;Object.defineProperty(sy,"__esModule",{value:!0});sy.default=WC});var q$=H((bYe,sw)=>{"use strict";p();var wx=UY();wx.default&&(wx=wx.default);sw.exports=W$;sw.exports.default=W$;function W$(e,t,r){t=t||1;for(var n,o,i,s,a=0;a<e[0].length;a++){var l=e[0][a];(!a||l[0]<n)&&(n=l[0]),(!a||l[1]<o)&&(o=l[1]),(!a||l[0]>i)&&(i=l[0]),(!a||l[1]>s)&&(s=l[1])}var u=i-n,d=s-o,f=Math.min(u,d),h=f/2;if(f===0){var b=[n,o];return b.distance=0,b}for(var v=new wx(void 0,kfe),I=n;I<i;I+=f)for(var x=o;x<s;x+=f)v.push(new uc(I+h,x+h,h,e));var C=Ffe(e),P=new uc(n+u/2,o+d/2,0,e);P.d>C.d&&(C=P);for(var w=v.length;v.length;){var T=v.pop();T.d>C.d&&(C=T,r&&console.log("found best %d after %d probes",Math.round(1e4*T.d)/1e4,w)),!(T.max-C.d<=t)&&(h=T.h/2,v.push(new uc(T.x-h,T.y-h,h,e)),v.push(new uc(T.x+h,T.y-h,h,e)),v.push(new uc(T.x-h,T.y+h,h,e)),v.push(new uc(T.x+h,T.y+h,h,e)),w+=4)}r&&(console.log("num probes: "+w),console.log("best distance: "+C.d));var O=[C.x,C.y];return O.distance=C.d,O}function kfe(e,t){return t.max-e.max}function uc(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=Dfe(e,t,n),this.max=this.d+this.h*Math.SQRT2}function Dfe(e,t,r){for(var n=!1,o=1/0,i=0;i<r.length;i++)for(var s=r[i],a=0,l=s.length,u=l-1;a<l;u=a++){var d=s[a],f=s[u];d[1]>t!=f[1]>t&&e<(f[0]-d[0])*(t-d[1])/(f[1]-d[1])+d[0]&&(n=!n),o=Math.min(o,Lfe(e,t,d,f))}return o===0?0:(n?1:-1)*Math.sqrt(o)}function Ffe(e){for(var t=0,r=0,n=0,o=e[0],i=0,s=o.length,a=s-1;i<s;a=i++){var l=o[i],u=o[a],d=l[0]*u[1]-u[0]*l[1];r+=(l[0]+u[0])*d,n+=(l[1]+u[1])*d,t+=d*3}return t===0?new uc(o[0][0],o[0][1],0,e):new uc(r/t,n/t,0,e)}function Lfe(e,t,r,n){var o=r[0],i=r[1],s=n[0]-o,a=n[1]-i;if(s!==0||a!==0){var l=((e-o)*s+(t-i)*a)/(s*s+a*a);l>1?(o=n[0],i=n[1]):l>0&&(o+=s*l,i+=a*l)}return s=e-o,a=t-i,s*s+a*a}});var yj=H((vw,xw)=>{p();(function(e,t){typeof vw=="object"&&typeof xw<"u"?xw.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(vw,function(){"use strict";function e(x,C,P,w,T){(function O(N,k,D,F,z){for(;F>D;){if(F-D>600){var G=F-D+1,j=k-D+1,K=Math.log(G),Z=.5*Math.exp(2*K/3),oe=.5*Math.sqrt(K*Z*(G-Z)/G)*(j-G/2<0?-1:1),Q=Math.max(D,Math.floor(k-j*Z/G+oe)),ye=Math.min(F,Math.floor(k+(G-j)*Z/G+oe));O(N,k,Q,ye,z)}var be=N[k],ue=D,_e=F;for(t(N,D,k),z(N[F],be)>0&&t(N,D,F);ue<_e;){for(t(N,ue,_e),ue++,_e--;z(N[ue],be)<0;)ue++;for(;z(N[_e],be)>0;)_e--}z(N[D],be)===0?t(N,D,_e):t(N,++_e,F),_e<=k&&(D=_e+1),k<=_e&&(F=_e-1)}})(x,C,P||0,w||x.length-1,T||r)}function t(x,C,P){var w=x[C];x[C]=x[P],x[P]=w}function r(x,C){return x<C?-1:x>C?1:0}var n=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(x,C,P){if(!P)return C.indexOf(x);for(var w=0;w<C.length;w++)if(P(x,C[w]))return w;return-1}function i(x,C){s(x,0,x.children.length,C,x)}function s(x,C,P,w,T){T||(T=v(null)),T.minX=1/0,T.minY=1/0,T.maxX=-1/0,T.maxY=-1/0;for(var O=C;O<P;O++){var N=x.children[O];a(T,x.leaf?w(N):N)}return T}function a(x,C){return x.minX=Math.min(x.minX,C.minX),x.minY=Math.min(x.minY,C.minY),x.maxX=Math.max(x.maxX,C.maxX),x.maxY=Math.max(x.maxY,C.maxY),x}function l(x,C){return x.minX-C.minX}function u(x,C){return x.minY-C.minY}function d(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function f(x){return x.maxX-x.minX+(x.maxY-x.minY)}function h(x,C){return x.minX<=C.minX&&x.minY<=C.minY&&C.maxX<=x.maxX&&C.maxY<=x.maxY}function b(x,C){return C.minX<=x.maxX&&C.minY<=x.maxY&&C.maxX>=x.minX&&C.maxY>=x.minY}function v(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(x,C,P,w,T){for(var O=[C,P];O.length;)if(!((P=O.pop())-(C=O.pop())<=w)){var N=C+Math.ceil((P-C)/w/2)*w;e(x,N,C,P,T),O.push(C,N,N,P)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(x){var C=this.data,P=[];if(!b(x,C))return P;for(var w=this.toBBox,T=[];C;){for(var O=0;O<C.children.length;O++){var N=C.children[O],k=C.leaf?w(N):N;b(x,k)&&(C.leaf?P.push(N):h(x,k)?this._all(N,P):T.push(N))}C=T.pop()}return P},n.prototype.collides=function(x){var C=this.data;if(!b(x,C))return!1;for(var P=[];C;){for(var w=0;w<C.children.length;w++){var T=C.children[w],O=C.leaf?this.toBBox(T):T;if(b(x,O)){if(C.leaf||h(x,O))return!0;P.push(T)}}C=P.pop()}return!1},n.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var C=0;C<x.length;C++)this.insert(x[C]);return this}var P=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===P.height)this._splitRoot(this.data,P);else{if(this.data.height<P.height){var w=this.data;this.data=P,P=w}this._insert(P,this.data.height-P.height-1,!0)}else this.data=P;return this},n.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},n.prototype.clear=function(){return this.data=v([]),this},n.prototype.remove=function(x,C){if(!x)return this;for(var P,w,T,O=this.data,N=this.toBBox(x),k=[],D=[];O||k.length;){if(O||(O=k.pop(),w=k[k.length-1],P=D.pop(),T=!0),O.leaf){var F=o(x,O.children,C);if(F!==-1)return O.children.splice(F,1),k.push(O),this._condense(k),this}T||O.leaf||!h(O,N)?w?(P++,O=w.children[P],T=!1):O=null:(k.push(O),D.push(P),P=0,w=O,O=O.children[0])}return this},n.prototype.toBBox=function(x){return x},n.prototype.compareMinX=function(x,C){return x.minX-C.minX},n.prototype.compareMinY=function(x,C){return x.minY-C.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(x){return this.data=x,this},n.prototype._all=function(x,C){for(var P=[];x;)x.leaf?C.push.apply(C,x.children):P.push.apply(P,x.children),x=P.pop();return C},n.prototype._build=function(x,C,P,w){var T,O=P-C+1,N=this._maxEntries;if(O<=N)return i(T=v(x.slice(C,P+1)),this.toBBox),T;w||(w=Math.ceil(Math.log(O)/Math.log(N)),N=Math.ceil(O/Math.pow(N,w-1))),(T=v([])).leaf=!1,T.height=w;var k=Math.ceil(O/N),D=k*Math.ceil(Math.sqrt(N));I(x,C,P,D,this.compareMinX);for(var F=C;F<=P;F+=D){var z=Math.min(F+D-1,P);I(x,F,z,k,this.compareMinY);for(var G=F;G<=z;G+=k){var j=Math.min(G+k-1,z);T.children.push(this._build(x,G,j,w-1))}}return i(T,this.toBBox),T},n.prototype._chooseSubtree=function(x,C,P,w){for(;w.push(C),!C.leaf&&w.length-1!==P;){for(var T=1/0,O=1/0,N=void 0,k=0;k<C.children.length;k++){var D=C.children[k],F=d(D),z=(G=x,j=D,(Math.max(j.maxX,G.maxX)-Math.min(j.minX,G.minX))*(Math.max(j.maxY,G.maxY)-Math.min(j.minY,G.minY))-F);z<O?(O=z,T=F<T?F:T,N=D):z===O&&F<T&&(T=F,N=D)}C=N||C.children[0]}var G,j;return C},n.prototype._insert=function(x,C,P){var w=P?x:this.toBBox(x),T=[],O=this._chooseSubtree(w,this.data,C,T);for(O.children.push(x),a(O,w);C>=0&&T[C].children.length>this._maxEntries;)this._split(T,C),C--;this._adjustParentBBoxes(w,T,C)},n.prototype._split=function(x,C){var P=x[C],w=P.children.length,T=this._minEntries;this._chooseSplitAxis(P,T,w);var O=this._chooseSplitIndex(P,T,w),N=v(P.children.splice(O,P.children.length-O));N.height=P.height,N.leaf=P.leaf,i(P,this.toBBox),i(N,this.toBBox),C?x[C-1].children.push(N):this._splitRoot(P,N)},n.prototype._splitRoot=function(x,C){this.data=v([x,C]),this.data.height=x.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(x,C,P){for(var w,T,O,N,k,D,F,z=1/0,G=1/0,j=C;j<=P-C;j++){var K=s(x,0,j,this.toBBox),Z=s(x,j,P,this.toBBox),oe=(T=K,O=Z,N=void 0,k=void 0,D=void 0,F=void 0,N=Math.max(T.minX,O.minX),k=Math.max(T.minY,O.minY),D=Math.min(T.maxX,O.maxX),F=Math.min(T.maxY,O.maxY),Math.max(0,D-N)*Math.max(0,F-k)),Q=d(K)+d(Z);oe<z?(z=oe,w=j,G=Q<G?Q:G):oe===z&&Q<G&&(G=Q,w=j)}return w||P-C},n.prototype._chooseSplitAxis=function(x,C,P){var w=x.leaf?this.compareMinX:l,T=x.leaf?this.compareMinY:u;this._allDistMargin(x,C,P,w)<this._allDistMargin(x,C,P,T)&&x.children.sort(w)},n.prototype._allDistMargin=function(x,C,P,w){x.children.sort(w);for(var T=this.toBBox,O=s(x,0,C,T),N=s(x,P-C,P,T),k=f(O)+f(N),D=C;D<P-C;D++){var F=x.children[D];a(O,x.leaf?T(F):F),k+=f(O)}for(var z=P-C-1;z>=C;z--){var G=x.children[z];a(N,x.leaf?T(G):G),k+=f(N)}return k},n.prototype._adjustParentBBoxes=function(x,C,P){for(var w=P;w>=0;w--)a(C[w],x)},n.prototype._condense=function(x){for(var C=x.length-1,P=void 0;C>=0;C--)x[C].children.length===0?C>0?(P=x[C-1].children).splice(P.indexOf(x[C]),1):this.clear():i(x[C],this.toBBox)},n})});var Tw=H(ke=>{"use strict";p();Object.defineProperty(ke,"__esModule",{value:!0});ke.earthRadius=63710088e-1;ke.factors={centimeters:ke.earthRadius*100,centimetres:ke.earthRadius*100,degrees:ke.earthRadius/111325,feet:ke.earthRadius*3.28084,inches:ke.earthRadius*39.37,kilometers:ke.earthRadius/1e3,kilometres:ke.earthRadius/1e3,meters:ke.earthRadius,metres:ke.earthRadius,miles:ke.earthRadius/1609.344,millimeters:ke.earthRadius*1e3,millimetres:ke.earthRadius*1e3,nauticalmiles:ke.earthRadius/1852,radians:1,yards:ke.earthRadius*1.0936};ke.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/ke.earthRadius,yards:1.0936133};ke.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 dc(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}ke.feature=dc;function Ime(e,t,r){switch(r===void 0&&(r={}),e){case"Point":return Iw(t).geometry;case"LineString":return Cw(t).geometry;case"Polygon":return Sw(t).geometry;case"MultiPoint":return bj(t).geometry;case"MultiLineString":return gj(t).geometry;case"MultiPolygon":return vj(t).geometry;default:throw new Error(e+" is invalid")}}ke.geometry=Ime;function Iw(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!kx(e[0])||!kx(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return dc(n,t,r)}ke.point=Iw;function Sme(e,t,r){return r===void 0&&(r={}),Dx(e.map(function(n){return Iw(n,t)}),r)}ke.points=Sme;function Sw(e,t,r){r===void 0&&(r={});for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<i[i.length-1].length;s++)if(i[i.length-1][s]!==i[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:e};return dc(a,t,r)}ke.polygon=Sw;function Cme(e,t,r){return r===void 0&&(r={}),Dx(e.map(function(n){return Sw(n,t)}),r)}ke.polygons=Cme;function Cw(e,t,r){if(r===void 0&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:e};return dc(n,t,r)}ke.lineString=Cw;function Pme(e,t,r){return r===void 0&&(r={}),Dx(e.map(function(n){return Cw(n,t)}),r)}ke.lineStrings=Pme;function Dx(e,t){t===void 0&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}ke.featureCollection=Dx;function gj(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return dc(n,t,r)}ke.multiLineString=gj;function bj(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return dc(n,t,r)}ke.multiPoint=bj;function vj(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return dc(n,t,r)}ke.multiPolygon=vj;function Tme(e,t,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:e};return dc(n,t,r)}ke.geometryCollection=Tme;function wme(e,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r}ke.round=wme;function xj(e,t){t===void 0&&(t="kilometers");var r=ke.factors[t];if(!r)throw new Error(t+" units is invalid");return e*r}ke.radiansToLength=xj;function Pw(e,t){t===void 0&&(t="kilometers");var r=ke.factors[t];if(!r)throw new Error(t+" units is invalid");return e/r}ke.lengthToRadians=Pw;function Mme(e,t){return Ij(Pw(e,t))}ke.lengthToDegrees=Mme;function Ome(e){var t=e%360;return t<0&&(t+=360),t}ke.bearingToAzimuth=Ome;function Ij(e){var t=e%(2*Math.PI);return t*180/Math.PI}ke.radiansToDegrees=Ij;function Eme(e){var t=e%360;return t*Math.PI/180}ke.degreesToRadians=Eme;function _me(e,t,r){if(t===void 0&&(t="kilometers"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return xj(Pw(e,t),r)}ke.convertLength=_me;function Ame(e,t,r){if(t===void 0&&(t="meters"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("area must be a positive number");var n=ke.areaFactors[t];if(!n)throw new Error("invalid original units");var o=ke.areaFactors[r];if(!o)throw new Error("invalid final units");return e/n*o}ke.convertArea=Ame;function kx(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}ke.isNumber=kx;function kme(e){return!!e&&e.constructor===Object}ke.isObject=kme;function Dme(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(t){if(!kx(t))throw new Error("bbox must only contain numbers")})}ke.validateBBox=Dme;function Fme(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")}ke.validateId=Fme});var wj=H(Ur=>{"use strict";p();Object.defineProperty(Ur,"__esModule",{value:!0});var kn=Tw();function Gy(e,t,r){if(e!==null)for(var n,o,i,s,a,l,u,d=0,f=0,h,b=e.type,v=b==="FeatureCollection",I=b==="Feature",x=v?e.features.length:1,C=0;C<x;C++){u=v?e.features[C].geometry:I?e.geometry:e,h=u?u.type==="GeometryCollection":!1,a=h?u.geometries.length:1;for(var P=0;P<a;P++){var w=0,T=0;if(s=h?u.geometries[P]:u,s!==null){l=s.coordinates;var O=s.type;switch(d=r&&(O==="Polygon"||O==="MultiPolygon")?1:0,O){case null:break;case"Point":if(t(l,f,C,w,T)===!1)return!1;f++,w++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(t(l[n],f,C,w,T)===!1)return!1;f++,O==="MultiPoint"&&w++}O==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-d;o++){if(t(l[n][o],f,C,w,T)===!1)return!1;f++}O==="MultiLineString"&&w++,O==="Polygon"&&T++}O==="Polygon"&&w++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(T=0,o=0;o<l[n].length;o++){for(i=0;i<l[n][o].length-d;i++){if(t(l[n][o][i],f,C,w,T)===!1)return!1;f++}T++}w++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(Gy(s.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Lme(e,t,r,n){var o=r;return Gy(e,function(i,s,a,l,u){s===0&&r===void 0?o=i:o=t(o,i,s,a,l,u)},n),o}function Sj(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&t(e.features[r].properties,r)!==!1;r++);break;case"Feature":t(e.properties,0);break}}function Rme(e,t,r){var n=r;return Sj(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}function Cj(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&t(e.features[r],r)!==!1;r++);}function Nme(e,t,r){var n=r;return Cj(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}function Bme(e){var t=[];return Gy(e,function(r){t.push(r)}),t}function ww(e,t){var r,n,o,i,s,a,l,u,d,f,h=0,b=e.type==="FeatureCollection",v=e.type==="Feature",I=b?e.features.length:1;for(r=0;r<I;r++){for(a=b?e.features[r].geometry:v?e.geometry:e,u=b?e.features[r].properties:v?e.properties:{},d=b?e.features[r].bbox:v?e.bbox:void 0,f=b?e.features[r].id:v?e.id:void 0,l=a?a.type==="GeometryCollection":!1,s=l?a.geometries.length:1,o=0;o<s;o++){if(i=l?a.geometries[o]:a,i===null){if(t(null,h,u,d,f)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(i,h,u,d,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(t(i.geometries[n],h,u,d,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function $me(e,t,r){var n=r;return ww(e,function(o,i,s,a,l){i===0&&r===void 0?n=o:n=t(n,o,i,s,a,l)}),n}function Fx(e,t){ww(e,function(r,n,o,i,s){var a=r===null?null:r.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return t(kn.feature(r,o,{bbox:i,id:s}),n,0)===!1?!1:void 0}var l;switch(a){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<r.coordinates.length;u++){var d=r.coordinates[u],f={type:l,coordinates:d};if(t(kn.feature(f,o),n,u)===!1)return!1}})}function jme(e,t,r){var n=r;return Fx(e,function(o,i,s){i===0&&s===0&&r===void 0?n=o:n=t(n,o,i,s)}),n}function Pj(e,t){Fx(e,function(r,n,o){var i=0;if(r.geometry){var s=r.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var a,l=0,u=0,d=0;if(Gy(r,function(f,h,b,v,I){if(a===void 0||n>l||v>u||I>d){a=f,l=n,u=v,d=I,i=0;return}var x=kn.lineString([a,f],r.properties);if(t(x,n,o,I,i)===!1)return!1;i++,a=f})===!1)return!1}}})}function Gme(e,t,r){var n=r,o=!1;return Pj(e,function(i,s,a,l,u){o===!1&&r===void 0?n=i:n=t(n,i,s,a,l,u),o=!0}),n}function Tj(e,t){if(!e)throw new Error("geojson is required");Fx(e,function(r,n,o){if(r.geometry!==null){var i=r.geometry.type,s=r.geometry.coordinates;switch(i){case"LineString":if(t(r,n,o,0,0)===!1)return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(t(kn.lineString(s[a],r.properties),n,o,a)===!1)return!1;break}}})}function Ume(e,t,r){var n=r;return Tj(e,function(o,i,s,a){i===0&&r===void 0?n=o:n=t(n,o,i,s,a)}),n}function Vme(e,t){if(t=t||{},!kn.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.segmentIndex||0,s=t.properties,a;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,a=e.features[r].geometry;break;case"Feature":s=s||e.properties,a=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=e;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var l=a.coordinates;switch(a.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=l.length+i-1),kn.lineString([l[i],l[i+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),i<0&&(i=l[o].length+i-1),kn.lineString([l[o][i],l[o][i+1]],s,t);case"MultiLineString":return n<0&&(n=l.length+n),i<0&&(i=l[n].length+i-1),kn.lineString([l[n][i],l[n][i+1]],s,t);case"MultiPolygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),i<0&&(i=l[n][o].length-i-1),kn.lineString([l[n][o][i],l[n][o][i+1]],s,t)}throw new Error("geojson is invalid")}function zme(e,t){if(t=t||{},!kn.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.coordIndex||0,s=t.properties,a;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,a=e.features[r].geometry;break;case"Feature":s=s||e.properties,a=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=e;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var l=a.coordinates;switch(a.type){case"Point":return kn.point(l,s,t);case"MultiPoint":return n<0&&(n=l.length+n),kn.point(l[n],s,t);case"LineString":return i<0&&(i=l.length+i),kn.point(l[i],s,t);case"Polygon":return o<0&&(o=l.length+o),i<0&&(i=l[o].length+i),kn.point(l[o][i],s,t);case"MultiLineString":return n<0&&(n=l.length+n),i<0&&(i=l[n].length+i),kn.point(l[n][i],s,t);case"MultiPolygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),i<0&&(i=l[n][o].length-i),kn.point(l[n][o][i],s,t)}throw new Error("geojson is invalid")}Ur.coordAll=Bme;Ur.coordEach=Gy;Ur.coordReduce=Lme;Ur.featureEach=Cj;Ur.featureReduce=Nme;Ur.findPoint=zme;Ur.findSegment=Vme;Ur.flattenEach=Fx;Ur.flattenReduce=jme;Ur.geomEach=ww;Ur.geomReduce=$me;Ur.lineEach=Tj;Ur.lineReduce=Ume;Ur.propEach=Sj;Ur.propReduce=Rme;Ur.segmentEach=Pj;Ur.segmentReduce=Gme});var Mw=H((UJe,Oj)=>{"use strict";p();var Mj=Object.prototype.toString;Oj.exports=function(t){var r=Mj.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Mj.call(t.callee)==="[object Function]"),n}});var Nj=H((zJe,Rj)=>{"use strict";p();var Lj;Object.keys||(Uy=Object.prototype.hasOwnProperty,Ow=Object.prototype.toString,Ej=Mw(),Ew=Object.prototype.propertyIsEnumerable,_j=!Ew.call({toString:null},"toString"),Aj=Ew.call(function(){},"prototype"),Vy=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Lx=function(e){var t=e.constructor;return t&&t.prototype===e},kj={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Dj=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!kj["$"+e]&&Uy.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Lx(window[e])}catch{return!0}}catch{return!0}return!1}(),Fj=function(e){if(typeof window>"u"||!Dj)return Lx(e);try{return Lx(e)}catch{return!1}},Lj=function(t){var r=t!==null&&typeof t=="object",n=Ow.call(t)==="[object Function]",o=Ej(t),i=r&&Ow.call(t)==="[object String]",s=[];if(!r&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var a=Aj&&n;if(i&&t.length>0&&!Uy.call(t,0))for(var l=0;l<t.length;++l)s.push(String(l));if(o&&t.length>0)for(var u=0;u<t.length;++u)s.push(String(u));else for(var d in t)!(a&&d==="prototype")&&Uy.call(t,d)&&s.push(String(d));if(_j)for(var f=Fj(t),h=0;h<Vy.length;++h)!(f&&Vy[h]==="constructor")&&Uy.call(t,Vy[h])&&s.push(Vy[h]);return s});var Uy,Ow,Ej,Ew,_j,Aj,Vy,Lx,kj,Dj,Fj;Rj.exports=Lj});var Nx=H((WJe,jj)=>{"use strict";p();var Hme=Array.prototype.slice,Wme=Mw(),Bj=Object.keys,Rx=Bj?function(t){return Bj(t)}:Nj(),$j=Object.keys;Rx.shim=function(){if(Object.keys){var t=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);t||(Object.keys=function(n){return Wme(n)?$j(Hme.call(n)):$j(n)})}else Object.keys=Rx;return Object.keys||Rx};jj.exports=Rx});var Uj=H((ZJe,Gj)=>{"use strict";p();Gj.exports=Error});var zj=H((YJe,Vj)=>{"use strict";p();Vj.exports=EvalError});var Wj=H((JJe,Hj)=>{"use strict";p();Hj.exports=RangeError});var Zj=H((eQe,qj)=>{"use strict";p();qj.exports=ReferenceError});var _w=H((rQe,Xj)=>{"use strict";p();Xj.exports=SyntaxError});var el=H((oQe,Yj)=>{"use strict";p();Yj.exports=TypeError});var Jj=H((sQe,Kj)=>{"use strict";p();Kj.exports=URIError});var zy=H((lQe,Qj)=>{"use strict";p();Qj.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==o||s.enumerable!==!0)return!1}return!0}});var Bx=H((uQe,tG)=>{"use strict";p();var eG=typeof Symbol<"u"&&Symbol,qme=zy();tG.exports=function(){return typeof eG!="function"||typeof Symbol!="function"||typeof eG("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:qme()}});var nG=H((dQe,rG)=>{"use strict";p();var Aw={__proto__:null,foo:{}},Zme=Object;rG.exports=function(){return{__proto__:Aw}.foo===Aw.foo&&!(Aw instanceof Zme)}});var sG=H((mQe,iG)=>{"use strict";p();var Xme="Function.prototype.bind called on incompatible ",Yme=Object.prototype.toString,Kme=Math.max,Jme="[object Function]",oG=function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var i=0;i<r.length;i+=1)n[i+t.length]=r[i];return n},Qme=function(t,r){for(var n=[],o=r||0,i=0;o<t.length;o+=1,i+=1)n[i]=t[o];return n},ehe=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};iG.exports=function(t){var r=this;if(typeof r!="function"||Yme.apply(r)!==Jme)throw new TypeError(Xme+r);for(var n=Qme(arguments,1),o,i=function(){if(this instanceof o){var d=r.apply(this,oG(n,arguments));return Object(d)===d?d:this}return r.apply(t,oG(n,arguments))},s=Kme(0,r.length-n.length),a=[],l=0;l<s;l++)a[l]="$"+l;if(o=Function("binder","return function ("+ehe(a,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var u=function(){};u.prototype=r.prototype,o.prototype=new u,u.prototype=null}return o}});var $x=H((yQe,aG)=>{"use strict";p();var the=sG();aG.exports=Function.prototype.bind||the});var kw=H((bQe,lG)=>{"use strict";p();var rhe=Function.prototype.call,nhe=Object.prototype.hasOwnProperty,ohe=$x();lG.exports=ohe.call(rhe,nhe)});var Hi=H((xQe,fG)=>{"use strict";p();var it,ihe=Uj(),she=zj(),ahe=Wj(),lhe=Zj(),Wf=_w(),Hf=el(),che=Jj(),dG=Function,Dw=function(e){try{return dG('"use strict"; return ('+e+").constructor;")()}catch{}},Ku=Object.getOwnPropertyDescriptor;if(Ku)try{Ku({},"")}catch{Ku=null}var Fw=function(){throw new Hf},uhe=Ku?function(){try{return arguments.callee,Fw}catch{try{return Ku(arguments,"callee").get}catch{return Fw}}}():Fw,Vf=Bx()(),phe=nG()(),Jr=Object.getPrototypeOf||(phe?function(e){return e.__proto__}:null),zf={},dhe=typeof Uint8Array>"u"||!Jr?it:Jr(Uint8Array),Ju={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?it:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?it:ArrayBuffer,"%ArrayIteratorPrototype%":Vf&&Jr?Jr([][Symbol.iterator]()):it,"%AsyncFromSyncIteratorPrototype%":it,"%AsyncFunction%":zf,"%AsyncGenerator%":zf,"%AsyncGeneratorFunction%":zf,"%AsyncIteratorPrototype%":zf,"%Atomics%":typeof Atomics>"u"?it:Atomics,"%BigInt%":typeof BigInt>"u"?it:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?it:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?it:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?it:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ihe,"%eval%":eval,"%EvalError%":she,"%Float32Array%":typeof Float32Array>"u"?it:Float32Array,"%Float64Array%":typeof Float64Array>"u"?it:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?it:FinalizationRegistry,"%Function%":dG,"%GeneratorFunction%":zf,"%Int8Array%":typeof Int8Array>"u"?it:Int8Array,"%Int16Array%":typeof Int16Array>"u"?it:Int16Array,"%Int32Array%":typeof Int32Array>"u"?it:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Vf&&Jr?Jr(Jr([][Symbol.iterator]())):it,"%JSON%":typeof JSON=="object"?JSON:it,"%Map%":typeof Map>"u"?it:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Vf||!Jr?it:Jr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?it:Promise,"%Proxy%":typeof Proxy>"u"?it:Proxy,"%RangeError%":ahe,"%ReferenceError%":lhe,"%Reflect%":typeof Reflect>"u"?it:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?it:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Vf||!Jr?it:Jr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?it:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Vf&&Jr?Jr(""[Symbol.iterator]()):it,"%Symbol%":Vf?Symbol:it,"%SyntaxError%":Wf,"%ThrowTypeError%":uhe,"%TypedArray%":dhe,"%TypeError%":Hf,"%Uint8Array%":typeof Uint8Array>"u"?it:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?it:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?it:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?it:Uint32Array,"%URIError%":che,"%WeakMap%":typeof WeakMap>"u"?it:WeakMap,"%WeakRef%":typeof WeakRef>"u"?it:WeakRef,"%WeakSet%":typeof WeakSet>"u"?it:WeakSet};if(Jr)try{null.error}catch(e){cG=Jr(Jr(e)),Ju["%Error.prototype%"]=cG}var cG,fhe=function e(t){var r;if(t==="%AsyncFunction%")r=Dw("async function () {}");else if(t==="%GeneratorFunction%")r=Dw("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Dw("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Jr&&(r=Jr(o.prototype))}return Ju[t]=r,r},uG={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Hy=$x(),jx=kw(),mhe=Hy.call(Function.call,Array.prototype.concat),hhe=Hy.call(Function.apply,Array.prototype.splice),pG=Hy.call(Function.call,String.prototype.replace),Gx=Hy.call(Function.call,String.prototype.slice),yhe=Hy.call(Function.call,RegExp.prototype.exec),ghe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,bhe=/\\(\\)?/g,vhe=function(t){var r=Gx(t,0,1),n=Gx(t,-1);if(r==="%"&&n!=="%")throw new Wf("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Wf("invalid intrinsic syntax, expected opening `%`");var o=[];return pG(t,ghe,function(i,s,a,l){o[o.length]=a?pG(l,bhe,"$1"):s||i}),o},xhe=function(t,r){var n=t,o;if(jx(uG,n)&&(o=uG[n],n="%"+o[0]+"%"),jx(Ju,n)){var i=Ju[n];if(i===zf&&(i=fhe(n)),typeof i>"u"&&!r)throw new Hf("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new Wf("intrinsic "+t+" does not exist!")};fG.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new Hf("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Hf('"allowMissing" argument must be a boolean');if(yhe(/^%?[^%]*%?$/,t)===null)throw new Wf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=vhe(t),o=n.length>0?n[0]:"",i=xhe("%"+o+"%",r),s=i.name,a=i.value,l=!1,u=i.alias;u&&(o=u[0],hhe(n,mhe([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var h=n[d],b=Gx(h,0,1),v=Gx(h,-1);if((b==='"'||b==="'"||b==="`"||v==='"'||v==="'"||v==="`")&&b!==v)throw new Wf("property names with quotes must have matching quotes");if((h==="constructor"||!f)&&(l=!0),o+="."+h,s="%"+o+"%",jx(Ju,s))a=Ju[s];else if(a!=null){if(!(h in a)){if(!r)throw new Hf("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ku&&d+1>=n.length){var I=Ku(a,h);f=!!I,f&&"get"in I&&!("originalValue"in I.get)?a=I.get:a=a[h]}else f=jx(a,h),a=a[h];f&&!l&&(Ju[s]=a)}}return a}});var Vx=H((SQe,mG)=>{"use strict";p();var Ihe=Hi(),Ux=Ihe("%Object.defineProperty%",!0)||!1;if(Ux)try{Ux({},"a",{value:1})}catch{Ux=!1}mG.exports=Ux});var Hx=H((PQe,hG)=>{"use strict";p();var She=Hi(),zx=She("%Object.getOwnPropertyDescriptor%",!0);if(zx)try{zx([],"length")}catch{zx=null}hG.exports=zx});var Wx=H((wQe,bG)=>{"use strict";p();var yG=Vx(),Che=_w(),qf=el(),gG=Hx();bG.exports=function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new qf("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new qf("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new qf("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new qf("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new qf("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new qf("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,l=!!gG&&gG(t,r);if(yG)yG(t,r,{configurable:s===null&&l?l.configurable:!s,enumerable:o===null&&l?l.enumerable:!o,value:n,writable:i===null&&l?l.writable:!i});else if(a||!o&&!i&&!s)t[r]=n;else throw new Che("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var qx=H((OQe,xG)=>{"use strict";p();var Lw=Vx(),vG=function(){return!!Lw};vG.hasArrayLengthDefineBug=function(){if(!Lw)return null;try{return Lw([],"length",{value:1}).length!==1}catch{return!0}};xG.exports=vG});var fc=H((_Qe,PG)=>{"use strict";p();var Phe=Nx(),The=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",whe=Object.prototype.toString,Mhe=Array.prototype.concat,IG=Wx(),Ohe=function(e){return typeof e=="function"&&whe.call(e)==="[object Function]"},SG=qx()(),Ehe=function(e,t,r,n){if(t in e){if(n===!0){if(e[t]===r)return}else if(!Ohe(n)||!n())return}SG?IG(e,t,r,!0):IG(e,t,r)},CG=function(e,t){var r=arguments.length>2?arguments[2]:{},n=Phe(t);The&&(n=Mhe.call(n,Object.getOwnPropertySymbols(t)));for(var o=0;o<n.length;o+=1)Ehe(e,n[o],t[n[o]],r[n[o]])};CG.supportsDescriptors=!!SG;PG.exports=CG});var EG=H((kQe,OG)=>{"use strict";p();var _he=Hi(),TG=Wx(),Ahe=qx()(),wG=Hx(),MG=el(),khe=_he("%Math.floor%");OG.exports=function(t,r){if(typeof t!="function")throw new MG("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||khe(r)!==r)throw new MG("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,i=!0;if("length"in t&&wG){var s=wG(t,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(i=!1)}return(o||i||!n)&&(Ahe?TG(t,"length",r,!0,!0):TG(t,"length",r)),t}});var Qu=H((FQe,Zx)=>{"use strict";p();var Rw=$x(),Xx=Hi(),Dhe=EG(),Fhe=el(),kG=Xx("%Function.prototype.apply%"),DG=Xx("%Function.prototype.call%"),FG=Xx("%Reflect.apply%",!0)||Rw.call(DG,kG),_G=Vx(),Lhe=Xx("%Math.max%");Zx.exports=function(t){if(typeof t!="function")throw new Fhe("a function is required");var r=FG(Rw,DG,arguments);return Dhe(r,1+Lhe(0,t.length-(arguments.length-1)),!0)};var AG=function(){return FG(Rw,kG,arguments)};_G?_G(Zx.exports,"apply",{value:AG}):Zx.exports.apply=AG});var Fo=H((RQe,NG)=>{"use strict";p();var LG=Hi(),RG=Qu(),Rhe=RG(LG("String.prototype.indexOf"));NG.exports=function(t,r){var n=LG(t,!!r);return typeof n=="function"&&Rhe(t,".prototype.")>-1?RG(n):n}});var Nw=H((BQe,UG)=>{"use strict";p();var Nhe=Nx(),jG=zy()(),GG=Fo(),BG=Object,Bhe=GG("Array.prototype.push"),$G=GG("Object.prototype.propertyIsEnumerable"),$he=jG?Object.getOwnPropertySymbols:null;UG.exports=function(t,r){if(t==null)throw new TypeError("target must be an object");var n=BG(t);if(arguments.length===1)return n;for(var o=1;o<arguments.length;++o){var i=BG(arguments[o]),s=Nhe(i),a=jG&&(Object.getOwnPropertySymbols||$he);if(a)for(var l=a(i),u=0;u<l.length;++u){var d=l[u];$G(i,d)&&Bhe(s,d)}for(var f=0;f<s.length;++f){var h=s[f];if($G(i,h)){var b=i[h];n[h]=b}}}return n}});var $w=H((jQe,VG)=>{"use strict";p();var Bw=Nw(),jhe=function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var o=Object.assign({},r),i="";for(var s in o)i+=s;return e!==i},Ghe=function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch{return e[1]==="y"}return!1};VG.exports=function(){return!Object.assign||jhe()||Ghe()?Bw:Object.assign}});var HG=H((UQe,zG)=>{"use strict";p();var Uhe=fc(),Vhe=$w();zG.exports=function(){var t=Vhe();return Uhe(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t}});var XG=H((zQe,ZG)=>{"use strict";p();var zhe=fc(),Hhe=Qu(),Whe=Nw(),WG=$w(),qhe=HG(),Zhe=Hhe.apply(WG()),qG=function(t,r){return Zhe(Object,arguments)};zhe(qG,{getPolyfill:WG,implementation:Whe,shim:qhe});ZG.exports=qG});var KG=H((WQe,YG)=>{"use strict";p();var qy=function(){return typeof(function(){}).name=="string"},Wy=Object.getOwnPropertyDescriptor;if(Wy)try{Wy([],"length")}catch{Wy=null}qy.functionsHaveConfigurableNames=function(){if(!qy()||!Wy)return!1;var t=Wy(function(){},"name");return!!t&&!!t.configurable};var Xhe=Function.prototype.bind;qy.boundFunctionsHaveNames=function(){return qy()&&typeof Xhe=="function"&&(function(){}).bind().name!==""};YG.exports=qy});var eU=H((ZQe,QG)=>{"use strict";p();var JG=Wx(),Yhe=qx()(),Khe=KG().functionsHaveConfigurableNames(),Jhe=el();QG.exports=function(t,r){if(typeof t!="function")throw new Jhe("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||Khe)&&(Yhe?JG(t,"name",r,!0,!0):JG(t,"name",r)),t}});var jw=H((YQe,tU)=>{"use strict";p();var Qhe=eU(),eye=el(),tye=Object;tU.exports=Qhe(function(){if(this==null||this!==tye(this))throw new eye("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var Gw=H((JQe,rU)=>{"use strict";p();var rye=jw(),nye=fc().supportsDescriptors,oye=Object.getOwnPropertyDescriptor;rU.exports=function(){if(nye&&/a/mig.flags==="gim"){var t=oye(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(n,"sticky",{get:function(){r+="y"}}),r==="dy")return t.get}}return rye}});var iU=H((eet,oU)=>{"use strict";p();var iye=fc().supportsDescriptors,sye=Gw(),aye=Object.getOwnPropertyDescriptor,lye=Object.defineProperty,cye=TypeError,nU=Object.getPrototypeOf,uye=/a/;oU.exports=function(){if(!iye||!nU)throw new cye("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=sye(),r=nU(uye),n=aye(r,"flags");return(!n||n.get!==t)&&lye(r,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var cU=H((ret,lU)=>{"use strict";p();var pye=fc(),dye=Qu(),fye=jw(),sU=Gw(),mye=iU(),aU=dye(sU());pye(aU,{getPolyfill:sU,implementation:fye,shim:mye});lU.exports=aU});var mc=H((oet,uU)=>{"use strict";p();var hye=zy();uU.exports=function(){return hye()&&!!Symbol.toStringTag}});var Vw=H((set,dU)=>{"use strict";p();var yye=mc()(),gye=Fo(),Uw=gye("Object.prototype.toString"),Yx=function(t){return yye&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Uw(t)==="[object Arguments]"},pU=function(t){return Yx(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Uw(t)!=="[object Array]"&&Uw(t.callee)==="[object Function]"},bye=function(){return Yx(arguments)}();Yx.isLegacyArguments=pU;dU.exports=bye?Yx:pU});var fU=H(()=>{p()});var DU=H((det,kU)=>{p();var Qw=typeof Map=="function"&&Map.prototype,zw=Object.getOwnPropertyDescriptor&&Qw?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Jx=Qw&&zw&&typeof zw.get=="function"?zw.get:null,mU=Qw&&Map.prototype.forEach,eM=typeof Set=="function"&&Set.prototype,Hw=Object.getOwnPropertyDescriptor&&eM?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Qx=eM&&Hw&&typeof Hw.get=="function"?Hw.get:null,hU=eM&&Set.prototype.forEach,vye=typeof WeakMap=="function"&&WeakMap.prototype,Xy=vye?WeakMap.prototype.has:null,xye=typeof WeakSet=="function"&&WeakSet.prototype,Yy=xye?WeakSet.prototype.has:null,Iye=typeof WeakRef=="function"&&WeakRef.prototype,yU=Iye?WeakRef.prototype.deref:null,Sye=Boolean.prototype.valueOf,Cye=Object.prototype.toString,Pye=Function.prototype.toString,Tye=String.prototype.match,tM=String.prototype.slice,yc=String.prototype.replace,wye=String.prototype.toUpperCase,gU=String.prototype.toLowerCase,wU=RegExp.prototype.test,bU=Array.prototype.concat,Hs=Array.prototype.join,Mye=Array.prototype.slice,vU=Math.floor,Zw=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ww=Object.getOwnPropertySymbols,Xw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Zf=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Dn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Zf||!0)?Symbol.toStringTag:null,MU=Object.prototype.propertyIsEnumerable,xU=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function IU(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||wU.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-vU(-e):vU(e);if(n!==e){var o=String(n),i=tM.call(t,o.length+1);return yc.call(o,r,"$&_")+"."+yc.call(yc.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yc.call(t,r,"$&_")}var Yw=fU(),SU=Yw.custom,CU=EU(SU)?SU:null;kU.exports=function e(t,r,n,o){var i=r||{};if(hc(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(hc(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=hc(i,"customInspect")?i.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(hc(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(hc(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=i.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return AU(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return a?IU(t,l):l}if(typeof t=="bigint"){var u=String(t)+"n";return a?IU(t,u):u}var d=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=d&&d>0&&typeof t=="object")return Kw(t)?"[Array]":"[Object]";var f=Hye(i,n);if(typeof o>"u")o=[];else if(_U(o,t)>=0)return"[Circular]";function h(K,Z,oe){if(Z&&(o=Mye.call(o),o.push(Z)),oe){var Q={depth:i.depth};return hc(i,"quoteStyle")&&(Q.quoteStyle=i.quoteStyle),e(K,Q,n+1,o)}return e(K,i,n+1,o)}if(typeof t=="function"&&!PU(t)){var b=Rye(t),v=Kx(t,h);return"[Function"+(b?": "+b:" (anonymous)")+"]"+(v.length>0?" { "+Hs.call(v,", ")+" }":"")}if(EU(t)){var I=Zf?yc.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Xw.call(t);return typeof t=="object"&&!Zf?Zy(I):I}if(Uye(t)){for(var x="<"+gU.call(String(t.nodeName)),C=t.attributes||[],P=0;P<C.length;P++)x+=" "+C[P].name+"="+OU(Oye(C[P].value),"double",i);return x+=">",t.childNodes&&t.childNodes.length&&(x+="..."),x+="</"+gU.call(String(t.nodeName))+">",x}if(Kw(t)){if(t.length===0)return"[]";var w=Kx(t,h);return f&&!zye(w)?"["+Jw(w,f)+"]":"[ "+Hs.call(w,", ")+" ]"}if(_ye(t)){var T=Kx(t,h);return!("cause"in Error.prototype)&&"cause"in t&&!MU.call(t,"cause")?"{ ["+String(t)+"] "+Hs.call(bU.call("[cause]: "+h(t.cause),T),", ")+" }":T.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Hs.call(T,", ")+" }"}if(typeof t=="object"&&s){if(CU&&typeof t[CU]=="function"&&Yw)return Yw(t,{depth:d-n});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Nye(t)){var O=[];return mU&&mU.call(t,function(K,Z){O.push(h(Z,t,!0)+" => "+h(K,t))}),TU("Map",Jx.call(t),O,f)}if(jye(t)){var N=[];return hU&&hU.call(t,function(K){N.push(h(K,t))}),TU("Set",Qx.call(t),N,f)}if(Bye(t))return qw("WeakMap");if(Gye(t))return qw("WeakSet");if($ye(t))return qw("WeakRef");if(kye(t))return Zy(h(Number(t)));if(Fye(t))return Zy(h(Zw.call(t)));if(Dye(t))return Zy(Sye.call(t));if(Aye(t))return Zy(h(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!Eye(t)&&!PU(t)){var k=Kx(t,h),D=xU?xU(t)===Object.prototype:t instanceof Object||t.constructor===Object,F=t instanceof Object?"":"null prototype",z=!D&&Dn&&Object(t)===t&&Dn in t?tM.call(gc(t),8,-1):F?"Object":"",G=D||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",j=G+(z||F?"["+Hs.call(bU.call([],z||[],F||[]),": ")+"] ":"");return k.length===0?j+"{}":f?j+"{"+Jw(k,f)+"}":j+"{ "+Hs.call(k,", ")+" }"}return String(t)};function OU(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function Oye(e){return yc.call(String(e),/"/g,"&quot;")}function Kw(e){return gc(e)==="[object Array]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function Eye(e){return gc(e)==="[object Date]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function PU(e){return gc(e)==="[object RegExp]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function _ye(e){return gc(e)==="[object Error]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function Aye(e){return gc(e)==="[object String]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function kye(e){return gc(e)==="[object Number]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function Dye(e){return gc(e)==="[object Boolean]"&&(!Dn||!(typeof e=="object"&&Dn in e))}function EU(e){if(Zf)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Xw)return!1;try{return Xw.call(e),!0}catch{}return!1}function Fye(e){if(!e||typeof e!="object"||!Zw)return!1;try{return Zw.call(e),!0}catch{}return!1}var Lye=Object.prototype.hasOwnProperty||function(e){return e in this};function hc(e,t){return Lye.call(e,t)}function gc(e){return Cye.call(e)}function Rye(e){if(e.name)return e.name;var t=Tye.call(Pye.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function _U(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function Nye(e){if(!Jx||!e||typeof e!="object")return!1;try{Jx.call(e);try{Qx.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Bye(e){if(!Xy||!e||typeof e!="object")return!1;try{Xy.call(e,Xy);try{Yy.call(e,Yy)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function $ye(e){if(!yU||!e||typeof e!="object")return!1;try{return yU.call(e),!0}catch{}return!1}function jye(e){if(!Qx||!e||typeof e!="object")return!1;try{Qx.call(e);try{Jx.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function Gye(e){if(!Yy||!e||typeof e!="object")return!1;try{Yy.call(e,Yy);try{Xy.call(e,Xy)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function Uye(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function AU(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return AU(tM.call(e,0,t.maxStringLength),t)+n}var o=yc.call(yc.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Vye);return OU(o,"single",t)}function Vye(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+wye.call(t.toString(16))}function Zy(e){return"Object("+e+")"}function qw(e){return e+" { ? }"}function TU(e,t,r,n){var o=n?Jw(r,n):Hs.call(r,", ");return e+" ("+t+") {"+o+"}"}function zye(e){for(var t=0;t<e.length;t++)if(_U(e[t],"\n")>=0)return!1;return!0}function Hye(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=Hs.call(Array(e.indent+1)," ");else return null;return{base:r,prev:Hs.call(Array(t+1),r)}}function Jw(e,t){if(e.length===0)return"";var r="\n"+t.prev+t.base;return r+Hs.call(e,","+r)+"\n"+t.prev}function Kx(e,t){var r=Kw(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=hc(e,o)?t(e[o],e):""}var i=typeof Ww=="function"?Ww(e):[],s;if(Zf){s={};for(var a=0;a<i.length;a++)s["$"+i[a]]=i[a]}for(var l in e)hc(e,l)&&(r&&String(Number(l))===l&&l<e.length||Zf&&s["$"+l]instanceof Symbol||(wU.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if(typeof Ww=="function")for(var u=0;u<i.length;u++)MU.call(e,i[u])&&n.push("["+t(i[u])+"]: "+t(e[i[u]],e));return n}});var nM=H((met,LU)=>{"use strict";p();var FU=Hi(),Xf=Fo(),Wye=DU(),qye=el(),e2=FU("%WeakMap%",!0),t2=FU("%Map%",!0),Zye=Xf("WeakMap.prototype.get",!0),Xye=Xf("WeakMap.prototype.set",!0),Yye=Xf("WeakMap.prototype.has",!0),Kye=Xf("Map.prototype.get",!0),Jye=Xf("Map.prototype.set",!0),Qye=Xf("Map.prototype.has",!0),rM=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},ege=function(e,t){var r=rM(e,t);return r&&r.value},tge=function(e,t,r){var n=rM(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},rge=function(e,t){return!!rM(e,t)};LU.exports=function(){var t,r,n,o={assert:function(i){if(!o.has(i))throw new qye("Side channel does not contain "+Wye(i))},get:function(i){if(e2&&i&&(typeof i=="object"||typeof i=="function")){if(t)return Zye(t,i)}else if(t2){if(r)return Kye(r,i)}else if(n)return ege(n,i)},has:function(i){if(e2&&i&&(typeof i=="object"||typeof i=="function")){if(t)return Yye(t,i)}else if(t2){if(r)return Qye(r,i)}else if(n)return rge(n,i);return!1},set:function(i,s){e2&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new e2),Xye(t,i,s)):t2?(r||(r=new t2),Jye(r,i,s)):(n||(n={key:{},next:null}),tge(n,i,s))}};return o}});var NU=H((yet,RU)=>{"use strict";p();var nge=kw(),Ky=nM()(),tl=el(),oM={assert:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new tl("`O` is not an object");if(typeof t!="string")throw new tl("`slot` must be a string");if(Ky.assert(e),!oM.has(e,t))throw new tl("`"+t+"` is not present on `O`")},get:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new tl("`O` is not an object");if(typeof t!="string")throw new tl("`slot` must be a string");var r=Ky.get(e);return r&&r["$"+t]},has:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new tl("`O` is not an object");if(typeof t!="string")throw new tl("`slot` must be a string");var r=Ky.get(e);return!!r&&nge(r,"$"+t)},set:function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new tl("`O` is not an object");if(typeof t!="string")throw new tl("`slot` must be a string");var n=Ky.get(e);n||(n={},Ky.set(e,n)),n["$"+t]=r}};Object.freeze&&Object.freeze(oM);RU.exports=oM});var jU=H((bet,$U)=>{"use strict";p();var Jy=NU(),oge=SyntaxError,BU=typeof StopIteration=="object"?StopIteration:null;$U.exports=function(t){if(!BU)throw new oge("this environment lacks StopIteration");Jy.set(t,"[[Done]]",!1);var r={next:function(){var o=Jy.get(this,"[[Iterator]]"),i=Jy.get(o,"[[Done]]");try{return{done:i,value:i?void 0:o.next()}}catch(s){if(Jy.set(o,"[[Done]]",!0),s!==BU)throw s;return{done:!0,value:void 0}}}};return Jy.set(r,"[[Iterator]]",t),r}});var iM=H((xet,GU)=>{p();var ige={}.toString;GU.exports=Array.isArray||function(e){return ige.call(e)=="[object Array]"}});var sM=H((Cet,UU)=>{"use strict";p();var sge=String.prototype.valueOf,age=function(t){try{return sge.call(t),!0}catch{return!1}},lge=Object.prototype.toString,cge="[object String]",uge=mc()();UU.exports=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:uge?age(t):lge.call(t)===cge}});var lM=H((Tet,HU)=>{"use strict";p();var aM=typeof Map=="function"&&Map.prototype?Map:null,pge=typeof Set=="function"&&Set.prototype?Set:null,r2;aM||(r2=function(t){return!1});var zU=aM?Map.prototype.has:null,VU=pge?Set.prototype.has:null;!r2&&!zU&&(r2=function(t){return!1});HU.exports=r2||function(t){if(!t||typeof t!="object")return!1;try{if(zU.call(t),VU)try{VU.call(t)}catch{return!0}return t instanceof aM}catch{}return!1}});var uM=H((Met,ZU)=>{"use strict";p();var dge=typeof Map=="function"&&Map.prototype?Map:null,cM=typeof Set=="function"&&Set.prototype?Set:null,n2;cM||(n2=function(t){return!1});var WU=dge?Map.prototype.has:null,qU=cM?Set.prototype.has:null;!n2&&!qU&&(n2=function(t){return!1});ZU.exports=n2||function(t){if(!t||typeof t!="object")return!1;try{if(qU.call(t),WU)try{WU.call(t)}catch{return!0}return t instanceof cM}catch{}return!1}});var sV=H((Eet,s2)=>{"use strict";p();var XU=Vw(),YU=jU();Bx()()||zy()()?(o2=Symbol.iterator,s2.exports=function(t){if(t!=null&&typeof t[o2]<"u")return t[o2]();if(XU(t))return Array.prototype[o2].call(t)}):(KU=iM(),JU=sM(),pM=Hi(),QU=pM("%Map%",!0),eV=pM("%Set%",!0),pi=Fo(),dM=pi("Array.prototype.push"),fM=pi("String.prototype.charCodeAt"),tV=pi("String.prototype.slice"),rV=function(t,r){var n=t.length;if(r+1>=n)return r+1;var o=fM(t,r);if(o<55296||o>56319)return r+1;var i=fM(t,r+1);return i<56320||i>57343?r+1:r+2},i2=function(t){var r=0;return{next:function(){var o=r>=t.length,i;return o||(i=t[r],r+=1),{done:o,value:i}}}},mM=function(t,r){if(KU(t)||XU(t))return i2(t);if(JU(t)){var n=0;return{next:function(){var i=rV(t,n),s=tV(t,n,i);return n=i,{done:i>t.length,value:s}}}}if(r&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},!QU&&!eV?s2.exports=function(t){if(t!=null)return mM(t,!0)}:(nV=lM(),oV=uM(),hM=pi("Map.prototype.forEach",!0),yM=pi("Set.prototype.forEach",!0),(typeof g>"u"||!g.versions||!g.versions.node)&&(gM=pi("Map.prototype.iterator",!0),bM=pi("Set.prototype.iterator",!0)),vM=pi("Map.prototype.@@iterator",!0)||pi("Map.prototype._es6-shim iterator_",!0),xM=pi("Set.prototype.@@iterator",!0)||pi("Set.prototype._es6-shim iterator_",!0),iV=function(t){if(nV(t)){if(gM)return YU(gM(t));if(vM)return vM(t);if(hM){var r=[];return hM(t,function(o,i){dM(r,[i,o])}),i2(r)}}if(oV(t)){if(bM)return YU(bM(t));if(xM)return xM(t);if(yM){var n=[];return yM(t,function(o){dM(n,o)}),i2(n)}}},s2.exports=function(t){return iV(t)||mM(t)}));var o2,KU,JU,pM,QU,eV,pi,dM,fM,tV,rV,i2,mM,nV,oV,hM,yM,gM,bM,vM,xM,iV});var IM=H((Aet,lV)=>{"use strict";p();var aV=function(e){return e!==e};lV.exports=function(t,r){return t===0&&r===0?1/t===1/r:!!(t===r||aV(t)&&aV(r))}});var SM=H((Det,cV)=>{"use strict";p();var fge=IM();cV.exports=function(){return typeof Object.is=="function"?Object.is:fge}});var pV=H((Let,uV)=>{"use strict";p();var mge=SM(),hge=fc();uV.exports=function(){var t=mge();return hge(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var hV=H((Net,mV)=>{"use strict";p();var yge=fc(),gge=Qu(),bge=IM(),dV=SM(),vge=pV(),fV=gge(dV(),Object);yge(fV,{getPolyfill:dV,implementation:bge,shim:vge});mV.exports=fV});var PM=H(($et,vV)=>{"use strict";p();var xge=Qu(),bV=Fo(),Ige=Hi(),CM=Ige("%ArrayBuffer%",!0),a2=bV("ArrayBuffer.prototype.byteLength",!0),Sge=bV("Object.prototype.toString"),yV=!!CM&&!a2&&new CM(0).slice,gV=!!yV&&xge(yV);vV.exports=a2||gV?function(t){if(!t||typeof t!="object")return!1;try{return a2?a2(t):gV(t,0),!0}catch{return!1}}:CM?function(t){return Sge(t)==="[object ArrayBuffer]"}:function(t){return!1}});var IV=H((Get,xV)=>{"use strict";p();var Cge=Date.prototype.getDay,Pge=function(t){try{return Cge.call(t),!0}catch{return!1}},Tge=Object.prototype.toString,wge="[object Date]",Mge=mc()();xV.exports=function(t){return typeof t!="object"||t===null?!1:Mge?Pge(t):Tge.call(t)===wge}});var wV=H((Vet,TV)=>{"use strict";p();var TM=Fo(),SV=mc()(),CV,PV,wM,MM;SV&&(CV=TM("Object.prototype.hasOwnProperty"),PV=TM("RegExp.prototype.exec"),wM={},l2=function(){throw wM},MM={toString:l2,valueOf:l2},typeof Symbol.toPrimitive=="symbol"&&(MM[Symbol.toPrimitive]=l2));var l2,Oge=TM("Object.prototype.toString"),Ege=Object.getOwnPropertyDescriptor,_ge="[object RegExp]";TV.exports=SV?function(t){if(!t||typeof t!="object")return!1;var r=Ege(t,"lastIndex"),n=r&&CV(r,"value");if(!n)return!1;try{PV(t,MM)}catch(o){return o===wM}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:Oge(t)===_ge}});var EV=H((Het,OV)=>{"use strict";p();var Age=Fo(),MV=Age("SharedArrayBuffer.prototype.byteLength",!0);OV.exports=MV?function(t){if(!t||typeof t!="object")return!1;try{return MV(t),!0}catch{return!1}}:function(t){return!1}});var AV=H((qet,_V)=>{"use strict";p();var kge=Number.prototype.toString,Dge=function(t){try{return kge.call(t),!0}catch{return!1}},Fge=Object.prototype.toString,Lge="[object Number]",Rge=mc()();_V.exports=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:Rge?Dge(t):Fge.call(t)===Lge}});var FV=H((Xet,DV)=>{"use strict";p();var kV=Fo(),Nge=kV("Boolean.prototype.toString"),Bge=kV("Object.prototype.toString"),$ge=function(t){try{return Nge(t),!0}catch{return!1}},jge="[object Boolean]",Gge=mc()();DV.exports=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:Gge&&Symbol.toStringTag in t?$ge(t):Bge(t)===jge}});var BV=H((Ket,OM)=>{"use strict";p();var Uge=Object.prototype.toString,Vge=Bx()();Vge?(LV=Symbol.prototype.toString,RV=/^Symbol\(.*\)$/,NV=function(t){return typeof t.valueOf()!="symbol"?!1:RV.test(LV.call(t))},OM.exports=function(t){if(typeof t=="symbol")return!0;if(Uge.call(t)!=="[object Symbol]")return!1;try{return NV(t)}catch{return!1}}):OM.exports=function(t){return!1};var LV,RV,NV});var GV=H((Qet,jV)=>{"use strict";p();var $V=typeof BigInt<"u"&&BigInt;jV.exports=function(){return typeof $V=="function"&&typeof BigInt=="function"&&typeof $V(42)=="bigint"&&typeof BigInt(42)=="bigint"}});var zV=H((ttt,EM)=>{"use strict";p();var zge=GV()();zge?(UV=BigInt.prototype.valueOf,VV=function(t){try{return UV.call(t),!0}catch{}return!1},EM.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:VV(t)}):EM.exports=function(t){return!1};var UV,VV});var WV=H((ntt,HV)=>{"use strict";p();var Hge=sM(),Wge=AV(),qge=FV(),Zge=BV(),Xge=zV();HV.exports=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(Hge(t))return"String";if(Wge(t))return"Number";if(qge(t))return"Boolean";if(Zge(t))return"Symbol";if(Xge(t))return"BigInt"}});var XV=H((itt,ZV)=>{"use strict";p();var c2=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,qV=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,u2;c2||(u2=function(t){return!1});var AM=c2?c2.prototype.has:null,_M=qV?qV.prototype.has:null;!u2&&!AM&&(u2=function(t){return!1});ZV.exports=u2||function(t){if(!t||typeof t!="object")return!1;try{if(AM.call(t,AM),_M)try{_M.call(t,_M)}catch{return!0}return t instanceof c2}catch{}return!1}});var KV=H((att,DM)=>{"use strict";p();var Yge=Hi(),YV=Fo(),Kge=Yge("%WeakSet%",!0),kM=YV("WeakSet.prototype.has",!0);kM?(p2=YV("WeakMap.prototype.has",!0),DM.exports=function(t){if(!t||typeof t!="object")return!1;try{if(kM(t,kM),p2)try{p2(t,p2)}catch{return!0}return t instanceof Kge}catch{}return!1}):DM.exports=function(t){return!1};var p2});var QV=H((ctt,JV)=>{"use strict";p();var Jge=lM(),Qge=uM(),ebe=XV(),tbe=KV();JV.exports=function(t){if(t&&typeof t=="object"){if(Jge(t))return"Map";if(Qge(t))return"Set";if(ebe(t))return"WeakMap";if(tbe(t))return"WeakSet"}return!1}});var nz=H((ptt,rz)=>{"use strict";p();var tz=Function.prototype.toString,Yf=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,LM,d2;if(typeof Yf=="function"&&typeof Object.defineProperty=="function")try{LM=Object.defineProperty({},"length",{get:function(){throw d2}}),d2={},Yf(function(){throw 42},null,LM)}catch(e){e!==d2&&(Yf=null)}else Yf=null;var rbe=/^\s*class\b/,RM=function(t){try{var r=tz.call(t);return rbe.test(r)}catch{return!1}},FM=function(t){try{return RM(t)?!1:(tz.call(t),!0)}catch{return!1}},f2=Object.prototype.toString,nbe="[object Object]",obe="[object Function]",ibe="[object GeneratorFunction]",sbe="[object HTMLAllCollection]",abe="[object HTML document.all class]",lbe="[object HTMLCollection]",cbe=typeof Symbol=="function"&&!!Symbol.toStringTag,ube=!(0 in[,]),NM=function(){return!1};typeof document=="object"&&(ez=document.all,f2.call(ez)===f2.call(document.all)&&(NM=function(t){if((ube||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=f2.call(t);return(r===sbe||r===abe||r===lbe||r===nbe)&&t("")==null}catch{}return!1}));var ez;rz.exports=Yf?function(t){if(NM(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Yf(t,null,LM)}catch(r){if(r!==d2)return!1}return!RM(t)&&FM(t)}:function(t){if(NM(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(cbe)return FM(t);if(RM(t))return!1;var r=f2.call(t);return r!==obe&&r!==ibe&&!/^\[object HTML/.test(r)?!1:FM(t)}});var sz=H((ftt,iz)=>{"use strict";p();var pbe=nz(),dbe=Object.prototype.toString,oz=Object.prototype.hasOwnProperty,fbe=function(t,r,n){for(var o=0,i=t.length;o<i;o++)oz.call(t,o)&&(n==null?r(t[o],o,t):r.call(n,t[o],o,t))},mbe=function(t,r,n){for(var o=0,i=t.length;o<i;o++)n==null?r(t.charAt(o),o,t):r.call(n,t.charAt(o),o,t)},hbe=function(t,r,n){for(var o in t)oz.call(t,o)&&(n==null?r(t[o],o,t):r.call(n,t[o],o,t))},ybe=function(t,r,n){if(!pbe(r))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=n),dbe.call(t)==="[object Array]"?fbe(t,r,o):typeof t=="string"?mbe(t,r,o):hbe(t,r,o)};iz.exports=ybe});var lz=H((htt,az)=>{"use strict";p();az.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var uz=H((gtt,cz)=>{"use strict";p();var BM=lz(),gbe=typeof globalThis>"u"?global:globalThis;cz.exports=function(){for(var t=[],r=0;r<BM.length;r++)typeof gbe[BM[r]]=="function"&&(t[t.length]=BM[r]);return t}});var hz=H((vtt,mz)=>{"use strict";p();var h2=sz(),bbe=uz(),pz=Qu(),GM=Fo(),m2=Hx(),vbe=GM("Object.prototype.toString"),fz=mc()(),dz=typeof globalThis>"u"?global:globalThis,jM=bbe(),UM=GM("String.prototype.slice"),$M=Object.getPrototypeOf,xbe=GM("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},y2={__proto__:null};fz&&m2&&$M?h2(jM,function(e){var t=new dz[e];if(Symbol.toStringTag in t){var r=$M(t),n=m2(r,Symbol.toStringTag);if(!n){var o=$M(r);n=m2(o,Symbol.toStringTag)}y2["$"+e]=pz(n.get)}}):h2(jM,function(e){var t=new dz[e],r=t.slice||t.set;r&&(y2["$"+e]=pz(r))});var Ibe=function(t){var r=!1;return h2(y2,function(n,o){if(!r)try{"$"+n(t)===o&&(r=UM(o,1))}catch{}}),r},Sbe=function(t){var r=!1;return h2(y2,function(n,o){if(!r)try{n(t),r=UM(o,1)}catch{}}),r};mz.exports=function(t){if(!t||typeof t!="object")return!1;if(!fz){var r=UM(vbe(t),8,-1);return xbe(jM,r)>-1?r:r!=="Object"?!1:Sbe(t)}return m2?Ibe(t):null}});var bz=H((Itt,gz)=>{"use strict";p();var Cbe=Fo(),yz=Cbe("ArrayBuffer.prototype.byteLength",!0),Pbe=PM();gz.exports=function(t){return Pbe(t)?yz?yz(t):t.byteLength:NaN}});var Vz=H((Ctt,Uz)=>{"use strict";p();var $z=XG(),Ws=Fo(),vz=cU(),Tbe=Hi(),Kf=sV(),wbe=nM(),xz=hV(),Iz=Vw(),Sz=iM(),Cz=PM(),Pz=IV(),Tz=wV(),wz=EV(),Mz=Nx(),Oz=WV(),Ez=QV(),_z=hz(),Az=bz(),kz=Ws("SharedArrayBuffer.prototype.byteLength",!0),Dz=Ws("Date.prototype.getTime"),VM=Object.getPrototypeOf,Fz=Ws("Object.prototype.toString"),b2=Tbe("%Set%",!0),zM=Ws("Map.prototype.has",!0),v2=Ws("Map.prototype.get",!0),Lz=Ws("Map.prototype.size",!0),x2=Ws("Set.prototype.add",!0),jz=Ws("Set.prototype.delete",!0),I2=Ws("Set.prototype.has",!0),g2=Ws("Set.prototype.size",!0);function Rz(e,t,r,n){for(var o=Kf(e),i;(i=o.next())&&!i.done;)if(Wi(t,i.value,r,n))return jz(e,i.value),!0;return!1}function Gz(e){if(typeof e>"u")return null;if(typeof e!="object")return typeof e=="symbol"?!1:typeof e=="string"||typeof e=="number"?+e==+e:!0}function Mbe(e,t,r,n,o,i){var s=Gz(r);if(s!=null)return s;var a=v2(t,s),l=$z({},o,{strict:!1});return typeof a>"u"&&!zM(t,s)||!Wi(n,a,l,i)?!1:!zM(e,s)&&Wi(n,a,l,i)}function Obe(e,t,r){var n=Gz(r);return n!=null?n:I2(t,n)&&!I2(e,n)}function Nz(e,t,r,n,o,i){for(var s=Kf(e),a,l;(a=s.next())&&!a.done;)if(l=a.value,Wi(r,l,o,i)&&Wi(n,v2(t,l),o,i))return jz(e,l),!0;return!1}function Wi(e,t,r,n){var o=r||{};if(o.strict?xz(e,t):e===t)return!0;var i=Oz(e),s=Oz(t);if(i!==s)return!1;if(!e||!t||typeof e!="object"&&typeof t!="object")return o.strict?xz(e,t):e==t;var a=n.has(e),l=n.has(t),u;if(a&&l){if(n.get(e)===n.get(t))return!0}else u={};return a||n.set(e,u),l||n.set(t,u),Abe(e,t,o,n)}function Bz(e){return!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function Ebe(e,t,r,n){if(g2(e)!==g2(t))return!1;for(var o=Kf(e),i=Kf(t),s,a,l;(s=o.next())&&!s.done;)if(s.value&&typeof s.value=="object")l||(l=new b2),x2(l,s.value);else if(!I2(t,s.value)){if(r.strict||!Obe(e,t,s.value))return!1;l||(l=new b2),x2(l,s.value)}if(l){for(;(a=i.next())&&!a.done;)if(a.value&&typeof a.value=="object"){if(!Rz(l,a.value,r.strict,n))return!1}else if(!r.strict&&!I2(e,a.value)&&!Rz(l,a.value,r.strict,n))return!1;return g2(l)===0}return!0}function _be(e,t,r,n){if(Lz(e)!==Lz(t))return!1;for(var o=Kf(e),i=Kf(t),s,a,l,u,d,f;(s=o.next())&&!s.done;)if(u=s.value[0],d=s.value[1],u&&typeof u=="object")l||(l=new b2),x2(l,u);else if(f=v2(t,u),typeof f>"u"&&!zM(t,u)||!Wi(d,f,r,n)){if(r.strict||!Mbe(e,t,u,d,r,n))return!1;l||(l=new b2),x2(l,u)}if(l){for(;(a=i.next())&&!a.done;)if(u=a.value[0],f=a.value[1],u&&typeof u=="object"){if(!Nz(l,e,u,f,r,n))return!1}else if(!r.strict&&(!e.has(u)||!Wi(v2(e,u),f,r,n))&&!Nz(l,e,u,f,$z({},r,{strict:!1}),n))return!1;return g2(l)===0}return!0}function Abe(e,t,r,n){var o,i;if(typeof e!=typeof t||e==null||t==null||Fz(e)!==Fz(t)||Iz(e)!==Iz(t))return!1;var s=Sz(e),a=Sz(t);if(s!==a)return!1;var l=e instanceof Error,u=t instanceof Error;if(l!==u||(l||u)&&(e.name!==t.name||e.message!==t.message))return!1;var d=Tz(e),f=Tz(t);if(d!==f||(d||f)&&(e.source!==t.source||vz(e)!==vz(t)))return!1;var h=Pz(e),b=Pz(t);if(h!==b||(h||b)&&Dz(e)!==Dz(t)||r.strict&&VM&&VM(e)!==VM(t))return!1;var v=_z(e),I=_z(t);if(v!==I)return!1;if(v||I){if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var x=Bz(e),C=Bz(t);if(x!==C)return!1;if(x||C){if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var P=Cz(e),w=Cz(t);if(P!==w)return!1;if(P||w)return Az(e)!==Az(t)?!1:typeof Uint8Array=="function"&&Wi(new Uint8Array(e),new Uint8Array(t),r,n);var T=wz(e),O=wz(t);if(T!==O)return!1;if(T||O)return kz(e)!==kz(t)?!1:typeof Uint8Array=="function"&&Wi(new Uint8Array(e),new Uint8Array(t),r,n);if(typeof e!=typeof t)return!1;var N=Mz(e),k=Mz(t);if(N.length!==k.length)return!1;for(N.sort(),k.sort(),o=N.length-1;o>=0;o--)if(N[o]!=k[o])return!1;for(o=N.length-1;o>=0;o--)if(i=N[o],!Wi(e[i],t[i],r,n))return!1;var D=Ez(e),F=Ez(t);return D!==F?!1:D==="Set"||F==="Set"?Ebe(e,t,r,n):D==="Map"?_be(e,t,r,n):!0}Uz.exports=function(t,r,n){return Wi(t,r,n,wbe())}});var iH=H(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0});function kbe(e){return e&&e.__esModule?e:{default:e}}var Dbe=Object.defineProperty,$t=(e,t)=>Dbe(e,"name",{value:t,configurable:!0}),Fbe=Vz(),Lbe=kbe(Fbe),zz=class{constructor(t){this.direction=!1,this.compareProperties=!0;var r,n,o;this.precision=10**-((r=t==null?void 0:t.precision)!=null?r:17),this.direction=(n=t==null?void 0:t.direction)!=null?n:!1,this.compareProperties=(o=t==null?void 0:t.compareProperties)!=null?o:!0}compare(t,r){if(t.type!==r.type||!Qy(t,r))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,r.coordinates);case"LineString":return this.compareLine(t.coordinates,r.coordinates);case"Polygon":return this.comparePolygon(t,r);case"GeometryCollection":return this.compareGeometryCollection(t,r);case"Feature":return this.compareFeature(t,r);case"FeatureCollection":return this.compareFeatureCollection(t,r);default:if(t.type.startsWith("Multi")){let n=HM(t),o=HM(r);return n.every(i=>o.some(s=>this.compare(i,s)))}}return!1}compareCoord(t,r){return t.length===r.length&&t.every((n,o)=>Math.abs(n-r[o])<this.precision)}compareLine(t,r,n=0,o=!1){if(!Qy(t,r))return!1;let i=t,s=r;if(o&&!this.compareCoord(i[0],s[0])){let l=this.fixStartIndex(s,i);if(l)s=l;else return!1}let a=this.compareCoord(i[n],s[n]);return this.direction||a?this.comparePath(i,s):this.compareCoord(i[n],s[s.length-(1+n)])?this.comparePath(i.slice().reverse(),s):!1}fixStartIndex(t,r){let n,o=-1;for(let i=0;i<t.length;i++)if(this.compareCoord(t[i],r[0])){o=i;break}return o>=0&&(n=[].concat(t.slice(o,t.length),t.slice(1,o+1))),n}comparePath(t,r){return t.every((n,o)=>this.compareCoord(n,r[o]))}comparePolygon(t,r){if(this.compareLine(t.coordinates[0],r.coordinates[0],1,!0)){let n=t.coordinates.slice(1,t.coordinates.length),o=r.coordinates.slice(1,r.coordinates.length);return n.every(i=>o.some(s=>this.compareLine(i,s,1,!0)))}return!1}compareGeometryCollection(t,r){return Qy(t.geometries,r.geometries)&&this.compareBBox(t,r)&&t.geometries.every((n,o)=>this.compare(n,r.geometries[o]))}compareFeature(t,r){return t.id===r.id&&(this.compareProperties?Lbe.default.call(void 0,t.properties,r.properties):!0)&&this.compareBBox(t,r)&&this.compare(t.geometry,r.geometry)}compareFeatureCollection(t,r){return Qy(t.features,r.features)&&this.compareBBox(t,r)&&t.features.every((n,o)=>this.compare(n,r.features[o]))}compareBBox(t,r){return!t.bbox&&!r.bbox||(t.bbox&&r.bbox?this.compareCoord(t.bbox,r.bbox):!1)}};$t(zz,"GeojsonEquality");var Rbe=zz;function Qy(e,t){return e.coordinates?e.coordinates.length===t.coordinates.length:e.length===t.length}$t(Qy,"sameLength");function HM(e){return e.coordinates.map(t=>({type:e.type.replace("Multi",""),coordinates:t}))}$t(HM,"explode");var yo=63710088e-1,qM={centimeters:yo*100,centimetres:yo*100,degrees:360/(2*Math.PI),feet:yo*3.28084,inches:yo*39.37,kilometers:yo/1e3,kilometres:yo/1e3,meters:yo,metres:yo,miles:yo/1609.344,millimeters:yo*1e3,millimetres:yo*1e3,nauticalmiles:yo/1852,radians:1,yards:yo*1.0936},WM={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,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function rl(e,t,r={}){let n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}$t(rl,"feature");function Hz(e,t,r={}){switch(e){case"Point":return S2(t).geometry;case"LineString":return P2(t).geometry;case"Polygon":return C2(t).geometry;case"MultiPoint":return XM(t).geometry;case"MultiLineString":return ZM(t).geometry;case"MultiPolygon":return YM(t).geometry;default:throw new Error(e+" is invalid")}}$t(Hz,"geometry");function S2(e,t,r={}){if(!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(!eg(e[0])||!eg(e[1]))throw new Error("coordinates must contain numbers");return rl({type:"Point",coordinates:e},t,r)}$t(S2,"point");function Wz(e,t,r={}){return tg(e.map(n=>S2(n,t)),r)}$t(Wz,"points");function C2(e,t,r={}){for(let o of e){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(let i=0;i<o[o.length-1].length;i++)if(o[o.length-1][i]!==o[0][i])throw new Error("First and last Position are not equivalent.")}return rl({type:"Polygon",coordinates:e},t,r)}$t(C2,"polygon");function qz(e,t,r={}){return tg(e.map(n=>C2(n,t)),r)}$t(qz,"polygons");function P2(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return rl({type:"LineString",coordinates:e},t,r)}$t(P2,"lineString");function Zz(e,t,r={}){return tg(e.map(n=>P2(n,t)),r)}$t(Zz,"lineStrings");function tg(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}$t(tg,"featureCollection");function ZM(e,t,r={}){return rl({type:"MultiLineString",coordinates:e},t,r)}$t(ZM,"multiLineString");function XM(e,t,r={}){return rl({type:"MultiPoint",coordinates:e},t,r)}$t(XM,"multiPoint");function YM(e,t,r={}){return rl({type:"MultiPolygon",coordinates:e},t,r)}$t(YM,"multiPolygon");function Xz(e,t,r={}){return rl({type:"GeometryCollection",geometries:e},t,r)}$t(Xz,"geometryCollection");function Yz(e,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");let r=Math.pow(10,t||0);return Math.round(e*r)/r}$t(Yz,"round");function KM(e,t="kilometers"){let r=qM[t];if(!r)throw new Error(t+" units is invalid");return e*r}$t(KM,"radiansToLength");function T2(e,t="kilometers"){let r=qM[t];if(!r)throw new Error(t+" units is invalid");return e/r}$t(T2,"lengthToRadians");function Kz(e,t){return JM(T2(e,t))}$t(Kz,"lengthToDegrees");function Jz(e){let t=e%360;return t<0&&(t+=360),t}$t(Jz,"bearingToAzimuth");function JM(e){return e%(2*Math.PI)*180/Math.PI}$t(JM,"radiansToDegrees");function Qz(e){return e%360*Math.PI/180}$t(Qz,"degreesToRadians");function eH(e,t="kilometers",r="kilometers"){if(!(e>=0))throw new Error("length must be a positive number");return KM(T2(e,t),r)}$t(eH,"convertLength");function tH(e,t="meters",r="kilometers"){if(!(e>=0))throw new Error("area must be a positive number");let n=WM[t];if(!n)throw new Error("invalid original units");let o=WM[r];if(!o)throw new Error("invalid final units");return e/n*o}$t(tH,"convertArea");function eg(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}$t(eg,"isNumber");function rH(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}$t(rH,"isObject");function nH(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(t=>{if(!eg(t))throw new Error("bbox must only contain numbers")})}$t(nH,"validateBBox");function oH(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")}$t(oH,"validateId");At.GeojsonEquality=Rbe;At.areaFactors=WM;At.bearingToAzimuth=Jz;At.convertArea=tH;At.convertLength=eH;At.degreesToRadians=Qz;At.earthRadius=yo;At.factors=qM;At.feature=rl;At.featureCollection=tg;At.geometry=Hz;At.geometryCollection=Xz;At.isNumber=eg;At.isObject=rH;At.lengthToDegrees=Kz;At.lengthToRadians=T2;At.lineString=P2;At.lineStrings=Zz;At.multiLineString=ZM;At.multiPoint=XM;At.multiPolygon=YM;At.point=S2;At.points=Wz;At.polygon=C2;At.polygons=qz;At.radiansToDegrees=JM;At.radiansToLength=KM;At.round=Yz;At.validateBBox=nH;At.validateId=oH});var yH=H(Vr=>{"use strict";p();Object.defineProperty(Vr,"__esModule",{value:!0});var Nbe=Object.defineProperty,dn=(e,t)=>Nbe(e,"name",{value:t,configurable:!0}),Fn=iH();function Jf(e,t,r){if(e!==null)for(var n,o,i,s,a,l,u,d=0,f=0,h,b=e.type,v=b==="FeatureCollection",I=b==="Feature",x=v?e.features.length:1,C=0;C<x;C++){u=v?e.features[C].geometry:I?e.geometry:e,h=u?u.type==="GeometryCollection":!1,a=h?u.geometries.length:1;for(var P=0;P<a;P++){var w=0,T=0;if(s=h?u.geometries[P]:u,s!==null){l=s.coordinates;var O=s.type;switch(d=r&&(O==="Polygon"||O==="MultiPolygon")?1:0,O){case null:break;case"Point":if(t(l,f,C,w,T)===!1)return!1;f++,w++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(t(l[n],f,C,w,T)===!1)return!1;f++,O==="MultiPoint"&&w++}O==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-d;o++){if(t(l[n][o],f,C,w,T)===!1)return!1;f++}O==="MultiLineString"&&w++,O==="Polygon"&&T++}O==="Polygon"&&w++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(T=0,o=0;o<l[n].length;o++){for(i=0;i<l[n][o].length-d;i++){if(t(l[n][o][i],f,C,w,T)===!1)return!1;f++}T++}w++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(Jf(s.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}dn(Jf,"coordEach");function sH(e,t,r,n){var o=r;return Jf(e,function(i,s,a,l,u){s===0&&r===void 0?o=i:o=t(o,i,s,a,l,u)},n),o}dn(sH,"coordReduce");function QM(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&t(e.features[r].properties,r)!==!1;r++);break;case"Feature":t(e.properties,0);break}}dn(QM,"propEach");function aH(e,t,r){var n=r;return QM(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}dn(aH,"propReduce");function e4(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&t(e.features[r],r)!==!1;r++);}dn(e4,"featureEach");function lH(e,t,r){var n=r;return e4(e,function(o,i){i===0&&r===void 0?n=o:n=t(n,o,i)}),n}dn(lH,"featureReduce");function cH(e){var t=[];return Jf(e,function(r){t.push(r)}),t}dn(cH,"coordAll");function w2(e,t){var r,n,o,i,s,a,l,u,d,f,h=0,b=e.type==="FeatureCollection",v=e.type==="Feature",I=b?e.features.length:1;for(r=0;r<I;r++){for(a=b?e.features[r].geometry:v?e.geometry:e,u=b?e.features[r].properties:v?e.properties:{},d=b?e.features[r].bbox:v?e.bbox:void 0,f=b?e.features[r].id:v?e.id:void 0,l=a?a.type==="GeometryCollection":!1,s=l?a.geometries.length:1,o=0;o<s;o++){if(i=l?a.geometries[o]:a,i===null){if(t(null,h,u,d,f)===!1)return!1;continue}switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(i,h,u,d,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<i.geometries.length;n++)if(t(i.geometries[n],h,u,d,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}dn(w2,"geomEach");function uH(e,t,r){var n=r;return w2(e,function(o,i,s,a,l){i===0&&r===void 0?n=o:n=t(n,o,i,s,a,l)}),n}dn(uH,"geomReduce");function rg(e,t){w2(e,function(r,n,o,i,s){var a=r===null?null:r.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return t(Fn.feature.call(void 0,r,o,{bbox:i,id:s}),n,0)===!1?!1:void 0}var l;switch(a){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<r.coordinates.length;u++){var d=r.coordinates[u],f={type:l,coordinates:d};if(t(Fn.feature.call(void 0,f,o),n,u)===!1)return!1}})}dn(rg,"flattenEach");function pH(e,t,r){var n=r;return rg(e,function(o,i,s){i===0&&s===0&&r===void 0?n=o:n=t(n,o,i,s)}),n}dn(pH,"flattenReduce");function t4(e,t){rg(e,function(r,n,o){var i=0;if(r.geometry){var s=r.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var a,l=0,u=0,d=0;if(Jf(r,function(f,h,b,v,I){if(a===void 0||n>l||v>u||I>d){a=f,l=n,u=v,d=I,i=0;return}var x=Fn.lineString.call(void 0,[a,f],r.properties);if(t(x,n,o,I,i)===!1)return!1;i++,a=f})===!1)return!1}}})}dn(t4,"segmentEach");function dH(e,t,r){var n=r,o=!1;return t4(e,function(i,s,a,l,u){o===!1&&r===void 0?n=i:n=t(n,i,s,a,l,u),o=!0}),n}dn(dH,"segmentReduce");function r4(e,t){if(!e)throw new Error("geojson is required");rg(e,function(r,n,o){if(r.geometry!==null){var i=r.geometry.type,s=r.geometry.coordinates;switch(i){case"LineString":if(t(r,n,o,0,0)===!1)return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(t(Fn.lineString.call(void 0,s[a],r.properties),n,o,a)===!1)return!1;break}}})}dn(r4,"lineEach");function fH(e,t,r){var n=r;return r4(e,function(o,i,s,a){i===0&&r===void 0?n=o:n=t(n,o,i,s,a)}),n}dn(fH,"lineReduce");function mH(e,t){if(t=t||{},!Fn.isObject.call(void 0,t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.segmentIndex||0,s=t.properties,a;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,a=e.features[r].geometry;break;case"Feature":s=s||e.properties,a=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=e;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var l=a.coordinates;switch(a.type){case"Point":case"MultiPoint":return null;case"LineString":return i<0&&(i=l.length+i-1),Fn.lineString.call(void 0,[l[i],l[i+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),i<0&&(i=l[o].length+i-1),Fn.lineString.call(void 0,[l[o][i],l[o][i+1]],s,t);case"MultiLineString":return n<0&&(n=l.length+n),i<0&&(i=l[n].length+i-1),Fn.lineString.call(void 0,[l[n][i],l[n][i+1]],s,t);case"MultiPolygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),i<0&&(i=l[n][o].length-i-1),Fn.lineString.call(void 0,[l[n][o][i],l[n][o][i+1]],s,t)}throw new Error("geojson is invalid")}dn(mH,"findSegment");function hH(e,t){if(t=t||{},!Fn.isObject.call(void 0,t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,o=t.geometryIndex||0,i=t.coordIndex||0,s=t.properties,a;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,a=e.features[r].geometry;break;case"Feature":s=s||e.properties,a=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":a=e;break;default:throw new Error("geojson is invalid")}if(a===null)return null;var l=a.coordinates;switch(a.type){case"Point":return Fn.point.call(void 0,l,s,t);case"MultiPoint":return n<0&&(n=l.length+n),Fn.point.call(void 0,l[n],s,t);case"LineString":return i<0&&(i=l.length+i),Fn.point.call(void 0,l[i],s,t);case"Polygon":return o<0&&(o=l.length+o),i<0&&(i=l[o].length+i),Fn.point.call(void 0,l[o][i],s,t);case"MultiLineString":return n<0&&(n=l.length+n),i<0&&(i=l[n].length+i),Fn.point.call(void 0,l[n][i],s,t);case"MultiPolygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),i<0&&(i=l[n][o].length-i),Fn.point.call(void 0,l[n][o][i],s,t)}throw new Error("geojson is invalid")}dn(hH,"findPoint");Vr.coordAll=cH;Vr.coordEach=Jf;Vr.coordReduce=sH;Vr.featureEach=e4;Vr.featureReduce=lH;Vr.findPoint=hH;Vr.findSegment=mH;Vr.flattenEach=rg;Vr.flattenReduce=pH;Vr.geomEach=w2;Vr.geomReduce=uH;Vr.lineEach=r4;Vr.lineReduce=fH;Vr.propEach=QM;Vr.propReduce=aH;Vr.segmentEach=t4;Vr.segmentReduce=dH});var gH=H(M2=>{"use strict";p();Object.defineProperty(M2,"__esModule",{value:!0});var Bbe=Object.defineProperty,$be=(e,t)=>Bbe(e,"name",{value:t,configurable:!0}),jbe=yH();function n4(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;let r=[1/0,1/0,-1/0,-1/0];return jbe.coordEach.call(void 0,e,n=>{r[0]>n[0]&&(r[0]=n[0]),r[1]>n[1]&&(r[1]=n[1]),r[2]<n[0]&&(r[2]=n[0]),r[3]<n[1]&&(r[3]=n[1])}),r}$be(n4,"bbox");var Gbe=n4;M2.bbox=n4;M2.default=Gbe});var SH=H((Ftt,o4)=>{p();var qs=yj(),vH=Tw(),xH=wj(),Qf=gH().default,Ube=xH.featureEach,ktt=xH.coordEach,Dtt=vH.polygon,bH=vH.featureCollection;function IH(e){var t=new qs(e);return t.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:Qf(r),qs.prototype.insert.call(this,r)},t.load=function(r){var n=[];return Array.isArray(r)?r.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Qf(o),n.push(o)}):Ube(r,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Qf(o),n.push(o)}),qs.prototype.load.call(this,n)},t.remove=function(r,n){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:Qf(r),qs.prototype.remove.call(this,r,n)},t.clear=function(){return qs.prototype.clear.call(this)},t.search=function(r){var n=qs.prototype.search.call(this,this.toBBox(r));return bH(n)},t.collides=function(r){return qs.prototype.collides.call(this,this.toBBox(r))},t.all=function(){var r=qs.prototype.all.call(this);return bH(r)},t.toJSON=function(){return qs.prototype.toJSON.call(this)},t.fromJSON=function(r){return qs.prototype.fromJSON.call(this,r)},t.toBBox=function(r){var n;if(r.bbox)n=r.bbox;else if(Array.isArray(r)&&r.length===4)n=r;else if(Array.isArray(r)&&r.length===6)n=[r[0],r[1],r[3],r[4]];else if(r.type==="Feature")n=Qf(r);else if(r.type==="FeatureCollection")n=Qf(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}o4.exports=IH;o4.exports.default=IH});var l5=H((Kg,Em)=>{p();var _0e=200,rq="__lodash_hash_undefined__",A0e=800,k0e=16,nq=9007199254740991,oq="[object Arguments]",D0e="[object Array]",F0e="[object AsyncFunction]",L0e="[object Boolean]",R0e="[object Date]",N0e="[object Error]",iq="[object Function]",B0e="[object GeneratorFunction]",$0e="[object Map]",j0e="[object Number]",G0e="[object Null]",sq="[object Object]",U0e="[object Proxy]",V0e="[object RegExp]",z0e="[object Set]",H0e="[object String]",W0e="[object Undefined]",q0e="[object WeakMap]",Z0e="[object ArrayBuffer]",X0e="[object DataView]",Y0e="[object Float32Array]",K0e="[object Float64Array]",J0e="[object Int8Array]",Q0e="[object Int16Array]",eve="[object Int32Array]",tve="[object Uint8Array]",rve="[object Uint8ClampedArray]",nve="[object Uint16Array]",ove="[object Uint32Array]",ive=/[\\^$.*+?()[\]{}|]/g,sve=/^\[object .+?Constructor\]$/,ave=/^(?:0|[1-9]\d*)$/,sr={};sr[Y0e]=sr[K0e]=sr[J0e]=sr[Q0e]=sr[eve]=sr[tve]=sr[rve]=sr[nve]=sr[ove]=!0;sr[oq]=sr[D0e]=sr[Z0e]=sr[L0e]=sr[X0e]=sr[R0e]=sr[N0e]=sr[iq]=sr[$0e]=sr[j0e]=sr[sq]=sr[V0e]=sr[z0e]=sr[H0e]=sr[q0e]=!1;var aq=typeof global=="object"&&global&&global.Object===Object&&global,lve=typeof self=="object"&&self&&self.Object===Object&&self,eb=aq||lve||Function("return this")(),lq=typeof Kg=="object"&&Kg&&!Kg.nodeType&&Kg,Jg=lq&&typeof Em=="object"&&Em&&!Em.nodeType&&Em,cq=Jg&&Jg.exports===lq,J4=cq&&aq.process,qW=function(){try{var e=Jg&&Jg.require&&Jg.require("util").types;return e||J4&&J4.binding&&J4.binding("util")}catch{}}(),ZW=qW&&qW.isTypedArray;function cve(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function uve(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function pve(e){return function(t){return e(t)}}function dve(e,t){return e==null?void 0:e[t]}function fve(e,t){return function(r){return e(t(r))}}var mve=Array.prototype,hve=Function.prototype,iI=Object.prototype,Q4=eb["__core-js_shared__"],sI=hve.toString,yl=iI.hasOwnProperty,XW=function(){var e=/[^.]+$/.exec(Q4&&Q4.keys&&Q4.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),uq=iI.toString,yve=sI.call(Object),gve=RegExp("^"+sI.call(yl).replace(ive,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nI=cq?eb.Buffer:void 0,YW=eb.Symbol,KW=eb.Uint8Array,JW=nI?nI.allocUnsafe:void 0,pq=fve(Object.getPrototypeOf,Object),QW=Object.create,bve=iI.propertyIsEnumerable,vve=mve.splice,Gp=YW?YW.toStringTag:void 0,oI=function(){try{var e=i5(Object,"defineProperty");return e({},"",{}),e}catch{}}(),xve=nI?nI.isBuffer:void 0,eq=Math.max,Ive=Date.now,dq=i5(eb,"Map"),Qg=i5(Object,"create"),Sve=function(){function e(){}return function(t){if(!Vp(t))return{};if(QW)return QW(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Up(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Cve(){this.__data__=Qg?Qg(null):{},this.size=0}function Pve(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Tve(e){var t=this.__data__;if(Qg){var r=t[e];return r===rq?void 0:r}return yl.call(t,e)?t[e]:void 0}function wve(e){var t=this.__data__;return Qg?t[e]!==void 0:yl.call(t,e)}function Mve(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Qg&&t===void 0?rq:t,this}Up.prototype.clear=Cve;Up.prototype.delete=Pve;Up.prototype.get=Tve;Up.prototype.has=wve;Up.prototype.set=Mve;function gl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ove(){this.__data__=[],this.size=0}function Eve(e){var t=this.__data__,r=aI(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():vve.call(t,r,1),--this.size,!0}function _ve(e){var t=this.__data__,r=aI(t,e);return r<0?void 0:t[r][1]}function Ave(e){return aI(this.__data__,e)>-1}function kve(e,t){var r=this.__data__,n=aI(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}gl.prototype.clear=Ove;gl.prototype.delete=Eve;gl.prototype.get=_ve;gl.prototype.has=Ave;gl.prototype.set=kve;function _m(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Dve(){this.size=0,this.__data__={hash:new Up,map:new(dq||gl),string:new Up}}function Fve(e){var t=cI(this,e).delete(e);return this.size-=t?1:0,t}function Lve(e){return cI(this,e).get(e)}function Rve(e){return cI(this,e).has(e)}function Nve(e,t){var r=cI(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}_m.prototype.clear=Dve;_m.prototype.delete=Fve;_m.prototype.get=Lve;_m.prototype.has=Rve;_m.prototype.set=Nve;function Am(e){var t=this.__data__=new gl(e);this.size=t.size}function Bve(){this.__data__=new gl,this.size=0}function $ve(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function jve(e){return this.__data__.get(e)}function Gve(e){return this.__data__.has(e)}function Uve(e,t){var r=this.__data__;if(r instanceof gl){var n=r.__data__;if(!dq||n.length<_0e-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new _m(n)}return r.set(e,t),this.size=r.size,this}Am.prototype.clear=Bve;Am.prototype.delete=$ve;Am.prototype.get=jve;Am.prototype.has=Gve;Am.prototype.set=Uve;function Vve(e,t){var r=n5(e),n=!r&&r5(e),o=!r&&!n&&yq(e),i=!r&&!n&&!o&&bq(e),s=r||n||o||i,a=s?uve(e.length,String):[],l=a.length;for(var u in e)(t||yl.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||mq(u,l)))&&a.push(u);return a}function e5(e,t,r){(r!==void 0&&!uI(e[t],r)||r===void 0&&!(t in e))&&o5(e,t,r)}function zve(e,t,r){var n=e[t];(!(yl.call(e,t)&&uI(n,r))||r===void 0&&!(t in e))&&o5(e,t,r)}function aI(e,t){for(var r=e.length;r--;)if(uI(e[r][0],t))return r;return-1}function o5(e,t,r){t=="__proto__"&&oI?oI(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Hve=oxe();function lI(e){return e==null?e===void 0?W0e:G0e:Gp&&Gp in Object(e)?ixe(e):pxe(e)}function tq(e){return tb(e)&&lI(e)==oq}function Wve(e){if(!Vp(e)||cxe(e))return!1;var t=a5(e)?gve:sve;return t.test(hxe(e))}function qve(e){return tb(e)&&gq(e.length)&&!!sr[lI(e)]}function Zve(e){if(!Vp(e))return uxe(e);var t=hq(e),r=[];for(var n in e)n=="constructor"&&(t||!yl.call(e,n))||r.push(n);return r}function fq(e,t,r,n,o){e!==t&&Hve(t,function(i,s){if(o||(o=new Am),Vp(i))Xve(e,t,s,r,fq,n,o);else{var a=n?n(t5(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),e5(e,s,a)}},vq)}function Xve(e,t,r,n,o,i,s){var a=t5(e,r),l=t5(t,r),u=s.get(l);if(u){e5(e,r,u);return}var d=i?i(a,l,r+"",e,t,s):void 0,f=d===void 0;if(f){var h=n5(l),b=!h&&yq(l),v=!h&&!b&&bq(l);d=l,h||b||v?n5(a)?d=a:yxe(a)?d=txe(a):b?(f=!1,d=Jve(l,!0)):v?(f=!1,d=exe(l,!0)):d=[]:gxe(l)||r5(l)?(d=a,r5(a)?d=bxe(a):(!Vp(a)||a5(a))&&(d=sxe(l))):f=!1}f&&(s.set(l,d),o(d,l,n,i,s),s.delete(l)),e5(e,r,d)}function Yve(e,t){return fxe(dxe(e,t,xq),e+"")}var Kve=oI?function(e,t){return oI(e,"toString",{configurable:!0,enumerable:!1,value:xxe(t),writable:!0})}:xq;function Jve(e,t){if(t)return e.slice();var r=e.length,n=JW?JW(r):new e.constructor(r);return e.copy(n),n}function Qve(e){var t=new e.constructor(e.byteLength);return new KW(t).set(new KW(e)),t}function exe(e,t){var r=t?Qve(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function txe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function rxe(e,t,r,n){var o=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var a=t[i],l=n?n(r[a],e[a],a,r,e):void 0;l===void 0&&(l=e[a]),o?o5(r,a,l):zve(r,a,l)}return r}function nxe(e){return Yve(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&axe(r[0],r[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var a=r[n];a&&e(t,a,n,i)}return t})}function oxe(e){return function(t,r,n){for(var o=-1,i=Object(t),s=n(t),a=s.length;a--;){var l=s[e?a:++o];if(r(i[l],l,i)===!1)break}return t}}function cI(e,t){var r=e.__data__;return lxe(t)?r[typeof t=="string"?"string":"hash"]:r.map}function i5(e,t){var r=dve(e,t);return Wve(r)?r:void 0}function ixe(e){var t=yl.call(e,Gp),r=e[Gp];try{e[Gp]=void 0;var n=!0}catch{}var o=uq.call(e);return n&&(t?e[Gp]=r:delete e[Gp]),o}function sxe(e){return typeof e.constructor=="function"&&!hq(e)?Sve(pq(e)):{}}function mq(e,t){var r=typeof e;return t=t==null?nq:t,!!t&&(r=="number"||r!="symbol"&&ave.test(e))&&e>-1&&e%1==0&&e<t}function axe(e,t,r){if(!Vp(r))return!1;var n=typeof t;return(n=="number"?s5(r)&&mq(t,r.length):n=="string"&&t in r)?uI(r[t],e):!1}function lxe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function cxe(e){return!!XW&&XW in e}function hq(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||iI;return e===r}function uxe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}function pxe(e){return uq.call(e)}function dxe(e,t,r){return t=eq(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=eq(n.length-t,0),s=Array(i);++o<i;)s[o]=n[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=n[o];return a[t]=r(s),cve(e,this,a)}}function t5(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var fxe=mxe(Kve);function mxe(e){var t=0,r=0;return function(){var n=Ive(),o=k0e-(n-r);if(r=n,o>0){if(++t>=A0e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function hxe(e){if(e!=null){try{return sI.call(e)}catch{}try{return e+""}catch{}}return""}function uI(e,t){return e===t||e!==e&&t!==t}var r5=tq(function(){return arguments}())?tq:function(e){return tb(e)&&yl.call(e,"callee")&&!bve.call(e,"callee")},n5=Array.isArray;function s5(e){return e!=null&&gq(e.length)&&!a5(e)}function yxe(e){return tb(e)&&s5(e)}var yq=xve||Ixe;function a5(e){if(!Vp(e))return!1;var t=lI(e);return t==iq||t==B0e||t==F0e||t==U0e}function gq(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=nq}function Vp(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function tb(e){return e!=null&&typeof e=="object"}function gxe(e){if(!tb(e)||lI(e)!=sq)return!1;var t=pq(e);if(t===null)return!0;var r=yl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&sI.call(r)==yve}var bq=ZW?pve(ZW):qve;function bxe(e){return rxe(e,vq(e))}function vq(e){return s5(e)?Vve(e,!0):Zve(e)}var vxe=nxe(function(e,t,r){fq(e,t,r)});function xxe(e){return function(){return e}}function xq(e){return e}function Ixe(){return!1}Em.exports=vxe});var S5=H((ob,Fm)=>{p();var Xxe=200,Gq="__lodash_hash_undefined__",Yxe=800,Kxe=16,Uq=9007199254740991,Vq="[object Arguments]",Jxe="[object Array]",Qxe="[object AsyncFunction]",e2e="[object Boolean]",t2e="[object Date]",r2e="[object Error]",zq="[object Function]",n2e="[object GeneratorFunction]",o2e="[object Map]",i2e="[object Number]",s2e="[object Null]",Hq="[object Object]",a2e="[object Proxy]",l2e="[object RegExp]",c2e="[object Set]",u2e="[object String]",p2e="[object Undefined]",d2e="[object WeakMap]",f2e="[object ArrayBuffer]",m2e="[object DataView]",h2e="[object Float32Array]",y2e="[object Float64Array]",g2e="[object Int8Array]",b2e="[object Int16Array]",v2e="[object Int32Array]",x2e="[object Uint8Array]",I2e="[object Uint8ClampedArray]",S2e="[object Uint16Array]",C2e="[object Uint32Array]",P2e=/[\\^$.*+?()[\]{}|]/g,T2e=/^\[object .+?Constructor\]$/,w2e=/^(?:0|[1-9]\d*)$/,ar={};ar[h2e]=ar[y2e]=ar[g2e]=ar[b2e]=ar[v2e]=ar[x2e]=ar[I2e]=ar[S2e]=ar[C2e]=!0;ar[Vq]=ar[Jxe]=ar[f2e]=ar[e2e]=ar[m2e]=ar[t2e]=ar[r2e]=ar[zq]=ar[o2e]=ar[i2e]=ar[Hq]=ar[l2e]=ar[c2e]=ar[u2e]=ar[d2e]=!1;var Wq=typeof global=="object"&&global&&global.Object===Object&&global,M2e=typeof self=="object"&&self&&self.Object===Object&&self,ab=Wq||M2e||Function("return this")(),qq=typeof ob=="object"&&ob&&!ob.nodeType&&ob,ib=qq&&typeof Fm=="object"&&Fm&&!Fm.nodeType&&Fm,Zq=ib&&ib.exports===qq,p5=Zq&&Wq.process,kq=function(){try{var e=ib&&ib.require&&ib.require("util").types;return e||p5&&p5.binding&&p5.binding("util")}catch{}}(),Dq=kq&&kq.isTypedArray;function Xq(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function O2e(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function E2e(e){return function(t){return e(t)}}function _2e(e,t){return e==null?void 0:e[t]}function A2e(e,t){return function(r){return e(t(r))}}var k2e=Array.prototype,D2e=Function.prototype,hI=Object.prototype,d5=ab["__core-js_shared__"],yI=D2e.toString,xl=hI.hasOwnProperty,Fq=function(){var e=/[^.]+$/.exec(d5&&d5.keys&&d5.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Yq=hI.toString,F2e=yI.call(Object),L2e=RegExp("^"+yI.call(xl).replace(P2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fI=Zq?ab.Buffer:void 0,Lq=ab.Symbol,Rq=ab.Uint8Array,Nq=fI?fI.allocUnsafe:void 0,Kq=A2e(Object.getPrototypeOf,Object),Bq=Object.create,R2e=hI.propertyIsEnumerable,N2e=k2e.splice,zp=Lq?Lq.toStringTag:void 0,mI=function(){try{var e=v5(Object,"defineProperty");return e({},"",{}),e}catch{}}(),B2e=fI?fI.isBuffer:void 0,$q=Math.max,$2e=Date.now,Jq=v5(ab,"Map"),sb=v5(Object,"create"),j2e=function(){function e(){}return function(t){if(!vl(t))return{};if(Bq)return Bq(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Hp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function G2e(){this.__data__=sb?sb(null):{},this.size=0}function U2e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function V2e(e){var t=this.__data__;if(sb){var r=t[e];return r===Gq?void 0:r}return xl.call(t,e)?t[e]:void 0}function z2e(e){var t=this.__data__;return sb?t[e]!==void 0:xl.call(t,e)}function H2e(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=sb&&t===void 0?Gq:t,this}Hp.prototype.clear=G2e;Hp.prototype.delete=U2e;Hp.prototype.get=V2e;Hp.prototype.has=z2e;Hp.prototype.set=H2e;function Il(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function W2e(){this.__data__=[],this.size=0}function q2e(e){var t=this.__data__,r=gI(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():N2e.call(t,r,1),--this.size,!0}function Z2e(e){var t=this.__data__,r=gI(t,e);return r<0?void 0:t[r][1]}function X2e(e){return gI(this.__data__,e)>-1}function Y2e(e,t){var r=this.__data__,n=gI(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}Il.prototype.clear=W2e;Il.prototype.delete=q2e;Il.prototype.get=Z2e;Il.prototype.has=X2e;Il.prototype.set=Y2e;function Lm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function K2e(){this.size=0,this.__data__={hash:new Hp,map:new(Jq||Il),string:new Hp}}function J2e(e){var t=vI(this,e).delete(e);return this.size-=t?1:0,t}function Q2e(e){return vI(this,e).get(e)}function eIe(e){return vI(this,e).has(e)}function tIe(e,t){var r=vI(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}Lm.prototype.clear=K2e;Lm.prototype.delete=J2e;Lm.prototype.get=Q2e;Lm.prototype.has=eIe;Lm.prototype.set=tIe;function Rm(e){var t=this.__data__=new Il(e);this.size=t.size}function rIe(){this.__data__=new Il,this.size=0}function nIe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function oIe(e){return this.__data__.get(e)}function iIe(e){return this.__data__.has(e)}function sIe(e,t){var r=this.__data__;if(r instanceof Il){var n=r.__data__;if(!Jq||n.length<Xxe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Lm(n)}return r.set(e,t),this.size=r.size,this}Rm.prototype.clear=rIe;Rm.prototype.delete=nIe;Rm.prototype.get=oIe;Rm.prototype.has=iIe;Rm.prototype.set=sIe;function aIe(e,t){var r=y5(e),n=!r&&h5(e),o=!r&&!n&&nZ(e),i=!r&&!n&&!o&&iZ(e),s=r||n||o||i,a=s?O2e(e.length,String):[],l=a.length;for(var u in e)(t||xl.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||tZ(u,l)))&&a.push(u);return a}function f5(e,t,r){(r!==void 0&&!xI(e[t],r)||r===void 0&&!(t in e))&&g5(e,t,r)}function lIe(e,t,r){var n=e[t];(!(xl.call(e,t)&&xI(n,r))||r===void 0&&!(t in e))&&g5(e,t,r)}function gI(e,t){for(var r=e.length;r--;)if(xI(e[r][0],t))return r;return-1}function g5(e,t,r){t=="__proto__"&&mI?mI(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var cIe=IIe();function bI(e){return e==null?e===void 0?p2e:s2e:zp&&zp in Object(e)?SIe(e):OIe(e)}function jq(e){return lb(e)&&bI(e)==Vq}function uIe(e){if(!vl(e)||wIe(e))return!1;var t=I5(e)?L2e:T2e;return t.test(kIe(e))}function pIe(e){return lb(e)&&oZ(e.length)&&!!ar[bI(e)]}function dIe(e){if(!vl(e))return MIe(e);var t=rZ(e),r=[];for(var n in e)n=="constructor"&&(t||!xl.call(e,n))||r.push(n);return r}function b5(e,t,r,n,o){e!==t&&cIe(t,function(i,s){if(o||(o=new Rm),vl(i))fIe(e,t,s,r,b5,n,o);else{var a=n?n(m5(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),f5(e,s,a)}},sZ)}function fIe(e,t,r,n,o,i,s){var a=m5(e,r),l=m5(t,r),u=s.get(l);if(u){f5(e,r,u);return}var d=i?i(a,l,r+"",e,t,s):void 0,f=d===void 0;if(f){var h=y5(l),b=!h&&nZ(l),v=!h&&!b&&iZ(l);d=l,h||b||v?y5(a)?d=a:DIe(a)?d=bIe(a):b?(f=!1,d=hIe(l,!0)):v?(f=!1,d=gIe(l,!0)):d=[]:FIe(l)||h5(l)?(d=a,h5(a)?d=LIe(a):(!vl(a)||I5(a))&&(d=CIe(l))):f=!1}f&&(s.set(l,d),o(d,l,n,i,s),s.delete(l)),f5(e,r,d)}function Qq(e,t){return _Ie(EIe(e,t,aZ),e+"")}var mIe=mI?function(e,t){return mI(e,"toString",{configurable:!0,enumerable:!1,value:BIe(t),writable:!0})}:aZ;function hIe(e,t){if(t)return e.slice();var r=e.length,n=Nq?Nq(r):new e.constructor(r);return e.copy(n),n}function yIe(e){var t=new e.constructor(e.byteLength);return new Rq(t).set(new Rq(e)),t}function gIe(e,t){var r=t?yIe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function bIe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function vIe(e,t,r,n){var o=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var a=t[i],l=n?n(r[a],e[a],a,r,e):void 0;l===void 0&&(l=e[a]),o?g5(r,a,l):lIe(r,a,l)}return r}function xIe(e){return Qq(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&PIe(r[0],r[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var a=r[n];a&&e(t,a,n,i)}return t})}function IIe(e){return function(t,r,n){for(var o=-1,i=Object(t),s=n(t),a=s.length;a--;){var l=s[e?a:++o];if(r(i[l],l,i)===!1)break}return t}}function eZ(e,t,r,n,o,i){return vl(e)&&vl(t)&&(i.set(t,e),b5(e,t,void 0,eZ,i),i.delete(t)),e}function vI(e,t){var r=e.__data__;return TIe(t)?r[typeof t=="string"?"string":"hash"]:r.map}function v5(e,t){var r=_2e(e,t);return uIe(r)?r:void 0}function SIe(e){var t=xl.call(e,zp),r=e[zp];try{e[zp]=void 0;var n=!0}catch{}var o=Yq.call(e);return n&&(t?e[zp]=r:delete e[zp]),o}function CIe(e){return typeof e.constructor=="function"&&!rZ(e)?j2e(Kq(e)):{}}function tZ(e,t){var r=typeof e;return t=t==null?Uq:t,!!t&&(r=="number"||r!="symbol"&&w2e.test(e))&&e>-1&&e%1==0&&e<t}function PIe(e,t,r){if(!vl(r))return!1;var n=typeof t;return(n=="number"?x5(r)&&tZ(t,r.length):n=="string"&&t in r)?xI(r[t],e):!1}function TIe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function wIe(e){return!!Fq&&Fq in e}function rZ(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||hI;return e===r}function MIe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}function OIe(e){return Yq.call(e)}function EIe(e,t,r){return t=$q(t===void 0?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=$q(n.length-t,0),s=Array(i);++o<i;)s[o]=n[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=n[o];return a[t]=r(s),Xq(e,this,a)}}function m5(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var _Ie=AIe(mIe);function AIe(e){var t=0,r=0;return function(){var n=$2e(),o=Kxe-(n-r);if(r=n,o>0){if(++t>=Yxe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function kIe(e){if(e!=null){try{return yI.call(e)}catch{}try{return e+""}catch{}}return""}function xI(e,t){return e===t||e!==e&&t!==t}var h5=jq(function(){return arguments}())?jq:function(e){return lb(e)&&xl.call(e,"callee")&&!R2e.call(e,"callee")},y5=Array.isArray;function x5(e){return e!=null&&oZ(e.length)&&!I5(e)}function DIe(e){return lb(e)&&x5(e)}var nZ=B2e||$Ie;function I5(e){if(!vl(e))return!1;var t=bI(e);return t==zq||t==n2e||t==Qxe||t==a2e}function oZ(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Uq}function vl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function lb(e){return e!=null&&typeof e=="object"}function FIe(e){if(!lb(e)||bI(e)!=Hq)return!1;var t=Kq(e);if(t===null)return!0;var r=xl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&yI.call(r)==F2e}var iZ=Dq?E2e(Dq):pIe;function LIe(e){return vIe(e,sZ(e))}var RIe=Qq(function(e){return e.push(void 0,eZ),Xq(NIe,void 0,e)});function sZ(e){return x5(e)?aIe(e,!0):dIe(e)}var NIe=xIe(function(e,t,r,n){b5(e,t,r,n)});function BIe(e){return function(){return e}}function aZ(e){return e}function $Ie(){return!1}Fm.exports=RIe});var KZ=H((Ppt,hb)=>{"use strict";p();var nSe=!1,Zp=!1,zZ=!0,HZ=!1,y={},WZ=!1;typeof hb<"u"&&hb.exports?(hb.exports=y,WZ=!0):typeof document<"u"?window.ClipperLib=y:self.ClipperLib=y;var kI;WZ?(Wr="chrome",kI="Netscape"):(Wr=navigator.userAgent.toString().toLowerCase(),kI=navigator.appName);var Wr,nt={};Wr.indexOf("chrome")!=-1&&Wr.indexOf("chromium")==-1?nt.chrome=1:nt.chrome=0;Wr.indexOf("chromium")!=-1?nt.chromium=1:nt.chromium=0;Wr.indexOf("safari")!=-1&&Wr.indexOf("chrome")==-1&&Wr.indexOf("chromium")==-1?nt.safari=1:nt.safari=0;Wr.indexOf("firefox")!=-1?nt.firefox=1:nt.firefox=0;Wr.indexOf("firefox/17")!=-1?nt.firefox17=1:nt.firefox17=0;Wr.indexOf("firefox/15")!=-1?nt.firefox15=1:nt.firefox15=0;Wr.indexOf("firefox/3")!=-1?nt.firefox3=1:nt.firefox3=0;Wr.indexOf("opera")!=-1?nt.opera=1:nt.opera=0;Wr.indexOf("msie 10")!=-1?nt.msie10=1:nt.msie10=0;Wr.indexOf("msie 9")!=-1?nt.msie9=1:nt.msie9=0;Wr.indexOf("msie 8")!=-1?nt.msie8=1:nt.msie8=0;Wr.indexOf("msie 7")!=-1?nt.msie7=1:nt.msie7=0;Wr.indexOf("msie ")!=-1?nt.msie=1:nt.msie=0;y.biginteger_used=null;var jc,oSe=0xdeadbeefcafe,UZ=(oSe&16777215)==15715070;function re(e,t,r){y.biginteger_used=1,e!=null&&(typeof e=="number"&&typeof t>"u"?this.fromInt(e):typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}function mt(){return new re(null)}function iSe(e,t,r,n,o,i){for(;--i>=0;){var s=t*this[e++]+r[n]+o;o=Math.floor(s/67108864),r[n++]=s&67108863}return o}function sSe(e,t,r,n,o,i){for(var s=t&32767,a=t>>15;--i>=0;){var l=this[e]&32767,u=this[e++]>>15,d=a*l+u*s;l=s*l+((d&32767)<<15)+r[n]+(o&1073741823),o=(l>>>30)+(d>>>15)+a*u+(o>>>30),r[n++]=l&1073741823}return o}function aSe(e,t,r,n,o,i){for(var s=t&16383,a=t>>14;--i>=0;){var l=this[e]&16383,u=this[e++]>>14,d=a*l+u*s;l=s*l+((d&16383)<<14)+r[n]+o,o=(l>>28)+(d>>14)+a*u,r[n++]=l&268435455}return o}UZ&&kI=="Microsoft Internet Explorer"?(re.prototype.am=sSe,jc=30):UZ&&kI!="Netscape"?(re.prototype.am=iSe,jc=26):(re.prototype.am=aSe,jc=28);re.prototype.DB=jc;re.prototype.DM=(1<<jc)-1;re.prototype.DV=1<<jc;var $5=52;re.prototype.FV=Math.pow(2,$5);re.prototype.F1=$5-jc;re.prototype.F2=2*jc-$5;var lSe="0123456789abcdefghijklmnopqrstuvwxyz",FI=new Array,Um,xi;Um=48;for(xi=0;xi<=9;++xi)FI[Um++]=xi;Um=97;for(xi=10;xi<36;++xi)FI[Um++]=xi;Um=65;for(xi=10;xi<36;++xi)FI[Um++]=xi;function VZ(e){return lSe.charAt(e)}function qZ(e,t){var r=FI[e.charCodeAt(t)];return r==null?-1:r}function cSe(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function uSe(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function $c(e){var t=mt();return t.fromInt(e),t}function pSe(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,o=!1,i=0;--n>=0;){var s=r==8?e[n]&255:qZ(e,n);if(s<0){e.charAt(n)=="-"&&(o=!0);continue}o=!1,i==0?this[this.t++]=s:i+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-i)-1)<<i,this[this.t++]=s>>this.DB-i):this[this.t-1]|=s<<i,i+=r,i>=this.DB&&(i-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,i>0&&(this[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),o&&re.ZERO.subTo(this,this)}function dSe(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function fSe(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,o=!1,i="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(n=this[s]>>a)>0&&(o=!0,i=VZ(n));s>=0;)a<t?(n=(this[s]&(1<<a)-1)<<t-a,n|=this[--s]>>(a+=this.DB-t)):(n=this[s]>>(a-=t)&r,a<=0&&(a+=this.DB,--s)),n>0&&(o=!0),o&&(i+=VZ(n));return o?i:"0"}function mSe(){var e=mt();return re.ZERO.subTo(this,e),e}function hSe(){return this.s<0?this.negate():this}function ySe(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-e[r])!=0)return t;return 0}function LI(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}function gSe(){return this.t<=0?0:this.DB*(this.t-1)+LI(this[this.t-1]^this.s&this.DM)}function bSe(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}function vSe(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}function xSe(e,t){var r=e%this.DB,n=this.DB-r,o=(1<<n)-1,i=Math.floor(e/this.DB),s=this.s<<r&this.DM,a;for(a=this.t-1;a>=0;--a)t[a+i+1]=this[a]>>n|s,s=(this[a]&o)<<r;for(a=i-1;a>=0;--a)t[a]=0;t[i]=s,t.t=this.t+i+1,t.s=this.s,t.clamp()}function ISe(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,o=this.DB-n,i=(1<<n)-1;t[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)t[s-r-1]|=(this[s]&i)<<o,t[s-r]=this[s]>>n;n>0&&(t[this.t-r-1]|=(this.s&i)<<o),t.t=this.t-r,t.clamp()}function SSe(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()}function CSe(e,t){var r=this.abs(),n=e.abs(),o=r.t;for(t.t=o+n.t;--o>=0;)t[o]=0;for(o=0;o<n.t;++o)t[o+r.t]=r.am(0,n[o],t,o,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&re.ZERO.subTo(t,t)}function PSe(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}function TSe(e,t,r){var n=e.abs();if(!(n.t<=0)){var o=this.abs();if(o.t<n.t){t!=null&&t.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=mt());var i=mt(),s=this.s,a=e.s,l=this.DB-LI(n[n.t-1]);l>0?(n.lShiftTo(l,i),o.lShiftTo(l,r)):(n.copyTo(i),o.copyTo(r));var u=i.t,d=i[u-1];if(d!=0){var f=d*(1<<this.F1)+(u>1?i[u-2]>>this.F2:0),h=this.FV/f,b=(1<<this.F1)/f,v=1<<this.F2,I=r.t,x=I-u,C=t==null?mt():t;for(i.dlShiftTo(x,C),r.compareTo(C)>=0&&(r[r.t++]=1,r.subTo(C,r)),re.ONE.dlShiftTo(u,C),C.subTo(i,i);i.t<u;)i[i.t++]=0;for(;--x>=0;){var P=r[--I]==d?this.DM:Math.floor(r[I]*h+(r[I-1]+v)*b);if((r[I]+=i.am(0,P,r,x,0,u))<P)for(i.dlShiftTo(x,C),r.subTo(C,r);r[I]<--P;)r.subTo(C,r)}t!=null&&(r.drShiftTo(u,t),s!=a&&re.ZERO.subTo(t,t)),r.t=u,r.clamp(),l>0&&r.rShiftTo(l,r),s<0&&re.ZERO.subTo(r,r)}}}function wSe(e){var t=mt();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(re.ZERO)>0&&e.subTo(t,t),t}function Xp(e){this.m=e}function MSe(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function OSe(e){return e}function ESe(e){e.divRemTo(this.m,null,e)}function _Se(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function ASe(e,t){e.squareTo(t),this.reduce(t)}Xp.prototype.convert=MSe;Xp.prototype.revert=OSe;Xp.prototype.reduce=ESe;Xp.prototype.mulTo=_Se;Xp.prototype.sqrTo=ASe;function kSe(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Yp(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function DSe(e){var t=mt();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(re.ZERO)>0&&this.m.subTo(t,t),t}function FSe(e){var t=mt();return e.copyTo(t),this.reduce(t),t}function LSe(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e[t]&32767,n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function RSe(e,t){e.squareTo(t),this.reduce(t)}function NSe(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Yp.prototype.convert=DSe;Yp.prototype.revert=FSe;Yp.prototype.reduce=LSe;Yp.prototype.mulTo=NSe;Yp.prototype.sqrTo=RSe;function BSe(){return(this.t>0?this[0]&1:this.s)==0}function $Se(e,t){if(e>4294967295||e<1)return re.ONE;var r=mt(),n=mt(),o=t.convert(this),i=LI(e)-1;for(o.copyTo(r);--i>=0;)if(t.sqrTo(r,n),(e&1<<i)>0)t.mulTo(n,o,r);else{var s=r;r=n,n=s}return t.revert(r)}function jSe(e,t){var r;return e<256||t.isEven()?r=new Xp(t):r=new Yp(t),this.exp(e,r)}re.prototype.copyTo=cSe;re.prototype.fromInt=uSe;re.prototype.fromString=pSe;re.prototype.clamp=dSe;re.prototype.dlShiftTo=bSe;re.prototype.drShiftTo=vSe;re.prototype.lShiftTo=xSe;re.prototype.rShiftTo=ISe;re.prototype.subTo=SSe;re.prototype.multiplyTo=CSe;re.prototype.squareTo=PSe;re.prototype.divRemTo=TSe;re.prototype.invDigit=kSe;re.prototype.isEven=BSe;re.prototype.exp=$Se;re.prototype.toString=fSe;re.prototype.negate=mSe;re.prototype.abs=hSe;re.prototype.compareTo=ySe;re.prototype.bitLength=gSe;re.prototype.mod=wSe;re.prototype.modPowInt=jSe;re.ZERO=$c(0);re.ONE=$c(1);function GSe(){var e=mt();return this.copyTo(e),e}function USe(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function VSe(){return this.t==0?this.s:this[0]<<24>>24}function zSe(){return this.t==0?this.s:this[0]<<16>>16}function HSe(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function WSe(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function qSe(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=$c(r),o=mt(),i=mt(),s="";for(this.divRemTo(n,o,i);o.signum()>0;)s=(r+i.intValue()).toString(e).substr(1)+s,o.divRemTo(n,o,i);return i.intValue().toString(e)+s}function ZSe(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),o=!1,i=0,s=0,a=0;a<e.length;++a){var l=qZ(e,a);if(l<0){e.charAt(a)=="-"&&this.signum()==0&&(o=!0);continue}s=t*s+l,++i>=r&&(this.dMultiply(n),this.dAddOffset(s,0),i=0,s=0)}i>0&&(this.dMultiply(Math.pow(t,i)),this.dAddOffset(s,0)),o&&re.ZERO.subTo(this,this)}function XSe(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(re.ONE.shiftLeft(e-1),j5,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(re.ONE.shiftLeft(e-1),this);else{var n=new Array,o=e&7;n.length=(e>>3)+1,t.nextBytes(n),o>0?n[0]&=(1<<o)-1:n[0]=0,this.fromString(n,256)}}function YSe(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,o=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[o++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),(n&128)!=0&&(n|=-256),o==0&&(this.s&128)!=(n&128)&&++o,(o>0||n!=this.s)&&(t[o++]=n);return t}function KSe(e){return this.compareTo(e)==0}function JSe(e){return this.compareTo(e)<0?this:e}function QSe(e){return this.compareTo(e)>0?this:e}function e3e(e,t,r){var n,o,i=Math.min(e.t,this.t);for(n=0;n<i;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=i;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function t3e(e,t){return e&t}function r3e(e){var t=mt();return this.bitwiseTo(e,t3e,t),t}function j5(e,t){return e|t}function n3e(e){var t=mt();return this.bitwiseTo(e,j5,t),t}function ZZ(e,t){return e^t}function o3e(e){var t=mt();return this.bitwiseTo(e,ZZ,t),t}function XZ(e,t){return e&~t}function i3e(e){var t=mt();return this.bitwiseTo(e,XZ,t),t}function s3e(){for(var e=mt(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}function a3e(e){var t=mt();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function l3e(e){var t=mt();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function c3e(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}function u3e(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+c3e(this[e]);return this.s<0?this.t*this.DB:-1}function p3e(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function d3e(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=p3e(this[r]^t);return e}function f3e(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}function m3e(e,t){var r=re.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function h3e(e){return this.changeBit(e,j5)}function y3e(e){return this.changeBit(e,XZ)}function g3e(e){return this.changeBit(e,ZZ)}function b3e(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()}function v3e(e){var t=mt();return this.addTo(e,t),t}function x3e(e){var t=mt();return this.subTo(e,t),t}function I3e(e){var t=mt();return this.multiplyTo(e,t),t}function S3e(){var e=mt();return this.squareTo(e),e}function C3e(e){var t=mt();return this.divRemTo(e,t,null),t}function P3e(e){var t=mt();return this.divRemTo(e,null,t),t}function T3e(e){var t=mt(),r=mt();return this.divRemTo(e,t,r),new Array(t,r)}function w3e(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function M3e(e,t){if(e!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function yb(){}function YZ(e){return e}function O3e(e,t,r){e.multiplyTo(t,r)}function E3e(e,t){e.squareTo(t)}yb.prototype.convert=YZ;yb.prototype.revert=YZ;yb.prototype.mulTo=O3e;yb.prototype.sqrTo=E3e;function _3e(e){return this.exp(e,new yb)}function A3e(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;var o;for(o=r.t-this.t;n<o;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(o=Math.min(e.t,t);n<o;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()}function k3e(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}function Vm(e){this.r2=mt(),this.q3=mt(),re.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function D3e(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=mt();return e.copyTo(t),this.reduce(t),t}function F3e(e){return e}function L3e(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function R3e(e,t){e.squareTo(t),this.reduce(t)}function N3e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}Vm.prototype.convert=D3e;Vm.prototype.revert=F3e;Vm.prototype.reduce=L3e;Vm.prototype.mulTo=N3e;Vm.prototype.sqrTo=R3e;function B3e(e,t){var r=e.bitLength(),n,o=$c(1),i;if(r<=0)return o;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?i=new Xp(t):t.isEven()?i=new Vm(t):i=new Yp(t);var s=new Array,a=3,l=n-1,u=(1<<n)-1;if(s[1]=i.convert(this),n>1){var d=mt();for(i.sqrTo(s[1],d);a<=u;)s[a]=mt(),i.mulTo(d,s[a-2],s[a]),a+=2}var f=e.t-1,h,b=!0,v=mt(),I;for(r=LI(e[f])-1;f>=0;){for(r>=l?h=e[f]>>r-l&u:(h=(e[f]&(1<<r+1)-1)<<l-r,f>0&&(h|=e[f-1]>>this.DB+r-l)),a=n;(h&1)==0;)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--f),b)s[h].copyTo(o),b=!1;else{for(;a>1;)i.sqrTo(o,v),i.sqrTo(v,o),a-=2;a>0?i.sqrTo(o,v):(I=o,o=v,v=I),i.mulTo(v,s[h],o)}for(;f>=0&&(e[f]&1<<r)==0;)i.sqrTo(o,v),I=o,o=v,v=I,--r<0&&(r=this.DB-1,--f)}return i.revert(o)}function $3e(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r}function j3e(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r}function G3e(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return re.ZERO;for(var r=e.clone(),n=this.clone(),o=$c(1),i=$c(0),s=$c(0),a=$c(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!o.isEven()||!i.isEven())&&(o.addTo(this,o),i.subTo(e,i)),o.rShiftTo(1,o)):i.isEven()||i.subTo(e,i),i.rShiftTo(1,i);for(;n.isEven();)n.rShiftTo(1,n),t?((!s.isEven()||!a.isEven())&&(s.addTo(this,s),a.subTo(e,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),t&&o.subTo(s,o),i.subTo(a,i)):(n.subTo(r,n),t&&s.subTo(o,s),a.subTo(i,a))}if(n.compareTo(re.ONE)!=0)return re.ZERO;if(a.compareTo(e)>=0)return a.subtract(e);if(a.signum()<0)a.addTo(e,a);else return a;return a.signum()<0?a.add(e):a}var Qn=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],U3e=(1<<26)/Qn[Qn.length-1];function V3e(e){var t,r=this.abs();if(r.t==1&&r[0]<=Qn[Qn.length-1]){for(t=0;t<Qn.length;++t)if(r[0]==Qn[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<Qn.length;){for(var n=Qn[t],o=t+1;o<Qn.length&&n<U3e;)n*=Qn[o++];for(n=r.modInt(n);t<o;)if(n%Qn[t++]==0)return!1}return r.millerRabin(e)}function z3e(e){var t=this.subtract(re.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>Qn.length&&(e=Qn.length);for(var o=mt(),i=0;i<e;++i){o.fromInt(Qn[Math.floor(Math.random()*Qn.length)]);var s=o.modPow(n,this);if(s.compareTo(re.ONE)!=0&&s.compareTo(t)!=0){for(var a=1;a++<r&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(re.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}re.prototype.chunkSize=HSe;re.prototype.toRadix=qSe;re.prototype.fromRadix=ZSe;re.prototype.fromNumber=XSe;re.prototype.bitwiseTo=e3e;re.prototype.changeBit=m3e;re.prototype.addTo=b3e;re.prototype.dMultiply=w3e;re.prototype.dAddOffset=M3e;re.prototype.multiplyLowerTo=A3e;re.prototype.multiplyUpperTo=k3e;re.prototype.modInt=j3e;re.prototype.millerRabin=z3e;re.prototype.clone=GSe;re.prototype.intValue=USe;re.prototype.byteValue=VSe;re.prototype.shortValue=zSe;re.prototype.signum=WSe;re.prototype.toByteArray=YSe;re.prototype.equals=KSe;re.prototype.min=JSe;re.prototype.max=QSe;re.prototype.and=r3e;re.prototype.or=n3e;re.prototype.xor=o3e;re.prototype.andNot=i3e;re.prototype.not=s3e;re.prototype.shiftLeft=a3e;re.prototype.shiftRight=l3e;re.prototype.getLowestSetBit=u3e;re.prototype.bitCount=d3e;re.prototype.testBit=f3e;re.prototype.setBit=h3e;re.prototype.clearBit=y3e;re.prototype.flipBit=g3e;re.prototype.add=v3e;re.prototype.subtract=x3e;re.prototype.multiply=I3e;re.prototype.divide=C3e;re.prototype.remainder=P3e;re.prototype.divideAndRemainder=T3e;re.prototype.modPow=B3e;re.prototype.modInverse=G3e;re.prototype.pow=_3e;re.prototype.gcd=$3e;re.prototype.isProbablePrime=V3e;re.prototype.square=S3e;var et=re;et.prototype.IsNegative=function(){return this.compareTo(et.ZERO)==-1};et.op_Equality=function(e,t){return e.compareTo(t)==0};et.op_Inequality=function(e,t){return e.compareTo(t)!=0};et.op_GreaterThan=function(e,t){return e.compareTo(t)>0};et.op_LessThan=function(e,t){return e.compareTo(t)<0};et.op_Addition=function(e,t){return new et(e).add(new et(t))};et.op_Subtraction=function(e,t){return new et(e).subtract(new et(t))};et.Int128Mul=function(e,t){return new et(e).multiply(new et(t))};et.op_Division=function(e,t){return e.divide(t)};et.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof DI>"u"&&(DI=function(e,t){var r;if(typeof Object.getOwnPropertyNames>"u"){for(r in t.prototype)(typeof e.prototype[r]>"u"||e.prototype[r]==Object.prototype[r])&&(e.prototype[r]=t.prototype[r]);for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}else{for(var n=Object.getOwnPropertyNames(t.prototype),o=0;o<n.length;o++)typeof Object.getOwnPropertyDescriptor(e.prototype,n[o])>"u"&&Object.defineProperty(e.prototype,n[o],Object.getOwnPropertyDescriptor(t.prototype,n[o]));for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}});var DI;y.Path=function(){return[]};y.Paths=function(){return[]};y.DoublePoint=function(){var e=arguments;this.X=0,this.Y=0,e.length==1?(this.X=e[0].X,this.Y=e[0].Y):e.length==2&&(this.X=e[0],this.Y=e[1])};y.DoublePoint0=function(){this.X=0,this.Y=0};y.DoublePoint1=function(e){this.X=e.X,this.Y=e.Y};y.DoublePoint2=function(e,t){this.X=e,this.Y=t};y.PolyNode=function(){this.m_Parent=null,this.m_polygon=new y.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};y.PolyNode.prototype.IsHoleNode=function(){for(var e=!0,t=this.m_Parent;t!==null;)e=!e,t=t.m_Parent;return e};y.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};y.PolyNode.prototype.Contour=function(){return this.m_polygon};y.PolyNode.prototype.AddChild=function(e){var t=this.m_Childs.length;this.m_Childs.push(e),e.m_Parent=this,e.m_Index=t};y.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};y.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};y.PolyNode.prototype.Childs=function(){return this.m_Childs};y.PolyNode.prototype.Parent=function(){return this.m_Parent};y.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};y.PolyTree=function(){this.m_AllPolys=[],y.PolyNode.call(this)};y.PolyTree.prototype.Clear=function(){for(var e=0,t=this.m_AllPolys.length;e<t;e++)this.m_AllPolys[e]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};y.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};y.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};DI(y.PolyTree,y.PolyNode);y.Math_Abs_Int64=y.Math_Abs_Int32=y.Math_Abs_Double=function(e){return Math.abs(e)};y.Math_Max_Int32_Int32=function(e,t){return Math.max(e,t)};nt.msie||nt.opera||nt.safari?y.Cast_Int32=function(e){return e|0}:y.Cast_Int32=function(e){return~~e};nt.chrome?y.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:nt.firefox&&typeof Number.toInteger=="function"?y.Cast_Int64=function(e){return Number.toInteger(e)}:nt.msie7||nt.msie8?y.Cast_Int64=function(e){return parseInt(e,10)}:nt.msie?y.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):e|0}:y.Cast_Int64=function(e){return e<0?Math.ceil(e):Math.floor(e)};y.Clear=function(e){e.length=0};y.PI=3.141592653589793;y.PI2=2*3.141592653589793;y.IntPoint=function(){var e=arguments,t=e.length;if(this.X=0,this.Y=0,Zp)if(this.Z=0,t==3)this.X=e[0],this.Y=e[1],this.Z=e[2];else if(t==2)this.X=e[0],this.Y=e[1],this.Z=0;else if(t==1)if(e[0]instanceof y.DoublePoint){var r=e[0];this.X=y.Clipper.Round(r.X),this.Y=y.Clipper.Round(r.Y),this.Z=0}else{var n=e[0];typeof n.Z>"u"&&(n.Z=0),this.X=n.X,this.Y=n.Y,this.Z=n.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=e[0],this.Y=e[1];else if(t==1)if(e[0]instanceof y.DoublePoint){var r=e[0];this.X=y.Clipper.Round(r.X),this.Y=y.Clipper.Round(r.Y)}else{var n=e[0];this.X=n.X,this.Y=n.Y}else this.X=0,this.Y=0};y.IntPoint.op_Equality=function(e,t){return e.X==t.X&&e.Y==t.Y};y.IntPoint.op_Inequality=function(e,t){return e.X!=t.X||e.Y!=t.Y};Zp?(y.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},y.IntPoint1=function(e){this.X=e.X,this.Y=e.Y,this.Z=e.Z},y.IntPoint1dp=function(e){this.X=y.Clipper.Round(e.X),this.Y=y.Clipper.Round(e.Y),this.Z=0},y.IntPoint2=function(e,t){this.X=e,this.Y=t,this.Z=0},y.IntPoint3=function(e,t,r){this.X=e,this.Y=t,this.Z=r}):(y.IntPoint0=function(){this.X=0,this.Y=0},y.IntPoint1=function(e){this.X=e.X,this.Y=e.Y},y.IntPoint1dp=function(e){this.X=y.Clipper.Round(e.X),this.Y=y.Clipper.Round(e.Y)},y.IntPoint2=function(e,t){this.X=e,this.Y=t});y.IntRect=function(){var e=arguments,t=e.length;t==4?(this.left=e[0],this.top=e[1],this.right=e[2],this.bottom=e[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};y.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};y.IntRect1=function(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom};y.IntRect4=function(e,t,r,n){this.left=e,this.top=t,this.right=r,this.bottom=n};y.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};y.PolyType={ptSubject:0,ptClip:1};y.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};y.JoinType={jtSquare:0,jtRound:1,jtMiter:2};y.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};HZ&&(y.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});y.EdgeSide={esLeft:0,esRight:1};y.Direction={dRightToLeft:0,dLeftToRight:1};y.TEdge=function(){this.Bot=new y.IntPoint,this.Curr=new y.IntPoint,this.Top=new y.IntPoint,this.Delta=new y.IntPoint,this.Dx=0,this.PolyTyp=y.PolyType.ptSubject,this.Side=y.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};y.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new y.IntPoint};y.MyIntersectNodeSort=function(){};y.MyIntersectNodeSort.Compare=function(e,t){return t.Pt.Y-e.Pt.Y};y.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};y.Scanbeam=function(){this.Y=0,this.Next=null};y.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};y.OutPt=function(){this.Idx=0,this.Pt=new y.IntPoint,this.Next=null,this.Prev=null};y.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new y.IntPoint};y.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};y.ClipperBase.horizontal=-9007199254740992;y.ClipperBase.Skip=-2;y.ClipperBase.Unassigned=-1;y.ClipperBase.tolerance=1e-20;nSe?(y.ClipperBase.loRange=46340,y.ClipperBase.hiRange=46340):(y.ClipperBase.loRange=47453132,y.ClipperBase.hiRange=0xfffffffffffff);y.ClipperBase.near_zero=function(e){return e>-y.ClipperBase.tolerance&&e<y.ClipperBase.tolerance};y.ClipperBase.IsHorizontal=function(e){return e.Delta.Y===0};y.ClipperBase.prototype.PointIsVertex=function(e,t){var r=t;do{if(y.IntPoint.op_Equality(r.Pt,e))return!0;r=r.Next}while(r!=t);return!1};y.ClipperBase.prototype.PointOnLineSegment=function(e,t,r,n){return n?e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&et.op_Equality(et.Int128Mul(e.X-t.X,r.Y-t.Y),et.Int128Mul(r.X-t.X,e.Y-t.Y)):e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&(e.X-t.X)*(r.Y-t.Y)==(r.X-t.X)*(e.Y-t.Y)};y.ClipperBase.prototype.PointOnPolygon=function(e,t,r){for(var n=t;;){if(this.PointOnLineSegment(e,n.Pt,n.Next.Pt,r))return!0;if(n=n.Next,n==t)break}return!1};y.ClipperBase.prototype.SlopesEqual=y.ClipperBase.SlopesEqual=function(){var e=arguments,t=e.length,r,n,o,i,s,a,l;return t==3?(r=e[0],n=e[1],l=e[2],l?et.op_Equality(et.Int128Mul(r.Delta.Y,n.Delta.X),et.Int128Mul(r.Delta.X,n.Delta.Y)):y.Cast_Int64(r.Delta.Y*n.Delta.X)==y.Cast_Int64(r.Delta.X*n.Delta.Y)):t==4?(o=e[0],i=e[1],s=e[2],l=e[3],l?et.op_Equality(et.Int128Mul(o.Y-i.Y,i.X-s.X),et.Int128Mul(o.X-i.X,i.Y-s.Y)):y.Cast_Int64((o.Y-i.Y)*(i.X-s.X))-y.Cast_Int64((o.X-i.X)*(i.Y-s.Y))===0):(o=e[0],i=e[1],s=e[2],a=e[3],l=e[4],l?et.op_Equality(et.Int128Mul(o.Y-i.Y,s.X-a.X),et.Int128Mul(o.X-i.X,s.Y-a.Y)):y.Cast_Int64((o.Y-i.Y)*(s.X-a.X))-y.Cast_Int64((o.X-i.X)*(s.Y-a.Y))===0)};y.ClipperBase.SlopesEqual3=function(e,t,r){return r?et.op_Equality(et.Int128Mul(e.Delta.Y,t.Delta.X),et.Int128Mul(e.Delta.X,t.Delta.Y)):y.Cast_Int64(e.Delta.Y*t.Delta.X)==y.Cast_Int64(e.Delta.X*t.Delta.Y)};y.ClipperBase.SlopesEqual4=function(e,t,r,n){return n?et.op_Equality(et.Int128Mul(e.Y-t.Y,t.X-r.X),et.Int128Mul(e.X-t.X,t.Y-r.Y)):y.Cast_Int64((e.Y-t.Y)*(t.X-r.X))-y.Cast_Int64((e.X-t.X)*(t.Y-r.Y))===0};y.ClipperBase.SlopesEqual5=function(e,t,r,n,o){return o?et.op_Equality(et.Int128Mul(e.Y-t.Y,r.X-n.X),et.Int128Mul(e.X-t.X,r.Y-n.Y)):y.Cast_Int64((e.Y-t.Y)*(r.X-n.X))-y.Cast_Int64((e.X-t.X)*(r.Y-n.Y))===0};y.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var e=0,t=this.m_edges.length;e<t;++e){for(var r=0,n=this.m_edges[e].length;r<n;++r)this.m_edges[e][r]=null;y.Clear(this.m_edges[e])}y.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};y.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var e=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=e}this.m_CurrentLM=null};y.ClipperBase.prototype.RangeTest=function(e,t){t.Value?(e.X>y.ClipperBase.hiRange||e.Y>y.ClipperBase.hiRange||-e.X>y.ClipperBase.hiRange||-e.Y>y.ClipperBase.hiRange)&&y.Error("Coordinate outside allowed range in RangeTest()."):(e.X>y.ClipperBase.loRange||e.Y>y.ClipperBase.loRange||-e.X>y.ClipperBase.loRange||-e.Y>y.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(e,t))};y.ClipperBase.prototype.InitEdge=function(e,t,r,n){e.Next=t,e.Prev=r,e.Curr.X=n.X,e.Curr.Y=n.Y,e.OutIdx=-1};y.ClipperBase.prototype.InitEdge2=function(e,t){e.Curr.Y>=e.Next.Curr.Y?(e.Bot.X=e.Curr.X,e.Bot.Y=e.Curr.Y,e.Top.X=e.Next.Curr.X,e.Top.Y=e.Next.Curr.Y):(e.Top.X=e.Curr.X,e.Top.Y=e.Curr.Y,e.Bot.X=e.Next.Curr.X,e.Bot.Y=e.Next.Curr.Y),this.SetDx(e),e.PolyTyp=t};y.ClipperBase.prototype.FindNextLocMin=function(e){for(var t;;){for(;y.IntPoint.op_Inequality(e.Bot,e.Prev.Bot)||y.IntPoint.op_Equality(e.Curr,e.Top);)e=e.Next;if(e.Dx!=y.ClipperBase.horizontal&&e.Prev.Dx!=y.ClipperBase.horizontal)break;for(;e.Prev.Dx==y.ClipperBase.horizontal;)e=e.Prev;for(t=e;e.Dx==y.ClipperBase.horizontal;)e=e.Next;if(e.Top.Y!=e.Prev.Bot.Y){t.Prev.Bot.X<e.Bot.X&&(e=t);break}}return e};y.ClipperBase.prototype.ProcessBound=function(e,t){var r=e,n=e,o,i;if(e.Dx==y.ClipperBase.horizontal&&(t?i=e.Prev.Bot.X:i=e.Next.Bot.X,e.Bot.X!=i&&this.ReverseHorizontal(e)),n.OutIdx!=y.ClipperBase.Skip)if(t){for(;n.Top.Y==n.Next.Bot.Y&&n.Next.OutIdx!=y.ClipperBase.Skip;)n=n.Next;if(n.Dx==y.ClipperBase.horizontal&&n.Next.OutIdx!=y.ClipperBase.Skip){for(o=n;o.Prev.Dx==y.ClipperBase.horizontal;)o=o.Prev;o.Prev.Top.X==n.Next.Top.X?t||(n=o.Prev):o.Prev.Top.X>n.Next.Top.X&&(n=o.Prev)}for(;e!=n;)e.NextInLML=e.Next,e.Dx==y.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),e=e.Next;e.Dx==y.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),n=n.Next}else{for(;n.Top.Y==n.Prev.Bot.Y&&n.Prev.OutIdx!=y.ClipperBase.Skip;)n=n.Prev;if(n.Dx==y.ClipperBase.horizontal&&n.Prev.OutIdx!=y.ClipperBase.Skip){for(o=n;o.Next.Dx==y.ClipperBase.horizontal;)o=o.Next;o.Next.Top.X==n.Prev.Top.X?t||(n=o.Next):o.Next.Top.X>n.Prev.Top.X&&(n=o.Next)}for(;e!=n;)e.NextInLML=e.Prev,e.Dx==y.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),e=e.Prev;e.Dx==y.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),n=n.Prev}if(n.OutIdx==y.ClipperBase.Skip){if(e=n,t){for(;e.Top.Y==e.Next.Bot.Y;)e=e.Next;for(;e!=n&&e.Dx==y.ClipperBase.horizontal;)e=e.Prev}else{for(;e.Top.Y==e.Prev.Bot.Y;)e=e.Prev;for(;e!=n&&e.Dx==y.ClipperBase.horizontal;)e=e.Next}if(e==n)t?n=e.Next:n=e.Prev;else{t?e=n.Next:e=n.Prev;var s=new y.LocalMinima;s.Next=null,s.Y=e.Bot.Y,s.LeftBound=null,s.RightBound=e,s.RightBound.WindDelta=0,n=this.ProcessBound(s.RightBound,t),this.InsertLocalMinima(s)}}return n};y.ClipperBase.prototype.AddPath=function(e,t,r){zZ?!r&&t==y.PolyType.ptClip&&y.Error("AddPath: Open paths must be subject."):r||y.Error("AddPath: Open paths have been disabled.");var n=e.length-1;if(r)for(;n>0&&y.IntPoint.op_Equality(e[n],e[0]);)--n;for(;n>0&&y.IntPoint.op_Equality(e[n],e[n-1]);)--n;if(r&&n<2||!r&&n<1)return!1;for(var o=new Array,i=0;i<=n;i++)o.push(new y.TEdge);var s=!0;o[1].Curr.X=e[1].X,o[1].Curr.Y=e[1].Y;var a={Value:this.m_UseFullRange};this.RangeTest(e[0],a),this.m_UseFullRange=a.Value,a.Value=this.m_UseFullRange,this.RangeTest(e[n],a),this.m_UseFullRange=a.Value,this.InitEdge(o[0],o[1],o[n],e[0]),this.InitEdge(o[n],o[0],o[n-1],e[n]);for(var i=n-1;i>=1;--i)a.Value=this.m_UseFullRange,this.RangeTest(e[i],a),this.m_UseFullRange=a.Value,this.InitEdge(o[i],o[i+1],o[i-1],e[i]);for(var l=o[0],u=l,d=l;;){if(y.IntPoint.op_Equality(u.Curr,u.Next.Curr)){if(u==u.Next)break;u==l&&(l=u.Next),u=this.RemoveEdge(u),d=u;continue}if(u.Prev==u.Next)break;if(r&&y.ClipperBase.SlopesEqual(u.Prev.Curr,u.Curr,u.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(u.Prev.Curr,u.Curr,u.Next.Curr))){u==l&&(l=u.Next),u=this.RemoveEdge(u),u=u.Prev,d=u;continue}if(u=u.Next,u==d)break}if(!r&&u==u.Next||r&&u.Prev==u.Next)return!1;r||(this.m_HasOpenPaths=!0,l.Prev.OutIdx=y.ClipperBase.Skip);var f=l;u=l;do this.InitEdge2(u,t),u=u.Next,s&&u.Curr.Y!=l.Curr.Y&&(s=!1);while(u!=l);if(s){if(r)return!1;u.Prev.OutIdx=y.ClipperBase.Skip,u.Prev.Bot.X<u.Prev.Top.X&&this.ReverseHorizontal(u.Prev);var h=new y.LocalMinima;for(h.Next=null,h.Y=u.Bot.Y,h.LeftBound=null,h.RightBound=u,h.RightBound.Side=y.EdgeSide.esRight,h.RightBound.WindDelta=0;u.Next.OutIdx!=y.ClipperBase.Skip;)u.NextInLML=u.Next,u.Bot.X!=u.Prev.Top.X&&this.ReverseHorizontal(u),u=u.Next;return this.InsertLocalMinima(h),this.m_edges.push(o),!0}this.m_edges.push(o);for(var b,v=null;u=this.FindNextLocMin(u),u!=v;){v==null&&(v=u);var h=new y.LocalMinima;h.Next=null,h.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(h.LeftBound=u.Prev,h.RightBound=u,b=!1):(h.LeftBound=u,h.RightBound=u.Prev,b=!0),h.LeftBound.Side=y.EdgeSide.esLeft,h.RightBound.Side=y.EdgeSide.esRight,r?h.LeftBound.Next==h.RightBound?h.LeftBound.WindDelta=-1:h.LeftBound.WindDelta=1:h.LeftBound.WindDelta=0,h.RightBound.WindDelta=-h.LeftBound.WindDelta,u=this.ProcessBound(h.LeftBound,b);var I=this.ProcessBound(h.RightBound,!b);h.LeftBound.OutIdx==y.ClipperBase.Skip?h.LeftBound=null:h.RightBound.OutIdx==y.ClipperBase.Skip&&(h.RightBound=null),this.InsertLocalMinima(h),b||(u=I)}return!0};y.ClipperBase.prototype.AddPaths=function(e,t,r){for(var n=!1,o=0,i=e.length;o<i;++o)this.AddPath(e[o],t,r)&&(n=!0);return n};y.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(e,t,r){return y.IntPoint.op_Equality(e,r)||y.IntPoint.op_Equality(e,t)||y.IntPoint.op_Equality(r,t)?!1:e.X!=r.X?t.X>e.X==t.X<r.X:t.Y>e.Y==t.Y<r.Y};y.ClipperBase.prototype.RemoveEdge=function(e){e.Prev.Next=e.Next,e.Next.Prev=e.Prev;var t=e.Next;return e.Prev=null,t};y.ClipperBase.prototype.SetDx=function(e){e.Delta.X=e.Top.X-e.Bot.X,e.Delta.Y=e.Top.Y-e.Bot.Y,e.Delta.Y===0?e.Dx=y.ClipperBase.horizontal:e.Dx=e.Delta.X/e.Delta.Y};y.ClipperBase.prototype.InsertLocalMinima=function(e){if(this.m_MinimaList===null)this.m_MinimaList=e;else if(e.Y>=this.m_MinimaList.Y)e.Next=this.m_MinimaList,this.m_MinimaList=e;else{for(var t=this.m_MinimaList;t.Next!==null&&e.Y<t.Next.Y;)t=t.Next;e.Next=t.Next,t.Next=e}};y.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};y.ClipperBase.prototype.ReverseHorizontal=function(e){var t=e.Top.X;e.Top.X=e.Bot.X,e.Bot.X=t,Zp&&(t=e.Top.Z,e.Top.Z=e.Bot.Z,e.Bot.Z=t)};y.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var e=this.m_MinimaList;e!=null;){var t=e.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=y.EdgeSide.esLeft,t.OutIdx=y.ClipperBase.Unassigned),t=e.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=y.EdgeSide.esRight,t.OutIdx=y.ClipperBase.Unassigned),e=e.Next}};y.Clipper=function(e){typeof e>"u"&&(e=0),this.m_PolyOuts=null,this.m_ClipType=y.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=y.PolyFillType.pftEvenOdd,this.m_SubjFillType=y.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,y.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=y.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&e)!==0,this.StrictlySimple=(2&e)!==0,this.PreserveCollinear=(4&e)!==0,Zp&&(this.ZFillFunction=null)};y.Clipper.ioReverseSolution=1;y.Clipper.ioStrictlySimple=2;y.Clipper.ioPreserveCollinear=4;y.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),y.ClipperBase.prototype.Clear.call(this))};y.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var e=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=e}};y.Clipper.prototype.Reset=function(){y.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var e=this.m_MinimaList;e!==null;)this.InsertScanbeam(e.Y),e=e.Next};y.Clipper.prototype.InsertScanbeam=function(e){if(this.m_Scanbeam===null)this.m_Scanbeam=new y.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=e;else if(e>this.m_Scanbeam.Y){var t=new y.Scanbeam;t.Y=e,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var r=this.m_Scanbeam;r.Next!==null&&e<=r.Next.Y;)r=r.Next;if(e==r.Y)return;var t=new y.Scanbeam;t.Y=e,t.Next=r.Next,r.Next=t}};y.Clipper.prototype.Execute=function(){var e=arguments,t=e.length,r=e[1]instanceof y.PolyTree;if(t==4&&!r){var n=e[0],o=e[1],i=e[2],s=e[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&y.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,y.Clear(o),this.m_SubjFillType=i,this.m_ClipFillType=s,this.m_ClipType=n,this.m_UsingPolyTree=!1;try{var a=this.ExecuteInternal();a&&this.BuildResult(o)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return a}else if(t==4&&r){var n=e[0],l=e[1],i=e[2],s=e[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=i,this.m_ClipFillType=s,this.m_ClipType=n,this.m_UsingPolyTree=!0;try{var a=this.ExecuteInternal();a&&this.BuildResult2(l)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return a}else if(t==2&&!r){var n=e[0],o=e[1];return this.Execute(n,o,y.PolyFillType.pftEvenOdd,y.PolyFillType.pftEvenOdd)}else if(t==2&&r){var n=e[0],l=e[1];return this.Execute(n,l,y.PolyFillType.pftEvenOdd,y.PolyFillType.pftEvenOdd)}};y.Clipper.prototype.FixHoleLinkage=function(e){if(!(e.FirstLeft===null||e.IsHole!=e.FirstLeft.IsHole&&e.FirstLeft.Pts!==null)){for(var t=e.FirstLeft;t!==null&&(t.IsHole==e.IsHole||t.Pts===null);)t=t.FirstLeft;e.FirstLeft=t}};y.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var e=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(e),y.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(e,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),e=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var o=this.m_PolyOuts[r];o.Pts===null||o.IsOpen||(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)}this.JoinCommonEdges();for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var o=this.m_PolyOuts[r];o.Pts!==null&&!o.IsOpen&&this.FixupOutPolygon(o)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{y.Clear(this.m_Joins),y.Clear(this.m_GhostJoins)}};y.Clipper.prototype.PopScanbeam=function(){var e=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,e};y.Clipper.prototype.DisposeAllPolyPts=function(){for(var e=0,t=this.m_PolyOuts.length;e<t;++e)this.DisposeOutRec(e);y.Clear(this.m_PolyOuts)};y.Clipper.prototype.DisposeOutRec=function(e){var t=this.m_PolyOuts[e];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[e]=null};y.Clipper.prototype.DisposeOutPts=function(e){if(e!==null){var t=null;for(e.Prev.Next=null;e!==null;)t=e,e=e.Next,t=null}};y.Clipper.prototype.AddJoin=function(e,t,r){var n=new y.Join;n.OutPt1=e,n.OutPt2=t,n.OffPt.X=r.X,n.OffPt.Y=r.Y,this.m_Joins.push(n)};y.Clipper.prototype.AddGhostJoin=function(e,t){var r=new y.Join;r.OutPt1=e,r.OffPt.X=t.X,r.OffPt.Y=t.Y,this.m_GhostJoins.push(r)};Zp&&(y.Clipper.prototype.SetZ=function(e,t){e.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,e):this.ZFillFunction(t.Top,t.Bot,e))});y.Clipper.prototype.InsertLocalMinimaIntoAEL=function(e){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==e;){var t=this.m_CurrentLM.LeftBound,r=this.m_CurrentLM.RightBound;this.PopLocalMinima();var n=null;if(t===null?(this.InsertEdgeIntoAEL(r,null),this.SetWindingCount(r),this.IsContributing(r)&&(n=this.AddOutPt(r,r.Bot))):r==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(n=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(r,t),this.SetWindingCount(t),r.WindCnt=t.WindCnt,r.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(n=this.AddLocalMinPoly(t,r,t.Bot)),this.InsertScanbeam(t.Top.Y)),r!=null&&(y.ClipperBase.IsHorizontal(r)?this.AddEdgeToSEL(r):this.InsertScanbeam(r.Top.Y)),!(t==null||r==null)){if(n!==null&&y.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var o=0,i=this.m_GhostJoins.length;o<i;o++){var s=this.m_GhostJoins[o];this.HorzSegmentsOverlap(s.OutPt1.Pt,s.OffPt,r.Bot,r.Top)&&this.AddJoin(s.OutPt1,n,s.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&y.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var a=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(n,a,t.Top)}if(t.NextInAEL!=r){if(r.OutIdx>=0&&r.PrevInAEL.OutIdx>=0&&y.ClipperBase.SlopesEqual(r.PrevInAEL,r,this.m_UseFullRange)&&r.WindDelta!==0&&r.PrevInAEL.WindDelta!==0){var a=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(n,a,r.Top)}var l=t.NextInAEL;if(l!==null)for(;l!=r;)this.IntersectEdges(r,l,t.Curr,!1),l=l.NextInAEL}}}};y.Clipper.prototype.InsertEdgeIntoAEL=function(e,t){if(this.m_ActiveEdges===null)e.PrevInAEL=null,e.NextInAEL=null,this.m_ActiveEdges=e;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,e))e.PrevInAEL=null,e.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=e,this.m_ActiveEdges=e;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,e);)t=t.NextInAEL;e.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=e),e.PrevInAEL=t,t.NextInAEL=e}};y.Clipper.prototype.E2InsertsBeforeE1=function(e,t){return t.Curr.X==e.Curr.X?t.Top.Y>e.Top.Y?t.Top.X<y.Clipper.TopX(e,t.Top.Y):e.Top.X>y.Clipper.TopX(t,e.Top.Y):t.Curr.X<e.Curr.X};y.Clipper.prototype.IsEvenOddFillType=function(e){return e.PolyTyp==y.PolyType.ptSubject?this.m_SubjFillType==y.PolyFillType.pftEvenOdd:this.m_ClipFillType==y.PolyFillType.pftEvenOdd};y.Clipper.prototype.IsEvenOddAltFillType=function(e){return e.PolyTyp==y.PolyType.ptSubject?this.m_ClipFillType==y.PolyFillType.pftEvenOdd:this.m_SubjFillType==y.PolyFillType.pftEvenOdd};y.Clipper.prototype.IsContributing=function(e){var t,r;switch(e.PolyTyp==y.PolyType.ptSubject?(t=this.m_SubjFillType,r=this.m_ClipFillType):(t=this.m_ClipFillType,r=this.m_SubjFillType),t){case y.PolyFillType.pftEvenOdd:if(e.WindDelta===0&&e.WindCnt!=1)return!1;break;case y.PolyFillType.pftNonZero:if(Math.abs(e.WindCnt)!=1)return!1;break;case y.PolyFillType.pftPositive:if(e.WindCnt!=1)return!1;break;default:if(e.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case y.ClipType.ctIntersection:switch(r){case y.PolyFillType.pftEvenOdd:case y.PolyFillType.pftNonZero:return e.WindCnt2!==0;case y.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case y.ClipType.ctUnion:switch(r){case y.PolyFillType.pftEvenOdd:case y.PolyFillType.pftNonZero:return e.WindCnt2===0;case y.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}case y.ClipType.ctDifference:if(e.PolyTyp==y.PolyType.ptSubject)switch(r){case y.PolyFillType.pftEvenOdd:case y.PolyFillType.pftNonZero:return e.WindCnt2===0;case y.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else switch(r){case y.PolyFillType.pftEvenOdd:case y.PolyFillType.pftNonZero:return e.WindCnt2!==0;case y.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case y.ClipType.ctXor:if(e.WindDelta===0)switch(r){case y.PolyFillType.pftEvenOdd:case y.PolyFillType.pftNonZero:return e.WindCnt2===0;case y.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else return!0}return!0};y.Clipper.prototype.SetWindingCount=function(e){for(var t=e.PrevInAEL;t!==null&&(t.PolyTyp!=e.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)e.WindCnt=e.WindDelta===0?1:e.WindDelta,e.WindCnt2=0,t=this.m_ActiveEdges;else if(e.WindDelta===0&&this.m_ClipType!=y.ClipType.ctUnion)e.WindCnt=1,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(e)){if(e.WindDelta===0){for(var r=!0,n=t.PrevInAEL;n!==null;)n.PolyTyp==t.PolyTyp&&n.WindDelta!==0&&(r=!r),n=n.PrevInAEL;e.WindCnt=r?0:1}else e.WindCnt=e.WindDelta;e.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta:e.WindCnt=e.WindDelta===0?1:e.WindDelta:e.WindDelta===0?e.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(e))for(;t!=e;)t.WindDelta!==0&&(e.WindCnt2=e.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=e;)e.WindCnt2+=t.WindDelta,t=t.NextInAEL};y.Clipper.prototype.AddEdgeToSEL=function(e){this.m_SortedEdges===null?(this.m_SortedEdges=e,e.PrevInSEL=null,e.NextInSEL=null):(e.NextInSEL=this.m_SortedEdges,e.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=e,this.m_SortedEdges=e)};y.Clipper.prototype.CopyAELToSEL=function(){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e=e.NextInAEL};y.Clipper.prototype.SwapPositionsInAEL=function(e,t){if(!(e.NextInAEL==e.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(e.NextInAEL==t){var r=t.NextInAEL;r!==null&&(r.PrevInAEL=e);var n=e.PrevInAEL;n!==null&&(n.NextInAEL=t),t.PrevInAEL=n,t.NextInAEL=e,e.PrevInAEL=t,e.NextInAEL=r}else if(t.NextInAEL==e){var r=e.NextInAEL;r!==null&&(r.PrevInAEL=t);var n=t.PrevInAEL;n!==null&&(n.NextInAEL=e),e.PrevInAEL=n,e.NextInAEL=t,t.PrevInAEL=e,t.NextInAEL=r}else{var r=e.NextInAEL,n=e.PrevInAEL;e.NextInAEL=t.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=t.PrevInAEL,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e),t.NextInAEL=r,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=n,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}e.PrevInAEL===null?this.m_ActiveEdges=e:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};y.Clipper.prototype.SwapPositionsInSEL=function(e,t){if(!(e.NextInSEL===null&&e.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(e.NextInSEL==t){var r=t.NextInSEL;r!==null&&(r.PrevInSEL=e);var n=e.PrevInSEL;n!==null&&(n.NextInSEL=t),t.PrevInSEL=n,t.NextInSEL=e,e.PrevInSEL=t,e.NextInSEL=r}else if(t.NextInSEL==e){var r=e.NextInSEL;r!==null&&(r.PrevInSEL=t);var n=t.PrevInSEL;n!==null&&(n.NextInSEL=e),e.PrevInSEL=n,e.NextInSEL=t,t.PrevInSEL=e,t.NextInSEL=r}else{var r=e.NextInSEL,n=e.PrevInSEL;e.NextInSEL=t.NextInSEL,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=t.PrevInSEL,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e),t.NextInSEL=r,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=n,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}e.PrevInSEL===null?this.m_SortedEdges=e:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};y.Clipper.prototype.AddLocalMaxPoly=function(e,t,r){this.AddOutPt(e,r),t.WindDelta==0&&this.AddOutPt(t,r),e.OutIdx==t.OutIdx?(e.OutIdx=-1,t.OutIdx=-1):e.OutIdx<t.OutIdx?this.AppendPolygon(e,t):this.AppendPolygon(t,e)};y.Clipper.prototype.AddLocalMinPoly=function(e,t,r){var n,o,i;if(y.ClipperBase.IsHorizontal(t)||e.Dx>t.Dx?(n=this.AddOutPt(e,r),t.OutIdx=e.OutIdx,e.Side=y.EdgeSide.esLeft,t.Side=y.EdgeSide.esRight,o=e,o.PrevInAEL==t?i=t.PrevInAEL:i=o.PrevInAEL):(n=this.AddOutPt(t,r),e.OutIdx=t.OutIdx,e.Side=y.EdgeSide.esRight,t.Side=y.EdgeSide.esLeft,o=t,o.PrevInAEL==e?i=e.PrevInAEL:i=o.PrevInAEL),i!==null&&i.OutIdx>=0&&y.Clipper.TopX(i,r.Y)==y.Clipper.TopX(o,r.Y)&&y.ClipperBase.SlopesEqual(o,i,this.m_UseFullRange)&&o.WindDelta!==0&&i.WindDelta!==0){var s=this.AddOutPt(i,r);this.AddJoin(n,s,o.Top)}return n};y.Clipper.prototype.CreateOutRec=function(){var e=new y.OutRec;return e.Idx=-1,e.IsHole=!1,e.IsOpen=!1,e.FirstLeft=null,e.Pts=null,e.BottomPt=null,e.PolyNode=null,this.m_PolyOuts.push(e),e.Idx=this.m_PolyOuts.length-1,e};y.Clipper.prototype.AddOutPt=function(e,t){var r=e.Side==y.EdgeSide.esLeft;if(e.OutIdx<0){var n=this.CreateOutRec();n.IsOpen=e.WindDelta===0;var o=new y.OutPt;return n.Pts=o,o.Idx=n.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=o,o.Prev=o,n.IsOpen||this.SetHoleState(e,n),Zp&&(y.IntPoint.op_Equality(t,e.Bot)?(o.Pt.X=e.Bot.X,o.Pt.Y=e.Bot.Y,o.Pt.Z=e.Bot.Z):y.IntPoint.op_Equality(t,e.Top)?(o.Pt.X=e.Top.X,o.Pt.Y=e.Top.Y,o.Pt.Z=e.Top.Z):this.SetZ(o.Pt,e)),e.OutIdx=n.Idx,o}else{var n=this.m_PolyOuts[e.OutIdx],i=n.Pts;if(r&&y.IntPoint.op_Equality(t,i.Pt))return i;if(!r&&y.IntPoint.op_Equality(t,i.Prev.Pt))return i.Prev;var o=new y.OutPt;return o.Idx=n.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=i,o.Prev=i.Prev,o.Prev.Next=o,i.Prev=o,r&&(n.Pts=o),Zp&&(y.IntPoint.op_Equality(t,e.Bot)?(o.Pt.X=e.Bot.X,o.Pt.Y=e.Bot.Y,o.Pt.Z=e.Bot.Z):y.IntPoint.op_Equality(t,e.Top)?(o.Pt.X=e.Top.X,o.Pt.Y=e.Top.Y,o.Pt.Z=e.Top.Z):this.SetZ(o.Pt,e)),o}};y.Clipper.prototype.SwapPoints=function(e,t){var r=new y.IntPoint(e.Value);e.Value.X=t.Value.X,e.Value.Y=t.Value.Y,t.Value.X=r.X,t.Value.Y=r.Y};y.Clipper.prototype.HorzSegmentsOverlap=function(e,t,r,n){return e.X>r.X==e.X<n.X||t.X>r.X==t.X<n.X||r.X>e.X==r.X<t.X||n.X>e.X==n.X<t.X||e.X==r.X&&t.X==n.X?!0:e.X==n.X&&t.X==r.X};y.Clipper.prototype.InsertPolyPtBetween=function(e,t,r){var n=new y.OutPt;return n.Pt.X=r.X,n.Pt.Y=r.Y,t==e.Next?(e.Next=n,t.Prev=n,n.Next=t,n.Prev=e):(t.Next=n,e.Prev=n,n.Next=e,n.Prev=t),n};y.Clipper.prototype.SetHoleState=function(e,t){for(var r=!1,n=e.PrevInAEL;n!==null;)n.OutIdx>=0&&n.WindDelta!=0&&(r=!r,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[n.OutIdx])),n=n.PrevInAEL;r&&(t.IsHole=!0)};y.Clipper.prototype.GetDx=function(e,t){return e.Y==t.Y?y.ClipperBase.horizontal:(t.X-e.X)/(t.Y-e.Y)};y.Clipper.prototype.FirstIsBottomPt=function(e,t){for(var r=e.Prev;y.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Prev;var n=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=e.Next;y.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Next;var o=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=t.Prev;y.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Prev;var i=Math.abs(this.GetDx(t.Pt,r.Pt));for(r=t.Next;y.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Next;var s=Math.abs(this.GetDx(t.Pt,r.Pt));return n>=i&&n>=s||o>=i&&o>=s};y.Clipper.prototype.GetBottomPt=function(e){for(var t=null,r=e.Next;r!=e;)r.Pt.Y>e.Pt.Y?(e=r,t=null):r.Pt.Y==e.Pt.Y&&r.Pt.X<=e.Pt.X&&(r.Pt.X<e.Pt.X?(t=null,e=r):r.Next!=e&&r.Prev!=e&&(t=r)),r=r.Next;if(t!==null)for(;t!=r;)for(this.FirstIsBottomPt(r,t)||(e=t),t=t.Next;y.IntPoint.op_Inequality(t.Pt,e.Pt);)t=t.Next;return e};y.Clipper.prototype.GetLowermostRec=function(e,t){e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var r=e.BottomPt,n=t.BottomPt;return r.Pt.Y>n.Pt.Y?e:r.Pt.Y<n.Pt.Y?t:r.Pt.X<n.Pt.X?e:r.Pt.X>n.Pt.X||r.Next==r?t:n.Next==n||this.FirstIsBottomPt(r,n)?e:t};y.Clipper.prototype.Param1RightOfParam2=function(e,t){do if(e=e.FirstLeft,e==t)return!0;while(e!==null);return!1};y.Clipper.prototype.GetOutRec=function(e){for(var t=this.m_PolyOuts[e];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};y.Clipper.prototype.AppendPolygon=function(e,t){var r=this.m_PolyOuts[e.OutIdx],n=this.m_PolyOuts[t.OutIdx],o;this.Param1RightOfParam2(r,n)?o=n:this.Param1RightOfParam2(n,r)?o=r:o=this.GetLowermostRec(r,n);var i=r.Pts,s=i.Prev,a=n.Pts,l=a.Prev,u;e.Side==y.EdgeSide.esLeft?(t.Side==y.EdgeSide.esLeft?(this.ReversePolyPtLinks(a),a.Next=i,i.Prev=a,s.Next=l,l.Prev=s,r.Pts=l):(l.Next=i,i.Prev=l,a.Prev=s,s.Next=a,r.Pts=a),u=y.EdgeSide.esLeft):(t.Side==y.EdgeSide.esRight?(this.ReversePolyPtLinks(a),s.Next=l,l.Prev=s,a.Next=i,i.Prev=a):(s.Next=a,a.Prev=s,i.Prev=l,l.Next=i),u=y.EdgeSide.esRight),r.BottomPt=null,o==n&&(n.FirstLeft!=r&&(r.FirstLeft=n.FirstLeft),r.IsHole=n.IsHole),n.Pts=null,n.BottomPt=null,n.FirstLeft=r;var d=e.OutIdx,f=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var h=this.m_ActiveEdges;h!==null;){if(h.OutIdx==f){h.OutIdx=d,h.Side=u;break}h=h.NextInAEL}n.Idx=r.Idx};y.Clipper.prototype.ReversePolyPtLinks=function(e){if(e!==null){var t,r;t=e;do r=t.Next,t.Next=t.Prev,t.Prev=r,t=r;while(t!=e)}};y.Clipper.SwapSides=function(e,t){var r=e.Side;e.Side=t.Side,t.Side=r};y.Clipper.SwapPolyIndexes=function(e,t){var r=e.OutIdx;e.OutIdx=t.OutIdx,t.OutIdx=r};y.Clipper.prototype.IntersectEdges=function(e,t,r,n){var o=!n&&e.NextInLML===null&&e.Top.X==r.X&&e.Top.Y==r.Y,i=!n&&t.NextInLML===null&&t.Top.X==r.X&&t.Top.Y==r.Y,s=e.OutIdx>=0,a=t.OutIdx>=0;if(zZ&&(e.WindDelta===0||t.WindDelta===0)){e.WindDelta===0&&t.WindDelta===0?(o||i)&&s&&a&&this.AddLocalMaxPoly(e,t,r):e.PolyTyp==t.PolyTyp&&e.WindDelta!=t.WindDelta&&this.m_ClipType==y.ClipType.ctUnion?e.WindDelta===0?a&&(this.AddOutPt(e,r),s&&(e.OutIdx=-1)):s&&(this.AddOutPt(t,r),a&&(t.OutIdx=-1)):e.PolyTyp!=t.PolyTyp&&(e.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=y.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(e,r),s&&(e.OutIdx=-1)):t.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=y.ClipType.ctUnion||e.WindCnt2===0)&&(this.AddOutPt(t,r),a&&(t.OutIdx=-1))),o&&(e.OutIdx<0?this.DeleteFromAEL(e):y.Error("Error intersecting polylines")),i&&(t.OutIdx<0?this.DeleteFromAEL(t):y.Error("Error intersecting polylines"));return}if(e.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(e)){var l=e.WindCnt;e.WindCnt=t.WindCnt,t.WindCnt=l}else e.WindCnt+t.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt+=t.WindDelta,t.WindCnt-e.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=e.WindDelta;else this.IsEvenOddFillType(t)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(e)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=e.WindDelta;var u,d,f,h;e.PolyTyp==y.PolyType.ptSubject?(u=this.m_SubjFillType,f=this.m_ClipFillType):(u=this.m_ClipFillType,f=this.m_SubjFillType),t.PolyTyp==y.PolyType.ptSubject?(d=this.m_SubjFillType,h=this.m_ClipFillType):(d=this.m_ClipFillType,h=this.m_SubjFillType);var b,v;switch(u){case y.PolyFillType.pftPositive:b=e.WindCnt;break;case y.PolyFillType.pftNegative:b=-e.WindCnt;break;default:b=Math.abs(e.WindCnt);break}switch(d){case y.PolyFillType.pftPositive:v=t.WindCnt;break;case y.PolyFillType.pftNegative:v=-t.WindCnt;break;default:v=Math.abs(t.WindCnt);break}if(s&&a)o||i||b!==0&&b!=1||v!==0&&v!=1||e.PolyTyp!=t.PolyTyp&&this.m_ClipType!=y.ClipType.ctXor?this.AddLocalMaxPoly(e,t,r):(this.AddOutPt(e,r),this.AddOutPt(t,r),y.Clipper.SwapSides(e,t),y.Clipper.SwapPolyIndexes(e,t));else if(s)(v===0||v==1)&&(this.AddOutPt(e,r),y.Clipper.SwapSides(e,t),y.Clipper.SwapPolyIndexes(e,t));else if(a)(b===0||b==1)&&(this.AddOutPt(t,r),y.Clipper.SwapSides(e,t),y.Clipper.SwapPolyIndexes(e,t));else if((b===0||b==1)&&(v===0||v==1)&&!o&&!i){var I,x;switch(f){case y.PolyFillType.pftPositive:I=e.WindCnt2;break;case y.PolyFillType.pftNegative:I=-e.WindCnt2;break;default:I=Math.abs(e.WindCnt2);break}switch(h){case y.PolyFillType.pftPositive:x=t.WindCnt2;break;case y.PolyFillType.pftNegative:x=-t.WindCnt2;break;default:x=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(b==1&&v==1)switch(this.m_ClipType){case y.ClipType.ctIntersection:I>0&&x>0&&this.AddLocalMinPoly(e,t,r);break;case y.ClipType.ctUnion:I<=0&&x<=0&&this.AddLocalMinPoly(e,t,r);break;case y.ClipType.ctDifference:(e.PolyTyp==y.PolyType.ptClip&&I>0&&x>0||e.PolyTyp==y.PolyType.ptSubject&&I<=0&&x<=0)&&this.AddLocalMinPoly(e,t,r);break;case y.ClipType.ctXor:this.AddLocalMinPoly(e,t,r);break}else y.Clipper.SwapSides(e,t)}o!=i&&(o&&e.OutIdx>=0||i&&t.OutIdx>=0)&&(y.Clipper.SwapSides(e,t),y.Clipper.SwapPolyIndexes(e,t)),o&&this.DeleteFromAEL(e),i&&this.DeleteFromAEL(t)};y.Clipper.prototype.DeleteFromAEL=function(e){var t=e.PrevInAEL,r=e.NextInAEL;t===null&&r===null&&e!=this.m_ActiveEdges||(t!==null?t.NextInAEL=r:this.m_ActiveEdges=r,r!==null&&(r.PrevInAEL=t),e.NextInAEL=null,e.PrevInAEL=null)};y.Clipper.prototype.DeleteFromSEL=function(e){var t=e.PrevInSEL,r=e.NextInSEL;t===null&&r===null&&e!=this.m_SortedEdges||(t!==null?t.NextInSEL=r:this.m_SortedEdges=r,r!==null&&(r.PrevInSEL=t),e.NextInSEL=null,e.PrevInSEL=null)};y.Clipper.prototype.UpdateEdgeIntoAEL=function(e){e.NextInLML===null&&y.Error("UpdateEdgeIntoAEL: invalid call");var t=e.PrevInAEL,r=e.NextInAEL;return e.NextInLML.OutIdx=e.OutIdx,t!==null?t.NextInAEL=e.NextInLML:this.m_ActiveEdges=e.NextInLML,r!==null&&(r.PrevInAEL=e.NextInLML),e.NextInLML.Side=e.Side,e.NextInLML.WindDelta=e.WindDelta,e.NextInLML.WindCnt=e.WindCnt,e.NextInLML.WindCnt2=e.WindCnt2,e=e.NextInLML,e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.PrevInAEL=t,e.NextInAEL=r,y.ClipperBase.IsHorizontal(e)||this.InsertScanbeam(e.Top.Y),e};y.Clipper.prototype.ProcessHorizontals=function(e){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,e),t=this.m_SortedEdges};y.Clipper.prototype.GetHorzDirection=function(e,t){e.Bot.X<e.Top.X?(t.Left=e.Bot.X,t.Right=e.Top.X,t.Dir=y.Direction.dLeftToRight):(t.Left=e.Top.X,t.Right=e.Bot.X,t.Dir=y.Direction.dRightToLeft)};y.Clipper.prototype.PrepareHorzJoins=function(e,t){var r=this.m_PolyOuts[e.OutIdx].Pts;e.Side!=y.EdgeSide.esLeft&&(r=r.Prev),t&&(y.IntPoint.op_Equality(r.Pt,e.Top)?this.AddGhostJoin(r,e.Bot):this.AddGhostJoin(r,e.Top))};y.Clipper.prototype.ProcessHorizontal=function(e,t){var r={Dir:null,Left:null,Right:null};this.GetHorzDirection(e,r);for(var n=r.Dir,o=r.Left,i=r.Right,s=e,a=null;s.NextInLML!==null&&y.ClipperBase.IsHorizontal(s.NextInLML);)s=s.NextInLML;for(s.NextInLML===null&&(a=this.GetMaximaPair(s));;){for(var l=e==s,u=this.GetNextInAEL(e,n);u!==null&&!(u.Curr.X==e.Top.X&&e.NextInLML!==null&&u.Dx<e.NextInLML.Dx);){var d=this.GetNextInAEL(u,n);if(n==y.Direction.dLeftToRight&&u.Curr.X<=i||n==y.Direction.dRightToLeft&&u.Curr.X>=o){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),u==a&&l){n==y.Direction.dLeftToRight?this.IntersectEdges(e,u,u.Top,!1):this.IntersectEdges(u,e,u.Top,!1),a.OutIdx>=0&&y.Error("ProcessHorizontal error");return}else if(n==y.Direction.dLeftToRight){var f=new y.IntPoint(u.Curr.X,e.Curr.Y);this.IntersectEdges(e,u,f,!0)}else{var f=new y.IntPoint(u.Curr.X,e.Curr.Y);this.IntersectEdges(u,e,f,!0)}this.SwapPositionsInAEL(e,u)}else if(n==y.Direction.dLeftToRight&&u.Curr.X>=i||n==y.Direction.dRightToLeft&&u.Curr.X<=o)break;u=d}if(e.OutIdx>=0&&e.WindDelta!==0&&this.PrepareHorzJoins(e,t),e.NextInLML!==null&&y.ClipperBase.IsHorizontal(e.NextInLML)){e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot);var r={Dir:n,Left:o,Right:i};this.GetHorzDirection(e,r),n=r.Dir,o=r.Left,i=r.Right}else break}if(e.NextInLML!==null)if(e.OutIdx>=0){var h=this.AddOutPt(e,e.Top);if(e=this.UpdateEdgeIntoAEL(e),e.WindDelta===0)return;var b=e.PrevInAEL,d=e.NextInAEL;if(b!==null&&b.Curr.X==e.Bot.X&&b.Curr.Y==e.Bot.Y&&b.WindDelta!==0&&b.OutIdx>=0&&b.Curr.Y>b.Top.Y&&y.ClipperBase.SlopesEqual(e,b,this.m_UseFullRange)){var v=this.AddOutPt(b,e.Bot);this.AddJoin(h,v,e.Top)}else if(d!==null&&d.Curr.X==e.Bot.X&&d.Curr.Y==e.Bot.Y&&d.WindDelta!==0&&d.OutIdx>=0&&d.Curr.Y>d.Top.Y&&y.ClipperBase.SlopesEqual(e,d,this.m_UseFullRange)){var v=this.AddOutPt(d,e.Bot);this.AddJoin(h,v,e.Top)}}else e=this.UpdateEdgeIntoAEL(e);else a!==null?a.OutIdx>=0?(n==y.Direction.dLeftToRight?this.IntersectEdges(e,a,e.Top,!1):this.IntersectEdges(a,e,e.Top,!1),a.OutIdx>=0&&y.Error("ProcessHorizontal error")):(this.DeleteFromAEL(e),this.DeleteFromAEL(a)):(e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e))};y.Clipper.prototype.GetNextInAEL=function(e,t){return t==y.Direction.dLeftToRight?e.NextInAEL:e.PrevInAEL};y.Clipper.prototype.IsMinima=function(e){return e!==null&&e.Prev.NextInLML!=e&&e.Next.NextInLML!=e};y.Clipper.prototype.IsMaxima=function(e,t){return e!==null&&e.Top.Y==t&&e.NextInLML===null};y.Clipper.prototype.IsIntermediate=function(e,t){return e.Top.Y==t&&e.NextInLML!==null};y.Clipper.prototype.GetMaximaPair=function(e){var t=null;return y.IntPoint.op_Equality(e.Next.Top,e.Top)&&e.Next.NextInLML===null?t=e.Next:y.IntPoint.op_Equality(e.Prev.Top,e.Top)&&e.Prev.NextInLML===null&&(t=e.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!y.ClipperBase.IsHorizontal(t))?null:t};y.Clipper.prototype.ProcessIntersections=function(e,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(e,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch{this.m_SortedEdges=null,this.m_IntersectList.length=0,y.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};y.Clipper.prototype.BuildIntersectList=function(e,t){if(this.m_ActiveEdges!==null){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r.Curr.X=y.Clipper.TopX(r,t),r=r.NextInAEL;for(var n=!0;n&&this.m_SortedEdges!==null;){for(n=!1,r=this.m_SortedEdges;r.NextInSEL!==null;){var o=r.NextInSEL,i=new y.IntPoint;if(r.Curr.X>o.Curr.X){!this.IntersectPoint(r,o,i)&&r.Curr.X>o.Curr.X+1&&y.Error("Intersection error"),i.Y>e&&(i.Y=e,Math.abs(r.Dx)>Math.abs(o.Dx)?i.X=y.Clipper.TopX(o,e):i.X=y.Clipper.TopX(r,e));var s=new y.IntersectNode;s.Edge1=r,s.Edge2=o,s.Pt.X=i.X,s.Pt.Y=i.Y,this.m_IntersectList.push(s),this.SwapPositionsInSEL(r,o),n=!0}else r=o}if(r.PrevInSEL!==null)r.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};y.Clipper.prototype.EdgesAdjacent=function(e){return e.Edge1.NextInSEL==e.Edge2||e.Edge1.PrevInSEL==e.Edge2};y.Clipper.IntersectNodeSort=function(e,t){return t.Pt.Y-e.Pt.Y};y.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var e=this.m_IntersectList.length,t=0;t<e;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var r=t+1;r<e&&!this.EdgesAdjacent(this.m_IntersectList[r]);)r++;if(r==e)return!1;var n=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[r],this.m_IntersectList[r]=n}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};y.Clipper.prototype.ProcessIntersectList=function(){for(var e=0,t=this.m_IntersectList.length;e<t;e++){var r=this.m_IntersectList[e];this.IntersectEdges(r.Edge1,r.Edge2,r.Pt,!0),this.SwapPositionsInAEL(r.Edge1,r.Edge2)}this.m_IntersectList.length=0};var H3e=function(e){return e<0?Math.ceil(e-.5):Math.round(e)},W3e=function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},q3e=function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},Z3e=function(e){return e<0?(e-=.5,e<-2147483648?Math.ceil(e):e|0):(e+=.5,e>2147483647?Math.floor(e):e|0)};nt.msie?y.Clipper.Round=H3e:nt.chromium?y.Clipper.Round=q3e:nt.safari?y.Clipper.Round=Z3e:y.Clipper.Round=W3e;y.Clipper.TopX=function(e,t){return t==e.Top.Y?e.Top.X:e.Bot.X+y.Clipper.Round(e.Dx*(t-e.Bot.Y))};y.Clipper.prototype.IntersectPoint=function(e,t,r){r.X=0,r.Y=0;var n,o;if(y.ClipperBase.SlopesEqual(e,t,this.m_UseFullRange)||e.Dx==t.Dx)return t.Bot.Y>e.Bot.Y?(r.X=t.Bot.X,r.Y=t.Bot.Y):(r.X=e.Bot.X,r.Y=e.Bot.Y),!1;if(e.Delta.X===0)r.X=e.Bot.X,y.ClipperBase.IsHorizontal(t)?r.Y=t.Bot.Y:(o=t.Bot.Y-t.Bot.X/t.Dx,r.Y=y.Clipper.Round(r.X/t.Dx+o));else if(t.Delta.X===0)r.X=t.Bot.X,y.ClipperBase.IsHorizontal(e)?r.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,r.Y=y.Clipper.Round(r.X/e.Dx+n));else{n=e.Bot.X-e.Bot.Y*e.Dx,o=t.Bot.X-t.Bot.Y*t.Dx;var i=(o-n)/(e.Dx-t.Dx);r.Y=y.Clipper.Round(i),Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=y.Clipper.Round(e.Dx*i+n):r.X=y.Clipper.Round(t.Dx*i+o)}if(r.Y<e.Top.Y||r.Y<t.Top.Y){if(e.Top.Y>t.Top.Y)return r.Y=e.Top.Y,r.X=y.Clipper.TopX(t,e.Top.Y),r.X<e.Top.X;r.Y=t.Top.Y,Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=y.Clipper.TopX(e,r.Y):r.X=y.Clipper.TopX(t,r.Y)}return!0};y.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(e){for(var t=this.m_ActiveEdges;t!==null;){var r=this.IsMaxima(t,e);if(r){var n=this.GetMaximaPair(t);r=n===null||!y.ClipperBase.IsHorizontal(n)}if(r){var o=t.PrevInAEL;this.DoMaxima(t),o===null?t=this.m_ActiveEdges:t=o.NextInAEL}else{if(this.IsIntermediate(t,e)&&y.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=y.Clipper.TopX(t,e),t.Curr.Y=e),this.StrictlySimple){var o=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&o!==null&&o.OutIdx>=0&&o.Curr.X==t.Curr.X&&o.WindDelta!==0){var i=this.AddOutPt(o,t.Curr),s=this.AddOutPt(t,t.Curr);this.AddJoin(i,s,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,e)){var i=null;t.OutIdx>=0&&(i=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var o=t.PrevInAEL,a=t.NextInAEL;if(o!==null&&o.Curr.X==t.Bot.X&&o.Curr.Y==t.Bot.Y&&i!==null&&o.OutIdx>=0&&o.Curr.Y>o.Top.Y&&y.ClipperBase.SlopesEqual(t,o,this.m_UseFullRange)&&t.WindDelta!==0&&o.WindDelta!==0){var s=this.AddOutPt(o,t.Bot);this.AddJoin(i,s,t.Top)}else if(a!==null&&a.Curr.X==t.Bot.X&&a.Curr.Y==t.Bot.Y&&i!==null&&a.OutIdx>=0&&a.Curr.Y>a.Top.Y&&y.ClipperBase.SlopesEqual(t,a,this.m_UseFullRange)&&t.WindDelta!==0&&a.WindDelta!==0){var s=this.AddOutPt(a,t.Bot);this.AddJoin(i,s,t.Top)}}t=t.NextInAEL}};y.Clipper.prototype.DoMaxima=function(e){var t=this.GetMaximaPair(e);if(t===null){e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e);return}for(var r=e.NextInAEL,n=!0;r!==null&&r!=t;)this.IntersectEdges(e,r,e.Top,!0),this.SwapPositionsInAEL(e,r),r=e.NextInAEL;e.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(e),this.DeleteFromAEL(t)):e.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(e,t,e.Top,!1):n&&e.WindDelta===0?(e.OutIdx>=0&&(this.AddOutPt(e,e.Top),e.OutIdx=-1),this.DeleteFromAEL(e),t.OutIdx>=0&&(this.AddOutPt(t,e.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):y.Error("DoMaxima error")};y.Clipper.ReversePaths=function(e){for(var t=0,r=e.length;t<r;t++)e[t].reverse()};y.Clipper.Orientation=function(e){return y.Clipper.Area(e)>=0};y.Clipper.prototype.PointCount=function(e){if(e===null)return 0;var t=0,r=e;do t++,r=r.Next;while(r!=e);return t};y.Clipper.prototype.BuildResult=function(e){y.Clear(e);for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];if(n.Pts!==null){var o=n.Pts.Prev,i=this.PointCount(o);if(!(i<2)){for(var s=new Array(i),a=0;a<i;a++)s[a]=o.Pt,o=o.Prev;e.push(s)}}}};y.Clipper.prototype.BuildResult2=function(e){e.Clear();for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t],o=this.PointCount(n.Pts);if(!(n.IsOpen&&o<2||!n.IsOpen&&o<3)){this.FixHoleLinkage(n);var i=new y.PolyNode;e.m_AllPolys.push(i),n.PolyNode=i,i.m_polygon.length=o;for(var s=n.Pts.Prev,a=0;a<o;a++)i.m_polygon[a]=s.Pt,s=s.Prev}}for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];n.PolyNode!==null&&(n.IsOpen?(n.PolyNode.IsOpen=!0,e.AddChild(n.PolyNode)):n.FirstLeft!==null&&n.FirstLeft.PolyNode!=null?n.FirstLeft.PolyNode.AddChild(n.PolyNode):e.AddChild(n.PolyNode))}};y.Clipper.prototype.FixupOutPolygon=function(e){var t=null;e.BottomPt=null;for(var r=e.Pts;;){if(r.Prev==r||r.Prev==r.Next){this.DisposeOutPts(r),e.Pts=null;return}if(y.IntPoint.op_Equality(r.Pt,r.Next.Pt)||y.IntPoint.op_Equality(r.Pt,r.Prev.Pt)||y.ClipperBase.SlopesEqual(r.Prev.Pt,r.Pt,r.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(r.Prev.Pt,r.Pt,r.Next.Pt))){t=null;var n=r;r.Prev.Next=r.Next,r.Next.Prev=r.Prev,r=r.Prev,n=null}else{if(r==t)break;t===null&&(t=r),r=r.Next}}e.Pts=r};y.Clipper.prototype.DupOutPt=function(e,t){var r=new y.OutPt;return r.Pt.X=e.Pt.X,r.Pt.Y=e.Pt.Y,r.Idx=e.Idx,t?(r.Next=e.Next,r.Prev=e,e.Next.Prev=r,e.Next=r):(r.Prev=e.Prev,r.Next=e,e.Prev.Next=r,e.Prev=r),r};y.Clipper.prototype.GetOverlap=function(e,t,r,n,o){return e<t?r<n?(o.Left=Math.max(e,r),o.Right=Math.min(t,n)):(o.Left=Math.max(e,n),o.Right=Math.min(t,r)):r<n?(o.Left=Math.max(t,r),o.Right=Math.min(e,n)):(o.Left=Math.max(t,n),o.Right=Math.min(e,r)),o.Left<o.Right};y.Clipper.prototype.JoinHorz=function(e,t,r,n,o,i){var s=e.Pt.X>t.Pt.X?y.Direction.dRightToLeft:y.Direction.dLeftToRight,a=r.Pt.X>n.Pt.X?y.Direction.dRightToLeft:y.Direction.dLeftToRight;if(s==a)return!1;if(s==y.Direction.dLeftToRight){for(;e.Next.Pt.X<=o.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;i&&e.Pt.X!=o.X&&(e=e.Next),t=this.DupOutPt(e,!i),y.IntPoint.op_Inequality(t.Pt,o)&&(e=t,e.Pt.X=o.X,e.Pt.Y=o.Y,t=this.DupOutPt(e,!i))}else{for(;e.Next.Pt.X>=o.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;!i&&e.Pt.X!=o.X&&(e=e.Next),t=this.DupOutPt(e,i),y.IntPoint.op_Inequality(t.Pt,o)&&(e=t,e.Pt.X=o.X,e.Pt.Y=o.Y,t=this.DupOutPt(e,i))}if(a==y.Direction.dLeftToRight){for(;r.Next.Pt.X<=o.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;i&&r.Pt.X!=o.X&&(r=r.Next),n=this.DupOutPt(r,!i),y.IntPoint.op_Inequality(n.Pt,o)&&(r=n,r.Pt.X=o.X,r.Pt.Y=o.Y,n=this.DupOutPt(r,!i))}else{for(;r.Next.Pt.X>=o.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;!i&&r.Pt.X!=o.X&&(r=r.Next),n=this.DupOutPt(r,i),y.IntPoint.op_Inequality(n.Pt,o)&&(r=n,r.Pt.X=o.X,r.Pt.Y=o.Y,n=this.DupOutPt(r,i))}return s==y.Direction.dLeftToRight==i?(e.Prev=r,r.Next=e,t.Next=n,n.Prev=t):(e.Next=r,r.Prev=e,t.Prev=n,n.Next=t),!0};y.Clipper.prototype.JoinPoints=function(e,t,r){var n=e.OutPt1,o=new y.OutPt,i=e.OutPt2,s=new y.OutPt,a=e.OutPt1.Pt.Y==e.OffPt.Y;if(a&&y.IntPoint.op_Equality(e.OffPt,e.OutPt1.Pt)&&y.IntPoint.op_Equality(e.OffPt,e.OutPt2.Pt)){for(o=e.OutPt1.Next;o!=n&&y.IntPoint.op_Equality(o.Pt,e.OffPt);)o=o.Next;var l=o.Pt.Y>e.OffPt.Y;for(s=e.OutPt2.Next;s!=i&&y.IntPoint.op_Equality(s.Pt,e.OffPt);)s=s.Next;var u=s.Pt.Y>e.OffPt.Y;return l==u?!1:l?(o=this.DupOutPt(n,!1),s=this.DupOutPt(i,!0),n.Prev=i,i.Next=n,o.Next=s,s.Prev=o,e.OutPt1=n,e.OutPt2=o,!0):(o=this.DupOutPt(n,!0),s=this.DupOutPt(i,!1),n.Next=i,i.Prev=n,o.Prev=s,s.Next=o,e.OutPt1=n,e.OutPt2=o,!0)}else if(a){for(o=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=o&&n.Prev!=i;)n=n.Prev;for(;o.Next.Pt.Y==o.Pt.Y&&o.Next!=n&&o.Next!=i;)o=o.Next;if(o.Next==n||o.Next==i)return!1;for(s=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=s&&i.Prev!=o;)i=i.Prev;for(;s.Next.Pt.Y==s.Pt.Y&&s.Next!=i&&s.Next!=n;)s=s.Next;if(s.Next==i||s.Next==n)return!1;var d={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,o.Pt.X,i.Pt.X,s.Pt.X,d))return!1;var f=d.Left,h=d.Right,b=new y.IntPoint,v;return n.Pt.X>=f&&n.Pt.X<=h?(b.X=n.Pt.X,b.Y=n.Pt.Y,v=n.Pt.X>o.Pt.X):i.Pt.X>=f&&i.Pt.X<=h?(b.X=i.Pt.X,b.Y=i.Pt.Y,v=i.Pt.X>s.Pt.X):o.Pt.X>=f&&o.Pt.X<=h?(b.X=o.Pt.X,b.Y=o.Pt.Y,v=o.Pt.X>n.Pt.X):(b.X=s.Pt.X,b.Y=s.Pt.Y,v=s.Pt.X>i.Pt.X),e.OutPt1=n,e.OutPt2=i,this.JoinHorz(n,o,i,s,b,v)}else{for(o=n.Next;y.IntPoint.op_Equality(o.Pt,n.Pt)&&o!=n;)o=o.Next;var I=o.Pt.Y>n.Pt.Y||!y.ClipperBase.SlopesEqual(n.Pt,o.Pt,e.OffPt,this.m_UseFullRange);if(I){for(o=n.Prev;y.IntPoint.op_Equality(o.Pt,n.Pt)&&o!=n;)o=o.Prev;if(o.Pt.Y>n.Pt.Y||!y.ClipperBase.SlopesEqual(n.Pt,o.Pt,e.OffPt,this.m_UseFullRange))return!1}for(s=i.Next;y.IntPoint.op_Equality(s.Pt,i.Pt)&&s!=i;)s=s.Next;var x=s.Pt.Y>i.Pt.Y||!y.ClipperBase.SlopesEqual(i.Pt,s.Pt,e.OffPt,this.m_UseFullRange);if(x){for(s=i.Prev;y.IntPoint.op_Equality(s.Pt,i.Pt)&&s!=i;)s=s.Prev;if(s.Pt.Y>i.Pt.Y||!y.ClipperBase.SlopesEqual(i.Pt,s.Pt,e.OffPt,this.m_UseFullRange))return!1}return o==n||s==i||o==s||t==r&&I==x?!1:I?(o=this.DupOutPt(n,!1),s=this.DupOutPt(i,!0),n.Prev=i,i.Next=n,o.Next=s,s.Prev=o,e.OutPt1=n,e.OutPt2=o,!0):(o=this.DupOutPt(n,!0),s=this.DupOutPt(i,!1),n.Next=i,i.Prev=n,o.Prev=s,s.Next=o,e.OutPt1=n,e.OutPt2=o,!0)}};y.Clipper.GetBounds=function(e){for(var t=0,r=e.length;t<r&&e[t].length==0;)t++;if(t==r)return new y.IntRect(0,0,0,0);var n=new y.IntRect;for(n.left=e[t][0].X,n.right=n.left,n.top=e[t][0].Y,n.bottom=n.top;t<r;t++)for(var o=0,i=e[t].length;o<i;o++)e[t][o].X<n.left?n.left=e[t][o].X:e[t][o].X>n.right&&(n.right=e[t][o].X),e[t][o].Y<n.top?n.top=e[t][o].Y:e[t][o].Y>n.bottom&&(n.bottom=e[t][o].Y);return n};y.Clipper.prototype.GetBounds2=function(e){var t=e,r=new y.IntRect;for(r.left=e.Pt.X,r.right=e.Pt.X,r.top=e.Pt.Y,r.bottom=e.Pt.Y,e=e.Next;e!=t;)e.Pt.X<r.left&&(r.left=e.Pt.X),e.Pt.X>r.right&&(r.right=e.Pt.X),e.Pt.Y<r.top&&(r.top=e.Pt.Y),e.Pt.Y>r.bottom&&(r.bottom=e.Pt.Y),e=e.Next;return r};y.Clipper.PointInPolygon=function(e,t){var r=0,n=t.length;if(n<3)return 0;for(var o=t[0],i=1;i<=n;++i){var s=i==n?t[0]:t[i];if(s.Y==e.Y&&(s.X==e.X||o.Y==e.Y&&s.X>e.X==o.X<e.X))return-1;if(o.Y<e.Y!=s.Y<e.Y){if(o.X>=e.X)if(s.X>e.X)r=1-r;else{var a=(o.X-e.X)*(s.Y-e.Y)-(s.X-e.X)*(o.Y-e.Y);if(a==0)return-1;a>0==s.Y>o.Y&&(r=1-r)}else if(s.X>e.X){var a=(o.X-e.X)*(s.Y-e.Y)-(s.X-e.X)*(o.Y-e.Y);if(a==0)return-1;a>0==s.Y>o.Y&&(r=1-r)}}o=s}return r};y.Clipper.prototype.PointInPolygon=function(e,t){for(var r=0,n=t;;){var o=t.Pt.X,i=t.Pt.Y,s=t.Next.Pt.X,a=t.Next.Pt.Y;if(a==e.Y&&(s==e.X||i==e.Y&&s>e.X==o<e.X))return-1;if(i<e.Y!=a<e.Y){if(o>=e.X)if(s>e.X)r=1-r;else{var l=(o-e.X)*(a-e.Y)-(s-e.X)*(i-e.Y);if(l==0)return-1;l>0==a>i&&(r=1-r)}else if(s>e.X){var l=(o-e.X)*(a-e.Y)-(s-e.X)*(i-e.Y);if(l==0)return-1;l>0==a>i&&(r=1-r)}}if(t=t.Next,n==t)break}return r};y.Clipper.prototype.Poly2ContainsPoly1=function(e,t){var r=e;do{var n=this.PointInPolygon(r.Pt,t);if(n>=0)return n!=0;r=r.Next}while(r!=e);return!0};y.Clipper.prototype.FixupFirstLefts1=function(e,t){for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var o=this.m_PolyOuts[r];o.Pts!==null&&o.FirstLeft==e&&this.Poly2ContainsPoly1(o.Pts,t.Pts)&&(o.FirstLeft=t)}};y.Clipper.prototype.FixupFirstLefts2=function(e,t){for(var r=0,n=this.m_PolyOuts,o=n.length,i=n[r];r<o;r++,i=n[r])i.FirstLeft==e&&(i.FirstLeft=t)};y.Clipper.ParseFirstLeft=function(e){for(;e!=null&&e.Pts==null;)e=e.FirstLeft;return e};y.Clipper.prototype.JoinCommonEdges=function(){for(var e=0,t=this.m_Joins.length;e<t;e++){var r=this.m_Joins[e],n=this.GetOutRec(r.OutPt1.Idx),o=this.GetOutRec(r.OutPt2.Idx);if(!(n.Pts==null||o.Pts==null)){var i;if(n==o?i=n:this.Param1RightOfParam2(n,o)?i=o:this.Param1RightOfParam2(o,n)?i=n:i=this.GetLowermostRec(n,o),!!this.JoinPoints(r,n,o))if(n==o){if(n.Pts=r.OutPt1,n.BottomPt=null,o=this.CreateOutRec(),o.Pts=r.OutPt2,this.UpdateOutPtIdxs(o),this.m_UsingPolyTree)for(var s=0,a=this.m_PolyOuts.length;s<a-1;s++){var l=this.m_PolyOuts[s];l.Pts==null||y.Clipper.ParseFirstLeft(l.FirstLeft)!=n||l.IsHole==n.IsHole||this.Poly2ContainsPoly1(l.Pts,r.OutPt2)&&(l.FirstLeft=o)}this.Poly2ContainsPoly1(o.Pts,n.Pts)?(o.IsHole=!n.IsHole,o.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,n),(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)):this.Poly2ContainsPoly1(n.Pts,o.Pts)?(o.IsHole=n.IsHole,n.IsHole=!o.IsHole,o.FirstLeft=n.FirstLeft,n.FirstLeft=o,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,o),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):(o.IsHole=n.IsHole,o.FirstLeft=n.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(n,o))}else o.Pts=null,o.BottomPt=null,o.Idx=n.Idx,n.IsHole=i.IsHole,i==o&&(n.FirstLeft=o.FirstLeft),o.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,n)}}};y.Clipper.prototype.UpdateOutPtIdxs=function(e){var t=e.Pts;do t.Idx=e.Idx,t=t.Prev;while(t!=e.Pts)};y.Clipper.prototype.DoSimplePolygons=function(){for(var e=0;e<this.m_PolyOuts.length;){var t=this.m_PolyOuts[e++],r=t.Pts;if(r!==null)do{for(var n=r.Next;n!=t.Pts;){if(y.IntPoint.op_Equality(r.Pt,n.Pt)&&n.Next!=r&&n.Prev!=r){var o=r.Prev,i=n.Prev;r.Prev=i,i.Next=r,n.Prev=o,o.Next=n,t.Pts=r;var s=this.CreateOutRec();s.Pts=n,this.UpdateOutPtIdxs(s),this.Poly2ContainsPoly1(s.Pts,t.Pts)?(s.IsHole=!t.IsHole,s.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,s.Pts)?(s.IsHole=t.IsHole,t.IsHole=!s.IsHole,s.FirstLeft=t.FirstLeft,t.FirstLeft=s):(s.IsHole=t.IsHole,s.FirstLeft=t.FirstLeft),n=r}n=n.Next}r=r.Next}while(r!=t.Pts)}};y.Clipper.Area=function(e){var t=e.length;if(t<3)return 0;for(var r=0,n=0,o=t-1;n<t;++n)r+=(e[o].X+e[n].X)*(e[o].Y-e[n].Y),o=n;return-r*.5};y.Clipper.prototype.Area=function(e){var t=e.Pts;if(t==null)return 0;var r=0;do r=r+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=e.Pts);return r*.5};HZ&&(y.Clipper.OffsetPaths=function(e,t,r,n,o){var i=new y.Paths,s=new y.ClipperOffset(o,o);return s.AddPaths(e,r,n),s.Execute(i,t),i});y.Clipper.SimplifyPolygon=function(e,t){var r=new Array,n=new y.Clipper(0);return n.StrictlySimple=!0,n.AddPath(e,y.PolyType.ptSubject,!0),n.Execute(y.ClipType.ctUnion,r,t,t),r};y.Clipper.SimplifyPolygons=function(e,t){typeof t>"u"&&(t=y.PolyFillType.pftEvenOdd);var r=new Array,n=new y.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(e,y.PolyType.ptSubject,!0),n.Execute(y.ClipType.ctUnion,r,t,t),r};y.Clipper.DistanceSqrd=function(e,t){var r=e.X-t.X,n=e.Y-t.Y;return r*r+n*n};y.Clipper.DistanceFromLineSqrd=function(e,t,r){var n=t.Y-r.Y,o=r.X-t.X,i=n*t.X+o*t.Y;return i=n*e.X+o*e.Y-i,i*i/(n*n+o*o)};y.Clipper.SlopesNearCollinear=function(e,t,r,n){return y.Clipper.DistanceFromLineSqrd(t,e,r)<n};y.Clipper.PointsAreClose=function(e,t,r){var n=e.X-t.X,o=e.Y-t.Y;return n*n+o*o<=r};y.Clipper.ExcludeOp=function(e){var t=e.Prev;return t.Next=e.Next,e.Next.Prev=t,t.Idx=0,t};y.Clipper.CleanPolygon=function(e,t){typeof t>"u"&&(t=1.415);var r=e.length;if(r==0)return new Array;for(var n=new Array(r),o=0;o<r;++o)n[o]=new y.OutPt;for(var o=0;o<r;++o)n[o].Pt=e[o],n[o].Next=n[(o+1)%r],n[o].Next.Prev=n[o],n[o].Idx=0;for(var i=t*t,s=n[0];s.Idx==0&&s.Next!=s.Prev;)y.Clipper.PointsAreClose(s.Pt,s.Prev.Pt,i)?(s=y.Clipper.ExcludeOp(s),r--):y.Clipper.PointsAreClose(s.Prev.Pt,s.Next.Pt,i)?(y.Clipper.ExcludeOp(s.Next),s=y.Clipper.ExcludeOp(s),r-=2):y.Clipper.SlopesNearCollinear(s.Prev.Pt,s.Pt,s.Next.Pt,i)?(s=y.Clipper.ExcludeOp(s),r--):(s.Idx=1,s=s.Next);r<3&&(r=0);for(var a=new Array(r),o=0;o<r;++o)a[o]=new y.IntPoint(s.Pt),s=s.Next;return n=null,a};y.Clipper.CleanPolygons=function(e,t){for(var r=new Array(e.length),n=0,o=e.length;n<o;n++)r[n]=y.Clipper.CleanPolygon(e[n],t);return r};y.Clipper.Minkowski=function(e,t,r,n){var o=n?1:0,i=e.length,s=t.length,a=new Array;if(r)for(var l=0;l<s;l++){for(var u=new Array(i),d=0,f=e.length,h=e[d];d<f;d++,h=e[d])u[d]=new y.IntPoint(t[l].X+h.X,t[l].Y+h.Y);a.push(u)}else for(var l=0;l<s;l++){for(var u=new Array(i),d=0,f=e.length,h=e[d];d<f;d++,h=e[d])u[d]=new y.IntPoint(t[l].X-h.X,t[l].Y-h.Y);a.push(u)}for(var b=new Array,l=0;l<s-1+o;l++)for(var d=0;d<i;d++){var v=new Array;v.push(a[l%s][d%i]),v.push(a[(l+1)%s][d%i]),v.push(a[(l+1)%s][(d+1)%i]),v.push(a[l%s][(d+1)%i]),y.Clipper.Orientation(v)||v.reverse(),b.push(v)}var I=new y.Clipper(0);return I.AddPaths(b,y.PolyType.ptSubject,!0),I.Execute(y.ClipType.ctUnion,a,y.PolyFillType.pftNonZero,y.PolyFillType.pftNonZero),a};y.Clipper.MinkowskiSum=function(){var e=arguments,t=e.length;if(t==3){var r=e[0],n=e[1],o=e[2];return y.Clipper.Minkowski(r,n,!0,o)}else if(t==4){for(var r=e[0],i=e[1],s=e[2],o=e[3],a=new y.Clipper,l,u=0,d=i.length;u<d;++u){var l=y.Clipper.Minkowski(r,i[u],!0,o);a.AddPaths(l,y.PolyType.ptSubject,!0)}o&&a.AddPaths(i,y.PolyType.ptClip,!0);var f=new y.Paths;return a.Execute(y.ClipType.ctUnion,f,s,s),f}};y.Clipper.MinkowskiDiff=function(e,t,r){return y.Clipper.Minkowski(e,t,!1,r)};y.Clipper.PolyTreeToPaths=function(e){var t=new Array;return y.Clipper.AddPolyNodeToPaths(e,y.Clipper.NodeType.ntAny,t),t};y.Clipper.AddPolyNodeToPaths=function(e,t,r){var n=!0;switch(t){case y.Clipper.NodeType.ntOpen:return;case y.Clipper.NodeType.ntClosed:n=!e.IsOpen;break;default:break}e.m_polygon.length>0&&n&&r.push(e.m_polygon);for(var o=0,i=e.Childs(),s=i.length,a=i[o];o<s;o++,a=i[o])y.Clipper.AddPolyNodeToPaths(a,t,r)};y.Clipper.OpenPathsFromPolyTree=function(e){for(var t=new y.Paths,r=0,n=e.ChildCount();r<n;r++)e.Childs()[r].IsOpen&&t.push(e.Childs()[r].m_polygon);return t};y.Clipper.ClosedPathsFromPolyTree=function(e){var t=new y.Paths;return y.Clipper.AddPolyNodeToPaths(e,y.Clipper.NodeType.ntClosed,t),t};DI(y.Clipper,y.ClipperBase);y.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};y.ClipperOffset=function(e,t){typeof e>"u"&&(e=2),typeof t>"u"&&(t=y.ClipperOffset.def_arc_tolerance),this.m_destPolys=new y.Paths,this.m_srcPoly=new y.Path,this.m_destPoly=new y.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new y.IntPoint,this.m_polyNodes=new y.PolyNode,this.MiterLimit=e,this.ArcTolerance=t,this.m_lowest.X=-1};y.ClipperOffset.two_pi=6.28318530717959;y.ClipperOffset.def_arc_tolerance=.25;y.ClipperOffset.prototype.Clear=function(){y.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};y.ClipperOffset.Round=y.Clipper.Round;y.ClipperOffset.prototype.AddPath=function(e,t,r){var n=e.length-1;if(!(n<0)){var o=new y.PolyNode;if(o.m_jointype=t,o.m_endtype=r,r==y.EndType.etClosedLine||r==y.EndType.etClosedPolygon)for(;n>0&&y.IntPoint.op_Equality(e[0],e[n]);)n--;o.m_polygon.push(e[0]);for(var i=0,s=0,a=1;a<=n;a++)y.IntPoint.op_Inequality(o.m_polygon[i],e[a])&&(i++,o.m_polygon.push(e[a]),(e[a].Y>o.m_polygon[s].Y||e[a].Y==o.m_polygon[s].Y&&e[a].X<o.m_polygon[s].X)&&(s=i));if(!(r==y.EndType.etClosedPolygon&&i<2||r!=y.EndType.etClosedPolygon&&i<0)&&(this.m_polyNodes.AddChild(o),r==y.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new y.IntPoint(0,s);else{var l=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(o.m_polygon[s].Y>l.Y||o.m_polygon[s].Y==l.Y&&o.m_polygon[s].X<l.X)&&(this.m_lowest=new y.IntPoint(this.m_polyNodes.ChildCount()-1,s))}}};y.ClipperOffset.prototype.AddPaths=function(e,t,r){for(var n=0,o=e.length;n<o;n++)this.AddPath(e[n],t,r)};y.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!y.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];(t.m_endtype==y.EndType.etClosedPolygon||t.m_endtype==y.EndType.etClosedLine&&y.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==y.EndType.etClosedLine&&!y.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};y.ClipperOffset.GetUnitNormal=function(e,t){var r=t.X-e.X,n=t.Y-e.Y;if(r==0&&n==0)return new y.DoublePoint(0,0);var o=1/Math.sqrt(r*r+n*n);return r*=o,n*=o,new y.DoublePoint(n,-r)};y.ClipperOffset.prototype.DoOffset=function(e){if(this.m_destPolys=new Array,this.m_delta=e,y.ClipperBase.near_zero(e)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];r.m_endtype==y.EndType.etClosedPolygon&&this.m_destPolys.push(r.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var n;this.ArcTolerance<=0?n=y.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(e)*y.ClipperOffset.def_arc_tolerance?n=Math.abs(e)*y.ClipperOffset.def_arc_tolerance:n=this.ArcTolerance;var o=3.14159265358979/Math.acos(1-n/Math.abs(e));this.m_sin=Math.sin(y.ClipperOffset.two_pi/o),this.m_cos=Math.cos(y.ClipperOffset.two_pi/o),this.m_StepsPerRad=o/y.ClipperOffset.two_pi,e<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];this.m_srcPoly=r.m_polygon;var i=this.m_srcPoly.length;if(!(i==0||e<=0&&(i<3||r.m_endtype!=y.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,i==1){if(r.m_jointype==y.JoinType.jtRound)for(var s=1,a=0,l=1;l<=o;l++){this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[0].X+s*e),y.ClipperOffset.Round(this.m_srcPoly[0].Y+a*e)));var u=s;s=s*this.m_cos-this.m_sin*a,a=u*this.m_sin+a*this.m_cos}else for(var s=-1,a=-1,l=0;l<4;++l)this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[0].X+s*e),y.ClipperOffset.Round(this.m_srcPoly[0].Y+a*e))),s<0?s=1:a<0?a=1:s=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var l=0;l<i-1;l++)this.m_normals.push(y.ClipperOffset.GetUnitNormal(this.m_srcPoly[l],this.m_srcPoly[l+1]));if(r.m_endtype==y.EndType.etClosedLine||r.m_endtype==y.EndType.etClosedPolygon?this.m_normals.push(y.ClipperOffset.GetUnitNormal(this.m_srcPoly[i-1],this.m_srcPoly[0])):this.m_normals.push(new y.DoublePoint(this.m_normals[i-2])),r.m_endtype==y.EndType.etClosedPolygon){for(var d=i-1,l=0;l<i;l++)d=this.OffsetPoint(l,d,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==y.EndType.etClosedLine){for(var d=i-1,l=0;l<i;l++)d=this.OffsetPoint(l,d,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var f=this.m_normals[i-1],l=i-1;l>0;l--)this.m_normals[l]=new y.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new y.DoublePoint(-f.X,-f.Y),d=0;for(var l=i-1;l>=0;l--)d=this.OffsetPoint(l,d,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var d=0,l=1;l<i-1;++l)d=this.OffsetPoint(l,d,r.m_jointype);var h;if(r.m_endtype==y.EndType.etOpenButt){var l=i-1;h=new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[l].X+this.m_normals[l].X*e),y.ClipperOffset.Round(this.m_srcPoly[l].Y+this.m_normals[l].Y*e)),this.m_destPoly.push(h),h=new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[l].X-this.m_normals[l].X*e),y.ClipperOffset.Round(this.m_srcPoly[l].Y-this.m_normals[l].Y*e)),this.m_destPoly.push(h)}else{var l=i-1;d=i-2,this.m_sinA=0,this.m_normals[l]=new y.DoublePoint(-this.m_normals[l].X,-this.m_normals[l].Y),r.m_endtype==y.EndType.etOpenSquare?this.DoSquare(l,d):this.DoRound(l,d)}for(var l=i-1;l>0;l--)this.m_normals[l]=new y.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new y.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),d=i-1;for(var l=d-1;l>0;--l)d=this.OffsetPoint(l,d,r.m_jointype);r.m_endtype==y.EndType.etOpenButt?(h=new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*e),y.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*e)),this.m_destPoly.push(h),h=new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*e),y.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*e)),this.m_destPoly.push(h)):(d=1,this.m_sinA=0,r.m_endtype==y.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};y.ClipperOffset.prototype.Execute=function(){var e=arguments,t=e[0]instanceof y.PolyTree;if(t){var r=e[0],n=e[1];r.Clear(),this.FixOrientations(),this.DoOffset(n);var o=new y.Clipper(0);if(o.AddPaths(this.m_destPolys,y.PolyType.ptSubject,!0),n>0)o.Execute(y.ClipType.ctUnion,r,y.PolyFillType.pftPositive,y.PolyFillType.pftPositive);else{var i=y.Clipper.GetBounds(this.m_destPolys),s=new y.Path;if(s.push(new y.IntPoint(i.left-10,i.bottom+10)),s.push(new y.IntPoint(i.right+10,i.bottom+10)),s.push(new y.IntPoint(i.right+10,i.top-10)),s.push(new y.IntPoint(i.left-10,i.top-10)),o.AddPath(s,y.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(y.ClipType.ctUnion,r,y.PolyFillType.pftNegative,y.PolyFillType.pftNegative),r.ChildCount()==1&&r.Childs()[0].ChildCount()>0){var a=r.Childs()[0];r.Childs()[0]=a.Childs()[0];for(var l=1;l<a.ChildCount();l++)r.AddChild(a.Childs()[l])}else r.Clear()}}else{var r=e[0],n=e[1];y.Clear(r),this.FixOrientations(),this.DoOffset(n);var o=new y.Clipper(0);if(o.AddPaths(this.m_destPolys,y.PolyType.ptSubject,!0),n>0)o.Execute(y.ClipType.ctUnion,r,y.PolyFillType.pftPositive,y.PolyFillType.pftPositive);else{var i=y.Clipper.GetBounds(this.m_destPolys),s=new y.Path;s.push(new y.IntPoint(i.left-10,i.bottom+10)),s.push(new y.IntPoint(i.right+10,i.bottom+10)),s.push(new y.IntPoint(i.right+10,i.top-10)),s.push(new y.IntPoint(i.left-10,i.top-10)),o.AddPath(s,y.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(y.ClipType.ctUnion,r,y.PolyFillType.pftNegative,y.PolyFillType.pftNegative),r.length>0&&r.splice(0,1)}}};y.ClipperOffset.prototype.OffsetPoint=function(e,t,r){if(this.m_sinA=this.m_normals[t].X*this.m_normals[e].Y-this.m_normals[e].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[t].X*this.m_delta),y.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new y.IntPoint(this.m_srcPoly[e])),this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),y.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)));else switch(r){case y.JoinType.jtMiter:{var n=1+(this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y);n>=this.m_miterLim?this.DoMiter(e,t,n):this.DoSquare(e,t);break}case y.JoinType.jtSquare:this.DoSquare(e,t);break;case y.JoinType.jtRound:this.DoRound(e,t);break}return t=e,t};y.ClipperOffset.prototype.DoSquare=function(e,t){var r=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y)/4);this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*r)),y.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*r)))),this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[e].X+this.m_normals[e].Y*r)),y.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[e].Y-this.m_normals[e].X*r))))};y.ClipperOffset.prototype.DoMiter=function(e,t,r){var n=this.m_delta/r;this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+(this.m_normals[t].X+this.m_normals[e].X)*n),y.ClipperOffset.Round(this.m_srcPoly[e].Y+(this.m_normals[t].Y+this.m_normals[e].Y)*n)))};y.ClipperOffset.prototype.DoRound=function(e,t){for(var r=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y),n=y.Cast_Int32(y.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),o=this.m_normals[t].X,i=this.m_normals[t].Y,s,a=0;a<n;++a)this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+o*this.m_delta),y.ClipperOffset.Round(this.m_srcPoly[e].Y+i*this.m_delta))),s=o,o=o*this.m_cos-this.m_sin*i,i=s*this.m_sin+i*this.m_cos;this.m_destPoly.push(new y.IntPoint(y.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),y.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)))};y.Error=function(e){try{throw new Error(e)}catch(t){alert(t.message)}};y.JS={};y.JS.AreaOfPolygon=function(e,t){return t||(t=1),y.Clipper.Area(e)/(t*t)};y.JS.AreaOfPolygons=function(e,t){t||(t=1);for(var r=0,n=0;n<e.length;n++)r+=y.Clipper.Area(e[n]);return r/(t*t)};y.JS.BoundsOfPath=function(e,t){return y.JS.BoundsOfPaths([e],t)};y.JS.BoundsOfPaths=function(e,t){t||(t=1);var r=y.Clipper.GetBounds(e);return r.left/=t,r.bottom/=t,r.right/=t,r.top/=t,r};y.JS.Clean=function(n,t){if(!(n instanceof Array))return[];var r=n[0]instanceof Array,n=y.JS.Clone(n);if(typeof t!="number"||t===null)return y.Error("Delta is not a number in Clean()."),n;if(n.length===0||n.length==1&&n[0].length===0||t<0)return n;r||(n=[n]);for(var o=n.length,i,s,a,l,u,d,f,h=[],b=0;b<o;b++)if(s=n[b],i=s.length,i!==0){if(i<3){a=s,h.push(a);continue}for(a=s,l=t*t,u=s[0],d=1,f=1;f<i;f++)(s[f].X-u.X)*(s[f].X-u.X)+(s[f].Y-u.Y)*(s[f].Y-u.Y)<=l||(a[d]=s[f],u=s[f],d++);u=s[d-1],(s[0].X-u.X)*(s[0].X-u.X)+(s[0].Y-u.Y)*(s[0].Y-u.Y)<=l&&d--,d<i&&a.splice(d,i-d),a.length&&h.push(a)}return!r&&h.length?h=h[0]:!r&&h.length===0?h=[]:r&&h.length===0&&(h=[[]]),h};y.JS.Clone=function(e){if(!(e instanceof Array))return[];if(e.length===0)return[];if(e.length==1&&e[0].length===0)return[[]];var t=e[0]instanceof Array;t||(e=[e]);var r=e.length,n,o,i,s,a=new Array(r);for(o=0;o<r;o++){for(n=e[o].length,s=new Array(n),i=0;i<n;i++)s[i]={X:e[o][i].X,Y:e[o][i].Y};a[o]=s}return t||(a=a[0]),a};y.JS.Lighten=function(e,t){if(!(e instanceof Array))return[];if(typeof t!="number"||t===null)return y.Error("Tolerance is not a number in Lighten()."),y.JS.Clone(e);if(e.length===0||e.length==1&&e[0].length===0||t<0)return y.JS.Clone(e);e[0]instanceof Array||(e=[e]);var r,n,o,i,s,a,l,u,d,f,h,b,v,I,x,C,P,w=e.length,T=t*t,O=[];for(r=0;r<w;r++)if(o=e[r],a=o.length,a!=0){for(i=0;i<1e6;i++){for(s=[],a=o.length,o[a-1].X!=o[0].X||o[a-1].Y!=o[0].Y?(b=1,o.push({X:o[0].X,Y:o[0].Y}),a=o.length):b=0,h=[],n=0;n<a-2;n++)l=o[n],d=o[n+1],u=o[n+2],C=l.X,P=l.Y,v=u.X-C,I=u.Y-P,(v!==0||I!==0)&&(x=((d.X-C)*v+(d.Y-P)*I)/(v*v+I*I),x>1?(C=u.X,P=u.Y):x>0&&(C+=v*x,P+=I*x)),v=d.X-C,I=d.Y-P,f=v*v+I*I,f<=T&&(h[n+1]=1,n++);for(s.push({X:o[0].X,Y:o[0].Y}),n=1;n<a-1;n++)h[n]||s.push({X:o[n].X,Y:o[n].Y});if(s.push({X:o[a-1].X,Y:o[a-1].Y}),b&&o.pop(),h.length)o=s;else break}a=s.length,s[a-1].X==s[0].X&&s[a-1].Y==s[0].Y&&s.pop(),s.length>2&&O.push(s)}return!e[0]instanceof Array&&(O=O[0]),typeof O>"u"&&(O=[[]]),O};y.JS.PerimeterOfPath=function(e,t,r){if(typeof e>"u")return 0;var n=Math.sqrt,o=0,i,s,a=0,l=0,u=0,d=0,f=e.length;if(f<2)return 0;for(t&&(e[f]=e[0],f++);--f;)i=e[f],a=i.X,l=i.Y,s=e[f-1],u=s.X,d=s.Y,o+=n((a-u)*(a-u)+(l-d)*(l-d));return t&&e.pop(),o/r};y.JS.PerimeterOfPaths=function(e,t,r){r||(r=1);for(var n=0,o=0;o<e.length;o++)n+=y.JS.PerimeterOfPath(e[o],t,r);return n};y.JS.ScaleDownPath=function(e,t){var r,n;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=n.X/t,n.Y=n.Y/t};y.JS.ScaleDownPaths=function(e,t){var r,n,o,i=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)o=e[r][n],o.X=o.X/t,o.Y=o.Y/t};y.JS.ScaleUpPath=function(e,t){var r,n,o=Math.round;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=o(n.X*t),n.Y=o(n.Y*t)};y.JS.ScaleUpPaths=function(e,t){var r,n,o,i=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)o=e[r][n],o.X=i(o.X*t),o.Y=i(o.Y*t)};y.ExPolygons=function(){return[]};y.ExPolygon=function(){this.outer=null,this.holes=null};y.JS.AddOuterPolyNodeToExPolygons=function(e,t){var r=new y.ExPolygon;r.outer=e.Contour();var n=e.Childs(),o=n.length;r.holes=new Array(o);var i,s,a,l,u,d;for(a=0;a<o;a++)for(i=n[a],r.holes[a]=i.Contour(),l=0,u=i.Childs(),d=u.length;l<d;l++)s=u[l],y.JS.AddOuterPolyNodeToExPolygons(s,t);t.push(r)};y.JS.ExPolygonsToPaths=function(e){var t,r,n,o,i=new y.Paths;for(t=0,n=e.length;t<n;t++)for(i.push(e[t].outer),r=0,o=e[t].holes.length;r<o;r++)i.push(e[t].holes[r]);return i};y.JS.PolyTreeToExPolygons=function(e){var t=new y.ExPolygons,r,n,o,i;for(n=0,o=e.Childs(),i=o.length;n<i;n++)r=o[n],y.JS.AddOuterPolyNodeToExPolygons(r,t);return t};hb.exports=y});var gY=H((Qvt,_S)=>{p();(function(){"use strict";function e(s,a){var l=s.x-a.x,u=s.y-a.y;return l*l+u*u}function t(s,a,l){var u=a.x,d=a.y,f=l.x-u,h=l.y-d;if(f!==0||h!==0){var b=((s.x-u)*f+(s.y-d)*h)/(f*f+h*h);b>1?(u=l.x,d=l.y):b>0&&(u+=f*b,d+=h*b)}return f=s.x-u,h=s.y-d,f*f+h*h}function r(s,a){for(var l=s[0],u=[l],d,f=1,h=s.length;f<h;f++)d=s[f],e(d,l)>a&&(u.push(d),l=d);return l!==d&&u.push(d),u}function n(s,a,l,u,d){for(var f=u,h,b=a+1;b<l;b++){var v=t(s[b],s[a],s[l]);v>f&&(h=b,f=v)}f>u&&(h-a>1&&n(s,a,h,u,d),d.push(s[h]),l-h>1&&n(s,h,l,u,d))}function o(s,a){var l=s.length-1,u=[s[0]];return n(s,0,l,a,u),u.push(s[l]),u}function i(s,a,l){if(s.length<=2)return s;var u=a!==void 0?a*a:1;return s=l?s:r(s,u),s=o(s,u),s}typeof define=="function"&&define.amd?define(function(){return i}):typeof _S<"u"?(_S.exports=i,_S.exports.default=i):typeof self<"u"?self.simplify=i:window.simplify=i})()});p();p();p();p();p();p();var Th=e=>e!=null;var VY=function(){let t=globalThis.fetch;return{fetch(...r){if(!Th(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...r)},setFetch(r){t=r}}}(),GE=VY.fetch;var HE=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],UE=HE[0],WE="https://api-gateway.mappedin.com/track-analytics/a/",qE="deny-watchposition",ZE="load-mapview",XE="load-mapdata",YE="change-language",KE="query-directions";var Ma,Oi,Dd,c0,Fd=class{constructor(){M(this,Dd);M(this,Ma,Object.freeze({}));M(this,Oi);m(this,"oneTimeEventsSent",new Set);m(this,"sendGetDirectionsEvent",hE((t,r)=>this.sendAnalyticEvent(KE,{start:t,end:r,type:"location_to_location"}),2500));_(this,Oi,ee(this,Dd,c0).call(this,c(this,Ma)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){_(this,Ma,{}),_(this,Oi,ee(this,Dd,c0).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return _(this,Ma,Object.freeze(Object.assign({},c(this,Ma),t))),_(this,Oi,ee(this,Dd,c0).call(this,t)),c(this,Oi)}updateState(t){let r={...t};r.mapId&&(r.analyticsBaseUrl=t3({...c(this,Oi),mapId:r.mapId})),r.context&&(r.context=zE(r.context)),r.baseUri&&(r.analyticsBaseUrl=t3({baseUri:r.baseUri,mapId:c(this,Oi).mapId})),Object.assign(c(this,Oi),r),this.handleStateUpdate(t)}handleStateUpdate(t){var r;(r=t.userPosition)!=null&&r.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:r,accessToken:n}=this.getState();return!!(t&&r)||!!n}getState(){return c(this,Oi)}getContext(){return this.getState().context||c(this,Ma).context||UE}getSessionId(){return this.getState().sessionId||c(this,Ma).sessionId||VE()}sendAnalyticEvent(t,r={}){let n=this.getState(),o=HY(n.analyticsBaseUrl,t),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":n.deviceId};if(n.logEvents&&$.log("Analytics.track",o,i),!n.sendEvents)return Promise.resolve();if(!this.authReady)return $.warn("Auth needs to be ready to send analytics.");let s={...r,g:n.geolocationMode,sdk_version:n.version};return n.userPosition&&Object.assign(s,n.userPosition),i["Content-Type"]="application/json",n.accessToken?i.Authorization="Bearer ".concat(n.accessToken):n.noAuth||n.secret&&n.key&&(i["x-mappedin-key"]=btoa(n.key),i["x-mappedin-secret"]=btoa(n.secret)),GE(o,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(s)})}capture(t,r){if(qY.includes(t))return $.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=WY.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,r)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(XE,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(YE,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(qE)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:r}){return this.sendAnalyticEvent(ZE,{type:"3d",firstRenderDuration:t,width:r.width,height:r.height,devicePixelRatio:window.devicePixelRatio})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};Ma=new WeakMap,Oi=new WeakMap,Dd=new WeakSet,c0=function(t){var n,o,i,s;let r=(n=t.baseUri)!=null?n:WE;return{baseUri:r,analyticsBaseUrl:t3({...t,baseUri:r}),version:((o=g==null?void 0:g.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||zY(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||VE(),platformString:t.platformString||"",context:zE(t.context)||UE,geolocationMode:!1,sendEvents:(i=t.sendEvents)!=null?i:!0,logEvents:(s=t.logEvents)!=null?s:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}};function t3({mapId:e,baseUri:t=WE}){return"".concat(t).concat(e,"/")}function zY(){return fu.getInstance().loadLocalData("deviceId")}function VE(){return fu.getInstance().loadSessionData("id")}function HY(e,t){return e+t}function zE(e){return HE.find(t=>t===e)}var WY=["$select-location","$select-category","$query-suggest","$query-search"],qY=[ZE,XE,KE,qE,YE],ITe=new Fd,Oa,wh=class{constructor(t){M(this,Oa);m(this,"capture");m(this,"updateState");_(this,Oa,t),this.capture=c(this,Oa).capture.bind(c(this,Oa)),this.updateState=c(this,Oa).updateState.bind(c(this,Oa))}getState(){return Object.assign({},c(this,Oa).getState())}};Oa=new WeakMap;p();p();var Oh,Eh,_h,Mh=class{constructor(t,r,{enabled:n=!1}={}){M(this,Oh);m(this,"searchInstance");M(this,Eh);M(this,_h);m(this,"enabled",!1);_(this,Oh,t),_(this,Eh,r),_(this,_h,()=>{var o;(o=this.searchInstance)==null||o.then(i=>i.populate())}),n&&this.enable()}async query(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return $.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,r)}catch(n){return $.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return $.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,r)}catch(n){return $.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-NKXX4DDI.js").then(({InternalSearch:t})=>new t(c(this,Oh)))),c(this,Eh).on("language-change",c(this,_h)),await this.searchInstance)}};Oh=new WeakMap,Eh=new WeakMap,_h=new WeakMap;var JE=new WeakMap,Sr,r3=class extends De{constructor(r,{search:n}={}){super();M(this,Sr);m(this,"Analytics");m(this,"Search");m(this,"Query");m(this,"getDirections",(r,n,o)=>c(this,Sr).getDirections(r,n,o));m(this,"getDirectionsMultiDestination",(r,n,o)=>c(this,Sr).getDirectionsMultiDestination(r,n,o));_(this,Sr,r),JE.set(this,r),this.Analytics=new wh(r.Analytics),this.Query=r.Query,this.Search=new Mh(this,r,{enabled:n==null?void 0:n.enabled}),c(this,Sr).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return c(this,Sr).getEnv()}getAccessToken(){var r;return(r=c(this,Sr).tokenManager)==null?void 0:r.getAccessToken().token}get mapName(){return c(this,Sr).mapName}get mapCenter(){return c(this,Sr).mapCenter}get organizationId(){return c(this,Sr).organizationId}get outdoorViewToken(){return c(this,Sr).outdoorViewToken}getByType(r){return c(this,Sr).getByType(r)}getById(r,n){return c(this,Sr).getById(r,n)}getByExternalId(r,n){return c(this,Sr).getByExternalId(r,n)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return c(this,Sr).changeLanguage(r)}get currentLanguage(){return c(this,Sr).currentLanguage}get naturalBearing(){var r;return(r=c(this,Sr).naturalBearing)!=null?r:0}getDistance(r,n){return c(this,Sr).getDistance(r,n)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return c(this,Sr).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return c(this,Sr).toJSONBundle({downloadLanguagePacks:r})}};Sr=new WeakMap;var u0=r3;function Ah(e){let t=JE.get(e);if(!t)throw new Error("MapDataInternal not found");return t}p();p();p();p();p();p();p();p();p();var uF=fs(jC(),1),pF=fs(lF(),1);p();var Nre=e=>{var r;let t=e;return((r=t==null?void 0:t.allOf)==null?void 0:r.length)===2};function W0(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(W0);let t={...e};for(let[r,n]of Object.entries(t))if(typeof n=="object"&&n!==null){let o=W0(n);if(Nre(o)){let i=o.allOf.findIndex(a=>a.type==="array"),s=o.allOf.findIndex(a=>a.type==="object");if(i!==-1&&s!==-1){t[r]={...o,allOf:[o.allOf[i]]};continue}}t[r]=o}return t}var cF={$ref:"#/definitions/ParsedMVF",$schema:"http://json-schema.org/draft-07/schema#",definitions:{AnchoredFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},geometryId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text belongs. It will be displayed on top of it."},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","geometryId","rotation","text","visible"],type:"object"},AnchoredImageProperties:{additionalProperties:!1,properties:{anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this image belongs. It will be displayed on top of it."},height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["anchorId","height","path","rotation","width"],type:"object"},AnchoredTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text area belongs. It will be displayed on top of it."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"}},required:["align","anchorId","maxHeight","maxWidth","rotation"],type:"object"},AnnotationCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/AnnotationProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AnnotationId:{pattern:"^a_[A-Za-z0-9_-]{8,}$",type:"string"},AnnotationProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},id:{$ref:"#/definitions/AnnotationId"},symbolId:{type:"string"}},required:["id","symbolId"],type:"object"},Area:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/AreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},AreaCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Area"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AreaId:{pattern:"^ar_[A-Za-z0-9_-]{8,}$",type:"string"},AreaProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this area."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this area.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/AreaId"}},required:["id"],type:"object"},Category:{additionalProperties:!1,properties:{icon:{description:"The category's icon",format:"uri",type:"string"},id:{$ref:"#/definitions/CategoryId"},name:{type:"string"},parent:{$ref:"#/definitions/CategoryId"}},required:["id","name","icon"],type:"object"},CategoryId:{description:"A category ID",pattern:"^cat_[A-Za-z0-9_-]{8,}$",type:"string"},Connection:{additionalProperties:!1,properties:{accessible:{type:"boolean"},details:{additionalProperties:!1,properties:{name:{type:"string"}},type:"object"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},id:{$ref:"#/definitions/ConnectionId"},metadata:{$ref:"#/definitions/Metadata"},nodes:{description:"A list of node IDs corresponding to nodes that are a part of this connection.",items:{$ref:"#/definitions/NodeId"},type:"array"},type:{type:"string"}},required:["id","type","nodes","externalId"],type:"object"},ConnectionId:{pattern:"^c_[A-Za-z0-9_-]{8,}$",type:"string"},Connections:{items:{$ref:"#/definitions/Connection"},type:"array"},Day:{enum:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],type:"string"},DayOrPublicHoliday:{anyOf:[{$ref:"#/definitions/Day"},{const:"PublicHolidays",type:"string"}]},Details:{additionalProperties:!1,description:"Additional information about a given entity.",properties:{description:{type:"string"},images:{items:{$ref:"#/definitions/Image"},type:"array"},links:{items:{$ref:"#/definitions/Hyperlink"},type:"array"},name:{type:"string"}},type:"object"},EnterpriseCategory:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},color:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The category's icon",format:"uri",type:"string"},iconFromDefaultList:{type:["string","null"]},id:{$ref:"#/definitions/EnterpriseCategoryId"},locations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},name:{type:"string"},picture:{description:"The category's picture",format:"uri",type:"string"},sortOrder:{type:"number"}},required:["children","externalId","id","locations","name","sortOrder"],type:"object"},EnterpriseCategoryId:{description:"An ID for an enterprise category",pattern:"^ec_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseCategoryPriority:{additionalProperties:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},description:"The ordered list of category ids that this location belongs to The order here determines the priority of the categories, with the first category being the highest priority for determining application logic like icon and color preference.",propertyNames:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$"},type:"object"},EnterpriseCollection:{additionalProperties:!1,properties:{categories:{items:{$ref:"#/definitions/EnterpriseCategory"},type:"array"},categoryPriorities:{$ref:"#/definitions/EnterpriseCategoryPriority"},enterpriseStyles:{$ref:"#/definitions/EnterpriseStyles"},floorText:{$ref:"#/definitions/EnterpriseFloorText"},layers:{items:{$ref:"#/definitions/EnterpriseLayer"},type:"array"},locationInstances:{items:{$ref:"#/definitions/EnterpriseLocationInstance"},type:"array"},locations:{items:{$ref:"#/definitions/EnterpriseLocation"},type:"array"},textures:{items:{$ref:"#/definitions/EnterpriseTexture"},type:"array"},venue:{$ref:"#/definitions/EnterpriseVenue"}},required:["locations","categories","venue","locationInstances","layers"],type:"object"},EnterpriseFloorText:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorTextFeatureCollection"},{not:{}}]},description:"The text to display on a map, split into feature collection per floor.",type:"object"},EnterpriseLayer:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/EnterpriseLayerId"},name:{type:"string"},spaces:{items:{$ref:"#/definitions/EnterpriseLayerSpace"},minItems:1,type:"array"}},required:["id","name","spaces"],type:"object"},EnterpriseLayerId:{pattern:"^ely_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLayerSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},EnterpriseLocation:{additionalProperties:!1,properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["externalId","id","name","nodes","polygons","sortOrder","spaces","type"],type:"object"},EnterpriseLocationId:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLocationInstance:{additionalProperties:!1,description:"A locationInstance is a particular instace of an Enterprise Location that has some properties different from the parent. Eg, it may have different hours, or a slightly different name.\n\nA LocationInstance:\n- MUST have a parent, referring to an Enterprise Location.\n- MUST have a unique ID, for localization to work.\n- SHOULD have AT LEAST ONE polygon or node to anchor it in space.\n- SHOULD have AT LEAST ONE other Enterprise Location property set.\n\nIt is otherwise a Partial<EnterpriseLocation>\n\nUsage examples:\n- A locationInstance for a location with a different externalId so a customer can identify them individually.\n- A locationInstance with different operationHours, that might indicate different hours for that particular entrace.",properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationInstanceId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},parent:{$ref:"#/definitions/EnterpriseLocationId"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["id","parent"],type:"object"},EnterpriseLocationInstanceId:{description:"An ID for an enterprise location instance",pattern:"^eli_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseStyles:{additionalProperties:{additionalProperties:!1,properties:{edgeOffset:{type:"number"},geometryAnchors:{items:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},type:"array"}},required:["geometryAnchors"],type:"object"},type:"object"},EnterpriseTexture:{additionalProperties:!1,properties:{bounds:{description:"Coordinates of the texture's bounding box in format: [minLon, minLat, maxLon, maxLat].",items:{type:"number"},maxItems:4,minItems:4,type:"array"},face:{$ref:"#/definitions/EnterpriseTextureFace",description:"Face of the polygon that the texture will be applied to.\n\n'top' means that the texture will be applied to the upward-pointing face of the polygon.\n\n'side' means that the texture will be applied to every side face of the polygon."},geometryAnchors:{description:"Anchors for the texture on the geometry of the polygon.",items:{$ref:"#/definitions/EnterpriseTextureGeometryAnchor"},minItems:1,type:"array"},offset:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls the starting position of the texture on the surface. The u value shifts the texture horizontally and v shifts vertically."},path:{description:"Path to the texture image. Must be either a PNG or JPG format.",type:"string"},repeat:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls how many times the texture repeats across the surface. The u value controls horizontal repetition and v controls vertical repetition."},rotation:{description:"Rotation of the texture in degrees clockwise.\n\nFor top textures this is relative to north. North is 0, east is 90.\n\nFor side textures this is relative to the upward direction, with 0 degrees being upright.",maximum:360,minimum:0,type:"number"},surface:{$ref:"#/definitions/EnterpriseTextureSurface",description:"Surface of the polygon that the texture will be applied to.\n\n'inside' means that the texture will only be applied to the interior surface of the polygon.\n\n'outside' means that the texture will only be applied to the exterior surface of the polygon.\n\n'both' means that the texture will be applied to both interior and exterior surfaces of the polygon."}},required:["repeat","offset","rotation","path","face","surface","bounds","geometryAnchors"],type:"object"},EnterpriseTextureFace:{enum:["top","side"],type:"string"},EnterpriseTextureGeometryAnchor:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},EnterpriseTextureSurface:{enum:["inside","outside","both"],type:"string"},EnterpriseTextureUV:{additionalProperties:!1,properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},EnterpriseVenue:{additionalProperties:!1,properties:{countrycode:{description:"The ISO 3166-1 alpha-2 country code of the venue, if known\n\nEg. `US` or `GB`",type:"string"},coverImage:{description:"The venue's cover image",format:"uri",type:"string"},defaultFloor:{$ref:"#/definitions/FloorId",description:"The venue's default floor"},defaultLanguage:{$ref:"#/definitions/Language"},defaultMap:{$ref:"#/definitions/FloorId",deprecated:"Use `defaultFloor` instead"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The venue's icon",format:"uri",type:"string"},languages:{items:{$ref:"#/definitions/Language"},type:"array"},logo:{description:"The venue's logo",format:"uri",type:"string"},mappedinWebUrl:{description:"The base URL for Mappedin Web for this venue\n\nBetter name?",type:"string"},name:{type:"string"},operationHours:{description:"When this venue is open.",items:{$ref:"#/definitions/OperationHours"},type:"array"},slug:{type:"string"},topLocations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},tzid:{description:"The venue's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",pattern:"^[A-Za-z0-9\\/_-]+$",type:"string"}},required:["defaultLanguage","externalId","languages","name","slug"],type:"object"},EntranceCollection:{$ref:"#/definitions/FeatureCollection%3CLineString%2CEntranceProperties%3E"},EntranceId:{pattern:"^e_[A-Za-z0-9_-]{8,}$",type:"string"},EntranceProperties:{additionalProperties:!1,properties:{details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/EntranceId"},isExterior:{type:"boolean"},metadata:{$ref:"#/definitions/Metadata"},node:{$ref:"#/definitions/NodeId"}},required:["id","externalId"],type:"object"},Facade:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/FacadeId"},spaces:{items:{$ref:"#/definitions/FacadeSpace"},minItems:1,type:"array"}},required:["id","spaces"],type:"object"},FacadeId:{pattern:"^fc_[A-Za-z0-9_-]{8,}$",type:"string"},FacadeSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},"Feature<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"}]},properties:{$ref:"#/definitions/ObstructionProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"},{$ref:"#/definitions/Point"}]},properties:{$ref:"#/definitions/SpaceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/MultiPolygon"},{type:"null"}]},properties:{$ref:"#/definitions/FloorProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<LineString,EntranceProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/EntranceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorImageProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorImageProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorTextProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorTextProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,NodeProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/NodeProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,TextAreaProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/TextAreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/FloorStackFootprintProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"FeatureCollection<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<LineString,EntranceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CLineString%2CEntranceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorImageProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorImageProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorTextProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorTextProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,NodeProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CNodeProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,TextAreaProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CTextAreaProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPolygon%2CFloorStackFootprintProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},FeatureCollectionType:{const:"FeatureCollection",description:"The type field used for a collection of GeoJSON features.",type:"string"},FeatureType:{const:"Feature",description:"The type field used for individual GeoJSON features.",type:"string"},FloatingFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},verticalOffset:{description:"The vertical offset of the text, in meters.",type:"number"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","rotation","text","verticalOffset","visible"],type:"object"},FloatingImageProperties:{additionalProperties:!1,properties:{height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the image, in meters, relative to the ground plane.",minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["height","path","rotation","verticalOffset","width"],type:"object"},FloatingTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the text area, in meters, relative to the ground plane.",minimum:0,type:"number"}},required:["align","maxHeight","maxWidth","rotation","verticalOffset"],type:"object"},FloorCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},FloorId:{description:"The m_ prefix is deprecated, from when floors were previously called maps. Use f_ as the prefix instead.",pattern:"^[mf]_[A-Za-z0-9_-]{8,}$",type:"string"},FloorImageFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorImageProperties%3E",description:"A collection of images to be displayed on a map. They are either attached to a polygon or are floating in space."},FloorImageProperties:{anyOf:[{$ref:"#/definitions/AnchoredImageProperties"},{$ref:"#/definitions/FloatingImageProperties"}]},FloorProperties:{additionalProperties:!1,properties:{elevation:{description:"The elevation of this map relative to other maps in the stack. Must be an integer.",type:"integer"},externalId:{description:"Use of this property as the name of the map is deprecated. Use the name property instead.",type:"string"},id:{$ref:"#/definitions/FloorId"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map, if it exists. Usually one or two characters (eg, 3, F1, L, etc.) For display in very small spaces, like a floor selector dropdown. Might line up with what is shown on elevator buttons in the physical world.",type:"string"},subtitle:{description:'A subtitle for the map, for display in larger spaces, usually beneath the full name. Provides additional context for what is actually on the map, if the name is not clear. For example, if the full name is "Level 1", the subtitle might be "Arrivals and Baggage Claim".\n\nShould be no more than a few words.',type:"string"}},required:["id","externalId","elevation"],type:"object"},FloorStack:{additionalProperties:!1,properties:{defaultFloor:{$ref:"#/definitions/FloorId",description:"The default floor to use when a floor is not specified."},externalId:{type:"string"},floors:{description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},footprint:{$ref:"#/definitions/FeatureCollection%3CPolygon%2CFloorStackFootprintProperties%3E",description:"Provides a footprint for the map stack based on the geometry of the maps it contains. This is useful for rendering a map stack without loading all of its maps."},id:{$ref:"#/definitions/FloorStackId"},maps:{deprecated:"Use `floors` instead.",description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map stack, if it exists. For display in small spaces, like a floor selector dropdown.",type:"string"},type:{description:"The type of MapStack, e.g. Building, Outdoor. Defaults to Building.",enum:["Building","Outdoor"],type:"string"}},required:["id","externalId","name","maps"],type:"object"},FloorStackFootprintProperties:{additionalProperties:{not:{}},type:"object"},FloorStackId:{description:"The mg_ prefix is deprecated, from when floor stacks were previously called map groups. Use fs_ as the prefix instead.",pattern:"^fs_[A-Za-z0-9_-]{8,}$",type:"string"},FloorStacks:{items:{$ref:"#/definitions/FloorStack"},type:"array"},FloorTextFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorTextProperties%3E",description:"A collection of text to be displayed on a map. They are either attached to a space or are floating."},FloorTextProperties:{anyOf:[{$ref:"#/definitions/AnchoredFloorTextProperties"},{$ref:"#/definitions/FloatingFloorTextProperties"}]},Hyperlink:{additionalProperties:!1,properties:{displayName:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Image:{additionalProperties:!1,properties:{altText:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Language:{additionalProperties:!1,properties:{code:{type:"string"},name:{type:"string"}},required:["name","code"],type:"object"},Latitude:{description:"A WGS 84-compatible latitude coordinate value.",maximum:90,minimum:-90,type:"number"},LineString:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON LineString geometry.",properties:{coordinates:{items:{$ref:"#/definitions/Position"},minItems:2,type:"array"},type:{const:"LineString",type:"string"}},required:["coordinates","type"],type:"object"},LineStringStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},lineStrings:{description:"The line strings which this style applies to.",items:{anyOf:[{$ref:"#/definitions/EntranceId"},{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},opacity:{maximum:1,minimum:0,type:"number"},width:{description:"The thickness of the line when rendered, in meters, measured from the center to the edge.",exclusiveMinimum:0,type:"number"}},required:["altitude","color","height","lineStrings","opacity","width"],type:"object"},LocalPosition:{description:"A position for a local coordinate system, measured in metres.",items:{type:"number"},maxItems:2,minItems:2,type:"array"},Location:{additionalProperties:!1,properties:{annotations:{items:{$ref:"#/definitions/LocationAnnotationMapping"},type:"array"},areas:{items:{$ref:"#/definitions/LocationAreaMapping"},type:"array"},categories:{items:{$ref:"#/definitions/CategoryId"},type:"array"},connections:{items:{$ref:"#/definitions/ConnectionId"},type:"array"},description:{type:"string"},entrances:{items:{$ref:"#/definitions/LocationEntranceMapping"},type:"array"},externalId:{type:"string"},icon:{description:"The location's icon, one of picture/category/logo",format:"uri",type:"string"},id:{$ref:"#/definitions/LocationId"},links:{description:"Web links for the location",items:{$ref:"#/definitions/LocationLink"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},obstructions:{items:{$ref:"#/definitions/LocationObstructionMapping"},type:"array"},openingHoursSpecification:{description:"The location's opening hours",items:{$ref:"#/definitions/OpeningHoursSpecification"},type:"array"},phone:{type:"string"},pictures:{description:"The location's pictures",items:{$ref:"#/definitions/LocationPicture"},type:"array"},social:{description:"The location's social media links.",items:{$ref:"#/definitions/LocationSocial"},type:"array"},spaces:{items:{$ref:"#/definitions/LocationSpaceMapping"},type:"array"},website:{$ref:"#/definitions/LocationLink",description:"The location's website"}},required:["id","name","categories","spaces","obstructions","entrances","connections","annotations","areas","social","pictures","links","openingHoursSpecification"],type:"object"},LocationAnnotationMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AnnotationId"}},required:["floor","id"],type:"object"},LocationAreaMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AreaId"}},required:["floor","id"],type:"object"},LocationEntranceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/EntranceId"}},required:["floor","id"],type:"object"},LocationId:{description:"An ID for a location",pattern:"^loc_[A-Za-z0-9_-]{8,}$",type:"string"},LocationLink:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},LocationObstructionMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/ObstructionId"}},required:["floor","id"],type:"object"},LocationPicture:{additionalProperties:!1,description:"The location's pictures Single-field object, because it's plausible we might add captions or comments in the future",properties:{url:{format:"uri",type:"string"}},type:"object"},LocationSocial:{additionalProperties:!1,properties:{name:{description:"The name of the social media platform.",type:"string"},url:{description:"The URL of the social media profile",format:"uri",type:"string"}},required:["name","url"],type:"object"},LocationSpaceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},LocationState:{additionalProperties:!1,description:"The state of a location. Start and end dates are optional.",properties:{end:{description:"The start date of the state",format:"date",type:"string"},start:{description:"The start date of the state",format:"date",type:"string"},type:{description:"The type of the location state. Technically not limited, but should be one of the following:\n- closed-temporarily\n- new\n- pop-up\n- coming-soon\n- relocated",type:"string"}},required:["type"],type:"object"},Longitude:{description:"A WGS 84-compatible longitude coordinate value.",maximum:180,minimum:-180,type:"number"},ManifestCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/ManifestFeature"},maxItems:1,minItems:1,type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},ManifestFeature:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/ManifestProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},ManifestFile:{additionalProperties:!1,properties:{name:{type:"string"},type:{const:"file",type:"string"}},required:["type","name"],type:"object"},ManifestFolder:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/ManifestFile"},minItems:1,type:"array"},name:{type:"string"},type:{const:"folder",type:"string"}},required:["type","name","children"],type:"object"},ManifestProperties:{additionalProperties:!1,properties:{folder_struct:{items:{anyOf:[{$ref:"#/definitions/ManifestFolder"},{$ref:"#/definitions/ManifestFile"}]},type:"array"},language:{description:"The RFC 5646 language tag of the MVF. https://datatracker.ietf.org/doc/html/rfc5646",examples:["en-US"],type:"string"},map:{description:"The identifier of the map that this MVF is for.",type:"string"},name:{type:"string"},naturalBearing:{description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"',maximum:360,minimum:0,type:"number"},org_id:{type:"string"},time:{description:"An ISO 8601 date-time string, including timezone offset.",format:"date-time",type:"string"},tzid:{description:"The map's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",examples:["America/New_York"],pattern:"^[A-Za-z0-9_-]+\\/[A-Za-z0-9_-]+$",type:"string"},version:{const:"2.0.0",type:"string"}},required:["name","folder_struct","version","time"],type:"object"},Maps:{deprecated:"This is only present on `map.geojson` which is deprecated. Use\nthe collection on `floor.geojson` instead.",items:{$ref:"#/definitions/FloorProperties"},type:"array"},Material:{additionalProperties:!1,description:"The color and/or texture that should be applied to an instance of a Shape.\n\nIf both a color and a texture are provided, the color will be applied to the texture via a multiply operation. If neither are provided, the shape will be white.",properties:{color:{description:"The color of this mateial as a hex code.",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},texture:{$ref:"#/definitions/Texture"}},type:"object"},Metadata:{additionalProperties:{},description:"Can be any extra metadata that is not part of the main MVF spec. Presence of any key or value is not guaranteed. Values are expected to be JSON-serializable.",type:"object"},ModelInstance:{additionalProperties:!1,description:"An instance of a 3D model.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},path:{description:"The path to this asset, relative to the MVF's models folder. Supports GLTF and OBJ.",minLength:1,type:"string"},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","path","position","rotation","scale"],type:"object"},ModelInstanceCollection:{additionalProperties:{$ref:"#/definitions/ModelInstance"},description:"A map of model instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},MultiPolygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry.",properties:{coordinates:{items:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:"array"},type:{const:"MultiPolygon",type:"string"}},required:["coordinates","type"],type:"object"},NodeCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CNodeProperties%3E"},NodeId:{pattern:"^n_[A-Za-z0-9_-]{8,}$",type:"string"},NodeProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},floor:{$ref:"#/definitions/FloorId",description:"The ID of the floor this node is found on."},id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId",deprecated:"use `floor` instead.",description:"The ID of the floor this node is found on."},neighbors:{description:"A list of nodes that can be navigated to from this node.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},weight:{description:"The cost of navigating to this node.",minimum:0,type:"number"}},required:["id","weight"],type:"object"},type:"array"},preventSmoothing:{description:"Flag that may optionally indicate that a node is part of a custom path network rather than auto generated and should not be removed during smoothing/simplifcation.",type:"boolean"},space:{description:"The IDs of any spaces this node may be contained within.",items:{$ref:"#/definitions/SpaceId"},type:"array"}},required:["id","externalId","map","space","neighbors"],type:"object"},ObstructionCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},ObstructionId:{pattern:"^o_[A-Za-z0-9_-]{8,}$",type:"string"},ObstructionProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this obstruction, if it is a polygon. This is undefined for line strings as this can be trivially derived."},details:{$ref:"#/definitions/Details"},entrances:{description:"A list of entrance IDs corresponding to entrances that can be used to navigate through this obstruction.",items:{$ref:"#/definitions/EntranceId"},type:"array"},externalId:{type:"string"},footprintComponent:{description:"Indicates whether this obstruction is considered part of the footprint of the building it is a part of. For example, an exterior wall would be considered part of the building footprint.",type:"boolean"},id:{$ref:"#/definitions/ObstructionId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"}},required:["id","externalId","entrances"],type:"object"},OpeningHoursSpecification:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.\n\nBehavioral notes:\n- if the \"opens\" property is not present, the location is closed, and the closes property is ignored (Schema.org style)\n- if opens/closes are both set to 00:00, the location is closed (Google style)\n- If special hours do not specifiy certain weekdays being open, those weekdays are closed.\n- Not specifying dayOfWeek is equivalent to specifying every day of the week.\n- we will omit the '@type' property when producing MVFs. But we won't reject 3rd party MVFs that include it.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of opening hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the opening hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the opening hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the opening hours start"},validFrom:{description:"The date the opening hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the opening hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},OperationHours:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of operation hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the operation hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the operation hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the operation hours start"},validFrom:{description:"The date the operation hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the operation hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},ParsedMVF:{additionalProperties:!1,properties:{annotation:{additionalProperties:{anyOf:[{$ref:"#/definitions/AnnotationCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},area:{additionalProperties:{anyOf:[{$ref:"#/definitions/AreaCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"category.json":{items:{$ref:"#/definitions/Category"},type:"array"},"connection.json":{$ref:"#/definitions/Connections"},enterprise:{$ref:"#/definitions/EnterpriseCollection"},entrance:{additionalProperties:{anyOf:[{$ref:"#/definitions/EntranceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},facade:{additionalProperties:{anyOf:[{$ref:"#/definitions/Facade"},{not:{}}]},propertyNames:{pattern:"^fs_[A-Za-z0-9_-]{8,}$"},type:"object"},"floor.geojson":{$ref:"#/definitions/FloorCollection"},floorImages:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorImageFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"floorstack.json":{$ref:"#/definitions/FloorStacks"},"location.json":{items:{$ref:"#/definitions/Location"},type:"array"},"manifest.geojson":{$ref:"#/definitions/ManifestCollection"},"map.geojson":{$ref:"#/definitions/Maps",deprecated:"Use `floor.geojson` instead."},"mapstack.geojson":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},"mapstack.json":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},modelInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ModelInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"node.geojson":{$ref:"#/definitions/NodeCollection"},obstruction:{additionalProperties:{anyOf:[{$ref:"#/definitions/ObstructionCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},shapeInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ShapeInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"shapes.json":{$ref:"#/definitions/ShapeCollection"},space:{additionalProperties:{anyOf:[{$ref:"#/definitions/SpaceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"styles.json":{$ref:"#/definitions/StyleCollection"},textAreas:{additionalProperties:{anyOf:[{$ref:"#/definitions/TextAreaFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"tileset.json":{$ref:"#/definitions/TilesetCollection"},window:{additionalProperties:{anyOf:[{$ref:"#/definitions/WindowCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"}},required:["manifest.geojson","mapstack.geojson","map.geojson","space","obstruction","connection.json","node.geojson","entrance"],type:"object"},Point:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Point geometry.",properties:{coordinates:{$ref:"#/definitions/Position"},type:{const:"Point",type:"string"}},required:["coordinates","type"],type:"object"},PointStyle:{additionalProperties:!1,properties:{points:{description:"The points which this style applies to.",items:{$ref:"#/definitions/SpaceId"},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the point.",type:"boolean"}},required:["points"],type:"object"},Polygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Polygon geometry.",properties:{coordinates:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:{const:"Polygon",type:"string"}},required:["coordinates","type"],type:"object"},PolygonStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},opacity:{maximum:1,minimum:0,type:"number"},polygons:{description:"The polygons which this style applies to.",items:{anyOf:[{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the polygon.",type:"boolean"}},required:["altitude","color","height","opacity","polygons"],type:"object"},Position:{description:"A valid WGS 84 position consisting of a longitude coodinate, followed by a latitude coordinate.",items:[{$ref:"#/definitions/Longitude"},{$ref:"#/definitions/Latitude"}],maxItems:2,minItems:2,type:"array"},Ring:{description:"A simple shape for part of a complex polygon",items:{$ref:"#/definitions/LocalPosition"},minItems:3,type:"array"},Shape:{description:"A 3D object made from extruded 2D polygons, that can be rendered to the map as a ShapeInstance.",items:{$ref:"#/definitions/ShapeComponent"},minItems:1,type:"array"},ShapeCollection:{additionalProperties:{$ref:"#/definitions/Shape"},description:"A group of Shapes, without any information as to how they will be placed in a scene.",propertyNames:{pattern:"^sh_[A-Za-z0-9_-]{8,}$"},type:"object"},ShapeComponent:{additionalProperties:!1,description:"A single extruded 2D polygon.",properties:{altitude:{description:"In metres.",type:"number"},geometry:{description:"Can contain holes, like GeoJSON.",items:{$ref:"#/definitions/Ring"},minItems:1,type:"array"},height:{description:"In metres.",exclusiveMinimum:0,type:"number"}},required:["geometry","altitude","height"],type:"object"},ShapeId:{pattern:"^sh_[A-Za-z0-9_-]{8,}$",type:"string"},ShapeInstance:{additionalProperties:!1,description:"An instance of a Shape.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},id:{$ref:"#/definitions/ShapeId",description:"The identifier of the Shape to be placed."},material:{$ref:"#/definitions/Material",description:"The color and/or texture to apply to this shape instance."},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","id","material","position","rotation","scale"],type:"object"},ShapeInstanceCollection:{additionalProperties:{$ref:"#/definitions/ShapeInstance"},description:"A map of shape instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},SiblingGroup:{additionalProperties:!1,properties:{label:{type:"string"},siblings:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"}},required:["label","siblings"],type:"object"},SpaceCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},SpaceId:{pattern:"^s_[A-Za-z0-9_-]{8,}$",type:"string"},SpaceProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this space, if it is a polygon. This is undefined for line string and point spaces as these can be trivially derived."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this space.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/SpaceId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"},tags:{description:"A list of tags that may apply to categorize the space, e.g. Void",items:{type:"string"},type:"array"}},required:["id","externalId","destinationNodes"],type:"object"},StyleCollection:{additionalProperties:{anyOf:[{$ref:"#/definitions/PolygonStyle"},{$ref:"#/definitions/LineStringStyle"},{$ref:"#/definitions/PointStyle"},{not:{}}]},description:"A map of layer styles, where keys represent the group IDs of each style.",type:"object"},TextAreaAlignment:{enum:["near","center"],type:"string"},TextAreaFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CTextAreaProperties%3E",description:"A collection of text areas to be displayed on a map. They are either attached to a polygon or are floating in space."},TextAreaProperties:{anyOf:[{$ref:"#/definitions/AnchoredTextAreaProperties"},{$ref:"#/definitions/FloatingTextAreaProperties"}]},Texture:{additionalProperties:!1,description:"A reference to an image texture and how it should be applied to a Component.",properties:{path:{description:"The path to this asset, relative to the MVF's images folder.",minLength:1,type:"string"},repeat:{$ref:"#/definitions/TextureRepeat"}},required:["path"],type:"object"},TextureRepeat:{additionalProperties:!1,description:"How a texture should be placed on a Component.",properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},TilesetCollection:{additionalProperties:!1,description:"Collection of tileset styles",properties:{default:{$ref:"#/definitions/TilesetStyle",description:"Default tileset style that should be used"},others:{description:"Additional tileset styles that can be used",items:{$ref:"#/definitions/TilesetStyle"},type:"array"}},required:["default"],type:"object"},TilesetStyle:{additionalProperties:!1,description:"A tileset style definition",properties:{key:{description:"Unique identifier for this tileset style",minLength:1,type:"string"},name:{description:"Display name for this tileset style",minLength:1,type:"string"},url:{description:"URL to the tileset style definition. This should be a JSON file matching the MapLibre style specification.",format:"uri",type:"string"}},required:["key","name","url"],type:"object"},Time:{description:"A time in the format of HH:MM:SS",pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",type:"string"},Vector3:{description:"A three-number tuple.",items:{type:"number"},maxItems:3,minItems:3,type:"array"},WindowCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/WindowProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},WindowId:{pattern:"^w_[A-Za-z0-9_-]{8,}$",type:"string"},WindowProperties:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/WindowId"}},required:["id"],type:"object"}}};var rOe=pF.default.default(new uF.default.default).compile(W0(cF));p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();var ct={};Ul(ct,{HasPropertyKey:()=>$re,IsArray:()=>Tn,IsAsyncIterator:()=>qC,IsBigInt:()=>ay,IsBoolean:()=>ec,IsDate:()=>Mu,IsFunction:()=>ZC,IsIterator:()=>XC,IsNull:()=>YC,IsNumber:()=>Fi,IsObject:()=>Ut,IsRegExp:()=>ly,IsString:()=>Xt,IsSymbol:()=>KC,IsUint8Array:()=>Fa,IsUndefined:()=>yr});p();function $re(e,t){return t in e}function qC(e){return Ut(e)&&!Tn(e)&&!Fa(e)&&Symbol.asyncIterator in e}function Tn(e){return Array.isArray(e)}function ay(e){return typeof e=="bigint"}function ec(e){return typeof e=="boolean"}function Mu(e){return e instanceof globalThis.Date}function ZC(e){return typeof e=="function"}function XC(e){return Ut(e)&&!Tn(e)&&!Fa(e)&&Symbol.iterator in e}function YC(e){return e===null}function Fi(e){return typeof e=="number"}function Ut(e){return typeof e=="object"&&e!==null}function ly(e){return e instanceof globalThis.RegExp}function Xt(e){return typeof e=="string"}function KC(e){return typeof e=="symbol"}function Fa(e){return e instanceof globalThis.Uint8Array}function yr(e){return e===void 0}function jre(e){return e.map(t=>q0(t))}function Gre(e){return new Date(e.getTime())}function Ure(e){return new Uint8Array(e)}function Vre(e){return new RegExp(e.source,e.flags)}function zre(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=q0(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=q0(e[r]);return t}function q0(e){return Tn(e)?jre(e):Mu(e)?Gre(e):Fa(e)?Ure(e):ly(e)?Vre(e):Ut(e)?zre(e):e}function rr(e){return q0(e)}function dF(e){return e.map(t=>cy(t))}function cy(e,t){return t===void 0?rr(e):rr({...t,...e})}p();p();p();function Z0(e){return ze(e)&&Symbol.asyncIterator in e}function X0(e){return ze(e)&&Symbol.iterator in e}function JC(e){return ze(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function Y0(e){return e instanceof Promise}function Vn(e){return e instanceof Date&&Number.isFinite(e.getTime())}function fF(e){return e instanceof globalThis.Map}function mF(e){return e instanceof globalThis.Set}function Xo(e){return ArrayBuffer.isView(e)}function Jd(e){return e instanceof globalThis.Uint8Array}function Fe(e,t){return t in e}function ze(e){return e!==null&&typeof e=="object"}function Ge(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}function gr(e){return e===void 0}function La(e){return e===null}function Os(e){return typeof e=="boolean"}function we(e){return typeof e=="number"}function K0(e){return Number.isInteger(e)}function sn(e){return typeof e=="bigint"}function ut(e){return typeof e=="string"}function tc(e){return typeof e=="function"}function Ra(e){return typeof e=="symbol"}function an(e){return sn(e)||Os(e)||La(e)||we(e)||ut(e)||Ra(e)||gr(e)}var Dt;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(s,a){return e.ExactOptionalPropertyTypes?a in s:s[a]!==void 0}e.IsExactOptionalProperty=t;function r(s){let a=ze(s);return e.AllowArrayObject?a:a&&!Ge(s)}e.IsObjectLike=r;function n(s){return r(s)&&!(s instanceof Date)&&!(s instanceof Uint8Array)}e.IsRecordLike=n;function o(s){return e.AllowNaN?we(s):Number.isFinite(s)}e.IsNumberLike=o;function i(s){let a=gr(s);return e.AllowNullVoid?a||s===null:a}e.IsVoidLike=i})(Dt||(Dt={}));p();function Hre(e){return globalThis.Object.freeze(e).map(t=>uy(t))}function Wre(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=uy(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=uy(e[r]);return globalThis.Object.freeze(t)}function uy(e){return Tn(e)?Hre(e):Mu(e)?e:Fa(e)?e:ly(e)?e:Ut(e)?Wre(e):e}function J(e,t){let r=t!==void 0?{...t,...e}:e;switch(Dt.InstanceMode){case"freeze":return uy(r);case"clone":return rr(r);default:return r}}p();var Ae=class extends Error{constructor(t){super(t)}};p();p();p();var nr=Symbol.for("TypeBox.Transform"),Na=Symbol.for("TypeBox.Readonly"),zn=Symbol.for("TypeBox.Optional"),Yo=Symbol.for("TypeBox.Hint"),W=Symbol.for("TypeBox.Kind");function hF(e){return Ut(e)&&e[Na]==="Readonly"}function Es(e){return Ut(e)&&e[zn]==="Optional"}function QC(e){return gt(e,"Any")}function Ba(e){return gt(e,"Array")}function py(e){return gt(e,"AsyncIterator")}function eP(e){return gt(e,"BigInt")}function tP(e){return gt(e,"Boolean")}function dy(e){return gt(e,"Constructor")}function qre(e){return gt(e,"Date")}function fy(e){return gt(e,"Function")}function Ou(e){return gt(e,"Integer")}function Or(e){return gt(e,"Intersect")}function my(e){return gt(e,"Iterator")}function gt(e,t){return Ut(e)&&W in e&&e[W]===t}function $a(e){return gt(e,"Literal")}function wo(e){return gt(e,"MappedKey")}function or(e){return gt(e,"MappedResult")}function rc(e){return gt(e,"Never")}function Zre(e){return gt(e,"Not")}function Xre(e){return gt(e,"Null")}function Eu(e){return gt(e,"Number")}function $r(e){return gt(e,"Object")}function _u(e){return gt(e,"Promise")}function rP(e){return gt(e,"Record")}function nP(e){return gt(e,"Ref")}function oP(e){return gt(e,"RegExp")}function hy(e){return gt(e,"String")}function Yre(e){return gt(e,"Symbol")}function Mo(e){return gt(e,"TemplateLiteral")}function Kre(e){return gt(e,"This")}function Qd(e){return Ut(e)&&nr in e}function Li(e){return gt(e,"Tuple")}function Jre(e){return gt(e,"Undefined")}function Ot(e){return gt(e,"Union")}function Qre(e){return gt(e,"Uint8Array")}function ene(e){return gt(e,"Unknown")}function tne(e){return gt(e,"Unsafe")}function rne(e){return gt(e,"Void")}function nc(e){return Ut(e)&&W in e&&Xt(e[W])}function Ri(e){return QC(e)||Ba(e)||tP(e)||eP(e)||py(e)||dy(e)||qre(e)||fy(e)||Ou(e)||Or(e)||my(e)||$a(e)||wo(e)||or(e)||rc(e)||Zre(e)||Xre(e)||Eu(e)||$r(e)||_u(e)||rP(e)||nP(e)||oP(e)||hy(e)||Yre(e)||Mo(e)||Kre(e)||Li(e)||Jre(e)||Ot(e)||Qre(e)||ene(e)||tne(e)||rne(e)||nc(e)}var R={};Ul(R,{IsAny:()=>vF,IsArray:()=>xF,IsAsyncIterator:()=>IF,IsBigInt:()=>SF,IsBoolean:()=>CF,IsConstructor:()=>PF,IsDate:()=>TF,IsFunction:()=>wF,IsInteger:()=>MF,IsIntersect:()=>OF,IsIterator:()=>EF,IsKind:()=>QF,IsKindOf:()=>dt,IsLiteral:()=>gy,IsLiteralBoolean:()=>lne,IsLiteralNumber:()=>AF,IsLiteralString:()=>_F,IsLiteralValue:()=>kF,IsMappedKey:()=>DF,IsMappedResult:()=>FF,IsNever:()=>LF,IsNot:()=>RF,IsNull:()=>NF,IsNumber:()=>BF,IsObject:()=>$F,IsOptional:()=>ane,IsPromise:()=>jF,IsProperties:()=>lP,IsReadonly:()=>sne,IsRecord:()=>GF,IsRecursive:()=>cne,IsRef:()=>UF,IsRegExp:()=>VF,IsSchema:()=>pt,IsString:()=>zF,IsSymbol:()=>HF,IsTemplateLiteral:()=>WF,IsThis:()=>qF,IsTransform:()=>Yt,IsTuple:()=>ZF,IsUint8Array:()=>XF,IsUndefined:()=>ef,IsUnion:()=>cP,IsUnionLiteral:()=>une,IsUnknown:()=>YF,IsUnsafe:()=>KF,IsVoid:()=>JF,TypeGuardUnknownTypeError:()=>iP});p();var iP=class extends Ae{},nne=["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 yF(e){try{return new RegExp(e),!0}catch{return!1}}function sP(e){if(!Xt(e))return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}function gF(e){return aP(e)||pt(e)}function yy(e){return yr(e)||ay(e)}function qt(e){return yr(e)||Fi(e)}function aP(e){return yr(e)||ec(e)}function Lt(e){return yr(e)||Xt(e)}function one(e){return yr(e)||Xt(e)&&sP(e)&&yF(e)}function ine(e){return yr(e)||Xt(e)&&sP(e)}function bF(e){return yr(e)||pt(e)}function sne(e){return Ut(e)&&e[Na]==="Readonly"}function ane(e){return Ut(e)&&e[zn]==="Optional"}function vF(e){return dt(e,"Any")&&Lt(e.$id)}function xF(e){return dt(e,"Array")&&e.type==="array"&&Lt(e.$id)&&pt(e.items)&&qt(e.minItems)&&qt(e.maxItems)&&aP(e.uniqueItems)&&bF(e.contains)&&qt(e.minContains)&&qt(e.maxContains)}function IF(e){return dt(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Lt(e.$id)&&pt(e.items)}function SF(e){return dt(e,"BigInt")&&e.type==="bigint"&&Lt(e.$id)&&yy(e.exclusiveMaximum)&&yy(e.exclusiveMinimum)&&yy(e.maximum)&&yy(e.minimum)&&yy(e.multipleOf)}function CF(e){return dt(e,"Boolean")&&e.type==="boolean"&&Lt(e.$id)}function PF(e){return dt(e,"Constructor")&&e.type==="Constructor"&&Lt(e.$id)&&Tn(e.parameters)&&e.parameters.every(t=>pt(t))&&pt(e.returns)}function TF(e){return dt(e,"Date")&&e.type==="Date"&&Lt(e.$id)&&qt(e.exclusiveMaximumTimestamp)&&qt(e.exclusiveMinimumTimestamp)&&qt(e.maximumTimestamp)&&qt(e.minimumTimestamp)&&qt(e.multipleOfTimestamp)}function wF(e){return dt(e,"Function")&&e.type==="Function"&&Lt(e.$id)&&Tn(e.parameters)&&e.parameters.every(t=>pt(t))&&pt(e.returns)}function MF(e){return dt(e,"Integer")&&e.type==="integer"&&Lt(e.$id)&&qt(e.exclusiveMaximum)&&qt(e.exclusiveMinimum)&&qt(e.maximum)&&qt(e.minimum)&&qt(e.multipleOf)}function lP(e){return Ut(e)&&Object.entries(e).every(([t,r])=>sP(t)&&pt(r))}function OF(e){return dt(e,"Intersect")&&!(Xt(e.type)&&e.type!=="object")&&Tn(e.allOf)&&e.allOf.every(t=>pt(t)&&!Yt(t))&&Lt(e.type)&&(aP(e.unevaluatedProperties)||bF(e.unevaluatedProperties))&&Lt(e.$id)}function EF(e){return dt(e,"Iterator")&&e.type==="Iterator"&&Lt(e.$id)&&pt(e.items)}function dt(e,t){return Ut(e)&&W in e&&e[W]===t}function _F(e){return gy(e)&&Xt(e.const)}function AF(e){return gy(e)&&Fi(e.const)}function lne(e){return gy(e)&&ec(e.const)}function gy(e){return dt(e,"Literal")&&Lt(e.$id)&&kF(e.const)}function kF(e){return ec(e)||Fi(e)||Xt(e)}function DF(e){return dt(e,"MappedKey")&&Tn(e.keys)&&e.keys.every(t=>Fi(t)||Xt(t))}function FF(e){return dt(e,"MappedResult")&&lP(e.properties)}function LF(e){return dt(e,"Never")&&Ut(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function RF(e){return dt(e,"Not")&&pt(e.not)}function NF(e){return dt(e,"Null")&&e.type==="null"&&Lt(e.$id)}function BF(e){return dt(e,"Number")&&e.type==="number"&&Lt(e.$id)&&qt(e.exclusiveMaximum)&&qt(e.exclusiveMinimum)&&qt(e.maximum)&&qt(e.minimum)&&qt(e.multipleOf)}function $F(e){return dt(e,"Object")&&e.type==="object"&&Lt(e.$id)&&lP(e.properties)&&gF(e.additionalProperties)&&qt(e.minProperties)&&qt(e.maxProperties)}function jF(e){return dt(e,"Promise")&&e.type==="Promise"&&Lt(e.$id)&&pt(e.item)}function GF(e){return dt(e,"Record")&&e.type==="object"&&Lt(e.$id)&&gF(e.additionalProperties)&&Ut(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&yF(r[0])&&Ut(t.patternProperties)&&pt(t.patternProperties[r[0]])})(e)}function cne(e){return Ut(e)&&Yo in e&&e[Yo]==="Recursive"}function UF(e){return dt(e,"Ref")&&Lt(e.$id)&&Xt(e.$ref)}function VF(e){return dt(e,"RegExp")&&Lt(e.$id)&&Xt(e.source)&&Xt(e.flags)&&qt(e.maxLength)&&qt(e.minLength)}function zF(e){return dt(e,"String")&&e.type==="string"&&Lt(e.$id)&&qt(e.minLength)&&qt(e.maxLength)&&one(e.pattern)&&ine(e.format)}function HF(e){return dt(e,"Symbol")&&e.type==="symbol"&&Lt(e.$id)}function WF(e){return dt(e,"TemplateLiteral")&&e.type==="string"&&Xt(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function qF(e){return dt(e,"This")&&Lt(e.$id)&&Xt(e.$ref)}function Yt(e){return Ut(e)&&nr in e}function ZF(e){return dt(e,"Tuple")&&e.type==="array"&&Lt(e.$id)&&Fi(e.minItems)&&Fi(e.maxItems)&&e.minItems===e.maxItems&&(yr(e.items)&&yr(e.additionalItems)&&e.minItems===0||Tn(e.items)&&e.items.every(t=>pt(t)))}function ef(e){return dt(e,"Undefined")&&e.type==="undefined"&&Lt(e.$id)}function une(e){return cP(e)&&e.anyOf.every(t=>_F(t)||AF(t))}function cP(e){return dt(e,"Union")&&Lt(e.$id)&&Ut(e)&&Tn(e.anyOf)&&e.anyOf.every(t=>pt(t))}function XF(e){return dt(e,"Uint8Array")&&e.type==="Uint8Array"&&Lt(e.$id)&&qt(e.minByteLength)&&qt(e.maxByteLength)}function YF(e){return dt(e,"Unknown")&&Lt(e.$id)}function KF(e){return dt(e,"Unsafe")}function JF(e){return dt(e,"Void")&&e.type==="void"&&Lt(e.$id)}function QF(e){return Ut(e)&&W in e&&Xt(e[W])&&!nne.includes(e[W])}function pt(e){return Ut(e)&&(vF(e)||xF(e)||CF(e)||SF(e)||IF(e)||PF(e)||TF(e)||wF(e)||MF(e)||OF(e)||EF(e)||gy(e)||DF(e)||FF(e)||LF(e)||RF(e)||NF(e)||BF(e)||$F(e)||jF(e)||GF(e)||UF(e)||VF(e)||zF(e)||HF(e)||WF(e)||qF(e)||ZF(e)||ef(e)||cP(e)||XF(e)||YF(e)||KF(e)||JF(e)||QF(e))}p();var uP="(true|false)",by="(0|[1-9][0-9]*)",pP="(.*)",pne="(?!.*)",fEe="^".concat(uP,"$"),ja="^".concat(by,"$"),Ga="^".concat(pP,"$"),eL="^".concat(pne,"$");p();var Hn={};Ul(Hn,{Clear:()=>fne,Delete:()=>mne,Entries:()=>dne,Get:()=>gne,Has:()=>hne,Set:()=>yne});p();var tf=new Map;function dne(){return new Map(tf)}function fne(){return tf.clear()}function mne(e){return tf.delete(e)}function hne(e){return tf.has(e)}function yne(e,t){tf.set(e,t)}function gne(e){return tf.get(e)}var jr={};Ul(jr,{Clear:()=>vne,Delete:()=>xne,Entries:()=>bne,Get:()=>Cne,Has:()=>Ine,Set:()=>Sne});p();var rf=new Map;function bne(){return new Map(rf)}function vne(){return rf.clear()}function xne(e){return rf.delete(e)}function Ine(e){return rf.has(e)}function Sne(e,t){rf.set(e,t)}function Cne(e){return rf.get(e)}p();function tL(e,t){return e.includes(t)}function rL(e){return[...new Set(e)]}function Pne(e,t){return e.filter(r=>t.includes(r))}function Tne(e,t){return e.reduce((r,n)=>Pne(r,n),t)}function nL(e){return e.length===1?e[0]:e.length>1?Tne(e.slice(1),e[0]):[]}function oL(e){let t=[];for(let r of e)t.push(...r);return t}p();function oc(e){return J({[W]:"Any"},e)}p();function J0(e,t){return J({[W]:"Array",type:"array",items:e},t)}p();function Q0(e,t){return J({[W]:"AsyncIterator",type:"AsyncIterator",items:e},t)}p();p();p();function wne(e,t){let{[t]:r,...n}=e;return n}function Cr(e,t){return t.reduce((r,n)=>wne(r,n),e)}p();function Rt(e){return J({[W]:"Never",not:{}},e)}p();p();function bt(e){return J({[W]:"MappedResult",properties:e})}p();p();function ev(e,t,r){return J({[W]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}p();function ic(e,t,r){return J({[W]:"Function",type:"Function",parameters:e,returns:t},r)}p();p();p();p();function vy(e,t){return J({[W]:"Union",anyOf:e},t)}function Mne(e){return e.some(t=>Es(t))}function iL(e){return e.map(t=>Es(t)?One(t):t)}function One(e){return Cr(e,[zn])}function Ene(e,t){return Mne(e)?uo(vy(iL(e),t)):vy(iL(e),t)}function _s(e,t){return e.length===0?Rt(t):e.length===1?J(e[0],t):Ene(e,t)}p();function Nt(e,t){return e.length===0?Rt(t):e.length===1?J(e[0],t):vy(e,t)}p();p();p();var tv=class extends Ae{};function _ne(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function dP(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}function Ua(e,t){return dP(e,t,"(")}function xy(e,t){return dP(e,t,")")}function sL(e,t){return dP(e,t,"|")}function Ane(e){if(!(Ua(e,0)&&xy(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Ua(e,r)&&(t+=1),xy(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}function kne(e){return e.slice(1,e.length-1)}function Dne(e){let t=0;for(let r=0;r<e.length;r++)if(Ua(e,r)&&(t+=1),xy(e,r)&&(t-=1),sL(e,r)&&t===0)return!0;return!1}function Fne(e){for(let t=0;t<e.length;t++)if(Ua(e,t))return!0;return!1}function Lne(e){let[t,r]=[0,0],n=[];for(let i=0;i<e.length;i++)if(Ua(e,i)&&(t+=1),xy(e,i)&&(t-=1),sL(e,i)&&t===0){let s=e.slice(r,i);s.length>0&&n.push(nf(s)),r=i+1}let o=e.slice(r);return o.length>0&&n.push(nf(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}function Rne(e){function t(o,i){if(!Ua(o,i))throw new tv("TemplateLiteralParser: Index must point to open parens");let s=0;for(let a=i;a<o.length;a++)if(Ua(o,a)&&(s+=1),xy(o,a)&&(s-=1),s===0)return[i,a];throw new tv("TemplateLiteralParser: Unclosed group parens in expression")}function r(o,i){for(let s=i;s<o.length;s++)if(Ua(o,s))return[i,s];return[i,o.length]}let n=[];for(let o=0;o<e.length;o++)if(Ua(e,o)){let[i,s]=t(e,o),a=e.slice(i,s+1);n.push(nf(a)),o=s}else{let[i,s]=r(e,o),a=e.slice(i,s);a.length>0&&n.push(nf(a)),o=s-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}function nf(e){return Ane(e)?nf(kne(e)):Dne(e)?Lne(e):Fne(e)?Rne(e):{type:"const",const:_ne(e)}}function of(e){return nf(e.slice(1,e.length-1))}var fP=class extends Ae{};function Nne(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 Bne(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 $ne(e){return e.type==="const"&&e.const===".*"}function Au(e){return Nne(e)||$ne(e)?!1:Bne(e)?!0:e.type==="and"?e.expr.every(t=>Au(t)):e.type==="or"?e.expr.every(t=>Au(t)):e.type==="const"?!0:(()=>{throw new fP("Unknown expression type")})()}function rv(e){let t=of(e.pattern);return Au(t)}p();var mP=class extends Ae{};function*aL(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let r of aL(e.slice(1)))yield"".concat(t).concat(r)}function*jne(e){return yield*aL(e.expr.map(t=>[...Iy(t)]))}function*Gne(e){for(let t of e.expr)yield*Iy(t)}function*Une(e){return yield e.const}function*Iy(e){return e.type==="and"?yield*jne(e):e.type==="or"?yield*Gne(e):e.type==="const"?yield*Une(e):(()=>{throw new mP("Unknown expression")})()}function sf(e){let t=of(e.pattern);return Au(t)?[...Iy(t)]:[]}p();p();function _t(e,t){return J({[W]:"Literal",const:e,type:typeof e},t)}p();function nv(e){return J({[W]:"Boolean",type:"boolean"},e)}p();function af(e){return J({[W]:"BigInt",type:"bigint"},e)}p();function As(e){return J({[W]:"Number",type:"number"},e)}p();function Ko(e){return J({[W]:"String",type:"string"},e)}function*Vne(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield nv():t==="number"?yield As():t==="bigint"?yield af():t==="string"?yield Ko():yield(()=>{let r=t.split("|").map(n=>_t(n.trim()));return r.length===0?Rt():r.length===1?r[0]:_s(r)})()}function*zne(e){if(e[1]!=="{"){let t=_t("$"),r=hP(e.slice(1));return yield*[t,...r]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=Vne(e.slice(2,t)),n=hP(e.slice(t+1));return yield*[...r,...n]}yield _t(e)}function*hP(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=_t(e.slice(0,t)),n=zne(e.slice(t));return yield*[r,...n]}yield _t(e)}function lL(e){return[...hP(e)]}p();var yP=class extends Ae{};function Hne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cL(e,t){return Mo(e)?e.pattern.slice(1,e.pattern.length-1):Ot(e)?"(".concat(e.anyOf.map(r=>cL(r,t)).join("|"),")"):Eu(e)?"".concat(t).concat(by):Ou(e)?"".concat(t).concat(by):eP(e)?"".concat(t).concat(by):hy(e)?"".concat(t).concat(pP):$a(e)?"".concat(t).concat(Hne(e.const.toString())):tP(e)?"".concat(t).concat(uP):(()=>{throw new yP("Unexpected Kind '".concat(e[W],"'"))})()}function gP(e){return"^".concat(e.map(t=>cL(t,"")).join(""),"$")}p();function ku(e){let r=sf(e).map(n=>_t(n));return _s(r)}p();function ov(e,t){let r=Xt(e)?gP(lL(e)):gP(e);return J({[W]:"TemplateLiteral",type:"string",pattern:r},t)}function Wne(e){return sf(e).map(r=>r.toString())}function qne(e){let t=[];for(let r of e)t.push(...po(r));return t}function Zne(e){return[e.toString()]}function po(e){return[...new Set(Mo(e)?Wne(e):Ot(e)?qne(e.anyOf):$a(e)?Zne(e.const):Eu(e)?["[number]"]:Ou(e)?["[number]"]:[])]}p();function Xne(e,t,r){let n={};for(let o of Object.getOwnPropertyNames(t))n[o]=lf(e,po(t[o]),r);return n}function Yne(e,t,r){return Xne(e,t.properties,r)}function uL(e,t,r){let n=Yne(e,t,r);return bt(n)}function dL(e,t){return e.map(r=>fL(r,t))}function Kne(e){return e.filter(t=>!rc(t))}function Jne(e,t){return iv(Kne(dL(e,t)))}function Qne(e){return e.some(t=>rc(t))?[]:e}function eoe(e,t){return _s(Qne(dL(e,t)))}function toe(e,t){return t in e?e[t]:t==="[number]"?_s(e):Rt()}function roe(e,t){return t==="[number]"?e:Rt()}function noe(e,t){return t in e?e[t]:Rt()}function fL(e,t){var r;return Or(e)?Jne(e.allOf,t):Ot(e)?eoe(e.anyOf,t):Li(e)?toe((r=e.items)!=null?r:[],t):Ba(e)?roe(e.items,t):$r(e)?noe(e.properties,t):Rt()}function Sy(e,t){return t.map(r=>fL(e,r))}function pL(e,t){return _s(Sy(e,t))}function lf(e,t,r){return or(t)?uL(e,t,r):wo(t)?mL(e,t,r):J(Ri(t)?pL(e,po(t)):pL(e,t),r)}function ooe(e,t,r){return{[t]:lf(e,[t],rr(r))}}function ioe(e,t,r){return t.reduce((n,o)=>({...n,...ooe(e,o,r)}),{})}function soe(e,t,r){return ioe(e,t.keys,r)}function mL(e,t,r){let n=soe(e,t,r);return bt(n)}p();function sv(e,t){return J({[W]:"Iterator",type:"Iterator",items:e},t)}p();function aoe(e){let t=[];for(let r in e)Es(e[r])||t.push(r);return t}function loe(e,t){let r=aoe(e),n=r.length>0?{[W]:"Object",type:"object",properties:e,required:r}:{[W]:"Object",type:"object",properties:e};return J(n,t)}var Vt=loe;p();function av(e,t){return J({[W]:"Promise",type:"Promise",item:e},t)}p();p();function coe(e){return J(Cr(e,[Na]))}function uoe(e){return J({...e,[Na]:"Readonly"})}function poe(e,t){return t===!1?coe(e):uoe(e)}function Jo(e,t){let r=t!=null?t:!0;return or(e)?hL(e,r):poe(e,r)}function doe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Jo(e[n],t);return r}function foe(e,t){return doe(e.properties,t)}function hL(e,t){let r=foe(e,t);return bt(r)}p();function ks(e,t){return J(e.length>0?{[W]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[W]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function yL(e,t){return e in t?Qo(e,t[e]):bt(t)}function moe(e){return{[e]:_t(e)}}function hoe(e){let t={};for(let r of e)t[r]=_t(r);return t}function yoe(e,t){return tL(t,e)?moe(e):hoe(t)}function goe(e,t){let r=yoe(e,t);return yL(e,r)}function Cy(e,t){return t.map(r=>Qo(e,r))}function boe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Qo(e,t[n]);return r}function Qo(e,t){var n;let r={...t};return Es(t)?uo(Qo(e,Cr(t,[zn]))):hF(t)?Jo(Qo(e,Cr(t,[Na]))):or(t)?yL(e,t.properties):wo(t)?goe(e,t.keys):dy(t)?ev(Cy(e,t.parameters),Qo(e,t.returns),r):fy(t)?ic(Cy(e,t.parameters),Qo(e,t.returns),r):py(t)?Q0(Qo(e,t.items),r):my(t)?sv(Qo(e,t.items),r):Or(t)?fo(Cy(e,t.allOf),r):Ot(t)?Nt(Cy(e,t.anyOf),r):Li(t)?ks(Cy(e,(n=t.items)!=null?n:[]),r):$r(t)?Vt(boe(e,t.properties),r):Ba(t)?J0(Qo(e,t.items),r):_u(t)?av(Qo(e,t.item),r):t}function voe(e,t){let r={};for(let n of e)r[n]=Qo(n,t);return r}function gL(e,t,r){let n=Ri(e)?po(e):e,o=t({[W]:"MappedKey",keys:n}),i=voe(n,o);return Vt(i,r)}p();function xoe(e){return J(Cr(e,[zn]))}function Ioe(e){return J({...e,[zn]:"Optional"})}function Soe(e,t){return t===!1?xoe(e):Ioe(e)}function uo(e,t){let r=t!=null?t:!0;return or(e)?bL(e,r):Soe(e,r)}function Coe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=uo(e[n],t);return r}function Poe(e,t){return Coe(e.properties,t)}function bL(e,t){let r=Poe(e,t);return bt(r)}p();function Py(e,t={}){let r=e.every(o=>$r(o)),n=Ri(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return J(t.unevaluatedProperties===!1||Ri(t.unevaluatedProperties)||r?{...n,[W]:"Intersect",type:"object",allOf:e}:{...n,[W]:"Intersect",allOf:e},t)}function Toe(e){return e.every(t=>Es(t))}function woe(e){return Cr(e,[zn])}function vL(e){return e.map(t=>Es(t)?woe(t):t)}function Moe(e,t){return Toe(e)?uo(Py(vL(e),t)):Py(vL(e),t)}function iv(e,t={}){if(e.length===0)return Rt(t);if(e.length===1)return J(e[0],t);if(e.some(r=>Qd(r)))throw new Error("Cannot intersect transform types");return Moe(e,t)}p();function fo(e,t){if(e.length===0)return Rt(t);if(e.length===1)return J(e[0],t);if(e.some(r=>Qd(r)))throw new Error("Cannot intersect transform types");return Py(e,t)}function xL(e){return e.map(t=>bP(t))}function Ooe(e){return fo(xL(e))}function Eoe(e){return Nt(xL(e))}function _oe(e){return bP(e)}function bP(e){return Or(e)?Ooe(e.allOf):Ot(e)?Eoe(e.anyOf):_u(e)?_oe(e.item):e}function IL(e,t){return J(bP(e),t)}p();p();p();p();function SL(e){let t=[];for(let r of e)t.push(Yr(r));return t}function Aoe(e){let t=SL(e);return oL(t)}function koe(e){let t=SL(e);return nL(t)}function Doe(e){return e.map((t,r)=>r.toString())}function Foe(e){return["[number]"]}function Loe(e){return globalThis.Object.getOwnPropertyNames(e)}function Roe(e){return vP?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}function Yr(e){var t;return Or(e)?Aoe(e.allOf):Ot(e)?koe(e.anyOf):Li(e)?Doe((t=e.items)!=null?t:[]):Ba(e)?Foe(e.items):$r(e)?Loe(e.properties):rP(e)?Roe(e.patternProperties):[]}var vP=!1;function Va(e){vP=!0;let t=Yr(e);vP=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}function Noe(e){return e.map(t=>t==="[number]"?As():_t(t))}function lv(e,t){if(or(e))return CL(e,t);{let r=Yr(e),n=Noe(r),o=_s(n);return J(o,t)}}function Boe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=lv(e[n],rr(t));return r}function $oe(e,t){return Boe(e.properties,t)}function CL(e,t){let r=$oe(e,t);return bt(r)}p();function sc(e){let t=Yr(e),r=Sy(e,t);return t.map((n,o)=>[t[o],r[o]])}function joe(e){let t=[];for(let r of e)t.push(...Yr(r));return rL(t)}function Goe(e){return e.filter(t=>!rc(t))}function Uoe(e,t){let r=[];for(let n of e)r.push(...Sy(n,[t]));return Goe(r)}function Voe(e,t){let r={};for(let n of t)r[n]=iv(Uoe(e,n));return r}function PL(e,t){let r=joe(e),n=Voe(e,r);return Vt(n,t)}p();p();function cv(e){return J({[W]:"Date",type:"Date"},e)}p();function uv(e){return J({[W]:"Null",type:"null"},e)}p();function pv(e){return J({[W]:"Symbol",type:"symbol"},e)}p();function dv(e){return J({[W]:"Undefined",type:"undefined"},e)}p();function fv(e){return J({[W]:"Uint8Array",type:"Uint8Array"},e)}p();function za(e){return J({[W]:"Unknown"},e)}function zoe(e){return e.map(t=>xP(t,!1))}function Hoe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Jo(xP(e[r],!1));return t}function mv(e,t){return t===!0?e:Jo(e)}function xP(e,t){return qC(e)?mv(oc(),t):XC(e)?mv(oc(),t):Tn(e)?Jo(ks(zoe(e))):Fa(e)?fv():Mu(e)?cv():Ut(e)?mv(Vt(Hoe(e)),t):ZC(e)?mv(ic([],za()),t):yr(e)?dv():YC(e)?uv():KC(e)?pv():ay(e)?af():Fi(e)?_t(e):ec(e)?_t(e):Xt(e)?_t(e):Vt({})}function TL(e,t){return J(xP(e,!0),t)}p();function wL(e,t){return ks(e.parameters,t)}p();function Ty(e,t){return e.map(r=>Ni(r,t))}function Woe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Ni(e[n],t);return r}function qoe(e,t){return e.parameters=Ty(e.parameters,t),e.returns=Ni(e.returns,t),e}function Zoe(e,t){return e.parameters=Ty(e.parameters,t),e.returns=Ni(e.returns,t),e}function Xoe(e,t){return e.allOf=Ty(e.allOf,t),e}function Yoe(e,t){return e.anyOf=Ty(e.anyOf,t),e}function Koe(e,t){return yr(e.items)||(e.items=Ty(e.items,t)),e}function Joe(e,t){return e.items=Ni(e.items,t),e}function Qoe(e,t){return e.properties=Woe(e.properties,t),e}function eie(e,t){return e.item=Ni(e.item,t),e}function tie(e,t){return e.items=Ni(e.items,t),e}function rie(e,t){return e.items=Ni(e.items,t),e}function nie(e,t){let r=t.find(o=>o.$id===e.$ref);if(r===void 0)throw Error("Unable to dereference schema with $id ".concat(e.$ref));let n=Cr(r,["$id"]);return Ni(n,t)}function oie(e,t){return dy(e)?qoe(e,t):fy(e)?Zoe(e,t):Or(e)?Xoe(e,t):Ot(e)?Yoe(e,t):Li(e)?Koe(e,t):Ba(e)?Joe(e,t):$r(e)?Qoe(e,t):_u(e)?eie(e,t):py(e)?tie(e,t):my(e)?rie(e,t):nP(e)?nie(e,t):e}function Ni(e,t){return oie(cy(e),dF(t))}p();function ML(e,t){if(yr(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(i=>isNaN(i)).map(i=>e[i]),o=[...new Set(r)].map(i=>_t(i));return Nt(o,{...t,[Yo]:"Enum"})}p();p();p();var SP=class extends Ae{},X;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(X||(X={}));function ei(e){return e===X.False?e:X.True}function cf(e){throw new SP(e)}function Dr(e){return R.IsNever(e)||R.IsIntersect(e)||R.IsUnion(e)||R.IsUnknown(e)||R.IsAny(e)}function Fr(e,t){return R.IsNever(t)?FL(e,t):R.IsIntersect(t)?hv(e,t):R.IsUnion(t)?wP(e,t):R.IsUnknown(t)?BL(e,t):R.IsAny(t)?TP(e,t):cf("StructuralRight")}function TP(e,t){return X.True}function iie(e,t){return R.IsIntersect(t)?hv(e,t):R.IsUnion(t)&&t.anyOf.some(r=>R.IsAny(r)||R.IsUnknown(r))?X.True:R.IsUnion(t)?X.Union:R.IsUnknown(t)||R.IsAny(t)?X.True:X.Union}function sie(e,t){return R.IsUnknown(e)?X.False:R.IsAny(e)?X.Union:R.IsNever(e)?X.True:X.False}function aie(e,t){return R.IsObject(t)&&yv(t)?X.True:Dr(t)?Fr(e,t):R.IsArray(t)?ei(Bt(e.items,t.items)):X.False}function lie(e,t){return Dr(t)?Fr(e,t):R.IsAsyncIterator(t)?ei(Bt(e.items,t.items)):X.False}function cie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):R.IsBigInt(t)?X.True:X.False}function kL(e,t){return R.IsLiteralBoolean(e)||R.IsBoolean(e)?X.True:X.False}function uie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):R.IsBoolean(t)?X.True:X.False}function pie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsConstructor(t)?e.parameters.length>t.parameters.length?X.False:e.parameters.every((r,n)=>ei(Bt(t.parameters[n],r))===X.True)?ei(Bt(e.returns,t.returns)):X.False:X.False}function die(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):R.IsDate(t)?X.True:X.False}function fie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsFunction(t)?e.parameters.length>t.parameters.length?X.False:e.parameters.every((r,n)=>ei(Bt(t.parameters[n],r))===X.True)?ei(Bt(e.returns,t.returns)):X.False:X.False}function DL(e,t){return R.IsLiteral(e)&&ct.IsNumber(e.const)||R.IsNumber(e)||R.IsInteger(e)?X.True:X.False}function mie(e,t){return R.IsInteger(t)||R.IsNumber(t)?X.True:Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):X.False}function hv(e,t){return t.allOf.every(r=>Bt(e,r)===X.True)?X.True:X.False}function hie(e,t){return e.allOf.some(r=>Bt(r,t)===X.True)?X.True:X.False}function yie(e,t){return Dr(t)?Fr(e,t):R.IsIterator(t)?ei(Bt(e.items,t.items)):X.False}function gie(e,t){return R.IsLiteral(t)&&t.const===e.const?X.True:Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):R.IsString(t)?NL(e,t):R.IsNumber(t)?LL(e,t):R.IsInteger(t)?DL(e,t):R.IsBoolean(t)?kL(e,t):X.False}function FL(e,t){return X.False}function bie(e,t){return X.True}function OL(e){let[t,r]=[e,0];for(;R.IsNot(t);)t=t.not,r+=1;return r%2===0?t:za()}function vie(e,t){return R.IsNot(e)?Bt(OL(e),t):R.IsNot(t)?Bt(e,OL(t)):cf("Invalid fallthrough for Not")}function xie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):R.IsNull(t)?X.True:X.False}function LL(e,t){return R.IsLiteralNumber(e)||R.IsNumber(e)||R.IsInteger(e)?X.True:X.False}function Iie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):R.IsInteger(t)||R.IsNumber(t)?X.True:X.False}function mo(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function EL(e){return yv(e)}function _L(e){return mo(e,0)||mo(e,1)&&"description"in e.properties&&R.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(R.IsString(e.properties.description.anyOf[0])&&R.IsUndefined(e.properties.description.anyOf[1])||R.IsString(e.properties.description.anyOf[1])&&R.IsUndefined(e.properties.description.anyOf[0]))}function IP(e){return mo(e,0)}function AL(e){return mo(e,0)}function Sie(e){return mo(e,0)}function Cie(e){return mo(e,0)}function Pie(e){return yv(e)}function Tie(e){let t=As();return mo(e,0)||mo(e,1)&&"length"in e.properties&&ei(Bt(e.properties.length,t))===X.True}function wie(e){return mo(e,0)}function yv(e){let t=As();return mo(e,0)||mo(e,1)&&"length"in e.properties&&ei(Bt(e.properties.length,t))===X.True}function Mie(e){let t=ic([oc()],oc());return mo(e,0)||mo(e,1)&&"then"in e.properties&&ei(Bt(e.properties.then,t))===X.True}function RL(e,t){return Bt(e,t)===X.False||R.IsOptional(e)&&!R.IsOptional(t)?X.False:X.True}function wn(e,t){return R.IsUnknown(e)?X.False:R.IsAny(e)?X.Union:R.IsNever(e)||R.IsLiteralString(e)&&EL(t)||R.IsLiteralNumber(e)&&IP(t)||R.IsLiteralBoolean(e)&&AL(t)||R.IsSymbol(e)&&_L(t)||R.IsBigInt(e)&&Sie(t)||R.IsString(e)&&EL(t)||R.IsSymbol(e)&&_L(t)||R.IsNumber(e)&&IP(t)||R.IsInteger(e)&&IP(t)||R.IsBoolean(e)&&AL(t)||R.IsUint8Array(e)&&Pie(t)||R.IsDate(e)&&Cie(t)||R.IsConstructor(e)&&wie(t)||R.IsFunction(e)&&Tie(t)?X.True:R.IsRecord(e)&&R.IsString(CP(e))?t[Yo]==="Record"?X.True:X.False:R.IsRecord(e)&&R.IsNumber(CP(e))?mo(t,0)?X.True:X.False:X.False}function Oie(e,t){return Dr(t)?Fr(e,t):R.IsRecord(t)?ti(e,t):R.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!R.IsOptional(t.properties[r]))return X.False;if(R.IsOptional(t.properties[r]))return X.True;if(RL(e.properties[r],t.properties[r])===X.False)return X.False}return X.True})():X.False}function Eie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)&&Mie(t)?X.True:R.IsPromise(t)?ei(Bt(e.item,t.item)):X.False}function CP(e){return ja in e.patternProperties?As():Ga in e.patternProperties?Ko():cf("Unknown record key pattern")}function PP(e){return ja in e.patternProperties?e.patternProperties[ja]:Ga in e.patternProperties?e.patternProperties[Ga]:cf("Unable to get record value schema")}function ti(e,t){let[r,n]=[CP(t),PP(t)];return R.IsLiteralString(e)&&R.IsNumber(r)&&ei(Bt(e,n))===X.True?X.True:R.IsUint8Array(e)&&R.IsNumber(r)||R.IsString(e)&&R.IsNumber(r)||R.IsArray(e)&&R.IsNumber(r)?Bt(e,n):R.IsObject(e)?(()=>{for(let o of Object.getOwnPropertyNames(e.properties))if(RL(n,e.properties[o])===X.False)return X.False;return X.True})():X.False}function _ie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?Bt(PP(e),PP(t)):X.False}function Aie(e,t){let r=R.IsRegExp(e)?Ko():e,n=R.IsRegExp(t)?Ko():t;return Bt(r,n)}function NL(e,t){return R.IsLiteral(e)&&ct.IsString(e.const)||R.IsString(e)?X.True:X.False}function kie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):R.IsString(t)?X.True:X.False}function Die(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):R.IsSymbol(t)?X.True:X.False}function Fie(e,t){return R.IsTemplateLiteral(e)?Bt(ku(e),t):R.IsTemplateLiteral(t)?Bt(e,ku(t)):cf("Invalid fallthrough for TemplateLiteral")}function Lie(e,t){return R.IsArray(t)&&e.items!==void 0&&e.items.every(r=>Bt(r,t.items)===X.True)}function Rie(e,t){return R.IsNever(e)?X.True:R.IsUnknown(e)?X.False:R.IsAny(e)?X.Union:X.False}function Nie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)&&yv(t)||R.IsArray(t)&&Lie(e,t)?X.True:R.IsTuple(t)?ct.IsUndefined(e.items)&&!ct.IsUndefined(t.items)||!ct.IsUndefined(e.items)&&ct.IsUndefined(t.items)?X.False:ct.IsUndefined(e.items)&&!ct.IsUndefined(t.items)||e.items.every((r,n)=>Bt(r,t.items[n])===X.True)?X.True:X.False:X.False}function Bie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):R.IsUint8Array(t)?X.True:X.False}function $ie(e,t){return Dr(t)?Fr(e,t):R.IsObject(t)?wn(e,t):R.IsRecord(t)?ti(e,t):R.IsVoid(t)?Uie(e,t):R.IsUndefined(t)?X.True:X.False}function wP(e,t){return t.anyOf.some(r=>Bt(e,r)===X.True)?X.True:X.False}function jie(e,t){return e.anyOf.every(r=>Bt(r,t)===X.True)?X.True:X.False}function BL(e,t){return X.True}function Gie(e,t){return R.IsNever(t)?FL(e,t):R.IsIntersect(t)?hv(e,t):R.IsUnion(t)?wP(e,t):R.IsAny(t)?TP(e,t):R.IsString(t)?NL(e,t):R.IsNumber(t)?LL(e,t):R.IsInteger(t)?DL(e,t):R.IsBoolean(t)?kL(e,t):R.IsArray(t)?sie(e,t):R.IsTuple(t)?Rie(e,t):R.IsObject(t)?wn(e,t):R.IsUnknown(t)?X.True:X.False}function Uie(e,t){return R.IsUndefined(e)||R.IsUndefined(e)?X.True:X.False}function Vie(e,t){return R.IsIntersect(t)?hv(e,t):R.IsUnion(t)?wP(e,t):R.IsUnknown(t)?BL(e,t):R.IsAny(t)?TP(e,t):R.IsObject(t)?wn(e,t):R.IsVoid(t)?X.True:X.False}function Bt(e,t){return R.IsTemplateLiteral(e)||R.IsTemplateLiteral(t)?Fie(e,t):R.IsRegExp(e)||R.IsRegExp(t)?Aie(e,t):R.IsNot(e)||R.IsNot(t)?vie(e,t):R.IsAny(e)?iie(e,t):R.IsArray(e)?aie(e,t):R.IsBigInt(e)?cie(e,t):R.IsBoolean(e)?uie(e,t):R.IsAsyncIterator(e)?lie(e,t):R.IsConstructor(e)?pie(e,t):R.IsDate(e)?die(e,t):R.IsFunction(e)?fie(e,t):R.IsInteger(e)?mie(e,t):R.IsIntersect(e)?hie(e,t):R.IsIterator(e)?yie(e,t):R.IsLiteral(e)?gie(e,t):R.IsNever(e)?bie(e,t):R.IsNull(e)?xie(e,t):R.IsNumber(e)?Iie(e,t):R.IsObject(e)?Oie(e,t):R.IsRecord(e)?_ie(e,t):R.IsString(e)?kie(e,t):R.IsSymbol(e)?Die(e,t):R.IsTuple(e)?Nie(e,t):R.IsPromise(e)?Eie(e,t):R.IsUint8Array(e)?Bie(e,t):R.IsUndefined(e)?$ie(e,t):R.IsUnion(e)?jie(e,t):R.IsUnknown(e)?Gie(e,t):R.IsVoid(e)?Vie(e,t):cf("Unknown left type operand '".concat(e[W],"'"))}function ac(e,t){return Bt(e,t)}p();p();p();function zie(e,t,r,n,o){let i={};for(let s of globalThis.Object.getOwnPropertyNames(e))i[s]=uf(e[s],t,r,n,rr(o));return i}function Hie(e,t,r,n,o){return zie(e.properties,t,r,n,o)}function $L(e,t,r,n,o){let i=Hie(e,t,r,n,o);return bt(i)}function Wie(e,t,r,n){let o=ac(e,t);return o===X.Union?Nt([r,n]):o===X.True?r:n}function uf(e,t,r,n,o){return or(e)?$L(e,t,r,n,o):wo(e)?J(jL(e,t,r,n,o)):J(Wie(e,t,r,n),o)}function qie(e,t,r,n,o){return{[e]:uf(_t(e),t,r,n,rr(o))}}function Zie(e,t,r,n,o){return e.reduce((i,s)=>({...i,...qie(s,t,r,n,o)}),{})}function Xie(e,t,r,n,o){return Zie(e.keys,t,r,n,o)}function jL(e,t,r,n,o){let i=Xie(e,t,r,n,o);return bt(i)}p();function Yie(e){return e.allOf.every(t=>Ha(t))}function Kie(e){return e.anyOf.some(t=>Ha(t))}function Jie(e){return!Ha(e.not)}function Ha(e){return e[W]==="Intersect"?Yie(e):e[W]==="Union"?Kie(e):e[W]==="Not"?Jie(e):e[W]==="Undefined"}p();function GL(e,t){return pf(ku(e),t)}function Qie(e,t){let r=e.filter(n=>ac(n,t)===X.False);return r.length===1?r[0]:Nt(r)}function pf(e,t,r={}){return Mo(e)?J(GL(e,t),r):or(e)?J(UL(e,t),r):J(Ot(e)?Qie(e.anyOf,t):ac(e,t)!==X.False?Rt():e,r)}function ese(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=pf(e[n],t);return r}function tse(e,t){return ese(e.properties,t)}function UL(e,t){let r=tse(e,t);return bt(r)}p();p();p();function VL(e,t){return df(ku(e),t)}function rse(e,t){let r=e.filter(n=>ac(n,t)!==X.False);return r.length===1?r[0]:Nt(r)}function df(e,t,r){return Mo(e)?J(VL(e,t),r):or(e)?J(zL(e,t),r):J(Ot(e)?rse(e.anyOf,t):ac(e,t)!==X.False?e:Rt(),r)}function nse(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=df(e[n],t);return r}function ose(e,t){return nse(e.properties,t)}function zL(e,t){let r=ose(e,t);return bt(r)}p();function HL(e,t){return J(e.returns,t)}p();function WL(e){return J({[W]:"Integer",type:"integer"},e)}p();p();p();function ise(e,t,r){return{[e]:Bi(_t(e),t,rr(r))}}function sse(e,t,r){return e.reduce((o,i)=>({...o,...ise(i,t,r)}),{})}function ase(e,t,r){return sse(e.keys,t,r)}function qL(e,t,r){let n=ase(e,t,r);return bt(n)}function lse(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}function cse(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}function use(e){return e.toUpperCase()}function pse(e){return e.toLowerCase()}function dse(e,t,r){let n=of(e.pattern);if(!Au(n))return{...e,pattern:ZL(e.pattern,t)};let s=[...Iy(n)].map(u=>_t(u)),a=XL(s,t),l=Nt(a);return ov([l],r)}function ZL(e,t){return typeof e=="string"?t==="Uncapitalize"?lse(e):t==="Capitalize"?cse(e):t==="Uppercase"?use(e):t==="Lowercase"?pse(e):e:e.toString()}function XL(e,t){return e.map(r=>Bi(r,t))}function Bi(e,t,r={}){return wo(e)?qL(e,t,r):Mo(e)?dse(e,t,r):Ot(e)?Nt(XL(e.anyOf,t),r):$a(e)?_t(ZL(e.const,t),r):J(e,r)}function YL(e,t={}){return Bi(e,"Capitalize",t)}p();function KL(e,t={}){return Bi(e,"Lowercase",t)}p();function JL(e,t={}){return Bi(e,"Uncapitalize",t)}p();function QL(e,t={}){return Bi(e,"Uppercase",t)}p();function eR(e,t){return J({[W]:"Not",not:e},t)}p();p();p();function fse(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=ff(e[o],t,rr(r));return n}function mse(e,t,r){return fse(e.properties,t,r)}function tR(e,t,r){let n=mse(e,t,r);return bt(n)}function hse(e,t){return e.map(r=>MP(r,t))}function yse(e,t){return e.map(r=>MP(r,t))}function gse(e,t){let{[t]:r,...n}=e;return n}function bse(e,t){return t.reduce((r,n)=>gse(r,n),e)}function vse(e,t){let r=Cr(e,[nr,"$id","required","properties"]),n=bse(e.properties,t);return Vt(n,r)}function MP(e,t){return Or(e)?fo(hse(e.allOf,t)):Ot(e)?Nt(yse(e.anyOf,t)):$r(e)?vse(e,t):Vt({})}function ff(e,t,r){if(wo(t))return rR(e,t,r);if(or(e))return tR(e,t,r);let n=Ri(t)?po(t):t;return J({...MP(e,n),...r})}function xse(e,t,r){return{[t]:ff(e,[t],rr(r))}}function Ise(e,t,r){return t.reduce((n,o)=>({...n,...xse(e,o,r)}),{})}function Sse(e,t,r){return Ise(e,t.keys,r)}function rR(e,t,r){let n=Sse(e,t,r);return bt(n)}p();function nR(e,t){return ks(e.parameters,t)}p();p();function oR(e){return e.map(t=>iR(t))}function Cse(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=uo(e[r]);return t}function Pse(e){let t=Cr(e,[nr,"$id","required","properties"]),r=Cse(e.properties);return Vt(r,t)}function iR(e){return Or(e)?fo(oR(e.allOf)):Ot(e)?Nt(oR(e.anyOf)):$r(e)?Pse(e):Vt({})}function gv(e,t){return or(e)?sR(e,t):J({...iR(e),...t})}function Tse(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=gv(e[n],rr(t));return r}function wse(e,t){return Tse(e.properties,t)}function sR(e,t){let r=wse(e,t);return bt(r)}p();p();p();function Mse(e,t,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=mf(e[o],t,rr(r));return n}function Ose(e,t,r){return Mse(e.properties,t,r)}function aR(e,t,r){let n=Ose(e,t,r);return bt(n)}function Ese(e,t){return e.map(r=>OP(r,t))}function _se(e,t){return e.map(r=>OP(r,t))}function Ase(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}function kse(e,t){let r=Cr(e,[nr,"$id","required","properties"]),n=Ase(e.properties,t);return Vt(n,r)}function OP(e,t){return Or(e)?fo(Ese(e.allOf,t)):Ot(e)?Nt(_se(e.anyOf,t)):$r(e)?kse(e,t):Vt({})}function mf(e,t,r){if(wo(t))return lR(e,t,r);if(or(e))return aR(e,t,r);let n=Ri(t)?po(t):t;return J({...OP(e,n),...r})}function Dse(e,t,r){return{[t]:mf(e,[t],rr(r))}}function Fse(e,t,r){return t.reduce((n,o)=>({...n,...Dse(e,o,r)}),{})}function Lse(e,t,r){return Fse(e,t.keys,r)}function lR(e,t,r){let n=Lse(e,t,r);return bt(n)}p();function cR(e){return Jo(uo(e))}p();function Du(e,t,r){return J({[W]:"Record",type:"object",patternProperties:{[e]:t}},r)}function EP(e,t,r){let n={};for(let o of e)n[o]=t;return Vt(n,{...r,[Yo]:"Record"})}function Rse(e,t,r){return rv(e)?EP(po(e),t,r):Du(e.pattern,t,r)}function Nse(e,t,r){return EP(po(Nt(e)),t,r)}function Bse(e,t,r){return EP([e.toString()],t,r)}function $se(e,t,r){return Du(e.source,t,r)}function jse(e,t,r){let n=yr(e.pattern)?Ga:e.pattern;return Du(n,t,r)}function Gse(e,t,r){return Du(Ga,t,r)}function Use(e,t,r){return Du(eL,t,r)}function Vse(e,t,r){return Du(ja,t,r)}function zse(e,t,r){return Du(ja,t,r)}function uR(e,t,r={}){return Ot(e)?Nse(e.anyOf,t,r):Mo(e)?Rse(e,t,r):$a(e)?Bse(e.const,t,r):Ou(e)?Vse(e,t,r):Eu(e)?zse(e,t,r):oP(e)?$se(e,t,r):hy(e)?jse(e,t,r):QC(e)?Gse(e,t,r):rc(e)?Use(e,t,r):Rt(r)}p();var Hse=0;function pR(e,t={}){yr(t.$id)&&(t.$id="T".concat(Hse++));let r=cy(e({[W]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,J({[Yo]:"Recursive",...r},t)}p();function dR(e,t){if(Xt(e))return J({[W]:"Ref",$ref:e},t);if(yr(e.$id))throw new Error("Reference target type must specify an $id");return J({[W]:"Ref",$ref:e.$id},t)}p();function fR(e,t){let r=Xt(e)?new globalThis.RegExp(e):e;return J({[W]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}p();p();function mR(e){return e.map(t=>hR(t))}function Wse(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Cr(e[r],[zn]);return t}function qse(e){let t=Cr(e,[nr,"$id","required","properties"]),r=Wse(e.properties);return Vt(r,t)}function hR(e){return Or(e)?fo(mR(e.allOf)):Ot(e)?Nt(mR(e.anyOf)):$r(e)?qse(e):Vt({})}function bv(e,t){return or(e)?yR(e,t):J({...hR(e),...t})}function Zse(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=bv(e[n],t);return r}function Xse(e,t){return Zse(e.properties,t)}function yR(e,t){let r=Xse(e,t);return bt(r)}p();function Yse(e){var t;return Or(e)?e.allOf:Ot(e)?e.anyOf:Li(e)?(t=e.items)!=null?t:[]:[]}function gR(e){return Yse(e)}p();function bR(e,t){return J(e.returns,t)}p();function vR(e){return JSON.parse(JSON.stringify(e))}p();var _P=class{constructor(t){this.schema=t}Decode(t){return new AP(this.schema,t)}},AP=class{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let i={Encode:s=>r[nr].Encode(t(s)),Decode:s=>this.decode(r[nr].Decode(s))};return{...r,[nr]:i}}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return{...r,[nr]:n}}Encode(t){return Qd(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};function xR(e){return new _P(e)}p();function vv(e={}){var t;return J({[W]:(t=e[W])!=null?t:"Unsafe"},e)}p();function IR(e){return J({[W]:"Void",type:"void"},e)}p();var kP={};Ul(kP,{Any:()=>oc,Array:()=>J0,AsyncIterator:()=>Q0,Awaited:()=>IL,BigInt:()=>af,Boolean:()=>nv,Capitalize:()=>YL,Composite:()=>PL,Const:()=>TL,Constructor:()=>ev,ConstructorParameters:()=>wL,Date:()=>cv,Deref:()=>Ni,Enum:()=>ML,Exclude:()=>pf,Extends:()=>uf,Extract:()=>df,Function:()=>ic,Index:()=>lf,InstanceType:()=>HL,Integer:()=>WL,Intersect:()=>fo,Iterator:()=>sv,KeyOf:()=>lv,Literal:()=>_t,Lowercase:()=>KL,Mapped:()=>gL,Never:()=>Rt,Not:()=>eR,Null:()=>uv,Number:()=>As,Object:()=>Vt,Omit:()=>ff,Optional:()=>uo,Parameters:()=>nR,Partial:()=>gv,Pick:()=>mf,Promise:()=>av,Readonly:()=>Jo,ReadonlyOptional:()=>cR,Record:()=>uR,Recursive:()=>pR,Ref:()=>dR,RegExp:()=>fR,Required:()=>bv,Rest:()=>gR,ReturnType:()=>bR,Strict:()=>vR,String:()=>Ko,Symbol:()=>pv,TemplateLiteral:()=>ov,Transform:()=>xR,Tuple:()=>ks,Uint8Array:()=>fv,Uncapitalize:()=>JL,Undefined:()=>dv,Union:()=>Nt,Unknown:()=>za,Unsafe:()=>vv,Uppercase:()=>QL,Void:()=>IR});p();var S=kP;var ur=(e,t)=>S.Unsafe(S.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]{8,}$")})),Mn=ur("g","GeometryId"),vt=ur("f","FloorId"),DP=[Mn,vt];p();p();var wy=S.Object({externalId:S.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:S.String({description:"The name of the entity."}),shortName:S.String({description:"A short name for the entity."}),description:S.String({description:"A description of the entity."}),icon:S.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),FP=S.Partial(wy,{$id:"Details",description:"Additional information about a given entity."}),$i=S.Object({details:S.Optional(S.Ref(FP))},{$id:"WithDetails"}),Fu=e=>{let t=[...e].sort(),r=S.Pick(wy,e),n=S.Omit(wy,e);return S.Object({details:S.Intersect([r,S.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},LP=[wy,FP];p();p();var RP=S.Record(S.String(),S.Unknown(),{$id:"Extra"}),ji=S.Object({extra:S.Optional(S.Ref(RP))}),NP=[RP];p();p();var hf=S.Object({geometryId:S.Ref(Mn),floorId:S.Ref(vt)},{$id:"GeometryAnchor"}),Kse=S.Object({geometryAnchor:S.Ref(hf)}),Lu=(e,t)=>S.Object({geometryAnchors:S.Array(S.Ref(hf),e)},t),BP=[hf];p();p();p();p();p();var yf=S.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),gf=S.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),Ru=S.Tuple([S.Ref(yf),S.Ref(gf)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),On=S.Object({type:S.Literal("Point"),coordinates:S.Ref(Ru)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),xv=S.Object({type:S.Literal("MultiPoint"),coordinates:S.Array(S.Ref(Ru))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),Iv=S.Object({type:S.Literal("LineString"),coordinates:S.Array(S.Ref(Ru),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),Sv=S.Object({type:S.Literal("MultiLineString"),coordinates:S.Array(S.Array(S.Ref(Ru),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),SR=S.Array(S.Ref(Ru),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),$P=S.Array(S.Ref(SR),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),bf=S.Object({type:S.Literal("Polygon"),coordinates:S.Ref($P)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),vf=S.Object({type:S.Literal("MultiPolygon"),coordinates:S.Array(S.Ref($P))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),ln=(e,t,r)=>S.Object({type:S.Literal("Feature"),geometry:e,properties:t},r),Wn=(e,t,r)=>S.Object({type:S.Literal("FeatureCollection"),features:S.Array(e,r)},t),jP=[yf,gf,Ru,On,xv,Iv,Sv,SR,$P,bf,vf];var CR=S.Intersect([S.Object({id:S.Ref(vt),elevation:S.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:S.Optional(S.String({description:"The subtitle of the floor."}))}),$i],{$id:"FloorProperties"}),PR=ln(S.Union([S.Ref(bf),S.Ref(vf),S.Null()]),S.Ref(CR),{$id:"FloorFeature"}),TR=Wn(S.Ref(PR),{$id:"FloorCollection"}),Jse=S.Object({floors:S.Ref(TR)}),wR={name:"core:floors",intoBundle:function*(e){e.floors!=null&&(yield{path:"floors.geojson",contents:e.floors})},fromBundle:(e,t,r)=>{if(e==="floors.geojson")return{floors:r(t)}},schema:Jse,references:[CR,PR,TR]};p();p();p();var Cv=class{constructor(t){m(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}},Pv=class{constructor(t){m(this,"_tag","Some");m(this,"_value");this._value=t}get value(){return this._value}isSome(){return!0}isSomeAnd(t){return t(this.value)}isNone(){return!1}equals(t){return t.isSome()&&t.value===this.value}expect(t){return this.value}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectNone(t){return this}map(t){return MR(t(this.value))}mapAsync(t){return t(this.value).then(r=>MR(r))}mapOr(t,r){return this.map(t).unwrapOr(r)}mapOrAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOr(r))}mapOrElse(t,r){return this.map(t).unwrapOrElse(r)}mapOrElseAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOrElse(r))}and(t){return t}andThen(t){return t(this.value)}andThenAsync(t){return t(this.value)}filter(t){return t(this.value)?this:lc()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?lc():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return fe(this.value)}okOrElse(t){return fe(this.value)}iter(){return new Cv(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?xf([this.value,t.value]):lc()}zipWith(t,r){return t.isSome()?xf(r(this.value,t.value)):lc()}get[Symbol.toStringTag](){return"Some"}},Tv=class{constructor(){m(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(t){return!1}isNone(){return!0}equals(t){return t.isNone()}expect(t){throw new Error(t)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(t){return this}inspectNone(t){return t(),this}map(t){return this}mapAsync(t){return Promise.resolve(this)}mapOr(t,r){return r}mapOrAsync(t,r){return Promise.resolve(r)}mapOrElse(t,r){return r()}mapOrElseAsync(t,r){return r()}and(t){return this}andThen(t){return this}andThenAsync(t){return Promise.resolve(this)}filter(t){return this}or(t){return t}orElse(t){return t()}xor(t){return t}toString(){return"None"}okOr(t){return ge(t)}okOrElse(t){return ge(t())}iter(){return new Cv(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}get[Symbol.toStringTag](){return"None"}},xf=e=>new Pv(e),lc=()=>new Tv,MR=e=>e instanceof Pv||e instanceof Tv?e:e==null?lc():xf(e);var wv=class{constructor(t){m(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}},GP=class{constructor(t){m(this,"_tag","Ok");m(this,"_value");this._value=t}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(t){return t(this.value)}isErr(){return!1}isErrAnd(t){return!1}ok(){return xf(this.value)}err(){return lc()}expect(t){return this.value}expectErr(t){throw new Error(t)}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectErr(){return this}map(t){return fe(t(this.value))}async mapAsync(t){return t(this.value).then(fe)}mapOr(t,r){return t(this.value)}async mapOrAsync(t,r){return t(this.value)}mapOrElse(t,r){return t(this.value)}async mapOrElseAsync(t,r){return t(this.value)}mapErr(t){return this}iter(){return new wv(this.value)}[Symbol.iterator](){return this.iter()}and(t){return t}andThen(t){return t(this.value)}or(t){return this}orElse(t){return this}async andThenAsync(t){return t(this.value)}toString(){return"Ok(".concat(this.value,")")}get[Symbol.toStringTag](){return"Ok"}},UP=class e{constructor(t){m(this,"_tag","Err");m(this,"_error");this._error=t}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(t){return!1}isErr(){return!0}isErrAnd(t){return t(this.error)}ok(){return lc()}err(){return xf(this.error)}expect(t){throw new Error(t)}expectErr(t){return this.error}unwrap(){throw this.error}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(){return this}inspectErr(t){return t(this.error),this}map(t){return this}iter(){return new wv(null)}[Symbol.iterator](){return this.iter()}async mapAsync(t){return this}mapOr(t,r){return r}async mapOrAsync(t,r){return r}mapOrElse(t,r){return r()}async mapOrElseAsync(t,r){return r()}mapErr(t){return new e(t(this.error))}and(t){return this}andThen(t){return this}async andThenAsync(t){return this}or(t){return t}orElse(t){return t(this.error)}toString(){return"Err(".concat(this.error,")")}get[Symbol.toStringTag](){return"Err"}},fe=e=>new GP(e),ge=e=>new UP(e);p();var Ds;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError"})(Ds||(Ds={}));var Qse=e=>{var t,r;return new Map((r=(t=e.floors)==null?void 0:t.features.map(n=>[n.properties.id,n]))!=null?r:[])},Wa=e=>{let t=Qse(e);return n=>{let o=t.get(n);return o==null?ge({kind:Ds.UnknownFloorError,properties:{floorId:n}}):fe(o)}};p();p();p();p();var Pr=e=>S.Unsafe(e);p();var ft=e=>Object.keys(e);p();var OR=e=>{if(e.floors==null)return ge({kind:Ds.FloorMissingError,properties:null});if(e.geometry==null)return ge({kind:Ds.GeometryMissingError,properties:null});let t=Wa(e);for(let r of ft(e.geometry)){let n=t(r);if(n.isErr())return n}return fe(!0)};var ER=S.Intersect([S.Object({id:S.Ref(Mn)}),$i],{$id:"GeometryProperties"}),_R=ln(S.Union([S.Ref(On),S.Ref(xv),S.Ref(Iv),S.Ref(Sv),S.Ref(bf),S.Ref(vf)]),S.Ref(ER),{$id:"GeometryFeature"}),AR=Wn(S.Ref(_R),{$id:"GeometryCollection"}),eae=S.Object({geometry:Pr(S.Record(vt,S.Ref(AR),{additionalProperties:!1}))},{$id:"GeometrySchema"}),tae=/^geometry\/(.*)\.geojson$/,kR={name:"core:geometry",schema:eae,intoBundle:function*(e){if(e.geometry!=null)for(let t of ft(e.geometry))yield{path:"geometry/".concat(t,".geojson"),contents:e.geometry[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(tae))==null?void 0:o[1];if(n)return{geometry:{[n]:r(t)}}},references:[ER,_R,AR],integrityCheck:OR};p();p();var xt=e=>Object.entries(e);var rae=e=>{var r;let t=new Map;for(let[n,o]of xt((r=e.geometry)!=null?r:{}))t.set(n,new Map(o==null?void 0:o.features.map(i=>[i.properties.id,i])));return t},Gr=e=>{let t=rae(e);return(n,o)=>{let i=t.get(n);if(i==null)return ge({kind:Ds.UnknownFloorError,properties:{floorId:n}});let s=i.get(o);return s==null?ge({kind:Ds.UnknownGeometryError,properties:{floorId:n,geometryId:o}}):fe(s)}};p();var VP=S.Object({type:S.Literal("file"),name:S.String({description:"The name of the file."})},{$id:"ManifestFile"}),DR=S.Recursive(e=>S.Object({type:S.Literal("folder"),name:S.String({description:"The name of the folder."}),children:S.Array(S.Union([e,S.Ref(VP)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),FR=S.Object({name:S.String({description:"The name of the map."}),version:S.Literal("3.0.0",{description:"The version of the manifest."}),orgId:S.Optional(S.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:S.Optional(S.String({description:"The identifier of the map that this MVF is for."})),contents:S.Array(S.Union([S.Ref(DR),S.Ref(VP)]),{minItems:1,description:"The contents of the MVF bundle."}),time:S.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:S.Optional(S.Unsafe(S.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:S.Optional(S.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:S.Optional(S.Ref(vt,{description:"The default floor ID of the map."})),language:S.Optional(S.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),LR=Wn(ln(On,S.Ref(FR)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),nae=S.Object({manifest:S.Ref(LR)}),RR={name:"core:manifest",intoBundle:function*(e){e.manifest!=null&&(yield{path:"manifest.geojson",contents:e.manifest})},fromBundle:(e,t,r)=>{if(e==="manifest.geojson")return{manifest:r(t)}},schema:nae,references:[VP,DR,FR,LR]};var ri=S.Object({geometryId:S.Ref(Mn)},{$id:"WithGeometryId"}),Mv=S.Object({geometryIds:S.Array(S.Ref(Mn))},{$id:"WithGeometryIds"}),zP=[ri,Mv];p();p();var NR=(e,t)=>S.Unsafe(S.Transform(S.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),ho=(e,t)=>{let r=NR(e,t),n=[...e,"unknown"],o=Object.freeze(Object.fromEntries([...e,"unknown"].map(i=>[i,i])));return{schema:r,values:n,record:o}};p();p();p();var My;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(My||(My={}));var BR=e=>{var n;if(e.annotations==null)return fe(!0);let t=Gr(e),r=new Set(ft((n=e.annotationSymbols)!=null?n:{}));for(let o of ft(e.annotations)){let i=e.annotations[o];if(i!=null)for(let s of i){if(!r.has(s.symbolKey))return ge({kind:My.AnnotationUnknownSymbolError,properties:{annotationId:s.id,symbolKey:s.symbolKey}});let a=t(o,s.geometryId);if(a.isErr())return a;if(a.value.geometry.type!=="Point")return ge({kind:My.AnnotationNonPointGeometryError,properties:{annotationId:s.id,floorId:o,geometryId:s.geometryId}})}}return fe(!0)};var $R=ur("a","AnnotationId"),HP=S.Intersect([ri,S.Object({id:S.Ref($R,{description:"The unique identifier for the annotation."}),externalId:S.Optional(S.String({description:"The external identifier for the annotation."})),symbolKey:S.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),jR=S.Object({url:S.String({format:"uri",description:"The URL for the symbol."}),name:S.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),oae=S.Object({annotations:Pr(S.Record(vt,S.Array(S.Ref(HP)),{additionalProperties:!1})),annotationSymbols:Pr(S.Record(S.Index(HP,["symbolKey"]),S.Ref(jR)))},{$id:"AnnotationsSchema"}),iae=/^annotations\/(.*)\.json$/,GR={name:"ext:mvf-annotations",schema:oae,intoBundle:function*(e){if(e.annotations!=null)for(let t of ft(e.annotations))yield{path:"annotations/".concat(t,".json"),contents:e.annotations[t]};e.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:e.annotationSymbols})},fromBundle:(e,t,r)=>{var o;if(e==="annotation-symbols.json")return{annotationSymbols:r(t)};let n=(o=e.match(iae))==null?void 0:o[1];if(n)return{annotations:{[n]:r(t)}}},references:[$R,HP,jR],integrityCheck:BR};p();p();p();p();p();p();p();p();var WP=class extends Ae{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}},Oy=class extends Ae{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}},Ov;(function(e){function t(n,o){if(jr.Has(n))throw new WP(n);return jr.Set(n,o),(i={})=>vv({...i,[W]:n})}e.Type=t;function r(n,o){if(Hn.Has(n))throw new Oy(n);return Hn.Set(n,o),n}e.Format=r})(Ov||(Ov={}));p();p();p();function sae(e){switch(e.errorType){case q.ArrayContains:return"Expected array to contain at least one matching value";case q.ArrayMaxContains:return"Expected array to contain no more than ".concat(e.schema.maxContains," matching values");case q.ArrayMinContains:return"Expected array to contain at least ".concat(e.schema.minContains," matching values");case q.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(e.schema.maxItems);case q.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(e.schema.minItems);case q.ArrayUniqueItems:return"Expected array elements to be unique";case q.Array:return"Expected array";case q.AsyncIterator:return"Expected AsyncIterator";case q.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(e.schema.exclusiveMaximum);case q.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(e.schema.exclusiveMinimum);case q.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(e.schema.maximum);case q.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(e.schema.minimum);case q.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(e.schema.multipleOf);case q.BigInt:return"Expected bigint";case q.Boolean:return"Expected boolean";case q.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(e.schema.exclusiveMinimumTimestamp);case q.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(e.schema.exclusiveMaximumTimestamp);case q.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(e.schema.minimumTimestamp);case q.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(e.schema.maximumTimestamp);case q.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(e.schema.multipleOfTimestamp);case q.Date:return"Expected Date";case q.Function:return"Expected function";case q.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(e.schema.exclusiveMaximum);case q.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(e.schema.exclusiveMinimum);case q.IntegerMaximum:return"Expected integer to be less or equal to ".concat(e.schema.maximum);case q.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(e.schema.minimum);case q.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(e.schema.multipleOf);case q.Integer:return"Expected integer";case q.IntersectUnevaluatedProperties:return"Unexpected property";case q.Intersect:return"Expected all values to match";case q.Iterator:return"Expected Iterator";case q.Literal:return"Expected ".concat(typeof e.schema.const=="string"?"'".concat(e.schema.const,"'"):e.schema.const);case q.Never:return"Never";case q.Not:return"Value should not match";case q.Null:return"Expected null";case q.NumberExclusiveMaximum:return"Expected number to be less than ".concat(e.schema.exclusiveMaximum);case q.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(e.schema.exclusiveMinimum);case q.NumberMaximum:return"Expected number to be less or equal to ".concat(e.schema.maximum);case q.NumberMinimum:return"Expected number to be greater or equal to ".concat(e.schema.minimum);case q.NumberMultipleOf:return"Expected number to be a multiple of ".concat(e.schema.multipleOf);case q.Number:return"Expected number";case q.Object:return"Expected object";case q.ObjectAdditionalProperties:return"Unexpected property";case q.ObjectMaxProperties:return"Expected object to have no more than ".concat(e.schema.maxProperties," properties");case q.ObjectMinProperties:return"Expected object to have at least ".concat(e.schema.minProperties," properties");case q.ObjectRequiredProperty:return"Expected required property";case q.Promise:return"Expected Promise";case q.RegExp:return"Expected string to match regular expression";case q.StringFormatUnknown:return"Unknown format '".concat(e.schema.format,"'");case q.StringFormat:return"Expected string to match '".concat(e.schema.format,"' format");case q.StringMaxLength:return"Expected string length less or equal to ".concat(e.schema.maxLength);case q.StringMinLength:return"Expected string length greater or equal to ".concat(e.schema.minLength);case q.StringPattern:return"Expected string to match '".concat(e.schema.pattern,"'");case q.String:return"Expected string";case q.Symbol:return"Expected symbol";case q.TupleLength:return"Expected tuple to have ".concat(e.schema.maxItems||0," elements");case q.Tuple:return"Expected tuple";case q.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(e.schema.maxByteLength);case q.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(e.schema.minByteLength);case q.Uint8Array:return"Expected Uint8Array";case q.Undefined:return"Expected undefined";case q.Union:return"Expected union value";case q.Void:return"Expected void";case q.Kind:return"Expected kind '".concat(e.schema[W],"'");default:return"Unknown error type"}}var aae=sae;function UR(){return aae}p();var qP=class extends Ae{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};function lae(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new qP(e);return It(r,t)}function ni(e,t){return!ut(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}function It(e,t){return e[W]==="This"||e[W]==="Ref"?lae(e,t):e}p();var ZP=class extends Ae{constructor(t){super("Unable to hash value"),this.value=t}},Oo;(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"})(Oo||(Oo={}));var If=BigInt("14695981039346656037"),[cae,uae]=[BigInt("1099511628211"),BigInt("18446744073709551616")],pae=Array.from({length:256}).map((e,t)=>BigInt(t)),VR=new Float64Array(1),zR=new DataView(VR.buffer),HR=new Uint8Array(VR.buffer);function*dae(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}function fae(e){En(Oo.Array);for(let t of e)Sf(t)}function mae(e){En(Oo.Boolean),En(e?1:0)}function hae(e){En(Oo.BigInt),zR.setBigInt64(0,e);for(let t of HR)En(t)}function yae(e){En(Oo.Date),Sf(e.getTime())}function gae(e){En(Oo.Null)}function bae(e){En(Oo.Number),zR.setFloat64(0,e);for(let t of HR)En(t)}function vae(e){En(Oo.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Sf(t),Sf(e[t])}function xae(e){En(Oo.String);for(let t=0;t<e.length;t++)for(let r of dae(e.charCodeAt(t)))En(r)}function Iae(e){En(Oo.Symbol),Sf(e.description)}function Sae(e){En(Oo.Uint8Array);for(let t=0;t<e.length;t++)En(e[t])}function Cae(e){return En(Oo.Undefined)}function Sf(e){if(Ge(e))return fae(e);if(Os(e))return mae(e);if(sn(e))return hae(e);if(Vn(e))return yae(e);if(La(e))return gae(e);if(we(e))return bae(e);if(ze(e))return vae(e);if(ut(e))return xae(e);if(Ra(e))return Iae(e);if(Jd(e))return Sae(e);if(gr(e))return Cae(e);throw new ZP(e)}function En(e){If=If^pae[e],If=If*cae%uae}function cc(e){return If=BigInt("14695981039346656037"),Sf(e),If}p();var XP=class extends Ae{constructor(t){super("Unknown type"),this.schema=t}};function Pae(e){return e[W]==="Any"||e[W]==="Unknown"}function tt(e){return e!==void 0}function Tae(e,t,r){return!0}function wae(e,t,r){if(!Ge(r)||tt(e.minItems)&&!(r.length>=e.minItems)||tt(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(i=>cn(e.items,t,i))||e.uniqueItems===!0&&!function(){let i=new Set;for(let s of r){let a=cc(s);if(i.has(a))return!1;i.add(a)}return!0}())return!1;if(!(tt(e.contains)||we(e.minContains)||we(e.maxContains)))return!0;let n=tt(e.contains)?e.contains:Rt(),o=r.reduce((i,s)=>cn(n,t,s)?i+1:i,0);return!(o===0||we(e.minContains)&&o<e.minContains||we(e.maxContains)&&o>e.maxContains)}function Mae(e,t,r){return Z0(r)}function Oae(e,t,r){return!(!sn(r)||tt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||tt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||tt(e.maximum)&&!(r<=e.maximum)||tt(e.minimum)&&!(r>=e.minimum)||tt(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}function Eae(e,t,r){return Os(r)}function _ae(e,t,r){return cn(e.returns,t,r.prototype)}function Aae(e,t,r){return!(!Vn(r)||tt(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||tt(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||tt(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||tt(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||tt(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}function kae(e,t,r){return tc(r)}function Dae(e,t,r){return!(!K0(r)||tt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||tt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||tt(e.maximum)&&!(r<=e.maximum)||tt(e.minimum)&&!(r>=e.minimum)||tt(e.multipleOf)&&r%e.multipleOf!==0)}function Fae(e,t,r){let n=e.allOf.every(o=>cn(o,t,r));if(e.unevaluatedProperties===!1){let o=new RegExp(Va(e)),i=Object.getOwnPropertyNames(r).every(s=>o.test(s));return n&&i}else if(pt(e.unevaluatedProperties)){let o=new RegExp(Va(e)),i=Object.getOwnPropertyNames(r).every(s=>o.test(s)||cn(e.unevaluatedProperties,t,r[s]));return n&&i}else return n}function Lae(e,t,r){return X0(r)}function Rae(e,t,r){return r===e.const}function Nae(e,t,r){return!1}function Bae(e,t,r){return!cn(e.not,t,r)}function $ae(e,t,r){return La(r)}function jae(e,t,r){return!(!Dt.IsNumberLike(r)||tt(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||tt(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||tt(e.minimum)&&!(r>=e.minimum)||tt(e.maximum)&&!(r<=e.maximum)||tt(e.multipleOf)&&r%e.multipleOf!==0)}function Gae(e,t,r){if(!Dt.IsObjectLike(r)||tt(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||tt(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let n=Object.getOwnPropertyNames(e.properties);for(let o of n){let i=e.properties[o];if(e.required&&e.required.includes(o)){if(!cn(i,t,r[o])||(Ha(i)||Pae(i))&&!(o in r))return!1}else if(Dt.IsExactOptionalProperty(r,o)&&!cn(i,t,r[o]))return!1}if(e.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return e.required&&e.required.length===n.length&&o.length===n.length?!0:o.every(i=>n.includes(i))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(i=>n.includes(i)||cn(e.additionalProperties,t,r[i])):!0}function Uae(e,t,r){return Y0(r)}function Vae(e,t,r){if(!Dt.IsRecordLike(r)||tt(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||tt(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[n,o]=Object.entries(e.patternProperties)[0],i=new RegExp(n),s=Object.entries(r).every(([u,d])=>i.test(u)?cn(o,t,d):!0),a=typeof e.additionalProperties=="object"?Object.entries(r).every(([u,d])=>i.test(u)?!0:cn(e.additionalProperties,t,d)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(u=>i.test(u)):!0;return s&&a&&l}function zae(e,t,r){return cn(It(e,t),t,r)}function Hae(e,t,r){let n=new RegExp(e.source,e.flags);return tt(e.minLength)&&!(r.length>=e.minLength)||tt(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}function Wae(e,t,r){return!ut(r)||tt(e.minLength)&&!(r.length>=e.minLength)||tt(e.maxLength)&&!(r.length<=e.maxLength)||tt(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:tt(e.format)?Hn.Has(e.format)?Hn.Get(e.format)(r):!1:!0}function qae(e,t,r){return Ra(r)}function Zae(e,t,r){return ut(r)&&new RegExp(e.pattern).test(r)}function Xae(e,t,r){return cn(It(e,t),t,r)}function Yae(e,t,r){if(!Ge(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let n=0;n<e.items.length;n++)if(!cn(e.items[n],t,r[n]))return!1;return!0}function Kae(e,t,r){return gr(r)}function Jae(e,t,r){return e.anyOf.some(n=>cn(n,t,r))}function Qae(e,t,r){return!(!Jd(r)||tt(e.maxByteLength)&&!(r.length<=e.maxByteLength)||tt(e.minByteLength)&&!(r.length>=e.minByteLength))}function ele(e,t,r){return!0}function tle(e,t,r){return Dt.IsVoidLike(r)}function rle(e,t,r){return jr.Has(e[W])?jr.Get(e[W])(e,r):!1}function cn(e,t,r){let n=tt(e.$id)?[...t,e]:t,o=e;switch(o[W]){case"Any":return Tae(o,n,r);case"Array":return wae(o,n,r);case"AsyncIterator":return Mae(o,n,r);case"BigInt":return Oae(o,n,r);case"Boolean":return Eae(o,n,r);case"Constructor":return _ae(o,n,r);case"Date":return Aae(o,n,r);case"Function":return kae(o,n,r);case"Integer":return Dae(o,n,r);case"Intersect":return Fae(o,n,r);case"Iterator":return Lae(o,n,r);case"Literal":return Rae(o,n,r);case"Never":return Nae(o,n,r);case"Not":return Bae(o,n,r);case"Null":return $ae(o,n,r);case"Number":return jae(o,n,r);case"Object":return Gae(o,n,r);case"Promise":return Uae(o,n,r);case"Record":return Vae(o,n,r);case"Ref":return zae(o,n,r);case"RegExp":return Hae(o,n,r);case"String":return Wae(o,n,r);case"Symbol":return qae(o,n,r);case"TemplateLiteral":return Zae(o,n,r);case"This":return Xae(o,n,r);case"Tuple":return Yae(o,n,r);case"Undefined":return Kae(o,n,r);case"Union":return Jae(o,n,r);case"Uint8Array":return Qae(o,n,r);case"Unknown":return ele(o,n,r);case"Void":return tle(o,n,r);default:if(!jr.Has(o[W]))throw new XP(o);return rle(o,n,r)}}function Je(...e){return e.length===3?cn(e[0],e[1],e[2]):cn(e[0],[],e[1])}var q;(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"})(q||(q={}));var YP=class extends Ae{constructor(t){super("Unknown type"),this.schema=t}};function qa(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function rt(e){return e!==void 0}var oi=class{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};function ce(e,t,r,n,o=[]){return{type:e,schema:t,path:r,value:n,message:UR()({errorType:e,path:r,schema:t,value:n,errors:o}),errors:o}}function*nle(e,t,r,n){}function*ole(e,t,r,n){if(!Ge(n))return yield ce(q.Array,e,r,n);rt(e.minItems)&&!(n.length>=e.minItems)&&(yield ce(q.ArrayMinItems,e,r,n)),rt(e.maxItems)&&!(n.length<=e.maxItems)&&(yield ce(q.ArrayMaxItems,e,r,n));for(let s=0;s<n.length;s++)yield*un(e.items,t,"".concat(r,"/").concat(s),n[s]);if(e.uniqueItems===!0&&!function(){let s=new Set;for(let a of n){let l=cc(a);if(s.has(l))return!1;s.add(l)}return!0}()&&(yield ce(q.ArrayUniqueItems,e,r,n)),!(rt(e.contains)||rt(e.minContains)||rt(e.maxContains)))return;let o=rt(e.contains)?e.contains:Rt(),i=n.reduce((s,a,l)=>un(o,t,"".concat(r).concat(l),a).next().done===!0?s+1:s,0);i===0&&(yield ce(q.ArrayContains,e,r,n)),we(e.minContains)&&i<e.minContains&&(yield ce(q.ArrayMinContains,e,r,n)),we(e.maxContains)&&i>e.maxContains&&(yield ce(q.ArrayMaxContains,e,r,n))}function*ile(e,t,r,n){Z0(n)||(yield ce(q.AsyncIterator,e,r,n))}function*sle(e,t,r,n){if(!sn(n))return yield ce(q.BigInt,e,r,n);rt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ce(q.BigIntExclusiveMaximum,e,r,n)),rt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ce(q.BigIntExclusiveMinimum,e,r,n)),rt(e.maximum)&&!(n<=e.maximum)&&(yield ce(q.BigIntMaximum,e,r,n)),rt(e.minimum)&&!(n>=e.minimum)&&(yield ce(q.BigIntMinimum,e,r,n)),rt(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield ce(q.BigIntMultipleOf,e,r,n))}function*ale(e,t,r,n){Os(n)||(yield ce(q.Boolean,e,r,n))}function*lle(e,t,r,n){yield*un(e.returns,t,r,n.prototype)}function*cle(e,t,r,n){if(!Vn(n))return yield ce(q.Date,e,r,n);rt(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield ce(q.DateExclusiveMaximumTimestamp,e,r,n)),rt(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield ce(q.DateExclusiveMinimumTimestamp,e,r,n)),rt(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield ce(q.DateMaximumTimestamp,e,r,n)),rt(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield ce(q.DateMinimumTimestamp,e,r,n)),rt(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield ce(q.DateMultipleOfTimestamp,e,r,n))}function*ule(e,t,r,n){tc(n)||(yield ce(q.Function,e,r,n))}function*ple(e,t,r,n){if(!K0(n))return yield ce(q.Integer,e,r,n);rt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ce(q.IntegerExclusiveMaximum,e,r,n)),rt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ce(q.IntegerExclusiveMinimum,e,r,n)),rt(e.maximum)&&!(n<=e.maximum)&&(yield ce(q.IntegerMaximum,e,r,n)),rt(e.minimum)&&!(n>=e.minimum)&&(yield ce(q.IntegerMinimum,e,r,n)),rt(e.multipleOf)&&n%e.multipleOf!==0&&(yield ce(q.IntegerMultipleOf,e,r,n))}function*dle(e,t,r,n){let o=!1;for(let i of e.allOf)for(let s of un(i,t,r,n))o=!0,yield s;if(o)return yield ce(q.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let i=new RegExp(Va(e));for(let s of Object.getOwnPropertyNames(n))i.test(s)||(yield ce(q.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(s),n))}if(typeof e.unevaluatedProperties=="object"){let i=new RegExp(Va(e));for(let s of Object.getOwnPropertyNames(n))if(!i.test(s)){let a=un(e.unevaluatedProperties,t,"".concat(r,"/").concat(s),n[s]).next();a.done||(yield a.value)}}}function*fle(e,t,r,n){X0(n)||(yield ce(q.Iterator,e,r,n))}function*mle(e,t,r,n){n!==e.const&&(yield ce(q.Literal,e,r,n))}function*hle(e,t,r,n){yield ce(q.Never,e,r,n)}function*yle(e,t,r,n){un(e.not,t,r,n).next().done===!0&&(yield ce(q.Not,e,r,n))}function*gle(e,t,r,n){La(n)||(yield ce(q.Null,e,r,n))}function*ble(e,t,r,n){if(!Dt.IsNumberLike(n))return yield ce(q.Number,e,r,n);rt(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield ce(q.NumberExclusiveMaximum,e,r,n)),rt(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield ce(q.NumberExclusiveMinimum,e,r,n)),rt(e.maximum)&&!(n<=e.maximum)&&(yield ce(q.NumberMaximum,e,r,n)),rt(e.minimum)&&!(n>=e.minimum)&&(yield ce(q.NumberMinimum,e,r,n)),rt(e.multipleOf)&&n%e.multipleOf!==0&&(yield ce(q.NumberMultipleOf,e,r,n))}function*vle(e,t,r,n){if(!Dt.IsObjectLike(n))return yield ce(q.Object,e,r,n);rt(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield ce(q.ObjectMinProperties,e,r,n)),rt(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield ce(q.ObjectMaxProperties,e,r,n));let o=Array.isArray(e.required)?e.required:[],i=Object.getOwnPropertyNames(e.properties),s=Object.getOwnPropertyNames(n);for(let a of o)s.includes(a)||(yield ce(q.ObjectRequiredProperty,e.properties[a],"".concat(r,"/").concat(qa(a)),void 0));if(e.additionalProperties===!1)for(let a of s)i.includes(a)||(yield ce(q.ObjectAdditionalProperties,e,"".concat(r,"/").concat(qa(a)),n[a]));if(typeof e.additionalProperties=="object")for(let a of s)i.includes(a)||(yield*un(e.additionalProperties,t,"".concat(r,"/").concat(qa(a)),n[a]));for(let a of i){let l=e.properties[a];e.required&&e.required.includes(a)?(yield*un(l,t,"".concat(r,"/").concat(qa(a)),n[a]),Ha(e)&&!(a in n)&&(yield ce(q.ObjectRequiredProperty,l,"".concat(r,"/").concat(qa(a)),void 0))):Dt.IsExactOptionalProperty(n,a)&&(yield*un(l,t,"".concat(r,"/").concat(qa(a)),n[a]))}}function*xle(e,t,r,n){Y0(n)||(yield ce(q.Promise,e,r,n))}function*Ile(e,t,r,n){if(!Dt.IsRecordLike(n))return yield ce(q.Object,e,r,n);rt(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield ce(q.ObjectMinProperties,e,r,n)),rt(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield ce(q.ObjectMaxProperties,e,r,n));let[o,i]=Object.entries(e.patternProperties)[0],s=new RegExp(o);for(let[a,l]of Object.entries(n))s.test(a)&&(yield*un(i,t,"".concat(r,"/").concat(qa(a)),l));if(typeof e.additionalProperties=="object")for(let[a,l]of Object.entries(n))s.test(a)||(yield*un(e.additionalProperties,t,"".concat(r,"/").concat(qa(a)),l));if(e.additionalProperties===!1){for(let[a,l]of Object.entries(n))if(!s.test(a))return yield ce(q.ObjectAdditionalProperties,e,"".concat(r,"/").concat(qa(a)),l)}}function*Sle(e,t,r,n){yield*un(It(e,t),t,r,n)}function*Cle(e,t,r,n){if(!ut(n))return yield ce(q.String,e,r,n);if(rt(e.minLength)&&!(n.length>=e.minLength)&&(yield ce(q.StringMinLength,e,r,n)),rt(e.maxLength)&&!(n.length<=e.maxLength)&&(yield ce(q.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield ce(q.RegExp,e,r,n)}function*Ple(e,t,r,n){if(!ut(n))return yield ce(q.String,e,r,n);rt(e.minLength)&&!(n.length>=e.minLength)&&(yield ce(q.StringMinLength,e,r,n)),rt(e.maxLength)&&!(n.length<=e.maxLength)&&(yield ce(q.StringMaxLength,e,r,n)),ut(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield ce(q.StringPattern,e,r,n))),ut(e.format)&&(Hn.Has(e.format)?Hn.Get(e.format)(n)||(yield ce(q.StringFormat,e,r,n)):yield ce(q.StringFormatUnknown,e,r,n))}function*Tle(e,t,r,n){Ra(n)||(yield ce(q.Symbol,e,r,n))}function*wle(e,t,r,n){if(!ut(n))return yield ce(q.String,e,r,n);new RegExp(e.pattern).test(n)||(yield ce(q.StringPattern,e,r,n))}function*Mle(e,t,r,n){yield*un(It(e,t),t,r,n)}function*Ole(e,t,r,n){if(!Ge(n))return yield ce(q.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield ce(q.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield ce(q.TupleLength,e,r,n);if(e.items)for(let o=0;o<e.items.length;o++)yield*un(e.items[o],t,"".concat(r,"/").concat(o),n[o])}function*Ele(e,t,r,n){gr(n)||(yield ce(q.Undefined,e,r,n))}function*_le(e,t,r,n){if(Je(e,t,n))return;let o=e.anyOf.map(i=>new oi(un(i,t,r,n)));yield ce(q.Union,e,r,n,o)}function*Ale(e,t,r,n){if(!Jd(n))return yield ce(q.Uint8Array,e,r,n);rt(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield ce(q.Uint8ArrayMaxByteLength,e,r,n)),rt(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield ce(q.Uint8ArrayMinByteLength,e,r,n))}function*kle(e,t,r,n){}function*Dle(e,t,r,n){Dt.IsVoidLike(n)||(yield ce(q.Void,e,r,n))}function*Fle(e,t,r,n){jr.Get(e[W])(e,n)||(yield ce(q.Kind,e,r,n))}function*un(e,t,r,n){let o=rt(e.$id)?[...t,e]:t,i=e;switch(i[W]){case"Any":return yield*nle(i,o,r,n);case"Array":return yield*ole(i,o,r,n);case"AsyncIterator":return yield*ile(i,o,r,n);case"BigInt":return yield*sle(i,o,r,n);case"Boolean":return yield*ale(i,o,r,n);case"Constructor":return yield*lle(i,o,r,n);case"Date":return yield*cle(i,o,r,n);case"Function":return yield*ule(i,o,r,n);case"Integer":return yield*ple(i,o,r,n);case"Intersect":return yield*dle(i,o,r,n);case"Iterator":return yield*fle(i,o,r,n);case"Literal":return yield*mle(i,o,r,n);case"Never":return yield*hle(i,o,r,n);case"Not":return yield*yle(i,o,r,n);case"Null":return yield*gle(i,o,r,n);case"Number":return yield*ble(i,o,r,n);case"Object":return yield*vle(i,o,r,n);case"Promise":return yield*xle(i,o,r,n);case"Record":return yield*Ile(i,o,r,n);case"Ref":return yield*Sle(i,o,r,n);case"RegExp":return yield*Cle(i,o,r,n);case"String":return yield*Ple(i,o,r,n);case"Symbol":return yield*Tle(i,o,r,n);case"TemplateLiteral":return yield*wle(i,o,r,n);case"This":return yield*Mle(i,o,r,n);case"Tuple":return yield*Ole(i,o,r,n);case"Undefined":return yield*Ele(i,o,r,n);case"Union":return yield*_le(i,o,r,n);case"Uint8Array":return yield*Ale(i,o,r,n);case"Unknown":return yield*kle(i,o,r,n);case"Void":return yield*Dle(i,o,r,n);default:if(!jr.Has(i[W]))throw new YP(e);return yield*Fle(i,o,r,n)}}function Fs(...e){let t=e.length===3?un(e[0],e[1],"",e[2]):un(e[0],[],"",e[1]);return new oi(t)}p();var Lle=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},qR=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},KP,Ev,ZR,JP=class extends Ae{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),KP.add(this),Ev.set(this,void 0),Lle(this,Ev,t,"f"),this.error=r}Errors(){return new oi(qR(this,KP,"m",ZR).call(this))}};Ev=new WeakMap,KP=new WeakSet,ZR=function*(){this.error&&(yield this.error),yield*qR(this,Ev,"f")};function WR(e,t,r){if(!Je(e,t,r))throw new JP(Fs(e,t,r))}function _v(...e){return e.length===3?WR(e[0],e[1],e[2]):WR(e[0],[],e[1])}p();p();p();function Rle(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=St(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=St(e[r]);return t}function Nle(e){return e.map(t=>St(t))}function Ble(e){return e.slice()}function $le(e){return new Map(St([...e.entries()]))}function jle(e){return new Set(St([...e.entries()]))}function Gle(e){return new Date(e.toISOString())}function St(e){if(Ge(e))return Nle(e);if(Vn(e))return Gle(e);if(Xo(e))return Ble(e);if(fF(e))return $le(e);if(mF(e))return jle(e);if(ze(e))return Rle(e);if(an(e))return e;throw new Error("ValueClone: Unable to clone value")}var Eo=class extends Ae{constructor(t,r){super(r),this.schema=t}};function Ct(e){return tc(e)?e():St(e)}function Ule(e,t){return Fe(e,"default")?Ct(e.default):{}}function Vle(e,t){if(e.uniqueItems===!0&&!Fe(e,"default"))throw new Eo(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!Fe(e,"default"))throw new Eo(e,"Array with the contains constraint requires a default value");return"default"in e?Ct(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>_o(e.items,t)):[]}function zle(e,t){return Fe(e,"default")?Ct(e.default):async function*(){}()}function Hle(e,t){return Fe(e,"default")?Ct(e.default):BigInt(0)}function Wle(e,t){return Fe(e,"default")?Ct(e.default):!1}function qle(e,t){if(Fe(e,"default"))return Ct(e.default);{let r=_o(e.returns,t);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let i=this;i[n]=o}}}:class{}}}function Zle(e,t){return Fe(e,"default")?Ct(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function Xle(e,t){return Fe(e,"default")?Ct(e.default):()=>_o(e.returns,t)}function Yle(e,t){return Fe(e,"default")?Ct(e.default):e.minimum!==void 0?e.minimum:0}function Kle(e,t){if(Fe(e,"default"))return Ct(e.default);{let r=e.allOf.reduce((n,o)=>{let i=_o(o,t);return typeof i=="object"?{...n,...i}:i},{});if(!Je(e,t,r))throw new Eo(e,"Intersect produced invalid value. Consider using a default value.");return r}}function Jle(e,t){return Fe(e,"default")?Ct(e.default):function*(){}()}function Qle(e,t){return Fe(e,"default")?Ct(e.default):e.const}function ece(e,t){if(Fe(e,"default"))return Ct(e.default);throw new Eo(e,"Never types cannot be created. Consider using a default value.")}function tce(e,t){if(Fe(e,"default"))return Ct(e.default);throw new Eo(e,"Not types must have a default value")}function rce(e,t){return Fe(e,"default")?Ct(e.default):null}function nce(e,t){return Fe(e,"default")?Ct(e.default):e.minimum!==void 0?e.minimum:0}function oce(e,t){if(Fe(e,"default"))return Ct(e.default);{let r=new Set(e.required),n={};for(let[o,i]of Object.entries(e.properties))r.has(o)&&(n[o]=_o(i,t));return n}}function ice(e,t){return Fe(e,"default")?Ct(e.default):Promise.resolve(_o(e.item,t))}function sce(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(Fe(e,"default"))return Ct(e.default);if(r===Ga||r===ja)return{};{let o=r.slice(1,r.length-1).split("|"),i={};for(let s of o)i[s]=_o(n,t);return i}}function ace(e,t){return Fe(e,"default")?Ct(e.default):_o(It(e,t),t)}function lce(e,t){if(Fe(e,"default"))return Ct(e.default);throw new Eo(e,"RegExp types cannot be created. Consider using a default value.")}function cce(e,t){if(e.pattern!==void 0){if(Fe(e,"default"))return Ct(e.default);throw new Eo(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(Fe(e,"default"))return Ct(e.default);throw new Eo(e,"String types with formats must specify a default value")}else return Fe(e,"default")?Ct(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}function uce(e,t){return Fe(e,"default")?Ct(e.default):"value"in e?Symbol.for(e.value):Symbol()}function pce(e,t){if(Fe(e,"default"))return Ct(e.default);if(!rv(e))throw new Eo(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return sf(e)[0]}function dce(e,t){if(XR++>xce)throw new Eo(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Fe(e,"default")?Ct(e.default):_o(It(e,t),t)}function fce(e,t){return Fe(e,"default")?Ct(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>_o(e.items[n],t))}function mce(e,t){if(Fe(e,"default"))return Ct(e.default)}function hce(e,t){if(Fe(e,"default"))return Ct(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return _o(e.anyOf[0],t)}function yce(e,t){return Fe(e,"default")?Ct(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function gce(e,t){return Fe(e,"default")?Ct(e.default):{}}function bce(e,t){if(Fe(e,"default"))return Ct(e.default)}function vce(e,t){if(Fe(e,"default"))return Ct(e.default);throw new Error("User defined types must specify a default value")}function _o(e,t){let r=ni(e,t),n=e;switch(n[W]){case"Any":return Ule(n,r);case"Array":return Vle(n,r);case"AsyncIterator":return zle(n,r);case"BigInt":return Hle(n,r);case"Boolean":return Wle(n,r);case"Constructor":return qle(n,r);case"Date":return Zle(n,r);case"Function":return Xle(n,r);case"Integer":return Yle(n,r);case"Intersect":return Kle(n,r);case"Iterator":return Jle(n,r);case"Literal":return Qle(n,r);case"Never":return ece(n,r);case"Not":return tce(n,r);case"Null":return rce(n,r);case"Number":return nce(n,r);case"Object":return oce(n,r);case"Promise":return ice(n,r);case"Record":return sce(n,r);case"Ref":return ace(n,r);case"RegExp":return lce(n,r);case"String":return cce(n,r);case"Symbol":return uce(n,r);case"TemplateLiteral":return pce(n,r);case"This":return dce(n,r);case"Tuple":return fce(n,r);case"Undefined":return mce(n,r);case"Union":return hce(n,r);case"Uint8Array":return yce(n,r);case"Unknown":return gce(n,r);case"Void":return bce(n,r);default:if(!jr.Has(n[W]))throw new Eo(n,"Unknown type");return vce(n,r)}}var xce=512,XR=0;function ii(...e){return XR=0,e.length===2?_o(e[0],e[1]):_o(e[0],[])}var Av=class extends Ae{constructor(t,r){super(r),this.schema=t}};function Ice(e,t,r){if(e[W]==="Object"&&typeof r=="object"&&!La(r)){let n=e,o=Object.getOwnPropertyNames(r),i=Object.entries(n.properties),[s,a]=[1/i.length,i.length];return i.reduce((l,[u,d])=>{let f=d[W]==="Literal"&&d.const===r[u]?a:0,h=Je(d,t,r[u])?s:0,b=o.includes(u)?s:0;return l+(f+h+b)},0)}else return Je(e,t,r)?1:0}function Sce(e,t,r){let n=e.anyOf.map(s=>It(s,t)),[o,i]=[n[0],0];for(let s of n){let a=Ice(s,t,r);a>i&&(o=s,i=a)}return o}function Cce(e,t,r){if("default"in e)return typeof r=="function"?e.default:St(e.default);{let n=Sce(e,t,r);return QP(n,t,r)}}function Pce(e,t,r){return Je(e,t,r)?St(r):ii(e,t)}function Tce(e,t,r){return Je(e,t,r)?r:ii(e,t)}function wce(e,t,r){if(Je(e,t,r))return St(r);let n=Ge(r)?St(r):ii(e,t),o=we(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,s=(we(e.maxItems)&&o.length>e.maxItems?o.slice(0,e.maxItems):o).map(l=>Ls(e.items,t,l));if(e.uniqueItems!==!0)return s;let a=[...new Set(s)];if(!Je(e,t,a))throw new Av(e,"Array cast produced invalid data due to uniqueItems constraint");return a}function Mce(e,t,r){if(Je(e,t,r))return ii(e,t);let n=new Set(e.returns.required||[]),o=function(){};for(let[i,s]of Object.entries(e.returns.properties))!n.has(i)&&r.prototype[i]===void 0||(o.prototype[i]=Ls(s,t,r.prototype[i]));return o}function Oce(e,t,r){let n=ii(e,t),o=ze(n)&&ze(r)?{...n,...r}:r;return Je(e,t,o)?o:ii(e,t)}function Ece(e,t,r){throw new Av(e,"Never types cannot be cast")}function _ce(e,t,r){if(Je(e,t,r))return r;if(r===null||typeof r!="object")return ii(e,t);let n=new Set(e.required||[]),o={};for(let[i,s]of Object.entries(e.properties))!n.has(i)&&r[i]===void 0||(o[i]=Ls(s,t,r[i]));if(typeof e.additionalProperties=="object"){let i=Object.getOwnPropertyNames(e.properties);for(let s of Object.getOwnPropertyNames(r))i.includes(s)||(o[s]=Ls(e.additionalProperties,t,r[s]))}return o}function Ace(e,t,r){if(Je(e,t,r))return St(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return ii(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[n],i={};for(let[s,a]of Object.entries(r))i[s]=Ls(o,t,a);return i}function kce(e,t,r){return Ls(It(e,t),t,r)}function Dce(e,t,r){return Ls(It(e,t),t,r)}function Fce(e,t,r){return Je(e,t,r)?St(r):Ge(r)?e.items===void 0?[]:e.items.map((n,o)=>Ls(n,t,r[o])):ii(e,t)}function Lce(e,t,r){return Je(e,t,r)?St(r):Cce(e,t,r)}function Ls(e,t,r){let n=ut(e.$id)?[...t,e]:t,o=e;switch(e[W]){case"Array":return wce(o,n,r);case"Constructor":return Mce(o,n,r);case"Intersect":return Oce(o,n,r);case"Never":return Ece(o,n,r);case"Object":return _ce(o,n,r);case"Record":return Ace(o,n,r);case"Ref":return kce(o,n,r);case"This":return Dce(o,n,r);case"Tuple":return Fce(o,n,r);case"Union":return Lce(o,n,r);case"Date":case"Symbol":case"Uint8Array":return Pce(e,t,r);default:return Tce(o,n,r)}}function QP(...e){return e.length===3?Ls(e[0],e[1],e[2]):Ls(e[0],[],e[1])}p();function Rce(e){return nc(e)&&e[W]!=="Unsafe"}function Nce(e,t,r){return Ge(r)?r.map(n=>Ao(e.items,t,n)):r}function Bce(e,t,r){let n=e.unevaluatedProperties,i=e.allOf.map(a=>Ao(a,t,St(r))).reduce((a,l)=>ze(l)?{...a,...l}:l,{});if(!ze(r)||!ze(i)||!nc(n))return i;let s=Yr(e);for(let a of Object.getOwnPropertyNames(r))s.includes(a)||Je(n,t,r[a])&&(i[a]=Ao(n,t,r[a]));return i}function $ce(e,t,r){if(!ze(r)||Ge(r))return r;let n=e.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Fe(e.properties,o)){r[o]=Ao(e.properties[o],t,r[o]);continue}if(nc(n)&&Je(n,t,r[o])){r[o]=Ao(n,t,r[o]);continue}delete r[o]}return r}function jce(e,t,r){if(!ze(r))return r;let n=e.additionalProperties,o=Object.getOwnPropertyNames(r),[i,s]=Object.entries(e.patternProperties)[0],a=new RegExp(i);for(let l of o){if(a.test(l)){r[l]=Ao(s,t,r[l]);continue}if(nc(n)&&Je(n,t,r[l])){r[l]=Ao(n,t,r[l]);continue}delete r[l]}return r}function Gce(e,t,r){return Ao(It(e,t),t,r)}function Uce(e,t,r){return Ao(It(e,t),t,r)}function Vce(e,t,r){if(!Ge(r))return r;if(gr(e.items))return[];let n=Math.min(r.length,e.items.length);for(let o=0;o<n;o++)r[o]=Ao(e.items[o],t,r[o]);return r.length>n?r.slice(0,n):r}function zce(e,t,r){for(let n of e.anyOf)if(Rce(n)&&Je(n,t,r))return Ao(n,t,r);return r}function Ao(e,t,r){let n=ut(e.$id)?[...t,e]:t,o=e;switch(o[W]){case"Array":return Nce(o,n,r);case"Intersect":return Bce(o,n,r);case"Object":return $ce(o,n,r);case"Record":return jce(o,n,r);case"Ref":return Gce(o,n,r);case"This":return Uce(o,n,r);case"Tuple":return Vce(o,n,r);case"Union":return zce(o,n,r);default:return r}}function kv(...e){return e.length===3?Ao(e[0],e[1],e[2]):Ao(e[0],[],e[1])}p();function Dv(e){return ut(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function Hce(e){return sn(e)||Os(e)||we(e)}function Ey(e){return e===!0||we(e)&&e===1||sn(e)&&e===BigInt("1")||ut(e)&&(e.toLowerCase()==="true"||e==="1")}function _y(e){return e===!1||we(e)&&(e===0||Object.is(e,-0))||sn(e)&&e===BigInt("0")||ut(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function Wce(e){return ut(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}function qce(e){return ut(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}function Zce(e){return ut(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 Xce(e){return ut(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 Yce(e){return ut(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}function Kce(e,t){let r=KR(e);return r===t?r:e}function Jce(e,t){let r=JR(e);return r===t?r:e}function Qce(e,t){let r=YR(e);return r===t?r:e}function eue(e,t){return ut(e.const)?Kce(t,e.const):we(e.const)?Jce(t,e.const):Os(e.const)?Qce(t,e.const):t}function YR(e){return Ey(e)?!0:_y(e)?!1:e}function tue(e){let t=r=>r.split(".")[0];return Dv(e)?BigInt(t(e)):we(e)?BigInt(Math.trunc(e)):_y(e)?BigInt(0):Ey(e)?BigInt(1):e}function KR(e){return Hce(e)?e.toString():Ra(e)&&e.description!==void 0?e.description.toString():e}function JR(e){return Dv(e)?parseFloat(e):Ey(e)?1:_y(e)?0:e}function rue(e){return Dv(e)?parseInt(e):we(e)?e|0:Ey(e)?1:_y(e)?0:e}function nue(e){return ut(e)&&e.toLowerCase()==="null"?null:e}function oue(e){return ut(e)&&e==="undefined"?void 0:e}function iue(e){return Vn(e)?e:we(e)?new Date(e):Ey(e)?new Date(1):_y(e)?new Date(0):Dv(e)?new Date(parseInt(e)):qce(e)?new Date("1970-01-01T".concat(e,".000Z")):Wce(e)?new Date("1970-01-01T".concat(e)):Xce(e)?new Date("".concat(e,".000Z")):Zce(e)?new Date(e):Yce(e)?new Date("".concat(e,"T00:00:00.000Z")):e}function sue(e,t,r){return(Ge(r)?r:[r]).map(o=>Rs(e.items,t,o))}function aue(e,t,r){return tue(r)}function lue(e,t,r){return YR(r)}function cue(e,t,r){return iue(r)}function uue(e,t,r){return rue(r)}function pue(e,t,r){return e.allOf.reduce((n,o)=>Rs(o,t,n),r)}function due(e,t,r){return eue(e,r)}function fue(e,t,r){return nue(r)}function mue(e,t,r){return JR(r)}function hue(e,t,r){if(!ze(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))Fe(r,n)&&(r[n]=Rs(e.properties[n],t,r[n]));return r}function yue(e,t,r){if(!ze(r))return r;let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[o];for(let[s,a]of Object.entries(r))r[s]=Rs(i,t,a);return r}function gue(e,t,r){return Rs(It(e,t),t,r)}function bue(e,t,r){return KR(r)}function vue(e,t,r){return ut(r)||we(r)?Symbol(r):r}function xue(e,t,r){return Rs(It(e,t),t,r)}function Iue(e,t,r){return Ge(r)&&!gr(e.items)?r.map((o,i)=>i<e.items.length?Rs(e.items[i],t,o):o):r}function Sue(e,t,r){return oue(r)}function Cue(e,t,r){for(let n of e.anyOf){let o=Rs(n,t,St(r));if(Je(n,t,o))return o}return r}function Rs(e,t,r){let n=ni(e,t),o=e;switch(e[W]){case"Array":return sue(o,n,r);case"BigInt":return aue(o,n,r);case"Boolean":return lue(o,n,r);case"Date":return cue(o,n,r);case"Integer":return uue(o,n,r);case"Intersect":return pue(o,n,r);case"Literal":return due(o,n,r);case"Null":return fue(o,n,r);case"Number":return mue(o,n,r);case"Object":return hue(o,n,r);case"Record":return yue(o,n,r);case"Ref":return gue(o,n,r);case"String":return bue(o,n,r);case"Symbol":return vue(o,n,r);case"This":return xue(o,n,r);case"Tuple":return Iue(o,n,r);case"Undefined":return Sue(o,n,r);case"Union":return Cue(o,n,r);default:return r}}function Fv(...e){return e.length===3?Rs(e[0],e[1],e[2]):Rs(e[0],[],e[1])}p();p();var Cf=class extends Ae{constructor(t,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=n}},Nu=class extends Ae{constructor(t,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=t,this.path=r,this.value=n,this.error=o}};function br(e,t,r){try{return Yt(e)?e[nr].Decode(r):r}catch(n){throw new Nu(e,t,r,n)}}function Pue(e,t,r,n){return Ge(n)?br(e,r,n.map((o,i)=>Ns(e.items,t,"".concat(r,"/").concat(i),o))):br(e,r,n)}function Tue(e,t,r,n){if(!ze(n)||an(n))return br(e,r,n);let o=sc(e),i=o.map(d=>d[0]),s={...n};for(let[d,f]of o)d in s&&(s[d]=Ns(f,t,"".concat(r,"/").concat(d),s[d]));if(!Yt(e.unevaluatedProperties))return br(e,r,s);let a=Object.getOwnPropertyNames(s),l=e.unevaluatedProperties,u={...s};for(let d of a)i.includes(d)||(u[d]=br(l,"".concat(r,"/").concat(d),u[d]));return br(e,r,u)}function wue(e,t,r,n){return br(e,r,Ns(e.not,t,r,n))}function Mue(e,t,r,n){if(!ze(n))return br(e,r,n);let o=Yr(e),i={...n};for(let u of o)Fe(i,u)&&(gr(i[u])&&(!ef(e.properties[u])||Dt.IsExactOptionalProperty(i,u))||(i[u]=Ns(e.properties[u],t,"".concat(r,"/").concat(u),i[u])));if(!pt(e.additionalProperties))return br(e,r,i);let s=Object.getOwnPropertyNames(i),a=e.additionalProperties,l={...i};for(let u of s)o.includes(u)||(l[u]=br(a,"".concat(r,"/").concat(u),l[u]));return br(e,r,l)}function Oue(e,t,r,n){if(!ze(n))return br(e,r,n);let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=new RegExp(o),s={...n};for(let d of Object.getOwnPropertyNames(n))i.test(d)&&(s[d]=Ns(e.patternProperties[o],t,"".concat(r,"/").concat(d),s[d]));if(!pt(e.additionalProperties))return br(e,r,s);let a=Object.getOwnPropertyNames(s),l=e.additionalProperties,u={...s};for(let d of a)i.test(d)||(u[d]=br(l,"".concat(r,"/").concat(d),u[d]));return br(e,r,u)}function Eue(e,t,r,n){let o=It(e,t);return br(e,r,Ns(o,t,r,n))}function _ue(e,t,r,n){let o=It(e,t);return br(e,r,Ns(o,t,r,n))}function Aue(e,t,r,n){return Ge(n)&&Ge(e.items)?br(e,r,e.items.map((o,i)=>Ns(o,t,"".concat(r,"/").concat(i),n[i]))):br(e,r,n)}function kue(e,t,r,n){for(let o of e.anyOf){if(!Je(o,t,n))continue;let i=Ns(o,t,r,n);return br(e,r,i)}return br(e,r,n)}function Ns(e,t,r,n){let o=ni(e,t),i=e;switch(e[W]){case"Array":return Pue(i,o,r,n);case"Intersect":return Tue(i,o,r,n);case"Not":return wue(i,o,r,n);case"Object":return Mue(i,o,r,n);case"Record":return Oue(i,o,r,n);case"Ref":return Eue(i,o,r,n);case"Symbol":return br(i,r,n);case"This":return _ue(i,o,r,n);case"Tuple":return Aue(i,o,r,n);case"Union":return kue(i,o,r,n);default:return br(i,r,n)}}function Pf(e,t,r){return Ns(e,t,"",r)}p();var Tf=class extends Ae{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}},Bu=class extends Ae{constructor(t,r,n,o){super("".concat(o instanceof Error?o.message:"Unknown error")),this.schema=t,this.path=r,this.value=n,this.error=o}};function _n(e,t,r){try{return Yt(e)?e[nr].Encode(r):r}catch(n){throw new Bu(e,t,r,n)}}function Due(e,t,r,n){let o=_n(e,r,n);return Ge(o)?o.map((i,s)=>Bs(e.items,t,"".concat(r,"/").concat(s),i)):o}function Fue(e,t,r,n){let o=_n(e,r,n);if(!ze(n)||an(n))return o;let i=sc(e),s=i.map(f=>f[0]),a={...o};for(let[f,h]of i)f in a&&(a[f]=Bs(h,t,"".concat(r,"/").concat(f),a[f]));if(!Yt(e.unevaluatedProperties))return a;let l=Object.getOwnPropertyNames(a),u=e.unevaluatedProperties,d={...a};for(let f of l)s.includes(f)||(d[f]=_n(u,"".concat(r,"/").concat(f),d[f]));return d}function Lue(e,t,r,n){return _n(e.not,r,_n(e,r,n))}function Rue(e,t,r,n){let o=_n(e,r,n);if(!ze(o))return o;let i=Yr(e),s={...o};for(let d of i)Fe(s,d)&&(gr(s[d])&&(!ef(e.properties[d])||Dt.IsExactOptionalProperty(s,d))||(s[d]=Bs(e.properties[d],t,"".concat(r,"/").concat(d),s[d])));if(!pt(e.additionalProperties))return s;let a=Object.getOwnPropertyNames(s),l=e.additionalProperties,u={...s};for(let d of a)i.includes(d)||(u[d]=_n(l,"".concat(r,"/").concat(d),u[d]));return u}function Nue(e,t,r,n){let o=_n(e,r,n);if(!ze(n))return o;let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),a={...o};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(a[f]=Bs(e.patternProperties[i],t,"".concat(r,"/").concat(f),a[f]));if(!pt(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),u=e.additionalProperties,d={...a};for(let f of l)s.test(f)||(d[f]=_n(u,"".concat(r,"/").concat(f),d[f]));return d}function Bue(e,t,r,n){let o=It(e,t),i=Bs(o,t,r,n);return _n(e,r,i)}function $ue(e,t,r,n){let o=It(e,t),i=Bs(o,t,r,n);return _n(e,r,i)}function jue(e,t,r,n){let o=_n(e,r,n);return Ge(e.items)?e.items.map((i,s)=>Bs(i,t,"".concat(r,"/").concat(s),o[s])):[]}function Gue(e,t,r,n){for(let o of e.anyOf){if(!Je(o,t,n))continue;let i=Bs(o,t,r,n);return _n(e,r,i)}for(let o of e.anyOf){let i=Bs(o,t,r,n);if(Je(e,t,i))return _n(e,r,i)}return _n(e,r,n)}function Bs(e,t,r,n){let o=ni(e,t),i=e;switch(e[W]){case"Array":return Due(i,o,r,n);case"Intersect":return Fue(i,o,r,n);case"Not":return Lue(i,o,r,n);case"Object":return Rue(i,o,r,n);case"Record":return Nue(i,o,r,n);case"Ref":return Bue(i,o,r,n);case"This":return $ue(i,o,r,n);case"Tuple":return jue(i,o,r,n);case"Union":return Gue(i,o,r,n);default:return _n(i,r,n)}}function Lv(e,t,r){return Bs(e,t,"",r)}p();function Uue(e,t){return Yt(e)||Kr(e.items,t)}function Vue(e,t){return Yt(e)||Kr(e.items,t)}function zue(e,t){return Yt(e)||Kr(e.returns,t)||e.parameters.some(r=>Kr(r,t))}function Hue(e,t){return Yt(e)||Kr(e.returns,t)||e.parameters.some(r=>Kr(r,t))}function Wue(e,t){return Yt(e)||Yt(e.unevaluatedProperties)||e.allOf.some(r=>Kr(r,t))}function que(e,t){return Yt(e)||Kr(e.items,t)}function Zue(e,t){return Yt(e)||Kr(e.not,t)}function Xue(e,t){return Yt(e)||Object.values(e.properties).some(r=>Kr(r,t))||pt(e.additionalProperties)&&Kr(e.additionalProperties,t)}function Yue(e,t){return Yt(e)||Kr(e.item,t)}function Kue(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return Yt(e)||Kr(n,t)||pt(e.additionalProperties)&&Yt(e.additionalProperties)}function Jue(e,t){return Yt(e)?!0:Kr(It(e,t),t)}function Que(e,t){return Yt(e)?!0:Kr(It(e,t),t)}function epe(e,t){return Yt(e)||!gr(e.items)&&e.items.some(r=>Kr(r,t))}function tpe(e,t){return Yt(e)||e.anyOf.some(r=>Kr(r,t))}function Kr(e,t){let r=ni(e,t),n=e;if(e.$id&&eT.has(e.$id))return!1;switch(e.$id&&eT.add(e.$id),e[W]){case"Array":return Uue(n,r);case"AsyncIterator":return Vue(n,r);case"Constructor":return zue(n,r);case"Function":return Hue(n,r);case"Intersect":return Wue(n,r);case"Iterator":return que(n,r);case"Not":return Zue(n,r);case"Object":return Xue(n,r);case"Promise":return Yue(n,r);case"Record":return Kue(n,r);case"Ref":return Jue(n,r);case"This":return Que(n,r);case"Tuple":return epe(n,r);case"Union":return tpe(n,r);default:return Yt(e)}}var eT=new Set;function $s(e,t){return eT.clear(),Kr(e,t)}function QR(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!Je(t,r,n))throw new Cf(t,n,Fs(t,r,n).First());return $s(t,r)?Pf(t,r,n):n}p();function Za(e,t){let r=Fe(e,"default")?e.default:void 0,n=tc(r)?r():St(r);return gr(t)?n:ze(t)&&ze(n)?Object.assign(n,t):t}function tT(e){return nc(e)&&"default"in e}function rpe(e,t,r){let n=Za(e,r);if(!Ge(n))return n;for(let o=0;o<n.length;o++)n[o]=ko(e.items,t,n[o]);return n}function npe(e,t,r){return Vn(r)?r:Za(e,r)}function ope(e,t,r){let n=Za(e,r);return e.allOf.reduce((o,i)=>{let s=ko(i,t,n);return ze(s)?{...o,...s}:s},{})}function ipe(e,t,r){let n=Za(e,r);if(!ze(n))return n;let o=Object.getOwnPropertyNames(e.properties);for(let i of o){let s=ko(e.properties[i],t,n[i]);gr(s)||(n[i]=ko(e.properties[i],t,n[i]))}if(!tT(e.additionalProperties))return n;for(let i of Object.getOwnPropertyNames(n))o.includes(i)||(n[i]=ko(e.additionalProperties,t,n[i]));return n}function spe(e,t,r){let n=Za(e,r);if(!ze(n))return n;let o=e.additionalProperties,[i,s]=Object.entries(e.patternProperties)[0],a=new RegExp(i);for(let l of Object.getOwnPropertyNames(n))a.test(l)&&tT(s)&&(n[l]=ko(s,t,n[l]));if(!tT(o))return n;for(let l of Object.getOwnPropertyNames(n))a.test(l)||(n[l]=ko(o,t,n[l]));return n}function ape(e,t,r){return ko(It(e,t),t,Za(e,r))}function lpe(e,t,r){return ko(It(e,t),t,r)}function cpe(e,t,r){let n=Za(e,r);if(!Ge(n)||gr(e.items))return n;let[o,i]=[e.items,Math.max(e.items.length,n.length)];for(let s=0;s<i;s++)s<o.length&&(n[s]=ko(o[s],t,n[s]));return n}function upe(e,t,r){let n=Za(e,r);for(let o of e.anyOf){let i=ko(o,t,St(n));if(Je(o,t,i))return i}return n}function ko(e,t,r){let n=ni(e,t),o=e;switch(o[W]){case"Array":return rpe(o,n,r);case"Date":return npe(o,n,r);case"Intersect":return ope(o,n,r);case"Object":return ipe(o,n,r);case"Record":return spe(o,n,r);case"Ref":return ape(o,n,r);case"This":return lpe(o,n,r);case"Tuple":return cpe(o,n,r);case"Union":return upe(o,n,r);default:return Za(o,r)}}function Rv(...e){return e.length===3?ko(e[0],e[1],e[2]):ko(e[0],[],e[1])}p();p();var si={};Ul(si,{Delete:()=>dpe,Format:()=>Ay,Get:()=>mpe,Has:()=>fpe,Set:()=>ppe,ValuePointerRootDeleteError:()=>Bv,ValuePointerRootSetError:()=>Nv});p();var Nv=class extends Ae{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}},Bv=class extends Ae{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};function eN(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*Ay(e){if(e==="")return;let[t,r]=[0,0];for(let n=0;n<e.length;n++)e.charAt(n)==="/"?(n===0||(r=n,yield eN(e.slice(t,r))),t=n+1):r=n;yield eN(e.slice(t))}function ppe(e,t,r){if(t==="")throw new Nv(e,t,r);let[n,o,i]=[null,e,""];for(let s of Ay(t))o[s]===void 0&&(o[s]={}),n=o,o=o[s],i=s;n[i]=r}function dpe(e,t){if(t==="")throw new Bv(e,t);let[r,n,o]=[null,e,""];for(let i of Ay(t)){if(n[i]===void 0||n[i]===null)return;r=n,n=n[i],o=i}if(Array.isArray(r)){let i=parseInt(o);r.splice(i,1)}else delete r[o]}function fpe(e,t){if(t==="")return!0;let[r,n,o]=[null,e,""];for(let i of Ay(t)){if(n[i]===void 0)return!1;r=n,n=n[i],o=i}return Object.getOwnPropertyNames(r).includes(o)}function mpe(e,t){if(t==="")return e;let r=e;for(let n of Ay(t)){if(r[n]===void 0)return;r=r[n]}return r}p();function hpe(e,t){if(!ze(t))return!1;let r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],n=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return r.length!==n.length?!1:r.every(o=>$u(e[o],t[o]))}function ype(e,t){return Vn(t)&&e.getTime()===t.getTime()}function gpe(e,t){return!Ge(t)||e.length!==t.length?!1:e.every((r,n)=>$u(r,t[n]))}function bpe(e,t){return!Xo(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>$u(r,t[n]))}function vpe(e,t){return e===t}function $u(e,t){if(Vn(e))return ype(e,t);if(Xo(e))return bpe(e,t);if(Ge(e))return gpe(e,t);if(ze(e))return hpe(e,t);if(an(e))return vpe(e,t);throw new Error("ValueEquals: Unable to compare value")}var xpe=Vt({type:_t("insert"),path:Ko(),value:za()}),Ipe=Vt({type:_t("update"),path:Ko(),value:za()}),Spe=Vt({type:_t("delete"),path:Ko()}),rN=Nt([xpe,Ipe,Spe]),$v=class extends Ae{constructor(t,r){super(r),this.value=t}};function jv(e,t){return{type:"update",path:e,value:t}}function nN(e,t){return{type:"insert",path:e,value:t}}function oN(e){return{type:"delete",path:e}}function tN(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new $v(e,"Cannot diff objects with symbols")}function*Cpe(e,t,r){if(tN(t),tN(r),!JC(r))return yield jv(e,r);let n=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(r);for(let i of o)Fe(t,i)||(yield nN("".concat(e,"/").concat(i),r[i]));for(let i of n)Fe(r,i)&&($u(t,r)||(yield*Gv("".concat(e,"/").concat(i),t[i],r[i])));for(let i of n)Fe(r,i)||(yield oN("".concat(e,"/").concat(i)))}function*Ppe(e,t,r){if(!Ge(r))return yield jv(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*Gv("".concat(e,"/").concat(n),t[n],r[n]);for(let n=0;n<r.length;n++)n<t.length||(yield nN("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield oN("".concat(e,"/").concat(n)))}function*Tpe(e,t,r){if(!Xo(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield jv(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*Gv("".concat(e,"/").concat(n),t[n],r[n])}function*wpe(e,t,r){t!==r&&(yield jv(e,r))}function*Gv(e,t,r){if(JC(t))return yield*Cpe(e,t,r);if(Ge(t))return yield*Ppe(e,t,r);if(Xo(t))return yield*Tpe(e,t,r);if(an(t))return yield*wpe(e,t,r);throw new $v(t,"Unable to diff value")}function iN(e,t){return[...Gv("",e,t)]}function Mpe(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function Ope(e){return e.length===0}function sN(e,t){if(Mpe(t))return St(t[0].value);if(Ope(t))return St(e);let r=St(e);for(let n of t)switch(n.type){case"insert":{si.Set(r,n.path,n.value);break}case"update":{si.Set(r,n.path,n.value);break}case"delete":{si.Delete(r,n.path);break}}return r}p();function aN(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=$s(t,r)?Lv(t,r,n):n;if(!Je(t,r,o))throw new Tf(t,o,Fs(t,r,o).First());return o}p();var Uv=class extends Ae{constructor(t){super(t)}};function Epe(e,t,r,n){if(!ze(r))si.Set(e,t,St(n));else{let o=Object.getOwnPropertyNames(r),i=Object.getOwnPropertyNames(n);for(let s of o)i.includes(s)||delete r[s];for(let s of i)o.includes(s)||(r[s]=null);for(let s of i)rT(e,"".concat(t,"/").concat(s),r[s],n[s])}}function _pe(e,t,r,n){if(!Ge(r))si.Set(e,t,St(n));else{for(let o=0;o<n.length;o++)rT(e,"".concat(t,"/").concat(o),r[o],n[o]);r.splice(n.length)}}function Ape(e,t,r,n){if(Xo(r)&&r.length===n.length)for(let o=0;o<r.length;o++)r[o]=n[o];else si.Set(e,t,St(n))}function kpe(e,t,r,n){r!==n&&si.Set(e,t,n)}function rT(e,t,r,n){if(Ge(n))return _pe(e,t,r,n);if(Xo(n))return Ape(e,t,r,n);if(ze(n))return Epe(e,t,r,n);if(an(n))return kpe(e,t,r,n)}function lN(e){return Xo(e)||an(e)}function Dpe(e,t){return ze(e)&&Ge(t)||Ge(e)&&ze(t)}function cN(e,t){if(lN(e)||lN(t))throw new Uv("Only object and array types can be mutated at the root level");if(Dpe(e,t))throw new Uv("Cannot assign due type mismatch of assignable values");rT(e,"",e,t)}p();var Fpe=[(e,t,r)=>St(r),(e,t,r)=>Rv(e,t,r),(e,t,r)=>kv(e,t,r),(e,t,r)=>Fv(e,t,r),(e,t,r)=>(_v(e,t,r),r),(e,t,r)=>$s(e,t)?Pf(e,t,r):r];function uN(e,t,r){return Fpe.reduce((n,o)=>o(e,t,n),r)}function pN(...e){return e.length===3?uN(e[0],e[1],e[2]):uN(e[0],[],e[1])}p();var Xa={};Ul(Xa,{Assert:()=>_v,Cast:()=>QP,Check:()=>Je,Clean:()=>kv,Clone:()=>St,Convert:()=>Fv,Create:()=>ii,Decode:()=>QR,Default:()=>Rv,Diff:()=>iN,Edit:()=>rN,Encode:()=>aN,Equal:()=>$u,Errors:()=>Fs,Hash:()=>cc,Mutate:()=>cN,Parse:()=>pN,Patch:()=>sN,ValueErrorIterator:()=>oi});p();p();var nT=class extends Ae{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));m(this,"schema");this.schema=r}};function Lpe(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new nT(e);return ju(r,t)}function Vv(e,t){return!ct.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}function ju(e,t){return e[W]==="This"||e[W]==="Ref"?Lpe(e,t):e}p();function Rpe(e,t,r){let n=e.get(t);if(n!==void 0)return n;let o=$s(t,r);return e.set(t,o),o}function zv(){let e=new WeakMap;return{HasTransform:(t,r)=>Rpe(e,t,r)}}function vr(e,t,r){try{return R.IsTransform(e)?e[nr].Decode(r):r}catch(n){throw new Nu(e,t,r,n)}}function Npe(e,t,r,n,o){return ct.IsArray(n)?vr(e,r,n.map((i,s)=>js(e.items,t,"".concat(r,"/").concat(s),i,o))):vr(e,r,n)}function Bpe(e,t,r,n,o){if(!ct.IsObject(n)||an(n))return vr(e,r,n);let i=sc(e),s=i.map(f=>f[0]),a={...n};for(let[f,h]of i)f in a&&(a[f]=js(h,t,"".concat(r,"/").concat(f),a[f],o));if(!R.IsTransform(e.unevaluatedProperties))return vr(e,r,a);let l=Object.getOwnPropertyNames(a),u=e.unevaluatedProperties,d={...a};for(let f of l)s.includes(f)||(d[f]=vr(u,"".concat(r,"/").concat(f),d[f]));return vr(e,r,d)}function $pe(e,t,r,n,o){return vr(e,r,js(e.not,t,r,n,o))}function jpe(e,t,r,n,o){if(!ct.IsObject(n))return vr(e,r,n);let i=Yr(e),s={...n};for(let d of i)ct.HasPropertyKey(s,d)&&(ct.IsUndefined(s[d])&&(!R.IsUndefined(e.properties[d])||Dt.IsExactOptionalProperty(s,d))||(s[d]=js(e.properties[d],t,"".concat(r,"/").concat(d),s[d],o)));if(!R.IsSchema(e.additionalProperties))return vr(e,r,s);let a=Object.getOwnPropertyNames(s),l=e.additionalProperties,u={...s};for(let d of a)i.includes(d)||(u[d]=vr(l,"".concat(r,"/").concat(d),u[d]));return vr(e,r,u)}function Gpe(e,t,r,n,o){if(!ct.IsObject(n))return vr(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),a={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(a[f]=js(e.patternProperties[i],t,"".concat(r,"/").concat(f),a[f],o));if(!R.IsSchema(e.additionalProperties))return vr(e,r,a);let l=Object.getOwnPropertyNames(a),u=e.additionalProperties,d={...a};for(let f of l)s.test(f)||(d[f]=vr(u,"".concat(r,"/").concat(f),d[f]));return vr(e,r,d)}function Upe(e,t,r,n,o){let i=ju(e,t);return vr(e,r,js(i,t,r,n,o))}function Vpe(e,t,r,n,o){let i=ju(e,t);return vr(e,r,js(i,t,r,n,o))}function zpe(e,t,r,n,o){return ct.IsArray(n)&&ct.IsArray(e.items)?vr(e,r,e.items.map((i,s)=>js(i,t,"".concat(r,"/").concat(s),n[s],o))):vr(e,r,n)}function Hpe(e,t,r,n,o){for(let i of e.anyOf){if(!Xa.Check(i,t,n))continue;let s=js(i,t,r,n,o);return vr(e,r,s)}return vr(e,r,n)}function js(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=Vv(e,t),s=e;switch(e[W]){case"Array":return Npe(s,i,r,n,o);case"Intersect":return Bpe(s,i,r,n,o);case"Not":return $pe(s,i,r,n,o);case"Object":return jpe(s,i,r,n,o);case"Record":return Gpe(s,i,r,n,o);case"Ref":return Upe(s,i,r,n,o);case"Symbol":return vr(s,r,n);case"This":return Vpe(s,i,r,n,o);case"Tuple":return zpe(s,i,r,n,o);case"Union":return Hpe(s,i,r,n,o);default:return vr(s,r,n)}}function dN(e,t,r){let n=zv();return js(e,t,"",r,n)}p();function An(e,t,r){try{return R.IsTransform(e)?e[nr].Encode(r):r}catch(n){throw new Bu(e,t,r,n)}}function Wpe(e,t,r,n,o){let i=An(e,r,n);return ct.IsArray(i)?i.map((s,a)=>Gs(e.items,t,"".concat(r,"/").concat(a),s,o)):i}function qpe(e,t,r,n,o){let i=An(e,r,n);if(!ct.IsObject(n)||an(n))return i;let s=sc(e),a=s.map(h=>h[0]),l={...i};for(let[h,b]of s)h in l&&(l[h]=Gs(b,t,"".concat(r,"/").concat(h),l[h],o));if(!R.IsTransform(e.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=e.unevaluatedProperties,f={...l};for(let h of u)a.includes(h)||(f[h]=An(d,"".concat(r,"/").concat(h),f[h]));return f}function Zpe(e,t,r,n){return An(e.not,r,An(e,r,n))}function Xpe(e,t,r,n,o){let i=An(e,r,n);if(!ct.IsObject(i))return i;let s=Yr(e),a={...i};for(let f of s)ct.HasPropertyKey(a,f)&&(ct.IsUndefined(a[f])&&(!R.IsUndefined(e.properties[f])||Dt.IsExactOptionalProperty(a,f))||(a[f]=Gs(e.properties[f],t,"".concat(r,"/").concat(f),a[f],o)));if(!R.IsSchema(e.additionalProperties))return a;let l=Object.getOwnPropertyNames(a),u=e.additionalProperties,d={...a};for(let f of l)s.includes(f)||(d[f]=An(u,"".concat(r,"/").concat(f),d[f]));return d}function Ype(e,t,r,n,o){let i=An(e,r,n);if(!ct.IsObject(n))return i;let s=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(s),l={...i};for(let h of Object.getOwnPropertyNames(n))a.test(h)&&(l[h]=Gs(e.patternProperties[s],t,"".concat(r,"/").concat(h),l[h],o));if(!R.IsSchema(e.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=e.additionalProperties,f={...l};for(let h of u)a.test(h)||(f[h]=An(d,"".concat(r,"/").concat(h),f[h]));return f}function Kpe(e,t,r,n,o){let i=ju(e,t),s=Gs(i,t,r,n,o);return An(e,r,s)}function Jpe(e,t,r,n,o){let i=ju(e,t),s=Gs(i,t,r,n,o);return An(e,r,s)}function Qpe(e,t,r,n,o){let i=An(e,r,n);return ct.IsArray(e.items)?e.items.map((s,a)=>Gs(s,t,"".concat(r,"/").concat(a),i[a],o)):[]}function ede(e,t,r,n,o){for(let i of e.anyOf){if(!Xa.Check(i,t,n))continue;let s=Gs(i,t,r,n,o);return An(e,r,s)}for(let i of e.anyOf){let s=Gs(i,t,r,n,o);if(Xa.Check(e,t,s))return An(e,r,s)}return An(e,r,n)}function Gs(e,t,r,n,o){if(!o.HasTransform(e,t))return n;let i=Vv(e,t),s=e;switch(e[W]){case"Array":return Wpe(s,i,r,n,o);case"Intersect":return qpe(s,i,r,n,o);case"Not":return Zpe(s,i,r,n);case"Object":return Xpe(s,i,r,n,o);case"Record":return Ype(s,i,r,n,o);case"Ref":return Kpe(s,i,r,n,o);case"This":return Jpe(s,i,r,n,o);case"Tuple":return Qpe(s,i,r,n,o);case"Union":return ede(s,i,r,n,o);default:return An(s,r,n)}}function fN(e,t,r){let n=zv();return Gs(e,t,"",r,n)}p();var oT=class{constructor(t,r,n,o){this.schema=t,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=$s(t,r)}Code(){return this.code}Errors(t){return Fs(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new Cf(this.schema,t,this.Errors(t).First());return this.hasTransform?Pf(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?Lv(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new Tf(this.schema,t,this.Errors(t).First());return r}},Ya;(function(e){function t(i){return i===36}e.DollarSign=t;function r(i){return i===95}e.IsUnderscore=r;function n(i){return i>=65&&i<=90||i>=97&&i<=122}e.IsAlpha=n;function o(i){return i>=48&&i<=57}e.IsNumeric=o})(Ya||(Ya={}));var Hv;(function(e){function t(i){return i.length===0?!1:Ya.IsNumeric(i.charCodeAt(0))}function r(i){if(t(i))return!1;for(let s=0;s<i.length;s++){let a=i.charCodeAt(s);if(!(Ya.IsAlpha(a)||Ya.IsNumeric(a)||Ya.DollarSign(a)||Ya.IsUnderscore(a)))return!1}return!0}function n(i){return i.replace(/'/g,"\\'")}function o(i,s){return r(s)?"".concat(i,".").concat(s):"".concat(i,"['").concat(n(s),"']")}e.Encode=o})(Hv||(Hv={}));var iT;(function(e){function t(r){let n=[];for(let o=0;o<r.length;o++){let i=r.charCodeAt(o);Ya.IsNumeric(i)||Ya.IsAlpha(i)?n.push(r.charAt(o)):n.push("_".concat(i,"_"))}return n.join("").replace(/__/g,"_")}e.Encode=t})(iT||(iT={}));var sT;(function(e){function t(r){return r.replace(/'/g,"\\'")}e.Escape=t})(sT||(sT={}));var aT=class extends Ae{constructor(t){super("Unknown type"),this.schema=t}},Wv=class extends Ae{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}},Gu;(function(e){function t(s,a,l){return Dt.ExactOptionalPropertyTypes?"('".concat(a,"' in ").concat(s," ? ").concat(l," : true)"):"(".concat(Hv.Encode(s,a)," !== undefined ? ").concat(l," : true)")}e.IsExactOptionalProperty=t;function r(s){return Dt.AllowArrayObject?"(typeof ".concat(s," === 'object' && ").concat(s," !== null)"):"(typeof ".concat(s," === 'object' && ").concat(s," !== null && !Array.isArray(").concat(s,"))")}e.IsObjectLike=r;function n(s){return Dt.AllowArrayObject?"(typeof ".concat(s," === 'object' && ").concat(s," !== null && !(").concat(s," instanceof Date) && !(").concat(s," instanceof Uint8Array))"):"(typeof ".concat(s," === 'object' && ").concat(s," !== null && !Array.isArray(").concat(s,") && !(").concat(s," instanceof Date) && !(").concat(s," instanceof Uint8Array))")}e.IsRecordLike=n;function o(s){return Dt.AllowNaN?"typeof ".concat(s," === 'number'"):"Number.isFinite(".concat(s,")")}e.IsNumberLike=o;function i(s){return Dt.AllowNullVoid?"(".concat(s," === undefined || ").concat(s," === null)"):"".concat(s," === undefined")}e.IsVoidLike=i})(Gu||(Gu={}));var qv;(function(e){function t(A){return A[W]==="Any"||A[W]==="Unknown"}function*r(A,Y,L){yield"true"}function*n(A,Y,L){yield"Array.isArray(".concat(L,")");let[le,ne]=[Ue("value","any"),Ue("acc","number")];we(A.maxItems)&&(yield"".concat(L,".length <= ").concat(A.maxItems)),we(A.minItems)&&(yield"".concat(L,".length >= ").concat(A.minItems));let ae=_e(A.items,Y,"value");if(yield"".concat(L,".every((").concat(le,") => ").concat(ae,")"),pt(A.contains)||we(A.minContains)||we(A.maxContains)){let ve=pt(A.contains)?A.contains:Rt(),cr=_e(ve,Y,"value"),jn=we(A.minContains)?["(count >= ".concat(A.minContains,")")]:[],rn=we(A.maxContains)?["(count <= ".concat(A.maxContains,")")]:[],xn="const count = value.reduce((".concat(ne,", ").concat(le,") => ").concat(cr," ? acc + 1 : acc, 0)"),uu=["(count > 0)",...jn,...rn].join(" && ");yield"((".concat(le,") => { ").concat(xn,"; return ").concat(uu,"})(").concat(L,")")}if(A.uniqueItems===!0){let cr="const set = new Set(); for(const element of value) { ".concat("const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true"," }");yield"((".concat(le,") => { ").concat(cr," )(").concat(L,")")}}function*o(A,Y,L){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(L,")")}function*i(A,Y,L){yield"(typeof ".concat(L," === 'bigint')"),sn(A.exclusiveMaximum)&&(yield"".concat(L," < BigInt(").concat(A.exclusiveMaximum,")")),sn(A.exclusiveMinimum)&&(yield"".concat(L," > BigInt(").concat(A.exclusiveMinimum,")")),sn(A.maximum)&&(yield"".concat(L," <= BigInt(").concat(A.maximum,")")),sn(A.minimum)&&(yield"".concat(L," >= BigInt(").concat(A.minimum,")")),sn(A.multipleOf)&&(yield"(".concat(L," % BigInt(").concat(A.multipleOf,")) === 0"))}function*s(A,Y,L){yield"(typeof ".concat(L," === 'boolean')")}function*a(A,Y,L){yield*be(A.returns,Y,"".concat(L,".prototype"))}function*l(A,Y,L){yield"(".concat(L," instanceof Date) && Number.isFinite(").concat(L,".getTime())"),we(A.exclusiveMaximumTimestamp)&&(yield"".concat(L,".getTime() < ").concat(A.exclusiveMaximumTimestamp)),we(A.exclusiveMinimumTimestamp)&&(yield"".concat(L,".getTime() > ").concat(A.exclusiveMinimumTimestamp)),we(A.maximumTimestamp)&&(yield"".concat(L,".getTime() <= ").concat(A.maximumTimestamp)),we(A.minimumTimestamp)&&(yield"".concat(L,".getTime() >= ").concat(A.minimumTimestamp)),we(A.multipleOfTimestamp)&&(yield"(".concat(L,".getTime() % ").concat(A.multipleOfTimestamp,") === 0"))}function*u(A,Y,L){yield"(typeof ".concat(L," === 'function')")}function*d(A,Y,L){yield"Number.isInteger(".concat(L,")"),we(A.exclusiveMaximum)&&(yield"".concat(L," < ").concat(A.exclusiveMaximum)),we(A.exclusiveMinimum)&&(yield"".concat(L," > ").concat(A.exclusiveMinimum)),we(A.maximum)&&(yield"".concat(L," <= ").concat(A.maximum)),we(A.minimum)&&(yield"".concat(L," >= ").concat(A.minimum)),we(A.multipleOf)&&(yield"(".concat(L," % ").concat(A.multipleOf,") === 0"))}function*f(A,Y,L){let le=A.allOf.map(ne=>_e(ne,Y,L)).join(" && ");if(A.unevaluatedProperties===!1){let ne=ot("".concat(new RegExp(Va(A)),";")),ae="Object.getOwnPropertyNames(".concat(L,").every(key => ").concat(ne,".test(key))");yield"(".concat(le," && ").concat(ae,")")}else if(pt(A.unevaluatedProperties)){let ne=ot("".concat(new RegExp(Va(A)),";")),ae="Object.getOwnPropertyNames(".concat(L,").every(key => ").concat(ne,".test(key) || ").concat(_e(A.unevaluatedProperties,Y,"".concat(L,"[key]")),")");yield"(".concat(le," && ").concat(ae,")")}else yield"(".concat(le,")")}function*h(A,Y,L){yield"(typeof value === 'object' && Symbol.iterator in ".concat(L,")")}function*b(A,Y,L){typeof A.const=="number"||typeof A.const=="boolean"?yield"(".concat(L," === ").concat(A.const,")"):yield"(".concat(L," === '").concat(sT.Escape(A.const),"')")}function*v(A,Y,L){yield"false"}function*I(A,Y,L){let le=_e(A.not,Y,L);yield"(!".concat(le,")")}function*x(A,Y,L){yield"(".concat(L," === null)")}function*C(A,Y,L){yield Gu.IsNumberLike(L),we(A.exclusiveMaximum)&&(yield"".concat(L," < ").concat(A.exclusiveMaximum)),we(A.exclusiveMinimum)&&(yield"".concat(L," > ").concat(A.exclusiveMinimum)),we(A.maximum)&&(yield"".concat(L," <= ").concat(A.maximum)),we(A.minimum)&&(yield"".concat(L," >= ").concat(A.minimum)),we(A.multipleOf)&&(yield"(".concat(L," % ").concat(A.multipleOf,") === 0"))}function*P(A,Y,L){yield Gu.IsObjectLike(L),we(A.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(L,").length >= ").concat(A.minProperties)),we(A.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(L,").length <= ").concat(A.maxProperties));let le=Object.getOwnPropertyNames(A.properties);for(let ne of le){let ae=Hv.Encode(L,ne),ve=A.properties[ne];if(A.required&&A.required.includes(ne))yield*be(ve,Y,ae),(Ha(ve)||t(ve))&&(yield"('".concat(ne,"' in ").concat(L,")"));else{let cr=_e(ve,Y,ae);yield Gu.IsExactOptionalProperty(L,ne,cr)}}if(A.additionalProperties===!1)if(A.required&&A.required.length===le.length)yield"Object.getOwnPropertyNames(".concat(L,").length === ").concat(le.length);else{let ne="[".concat(le.map(ae=>"'".concat(ae,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(L,").every(key => ").concat(ne,".includes(key))")}if(typeof A.additionalProperties=="object"){let ne=_e(A.additionalProperties,Y,"".concat(L,"[key]")),ae="[".concat(le.map(ve=>"'".concat(ve,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(L,").every(key => ").concat(ae,".includes(key) || ").concat(ne,"))")}}function*w(A,Y,L){yield"(typeof value === 'object' && typeof ".concat(L,".then === 'function')")}function*T(A,Y,L){yield Gu.IsRecordLike(L),we(A.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(L,").length >= ").concat(A.minProperties)),we(A.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(L,").length <= ").concat(A.maxProperties));let[le,ne]=Object.entries(A.patternProperties)[0],ae=ot("".concat(new RegExp(le))),ve=_e(ne,Y,"value"),cr=pt(A.additionalProperties)?_e(A.additionalProperties,Y,L):A.additionalProperties===!1?"false":"true",jn="(".concat(ae,".test(key) ? ").concat(ve," : ").concat(cr,")");yield"(Object.entries(".concat(L,").every(([key, value]) => ").concat(jn,"))")}function*O(A,Y,L){let le=It(A,Y);if(ue.functions.has(A.$ref))return yield"".concat(ht(A.$ref),"(").concat(L,")");yield*be(le,Y,L)}function*N(A,Y,L){let le=ot("".concat(new RegExp(A.source,A.flags),";"));yield"(typeof ".concat(L," === 'string')"),we(A.maxLength)&&(yield"".concat(L,".length <= ").concat(A.maxLength)),we(A.minLength)&&(yield"".concat(L,".length >= ").concat(A.minLength)),yield"".concat(le,".test(").concat(L,")")}function*k(A,Y,L){if(yield"(typeof ".concat(L," === 'string')"),we(A.maxLength)&&(yield"".concat(L,".length <= ").concat(A.maxLength)),we(A.minLength)&&(yield"".concat(L,".length >= ").concat(A.minLength)),A.pattern!==void 0){let le=ot("".concat(new RegExp(A.pattern),";"));yield"".concat(le,".test(").concat(L,")")}A.format!==void 0&&(yield"format('".concat(A.format,"', ").concat(L,")"))}function*D(A,Y,L){yield"(typeof ".concat(L," === 'symbol')")}function*F(A,Y,L){yield"(typeof ".concat(L," === 'string')");let le=ot("".concat(new RegExp(A.pattern),";"));yield"".concat(le,".test(").concat(L,")")}function*z(A,Y,L){yield"".concat(ht(A.$ref),"(").concat(L,")")}function*G(A,Y,L){if(yield"Array.isArray(".concat(L,")"),A.items===void 0)return yield"".concat(L,".length === 0");yield"(".concat(L,".length === ").concat(A.maxItems,")");for(let le=0;le<A.items.length;le++){let ne=_e(A.items[le],Y,"".concat(L,"[").concat(le,"]"));yield"".concat(ne)}}function*j(A,Y,L){yield"".concat(L," === undefined")}function*K(A,Y,L){let le=A.anyOf.map(ne=>_e(ne,Y,L));yield"(".concat(le.join(" || "),")")}function*Z(A,Y,L){yield"".concat(L," instanceof Uint8Array"),we(A.maxByteLength)&&(yield"(".concat(L,".length <= ").concat(A.maxByteLength,")")),we(A.minByteLength)&&(yield"(".concat(L,".length >= ").concat(A.minByteLength,")"))}function*oe(A,Y,L){yield"true"}function*Q(A,Y,L){yield Gu.IsVoidLike(L)}function*ye(A,Y,L){let le=ue.instances.size;ue.instances.set(le,A),yield"kind('".concat(A[W],"', ").concat(le,", ").concat(L,")")}function*be(A,Y,L,le=!0){let ne=ut(A.$id)?[...Y,A]:Y,ae=A;if(le&&ut(A.$id)){let ve=ht(A.$id);if(ue.functions.has(ve))return yield"".concat(ve,"(").concat(L,")");{let cr=Xe(ve,A,Y,"value",!1);return ue.functions.set(ve,cr),yield"".concat(ve,"(").concat(L,")")}}switch(ae[W]){case"Any":return yield*r(ae,ne,L);case"Array":return yield*n(ae,ne,L);case"AsyncIterator":return yield*o(ae,ne,L);case"BigInt":return yield*i(ae,ne,L);case"Boolean":return yield*s(ae,ne,L);case"Constructor":return yield*a(ae,ne,L);case"Date":return yield*l(ae,ne,L);case"Function":return yield*u(ae,ne,L);case"Integer":return yield*d(ae,ne,L);case"Intersect":return yield*f(ae,ne,L);case"Iterator":return yield*h(ae,ne,L);case"Literal":return yield*b(ae,ne,L);case"Never":return yield*v(ae,ne,L);case"Not":return yield*I(ae,ne,L);case"Null":return yield*x(ae,ne,L);case"Number":return yield*C(ae,ne,L);case"Object":return yield*P(ae,ne,L);case"Promise":return yield*w(ae,ne,L);case"Record":return yield*T(ae,ne,L);case"Ref":return yield*O(ae,ne,L);case"RegExp":return yield*N(ae,ne,L);case"String":return yield*k(ae,ne,L);case"Symbol":return yield*D(ae,ne,L);case"TemplateLiteral":return yield*F(ae,ne,L);case"This":return yield*z(ae,ne,L);case"Tuple":return yield*G(ae,ne,L);case"Undefined":return yield*j(ae,ne,L);case"Union":return yield*K(ae,ne,L);case"Uint8Array":return yield*Z(ae,ne,L);case"Unknown":return yield*oe(ae,ne,L);case"Void":return yield*Q(ae,ne,L);default:if(!jr.Has(ae[W]))throw new aT(A);return yield*ye(ae,ne,L)}}let ue={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function _e(A,Y,L,le=!0){return"(".concat([...be(A,Y,L,le)].join(" && "),")")}function ht(A){return"check_".concat(iT.Encode(A))}function ot(A){let Y="local_".concat(ue.variables.size);return ue.variables.set(Y,"const ".concat(Y," = ").concat(A)),Y}function Xe(A,Y,L,le,ne=!0){let[ae,ve]=["\n",xn=>"".padStart(xn," ")],cr=Ue("value","any"),jn=pe("boolean"),rn=[...be(Y,L,le,ne)].map(xn=>"".concat(ve(4)).concat(xn)).join(" &&".concat(ae));return"function ".concat(A,"(").concat(cr,")").concat(jn," {").concat(ae).concat(ve(2),"return (").concat(ae).concat(rn).concat(ae).concat(ve(2),")\n}")}function Ue(A,Y){let L=ue.language==="typescript"?": ".concat(Y):"";return"".concat(A).concat(L)}function pe(A){return ue.language==="typescript"?": ".concat(A):""}function me(A,Y,L){let le=Xe("check",A,Y,"value"),ne=Ue("value","any"),ae=pe("boolean"),ve=[...ue.functions.values()],cr=[...ue.variables.values()],jn=ut(A.$id)?"return function check(".concat(ne,")").concat(ae," {\n return ").concat(ht(A.$id),"(value)\n}"):"return ".concat(le);return[...cr,...ve,jn].join("\n")}function te(...A){let Y={language:"javascript"},[L,le,ne]=A.length===2&&Ge(A[1])?[A[0],A[1],Y]:A.length===2&&!Ge(A[1])?[A[0],[],A[1]]:A.length===3?[A[0],A[1],A[2]]:A.length===1?[A[0],[],Y]:[null,[],Y];if(ue.language=ne.language,ue.variables.clear(),ue.functions.clear(),ue.instances.clear(),!pt(L))throw new Wv(L);for(let ae of le)if(!pt(ae))throw new Wv(ae);return me(L,le,ne)}e.Code=te;function ie(A,Y=[]){let L=te(A,Y,{language:"javascript"}),le=globalThis.Function("kind","format","hash",L),ne=new Map(ue.instances);function ae(rn,xn,uu){if(!jr.Has(rn)||!ne.has(xn))return!1;let GS=jr.Get(rn),US=ne.get(xn);return GS(US,uu)}function ve(rn,xn){return Hn.Has(rn)?Hn.Get(rn)(xn):!1}function cr(rn){return cc(rn)}let jn=le(ae,ve,cr);return new oT(A,Y,jn,L)}e.Compile=ie})(qv||(qv={}));p();p();var mN={},tde=function(e,t,r,n,o){var i=new Worker(mN[t]||(mN[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return i.onmessage=function(s){var a=s.data,l=a.$e$;if(l){var u=new Error(l[0]);u.code=l[1],u.stack=l[2],o(u,null)}else o(null,a)},i.postMessage(r,n),i},Kt=Uint8Array,qn=Uint16Array,Fy=Int32Array,Ef=new Kt([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]),_f=new Kt([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]),ky=new Kt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bN=function(e,t){for(var r=new qn(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Fy(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},vN=bN(Ef,2),mT=vN.b,Jv=vN.r;mT[28]=258,Jv[258]=28;var xN=bN(_f,0),IN=xN.b,cT=xN.r,Dy=new qn(32768);for(kt=0;kt<32768;++kt)Ka=(kt&43690)>>1|(kt&21845)<<1,Ka=(Ka&52428)>>2|(Ka&13107)<<2,Ka=(Ka&61680)>>4|(Ka&3855)<<4,Dy[kt]=((Ka&65280)>>8|(Ka&255)<<8)>>1;var Ka,kt,li=function(e,t,r){for(var n=e.length,o=0,i=new qn(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new qn(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new qn(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var u=o<<4|e[o],d=t-e[o],f=s[e[o]-1]++<<d,h=f|(1<<d)-1;f<=h;++f)a[Dy[f]>>l]=u}else for(a=new qn(n),o=0;o<n;++o)e[o]&&(a[o]=Dy[s[e[o]-1]++]>>15-e[o]);return a},Ja=new Kt(288);for(kt=0;kt<144;++kt)Ja[kt]=8;var kt;for(kt=144;kt<256;++kt)Ja[kt]=9;var kt;for(kt=256;kt<280;++kt)Ja[kt]=7;var kt;for(kt=280;kt<288;++kt)Ja[kt]=8;var kt,Of=new Kt(32);for(kt=0;kt<32;++kt)Of[kt]=5;var kt,SN=li(Ja,9,0),CN=li(Ja,9,1),PN=li(Of,5,0),TN=li(Of,5,1),Xv=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ai=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},Yv=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},Ly=function(e){return(e+7)/8|0},Uu=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new Kt(e.subarray(t,r))},rx={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},wN=["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"],Lr=function(e,t,r){var n=new Error(t||wN[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Lr),!r)throw n;return n},MN=function(e,t,r,n){var o=e.length,i=n?n.length:0;if(!o||t.f&&!t.l)return r||new Kt(0);var s=!r,a=s||t.i!=2,l=t.i;s&&(r=new Kt(o*3));var u=function(L){var le=r.length;if(L>le){var ne=new Kt(Math.max(le*2,L));ne.set(r),r=ne}},d=t.f||0,f=t.p||0,h=t.b||0,b=t.l,v=t.d,I=t.m,x=t.n,C=o*8;do{if(!b){d=ai(e,f,1);var P=ai(e,f+1,3);if(f+=3,P)if(P==1)b=CN,v=TN,I=9,x=5;else if(P==2){var N=ai(e,f,31)+257,k=ai(e,f+10,15)+4,D=N+ai(e,f+5,31)+1;f+=14;for(var F=new Kt(D),z=new Kt(19),G=0;G<k;++G)z[ky[G]]=ai(e,f+G*3,7);f+=k*3;for(var j=Xv(z),K=(1<<j)-1,Z=li(z,j,1),G=0;G<D;){var oe=Z[ai(e,f,K)];f+=oe&15;var w=oe>>4;if(w<16)F[G++]=w;else{var Q=0,ye=0;for(w==16?(ye=3+ai(e,f,3),f+=2,Q=F[G-1]):w==17?(ye=3+ai(e,f,7),f+=3):w==18&&(ye=11+ai(e,f,127),f+=7);ye--;)F[G++]=Q}}var be=F.subarray(0,N),ue=F.subarray(N);I=Xv(be),x=Xv(ue),b=li(be,I,1),v=li(ue,x,1)}else Lr(1);else{var w=Ly(f)+4,T=e[w-4]|e[w-3]<<8,O=w+T;if(O>o){l&&Lr(0);break}a&&u(h+T),r.set(e.subarray(w,O),h),t.b=h+=T,t.p=f=O*8,t.f=d;continue}if(f>C){l&&Lr(0);break}}a&&u(h+131072);for(var _e=(1<<I)-1,ht=(1<<x)-1,ot=f;;ot=f){var Q=b[Yv(e,f)&_e],Xe=Q>>4;if(f+=Q&15,f>C){l&&Lr(0);break}if(Q||Lr(2),Xe<256)r[h++]=Xe;else if(Xe==256){ot=f,b=null;break}else{var Ue=Xe-254;if(Xe>264){var G=Xe-257,pe=Ef[G];Ue=ai(e,f,(1<<pe)-1)+mT[G],f+=pe}var me=v[Yv(e,f)&ht],te=me>>4;me||Lr(3),f+=me&15;var ue=IN[te];if(te>3){var pe=_f[te];ue+=Yv(e,f)&(1<<pe)-1,f+=pe}if(f>C){l&&Lr(0);break}a&&u(h+131072);var ie=h+Ue;if(h<ue){var A=i-ue,Y=Math.min(ue,ie);for(A+h<0&&Lr(3);h<Y;++h)r[h]=n[A+h]}for(;h<ie;++h)r[h]=r[h-ue]}}t.l=b,t.p=ot,t.b=h,t.f=d,b&&(d=1,t.m=I,t.d=v,t.n=x)}while(!d);return h!=r.length&&s?Uu(r,0,h):r.subarray(0,h)},Us=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},wf=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},Kv=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:yT,l:0};if(o==1){var s=new Kt(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(O,N){return O.f-N.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,d=1,f=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};d!=o-1;)a=r[r[u].f<r[f].f?u++:f++],l=r[u!=d&&r[u].f<r[f].f?u++:f++],r[d++]={s:-1,f:a.f+l.f,l:a,r:l};for(var h=i[0].s,n=1;n<o;++n)i[n].s>h&&(h=i[n].s);var b=new qn(h+1),v=Qv(r[d-1],b,0);if(v>t){var n=0,I=0,x=v-t,C=1<<x;for(i.sort(function(N,k){return b[k.s]-b[N.s]||N.f-k.f});n<o;++n){var P=i[n].s;if(b[P]>t)I+=C-(1<<v-b[P]),b[P]=t;else break}for(I>>=x;I>0;){var w=i[n].s;b[w]<t?I-=1<<t-b[w]++-1:++n}for(;n>=0&&I;--n){var T=i[n].s;b[T]==t&&(--b[T],++I)}v=t}return{t:new Kt(b),l:v}},Qv=function(e,t,r){return e.s==-1?Math.max(Qv(e.l,t,r+1),Qv(e.r,t,r+1)):t[e.s]=r},uT=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new qn(++t),n=0,o=e[0],i=1,s=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==o&&a!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[a]}return{c:r.subarray(0,n),n:t}},Mf=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},hT=function(e,t,r){var n=r.length,o=Ly(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},pT=function(e,t,r,n,o,i,s,a,l,u,d){Us(t,d++,r),++o[256];for(var f=Kv(o,15),h=f.t,b=f.l,v=Kv(i,15),I=v.t,x=v.l,C=uT(h),P=C.c,w=C.n,T=uT(I),O=T.c,N=T.n,k=new qn(19),D=0;D<P.length;++D)++k[P[D]&31];for(var D=0;D<O.length;++D)++k[O[D]&31];for(var F=Kv(k,7),z=F.t,G=F.l,j=19;j>4&&!z[ky[j-1]];--j);var K=u+5<<3,Z=Mf(o,Ja)+Mf(i,Of)+s,oe=Mf(o,h)+Mf(i,I)+s+14+3*j+Mf(k,z)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&K<=Z&&K<=oe)return hT(t,d,e.subarray(l,l+u));var Q,ye,be,ue;if(Us(t,d,1+(oe<Z)),d+=2,oe<Z){Q=li(h,b,0),ye=h,be=li(I,x,0),ue=I;var _e=li(z,G,0);Us(t,d,w-257),Us(t,d+5,N-1),Us(t,d+10,j-4),d+=14;for(var D=0;D<j;++D)Us(t,d+3*D,z[ky[D]]);d+=3*j;for(var ht=[P,O],ot=0;ot<2;++ot)for(var Xe=ht[ot],D=0;D<Xe.length;++D){var Ue=Xe[D]&31;Us(t,d,_e[Ue]),d+=z[Ue],Ue>15&&(Us(t,d,Xe[D]>>5&127),d+=Xe[D]>>12)}}else Q=SN,ye=Ja,be=PN,ue=Of;for(var D=0;D<a;++D){var pe=n[D];if(pe>255){var Ue=pe>>18&31;wf(t,d,Q[Ue+257]),d+=ye[Ue+257],Ue>7&&(Us(t,d,pe>>23&31),d+=Ef[Ue]);var me=pe&31;wf(t,d,be[me]),d+=ue[me],me>3&&(wf(t,d,pe>>5&8191),d+=_f[me])}else wf(t,d,Q[pe]),d+=ye[pe]}return wf(t,d,Q[256]),d+ye[256]},ON=new Fy([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),yT=new Kt(0),EN=function(e,t,r,n,o,i){var s=i.z||e.length,a=new Kt(n+s+5*(1+Math.ceil(s/7e3))+o),l=a.subarray(n,a.length-o),u=i.l,d=(i.r||0)&7;if(t){d&&(l[0]=i.r>>3);for(var f=ON[t-1],h=f>>13,b=f&8191,v=(1<<r)-1,I=i.p||new qn(32768),x=i.h||new qn(v+1),C=Math.ceil(r/3),P=2*C,w=function(ae){return(e[ae]^e[ae+1]<<C^e[ae+2]<<P)&v},T=new Fy(25e3),O=new qn(288),N=new qn(32),k=0,D=0,F=i.i||0,z=0,G=i.w||0,j=0;F+2<s;++F){var K=w(F),Z=F&32767,oe=x[K];if(I[Z]=oe,x[K]=Z,G<=F){var Q=s-F;if((k>7e3||z>24576)&&(Q>423||!u)){d=pT(e,l,0,T,O,N,D,z,j,F-j,d),z=k=D=0,j=F;for(var ye=0;ye<286;++ye)O[ye]=0;for(var ye=0;ye<30;++ye)N[ye]=0}var be=2,ue=0,_e=b,ht=Z-oe&32767;if(Q>2&&K==w(F-ht))for(var ot=Math.min(h,Q)-1,Xe=Math.min(32767,F),Ue=Math.min(258,Q);ht<=Xe&&--_e&&Z!=oe;){if(e[F+be]==e[F+be-ht]){for(var pe=0;pe<Ue&&e[F+pe]==e[F+pe-ht];++pe);if(pe>be){if(be=pe,ue=ht,pe>ot)break;for(var me=Math.min(ht,pe-2),te=0,ye=0;ye<me;++ye){var ie=F-ht+ye&32767,A=I[ie],Y=ie-A&32767;Y>te&&(te=Y,oe=ie)}}}Z=oe,oe=I[Z],ht+=Z-oe&32767}if(ue){T[z++]=268435456|Jv[be]<<18|cT[ue];var L=Jv[be]&31,le=cT[ue]&31;D+=Ef[L]+_f[le],++O[257+L],++N[le],G=F+be,++k}else T[z++]=e[F],++O[e[F]]}}for(F=Math.max(F,G);F<s;++F)T[z++]=e[F],++O[e[F]];d=pT(e,l,u,T,O,N,D,z,j,F-j,d),u||(i.r=d&7|l[d/8|0]<<3,d-=7,i.h=x,i.p=I,i.i=F,i.w=G)}else{for(var F=i.w||0;F<s+u;F+=65535){var ne=F+65535;ne>=s&&(l[d/8|0]=u,ne=s),d=hT(l,d+1,e.subarray(F,ne))}i.i=s}return Uu(a,0,n+Ly(d)+o)},rde=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e}(),nde=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=rde[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}};var _N=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new Kt(i.length+e.length);s.set(i),s.set(e,i.length),e=s,o.w=i.length}return EN(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)},gT=function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},hN=function(e,t,r){for(var n=e(),o=e.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<n.length;++s){var a=n[s],l=i[s];if(typeof a=="function"){t+=";"+l+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var d=u.indexOf(" ",8)+1;t+=u.slice(d,u.indexOf("(",d))}else{t+=u;for(var f in a.prototype)t+=";"+l+".prototype."+f+"="+a.prototype[f].toString()}else t+=u}else r[l]=a}return t},Zv=[],ode=function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},ide=function(e,t,r,n){if(!Zv[r]){for(var o="",i={},s=e.length-1,a=0;a<s;++a)o=hN(e[a],o,i);Zv[r]={c:hN(e[s],o,i),e:i}}var l=gT({},Zv[r].e);return tde(Zv[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,l,ode(l),n)},sde=function(){return[Kt,qn,Fy,Ef,_f,ky,mT,IN,CN,TN,Dy,wN,li,Xv,ai,Yv,Ly,Uu,Lr,MN,vT,nx,AN]},ade=function(){return[Kt,qn,Fy,Ef,_f,ky,Jv,cT,SN,Ja,PN,Of,Dy,ON,yT,li,Us,wf,Kv,Qv,uT,Mf,hT,pT,Ly,Uu,EN,_N,bT,nx]};var nx=function(e){return postMessage(e,[e.buffer])},AN=function(e){return e&&{out:e.size&&new Kt(e.size),dictionary:e.dictionary}},kN=function(e,t,r,n,o,i){var s=ide(r,n,o,function(a,l){s.terminate(),i(a,l)});return s.postMessage([e,t],t.consume?[e.buffer]:[]),function(){s.terminate()}};var Vs=function(e,t){return e[t]|e[t+1]<<8},Gi=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},lT=function(e,t){return Gi(e,t)+Gi(e,t+4)*4294967296},pn=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function lde(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Lr(7),kN(e,t,[ade],function(n){return nx(bT(n.data[0],n.data[1]))},0,r)}function bT(e,t){return _N(e,t||{},0,0)}function cde(e,t,r){return r||(r=t,t={}),typeof r!="function"&&Lr(7),kN(e,t,[sde],function(n){return nx(vT(n.data[0],AN(n.data[1])))},1,r)}function vT(e,t){return MN(e,{i:2},t&&t.out,t&&t.dictionary)}var DN=function(e,t,r,n){for(var o in e){var i=e[o],s=t+o,a=n;Array.isArray(i)&&(a=gT(n,i[1]),i=i[0]),i instanceof Kt?r[s]=[i,a]:(r[s+="/"]=[new Kt(0),a],DN(i,s,r,n))}},yN=typeof TextEncoder<"u"&&new TextEncoder,dT=typeof TextDecoder<"u"&&new TextDecoder,ude=0;try{dT.decode(yT,{stream:!0}),ude=1}catch{}var pde=function(e){for(var t="",r=0;;){var n=e[r++],o=(n>127)+(n>223)+(n>239);if(r+o>e.length)return{s:t,r:Uu(e,r-1)};o?o==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):o&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}};function ex(e,t){if(t){for(var r=new Kt(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(yN)return yN.encode(e);for(var o=e.length,i=new Kt(e.length+(e.length>>1)),s=0,a=function(d){i[s++]=d},n=0;n<o;++n){if(s+5>i.length){var l=new Kt(s+8+(o-n<<1));l.set(i),i=l}var u=e.charCodeAt(n);u<128||t?a(u):u<2048?(a(192|u>>6),a(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|e.charCodeAt(++n)&1023,a(240|u>>18),a(128|u>>12&63),a(128|u>>6&63),a(128|u&63)):(a(224|u>>12),a(128|u>>6&63),a(128|u&63))}return Uu(i,0,s)}function xT(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else{if(dT)return dT.decode(e);var o=pde(e),i=o.s,r=o.r;return r.length&&Lr(8),i}}var dde=function(e,t){return t+30+Vs(e,t+26)+Vs(e,t+28)},fde=function(e,t,r){var n=Vs(e,t+28),o=xT(e.subarray(t+46,t+46+n),!(Vs(e,t+8)&2048)),i=t+46+n,s=Gi(e,t+20),a=r&&s==4294967295?mde(e,i):[s,Gi(e,t+24),Gi(e,t+42)],l=a[0],u=a[1],d=a[2];return[Vs(e,t+10),l,u,o,i+Vs(e,t+30)+Vs(e,t+32),d]},mde=function(e,t){for(;Vs(e,t)!=1;t+=4+Vs(e,t+2));return[lT(e,t+12),lT(e,t+4),lT(e,t+20)]},fT=function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&Lr(9),t+=n+4}return t},gN=function(e,t,r,n,o,i,s,a){var l=n.length,u=r.extra,d=a&&a.length,f=fT(u);pn(e,t,s!=null?33639248:67324752),t+=4,s!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(i<0&&8),e[t++]=o&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var h=new Date(r.mtime==null?Date.now():r.mtime),b=h.getFullYear()-1980;if((b<0||b>119)&&Lr(10),pn(e,t,b<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),t+=4,i!=-1&&(pn(e,t,r.crc),pn(e,t+4,i<0?-i-2:i),pn(e,t+8,r.size)),pn(e,t+12,l),pn(e,t+14,f),t+=16,s!=null&&(pn(e,t,d),pn(e,t+6,r.attrs),pn(e,t+10,s),t+=14),e.set(n,t),t+=l,f)for(var v in u){var I=u[v],x=I.length;pn(e,t,+v),pn(e,t+2,x),e.set(I,t+4),t+=4+x}return d&&(e.set(a,t),t+=d),t},hde=function(e,t,r,n,o){pn(e,t,101010256),pn(e,t+8,r),pn(e,t+10,r),pn(e,t+12,n),pn(e,t+16,o)};function FN(e,t,r){r||(r=t,t={}),typeof r!="function"&&Lr(7);var n={};DN(e,"",n,t);var o=Object.keys(n),i=o.length,s=0,a=0,l=i,u=new Array(i),d=[],f=function(){for(var x=0;x<d.length;++x)d[x]()},h=function(x,C){tx(function(){r(x,C)})};tx(function(){h=r});var b=function(){var x=new Kt(a+22),C=s,P=a-s;a=0;for(var w=0;w<l;++w){var T=u[w];try{var O=T.c.length;gN(x,a,T,T.f,T.u,O);var N=30+T.f.length+fT(T.extra),k=a+N;x.set(T.c,k),gN(x,s,T,T.f,T.u,O,a,T.m),s+=16+N+(T.m?T.m.length:0),a=k+O}catch(D){return h(D,null)}}hde(x,s,u.length,P,C),h(null,x)};i||b();for(var v=function(x){var C=o[x],P=n[C],w=P[0],T=P[1],O=nde(),N=w.length;O.p(w);var k=ex(C),D=k.length,F=T.comment,z=F&&ex(F),G=z&&z.length,j=fT(T.extra),K=T.level==0?0:8,Z=function(oe,Q){if(oe)f(),h(oe,null);else{var ye=Q.length;u[x]=gT(T,{size:N,crc:O.d(),c:Q,f:k,m:z,u:D!=C.length||z&&F.length!=G,compression:K}),s+=30+D+j+ye,a+=76+2*(D+j)+(G||0)+ye,--i||b()}};if(D>65535&&Z(Lr(11,0,1),null),!K)Z(null,w);else if(N<16e4)try{Z(null,bT(w,T))}catch(oe){Z(oe,null)}else d.push(lde(w,T,Z))},I=0;I<l;++I)v(I);return f}var tx=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function LN(e,t,r){r||(r=t,t={}),typeof r!="function"&&Lr(7);var n=[],o=function(){for(var x=0;x<n.length;++x)n[x]()},i={},s=function(x,C){tx(function(){r(x,C)})};tx(function(){s=r});for(var a=e.length-22;Gi(e,a)!=101010256;--a)if(!a||e.length-a>65558)return s(Lr(13,0,1),null),o;var l=Vs(e,a+8);if(l){var u=l,d=Gi(e,a+16),f=d==4294967295||u==65535;if(f){var h=Gi(e,a-12);f=Gi(e,h)==101075792,f&&(u=l=Gi(e,h+32),d=Gi(e,h+48))}for(var b=t&&t.filter,v=function(x){var C=fde(e,d,f),P=C[0],w=C[1],T=C[2],O=C[3],N=C[4],k=C[5],D=dde(e,k);d=N;var F=function(G,j){G?(o(),s(G,null)):(j&&(i[O]=j),--l||s(null,i))};if(!b||b({name:O,size:w,originalSize:T,compression:P}))if(!P)F(null,Uu(e,D,D+w));else if(P==8){var z=e.subarray(D,D+w);if(T<524288||w>.8*T)try{F(null,vT(z,{out:new Kt(T)}))}catch(G){F(G,null)}else n.push(cde(z,{size:T},F))}else F(Lr(14,"unknown compression type "+P,1),null);else F(null,null)},I=0;I<u;++I)v(I)}else s(null,{});return o}p();var yde=e=>{if(e!=null)return e.trim()===""?void 0:e},gde=e=>e!=null,ox=(e,t,r=0)=>{var n;if(R.IsNull(e))return"null";if(R.IsUndefined(e))return"undefined";if(R.IsString(e))return"<string>";if(R.IsNumber(e))return"<number>";if(R.IsBoolean(e))return"<boolean>";if(R.IsLiteral(e))return typeof e.const=="string"?"'".concat(e.const,"'"):"".concat(e.const);if(R.IsRef(e)){let o=t.find(i=>i.$id===e.$ref);return o==null?e.$ref:ox(o,t,r)}if(R.IsArray(e))return"".concat(ox(e.items,t,r+1),"[]");if(R.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let i="".concat(e.anyOf.map(s=>ox(s,t,r+1)).filter(gde).join(" | "));return r>0?"(".concat(i,")"):i}return(n=e.$id)!=null?n:""},bde=(e,t,r)=>{var i;let n=t.message;R.IsUnion(t.schema)&&(n="Expected one of: ".concat(ox(t.schema,r)));let o="#/definitions/".concat(e).concat((i=yde(t.path))!=null?i:"");return"".concat(o,": ").concat(n)},ix=(e,t,r)=>{let n=t.First();if(n!=null)return bde(e,n,r)};var Af;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(Af||(Af={}));var kf=class extends Error{constructor(r,n){super(n);m(this,"name");m(this,"kind");this.name="CompressError",this.kind=r}},vde=e=>new kf(Af.Archive,e.message),xde=e=>{let t=Object.values(rx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},Ide=(e,t,r)=>{var n;return new kf(Af.Validate,(n=ix(e,t,r))!=null?n:"Unknown validate error")},Sde=e=>new kf(Af.Encode,e.message),Cde=e=>new kf(Af.Unknown,e instanceof Error?e.message:String(e)),IT=(e,t,r)=>t instanceof Bu?Sde(t):t instanceof oi?Ide(e,t,r):xde(t)?vde(t):Cde(t);p();var Df;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})(Df||(Df={}));var Ff=class extends Error{constructor(r,n){super(n);m(this,"name");m(this,"kind");this.name="DecompressError",this.kind=r}},Pde=e=>new Ff(Df.Unarchive,e.message),Tde=e=>{let t=Object.values(rx);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},wde=(e,t,r)=>{var n;return new Ff(Df.Validate,(n=ix(e,t,r))!=null?n:"Unknown validate error")},Mde=e=>new Ff(Df.Decode,e.message),Ode=e=>new Ff(Df.Unknown,e instanceof Error?e.message:String(e)),ST=(e,t,r)=>t instanceof Nu?Mde(t):t instanceof oi?wde(e,t,r):Tde(t)?Pde(t):Ode(t);p();p();p();var Ede=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,_de=[0,31,28,31,30,31,30,31,31,30,31,30,31],Ade=e=>e%4===0&&(e%100!==0||e%400===0),sx=e=>{let t=Ede.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&Ade(r)?29:_de[n])};p();var kde=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,ax=e=>{let t=kde.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3],i=t[4],s=t[5]==="-"?-1:1,a=+(t[6]||0),l=+(t[7]||0);if(a>23||l>59||!i)return!1;if(r<=23&&n<=59&&o<60)return!0;let u=n-l*s,d=r-a*s-(u<0?1:0);return(d===23||d===-1)&&(u===59||u===-1)&&o<61};var Dde=/t|\s/i,RN=e=>{let t=e.split(Dde);return t.length===2&&sx(t[0])&&ax(t[1])};p();var Fde=/\/|:/,Lde=/^(?:[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,NN=e=>Fde.test(e)&&Lde.test(e);var Rde=[["date",sx],["time",ax],["date-time",RN],["uri",NN]],BN=()=>{for(let[e,t]of Rde)try{Ov.Format(e,t)}catch(r){if(r instanceof Oy)continue;throw r}};p();p();p();var $N=e=>e instanceof Error?e:new Error(String(e));var lx=e=>(...t)=>{try{return fe(e(...t))}catch(r){return ge($N(r))}};var Nde=lx((e,t)=>{let r={};for(let n of t)for(let o of n.intoBundle(e))r[o.path]=ex(JSON.stringify(o.contents));return r}),CT=async(e,t,r)=>Nde(e,t).andThenAsync(n=>new Promise(o=>{FN(n,{...r,consume:!0},(i,s)=>{o(i?ge(i):fe(s))})}));p();p();function cx(e,t,r=[]){let n={...e};for(let[o,i]of Object.entries(t))if(i!==void 0)if(o in n){let s=o;if(Array.isArray(i)&&i.length>0){let a=Bde(i[0],r);if(a){let l=n[s];if(!Array.isArray(l))throw new Error("Expected array at ".concat(o,", got ").concat(typeof l));let u=new Map(i.map(h=>[jN(h,a),h])),f=l.map(h=>{let b=u.get(jN(h,a));return b?cx(h,b,r):h});n[s]=f}else n[s]=i}else{let a=n[s];typeof a=="object"&&a!==null&&typeof i=="object"&&i!==null?Object.keys(i).length===0?n[s]=i:n[s]=cx(a,i,r):n[o]=i}}else n[o]=i;return n}function Bde(e,t){function r(n){if(typeof n!="object"||n===null)return null;for(let o of t)if(o in n&&typeof n[o]<"u")return[o];if(Array.isArray(n))return null;for(let[o,i]of Object.entries(n)){let s=r(i);if(s)return[o,...s]}return null}return r(e)}function jN(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}var $de=e=>e,jde=e=>JSON.parse(xT(e)),Gde=(e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,$de)!==void 0),Ude=lx((e,t)=>{let r={};for(let n of Object.keys(e)){let o=e[n];for(let i of t){let s=i.fromBundle(n,o,jde);if(s){r=cx(r,s,[]);break}}}return r}),PT=async(e,t)=>new Promise(r=>LN(e,{filter:n=>Gde(n,t)},(n,o)=>{r(n?ge(n):fe(o))})).then(r=>r.andThen(n=>Ude(n,t)));p();var Vde=e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string",zde=e=>{if(e.length<2)return!1;let t=e.filter(Vde);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},ux=e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&zde(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,ux(r)])):Array.isArray(e)?e.map(ux):e;p();var px=e=>typeof e=="object"&&e!=null&&"$ref"in e?{...e,$ref:"#/definitions/".concat(e.$ref)}:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,px(r)])):Array.isArray(e)?e.map(px):e;var Lf;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(Lf||(Lf={}));var Hde=e=>({next(){for(let r of e){let n=r.next();if(!n.done)return n}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),Wde=(...e)=>{let t=new Map;for(let r of Hde(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return ge({kind:Lf.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:r});t.set(r.$id,r)}return fe(t)},ci,Vu,Qa,Ui,TT=class TT{constructor(t,r,n,o){M(this,ci);M(this,Vu);M(this,Qa,[]);M(this,Ui);_(this,ci,t),_(this,Vu,r),_(this,Qa,n),_(this,Ui,o),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(t,r="CoreMVF"){let n=S.Composite(t.extensions.map(i=>i.schema),{$id:r});if(!R.IsSchema(n))return ge({kind:Lf.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let o=Wde(jP.values(),DP.values(),LP.values(),NP.values(),BP.values(),zP.values(),t.extensions.flatMap(i=>{var s;return(s=i.references)!=null?s:[]}).values());if(!o.isOk())return o;try{BN();let i=qv.Compile(n,[...o.value.values()]);return fe(new TT(n,i,t.extensions,o.value))}catch(i){return i instanceof Ae?ge({kind:Lf.TypeboxError,message:i.message,original:i}):ge({kind:Lf.UnknownError,message:"An unknown error occurred while compiling the schema",original:i})}}is(t){return c(this,Vu).Check(t)}parse(t){return c(this,Vu).Check(t)?fe(t):ge(c(this,Vu).Errors(t))}decode(t){try{return fe(dN(c(this,ci),[...c(this,Ui).values()],t))}catch(r){return ge(r)}}encode(t){try{return fe(fN(c(this,ci),[...c(this,Ui).values()],t))}catch(r){return ge(r)}}verify(t){for(let r of c(this,Qa))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return ge(n.error)}return fe(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([c(this,ci),...c(this,Ui).values()])),r=ux(px({$id:"#/definitions/".concat((n=c(this,ci).$id)!=null?n:"CoreMVF"),$schema:"http://json-schema.org/draft-07/schema#",references:t}));return JSON.stringify(r,null,2)}async compress(t){return this.encode(t).andThen(r=>this.parse(r)).andThenAsync(r=>CT(r,c(this,Qa))).then(r=>r.mapErr(n=>{var o;return IT((o=c(this,ci).$id)!=null?o:"CoreMVF",n,[...c(this,Ui).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>CT(r,c(this,Qa))).then(r=>r.mapErr(n=>{var o;return IT((o=c(this,ci).$id)!=null?o:"CoreMVF",n,[...c(this,Ui).values()])}))}async decompress(t){return PT(t,c(this,Qa)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var o;return ST((o=c(this,ci).$id)!=null?o:"CoreMVF",n,[...c(this,Ui).values()])}))}async decompressUnsafe(t){return PT(t,c(this,Qa)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var o;return ST((o=c(this,ci).$id)!=null?o:"CoreMVF",n,[...c(this,Ui).values()])}))}};ci=new WeakMap,Vu=new WeakMap,Qa=new WeakMap,Ui=new WeakMap;var dx=TT;var Rf,fx=class{constructor(){M(this,Rf,[]);this.extend=this.extend.bind(this)}extend(t){return c(this,Rf).push(t),this}extendOptional(t){let r={...t,schema:S.Partial(t.schema)};return c(this,Rf).push(r),this}build(){return dx.create(this)}get extensions(){return c(this,Rf)}};Rf=new WeakMap;var GN=()=>new fx().extend(wR).extend(kR).extend(RR);var zu=ur("lcat","LocationCategoryId"),wT=S.Intersect([S.Object({id:S.Ref(zu),parent:S.Optional(S.Ref(zu))}),Fu(["name"]),ji],{$id:"LocationCategory"}),UN=[zu,wT];p();p();var Hu;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(Hu||(Hu={}));var VN=e=>{var o,i,s,a,l,u,d,f,h;if(e.locationCategories==null&&e.locations==null)return fe(!0);let t=new Set((i=(o=e.locationCategories)==null?void 0:o.map(b=>b.id))!=null?i:[]);for(let b of(s=e.locationCategories)!=null?s:[])if(b.parent!=null&&!t.has(b.parent))return ge({kind:Hu.UnknownParentCategoryError,properties:{categoryId:b.id,parentCategoryId:b.parent}});let r=Gr(e);for(let b of(a=e.locations)!=null?a:[]){for(let v of b.categories)if(!t.has(v))return ge({kind:Hu.UnknownCategoryError,properties:{locationId:b.id,categoryId:v}});for(let v of b.geometryAnchors){let I=r(v.floorId,v.geometryId);if(I.isErr())return I}}let n=new Set((u=(l=e.locations)==null?void 0:l.map(b=>b.id))!=null?u:[]);for(let b of(d=e.locationInstances)!=null?d:[]){if(!n.has(b.parentId))return ge({kind:Hu.UnknownParentLocationError,properties:{locationInstanceId:b.id,parentLocationId:b.parentId}});for(let v of(f=b.categories)!=null?f:[])if(!t.has(v))return ge({kind:Hu.UnknownCategoryError,properties:{locationId:b.id,categoryId:v}});for(let v of(h=b.geometryAnchors)!=null?h:[]){let I=r(v.floorId,v.geometryId);if(I.isErr())return I}}return fe(!0)};p();var Wu=ur("loc","LocationId"),mx=ur("loci","LocationInstanceId"),zN=S.Object({name:S.String(),url:S.String({format:"uri"})},{$id:"LocationSocial"}),HN=S.Object({url:S.String({format:"uri"})},{$id:"LocationImage"}),MT=S.Object({label:S.String(),url:S.String({format:"uri"})},{$id:"LocationLink"}),OT=S.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),WN=S.Union([S.Literal("Sunday"),S.Literal("Monday"),S.Literal("Tuesday"),S.Literal("Wednesday"),S.Literal("Thursday"),S.Literal("Friday"),S.Literal("Saturday")],{$id:"OpeningHoursDay"}),qde="PublicHolidays",ET=S.Union([WN,S.Literal(qde)],{$id:"OpeningHoursDayOrPublicHoliday"}),hx=S.Object({"@type":S.Optional(S.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:S.Optional(S.Ref(OT,{description:"The time the opening hours start"})),closes:S.Optional(S.Ref(OT,{description:"The time the opening hours end"})),dayOfWeek:S.Optional(S.Union([S.Ref(ET),S.Array(S.Ref(ET))],{description:"The days of the week the opening hours apply to"})),validFrom:S.Optional(S.String({format:"date-time",description:"The date the opening hours start, in ISO 8601 format"})),validTo:S.Optional(S.String({format:"date-time",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),yx=S.Intersect([S.Object({id:S.Ref(Wu),categories:S.Array(S.Ref(zu)),logo:S.Optional(S.String({format:"uri"})),phone:S.Optional(S.String()),social:S.Array(S.Ref(zN)),images:S.Array(S.Ref(HN)),links:S.Array(S.Ref(MT)),website:S.Optional(S.Ref(MT)),openingHours:S.Optional(S.Array(S.Ref(hx)))}),Fu(["name"]),Lu(),ji],{$id:"Location"}),_T=S.Intersect([S.Object({id:S.Ref(mx),parentId:S.Ref(Wu)}),S.Partial(S.Omit(yx,["id","parentId"]))],{$id:"LocationInstance"}),gx=[Wu,mx,zN,HN,MT,OT,WN,ET,hx,yx,_T];var Zde=S.Object({locations:S.Array(S.Ref(yx)),locationCategories:S.Array(S.Ref(wT)),locationInstances:S.Optional(S.Array(S.Ref(_T)))},{$id:"LocationsExtensionSchema"}),qN="locations.json",ZN="location-categories.json",XN="location-instances.json",YN={name:"ext:locations",schema:Zde,intoBundle:function*(e){e.locations!=null&&(yield{path:qN,contents:e.locations}),e.locationCategories!=null&&(yield{path:ZN,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:XN,contents:e.locationInstances})},fromBundle:(e,t,r)=>{if(e===qN)return{locations:r(t)};if(e===ZN)return{locationCategories:r(t)};if(e===XN)return{locationInstances:r(t)}},references:[...UN,...gx],integrityCheck:VN};p();p();var zs;(function(e){e.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(zs||(zs={}));var KN=e=>{var l,u,d,f,h,b,v,I,x,C,P,w,T,O,N,k,D,F,z,G;if(e.enterprise==null)return fe(!0);let t=e.enterprise,r=new Set((u=(l=e.locationCategories)==null?void 0:l.map(j=>j.id))!=null?u:[]);for(let j of(d=t.categories)!=null?d:[])if(!r.has(j.categoryId))return ge({kind:zs.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:j.id,locationCategoryId:j.categoryId}});let n=new Set((h=(f=e.locations)==null?void 0:f.map(j=>j.id))!=null?h:[]);for(let j of(b=t.locations)!=null?b:[]){if(!n.has(j.locationId))return ge({kind:zs.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:j.id,locationId:j.locationId}});for(let K of(v=j.siblingGroups)!=null?v:[])for(let Z of(I=K.siblings)!=null?I:[])if(!n.has(Z))return ge({kind:zs.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:j.id,siblingLocationId:Z,label:K.label}})}let o=new Set((C=(x=e.enterprise.locations)==null?void 0:x.map(j=>j.id))!=null?C:[]);if(((P=t.venue)==null?void 0:P.topLocations)!=null){for(let j of t.venue.topLocations)if(!o.has(j))return ge({kind:zs.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:j}})}let i=new Set((T=(w=e.locationInstances)==null?void 0:w.map(j=>j.id))!=null?T:[]);for(let j of(O=t.locationInstances)!=null?O:[]){if(!o.has(j.parentId))return ge({kind:zs.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:j.id,enterpriseLocationId:j.parentId}});if(!i.has(j.locationInstanceId))return ge({kind:zs.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:j.id,locationInstanceId:j.locationInstanceId}});for(let K of(N=j.siblingGroups)!=null?N:[])for(let Z of(k=K.siblings)!=null?k:[])if(!n.has(Z))return ge({kind:zs.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:j.id,siblingLocationId:Z,label:K.label}})}let s=Wa(e),a=Gr(e);for(let[j,K]of xt((D=t.floorText)!=null?D:{})){let Z=s(j);if(Z.isErr())return Z;for(let oe of K.features){if(!("geometryId"in oe.properties))continue;let Q=a(j,oe.properties.geometryId);if(Q.isErr())return Q}}for(let[j,K]of xt((F=t.textures)!=null?F:{})){let Z=s(j);if(Z.isErr())return Z;for(let oe of K){let Q=a(j,oe.geometryId);if(Q.isErr())return Q}}for(let[j,K]of xt((z=t.layers)!=null?z:{})){let Z=s(j);if(Z.isErr())return Z;for(let oe of ft(K!=null?K:{})){let Q=a(j,oe);if(Q.isErr())return Q}}for(let[j,K]of xt((G=t.textAreas)!=null?G:{})){let Z=s(j);if(Z.isErr())return Z;for(let oe of K.features)if("geometryId"in oe.properties){let Q=a(j,oe.properties.geometryId);if(Q.isErr())return Q}}return fe(!0)};p();p();var qu=ur("el","EnterpriseLocationId"),AT=ur("ec","EnterpriseCategoryId"),kT=ur("eli","EnterpriseLocationInstanceId"),DT=ur("ev","EnterpriseVenueId"),FT=ur("eft","EnterpriseFloorTextId"),JN=[qu,AT,kT,DT,FT];var QN=S.Object({id:S.Ref(AT),categoryId:S.Ref(zu),color:S.Optional(S.String()),sortOrder:S.Number(),iconFromDefaultList:S.Optional(S.Union([S.String(),S.Null()])),picture:S.Optional(S.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),LT=S.Object({categories:S.Optional(S.Array(S.Ref(QN)))},{$id:"EnterpriseCategoriesSchema"}),eB=[QN,LT];p();var tB=ho(["left","center","right"]),Xde=tB.schema,JHe=tB.values,RT=S.Object({id:S.Ref(FT),text:S.String(),visible:S.Boolean({default:!0}),fontSize:S.Number({default:12,minimum:1}),fontFamily:S.String({default:"Droid Sans"}),color:S.String({default:"black"}),rotation:S.Number({minimum:0,maximum:360}),align:Xde},{$id:"FloorTextCommonProperties"}),NT=S.Intersect([S.Ref(RT),ri],{$id:"AnchoredFloorTextProperties"}),BT=S.Intersect([S.Ref(RT),S.Object({verticalOffset:S.Number()})],{$id:"FloatingFloorTextProperties"}),rB=S.Union([S.Ref(NT),S.Ref(BT)],{$id:"FloorTextProperties"}),nB=ln(On,S.Ref(rB),{$id:"FloorTextFeature"}),Yde=ln(On,S.Ref(NT),{$id:"AnchoredFloorTextFeature"}),Kde=ln(On,S.Ref(BT),{$id:"FloatingFloorTextFeature"}),oB=Wn(S.Ref(nB),{$id:"EnterpriseFloorTextFeatureCollection"}),iB=S.Record(vt,S.Ref(oB),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),$T=S.Object({floorText:S.Optional(S.Ref(iB))},{$id:"EnterpriseFloorTextSchema"}),sB=[RT,NT,BT,rB,nB,Yde,Kde,oB,iB,$T];p();var aB=Pr(S.Record(Mn,S.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),lB=Pr(S.Record(vt,S.Ref(aB),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),jT=S.Object({layers:S.Optional(S.Ref(lB))},{$id:"EnterpriseLayersSchema"}),cB=[aB,lB,jT];p();p();p();var GT=ho(["closed-temporarily","new","pop-up","coming-soon","relocated"]),Jde=GT.schema,cWe=GT.values,uWe=GT.record,UT=S.Object({type:Jde,start:S.Optional(S.String({format:"date",description:"The start date of the state"})),end:S.Optional(S.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),VT=S.Object({label:S.String(),siblings:S.Array(S.Ref(Wu))},{$id:"SiblingGroup"}),bx=S.Object({name:S.String(),code:S.String()},{$id:"Language"}),uB=[UT,VT,bx];var vx=S.Object({id:S.Ref(qu),locationId:S.Ref(Wu),type:S.String(),sortOrder:S.Number(),tags:S.Optional(S.Array(S.String())),picture:S.Optional(S.String({format:"uri",description:"The picture of the location"})),states:S.Optional(S.Array(S.Ref(UT),{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:S.Optional(S.Array(S.Ref(VT))),gallery:S.Optional(S.Array(S.Object({caption:S.Optional(S.String()),image:S.String({format:"uri"}),embeddedUrl:S.Optional(S.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:S.Optional(S.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:S.Optional(S.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:S.Optional(S.Boolean({description:"Whether to show the logo of the location"}))},{$id:"EnterpriseLocation"}),zT=S.Object({locations:S.Optional(S.Array(S.Ref(vx)))},{$id:"EnterpriseLocationsSchema"}),pB=[vx,zT];var dB=S.Intersect([S.Object({id:S.Ref(kT),parentId:S.Ref(qu),locationInstanceId:S.Ref(mx)}),S.Partial(S.Omit(vx,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),HT=S.Object({locationInstances:S.Optional(S.Array(S.Ref(dB)))},{$id:"EnterpriseLocationInstancesSchema"}),fB=[dB,HT];p();var WT=ho(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),mB=WT.schema,EWe=WT.values,_We=WT.record,qT=S.Object({maxWidth:S.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:S.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:S.Ref(mB),rotation:S.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),hB=S.Intersect([S.Ref(qT),ri],{$id:"EnterpriseAnchoredTextAreaProperties"}),yB=S.Intersect([S.Ref(qT),S.Object({verticalOffset:S.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),gB=S.Union([hB,yB],{$id:"EnterpriseTextAreaProperties"}),bB=ln(S.Ref(On),gB,{$id:"EnterpriseTextAreaFeature"}),vB=Wn(S.Ref(bB),{$id:"EnterpriseTextAreaCollection"}),xB=S.Record(vt,S.Ref(vB),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),IB=S.Object({textAreas:S.Optional(S.Ref(xB))},{$id:"EnterpriseTextAreasSchema"}),SB=[mB,qT,hB,yB,gB,bB,vB,xB];p();var ZT=S.Object({u:S.Number(),v:S.Number()},{$id:"EnterpriseTextureUV"}),XT=ho(["top","side"],{$id:"EnterpriseTextureFace"}),CB=XT.schema,LWe=XT.values,RWe=XT.record,YT=ho(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),PB=YT.schema,NWe=YT.values,BWe=YT.record,TB=S.Tuple([yf,gf,yf,gf],{$id:"EnterpriseTextureBounds"}),wB=S.Intersect([S.Object({repeat:S.Ref(ZT),offset:S.Ref(ZT),rotation:S.Number({minimum:0,maximum:360}),path:S.String({format:"uri"}),face:S.Ref(CB),surface:S.Ref(PB),bounds:S.Ref(TB)},{$id:"EnterpriseTextureProperties"}),ri],{$id:"EnterpriseTexture"}),MB=S.Array(S.Ref(wB),{$id:"EnterpriseTextures"}),OB=S.Record(vt,S.Ref(MB),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),KT=S.Object({textures:S.Optional(S.Ref(OB))},{$id:"EnterpriseTexturesSchema"}),EB=[wB,MB,KT,ZT,CB,PB,TB,OB];p();var _B=S.Intersect([S.Object({id:S.Ref(DT),slug:S.String(),defaultLanguage:S.Ref(bx),languages:S.Array(S.Ref(bx)),countrycode:S.Optional(S.String()),logo:S.Optional(S.String({format:"uri"})),mappedinWebUrl:S.Optional(S.String({format:"uri"})),topLocations:S.Optional(S.Array(S.Ref(qu))),operationHours:S.Optional(S.Array(S.Ref(hx))),coverImage:S.Optional(S.String({format:"uri"}))}),Fu(["name"]),ji],{$id:"EnterpriseVenue"}),JT=S.Object({venue:S.Optional(S.Ref(_B))},{$id:"EnterpriseVenueSchema"}),AB=[_B,JT];var DB=S.Intersect([JT,zT,HT,LT,KT,$T,jT,IB],{$id:"EnterpriseProperties"}),kB=S.Object({enterprise:S.Optional(S.Ref(DB))},{$id:"CMSExtensionSchema"}),Qde=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,FB={name:"ext:cms",schema:kB,intoBundle:function*(e){var r,n,o,i,s,a;if(e.enterprise==null)return;let t=e.enterprise;for(let l of ft(t))switch(l){case"floorText":for(let u of ft((r=t.floorText)!=null?r:{}))yield{path:"enterprise/floorText/".concat(u,".geojson"),contents:((n=t.floorText)!=null?n:{})[u]};continue;case"textures":for(let u of ft((o=t.textures)!=null?o:{}))yield{path:"enterprise/textures/".concat(u,".json"),contents:((i=t.textures)!=null?i:{})[u]};continue;case"textAreas":for(let u of ft((s=t.textAreas)!=null?s:{}))yield{path:"enterprise/textAreas/".concat(u,".geojson"),contents:((a=t.textAreas)!=null?a:{})[u]};continue;default:yield{path:"enterprise/".concat(l,".json"),contents:t[l]};continue}},fromBundle:(e,t,r)=>{let n=e.match(Qde);if(!n)return;let[,o,i]=n,s=r(t);switch(o){case"floorText":case"textures":case"textAreas":return{enterprise:{[o]:{[i]:s}}};default:return{enterprise:{[i]:s}}}},references:[DB,kB,...AB,...pB,...fB,...eB,...EB,...cB,...sB,...SB,...JN,...uB,...gx],integrityCheck:KN};p();p();p();p();var Vi;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Vi||(Vi={}));var LB=e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return fe(!0);let r=Object.entries(t).map(([i,s])=>({key:i,...s})).sort((i,s)=>i.index!==s.index?i.index-s.index:i.bit-s.bit),n=0,o=-1;for(let i of r){if(i.bit===o)return ge({kind:Vi.NavigationFlagDuplicateBit,properties:{index:i.index,bit:i.bit,path:"navigationFlags.".concat(i.key)}});if(i.index!=n){if(o!=31)return ge({kind:Vi.NavigationFlagMissingDeclaration,properties:{index:n,bit:o+1,path:"navigationFlags"}});if(i.index!=n+1||i.bit!=0)return ge({kind:Vi.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=i.index,o=0}else{if(i.bit!==o+1)return ge({kind:Vi.NavigationFlagMissingDeclaration,properties:{index:i.index,bit:o+1,path:"navigationFlags"}});o=i.bit}}return fe(!0)};p();function Nf(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}p();var RB=2**32-1,Ry=e=>{var o;let t=Object.keys((o=e.navigationFlags)!=null?o:{}).length;if(t===0)return{index:-1,flag:0};let r=Math.floor(t/32),n=t%32;return{index:r,flag:2**n-1}},Bf=(e,t,r)=>{if(t.index==-1&&e.length===0)return fe(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return ge({kind:Vi.NavigationFlagIncorrectFlagsLength,properties:{expected:n,actual:e.length,path:r}});for(let o=0;o<e.length;o++){let i=e[o];if(o<t.index){if(i>RB)return ge({kind:Vi.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:RB,path:r}});continue}else if(i>t.flag)return ge({kind:Vi.NavigationFlagValueTooBig,properties:{index:o,flagValue:i,expectedMaxFlagValue:t.flag,path:r}})}return fe(!0)};var efe=S.Object({index:S.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:S.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),NB=S.Intersect([efe,$i],{$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.'}),QT={accessible:"accessible",outdoors:"outdoors"},BB=S.Record(S.String(),NB,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),tfe=S.Object({navigationFlags:S.Ref(BB)},{$id:"NavigationFlagsSchema"}),xx=S.Array(S.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),ew=S.Object({flags:S.Ref(xx)},{$id:"WithFlags"}),Zu=S.Intersect([hf,ew],{$id:"FlaggedGeometryAnchor"}),rfe=S.Object({geometryAnchor:Zu},{$id:"WithFlaggedGeometryAnchor"}),nfe=S.Object({geometryAnchors:S.Array(Zu)},{$id:"WithFlaggedGeometryAnchors"}),$B={name:"ext:mvf-navigation-flags",schema:tfe,intoBundle:function*(e){e.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:e.navigationFlags})},fromBundle:(e,t,r)=>e!=="navigationFlags.json"?void 0:{navigationFlags:r(t)},references:[NB,BB,xx,Zu,rfe,nfe],integrityCheck:LB};p();var jB=e=>{if(e.connections==null)return fe(!0);let t=Gr(e),r=Ry(e);for(let[n,o]of e.connections.entries()){for(let[i,s]of o.entrances.entries()){let a=t(s.floorId,s.geometryId);if(a.isErr())return a;let l=Bf(s.flags,r,"connections[".concat(n,"].entrances[").concat(i,"]"));if(l.isErr())return l}for(let[i,s]of o.exits.entries()){let a=t(s.floorId,s.geometryId);if(a.isErr())return a;let l=Bf(s.flags,r,"connections[".concat(n,"].exits[").concat(i,"]"));if(l.isErr())return l}}return fe(!0)};var UB=ur("c","ConnectionId"),{schema:ofe,values:$qe,record:ife}=ho(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),VB=ofe;var tw=ife,zB=S.Intersect([S.Object({id:S.Ref(UB,{description:"The unique identifier for the connection."}),entrances:S.Array(S.Ref(Zu)),exits:S.Array(S.Ref(Zu)),entryCost:S.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:S.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:S.Ref(VB,{description:"The type of connection."})}),$i,ji],{$id:"ConnectionsProperties"}),HB=S.Array(S.Ref(zB),{$id:"ConnectionsCollection"}),sfe=S.Object({connections:S.Ref(HB)},{$id:"ConnectionsExtensionSchema"}),GB="connections.json",WB={name:"ext:connections",schema:sfe,intoBundle:function*(e){e.connections!=null&&(yield{path:GB,contents:e.connections})},fromBundle:(e,t,r)=>{if(e===GB)return{connections:r(t)}},references:[zB,HB,VB,UB,Zu,xx],integrityCheck:jB};p();p();var qB=e=>{if(e.defaultStyle==null)return fe(!0);let t=Gr(e);for(let r of Object.values(e.defaultStyle))if(r!=null)for(let n of r.geometryAnchors){let o=t(n.floorId,n.geometryId);if(o.isErr())return o}return fe(!0)};var ZB=S.Intersect([Lu(),ji,S.Object({altitude:S.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:S.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:S.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:S.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:S.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:S.Optional(S.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),XB=S.Record(S.String(),S.Ref(ZB),{$id:"DefaultStyleCollection",additionalProperties:!1}),afe=S.Object({defaultStyle:S.Ref(XB)},{$id:"DefaultStyleSchema"}),YB={name:"ext:mvf-default-style",schema:afe,intoBundle:function*(e){e.defaultStyle!=null&&(yield{path:"default-style.json",contents:e.defaultStyle})},fromBundle:(e,t,r)=>{if(e==="default-style.json")return{defaultStyle:r(t)}},references:[ZB,XB],integrityCheck:qB};p();p();p();p();var Ix;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(Ix||(Ix={}));var KB=e=>{if(e.floorStacks==null)return fe(!0);let t=Wa(e);for(let r of e.floorStacks){for(let n of r.floors){let o=t(n);if(o.isErr())return o}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return ge({kind:Ix.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return fe(!0)};var Sx=ur("fs","FloorStackId"),QB=S.Intersect([S.Object({id:S.Ref(Sx,{description:"The unique identifier for the floor stack."}),floors:S.Array(S.Ref(vt),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:S.Optional(S.Ref(vt,{description:"The default floor for the floor stack."}))}),$i],{$id:"FloorStacksProperties"}),e$=S.Array(S.Ref(QB),{$id:"FloorStackCollection"}),lfe=S.Object({floorStacks:S.Ref(e$)},{$id:"FloorStackExtensionSchema"}),JB="floor-stacks.json",t$={name:"ext:floor-stacks",schema:lfe,intoBundle:function*(e){e.floorStacks!=null&&(yield{path:JB,contents:e.floorStacks})},fromBundle:(e,t,r)=>{if(e===JB)return{floorStacks:r(t)}},references:[Sx,QB,e$],integrityCheck:KB};p();p();var Ny;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(Ny||(Ny={}));var r$=e=>{if(e.facade==null)return fe(!0);if(e.floorStacks==null)return ge({kind:Ny.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(n=>n.id)),r=Gr(e);for(let[n,o]of xt(e.facade))if(o!=null){if(!t.has(n))return ge({kind:Ny.UnknownFloorStackError,properties:{floorStackId:n}});for(let i of o.geometryAnchors){let s=r(i.floorId,i.geometryId);if(s.isErr())return s}}return fe(!0)};var n$=ur("fc","FacadeId"),o$=S.Intersect([S.Object({id:S.Ref(n$)}),Lu({minItems:1})],{$id:"FacadeProperties"}),cfe=S.Object({facade:Pr(S.Record(Sx,S.Ref(o$),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),ufe=/^facade\/(.*)\.json$/,i$={name:"ext:facade",schema:cfe,intoBundle:function*(e){if(e.facade!=null)for(let t of ft(e.facade))yield{path:"facade/".concat(t,".json"),contents:e.facade[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(ufe))==null?void 0:o[1];if(n)return{facade:{[n]:r(t)}}},references:[n$,o$],integrityCheck:r$};p();p();var s$=e=>{if(e.floorImages==null)return fe(!0);let t=Gr(e);for(let[r,n]of xt(e.floorImages))if(n!=null)for(let o of n.features){if(!("geometryId"in o.properties))continue;let i=o.properties.geometryId,s=t(r,i);if(s.isErr())return s}return fe(!0)};var rw=S.Object({path:S.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:S.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:S.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:S.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),a$=S.Intersect([S.Ref(rw),ri],{$id:"AnchoredFloorImageProperties"}),l$=S.Intersect([S.Ref(rw),S.Object({verticalOffset:S.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),c$=S.Union([a$,l$],{$id:"FloorImageProperties"}),u$=ln(S.Ref(On),c$,{$id:"FloorImageFeature"}),p$=Wn(S.Ref(u$),{$id:"FloorImageCollection"}),pfe=S.Object({floorImages:Pr(S.Record(vt,S.Ref(p$),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),dfe=/^floorImages\/(.*)\.geojson$/,d$={name:"ext:floor-images",schema:pfe,intoBundle:function*(e){if(e.floorImages!=null)for(let t of ft(e.floorImages))yield{path:"floorImages/".concat(t,".geojson"),contents:e.floorImages[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(dfe))==null?void 0:o[1];if(n)return{floorImages:{[n]:r(t)}}},references:[rw,a$,l$,c$,u$,p$],integrityCheck:s$};p();p();var f$=e=>{if(e.kinds==null)return fe(!0);let t=Gr(e);for(let[r,n]of xt(e.kinds))if(n!=null)for(let o of ft(n)){let i=t(r,o);if(i.isErr())return i}return fe(!0)};var{values:XZe,schema:ffe,record:YZe}=ho(["room","hallway","wall","desk","poi","area","window"],{$id:"Kind"}),m$=ffe;var h$=Pr(S.Record(Mn,S.Ref(m$),{additionalProperties:!1,$id:"GeometryKinds"})),mfe=S.Object({kinds:Pr(S.Record(vt,S.Ref(h$),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),hfe=/^kinds\/(.*)\.json$/,y$={name:"ext:kinds",schema:mfe,intoBundle:function*(e){if(e.kinds!=null)for(let t of ft(e.kinds))yield{path:"kinds/".concat(t,".json"),contents:e.kinds[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(hfe))==null?void 0:o[1];if(n)return{kinds:{[n]:r(t)}}},references:[m$,h$],integrityCheck:f$};p();p();p();var Cx;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(Cx||(Cx={}));var g$=e=>{if(e.nodes==null)return fe(!0);let t=Gr(e),r=Ry(e);for(let[n,o]of xt(e.nodes)){if(o==null)continue;let i=new Set(o.features.map(s=>s.properties.id));for(let[s,a]of o.features.entries()){for(let l of a.properties.geometryIds){let u=t(n,l);if(u.isErr())return u}for(let[l,u]of a.properties.neighbors.entries()){if(!i.has(u.id))return ge({kind:Cx.UnknownNeighbor,properties:{floorId:n,nodeId:a.properties.id,neighborId:u.id}});let d=Bf(u.flags,r,'nodes["'.concat(n,'"].features[').concat(s,"].properties.neighbors[").concat(l,"]"));if(d.isErr())return d}}}return fe(!0)};var nw=ur("n","NodeId"),b$=S.Intersect([S.Object({id:S.Ref(nw,{description:"The unique identifier for the node."}),extraCost:S.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),ew],{$id:"NodeNeighbor"}),v$=S.Intersect([S.Object({id:S.Ref(nw,{description:"The unique identifier for the node."}),neighbors:S.Array(S.Ref(b$),{description:"The neighbors of the node."})}),Mv],{$id:"NodeProperties"}),x$=ln(S.Ref(On),v$,{$id:"NodeFeature"}),I$=Wn(S.Ref(x$),{$id:"NodeCollection"}),yfe=S.Object({nodes:Pr(S.Record(vt,S.Ref(I$),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),gfe=/^nodes\/(.*)\.json$/,S$={name:"ext:nodes",schema:yfe,intoBundle:function*(e){if(e.nodes!=null)for(let t of ft(e.nodes))yield{path:"nodes/".concat(t,".json"),contents:e.nodes[t]}},fromBundle:(e,t,r)=>{var o;let n=(o=e.match(gfe))==null?void 0:o[1];if(n)return{nodes:{[n]:r(t)}}},references:[nw,b$,v$,x$,I$],integrityCheck:g$};p();p();p();var Px;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(Px||(Px={}));var C$=e=>{if(e.outdoors==null)return fe(!0);let t=Wa(e);for(let r of e.outdoors.floors){let n=t(r);if(n.isErr())return n;if(e.floorStacks!=null){for(let o of e.floorStacks)if(o.floors.includes(r))return ge({kind:Px.FloorInFloorStackError,properties:{floorId:r,floorStackId:o.id}})}}return fe(!0)};var T$=S.Object({floors:S.Array(S.Ref(vt),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),bfe=S.Object({outdoors:S.Ref(T$)},{$id:"OutdoorsExtensionSchema"}),P$="outdoors.json",w$={name:"ext:outdoors",schema:bfe,intoBundle:function*(e){e.outdoors!=null&&(yield{path:P$,contents:e.outdoors})},fromBundle:(e,t,r)=>{if(e===P$)return{outdoors:r(t)}},references:[T$],integrityCheck:C$};p();p();p();var Tx;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(Tx||(Tx={}));var M$=e=>{if(e.tileset==null)return fe(!0);let t=new Set;if(t.add(e.tileset.default.key),e.tileset.others)for(let r of e.tileset.others){if(t.has(r.key))return ge({kind:Tx.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return fe(!0)};var ow=S.Object({key:S.String({minLength:1,description:"Unique identifier for the tileset style."}),name:S.String({minLength:1,description:"Display name of the tileset style."}),url:S.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),O$=S.Object({default:S.Ref(ow,{description:"The default tileset style, which should be used."}),others:S.Optional(S.Array(S.Ref(ow,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),vfe=S.Object({tileset:S.Ref(O$)},{$id:"TilesetExtensionSchema"}),E$={name:"ext:mvf-tileset",schema:vfe,intoBundle:function*(e){e.tileset!=null&&(yield{path:"tileset.json",contents:e.tileset})},fromBundle:(e,t,r)=>{if(e==="tileset.json")return{tileset:r(t)}},references:[ow,O$],integrityCheck:M$};p();var _$=S.Object({},{$id:"WalkableProperties"}),A$=S.Object({},{$id:"NonWalkableProperties"}),k$=Pr(S.Record(Mn,S.Ref(_$),{$id:"WalkableGeometries",additionalProperties:!1})),D$=Pr(S.Record(Mn,S.Ref(A$),{$id:"NonWalkableGeometries",additionalProperties:!1})),xfe=S.Object({walkable:Pr(S.Record(vt,S.Ref(k$),{additionalProperties:!1})),nonwalkable:Pr(S.Record(vt,S.Ref(D$),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),Ife=/^walkable\/(.*)\.json$/,Sfe=/^nonwalkable\/(.*)\.json$/,F$={name:"ext:mvf-traversability",schema:xfe,intoBundle:function*(e){if(e.walkable!=null)for(let t of ft(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of ft(e.nonwalkable))yield{path:"nonwalkable/".concat(t,".json"),contents:e.nonwalkable[t]}},fromBundle:(e,t,r)=>{var i,s;let n=(i=e.match(Ife))==null?void 0:i[1];if(n!=null)return{walkable:{[n]:r(t)}};let o=(s=e.match(Sfe))==null?void 0:s[1];if(o!=null)return{nonwalkable:{[o]:r(t)}}},references:[_$,A$,k$,D$]};p();p();function L$(e){return e.replace(/^g_/,"s_")}function Cfe(e){return e.replace(/^g_/,"o_")}function Pfe(e){return e.replace(/^g_/,"w_")}function Tfe(e){return e.replace(/^g_/,"ar_")}function wfe(e,t,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],o=0,i=e.geometry.type.replace("Multi","");for(let s of e.geometry.coordinates)n.push({...e,geometry:{type:i,coordinates:s},properties:{...e.properties,id:"".concat(t,"-").concat(o++),kind:r}});return n}default:return[{...e,properties:{...e.properties,id:t,kind:r}}]}}function By(e,t,r,n){let o=new Map;for(let{feature:i,floorId:s}of e){let a=i.properties.id,l=n.get(a);if(t.has(a)){let u=wfe(i,r(a),l),d=u.map(h=>h.properties.id),f=d.map(h=>({geometryId:h,floorId:s}));o.set(a,{ids:d,features:u,anchors:f})}}return o}function R$(e){var l,u,d;let t={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!e.geometry)return t;let r=new Map(Object.values((l=e.kinds)!=null?l:{}).filter(f=>f!==void 0).flatMap(xt)),n=xt(e.geometry).flatMap(([f,h])=>{var b;return((b=h==null?void 0:h.features)!=null?b:[]).map(v=>({feature:v,floorId:f}))}).flat(),o=new Set(Object.values((u=e.walkable)!=null?u:{}).filter(f=>f!==void 0).flatMap(ft)),i=new Set(Object.values((d=e.nonwalkable)!=null?d:{}).filter(f=>f!==void 0).flatMap(ft)),s=new Set(Array.from(r.entries()).filter(([f,h])=>h==="area").map(([f])=>f)),a=new Set(Array.from(r.entries()).filter(([f,h])=>h==="window").map(([f])=>f));return o.size>0&&(t.space=By(n,o,L$,r)),i.size>0&&(t.obstruction=By(n,i,Cfe,r)),s.size>0&&(t.area=By(n,s,Tfe,r)),a.size>0&&(t.window=By(n,a,Pfe,r)),o.size===0&&i.size===0&&s.size===0&&(t.space=By(n,new Set(n.map(f=>f.feature.properties.id)),L$,r)),t}function N$(e){let t=Mfe(e),r=R$(e),n=Ofe(e);return{geometryMaps:r,nodesByGeometryId:t,geometryFeatureById:n}}function Mfe(e){var r,n,o;let t=new Map;for(let i of Object.values((r=e.nodes)!=null?r:{}))for(let s of(n=i==null?void 0:i.features)!=null?n:[])if(s.properties.geometryIds.length>0)for(let a of s.properties.geometryIds){let l=(o=t.get(a))!=null?o:[];l.push(s.properties.id),t.set(a,l)}return t}function Ofe(e){var r,n;let t=new Map;for(let o of Object.values((r=e.geometry)!=null?r:{}))for(let i of(n=o==null?void 0:o.features)!=null?n:[])t.set(i.properties.id,i);return t}p();function B$(e,t){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let r={};for(let[n,o]of xt(e.annotations)){if(!o||o.length===0||!e.geometry[n]||e.geometry[n].features.length===0)continue;let i=new Map(e.geometry[n].features.map(a=>[a.properties.id,a])),s={type:"FeatureCollection",features:[]};for(let a of o){let l=i.get(a.geometryId);if(!l||l.geometry.type!=="Point")continue;let u={id:a.id,externalId:a.externalId,symbolId:a.symbolKey};s.features.push({type:"Feature",geometry:l.geometry,properties:u})}r[n]=s}return{annotation:r}}p();function $$(e,{nodesByGeometryId:t}){var s,a,l,u,d,f,h;let r={"connection.json":[],entrance:{}},n=(s=e.navigationFlags)==null?void 0:s[QT.accessible],o=(a=e.navigationFlags)==null?void 0:a[QT.outdoors],i=new Map(Object.values((l=e.geometry)!=null?l:{}).flatMap(b=>{var v;return(v=b==null?void 0:b.features)!=null?v:[]}).map(b=>[b.properties.id,b]));for(let b of(u=e.connections)!=null?u:[]){if(iw(b,i)){let C=Efe(b,i,t,o);for(let[P,w]of C)r.entrance[P]||(r.entrance[P]={type:"FeatureCollection",features:[]}),r.entrance[P].features.push(w);continue}let v=n!=null&&b.entrances.every(C=>Nf(C,n))&&b.exits.every(C=>Nf(C,n)),I=Array.from(new Set([...b.entrances.map(C=>t.get(C.geometryId)),...b.exits.map(C=>t.get(C.geometryId))].flat().filter(C=>C!=null))),x={id:b.id,externalId:(f=(d=b.details)==null?void 0:d.externalId)!=null?f:"",type:b.type,accessible:v,nodes:I};(h=b.details)!=null&&h.name&&(x.details={name:b.details.name}),b.extra&&(x.extra=b.extra),r["connection.json"].push(x)}return r}function iw(e,t){return e.type==tw.door&&e.entrances.every(r=>{let n=t.get(r.geometryId);return(n==null?void 0:n.geometry.type)==="LineString"})}function Efe(e,t,r,n){var i,s;if(e.type!==tw.door)return[];let o=[];for(let a of e.entrances){let l=t.get(a.geometryId);if((l==null?void 0:l.geometry.type)==="LineString"){let u={type:"Feature",geometry:l.geometry,properties:{id:e.id,externalId:(s=(i=e.details)==null?void 0:i.externalId)!=null?s:"",isExterior:_fe(e,n)}},d=e.details;d&&(u.properties.details={name:d.name,description:d.description},d.icon&&(u.properties.details.images=[{url:d.icon,altText:"".concat(d.name," icon")}]));let f=r.get(a.geometryId);f&&f.length>0&&(u.properties.node=f[0]),o.push([a.floorId,u])}}return o}function _fe(e,t){return e.entrances.some(r=>Nf(r,t))||e.exits.some(r=>Nf(r,t))}p();function G$(e,{geometryMaps:t,nodesByGeometryId:r}){var P,w,T,O,N,k,D,F,z,G,j,K,Z,oe,Q,ye,be,ue,_e,ht,ot,Xe,Ue;if(!e.enterprise)return{};let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"",code:""},languages:[]}},o=(P=e.manifest)==null?void 0:P.features[0];if(o&&(n.venue.defaultFloor=o.properties.defaultFloor,n.venue.tzid=o.properties.tzid,n.venue.name=o.properties.name),e.enterprise.venue){let pe=e.enterprise.venue;n.venue={...n.venue,slug:pe.slug,name:(w=pe.details.name)!=null?w:n.venue.name,externalId:(T=pe.details.externalId)!=null?T:"",defaultLanguage:pe.defaultLanguage,languages:pe.languages,countrycode:pe.countrycode,coverImage:pe.coverImage,logo:pe.logo,icon:pe.details.icon,extra:pe.extra,mappedinWebUrl:pe.mappedinWebUrl,operationHours:pe.operationHours,topLocations:pe.topLocations}}let i=new Map,s=new Map,a=e.locations,l=e.enterprise.locations;if(a&&l){let pe=new Map(a.map(me=>[me.id,me]));for(let me of l){let te=pe.get(me.locationId);if(te){let ie=te.details,A={id:me.id,name:ie.name,externalId:(O=ie.externalId)!=null?O:"",type:me.type,sortOrder:me.sortOrder,amenity:me.amenity,description:ie.description,extra:te.extra,links:te.links,operationHours:te.openingHours,gallery:me.gallery,logo:te.logo,shortName:ie.shortName,picture:me.picture,showFloatingLabelWhenImagePresent:me.showFloatingLabelWhenImagePresent,showLogo:me.showLogo,siblingGroups:me.siblingGroups,states:me.states,tags:me.tags,spaces:[],nodes:[],polygons:[]};te.phone&&(A.phone={number:te.phone});let Y=j$(te.social);te.website&&(Y.website=te.website.url),A.social=Y;for(let L of te.geometryAnchors){let le=t.space.get(L.geometryId);if(le){let ae=new Set(le.features.filter(ve=>ve.geometry.type==="Polygon").map(ve=>ve.properties.id));for(let ve of le.anchors)A.spaces.push({floor:ve.floorId,id:ve.geometryId}),ae.has(ve.geometryId)&&A.polygons.push({map:ve.floorId,id:ve.geometryId})}let ne=r.get(L.geometryId);for(let ae of ne!=null?ne:[])A.nodes.push({map:L.floorId,id:ae})}n.locations.push(A);for(let L of te.categories)i.set(L,[...(N=i.get(L))!=null?N:[],me.id]);s.set(me.id,te.categories)}}}let u=e.enterprise.locationInstances,d=e.locationInstances;if(u&&d){let pe=new Map(d.map(te=>[te.id,te])),me=[];for(let te of u){let ie=pe.get(te.locationInstanceId);if(ie){let A={id:te.id,parent:te.parentId,name:(k=ie.details)==null?void 0:k.name,externalId:(D=ie.details)==null?void 0:D.externalId,type:te.type,sortOrder:te.sortOrder,amenity:te.amenity,description:(F=ie.details)==null?void 0:F.description,extra:ie.extra,links:ie.links,operationHours:ie.openingHours,gallery:te.gallery,picture:te.picture,showFloatingLabelWhenImagePresent:te.showFloatingLabelWhenImagePresent,showLogo:te.showLogo,siblingGroups:te.siblingGroups,states:te.states,tags:te.tags,logo:ie.logo,shortName:(z=ie.details)==null?void 0:z.shortName};ie.phone&&(A.phone={number:ie.phone});let Y=j$((G=ie.social)!=null?G:[]);if(ie.website&&(Y.website=ie.website.url),Object.keys(Y).length>0&&(A.social=Y),(j=ie.geometryAnchors)!=null&&j.length){let L=ie.geometryAnchors.flatMap(le=>{var ne,ae;return(ae=(ne=t.space.get(le.geometryId))==null?void 0:ne.anchors)!=null?ae:[]});L.length>0&&(A.spaces=L.map(le=>({floor:le.floorId,id:le.geometryId})))}if(ie.geometryAnchors){A.spaces=[],A.polygons=[],A.nodes=[];for(let L of ie.geometryAnchors){let le=t.space.get(L.geometryId);if(le){let ae=new Set(le.features.filter(ve=>ve.geometry.type==="Polygon").map(ve=>ve.properties.id));for(let ve of le.anchors)A.spaces.push({floor:ve.floorId,id:ve.geometryId}),ae.has(ve.geometryId)&&A.polygons.push({map:ve.floorId,id:ve.geometryId})}let ne=r.get(L.geometryId);for(let ae of ne!=null?ne:[])A.nodes.push({map:L.floorId,id:ae})}}me.push(A)}}me.length>0&&(n.locationInstances=me)}let f=e.locationCategories,h=e.enterprise.categories;if(f&&h){let pe=[],me=new Map(f.map(Y=>[Y.id,Y])),te=new Map(h.map(Y=>[Y.categoryId,Y.id])),ie=new Map;for(let Y of f){let L=te.get(Y.parent);if(L){let le=(K=ie.get(L))!=null?K:[];le.push(Y.id),ie.set(L,le)}}for(let Y of h){let L=me.get(Y.categoryId);if(L){let ne=((Z=ie.get(Y.id))!=null?Z:[]).map(ve=>te.get(ve)).filter(ve=>ve!==void 0),ae={id:Y.id,name:L.details.name,externalId:(oe=L.details.externalId)!=null?oe:"",sortOrder:Y.sortOrder,children:ne,locations:(Q=i.get(Y.categoryId))!=null?Q:[],icon:L.details.icon,picture:Y.picture,color:Y.color,extra:L.extra,iconFromDefaultList:Y.iconFromDefaultList};pe.push(ae)}}n.categories=pe;let A={};for(let[Y,L]of s.entries())A[Y]=L.map(le=>te.get(le)).filter(le=>le!==void 0);n.categoryPriorities=A}let b={};for(let[pe,me]of Object.entries((ye=e.defaultStyle)!=null?ye:{}))if(me.buffer>0){let te=me.geometryAnchors.flatMap(ie=>{var A,Y;return(Y=(A=t.space.get(ie.geometryId))==null?void 0:A.anchors)!=null?Y:[]});b[pe]={edgeOffset:me.buffer,geometryAnchors:te}}Object.keys(b).length>0&&(n.enterpriseStyles=b);let v=new Map;for(let pe of Object.values((be=e.enterprise.layers)!=null?be:{}))if(pe)for(let[me,te]of xt(pe)){if(typeof te!="string")continue;let ie=(ue=v.get(te))!=null?ue:{name:te,id:"ely_".concat(te),spaces:[]};ie.spaces.push(...(ht=(_e=t.space.get(me))==null?void 0:_e.anchors.map(A=>({floorId:A.floorId,spaceId:A.geometryId})))!=null?ht:[]),v.set(te,ie)}v.size>0&&(n.layers=Array.from(v.values()));let I=[];for(let pe of Object.values((ot=e.enterprise.textures)!=null?ot:{}))for(let me of pe){let te=(Xe=t.space.get(me.geometryId))==null?void 0:Xe.anchors;!te||te.length<1||me.face==="unknown"||me.surface==="unknown"||I.push({repeat:me.repeat,offset:me.offset,rotation:me.rotation,path:me.path,face:me.face,surface:me.surface,bounds:me.bounds,geometryAnchors:te})}I.length>0&&(n.textures=I);let x={};for(let[pe,me]of Object.entries((Ue=e.enterprise.floorText)!=null?Ue:{})){let te={type:"FeatureCollection",features:[]};for(let ie of me.features){if(ie.properties.align==="unknown")continue;let A={align:ie.properties.align,color:ie.properties.color,fontFamily:ie.properties.fontFamily,fontSize:ie.properties.fontSize,rotation:ie.properties.rotation,text:ie.properties.text,visible:ie.properties.visible};"geometryId"in ie.properties?A.geometryId=ie.properties.geometryId:A.verticalOffset=ie.properties.verticalOffset,te.features.push({type:"Feature",geometry:ie.geometry,properties:A})}te.features.length>0&&(x[pe]=te)}Object.keys(x).length>0&&(n.floorText=x);let C={enterprise:n};if(e.enterprise.textAreas){let pe={};for(let[me,te]of xt(e.enterprise.textAreas)){let ie={type:"FeatureCollection",features:[]};for(let A of te.features){if(A.properties.align==="unknown")continue;let Y={align:A.properties.align,maxWidth:A.properties.maxWidth,maxHeight:A.properties.maxHeight,rotation:A.properties.rotation};"geometryId"in A.properties?Y.anchorId=A.properties.geometryId:Y.verticalOffset=A.properties.verticalOffset;let L={type:"Feature",geometry:A.geometry,properties:Y};ie.features.push(L)}pe[me]=ie}C.textAreas=pe}return C}var Afe=["facebook","instagram","twitter"];function j$(e){let t={};for(let{name:r,url:n}of e){let o=r.toLowerCase();Afe.includes(o)&&(t[o]=n)}return t}p();function U$(e,{geometryMaps:t}){if(!e.facade)return{};let r={},n={};for(let[o,i]of xt(e.facade))i&&(n[o]={id:i.id,spaces:i.geometryAnchors.flatMap(({floorId:s,geometryId:a})=>{var l;return(l=t.space.get(a))==null?void 0:l.ids.map(u=>({floorId:s,spaceId:u}))}).filter(s=>s!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}p();function V$(e,t={}){var o,i,s,a,l,u,d,f,h,b,v,I;let r={type:"FeatureCollection",features:[]},n=[];for(let x of e.floors.features)n.push({id:x.properties.id.replace(/^f_/,"m_"),externalId:(i=(o=x.properties.details)==null?void 0:o.externalId)!=null?i:"",elevation:x.properties.elevation,name:(a=(s=x.properties.details)==null?void 0:s.name)!=null?a:"",shortName:(u=(l=x.properties.details)==null?void 0:l.shortName)!=null?u:"",subtitle:x.properties.subtitle}),r.features.push({type:"Feature",geometry:x.geometry,properties:{id:x.properties.id,externalId:(f=(d=x.properties.details)==null?void 0:d.externalId)!=null?f:"",elevation:x.properties.elevation,name:(b=(h=x.properties.details)==null?void 0:h.name)!=null?b:"",shortName:(I=(v=x.properties.details)==null?void 0:v.shortName)!=null?I:"",subtitle:x.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}p();function z$(e,{geometryMaps:t}){var o,i,s,a,l;let r={},n={};for(let[u,d]of xt((o=e.floorImages)!=null?o:{})){let f={features:[],type:"FeatureCollection"};for(let h of(i=d==null?void 0:d.features)!=null?i:[])if("verticalOffset"in h.properties)f.features.push(h);else{let{geometryId:b,...v}=h.properties,I=(l=(s=t.space.get(b))==null?void 0:s.ids[0])!=null?l:(a=t.obstruction.get(b))==null?void 0:a.ids[0];if(!I)continue;let x={geometry:h.geometry,properties:{...v,anchorId:I},type:h.type};f.features.push(x)}n[u]=f}return Object.keys(n).length>0&&(r.floorImages=n),r}p();function H$(e,t={}){var o,i,s,a,l,u,d;let r=[];for(let f of(o=e==null?void 0:e.floorStacks)!=null?o:[]){let h={id:f.id,floors:f.floors,maps:f.floors,externalId:(s=(i=f.details)==null?void 0:i.externalId)!=null?s:"",name:(l=(a=f.details)==null?void 0:a.name)!=null?l:"",shortName:(d=(u=f.details)==null?void 0:u.shortName)!=null?d:"",type:"Building"};f.defaultFloor&&(h.defaultFloor=f.defaultFloor),r.push(h)}if(e.outdoors){let f={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(f)}return{"floorstack.json":r,"mapstack.geojson":r}}p();p();var Z$=fs(q$(),1),Rfe=e=>{let t=e.geometry.coordinates[0],r=0;for(let n=0;n<t.length-1;n++)r+=t[n][0]*t[n+1][1]-t[n+1][0]*t[n][1];return Math.abs(r/2)},Nfe=(e,t)=>{let[r,n]=e,o=t.geometry.coordinates[0],i=!1;for(let s=0,a=o.length-1;s<o.length;a=s++){let[l,u]=o[s],[d,f]=o[a];u>n!=f>n&&r<(d-l)*(n-u)/(f-u)+l&&(i=!i)}return i},Bfe=e=>{let t=e.geometry.coordinates[0],r=0,n=0;for(let o=0;o<t.length-1;o++)r+=t[o][0],n+=t[o][1];return{geometry:{coordinates:[r/(t.length-1),n/(t.length-1)]}}},$fe=e=>{let t=Rfe(e),r=Number.isFinite(t)?Math.max(t,1):1;return Math.sqrt(r)*1e-6},Mx=e=>{try{let r=Bfe(e).geometry.coordinates;if(!Nfe(r,e)){let o=(0,Z$.default)(e.geometry.coordinates,$fe(e));return fe([o[0],o[1]])}return fe(r)}catch{return ge(new Error("Unable to calculate center of polygon"))}};function aw(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Polygon"}function X$(e,{geometryMaps:t,nodesByGeometryId:r}){var u,d,f,h,b,v,I,x,C;let n=zfe(e.defaultStyle),o={},i={},s={},a={};for(let P of ft(e.geometry)){let w=e.geometry[P];if(!w)continue;let T=[],O=[],N=[],k=[];for(let D of w.features){let F=D.properties.id,z=n.has(F),G=(u=r.get(F))!=null?u:[];for(let j of(f=(d=t.space.get(F))==null?void 0:d.features)!=null?f:[])T.push(jfe(j,G));for(let j of(b=(h=t.obstruction.get(F))==null?void 0:h.features)!=null?b:[])O.push(Gfe(j,z));for(let j of(I=(v=t.area.get(F))==null?void 0:v.features)!=null?I:[])N.push(Ufe(j,G));for(let j of(C=(x=t.window.get(F))==null?void 0:x.features)!=null?C:[])k.push(Vfe(j))}T.length>0&&(o[P]={type:"FeatureCollection",features:T.filter(D=>D!==null)}),O.length>0&&(i[P]={type:"FeatureCollection",features:O.filter(D=>D!==null)}),N.length>0&&(s[P]={type:"FeatureCollection",features:N.filter(D=>D!==null)}),k.length>0&&(a[P]={type:"FeatureCollection",features:k.filter(D=>D!==null)})}let l={space:o,obstruction:i};return Object.keys(s).length>0&&(l.area=s),Object.keys(a).length>0&&(l.window=a),l}function jfe(e,t){var n,o;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let r={type:"Feature",geometry:e.geometry,properties:{destinationNodes:t,id:e.properties.id,externalId:(o=(n=e.properties.details)==null?void 0:n.externalId)!=null?o:"",kind:e.properties.kind}};return e.properties.details&&(r.properties.details={name:e.properties.details.name,description:e.properties.details.description,images:e.properties.details.icon?[{url:e.properties.details.icon,altText:e.properties.details.name?"".concat(e.properties.details.name," icon"):"icon"}]:void 0}),aw(r)&&(r.properties.center=Mx(r).unwrapOr(void 0)),r}function Gfe(e,t){var o,i;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(i=(o=r.details)==null?void 0:o.externalId)!=null?i:"",entrances:[],kind:r.kind,footprintComponent:t}};return aw(n)&&(n.properties.center=Mx(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}function Ufe(e,t){var o,i;if(e.geometry.type!=="Polygon")return null;let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(i=(o=r.details)==null?void 0:o.externalId)!=null?i:"",destinationNodes:t}};return aw(n)&&(n.properties.center=Mx(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}function Vfe(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}function zfe(e){var n,o,i,s;let t=[...(o=(n=e==null?void 0:e.ExteriorWalls)==null?void 0:n.geometryAnchors)!=null?o:[],...(s=(i=e==null?void 0:e.Walls)==null?void 0:i.geometryAnchors)!=null?s:[]];return new Set(t.map(a=>a.geometryId))}p();function Y$(e,{geometryMaps:t,geometryFeatureById:r}){var o,i,s,a,l,u,d,f,h,b,v,I,x;if(!e.locationCategories&&!e.locations)return{};let n={};if((o=e.locationCategories)!=null&&o.length){let C=[];for(let P of e.locationCategories){let w={id:P.id,name:P.details.name,icon:(i=P.details.icon)!=null?i:""};P.parent&&(w.parent=P.parent),C.push(w)}n["category.json"]=C}if((s=e.locations)!=null&&s.length){let C=Hfe(e,{geometryFeatureById:r}),P=[];for(let w of e.locations){let T={id:w.id,name:w.details.name,categories:w.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:w.links,openingHoursSpecification:(a=w.openingHours)!=null?a:[],pictures:w.images,social:w.social,description:w.details.description,externalId:w.details.externalId,icon:w.details.icon,logo:w.logo,phone:w.phone,website:w.website};P.push(T);for(let{geometryId:O,floorId:N}of w.geometryAnchors)T.spaces.push(...(u=(l=t.space.get(O))==null?void 0:l.ids.map(k=>({id:k,floor:N})))!=null?u:[]),T.obstructions.push(...(f=(d=t.obstruction.get(O))==null?void 0:d.ids.map(k=>({id:k,floor:N})))!=null?f:[]),T.areas.push(...(b=(h=t.area.get(O))==null?void 0:h.ids.map(k=>({id:k,floor:N})))!=null?b:[]),T.entrances.push(...(v=C.entrancesByGeometryId.get(O))!=null?v:[]),T.connections.push(...(I=C.connectionsByGeometryId.get(O))!=null?I:[]),T.annotations.push(...(x=C.annotationsByGeometryId.get(O))!=null?x:[])}n["location.json"]=P}return n}function Hfe(e,{geometryFeatureById:t}){var n,o,i;let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(e.annotations)for(let[s,a]of xt(e.annotations))for(let l of a!=null?a:[]){let u=l.geometryId,d=l.id,f=(n=r.annotationsByGeometryId.get(u))!=null?n:[];f.push({floor:s,id:d}),r.annotationsByGeometryId.set(u,f)}if(e.connections)for(let s of e.connections){let a=iw(s,t),l=Array.from(new Map([...s.entrances,...s.exits].map(u=>["".concat(u.geometryId,"_").concat(u.floorId),u])).values());for(let u of l){let d=u.geometryId;if(a){let f=(o=r.entrancesByGeometryId.get(d))!=null?o:[];f.push({floor:u.floorId,id:s.id}),r.entrancesByGeometryId.set(d,f)}else{let f=(i=r.connectionsByGeometryId.get(d))!=null?i:[];f.push(s.id),r.connectionsByGeometryId.set(d,f)}}}return r}p();function K$(e,t){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},o=e.manifest;if(o.features.length>0){let i=o.features[0],s=i.properties,a={type:"Feature",geometry:i.geometry,properties:{folder_struct:[],version:"2.0.0",time:s.time,name:s.name,naturalBearing:s.naturalBearing,tzid:s.tzid,map:s.mapId,org_id:s.orgId,language:s.language}};r.features.push(a)}return n}p();function J$(e,{geometryMaps:t}){var a,l,u,d,f,h,b,v,I,x,C,P,w,T,O;let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,o=new Map;for(let N of(l=(a=e.floors)==null?void 0:a.features)!=null?l:[])o.set(N.properties.id,N.properties.elevation);let i=new Map;for(let N of Object.values((u=e.nodes)!=null?u:{}))for(let k of(d=N==null?void 0:N.features)!=null?d:[])for(let D of k.properties.geometryIds)i.set(D,[...(f=i.get(D))!=null?f:[],k.properties.id]);let s=new Map;for(let N of(h=e.connections)!=null?h:[]){let k=N.exits.map(D=>{var F;return{...D,nodes:(F=i.get(D.geometryId))!=null?F:[]}});for(let D of N.entrances){let F=(b=i.get(D.geometryId))!=null?b:[];for(let z of F)for(let G of k){let j=Math.abs(((v=o.get(D.floorId))!=null?v:0)-((I=o.get(G.floorId))!=null?I:0))*N.floorCostMultiplier,K=(x=s.get(z))!=null?x:[];K.push(...G.nodes.map(Z=>({id:Z,weight:j+N.entryCost}))),s.set(z,K)}}}for(let[N,k]of xt((C=e.nodes)!=null?C:{}))for(let D of(P=k==null?void 0:k.features)!=null?P:[]){let F=(w=t.space.get(D.properties.geometryIds[0]))==null?void 0:w.features[0],z=(F==null?void 0:F.geometry.type)==="Point"&&((T=F==null?void 0:F.properties.details)!=null&&T.externalId)?F.properties.details.externalId:"",G={type:"Feature",geometry:D.geometry,properties:{id:D.properties.id,floor:N,space:D.properties.geometryIds.map(j=>{var K;return(K=t.space.get(j))==null?void 0:K.ids}).flat().filter(j=>j!==void 0),neighbors:[...D.properties.neighbors.map(j=>({id:j.id,weight:j.extraCost})),...(O=s.get(D.properties.id))!=null?O:[]],map:N,externalId:z}};n.push(G)}return r}p();function Wfe(e,t){var n;let r={};for(let o of e){let i=t.get(o);i&&((n=r[i])!=null||(r[i]=[]),r[i].push(o))}return r}function Q$(e,{geometryMaps:t}){var s,a,l;if(!e.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let o=[...Array.from(t.space.values()).map(u=>u.features),...Array.from(t.obstruction.values()).map(u=>u.features)],i=new Map(o.flatMap(u=>u.map(d=>[d.properties.id,d.geometry.type])));for(let[u,d]of xt(e.defaultStyle)){let f=Wfe(d.geometryAnchors.flatMap(h=>{var b,v,I,x;return[...(v=(b=t.space.get(h.geometryId))==null?void 0:b.ids)!=null?v:[],...(x=(I=t.obstruction.get(h.geometryId))==null?void 0:I.ids)!=null?x:[]]}),i);if(f.Point&&f.Point.length>0){let h={points:Array.from(f.Point.values()),showImage:((s=d.extra)==null?void 0:s.showImage)!==void 0?((a=d.extra)==null?void 0:a.showImage)===!0:d.opacity!==0};n["".concat(u,".Point")]=h}if(f.LineString&&f.LineString.length>0){let h={lineStrings:Array.from(f.LineString.values()),altitude:d.altitude,color:d.color,height:d.height,opacity:d.opacity,width:d.buffer};n["".concat(u,".LineString")]=h}if(f.Polygon&&f.Polygon.length>0){let h={polygons:Array.from(f.Polygon.values()),altitude:d.altitude,color:d.color,height:d.height,opacity:d.opacity};((l=d.extra)==null?void 0:l.showImage)!==void 0&&(h.showImage=d.extra.showImage===!0),n["".concat(u,".Polygon")]=h}}return r}var qfe=GN().extendOptional($B).extendOptional(S$).extendOptional(WB).extendOptional(y$).extendOptional(F$).extendOptional(YB).extendOptional(t$).extendOptional(w$).extendOptional(E$).extendOptional(d$).extendOptional(i$).extendOptional(GR).extendOptional(YN).extendOptional(FB).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function Zfe(e){let t=N$(e),r=V$(e,t),n=X$(e,t),o=J$(e,t),i=$$(e,t),s=Q$(e,t),a=H$(e,t),l=z$(e,t),u=U$(e,t),d=B$(e,t),f=Y$(e,t),h=G$(e,t),b=K$(e,t);return{...r,...n,...o,...i,...s,...a,"tileset.json":e.tileset,...l,...u,...d,...f,...h,...b}}async function lw(e){let t=await qfe.decompress(e);return t.isOk()?fe(Zfe(t.value)):ge(t.error)}p();function $f(e){return e.endsWith("/")?e:"".concat(e,"/")}p();var jf="https://app.mappedin.com/",ej="https://auth.mappedin.com/";p();p();var Xfe=e=>{let t=Date.now();return e-t},Ox=(e,t)=>Xfe(e)<=t*60*1e3;var rj=60,nj=rj*60*1e3,tj="accessTokens";async function $y(e,t=!1){let r="".concat(e.key),n=fu.getInstance(),o=(n==null?void 0:n.loadSessionData(tj))||{},i=Math.floor(Date.now()/1e3);if(o[r]&&!Ox(o[r].expiresTimestamp*1e3,rj))return o[r];let s=t?await Yfe(e,i):await Kfe(e,i),a={...o,[r]:s};return n==null||n.saveSessionData(tj,a),s}async function Yfe(e,t){var i;let r="".concat((i=e.baseAuthUri)!=null?i:ej,"oauth2/token"),n=await zi()(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:e.key,client_secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let o=await n.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}async function Kfe(e,t){let r="".concat(e.baseAuthUri?$f(e.baseAuthUri):jf,"api/api-key/token"),n=await zi()(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e.key,secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let o=await n.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}p();var ij=60,sj=ij*60*1e3,oj="miSasTokens";async function cw(e,t){let r="".concat(t,"__").concat(e.mapId),n=fu.getInstance(),o=(n==null?void 0:n.loadSessionData(oj))||{};if(o[r]&&!Ox(o[r].expires,ij))return o[r];let i=await Jfe(e,t),s={...o,[r]:{token:i.token,expires:new Date(i.expires).getTime()}};return n==null||n.saveSessionData(oj,s),i}async function Jfe(e,t){let r="".concat(e.baseUri?$f(e.baseUri):jf,"api/v1/venue/").concat(e.mapId,"/sas-token"),n=await zi()(r,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let o=await n.json();return{token:o.token,expires:new Date(o.expires).getTime()}}var aj=globalThis.fetch,uj,Qfe=(uj=g==null?void 0:g.env)==null?void 0:uj.npm_package_version;function zi(){if(aj==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return aj}var uw={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function pj(e){var r;let t={...uw,...e};return t.headers={...t.headers,"mappedin-sdk-version":Qfe},t.things=[],"platformString"in e&&(t.headers={...t.headers,"mappedin-platform-version":e.platformString}),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(r=t.language)==null?void 0:r.toLowerCase(),t}function eme(e,t,r=!1){let n={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};r&&delete n.language;let{headers:o}=e;o["Content-Type"]=o["Content-Type"]||"text/json",e.accessToken?o.Authorization="Bearer ".concat(e.accessToken):e.noAuth||e.clientId&&e.clientSecret&&(o["x-mappedin-key"]=btoa(e.clientId),o["x-mappedin-secret"]=btoa(e.clientSecret));let i={method:"GET",headers:o};return e.secure&&(t+="&withcdntoken"),{req:i,url:t}}async function tme(e,t,r=!1){let n=eme(e,t,r),o=await zi()(n.url,n.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}var rme=e=>{let t=e!=null&&typeof e=="object"&&"perspectives"in e&&e.perspectives!=null&&typeof e.perspectives=="object"?e.perspectives:null;if(t==null||Object.keys(t).length===0)return $.warn("No perspectives available in response!"),null;let r={};for(let[n,o]of Object.entries(t)){let i="url"in o&&typeof o.url=="string"?o.url:null,s="locale_packs"in o&&typeof o.locale_packs=="object"?o.locale_packs:null;if(i==null||s==null){$.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}r[n]={url:i,locale_packs:s}}return r};async function nme(e,t="exports/mvf/1/bundle"){var u,d;let r=pj({baseUri:"https://api-gateway.mappedin.com/",...uw,...e}),n="".concat(r.baseUri+t,"?venue=").concat(r.venue,"&version=").concat((u=r.version)!=null?u:"2.0.0");r.headers["Content-Type"]="application/zip";let o=await tme(r,n),i=o.url,s=o.locale_packs,a=(d=r.perspective)!=null?d:uw.perspective,l=rme(o);if(a!=null&&a!==""&&l!=null){let f=l[a];f==null?$.warn("Perspective ".concat(a," not found in response! Loading default perspective instead.")):($.log('Loading perspective "'.concat(a,'"')),i=f.url,s=f.locale_packs)}return{url:i,localePacks:s,updated_at:o.updated_at}}var jy=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function pw(e,{signal:t}){let r=await(await zi()(e,{signal:t})).arrayBuffer();return new Uint8Array(r)}async function Gf(e){let r=(await import("./browser-OJQDECWL.js")).unzipSync(e),n={};if(r["enterprise/"]!=null){n.enterprise={};let o=r["enterprise/locations.json"];o&&(n.enterprise.locations=JSON.parse(jy().decode(o)));let i=r["enterprise/categories.json"];i&&(n.enterprise.categories=JSON.parse(jy().decode(i)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(jy().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(jy().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(jy().decode(r["manifest.json"]))),n}async function dj(e,{signal:t}){try{let r=await(await zi()(e,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(r);return await Gf(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}async function dw(e){return new Promise(async(t,r)=>{try{let n=e.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:o,localePacks:i}=await nme(e,n),s=await zi()(o).then(l=>l.arrayBuffer()),a=new Uint8Array(s);t({compressed:a,localePacks:i})}catch(n){r(n)}})}async function fw(e,t){return new Promise(async(r,n)=>{try{let{url:o}=await ome(e,t),i=await zi()(o).then(a=>a.arrayBuffer()),s=new Uint8Array(i);r(s)}catch(o){n(o)}})}async function ome(e,t){let r=new URL("".concat(e.baseUri?$f(e.baseUri):jf,"api/venue/").concat(e.mapId,"/mvf"));e.viewId&&r.searchParams.set("configId",e.viewId),e.mvfVersion&&r.searchParams.set("version",e.mvfVersion);let n=await zi()(r.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}function mw(e){var n,o,i,s,a,l,u,d,f,h,b,v,I,x,C,P,w,T;let t=new TextDecoder,r=t.decode.bind(t);try{let O={"connection.json":JSON.parse(r(e["connection.json"])),"manifest.geojson":JSON.parse(r(e["manifest.geojson"])),"map.geojson":e["map.geojson"]?JSON.parse(r(e["map.geojson"])):void 0,"mapstack.geojson":e["mapstack.geojson"]?JSON.parse(r(e["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(r(e["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":e["tileset.json"]?JSON.parse(r(e["tileset.json"])):void 0};if(e.enterprise!=null&&(O.enterprise={},(n=e.enterprise)!=null&&n["locations.json"]&&(O.enterprise.locations=JSON.parse(r((o=e.enterprise)==null?void 0:o["locations.json"]))),(i=e.enterprise)!=null&&i["categories.json"]&&(O.enterprise.categories=JSON.parse(r((s=e.enterprise)==null?void 0:s["categories.json"]))),(a=e.enterprise)!=null&&a["venue.json"]&&(O.enterprise.venue=JSON.parse(r((l=e.enterprise)==null?void 0:l["venue.json"]))),(u=e.enterprise)!=null&&u["layers.json"]&&(O.enterprise.layers=JSON.parse(r((d=e.enterprise)==null?void 0:d["layers.json"]))),(f=e.enterprise)!=null&&f["locationInstances.json"]&&(O.enterprise.locationInstances=JSON.parse(r((h=e.enterprise)==null?void 0:h["locationInstances.json"]))),(b=e.enterprise)!=null&&b["enterpriseStyles.json"]&&(O.enterprise.enterpriseStyles=JSON.parse(r((v=e.enterprise)==null?void 0:v["enterpriseStyles.json"]))),(I=e.enterprise)!=null&&I["textures.json"]&&(O.enterprise.textures=JSON.parse(r((x=e.enterprise)==null?void 0:x["textures.json"]))),(C=e.enterprise)!=null&&C["floorText.json"]&&(O.enterprise.floorText=JSON.parse(r((P=e.enterprise)==null?void 0:P["floorText.json"]))),(w=e.enterprise)!=null&&w["categoryPriorities.json"]&&(O.enterprise.categoryPriorities=JSON.parse(r((T=e.enterprise)==null?void 0:T["categoryPriorities.json"])))),e["floorstack.json"]!=null?O["floorstack.json"]=JSON.parse(r(e["floorstack.json"])):e["mapstack.json"]!=null&&(O["mapstack.json"]=JSON.parse(r(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(r(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(r(e["styles.json"]))),"shapes.json"in e&&(O["shapes.json"]=JSON.parse(r(e["shapes.json"]))),"location.json"in e&&(O["location.json"]=JSON.parse(r(e["location.json"]))),"category.json"in e&&(O["category.json"]=JSON.parse(r(e["category.json"]))),e.annotation!=null){O.annotation={};let k=Object.keys(e.annotation);for(let D of k){let F=D.replace(/\.json|\.geojson/g,"");O.annotation[F]=JSON.parse(r(e.annotation[D]))}}let N=Object.keys(e.space);for(let k of N){let D=k.replace(/\.json|\.geojson/g,"");O.space[D]=JSON.parse(r(e.space[k]))}if(e.obstruction!=null){let k=Object.keys(e.obstruction);for(let D of k){let F=D.replace(/\.json|\.geojson/g,"");O.obstruction[F]=JSON.parse(r(e.obstruction[D]))}}else O.obstruction={};if(e.entrance!=null){let k=Object.keys(e.entrance);for(let D of k){let F=D.replace(/\.json|\.geojson/g,"");O.entrance[F]=JSON.parse(r(e.entrance[D]))}}else O.entrance={};if("floorImages"in e&&e.floorImages!=null){O.floorImages={};for(let k of Object.keys(e.floorImages)){let D=k.replace(/\.json|\.geojson/g,"");O.floorImages[D]=JSON.parse(r(e.floorImages[k]))}}if("textAreas"in e&&e.textAreas!=null){O.textAreas={};for(let k of Object.keys(e.textAreas)){let D=k.replace(/\.json|\.geojson/g,"");O.textAreas[D]=JSON.parse(r(e.textAreas[k]))}}if("facade"in e&&e.facade!=null){O.facade={};for(let k of Object.keys(e.facade)){let D=k.replace(/\.json|\.geojson/g,"");O.facade[D]=JSON.parse(r(e.facade[k]))}}if("area"in e&&e.area!=null){O.area={};for(let k of Object.keys(e.area)){let D=k.replace(/\.json|\.geojson/g,"");O.area[D]=JSON.parse(r(e.area[k]))}}return O}catch(O){throw $.error(O),new Error("MVF parsing failed! Probably encountered a bad file.")}}function ime(e){if(e==null||typeof e!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in e?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in e?"floorstack.json":"mapstack.json"in e?"mapstack.json":"mapstack.geojson"];"styles.json"in e&&t.push("styles.json"),"shapes.json"in e&&t.push("shapes.json");for(let r of t)if(e[r]==null||e[r][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function hw(e){return new Promise(async(t,r)=>{try{if(e==null||typeof e!="object")throw new Error("Error parsing data! Unzipping failed.");if(e[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let o=(await import("./browser-OJQDECWL.js")).unzipSync(e);if(!ime(o))throw new Error("MVF is missing some expect static files. Unzipping failed.");let i={},s=Object.keys(o);for(let a of s){if(o[a].length===0)continue;let l=a.split("/");if(l.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(l.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(l.length===1){i[l[0]]=o[a];continue}if(l[0]==="image"){$.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else i[l[0]]==null&&(i[l[0]]={}),i[l[0]][l[1]]=o[a]}t(i)}catch(n){r(n)}})}function Xu(){let e="us",t={};function r(){return cme(pme(e),t)}return{updateByUserOption(n){var o,i;n.environment&&(e=n.environment),n.baseUri&&(t.baseUri=n.baseUri),n.baseAuthUri&&(t.baseAuthUri=n.baseAuthUri),(o=n.analytics)!=null&&o.baseUri&&(t.analyticsBaseUri=(i=n.analytics)==null?void 0:i.baseUri)},updateTileServerBaseUrl(n){t.tileServerUri=n},updateEnvironment(n){e=n},getBaseUri(n){return e==="us"&&n?lj.baseUri:r().baseUri},getBaseAuthUri(n=!1){return e==="us"&&n?lj.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){e="us",t={}},__getState:r}}var fj=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"}),lj=Object.freeze({...fj,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),sme=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"}),ame=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"}),lme=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 cme(e,t){return{...e,...t}}var ume={eu:sme,us:fj,"us-staging-enterprise":ame,"us-staging-self-serve":lme};function pme(e){return ume[e]}var yw=e=>{var r,n;let t=Object.values((n=(r=e["floorstack.json"])!=null?r:e["mapstack.json"])!=null?n:{});return t.length===1?[]:t.filter(o=>o.type!=="Outdoor").map(o=>o.id.replace("fs_","").replace("ms_",""))},cj=async e=>{let t=performance.now(),r=await lw(e);return $.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),r.inspectErr(n=>{throw $.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()};async function gw(e,t="2.0.0"){switch(t){case"2.0.0":try{let r=await hw(e);return mw(r)}catch{return cj(e)}case"3.0.0":return cj(e);default:throw new Error("Unsupported MVF version: ".concat(t))}}p();p();p();function ui(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 Do(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 Uf(e){return e.type==="Feature"?e.geometry:e}function mj(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function dme(e,t,r){r===void 0&&(r={});for(var n=ui(e),o=Do(t),i=0;i<o.length-1;i++){var s=!1;if(r.ignoreEndVertices&&(i===0&&(s="start"),i===o.length-2&&(s="end"),i===0&&i+1===o.length-1&&(s="both")),fme(o[i],o[i+1],n,s,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}function fme(e,t,r,n,o){var i=r[0],s=r[1],a=e[0],l=e[1],u=t[0],d=t[1],f=r[0]-a,h=r[1]-l,b=u-a,v=d-l,I=f*v-h*b;if(o!==null){if(Math.abs(I)>o)return!1}else if(I!==0)return!1;if(n){if(n==="start")return Math.abs(b)>=Math.abs(v)?b>0?a<i&&i<=u:u<=i&&i<a:v>0?l<s&&s<=d:d<=s&&s<l;if(n==="end")return Math.abs(b)>=Math.abs(v)?b>0?a<=i&&i<u:u<i&&i<=a:v>0?l<=s&&s<d:d<s&&s<=l;if(n==="both")return Math.abs(b)>=Math.abs(v)?b>0?a<i&&i<u:u<i&&i<a:v>0?l<s&&s<d:d<s&&s<l}else return Math.abs(b)>=Math.abs(v)?b>0?a<=i&&i<=u:u<=i&&i<=a:v>0?l<=s&&s<=d:d<=s&&s<=l;return!1}var hj=dme;p();function mme(e,t){t===void 0&&(t={});var r=Md(e),n=(r[0]+r[2])/2,o=(r[1]+r[3])/2;return vs([n,o],t.properties,t)}var Ex=mme;p();p();function hme(e,t,r){r===void 0&&(r={});var n=ui(e),o=ui(t),i=io(o[1]-n[1]),s=io(o[0]-n[0]),a=io(n[1]),l=io(o[1]),u=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return bE(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),r.units)}var pc=hme;function _x(e,t){return t===void 0&&(t={}),IE(e,function(r,n){var o=n.geometry.coordinates;return r+pc(o[0],o[1],t)},0)}p();p();p();function Ax(e,t,r){if(r===void 0&&(r={}),r.final===!0)return yme(e,t);var n=ui(e),o=ui(t),i=io(n[0]),s=io(o[0]),a=io(n[1]),l=io(o[1]),u=Math.sin(s-i)*Math.cos(l),d=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-i);return Ih(Math.atan2(u,d))}function yme(e,t){var r=Ax(t,e);return r=(r+180)%360,r}p();function Yu(e,t,r,n){n===void 0&&(n={});var o=ui(e),i=io(o[0]),s=io(o[1]),a=io(r),l=vE(t,n.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a)),d=i+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u)),f=Ih(d),h=Ih(u);return vs([f,h],n.properties)}p();p();function gme(e){if(!e)throw new Error("geojson is required");var t=[];return xs(e,function(r){bme(r,t)}),mu(t)}function bme(e,t){var r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=Do(n);break;case"LineString":r=[Do(n)]}r.forEach(function(o){var i=vme(o,e.properties);i.forEach(function(s){s.id=t.length,t.push(s)})})}}function vme(e,t){var r=[];return e.reduce(function(n,o){var i=wa([n,o],t);return i.bbox=xme(n,o),r.push(i),o}),r}function xme(e,t){var r=e[0],n=e[1],o=t[0],i=t[1],s=r<o?r:o,a=n<i?n:i,l=r>o?r:o,u=n>i?n:i;return[s,a,l,u]}var bw=gme;var PH=fs(SH(),1);function Vbe(e,t){var r={},n=[];if(e.type==="LineString"&&(e=ZS(e)),t.type==="LineString"&&(t=ZS(t)),e.type==="Feature"&&t.type==="Feature"&&e.geometry!==null&&t.geometry!==null&&e.geometry.type==="LineString"&&t.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var o=CH(e,t);return o&&n.push(o),mu(n)}var i=(0,PH.default)();return i.load(bw(t)),XS(bw(e),function(s){XS(i.search(s),function(a){var l=CH(s,a);if(l){var u=Do(l).join(",");r[u]||(r[u]=!0,n.push(l))}})}),mu(n)}function CH(e,t){var r=Do(e),n=Do(t);if(r.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=r[0][0],i=r[0][1],s=r[1][0],a=r[1][1],l=n[0][0],u=n[0][1],d=n[1][0],f=n[1][1],h=(f-u)*(s-o)-(d-l)*(a-i),b=(d-l)*(i-u)-(f-u)*(o-l),v=(s-o)*(i-u)-(a-i)*(o-l);if(h===0)return null;var I=b/h,x=v/h;if(I>=0&&I<=1&&x>=0&&x<=1){var C=o+I*(s-o),P=i+I*(a-i);return vs([C,P])}return null}var em=Vbe;function zbe(e,t,r){r===void 0&&(r={});var n=vs([1/0,1/0],{dist:1/0}),o=0;return xs(e,function(i){for(var s=Do(i),a=0;a<s.length-1;a++){var l=vs(s[a]);l.properties.dist=pc(t,l,r);var u=vs(s[a+1]);u.properties.dist=pc(t,u,r);var d=pc(l,u,r),f=Math.max(l.properties.dist,u.properties.dist),h=Ax(l,u),b=Yu(t,f,h+90,r),v=Yu(t,f,h-90,r),I=em(wa([b.geometry.coordinates,v.geometry.coordinates]),wa([l.geometry.coordinates,u.geometry.coordinates])),x=null;I.features.length>0&&(x=I.features[0],x.properties.dist=pc(t,x,r),x.properties.location=o+pc(l,x,r)),l.properties.dist<n.properties.dist&&(n=l,n.properties.index=a,n.properties.location=o),u.properties.dist<n.properties.dist&&(n=u,n.properties.index=a+1,n.properties.location=o+d),x&&x.properties.dist<n.properties.dist&&(n=x,n.properties.index=a),o+=d}}),n}var ng=zbe;function Hbe(e,t,r){var n=Do(r);if(mj(r)!=="LineString")throw new Error("line must be a LineString");var o=ng(r,e),i=ng(r,t),s;o.properties.index<=i.properties.index?s=[o,i]:s=[i,o];for(var a=[s[0].geometry.coordinates],l=s[0].properties.index+1;l<s[1].properties.index+1;l++)a.push(n[l]);return a.push(s[1].geometry.coordinates),wa(a,r.properties)}var i4=Hbe;var Wbe=1e-7;function s4(e){return{type:"Point",coordinates:e}}function qbe(e,t){let{coordinates:r}=t.geometry,{coordinates:n}=e.geometry,o=r.map(i=>ng(e,s4(i)));return n.reduce((i,s)=>{let a=i4(s4(s),o[0],e),l=i4(s4(s),o[1],e),u=_x(a)<_x(l)?a:l;return u.properties={...e.properties,entrances:[]},i.concat([u])},[])}function a4(e,t){return t.reduce((r,n)=>{let o={epsilon:Wbe},i=r.obstructions.findIndex(a=>hj(Ex(n),a,o)),s=r.obstructions[i];if(s){let[a,l]=qbe(s,n);r.entrances.push(n),r.obstructions.splice(i,1,a,l)}return r},{obstructions:[e],entrances:[]})}p();p();p();var og=class og{constructor(t,r,n){m(this,"__type",og.__type);m(this,"id",Et());m(this,"latitude");m(this,"longitude");m(this,"floorId");m(this,"verticalOffset");var o;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(o=t.verticalOffset)!=null?o:0;else{if(r==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=r,this.floorId=n,this.verticalOffset=0}}static is(t){return t.__type===og.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};m(og,"__type","coordinate");var l4=og,Le=l4;p();var zr=class{constructor(t){m(this,"id");this.id=t}};var Zs,Zn,ep,bc,ig=class ig extends zr{constructor(r,n){super(n.mvfData.properties.id);m(this,"__type",ig.__type);M(this,Zs);M(this,Zn,{});M(this,ep);M(this,bc);_(this,Zs,r),_(this,ep,n.floorId),_(this,bc,n.mvfData)}static is(r){return r.__type===ig.__type}get locations(){return c(this,Zn).locations?c(this,Zn).locations:(c(this,Zn).locations=(c(this,Zs).locationIdsByNodeId[this.id]||[]).map(r=>c(this,Zs).getById("enterprise-location",r)).filter(Boolean),c(this,Zn).locations)}get space(){var r;return c(this,Zs).getById("space",(r=c(this,Zs).spaceIdsByNodeId[this.id])==null?void 0:r[0])}get floor(){let r=c(this,Zs).getById("floor",c(this,ep));if(r==null)throw new Error("Floor ".concat(c(this,ep)," not found!"));return r}get coordinate(){if(c(this,Zn).coordinate==null){let[r,n]=c(this,bc).geometry.coordinates;c(this,Zn).coordinate=new Le(n,r,c(this,ep))}return c(this,Zn).coordinate}get externalId(){var r;return(r=c(this,bc).properties.externalId)!=null?r:""}get neighbors(){if(c(this,Zn).neighbours==null){let r=c(this,bc).properties.neighbors.map(n=>{let o=c(this,Zs).getById("node",n.id);if(o==null)throw new Error("Node ".concat(n.id," not found!"));return o});c(this,Zn).neighbours=r}return c(this,Zn).neighbours}get geoJSON(){return{...c(this,bc),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(r=>r.id)}}destroy(){for(let r of Object.keys(c(this,Zn)))delete c(this,Zn)[r]}};Zs=new WeakMap,Zn=new WeakMap,ep=new WeakMap,bc=new WeakMap,m(ig,"__type","node");var c4=ig,vc=c4;p();p();p();p();var sg,nl,O2=class O2 extends zr{constructor(r){super(String(Et()));M(this,sg,{});M(this,nl);_(this,nl,r.mvfData)}static is(r){return r.__type===O2.__type}get url(){return c(this,nl).url}get name(){if("displayName"in c(this,nl))return c(this,nl).displayName;if("label"in c(this,nl))return c(this,nl).label}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(c(this,sg)))delete c(this,sg)[r]}};sg=new WeakMap,nl=new WeakMap,m(O2,"__type","hyperlink");var u4=O2,tp=u4;p();p();function ag(e){return typeof e=="string"?e:e.id}function d4(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}var p4=8,Xs=e=>typeof e=="number"?e.toFixed(p4):d4(e)?e[1].toFixed(p4)+"-"+e[0].toFixed(p4):e.map(t=>Xs(t)).join("-"),Zbe=e=>{let t=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,r=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return t.test(e)||r.test(e)},E2=e=>{if(!Zbe(e))return null;let t="";e.startsWith("https://")?(t="https://",e=e.slice(8)):e.startsWith("http://")&&(t="http://",e=e.slice(7));let[r,n,o]=e.split("/");return{origin:t+r,mapId:n,fileName:o}};var lg,xc,rp,_2=class _2 extends zr{constructor(r){super(String(Et()));M(this,lg,{});M(this,xc);M(this,rp);_(this,xc,r.mvfData),_(this,rp,r.mapData)}static is(r){return r.__type===_2.__type}get url(){let r=c(this,xc).url;if(c(this,rp).tokenManager==null)return r;let n=E2(c(this,xc).url);if(n==null)return r;let o=n.mapId;try{if(c(this,rp).tokenManager.isEnterpriseMode())return r;let i=c(this,rp).tokenManager.getSasToken(o).token;if(i==null||i==="")throw new Error("SAS token empty!");return"".concat(r,"?").concat(i)}catch(i){return $.error("Error getting SAS token for image",{error:i,url:r}),r}}get name(){return c(this,xc).altText}get altText(){return c(this,xc).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(c(this,lg)))delete c(this,lg)[r]}};lg=new WeakMap,xc=new WeakMap,rp=new WeakMap,m(_2,"__type","image");var f4=_2,np=f4;p();var op,qi=class{constructor(t,r){m(this,"id");M(this,op);this.id=t}get geoJSONBoundingBox(){return c(this,op)?c(this,op):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(_(this,op,Md(this.geoJSON)),c(this,op))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};op=new WeakMap;var tm,Zi,ol,fn=class extends qi{constructor(r,n){super(n.properties.id,r);M(this,tm);M(this,Zi);M(this,ol,{});_(this,tm,r),_(this,Zi,n)}get externalId(){var r;return(r=c(this,Zi).properties.externalId)!=null?r:""}get name(){var n,o,i,s,a;let r="";return"details"in c(this,Zi).properties||(r=(n=c(this,Zi).properties.externalId)!=null?n:""),r===""&&(r=(i=(o=c(this,Zi).properties.details)==null?void 0:o.name)!=null?i:""),r===""&&(r=(a=(s=this.locationProfiles.find(l=>l.name&&l.name.length>0))==null?void 0:s.name)!=null?a:""),r}get description(){var n,o,i,s;let r=(o=(n=c(this,Zi).properties.details)==null?void 0:n.description)!=null?o:"";return r===""&&(r=(s=(i=this.locationProfiles.find(a=>a.description&&a.description.length>0))==null?void 0:i.description)!=null?s:""),r}get images(){var n,o,i,s,a;if(c(this,ol).images!=null)return c(this,ol).images;let r=(i=(o=(n=c(this,Zi).properties.details)==null?void 0:n.images)==null?void 0:o.map(l=>new np({mvfData:l,mapData:c(this,tm)})))!=null?i:[];return(r==null||r.length===0)&&(r=(a=(s=this.locationProfiles.find(l=>l.images.length>0))==null?void 0:s.images)!=null?a:[]),c(this,ol).images=r,r}get links(){var n,o,i,s,a;if(c(this,ol).links!=null)return c(this,ol).links;let r=(i=(o=(n=c(this,Zi).properties.details)==null?void 0:n.links)==null?void 0:o.map(l=>new tp({mvfData:l})))!=null?i:[];return(r==null||r.length===0)&&(r=(a=(s=this.locationProfiles.find(l=>l.links.length>0))==null?void 0:s.links)!=null?a:[]),c(this,ol).links=r,r}get locationProfiles(){var r;return(r=c(this,tm).locationProfilesByAttachedFeatureId[this.id])!=null?r:[]}};tm=new WeakMap,Zi=new WeakMap,ol=new WeakMap;var ug,ip,rm,nm,cg=class cg extends fn{constructor(r,n){super(r,n.mvfData);m(this,"__type",cg.__type);M(this,ug);M(this,ip);M(this,rm,{});M(this,nm);_(this,ug,r),_(this,ip,n.floorId),_(this,nm,n.mvfData)}static is(r){return r.__type===cg.__type}get center(){var r;if(c(this,rm).center==null){let[n,o]=(r=c(this,nm).properties.center)!=null?r:[0,0];c(this,rm).center=new Le(o,n,c(this,ip))}return c(this,rm).center}get floor(){let r=c(this,ug).getById("floor",c(this,ip));if(r==null)throw new Error("Floor ".concat(c(this,ip)," not found!"));return r}get geoJSON(){return{...c(this,nm),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};ug=new WeakMap,ip=new WeakMap,rm=new WeakMap,nm=new WeakMap,m(cg,"__type","area");var m4=cg,Ic=m4;p();var sp,il,ap,om,pg=class pg extends fn{constructor(r,n){super(r,n.mvfData);m(this,"__type",pg.__type);M(this,sp);M(this,il);M(this,ap);M(this,om);_(this,il,{}),_(this,om,n.mvfData),_(this,sp,r),_(this,ap,n.floorId)}static is(r){return r.__type===pg.__type}get floor(){let r=c(this,sp).getById("floor",c(this,ap));if(r==null)throw new Error("Floor ".concat(c(this,ap)," not found!"));return r}get center(){if(c(this,il).center==null){let[[r,n],[o,i]]=c(this,om).geometry.coordinates,s=(r+o)/2,a=(n+i)/2;c(this,il).center=new Le(a,s,c(this,ap))}return c(this,il).center}get isExterior(){var o;let r=c(this,sp).obstructionIdByEntranceId[this.id],n=c(this,sp).getMVFFeatureById("obstruction",r);return(o=n==null?void 0:n.properties.footprintComponent)!=null?o:!1}get geoJSON(){return{...c(this,om),properties:null}}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(c(this,il)))delete c(this,il)[r]}};sp=new WeakMap,il=new WeakMap,ap=new WeakMap,om=new WeakMap,m(pg,"__type","door");var h4=pg,Ys=h4;p();var Sc,lp,Lo,Ks,dg=class dg extends fn{constructor(r,n){super(r,n.mvfData);m(this,"__type",dg.__type);M(this,Sc);M(this,lp);M(this,Lo,{});M(this,Ks);_(this,Sc,r),_(this,lp,n.floorId),_(this,Ks,n.mvfData)}getMvfData(){return c(this,Ks)}static is(r){return r.__type===dg.__type}get type(){return Ybe(c(this,Ks).properties.kind)}get locations(){if(c(this,Lo).locations)return c(this,Lo).locations;c(this,Lo).locations=[];let r=c(this,Sc).mvfLocationsBySpaceId[c(this,Ks).properties.id];if((r==null?void 0:r.length)>0)for(let n of r){let o=c(this,Sc).getById("enterprise-location",n.id);o&&c(this,Lo).locations.push(o)}return c(this,Lo).locations}get floor(){let r=c(this,Sc).getById("floor",c(this,lp));if(r==null)throw new Error("Floor ".concat(c(this,lp)," not found!"));return r}get doors(){return c(this,Ks).properties.destinationNodes.reduce((r,n)=>{let o=c(this,Sc).doorsByNodeId[n];return o&&r.push(o),r},[])}get center(){var r;if(c(this,Lo).center==null){let[n,o]=(r=c(this,Ks).properties.center)!=null?r:[0,0];c(this,Lo).center=new Le(o,n,c(this,lp))}return c(this,Lo).center}get geoJSON(){return{...c(this,Ks),properties:null}}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(c(this,Lo)))delete c(this,Lo)[r]}};Sc=new WeakMap,lp=new WeakMap,Lo=new WeakMap,Ks=new WeakMap,m(dg,"__type","space");var y4=dg,Xbe=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function Ybe(e){if(e==null||e==="default")return"room";let t=e.toLowerCase();return Xbe.includes(t)?t:"room"}var Qr=y4;p();var di,Jt,fi,mg,b4,fg=class fg extends qi{constructor(r,n){super(n.mvfData.properties.id,r);M(this,mg);m(this,"__type",fg.__type);M(this,di);M(this,Jt,{});M(this,fi);_(this,di,r),_(this,fi,n.mvfData)}static is(r){return r.__type===fg.__type}get focusTarget(){return this}get name(){var r,n;return"name"in c(this,fi).properties?(n=ee(this,mg,b4).call(this,"name"))!=null?n:"":(r=c(this,fi).properties.externalId)!=null?r:""}get shortName(){var r,n;return"shortName"in c(this,fi).properties?(n=ee(this,mg,b4).call(this,"shortName"))!=null?n:"":(r=c(this,fi).properties.externalId)!=null?r:""}get externalId(){var r;return(r=c(this,fi).properties.externalId)!=null?r:""}get elevation(){return c(this,fi).properties.elevation}get spaces(){if(c(this,Jt).spaces==null){let r=c(this,di).spaces.filter(n=>n.floor.id===this.id);c(this,Jt).spaces=r}return c(this,Jt).spaces}get geoJSON(){var r;return{type:"Feature",properties:null,geometry:(r=c(this,fi).geometry)!=null?r:{type:"Polygon",coordinates:[]}}}get objects(){if(c(this,Jt).objects==null){let r=c(this,di).objects.filter(n=>n.floor.id===this.id);c(this,Jt).objects=r}return c(this,Jt).objects}get connections(){if(c(this,Jt).connections==null){let r=c(this,di).connections.filter(n=>n.floors.includes(this));c(this,Jt).connections=r}return c(this,Jt).connections}get doors(){if(c(this,Jt).doors==null){let r=c(this,di).doors.filter(n=>n.floor.id===this.id);c(this,Jt).doors=r}return c(this,Jt).doors}get annotations(){if(c(this,Jt).annotations==null){let r=c(this,di).annotations.filter(n=>n.floor.id===this.id);c(this,Jt).annotations=r}return c(this,Jt).annotations}get pois(){if(c(this,Jt).pois==null){let r=c(this,di).pointsOfInterest.filter(n=>n.floor.id===this.id);c(this,Jt).pois=r}return c(this,Jt).pois}get floorStack(){if(c(this,Jt).floorStack==null){let r=c(this,di).floorStacks.find(n=>n.floors.includes(this));c(this,Jt).floorStack=r}return c(this,Jt).floorStack}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,elevation:this.elevation,spaces:this.spaces.map(r=>r.id),objects:this.objects.map(r=>r.id),connections:this.connections.map(r=>r.id),doors:this.doors.map(r=>r.id),annotations:this.annotations.map(r=>r.id),pois:this.pois.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(c(this,Jt)))delete c(this,Jt)[r]}};di=new WeakMap,Jt=new WeakMap,fi=new WeakMap,mg=new WeakSet,b4=function(r){let n=c(this,fi).properties[r];return c(this,di).getPropTranslation(this.__type,r,this.id,n)},m(fg,"__type","floor");var g4=fg,Ro=g4;p();p();p();function hg(e){let t;if(Qr.is(e)||Ys.is(e)||No.is(e)||Ic.is(e)||Xi.is(e))t=e.center;else if(Cc.is(e)||Pc.is(e))t=e.coordinate;else if(Le.is(e))t=e;else if(vc.is(e))t=e.coordinate;else if(sl.is(e))t=e.coordinates[0];else return;return t}p();p();var cp={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!1,floorHeight:10}},Js="ExteriorWalls",Tc="Walls",TH=0,im="InteriorDoors",sm="ExteriorDoors",Er="GeometryLayer",al="LabelsLayer",Qs="MarkersLayer",yg="FootprintLayer",am="OcclusionLayer",wH="ImagesLayer",up="FacadesLayer";var MH=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],Kbe={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function v4(e){var t,r;(t=e.outdoorView)!=null&&t.enabled&&!((r=e.outdoorView)!=null&&r.token)&&$.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function x4(e,t){var o,i,s,a,l,u;let r=((o=e==null?void 0:e.outdoorView)==null?void 0:o.token)||t.outdoorViewToken,n={...cp,...e,outdoorView:{enabled:((i=e==null?void 0:e.outdoorView)==null?void 0:i.enabled)===void 0?!!r:(s=e==null?void 0:e.outdoorView)==null?void 0:s.enabled,layersHiddenByGeometry:(a=cp.outdoorView)==null?void 0:a.layersHiddenByGeometry,...e==null?void 0:e.outdoorView},bearing:(u=(l=e==null?void 0:e.bearing)!=null?l:t.naturalBearing)!=null?u:0,imagePlacementOptions:{...cp.imagePlacementOptions,...e==null?void 0:e.imagePlacementOptions},multiFloorView:{...cp.multiFloorView,...e==null?void 0:e.multiFloorView}};return r&&n.outdoorView&&(n.outdoorView.token=r),n}function OH(e){let t={remove_watermark:!1};if(e)try{let r=e0(e);Object.assign(t,r.capabilities)}catch(r){$.error("Error decoding capabilities from token",r)}return t}var wc,mi,ll,gg=class gg extends fn{constructor(r,n){let o=Object.values(n.mvfDataByFloorId)[0];super(r,o);m(this,"__type",gg.__type);M(this,wc);M(this,mi);M(this,ll);_(this,mi,{}),_(this,wc,r),_(this,ll,n.mvfDataByFloorId)}static is(r){return r.__type===gg.__type}get accessible(){var r;return(r=Object.values(c(this,ll))[0].properties.accessible)!=null?r:!1}get type(){var r,n;return(n=(r=Object.values(c(this,ll))[0].properties.kind)==null?void 0:r.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(c(this,ll))[0].properties.extra}get coordinates(){return c(this,mi).coordinates==null&&(c(this,mi).coordinates=Object.entries(c(this,ll)).map(([r,n])=>new Le(n.geometry.coordinates[1],n.geometry.coordinates[0],r))),c(this,mi).coordinates}get nodes(){return Object.values(c(this,ll))[0].properties.nodes.map(r=>c(this,wc).getById("node",r))}get floors(){return this.coordinates.map(r=>r.floorId?c(this,wc).getById("floor",r.floorId):void 0).filter(Th)}get locationProfiles(){var n,o,i,s,a;if(c(this,mi).locationProfiles!=null)return c(this,mi).locationProfiles;let r=super.locationProfiles;if(r==null||r.length===0){let l=[(o=(n=this.coordinates[0])==null?void 0:n.longitude)!=null?o:0,(s=(i=this.coordinates[0])==null?void 0:i.latitude)!=null?s:0],u=Xs(l),d=(a=c(this,wc).mvfConnectionIdsByLatLon[u])!=null?a:[];for(let f of d){let h=c(this,wc).locationProfilesByAttachedFeatureId[f];if(h!=null){r=h;break}}}return c(this,mi).locationProfiles=r!=null?r:[],r}get focusTarget(){return this.coordinates}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(r=>r.toJSON()),floors:this.floors.map(r=>r.id),extra:this.extra}}destroy(){for(let r of Object.keys(c(this,mi)))delete c(this,mi)[r]}};wc=new WeakMap,mi=new WeakMap,ll=new WeakMap,m(gg,"__type","connection");var I4=gg,pp=I4;p();var vg,dp,Mc,fp,bg=class bg extends fn{constructor(r,n){super(r,n.mvfData);m(this,"__type",bg.__type);M(this,vg);M(this,dp);M(this,Mc,{});M(this,fp);_(this,vg,r),_(this,dp,n.floorId),_(this,fp,n.mvfData)}static is(r){return r.__type===bg.__type}get type(){let r=c(this,fp).properties.kind;return r==null&&(r="object"),r==="Desks"&&(r="desk"),r.toLowerCase()}get floor(){let r=c(this,vg).getById("floor",c(this,dp));if(r==null)throw new Error("Floor ".concat(c(this,dp)," not found!"));return r}get center(){var r;if(c(this,Mc).center==null){let[n,o]=(r=c(this,fp).properties.center)!=null?r:[0,0];c(this,Mc).center=new Le(o,n,c(this,dp))}return c(this,Mc).center}get geoJSON(){return{...c(this,fp),properties:null}}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of globalThis.Object.keys(c(this,Mc)))c(this,Mc)[r]=null}};vg=new WeakMap,dp=new WeakMap,Mc=new WeakMap,fp=new WeakMap,m(bg,"__type","object");var S4=bg,No=S4;p();var Ig,mp,Oc,lm,xg=class xg extends fn{constructor(r,n){super(r,n.mvfData);m(this,"__type",xg.__type);M(this,Ig);M(this,mp);M(this,Oc,{});M(this,lm);_(this,Ig,r),_(this,lm,n.mvfData),_(this,mp,n.floorId)}static is(r){return r.__type===xg.__type}get floor(){let r=c(this,Ig).getById("floor",c(this,mp));if(r==null)throw new Error("Floor ".concat(c(this,mp)," not found!"));return r}get coordinate(){var r;if(c(this,Oc).coordinate==null){let[n,o]=(r=c(this,lm).geometry.coordinates)!=null?r:[0,0];c(this,Oc).coordinate=new Le(o,n,c(this,mp))}return c(this,Oc).coordinate}get geoJSON(){return{...c(this,lm),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let r in c(this,Oc))c(this,Oc)[r]=null}};Ig=new WeakMap,mp=new WeakMap,Oc=new WeakMap,lm=new WeakMap,m(xg,"__type","point-of-interest");var C4=xg,Cc=C4;p();var Cg,hp,Ec,yp,Pg,T4,Sg=class Sg extends fn{constructor(r,n){super(r,n.mvfData);M(this,Pg);m(this,"__type",Sg.__type);M(this,Cg);M(this,hp);M(this,Ec,{});M(this,yp);_(this,Cg,r),_(this,hp,n.floorId),_(this,yp,n.mvfData)}static is(r){return r.__type===Sg.__type}get group(){return ee(this,Pg,T4).call(this).group}get type(){return ee(this,Pg,T4).call(this).type}get coordinate(){if(c(this,Ec).coordinate==null){let[r,n]=c(this,yp).geometry.coordinates;c(this,Ec).coordinate=new Le(n,r,c(this,hp))}return c(this,Ec).coordinate}get floor(){let r=c(this,Cg).getById("floor",c(this,hp));if(r==null)throw new Error("Floor ".concat(c(this,hp)," not found!"));return r}get geoJSON(){return{...c(this,yp),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let r of Object.keys(c(this,Ec)))delete c(this,Ec)[r]}};Cg=new WeakMap,hp=new WeakMap,Ec=new WeakMap,yp=new WeakMap,Pg=new WeakSet,T4=function(){let[r,n]=c(this,yp).properties.symbolId.split("--");return{group:r,type:n}},m(Sg,"__type","annotation");var P4=Sg,Pc=P4;p();var _c,hi,Yi,cm,wg,M4,Tg=class Tg extends qi{constructor(r,n){super(n.mvfData.id,r);M(this,wg);m(this,"__type",Tg.__type);M(this,_c);M(this,hi,{});M(this,Yi);M(this,cm);_(this,_c,r),_(this,Yi,n.mvfData),_(this,cm,n.facadeId)}static is(r){return r.__type===Tg.__type}get type(){return c(this,Yi).type}get name(){var r;return(r=ee(this,wg,M4).call(this,"name"))!=null?r:""}get shortName(){var r;return(r=ee(this,wg,M4).call(this,"shortName"))!=null?r:""}get externalId(){var r;return(r=c(this,Yi).externalId)!=null?r:""}get floors(){var r,n;if(c(this,hi).floors==null){let o=((n=(r=c(this,Yi).floors)!=null?r:c(this,Yi).maps)!=null?n:[]).reduce((i,s)=>{let a=c(this,_c).floorsById[s];return a&&i.push(a),i},[]);o.length===0&&$.error("Floor stack ".concat(this.id," has no floors")),c(this,hi).floors=o}return c(this,hi).floors}get defaultFloor(){if(c(this,hi).defaultFloor!=null)return c(this,hi).defaultFloor;let r=c(this,Yi).defaultFloor?c(this,_c).getById("floor",c(this,Yi).defaultFloor):void 0;return c(this,hi).defaultFloor=r||this.floors.reduce((n,o)=>Math.abs(o.elevation)<Math.abs(n.elevation)?o:n),c(this,hi).defaultFloor}get facade(){return c(this,cm)?c(this,_c).facadesById[c(this,cm)]:void 0}toJSON(){return{id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(c(this,hi)))delete c(this,hi)[r]}};_c=new WeakMap,hi=new WeakMap,Yi=new WeakMap,cm=new WeakMap,wg=new WeakSet,M4=function(r){return c(this,_c).getPropTranslation(this.__type,r,this.id,c(this,Yi)[r])},m(Tg,"__type","floor-stack");var w4=Tg,A2=w4;p();var um,gp,Og,ea,Mg=class Mg extends qi{constructor(r,n){super(n.mvfData.id,r);m(this,"__type",Mg.__type);M(this,um);M(this,gp);M(this,Og);M(this,ea,{});_(this,um,n.mvfData),_(this,gp,r),_(this,Og,n.floorStackId)}static is(r){return r.__type===Mg.__type}get floorStack(){return c(this,gp).getById("floor-stack",c(this,Og))}get spaces(){if(!c(this,ea).spaces){c(this,ea).spaces=[];for(let r of c(this,um).spaces){let n=c(this,gp).getById("space",r.spaceId);n&&c(this,ea).spaces.push(n)}}return c(this,ea).spaces}get center(){if(!c(this,ea).center){let r={type:"FeatureCollection",features:[]};for(let o of this.spaces){let i=c(this,gp).mvfSpacesById[o.id];i&&r.features.push(i)}if(r.features.length===0)throw new Error("No geometry found for facade!");let n=Ex(r);c(this,ea).center=new Le(n.geometry.coordinates[1],n.geometry.coordinates[0],c(this,um).spaces[0].floorId)}return c(this,ea).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};um=new WeakMap,gp=new WeakMap,Og=new WeakMap,ea=new WeakMap,m(Mg,"__type","facade");var O4=Mg,Xi=O4;p();var Jbe=(e,t)=>{var l,u,d,f,h,b,v,I,x,C,P;let r={},n={},o={},i={},s={},a={};for(let w of e["location.json"]||[]){let T=new pm(t,{mvfData:w});if(r[w.id]=T,w.externalId&&(i[w.externalId]==null&&(i[w.externalId]=[]),i[w.externalId].push(T)),w.categories)for(let N of w.categories)s[N]==null&&(s[N]=[]),s[N].push(T);let O=[...(u=(l=w.obstructions)==null?void 0:l.map(N=>N.id))!=null?u:[],...(f=(d=w.spaces)==null?void 0:d.map(N=>N.id))!=null?f:[],...(b=(h=w.annotations)==null?void 0:h.map(N=>N.id))!=null?b:[],...(v=w.connections)!=null?v:[],...(x=(I=w.entrances)==null?void 0:I.map(N=>N.id))!=null?x:[],...(P=(C=w.areas)==null?void 0:C.map(N=>N.id))!=null?P:[]];for(let N of O)N&&(a[N]==null&&(a[N]=[]),a[N].push(T))}for(let w of e["category.json"]||[]){let T=new D2(t,{mvfData:w});n[w.id]=T,w.parent&&(o[w.parent]==null&&(o[w.parent]=[]),o[w.parent].push(T))}return{locationCategoriesByParentId:o,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:i,locationProfilesByCategoryId:s,locationProfilesByAttachedFeatureId:a}},Qbe=(e,t,r)=>{var x,C;let n={},o={},i={},s={},a={},l={},u={},d={},f={},h={},b={},v={},I=globalThis.Object.keys(e.space);for(let P of I){let w=e.space[P];if(w!=null)for(let T of w.features){v[T.properties.id]=P,u[T.properties.id]=T;for(let O of T.properties.destinationNodes)a[O]==null&&(a[O]=[]),a[O].push(T.properties.id);if(T.properties.kind==="desk-entrance"&&(l[T.properties.externalId]==null&&(l[T.properties.externalId]=[]),l[T.properties.externalId].push(...T.properties.destinationNodes)),!["void","desk-entrance"].includes((x=T.properties.kind)!=null?x:"")){if((C=T.properties.kind)!=null&&C.includes("connection")){let O=Xs(T.geometry.coordinates);h[O]==null&&(h[O]=[]),h[O].push(T.properties.id);continue}if(T.properties.kind==="poi"){let O=new Cc(r,{floorId:P,mvfData:T});i[T.properties.id]=O,f[P]||(f[P]=[]),f[P].push(T),T.properties.externalId&&(s[T.properties.externalId]==null&&(s[T.properties.externalId]=[]),s[T.properties.externalId].push(O))}else{let O=new Qr(r,{floorId:P,mvfData:T});n[T.properties.id]=O,T.properties.externalId&&(o[T.properties.externalId]==null&&(o[T.properties.externalId]=[]),o[T.properties.externalId].push(O)),d[P]||(d[P]=[]),d[P].push(T)}}}}for(let P in h){let w=h[P],T={};for(let N of w){let k=v[N],D=u[N],F=t==null?void 0:t["n_"+D.properties.id.split("s_")[1]];T[k]={...D,properties:{...D.properties,accessible:(F==null?void 0:F.accessible)===!0}}}let O=new pp(r,{mvfDataByFloorId:T});b[O.id]=O}return{spacesById:n,spacesByExternalId:o,poisById:i,poisByExternalId:s,connectionsById:b,spaceIdsByDestinationNodeId:a,objectEntranceNodeIdsByObstructionId:l,mvfSpacesById:u,connectionIdsByLatLon:h,mvfSpacesByFloorId:d,mvfPoisByFloorId:f}},e1e=(e,t)=>{var s,a;let r={},n={},o={},i={};for(let l of e["node.geojson"].features){o[l.properties.id]=l;let u=new vc(t,{mvfData:l,floorId:(s=l.properties.floor)!=null?s:l.properties.map});r[l.properties.id]=u,l.properties.externalId&&(n[l.properties.externalId]==null&&(n[l.properties.externalId]=[]),n[l.properties.externalId].push(u));let d=(a=l.properties.floor)!=null?a:l.properties.map;i[d]||(i[d]=[]),i[d].push(l)}return{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}},t1e=(e,t)=>{let r={},n={},o={},i={},s=globalThis.Object.keys(e.obstruction);for(let a of s){let l=e.obstruction[a];if(l!=null)for(let u of l.features){o[u.properties.id]=u;for(let f of u.properties.entrances)i[f]=u.properties.id;if(u.properties.kind==="Wall")continue;let d=new No(t,{floorId:a,mvfData:u});r[u.properties.id]=d,u.properties.externalId&&(n[u.properties.externalId]==null&&(n[u.properties.externalId]=[]),n[u.properties.externalId].push(d))}}return{objectsById:r,objectsByExternalId:n,mvfObstructionById:o,obstructionIdByEntranceId:i}},r1e=(e,t)=>{let r={},n={},o={};if("floor.geojson"in e&&e["floor.geojson"]!=null)for(let i of e["floor.geojson"].features){o[i.properties.id]=i.properties;let s=new Ro(t,{mvfData:i});r[i.properties.id]=s,i.properties.externalId&&(n[i.properties.externalId]==null&&(n[i.properties.externalId]=[]),n[i.properties.externalId].push(s))}else for(let i of e["map.geojson"]){o[i.id]=i;let s=new Ro(t,{mvfData:{properties:i}});r[i.id]=s}return{floorsById:r,floorsByExternalId:n,mvfFloorsById:o}},n1e=(e,t)=>{var l;let r={},n={},o={},i={},s={},a=e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"];if(a!=null)for(let u of a){let d=(l=e.facade)==null?void 0:l[u.id],f=new A2(t,{mvfData:u,facadeId:d==null?void 0:d.id});if(r[u.id]=f,u.externalId&&(n[u.externalId]==null&&(n[u.externalId]=[]),n[u.externalId].push(f)),o[u.id]=u,d){let h=new Xi(t,{mvfData:d,floorStackId:u.id});i[d.id]=h;for(let b of d.spaces)s[b.spaceId]=h}}return{floorStacksById:r,floorStacksByExternalId:n,mvfFloorStacksById:o,facadesById:i,facadesBySpaceId:s}},o1e=(e,t)=>{let r={},n={},o=e["connection.json"].reduce((i,s)=>{s.nodes.forEach(l=>i[l]=s),r[s.id]=s;let a=t==null?void 0:t[s.nodes[0]];if(a!=null){let l=Xs(a.geometry.coordinates);n[l]==null&&(n[l]=[]),n[l].push(s.id)}return i},{});return{mvfConnectionsById:r,mvfConnectionsByNodeId:o,mvfConnectionIdsByLatLon:n}},i1e=(e,t)=>{let r={},n={},o={},i={},s={},a=globalThis.Object.keys(e.entrance);for(let l of a){let u=e.entrance[l];if(u!=null)for(let d of u.features){i[d.properties.id]=d;let f=new Ys(t,{floorId:l,mvfData:d});d.properties.node&&(o[d.properties.node]=f),r[d.properties.id]=f,d.properties.externalId&&(n[d.properties.externalId]==null&&(n[d.properties.externalId]=[]),n[d.properties.externalId].push(f)),s[l]||(s[l]=[]),s[l].push(d)}}return{doorsById:r,doorsByExternalId:n,doorsByNodeId:o,mvfEntrancesById:i,mvfEntrancesByFloorId:s}},s1e=(e,t,r)=>{var n;if(e.textAreas!=null)for(let o in e.textAreas){let i=(n=e.textAreas[o])==null?void 0:n.features;if(i!=null){for(let s of i)if("anchorId"in s.properties){let a=s==null?void 0:s.properties,l=t[a.anchorId]||r[a.anchorId];if(l!=null&&a!=null){let u=l.properties;u.textArea=a,u.textArea&&(u.textArea.position=s.geometry.coordinates)}}}}},a1e=(e,t,r)=>{var n;if(e.floorImages!=null)for(let o in e.floorImages){let i=(n=e.floorImages[o])==null?void 0:n.features;if(i!=null){for(let s of i)if("anchorId"in s.properties){let a=s==null?void 0:s.properties,l=t[a.anchorId]||r[a.anchorId];if(l!=null&&a!=null){let u=l.properties;u.image=a,u.image&&(u.image.position=s.geometry.coordinates)}}}}},l1e=(e,t)=>{var n,o;if(((n=e.enterprise)==null?void 0:n.enterpriseStyles)==null)return;let r=(o=e.enterprise)==null?void 0:o.enterpriseStyles;for(let i in r){let s=r[i];s.geometryAnchors.forEach(a=>{let l=t[a.geometryId];if(l!=null){let u=l.properties;u.style={styleId:i,edgeOffset:s.edgeOffset}}})}},c1e=(e,t,r)=>{if(!(e.enterprise==null||e.enterprise.textures==null))for(let n of e.enterprise.textures)for(let o of n.geometryAnchors){let i=t[o.geometryId]||r[o.geometryId];if(i!=null){let s=i.properties;s.textures==null&&(s.textures=[]),s.textures.push(n)}}},u1e=(e,t)=>{let r={},n={},o={};if(e.annotation==null)return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:o};let i=globalThis.Object.keys(e.annotation);for(let s of i){let a=e.annotation[s];if(a!=null)for(let l of a.features){n[l.properties.id]=l;let u=new Pc(t,{floorId:s,mvfData:l});r[l.properties.id]=u,o[s]||(o[s]=[]),o[s].push(l)}}return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:o}},p1e=(e,t)=>{let r={},n={},o={};if(e.area==null)return{areasById:r,areasByExternalId:n,mvfAreasById:o};let i=globalThis.Object.keys(e.area);for(let s of i){let a=e.area[s];if(a!=null)for(let l of a.features){o[l.properties.id]=l;let u=new Ic(t,{floorId:s,mvfData:l});r[l.properties.id]=u,l.properties.externalId&&(n[l.properties.externalId]==null&&(n[l.properties.externalId]=[]),n[l.properties.externalId].push(u))}}return{areasById:r,areasByExternalId:n,mvfAreasById:o}},EH=(e,t)=>{var C,P,w,T,O,N,k,D,F,z,G,j,K;let r={},n={},o={},i={},s=((P=(C=e.enterprise)==null?void 0:C.locations)!=null?P:[]).reduce((Z,oe)=>(Z[oe.id]=oe,Z),{}),a={},l={},u={},d={},f={},h={},b=((w=e.enterprise)==null?void 0:w.venue)||{},v={},I={};for(let Z of(O=(T=e.enterprise)==null?void 0:T.categories)!=null?O:[]){let oe=new k2(t,{mvfData:Z});a[Z.id]=oe,Z.externalId&&(l[Z.externalId]==null&&(l[Z.externalId]=[]),l[Z.externalId].push(oe)),u[Z.id]=Z,Z.locations.forEach(Q=>{f[Q]==null&&(f[Q]=[]),f[Q].push(Z.id)})}let x={};for(let Z of(k=(N=e.enterprise)==null?void 0:N.locationInstances)!=null?k:[]){let oe=s[Z.parent],Q=Object.keys(oe),ye={};for(let ue of Q)ye[ue]=void 0;let be={...ye,polygons:[],nodes:[],...Z};x[be.parent]==null&&(x[be.parent]=[]),x[be.parent].push(new sl(t,{mvfData:be,categoryIds:((F=(D=e.enterprise)==null?void 0:D.categoryPriorities)==null?void 0:F[be.id])||f[be.id],parentId:Z.parent})),v[be.id]=Z}for(let Z in e.space){let oe=e.space[Z];if(oe!=null)for(let Q of oe.features)for(let ye of Q.properties.destinationNodes)I[ye]==null&&(I[ye]=[]),I[ye].push(Q.properties.id)}for(let Z of(G=(z=e.enterprise)==null?void 0:z.locations)!=null?G:[]){let oe=new sl(t,{mvfData:Z,categoryIds:((K=(j=e.enterprise)==null?void 0:j.categoryPriorities)==null?void 0:K[Z.id])||f[Z.id],locationInstances:x[Z.id]});o[Z.id]=oe,Z.externalId&&(i[Z.externalId]==null&&(i[Z.externalId]=[]),i[Z.externalId].push(oe)),Z.nodes.forEach(Q=>{h[Q.id]==null&&(h[Q.id]=[]),h[Q.id].push(Z.id)});for(let Q of Z.polygons)d[Q.id]==null&&(d[Q.id]=[]),d[Q.id].push(Z)}if(t.enterpriseMode===!0){for(let Z in t.mvfConnectionsById){let oe={},Q=t.mvfConnectionsById[Z];for(let ye of t.mvfConnectionsById[Z].nodes){let be=t.nodesById[ye];be!=null&&(oe[be.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[be.coordinate.longitude,be.coordinate.latitude]},properties:{id:Z,externalId:Q.externalId,kind:"enterprise."+Q.type,destinationNodes:[],flags:"",type:Q.type,nodes:Q.nodes,accessible:Q.accessible,extra:Q.extra,details:Q.details}})}Object.keys(oe).length>0&&(r[Z]=new pp(t,{mvfDataByFloorId:oe}),Q.externalId&&(n[Q.externalId]==null&&(n[Q.externalId]=[]),n[Q.externalId].push(r[Z])))}t.connectionsById=r}return{spaceIdsByNodeId:I,connectionsByExternalId:n,locationIdsByNodeId:h,mvfLocationsBySpaceId:d,mvfLocationsById:s,mvfCategoriesById:u,locationsById:o,locationsByExternalId:i,locationInstancesById:v,categoriesById:a,categoriesByExternalId:l,venue:b}},_H=(e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:o,mvfNodesByFloorId:i}=e1e(e,t),{mvfConnectionsById:s,mvfConnectionsByNodeId:a,mvfConnectionIdsByLatLon:l}=o1e(e,o),{spacesById:u,spacesByExternalId:d,spaceIdsByDestinationNodeId:f,poisById:h,poisByExternalId:b,mvfSpacesById:v,objectEntranceNodeIdsByObstructionId:I,connectionsById:x,connectionIdsByLatLon:C,mvfSpacesByFloorId:P,mvfPoisByFloorId:w}=Qbe(e,a,t),{objectsById:T,objectsByExternalId:O,mvfObstructionById:N,obstructionIdByEntranceId:k}=t1e(e,t),{floorsById:D,floorsByExternalId:F,mvfFloorsById:z}=r1e(e,t),{floorStacksById:G,floorStacksByExternalId:j,mvfFloorStacksById:K,facadesById:Z,facadesBySpaceId:oe}=n1e(e,t),{doorsById:Q,doorsByExternalId:ye,doorsByNodeId:be,mvfEntrancesById:ue,mvfEntrancesByFloorId:_e}=i1e(e,t),{annotationsById:ht,mvfAnnotationsById:ot,mvfAnnotationsByFloorId:Xe}=u1e(e,t),{areasById:Ue,areasByExternalId:pe,mvfAreasById:me}=p1e(e,t);a1e(e,v,N),s1e(e,v,N),l1e(e,v),c1e(e,v,N);let{locationCategoriesByParentId:te,locationProfilesById:ie,locationCategoriesById:A,locationProfilesByExternalId:Y,locationProfilesByCategoryId:L,locationProfilesByAttachedFeatureId:le}=Jbe(e,t);return{spacesById:u,spacesByExternalId:d,nodesById:r,nodesByExternalId:n,objectsById:T,objectsByExternalId:O,floorsById:D,floorsByExternalId:F,floorStacksById:G,floorStacksByExternalId:j,facadesById:Z,facadesBySpaceId:oe,connectionsById:x,doorsById:Q,doorsByExternalId:ye,doorsByNodeId:be,poisById:h,poisByExternalId:b,annotationsById:ht,areasById:Ue,areasByExternalId:pe,spaceIdsByDestinationNodeId:f,objectEntranceNodeIdsByObstructionId:I,obstructionIdByEntranceId:k,connectionIdsByLatLon:C,locationProfilesById:ie,locationCategoriesById:A,locationProfilesByExternalId:Y,locationProfilesByCategoryId:L,locationCategoriesByParentId:te,mvfSpacesById:v,mvfNodesById:o,mvfObstructionById:N,mvfFloorsById:z,mvfFloorStacksById:K,mvfConnectionsById:s,mvfConnectionsByNodeId:a,mvfEntrancesById:ue,mvfAnnotationsById:ot,mvfNodesByFloorId:i,mvfSpacesByFloorId:P,mvfPoisByFloorId:w,mvfAreasById:me,mvfEntrancesByFloorId:_e,mvfAnnotationsByFloorId:Xe,locationProfilesByAttachedFeatureId:le,mvfConnectionIdsByLatLon:l}};p();var d1e=new Set(["polygons"]),Ki,pr,go,_g,Eg=class Eg extends zr{constructor(r,n){super(n.mvfData.externalId);m(this,"__type",Eg.__type);m(this,"description");m(this,"name","");m(this,"amenity");m(this,"externalId","");m(this,"extra");m(this,"gallery");m(this,"instances");m(this,"logo");m(this,"operationHours");m(this,"phone");m(this,"picture");m(this,"shortName");m(this,"showFloatingLabelWhenImagePresent");m(this,"showLogo");m(this,"siblingGroups");m(this,"social");m(this,"sortOrder",-1);m(this,"states");m(this,"tags");m(this,"type","");M(this,Ki);M(this,pr,{});M(this,go);M(this,_g);_(this,Ki,r),_(this,go,n.mvfData),_(this,_g,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let o in n.mvfData)!d1e.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{enumerable:!0,get(){if(n.parentId){let i=c(this,Ki).locationsById[n.parentId];return c(this,go)[o]!=null?c(this,Ki).getPropTranslation(this.__type,o,c(this,go).id,c(this,go)[o]):c(this,Ki).getPropTranslation(this.__type,o,c(this,go).id,i[o])}return c(this,Ki).getPropTranslation(this.__type,o,c(this,go).id,c(this,go)[o])}})}static is(r){return r.__type===Eg.__type}get focusTarget(){return this.spaces}get categories(){return c(this,pr).categories?c(this,pr).categories:(c(this,pr).categories=(c(this,_g).map(r=>c(this,Ki).getById("enterprise-category",r))||[]).filter(Boolean),c(this,pr).categories)}get coordinates(){if(c(this,pr).coordinates)return c(this,pr).coordinates;c(this,pr).coordinates=[];for(let r=0;r<this.nodes.length;r++)c(this,pr).coordinates.push(this.nodes[r].coordinate);return c(this,pr).coordinates}get nodes(){if(c(this,pr).nodes)return c(this,pr).nodes;c(this,pr).nodes=[];for(let r=0;r<c(this,go).nodes.length;r++){let n=c(this,Ki).getById("node",c(this,go).nodes[r].id);n&&c(this,pr).nodes.push(n)}return c(this,pr).nodes}get spaces(){if(c(this,pr).spaces)return c(this,pr).spaces;c(this,pr).spaces=[];for(let r=0;r<c(this,go).polygons.length;r++){let n=c(this,Ki).getById("space",c(this,go).polygons[r].id);n&&c(this,pr).spaces.push(n)}return c(this,pr).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(c(this,pr)))delete c(this,pr)[r]}};Ki=new WeakMap,pr=new WeakMap,go=new WeakMap,_g=new WeakMap,m(Eg,"__type","enterprise-location");var E4=Eg,sl=E4;p();var f1e=new Set,bp,Xn,ta,Ag=class Ag extends zr{constructor(r,n){super(n.mvfData.externalId);m(this,"__type",Ag.__type);m(this,"name","");m(this,"color");m(this,"externalId","");m(this,"extra");m(this,"icon");m(this,"iconFromDefaultList");m(this,"sortOrder",-1);m(this,"picture");M(this,bp);M(this,Xn,{});M(this,ta);_(this,bp,r),_(this,ta,n.mvfData);for(let o in n.mvfData)!f1e.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return c(this,bp).getPropTranslation(this.__type,o,c(this,ta).id,c(this,ta)[o])}})}static is(r){return r.__type===Ag.__type}get children(){if(c(this,Xn).children)return c(this,Xn).children;c(this,Xn).children=[];for(let r=0;r<c(this,ta).children.length;r++){let n=c(this,bp).getById("enterprise-category",c(this,ta).children[r]);n&&c(this,Xn).children.push(n)}return c(this,Xn).children}get locations(){if(c(this,Xn).locations)return c(this,Xn).locations;c(this,Xn).locations=[];for(let r=0;r<c(this,ta).locations.length;r++){let n=c(this,bp).getById("enterprise-location",c(this,ta).locations[r]);n&&c(this,Xn).locations.push(n)}return c(this,Xn).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(c(this,Xn)))delete c(this,Xn)[r]}};bp=new WeakMap,Xn=new WeakMap,ta=new WeakMap,m(Ag,"__type","enterprise-category");var _4=Ag,k2=_4;p();var m1e=new Set,Dg,Fg,kg=class kg extends zr{constructor(r,n){super(n.mvfData.externalId);m(this,"__type",kg.__type);m(this,"countrycode");m(this,"externalId","");m(this,"defaultLanguage",{code:"en",name:"English"});m(this,"defaultMap");m(this,"extra");m(this,"icon");m(this,"languages",[]);m(this,"links",[]);m(this,"logo");m(this,"mappedinWebUrl");m(this,"slug","");m(this,"topLocations");m(this,"tzid");M(this,Dg,{});M(this,Fg);_(this,Fg,n.mvfData);for(let o in n.mvfData)!m1e.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=n.mvfData[o])}static is(r){return r.__type===kg.__type}get name(){var r;return(r=c(this,Fg).name)!=null?r:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let r of Object.keys(c(this,Dg)))delete c(this,Dg)[r]}};Dg=new WeakMap,Fg=new WeakMap,m(kg,"__type","enterprise-venue");var A4=kg,k4=A4;p();function D4(e){var o,i,s,a,l,u;let t=((i=(o=e.enterprise)==null?void 0:o.locations)==null?void 0:i.reduce((d,f)=>(d[f.id]=f,d),{}))||{};for(let d of((s=e.enterprise)==null?void 0:s.locationInstances)||[])t[d.id]=d;let r={};for(let d of e["floorstack.json"]||[])r[d.id]=d;let n={};for(let d of((a=e["floor.geojson"])==null?void 0:a.features)||[])d.properties&&d.properties.id&&(n[d.properties.id]=d.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":t,"enterprise-category":((u=(l=e.enterprise)==null?void 0:l.categories)==null?void 0:u.reduce((d,f)=>(d[f.id]=f,d),{}))||{},"floor-stack":r,floor:n}}}function AH(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}function kH(e){let t=e.split("?")[1];return!!(t!=null&&t.includes("sv="))}p();p();p();p();p();p();p();var vp=class{constructor({origin:t,destination:r,distance:n=0,angle:o=0,pathWeight:i=0,multiplicativeDistanceWeightScaling:s=!0}){m(this,"origin");m(this,"destination");m(this,"distance");m(this,"angle");m(this,"weight");if(this.origin=t,this.destination=r,this.distance=n,this.angle=o,this.weight=i||0,s?t.properties.floor===r.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===r.properties.map&&(this.weight=this.weight>=0?this.distance+this.weight:0),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};p();p();p();function cl(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=ui(e),o=Uf(t),i=o.type,s=t.bbox,a=o.coordinates;if(s&&h1e(n,s)===!1)return!1;i==="Polygon"&&(a=[a]);for(var l=!1,u=0;u<a.length&&!l;u++)if(DH(n,a[u][0],r.ignoreBoundary)){for(var d=!1,f=1;f<a[u].length&&!d;)DH(n,a[u][f],!r.ignoreBoundary)&&(d=!0),f++;d||(l=!0)}return l}function DH(e,t,r){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var o=0,i=t.length-1;o<t.length;i=o++){var s=t[o][0],a=t[o][1],l=t[i][0],u=t[i][1],d=e[1]*(s-l)+a*(l-e[0])+u*(e[0]-s)===0&&(s-e[0])*(l-e[0])<=0&&(a-e[1])*(u-e[1])<=0;if(d)return!r;var f=a>e[1]!=u>e[1]&&e[0]<(l-s)*(e[1]-a)/(u-a)+s;f&&(n=!n)}return n}function h1e(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}p();p();function ul([e,t],[r,n]){let o=t-n,i=e-r;return(Math.atan2(i,o)+Math.PI*3)%(Math.PI*2)}p();var y1e=63710088e-1;function Ji(e,t){let[r,n]=e.map(d=>d*Math.PI/180),[o,i]=t.map(d=>d*Math.PI/180),s=i-n,a=o-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(i)*Math.sin(a/2)*Math.sin(a/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return y1e*u}p();p();function F2(e,t,r,n){let[o,i]=e,[s,a]=t,[l,u]=r,[d,f]=n;if(i===a&&o===s||u===f&&l===d)return null;let h=(d-l)*(a-i)-(f-u)*(s-o);if(h===0)return null;let b=((f-u)*(o-l)-(d-l)*(i-u))/h,v=((a-i)*(o-l)-(s-o)*(i-u))/h;if(b<0||b>1||v<0||v>1)return null;let I=i+b*(a-i);return[o+b*(s-o),I]}p();function F4(e,t,r,n){let o=Yu(e,r/1e3,n),i=Yu(t,r/1e3,n);return[o.geometry.coordinates,i.geometry.coordinates]}p();function L4(e){let t=e*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}var FH=111e3;function LH(e,t,r=[],n=0){let o=!0,i=e.geometry.coordinates,s=t.geometry.coordinates,a=L4(ul(i,s)-Math.PI/2),l=L4(ul(i,s)+Math.PI/2),u=n/FH,d=n/(FH*Math.cos(i[1]*Math.PI/180)),f=Math.min(i[1],s[1])-u,h=Math.max(i[1],s[1])+u,b=Math.min(i[0],s[0])-d,v=Math.max(i[0],s[0])+d;for(let I of r)if(!(Math.max(I[0][1],I[1][1])<f||Math.min(I[0][1],I[1][1])>h||Math.max(I[0][0],I[1][0])<b||Math.min(I[0][0],I[1][0])>v)){if(n>0){let x=F4(i,s,n,a),C=F4(i,s,n,l);if(F2(x[0],x[1],I[0],I[1])||F2(C[0],C[1],I[0],I[1])){o=!1;return}}else if(F2(i,s,I[0],I[1])){o=!1;return}}return o}var xp,mn,R4,RH,NH,BH,$H,jH,GH,R2,L2=class{constructor({nodes:t,groupBy:r,multiplicativeDistanceWeightScaling:n}){M(this,mn);m(this,"edges",{});m(this,"nodesById");m(this,"nodesByGroup",new Map);M(this,xp);M(this,R2,(t,r)=>{let n=0;for(let o of r)(!o[c(this,xp)]||o[c(this,xp)]===t.properties[c(this,xp)])&&cl(t.geometry.coordinates,o.geometry.geometry)&&(n+=Math.max(0,o.cost));return n});_(this,xp,r);let{features:o}=t;this.nodesById=ee(this,mn,RH).call(this,o),ee(this,mn,NH).call(this),ee(this,mn,BH).call(this,o,r,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,r){return r.reduce((n,o)=>{let i=Ji(t.geometry.coordinates,o.geometry.coordinates);return Math.min(n,i)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:r,excludedNodeIds:n,disabledConnectionNodeIds:o,zones:i}){let s=ee(this,mn,R4).call(this,t),a=ee(this,mn,R4).call(this,r);if(s.length===0||a.length===0)return[];let{frontier:l,cameFrom:u,costSoFar:d}=ee(this,mn,$H).call(this,s,a);for(;l.length>0;){let f=l.shift();if(!f)break;if(ee(this,mn,jH).call(this,f.origin,a))return ee(this,mn,GH).call(this,u,f.origin.properties.id);for(let h of this.edges[f.origin.properties.id]){if(o!=null&&o.has(h.origin.properties.id)&&h.destination.properties.map!==h.origin.properties.map)continue;let b=d[f.origin.properties.id]+h.weight+c(this,R2).call(this,h.destination,i);if(!(b===1/0||n!=null&&n.has(h.destination.properties.id))&&(d[h.destination.properties.id]==null||b<d[h.destination.properties.id])){let v=b+this.getShortestEuclideanDistance(h.destination,a);d[h.destination.properties.id]=b,u[h.destination.properties.id]=h,l.push({origin:h.destination,priority:v})}}l.sort((h,b)=>h.priority-b.priority)}return[]}};xp=new WeakMap,mn=new WeakSet,R4=function(t){return t.map(r=>this.nodesById[r]).filter(Boolean)},RH=function(t){return t.reduce((r,n)=>(r[n.properties.id]=n,r),{})},NH=function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:r})=>!!this.nodesById[r]))},BH=function(t,r,n){t.forEach(o=>{let i=r==="default"?r:o.properties[r];this.nodesByGroup.has(i)||this.nodesByGroup.set(i,[]),this.nodesByGroup.get(i).push(o),this.edges[o.properties.id]=o.properties.neighbors.map(({id:s,weight:a})=>{let l=this.nodesById[s],u=Ji(o.geometry.coordinates,l.geometry.coordinates),d=ul(o.geometry.coordinates,l.geometry.coordinates);return new vp({origin:o,destination:l,pathWeight:a,distance:u,angle:d,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},$H=function(t,r){let n=[],o={},i={};return t.forEach(s=>{let a=this.getShortestEuclideanDistance(s,r);n.push({origin:s,priority:a}),o[s.properties.id]=null,i[s.properties.id]=0}),n.sort((s,a)=>s.priority-a.priority),{frontier:n,cameFrom:o,costSoFar:i}},jH=function(t,r){return r.some(n=>n.properties.id===t.properties.id)},GH=function(t,r){let n=[],o=t[r];for(;o;)n.push(o),o=t[o.origin.properties.id];return n.reverse()},R2=new WeakMap;var g1e=.4,dm=class{constructor({nodes:t,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:o}){m(this,"groupBy");m(this,"graph");m(this,"geometryEdgesByMapId",new Map);m(this,"generatePath",t=>{let{destination:r}=t[t.length-1],n={type:"FeatureCollection",features:[]};for(let i=0;i<t.length;i++){let{origin:s,destination:a}=t[i],l={id:s.properties.id,angle:t[i].angle,distance:t[i].distance,destination:a.properties.id,edges:this.graph.edges[s.properties.id]};this.groupBy!=="default"&&(l.groupBy=s.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[s.geometry.coordinates[0],s.geometry.coordinates[1]]},properties:l})}let o={id:r.properties.id,edges:this.graph.edges[r.properties.id]};return this.groupBy!=="default"&&(o.groupBy=r.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[r.geometry.coordinates[0],r.geometry.coordinates[1]]},properties:o}),n});m(this,"getDistance",(t,r)=>Ji(t,r));m(this,"getAngle",(t,r)=>ul(t,r));this.groupBy=n,this.graph=new L2({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:o}),((r==null?void 0:r.features)||[]).forEach(s=>{let a=null;if(s.geometry.type==="LineString"?a=s.geometry.coordinates:s.geometry.type==="Polygon"&&(a=s.geometry.coordinates.flat()),a){let l=this.groupBy==="default"?this.groupBy:s.properties[this.groupBy];this.geometryEdgesByMapId.has(l)||this.geometryEdgesByMapId.set(l,[]),a.forEach((u,d)=>{this.geometryEdgesByMapId.get(l).push([u,a[d+1]||a[0]])})}})}getDirections({zones:t,originIds:r,destinationNodeIds:n,excludedNodeIds:o,disabledConnectionNodeIds:i,simplify:s,multiplicativeDistanceWeightScaling:a}){var f,h;let l=(f=s==null?void 0:s.enabled)!=null?f:!0,u=t!=null?t:[],d=this.graph.aStar({originIds:r,destinationNodeIds:n,zones:u,excludedNodeIds:new Set(o),disabledConnectionNodeIds:new Set(i)});return d.length===0?{type:"FeatureCollection",features:[]}:(l&&(d=this.simplifyAllSteps(d,(h=s==null?void 0:s.bufferRadius)!=null?h:g1e,a)),this.generatePath(d))}simplifyAllSteps(t,r,n){var u,d;let o=[],i=[t[0]];for(let f=1;f<t.length;f++)if(this.groupBy!=="default"&&t[f].origin.properties[this.groupBy]!==t[f-1].origin.properties[this.groupBy]){let h=t[f-1].origin.properties[this.groupBy],b=(u=this.geometryEdgesByMapId.get(h))!=null?u:[];o.push(...this.simplifySteps(i,b,r,n)),i=[t[f]]}else i.push(t[f]);let s=t[t.length-1],a=this.groupBy==="default"?this.groupBy:s.origin.properties[this.groupBy],l=(d=this.geometryEdgesByMapId.get(a))!=null?d:[];return o.push(...this.simplifySteps(i,l,r,n)),o}simplifySteps(t,r,n,o){if(t.length<3)return t;let i=[t[0]],s=1;for(let a=s+2;a<t.length;a++)if(t[s].origin.properties.preventSmoothing||!LH(t[s].origin,t[a].origin,r,n)){let l=a-1;i.push(new vp({...t[s],destination:t[l].origin,distance:Ji(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates),angle:ul(t[s].origin.geometry.coordinates,t[l].origin.geometry.coordinates)})),s=l}return i.push(new vp({...t[s],destination:t[t.length-1].origin,distance:Ji(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:ul(t[s].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:o}),t[t.length-1]),i}};p();function yi(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}function b1e(e){return new Map(e.map(t=>{let{properties:r}=t,{id:n}=r;return[n,t]}))}var N4=(e,t)=>{let r=b1e(t),n={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:e[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let o of e){let i=[o.geometry.coordinates],s=(o.properties.entrances||[]).reduce((a,l)=>(r.has(l)&&a.push(r.get(l)),a),[]);if(s.length){let{entrances:a,obstructions:l}=a4(o,s);i=l.map(u=>u.geometry.coordinates),n.entrances.features.push(...a)}n.walls.geometry.coordinates.push(...i)}return n};function UH(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.text&&(r.text=e.text),e.appearance&&(r.options.appearance=e.appearance),e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!==void 0&&(r.enabled=e.enabled),e.interactive!==null&&(r.options.interactive=e.interactive),e.enabled!==null&&(r.enabled=e.enabled),r}function VH(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!=null&&(r.enabled=e.enabled),e.interactive!=null&&(r.options.interactive=e.interactive),e.enabled!==null&&(r.enabled=e.enabled),r}function N2(e,t){var n,o;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((o=e.topTexture)==null?void 0:o.url)!==void 0&&(r.topTexture=e.topTexture.url),e.opacity!==void 0&&(r.opacity=e.opacity)),r}function B4(e,t){var n,o;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((o=e.topTexture)==null?void 0:o.url)!==void 0&&(r.topTexture=e.topTexture.url),e.height!==void 0&&(r.height=e.height),e.opacity!==void 0&&(r.opacity=e.opacity)),r}function zH(e,t){var n,o;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((o=e.topTexture)==null?void 0:o.url)!==void 0&&(r.topTexture=e.topTexture.url),e.hoverColor!==void 0&&(r.hoverColor=e.hoverColor),e.interactive!==void 0&&(r.interactive=e.interactive),e.height!==void 0&&(r.height=e.height),e.opacity!==void 0&&(r.opacity=e.opacity),e.flipImageToFaceCamera!==void 0&&(r.flipImageToFaceCamera=e.flipImageToFaceCamera)),r}function HH(e,t){return((t-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function WH(e,t){let r="Left";return e<=-Math.PI/4?r="Right":e<=-t?r="SlightRight":e<=t?r="Straight":e<=Math.PI/4?r="SlightLeft":r="Left",r}function qH(e){let t={};for(let r in e){let n=e[r];if(n!=null){if(n.id=r,"polygons"in n)for(let o of n.polygons)t[o]=n;else if("lineStrings"in n)for(let o of n.lineStrings)t[o]=n;else if("points"in n)for(let o of n.points)t[o]=n}}return t}function B2(e,t){return e.reduce((r,n)=>{let o=t[n.properties.id];if(o==null)return r;if("textures"in n.properties&&Array.isArray(n.properties.textures)&&n.properties.textures.length>0){let i={...o,id:o.id+"-textures"};r.set(i,[n])}else r.has(o)||r.set(o,[]),r.get(o).push(n);return r},new Map)}function fm(e,t={}){var o,i,s,a,l,u,d;let r={...e,flipImageToFaceCamera:(o=t==null?void 0:t.flipImagesToFaceCamera)!=null?o:!0},n=(s=(i=t==null?void 0:t.style)==null?void 0:i.shading)!=null?s:t==null?void 0:t.shadingAndOutlines;if(n===!0?r.shading={start:.1,end:.15,intensity:.4}:typeof n=="object"&&(r.shading={start:n.start,end:n.end,intensity:n.intensity}),r.outline=(l=(a=t==null?void 0:t.style)==null?void 0:a.outlines)!=null?l:t==null?void 0:t.shadingAndOutlines,"lineStrings"in e){let f=(d=(u=t==null?void 0:t.style)==null?void 0:u.wallTopColor)!=null?d:t==null?void 0:t.wallTopColor;f!=null&&(r.topColor=f)}return r}var ZH=(e,t)=>{var o;let n=((o=t.currentMap)==null?void 0:o.currentFloor).layers.get(Er);switch(e){case"interior-walls":return n==null?void 0:n.layers.get(Tc);case"exterior-walls":return n==null?void 0:n.layers.get(Js);case"interior-doors":return n==null?void 0:n.layers.get(im);case"exterior-doors":return n==null?void 0:n.layers.get(sm);default:return typeof e=="string"?e:e.id}};function $4(e){return new Promise(t=>{e.onComplete(t),e.onStop(t)})}function $2(e){return e.bbox?e.bbox:Md(e)}function XH(e,t){return[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[2],t[2]),Math.max(e[3],t[3])]}function YH(e){return[...new Set(e)]}function j4(e,t,r){return e.floorId&&t.has(e.floorId)?t.get(e.floorId):r}function mm(e){if(Qr.is(e)||No.is(e))return e.id}function KH(e,t,r){var i,s,a,l,u,d;let n=e.coordinates.length===2,o=!0;if(n&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let f=t==null?void 0:t.getById("floor",e.coordinates[0].floorId),h=t==null?void 0:t.getById("floor",e.coordinates[1].floorId);f&&h&&(o=((s=(i=r.getState(f))==null?void 0:i.visible)!=null?s:!0)&&((l=(a=r.getState(h))==null?void 0:a.visible)!=null?l:!0))}else{let f=e.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",e.coordinates[0].floorId):void 0;o=f&&(d=(u=r.getState(f))==null?void 0:u.visible)!=null?d:!0}return o}var JH=Math.PI*.1,_r,Ln,Yn,Ip,Sp,pl,Cp,ym,gi,QH,hm,eW,U2=class{constructor(t,r,n,o){M(this,gi);M(this,_r,{});M(this,Ln);M(this,Yn);M(this,Ip);M(this,Sp);M(this,pl);M(this,Cp);M(this,ym);_(this,Ln,r),_(this,Yn,t.features),_(this,Ip,n),_(this,Sp,o)}get path(){return c(this,Yn).map(t=>c(this,Ln).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(c(this,_r).departure)return c(this,_r).departure;let t=c(this,Yn)[0].properties.id,r=c(this,Ip)[0];if(c(this,Ip).length>1){for(let n of c(this,Ip))if(Lg(n,c(this,Ln)).includes(t)){r=n;break}}return c(this,_r).departure=r,r}get destination(){if(c(this,_r).destination)return c(this,_r).destination;let t=c(this,Yn)[c(this,Yn).length-1].properties.id,r=c(this,Sp)[0];if(c(this,Sp).length>1){for(let n of c(this,Sp))if(Lg(n,c(this,Ln)).includes(t)){r=n;break}}return c(this,_r).destination=r,r}get coordinates(){return c(this,_r).coordinates?c(this,_r).coordinates:(c(this,_r).coordinates=c(this,Yn).map(t=>new Le(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),c(this,_r).coordinates)}get distance(){return c(this,_r).distance?c(this,_r).distance:(c(this,_r).distance=c(this,Yn).reduce((t,r)=>t+(r.properties.distance||0),0),c(this,_r).distance)}get instructions(){if(c(this,Yn).length<2)return[];if(c(this,_r).instructions)return c(this,_r).instructions;let t=[],r=0;for(let n=0;n<c(this,Yn).length;n++){let o=c(this,Yn)[n],i=c(this,Yn)[n-1],s=c(this,Yn)[n+1],a=new Le(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),l=ee(this,gi,QH).call(this,{prevDirection:i,direction:o,nextDirection:s});r+=(i==null?void 0:i.properties.distance)||0;for(let u of l)u&&(t.push({action:u,distance:r,coordinate:a,node:c(this,Ln).getById("node",o.properties.id)}),r=0)}return c(this,_r).instructions=t,c(this,_r).instructions}};_r=new WeakMap,Ln=new WeakMap,Yn=new WeakMap,Ip=new WeakMap,Sp=new WeakMap,pl=new WeakMap,Cp=new WeakMap,ym=new WeakMap,gi=new WeakSet,QH=function(t){var v,I;let{prevDirection:r,direction:n,nextDirection:o}=t,i=r&&c(this,Ln).getById("floor",r.properties.groupBy),s=c(this,Ln).getById("floor",n.properties.groupBy),a=o&&c(this,Ln).getById("floor",o.properties.groupBy),l=[];r||l.push({type:"Departure"});let u=c(this,Ln).getMVFFeatureByNodeId("connection",n.properties.id),d=u?c(this,Ln).getById("connection",u.id):void 0,f=u&&u.nodes.length>1,h=c(this,Ln).enterpriseMode&&(!n.properties.destination||!(u!=null&&u.nodes.includes(n.properties.destination))||!(u!=null&&u.nodes.includes(n.properties.id)));if(u&&!(!f||h))if(!c(this,pl)||c(this,pl)==="exit")l.push(ee(this,gi,hm).call(this,"TakeConnection",s,a,d,u)),_(this,pl,"take"),_(this,Cp,d),_(this,ym,u);else{let x=c(this,Ln).getMVFFeatureByNodeId("connection",(v=r==null?void 0:r.properties.id)!=null?v:""),C=c(this,Ln).getById("connection",(I=x==null?void 0:x.id)!=null?I:"");l.push(ee(this,gi,hm).call(this,"ExitConnection",s,i,C,x)),_(this,pl,"exit"),_(this,Cp,d),_(this,ym,u)}else c(this,pl)==="take"?(l.push(ee(this,gi,hm).call(this,"ExitConnection",s,i,c(this,Cp),c(this,ym))),_(this,pl,"exit"),_(this,Cp,d)):a&&s.id!==a.id?l.push(ee(this,gi,hm).call(this,"TakeConnection",s,a,d)):i&&i.id!==s.id?l.push(ee(this,gi,hm).call(this,"ExitConnection",s,i,d)):l.push(ee(this,gi,eW).call(this,r,n));return o||l.push({type:"Arrival"}),l},hm=function(t,r,n,o,i){var l,u;let s="none";if(r.elevation!=null&&(n==null?void 0:n.elevation)!=null){let d=r.elevation-n.elevation;d>0?s="down":d<0&&(s="up")}let a=(u=(l=o==null?void 0:o.type)!=null?l:i==null?void 0:i.type)!=null?u:"stairs";return{type:t,fromFloor:r,toFloor:n,direction:s,connection:o,connectionType:a}},eW=function(t,r){let n=r.properties.edges;if(!n||n.filter(s=>s.destination.properties.id!==(t==null?void 0:t.properties.id)&&s.destination.properties.id!==r.properties.destination).length===0)return null;let i=t?-HH(t.properties.angle,r.properties.angle):0;return Math.abs(i)>=JH?{type:"Turn",bearing:WH(i,JH),referencePosition:"At"}:null};var V2=class{constructor({nodes:t,geojsonCollection:r,connections:n,groupBy:o,multiplicativeDistanceWeightScaling:i}){m(this,"navigator");m(this,"connections");m(this,"getDirections",(t,r,n,o)=>{let{accessible:i,smoothing:{enabled:s,radius:a}}=n,l=t.flatMap(v=>Lg(v,o)),u=r.flatMap(v=>Lg(v,o)),d=this.getExcludedNodeIds(n.excludedConnections).filter(v=>!l.includes(v)&&!u.includes(v)),f=this.getDisabledConnectionNodeIds(i).filter(v=>!l.includes(v)&&!u.includes(v)),h=this.navigator.getDirections({zones:n.zones.map(v=>{var I;return{geometry:v.geometry,cost:v.cost,map:(I=v.floor)==null?void 0:I.id}}),originIds:l,destinationNodeIds:u,excludedNodeIds:d,disabledConnectionNodeIds:f,simplify:{enabled:s,bufferRadius:a},multiplicativeDistanceWeightScaling:!o.enterpriseMode});this.addCoordinateDirections(h,t,r);let b=new U2(h,o,t,r);if(!(b.distance===0&&new Set([...l,...u]).size===l.length+u.length))return b});m(this,"getExcludedNodeIds",t=>{if(t.length===0)return[];let r=new Set(t.map(n=>n.id));return this.connections.reduce((n,o)=>r.has(o.id)?n.concat(o.nodes):n,[])});m(this,"getDisabledConnectionNodeIds",t=>t===!1?[]:this.connections.reduce((r,n)=>n.accessible?r:r.concat(n.nodes),[]));m(this,"addCoordinateDirections",(t,[r],[n])=>{if(t.features.length){if(Le.is(r)){let o=this.createDirectionFeature(r,this.navigator.getAngle([r.longitude,r.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([r.longitude,r.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,o)}if(Le.is(n)){let o=this.createDirectionFeature(n,0,0),i=t.features[t.features.length-1];i.properties.distance=this.navigator.getDistance(i.geometry.coordinates,[n.longitude,n.latitude]),i.properties.angle=this.navigator.getAngle(i.geometry.coordinates,[n.longitude,n.latitude]),t.features.push(o)}}});m(this,"createDirectionFeature",(t,r,n)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:r,distance:n,edges:[]}}));this.navigator=new dm({nodes:t,geojsonCollection:this.createCollection(r),groupBy:o,multiplicativeDistanceWeightScaling:i}),this.connections=n}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((r,[n,o])=>r.concat(o.features.map(i=>(i.properties.map=n,i))),[])}}};function Lg(e,t){var r,n,o,i;if(pm.is(e))return e.navigationTarget.flatMap(s=>Lg(s,t));if(Pc.is(e)){let s=t.Query.nearest(e,{types:["node"]});return(r=s==null?void 0:s[0])!=null&&r.feature.id?[s[0].feature.id]:[]}else if(Le.is(e)){let s=t.Query.nearest(e,{types:["node"]});return(n=s==null?void 0:s[0])!=null&&n.feature.id?[s[0].feature.id]:[]}else if(Cc.is(e)){let s=t.Query.nearest(e,{types:["node"]});return(o=s==null?void 0:s[0])!=null&&o.feature.id?[s[0].feature.id]:[]}else if(Ys.is(e)){let s=t==null?void 0:t.getMVFFeatureById("entrance",e.id);return s!=null&&s.properties.node?[s==null?void 0:s.properties.node]:[]}else if(Ic.is(e)){let s=t==null?void 0:t.getMVFFeatureById("area",e.id);return(i=s==null?void 0:s.properties.destinationNodes)!=null?i:[]}else if(Qr.is(e)){let s=t==null?void 0:t.getMVFFeatureById("space",e.id);return s==null?[]:s.properties.destinationNodes}else{if(pp.is(e))return e.coordinates.reduce((s,a)=>{var u;let l=t.Query.nearest(a,{types:["node"]});return(u=l==null?void 0:l[0])!=null&&u.feature.id&&s.push(l[0].feature.id),s},[]);if(No.is(e)){let s=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return s!=null?s:[]}else return Xi.is(e)?e.spaces.flatMap(s=>{var a,l;return(l=(a=t==null?void 0:t.getMVFFeatureById("space",s.id))==null?void 0:a.properties.destinationNodes)!=null?l:[]}).filter(s=>typeof s=="string"):sl.is(e)?e.nodes.map(s=>s.id):vc.is(e)?[e.id]:[]}}p();p();p();p();p();p();function tW(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return rW(this.cover(t,r),t,r,e)}function rW(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var o,i=e._root,s={data:n},a=e._x0,l=e._y0,u=e._x1,d=e._y1,f,h,b,v,I,x,C,P;if(!i)return e._root=s,e;for(;i.length;)if((I=t>=(f=(a+u)/2))?a=f:u=f,(x=r>=(h=(l+d)/2))?l=h:d=h,o=i,!(i=i[C=x<<1|I]))return o[C]=s,e;if(b=+e._x.call(null,i.data),v=+e._y.call(null,i.data),t===b&&r===v)return s.next=i,o?o[C]=s:e._root=s,e;do o=o?o[C]=new Array(4):e._root=new Array(4),(I=t>=(f=(a+u)/2))?a=f:u=f,(x=r>=(h=(l+d)/2))?l=h:d=h;while((C=x<<1|I)===(P=(v>=h)<<1|b>=f));return o[P]=i,o[C]=s,e}function nW(e){var t,r,n=e.length,o,i,s=new Array(n),a=new Array(n),l=1/0,u=1/0,d=-1/0,f=-1/0;for(r=0;r<n;++r)isNaN(o=+this._x.call(null,t=e[r]))||isNaN(i=+this._y.call(null,t))||(s[r]=o,a[r]=i,o<l&&(l=o),o>d&&(d=o),i<u&&(u=i),i>f&&(f=i));if(l>d||u>f)return this;for(this.cover(l,u).cover(d,f),r=0;r<n;++r)rW(this,s[r],a[r],e[r]);return this}p();function oW(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,o=this._x1,i=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,i=(n=Math.floor(t))+1;else{for(var s=o-r||1,a=this._root,l,u;r>e||e>=o||n>t||t>=i;)switch(u=(t<n)<<1|e<r,l=new Array(4),l[u]=a,a=l,s*=2,u){case 0:o=r+s,i=n+s;break;case 1:r=o-s,i=n+s;break;case 2:o=r+s,n=i-s;break;case 3:r=o-s,n=i-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=r,this._y0=n,this._x1=o,this._y1=i,this}p();function iW(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}p();function sW(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]]}p();p();function en(e,t,r,n,o){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=o}function aW(e,t,r){var n,o=this._x0,i=this._y0,s,a,l,u,d=this._x1,f=this._y1,h=[],b=this._root,v,I;for(b&&h.push(new en(b,o,i,d,f)),r==null?r=1/0:(o=e-r,i=t-r,d=e+r,f=t+r,r*=r);v=h.pop();)if(!(!(b=v.node)||(s=v.x0)>d||(a=v.y0)>f||(l=v.x1)<o||(u=v.y1)<i))if(b.length){var x=(s+l)/2,C=(a+u)/2;h.push(new en(b[3],x,C,l,u),new en(b[2],s,C,x,u),new en(b[1],x,a,l,C),new en(b[0],s,a,x,C)),(I=(t>=C)<<1|e>=x)&&(v=h[h.length-1],h[h.length-1]=h[h.length-1-I],h[h.length-1-I]=v)}else{var P=e-+this._x.call(null,b.data),w=t-+this._y.call(null,b.data),T=P*P+w*w;if(T<r){var O=Math.sqrt(r=T);o=e-O,i=t-O,d=e+O,f=t+O,n=b.data}}return n}p();function lW(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,r=this._root,n,o,i,s=this._x0,a=this._y0,l=this._x1,u=this._y1,d,f,h,b,v,I,x,C;if(!r)return this;if(r.length)for(;;){if((v=d>=(h=(s+l)/2))?s=h:l=h,(I=f>=(b=(a+u)/2))?a=b:u=b,t=r,!(r=r[x=I<<1|v]))return this;if(!r.length)break;(t[x+1&3]||t[x+2&3]||t[x+3&3])&&(n=t,C=x)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(i=r.next)&&delete r.next,o?(i?o.next=i:delete o.next,this):t?(i?t[x]=i:delete t[x],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[C]=r:this._root=r),this):(this._root=i,this)}function cW(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}p();function uW(){return this._root}p();function pW(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}p();function dW(e){var t=[],r,n=this._root,o,i,s,a,l;for(n&&t.push(new en(n,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(n=r.node,i=r.x0,s=r.y0,a=r.x1,l=r.y1)&&n.length){var u=(i+a)/2,d=(s+l)/2;(o=n[3])&&t.push(new en(o,u,d,a,l)),(o=n[2])&&t.push(new en(o,i,d,u,l)),(o=n[1])&&t.push(new en(o,u,s,a,d)),(o=n[0])&&t.push(new en(o,i,s,u,d))}return this}p();function fW(e){var t=[],r=[],n;for(this._root&&t.push(new en(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var o=n.node;if(o.length){var i,s=n.x0,a=n.y0,l=n.x1,u=n.y1,d=(s+l)/2,f=(a+u)/2;(i=o[0])&&t.push(new en(i,s,a,d,f)),(i=o[1])&&t.push(new en(i,d,a,l,f)),(i=o[2])&&t.push(new en(i,s,f,d,u)),(i=o[3])&&t.push(new en(i,d,f,l,u))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}p();function mW(e){return e[0]}function hW(e){return arguments.length?(this._x=e,this):this._x}p();function yW(e){return e[1]}function gW(e){return arguments.length?(this._y=e,this):this._y}function Rg(e,t,r){var n=new G4(t==null?mW:t,r==null?yW:r,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}function G4(e,t,r,n,o,i){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=o,this._y1=i,this._root=void 0}function bW(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var Kn=Rg.prototype=G4.prototype;Kn.copy=function(){var e=new G4(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,r,n;if(!t)return e;if(!t.length)return e._root=bW(t),e;for(r=[{source:t,target:e._root=new Array(4)}];t=r.pop();)for(var o=0;o<4;++o)(n=t.source[o])&&(n.length?r.push({source:n,target:t.target[o]=new Array(4)}):t.target[o]=bW(n));return e};Kn.add=tW;Kn.addAll=nW;Kn.cover=oW;Kn.data=iW;Kn.extent=sW;Kn.find=aW;Kn.remove=lW;Kn.removeAll=cW;Kn.root=uW;Kn.size=pW;Kn.visit=dW;Kn.visitAfter=fW;Kn.x=hW;Kn.y=gW;var Bo,Ac,z2=class{constructor(t){M(this,Bo,{});M(this,Ac);_(this,Ac,t)}getTreeByType(t,r,n){var s;if(c(this,Bo)[t]||(c(this,Bo)[t]={}),c(this,Bo)[t][r]&&c(this,Bo)[t][r][n])return c(this,Bo)[t][r][n];c(this,Bo)[t][r]||(c(this,Bo)[t][r]={}),c(this,Bo)[t][r][n]||(c(this,Bo)[t][r][n]=Rg());let o=c(this,Bo)[t][r][n];o.x(a=>a.geometry.coordinates[1]),o.y(a=>a.geometry.coordinates[0]);let i=[];switch(t){case"node":i=((s=c(this,Ac).directions.navigator.graph.nodesByGroup.get(n))==null?void 0:s.filter(a=>a.properties.neighbors.length>0))||[];break;case"point-of-interest":i=c(this,Ac).mvfPoisByFloorId[n]||[];break;case"door":i=c(this,Ac).mvfEntrancesByFloorId[n]||[];break;case"annotation":i=c(this,Ac).mvfAnnotationsByFloorId[n]||[];break}return(i==null?void 0:i.length)>0&&o.addAll(i),o}};Bo=new WeakMap,Ac=new WeakMap;p();var Pt;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?"'".concat(s,"'"):s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Pt||(Pt={}));var V4;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(V4||(V4={}));var he=Pt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),kc=e=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":return Array.isArray(e)?he.array:e===null?he.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?he.promise:typeof Map<"u"&&e instanceof Map?he.map:typeof Set<"u"&&e instanceof Set?he.set:typeof Date<"u"&&e instanceof Date?he.date:he.object;default:return he.unknown}},se=Pt.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"]),v1e=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),$o=class e extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,l=0;for(;l<s.path.length;){let u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,Pt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};$o.create=e=>new $o(e);var vm=(e,t)=>{let r;switch(e.code){case se.invalid_type:e.received===he.undefined?r="Required":r="Expected ".concat(e.expected,", received ").concat(e.received);break;case se.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,Pt.jsonStringifyReplacer));break;case se.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(Pt.joinValues(e.keys,", "));break;case se.invalid_union:r="Invalid input";break;case se.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(Pt.joinValues(e.options));break;case se.invalid_enum_value:r="Invalid enum value. Expected ".concat(Pt.joinValues(e.options),", received '").concat(e.received,"'");break;case se.invalid_arguments:r="Invalid function arguments";break;case se.invalid_return_type:r="Invalid function return type";break;case se.invalid_date:r="Invalid date";break;case se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),typeof e.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):Pt.assertNever(e.validation):e.validation!=="regex"?r="Invalid ".concat(e.validation):r="Invalid";break;case se.too_small:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):r="Invalid input";break;case se.too_big:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="bigint"?r="BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):r="Invalid input";break;case se.custom:r="Invalid input";break;case se.invalid_intersection_types:r="Intersection results could not be merged";break;case se.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case se.not_finite:r="Number must be finite";break;default:r=t.defaultError,Pt.assertNever(e)}return{message:r}},IW=vm;function x1e(e){IW=e}function H2(){return IW}var W2=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",l=n.filter(u=>!!u).slice().reverse();for(let u of l)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},I1e=[];function de(e,t){let r=H2(),n=W2({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===vm?void 0:vm].filter(o=>!!o)});e.common.issues.push(n)}var Rn=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Be;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Be;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},Be=Object.freeze({status:"aborted"}),bm=e=>({status:"dirty",value:e}),Jn=e=>({status:"valid",value:e}),z4=e=>e.status==="aborted",H4=e=>e.status==="dirty",$g=e=>e.status==="valid",jg=e=>typeof Promise<"u"&&e instanceof Promise;function q2(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function SW(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}var Me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Me||(Me={}));var Ng,Bg,vi=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vW=(e,t)=>{if($g(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new $o(e.common.issues);return this._error=r,this._error}}};function He(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:o}:{errorMap:(s,a)=>{var l,u;let{message:d}=e;return s.code==="invalid_enum_value"?{message:d!=null?d:a.defaultError}:typeof a.data>"u"?{message:(l=d!=null?d:n)!==null&&l!==void 0?l:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(u=d!=null?d:r)!==null&&u!==void 0?u:a.defaultError}},description:o}}var We=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return kc(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:kc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Rn,ctx:{common:t.parent.common,data:t.data,parsedType:kc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(jg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let o={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:kc(t)},i=this._parseSync({data:t,path:o.path,parent:o});return vW(o,i)}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:kc(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(jg(o)?o:Promise.resolve(o));return vW(n,i)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=t(o),a=()=>i.addIssue({code:se.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new jo({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return bi.create(this,this._def)}nullable(){return na.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ml.create(this,this._def)}promise(){return Lc.create(this,this._def)}or(t){return _p.create([this,t],this._def)}and(t){return Ap.create(this,t,this._def)}transform(t){return new jo({...He(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Rp({...He(this._def),innerType:this,defaultValue:r,typeName:Re.ZodDefault})}brand(){return new Gg({typeName:Re.ZodBranded,type:this,...He(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Np({...He(this._def),innerType:this,catchValue:r,typeName:Re.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Ug.create(this,t)}readonly(){return Bp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},S1e=/^c[^\s-]{8,}$/i,C1e=/^[0-9a-z]+$/,P1e=/^[0-9A-HJKMNP-TV-Z]{26}$/,T1e=/^[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,w1e=/^[a-z0-9_-]{21}$/i,M1e=/^[-+]?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)?)??$/,O1e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,E1e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",U4,_1e=/^(?:(?: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])$/,A1e=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,k1e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,CW="((\\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])))",D1e=new RegExp("^".concat(CW,"$"));function PW(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?")),t}function F1e(e){return new RegExp("^".concat(PW(e),"$"))}function TW(e){let t="".concat(CW,"T").concat(PW(e)),r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(r.join("|"),")"),new RegExp("^".concat(t,"$"))}function L1e(e,t){return!!((t==="v4"||!t)&&_1e.test(e)||(t==="v6"||!t)&&A1e.test(e))}var Dc=class e extends We{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==he.string){let i=this._getOrReturnCtx(t);return de(i,{code:se.invalid_type,expected:he.string,received:i.parsedType}),Be}let n=new Rn,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),de(o,{code:se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),de(o,{code:se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?de(o,{code:se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&de(o,{code:se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")O1e.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"email",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")U4||(U4=new RegExp(E1e,"u")),U4.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"emoji",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")T1e.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"uuid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")w1e.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"nanoid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")S1e.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"cuid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")C1e.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"cuid2",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")P1e.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"ulid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),de(o,{validation:"url",code:se.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"regex",code:se.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),de(o,{code:se.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),de(o,{code:se.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),de(o,{code:se.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?TW(i).test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{code:se.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?D1e.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{code:se.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?F1e(i).test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{code:se.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?M1e.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"duration",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?L1e(t.data,i.version)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"ip",code:se.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?k1e.test(t.data)||(o=this._getOrReturnCtx(t,o),de(o,{validation:"base64",code:se.invalid_string,message:i.message}),n.dirty()):Pt.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:se.invalid_string,...Me.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Me.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Me.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Me.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...Me.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Me.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Me.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Me.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Me.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Me.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Me.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Me.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Me.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Me.errToObj(r)})}nonempty(t){return this.min(1,Me.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Dc.create=e=>{var t;return new Dc({checks:[],typeName:Re.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};function R1e(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=parseInt(e.toFixed(o).replace(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}var Pp=class e extends We{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==he.number){let i=this._getOrReturnCtx(t);return de(i,{code:se.invalid_type,expected:he.number,received:i.parsedType}),Be}let n,o=new Rn;for(let i of this._def.checks)i.kind==="int"?Pt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),de(n,{code:se.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:se.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:se.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?R1e(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),de(n,{code:se.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),de(n,{code:se.not_finite,message:i.message}),o.dirty()):Pt.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Me.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Me.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Me.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Me.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Me.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Me.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Me.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Me.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Pt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Pp.create=e=>new Pp({checks:[],typeName:Re.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});var Tp=class e extends We{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==he.bigint){let i=this._getOrReturnCtx(t);return de(i,{code:se.invalid_type,expected:he.bigint,received:i.parsedType}),Be}let n,o=new Rn;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:se.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:se.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),de(n,{code:se.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Pt.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Me.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Me.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Me.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Me.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Me.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Me.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Me.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Tp.create=e=>{var t;return new Tp({checks:[],typeName:Re.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...He(e)})};var wp=class extends We{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==he.boolean){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:he.boolean,received:n.parsedType}),Be}return Jn(t.data)}};wp.create=e=>new wp({typeName:Re.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});var Mp=class e extends We{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==he.date){let i=this._getOrReturnCtx(t);return de(i,{code:se.invalid_type,expected:he.date,received:i.parsedType}),Be}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return de(i,{code:se.invalid_date}),Be}let n=new Rn,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),de(o,{code:se.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),de(o,{code:se.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Pt.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Me.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Me.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Mp.create=e=>new Mp({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Re.ZodDate,...He(e)});var xm=class extends We{_parse(t){if(this._getType(t)!==he.symbol){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:he.symbol,received:n.parsedType}),Be}return Jn(t.data)}};xm.create=e=>new xm({typeName:Re.ZodSymbol,...He(e)});var Op=class extends We{_parse(t){if(this._getType(t)!==he.undefined){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:he.undefined,received:n.parsedType}),Be}return Jn(t.data)}};Op.create=e=>new Op({typeName:Re.ZodUndefined,...He(e)});var Ep=class extends We{_parse(t){if(this._getType(t)!==he.null){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:he.null,received:n.parsedType}),Be}return Jn(t.data)}};Ep.create=e=>new Ep({typeName:Re.ZodNull,...He(e)});var Fc=class extends We{constructor(){super(...arguments),this._any=!0}_parse(t){return Jn(t.data)}};Fc.create=e=>new Fc({typeName:Re.ZodAny,...He(e)});var fl=class extends We{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Jn(t.data)}};fl.create=e=>new fl({typeName:Re.ZodUnknown,...He(e)});var Qi=class extends We{_parse(t){let r=this._getOrReturnCtx(t);return de(r,{code:se.invalid_type,expected:he.never,received:r.parsedType}),Be}};Qi.create=e=>new Qi({typeName:Re.ZodNever,...He(e)});var Im=class extends We{_parse(t){if(this._getType(t)!==he.undefined){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:he.void,received:n.parsedType}),Be}return Jn(t.data)}};Im.create=e=>new Im({typeName:Re.ZodVoid,...He(e)});var ml=class e extends We{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==he.array)return de(r,{code:se.invalid_type,expected:he.array,received:r.parsedType}),Be;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(de(r,{code:s?se.too_big:se.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(de(r,{code:se.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(de(r,{code:se.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new vi(r,s,r.path,a)))).then(s=>Rn.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new vi(r,s,r.path,a)));return Rn.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Me.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Me.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Me.toString(r)}})}nonempty(t){return this.min(1,t)}};ml.create=(e,t)=>new ml({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...He(t)});function gm(e){if(e instanceof bo){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=bi.create(gm(n))}return new bo({...e._def,shape:()=>t})}else return e instanceof ml?new ml({...e._def,type:gm(e.element)}):e instanceof bi?bi.create(gm(e.unwrap())):e instanceof na?na.create(gm(e.unwrap())):e instanceof ra?ra.create(e.items.map(t=>gm(t))):e}var bo=class e extends We{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Pt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==he.object){let u=this._getOrReturnCtx(t);return de(u,{code:se.invalid_type,expected:he.object,received:u.parsedType}),Be}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Qi&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let l=[];for(let u of s){let d=i[u],f=o.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new vi(o,f,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Qi){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")a.length>0&&(de(o,{code:se.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of a){let f=o.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new vi(o,f,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>Rn.mergeObjectSync(n,u)):Rn.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Me.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var o,i,s,a;let l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Me.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Re.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return Pt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return Pt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}deepPartial(){return gm(this)}partial(t){let r={};return Pt.objectKeys(this.shape).forEach(n=>{let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return Pt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof bi;)i=i._def.innerType;r[n]=i}}),new e({...this._def,shape:()=>r})}keyof(){return wW(Pt.objectKeys(this.shape))}};bo.create=(e,t)=>new bo({shape:()=>e,unknownKeys:"strip",catchall:Qi.create(),typeName:Re.ZodObject,...He(t)});bo.strictCreate=(e,t)=>new bo({shape:()=>e,unknownKeys:"strict",catchall:Qi.create(),typeName:Re.ZodObject,...He(t)});bo.lazycreate=(e,t)=>new bo({shape:e,unknownKeys:"strip",catchall:Qi.create(),typeName:Re.ZodObject,...He(t)});var _p=class extends We{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new $o(a.ctx.common.issues));return de(r,{code:se.invalid_union,unionErrors:s}),Be}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let l of n){let u={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(l=>new $o(l));return de(r,{code:se.invalid_union,unionErrors:a}),Be}}get options(){return this._def.options}};_p.create=(e,t)=>new _p({options:e,typeName:Re.ZodUnion,...He(t)});var dl=e=>e instanceof kp?dl(e.schema):e instanceof jo?dl(e.innerType()):e instanceof Dp?[e.value]:e instanceof Fp?e.options:e instanceof Lp?Pt.objectValues(e.enum):e instanceof Rp?dl(e._def.innerType):e instanceof Op?[void 0]:e instanceof Ep?[null]:e instanceof bi?[void 0,...dl(e.unwrap())]:e instanceof na?[null,...dl(e.unwrap())]:e instanceof Gg||e instanceof Bp?dl(e.unwrap()):e instanceof Np?dl(e._def.innerType):[],Z2=class e extends We{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==he.object)return de(r,{code:se.invalid_type,expected:he.object,received:r.parsedType}),Be;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(de(r,{code:se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let s=dl(i.shape[t]);if(!s.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let a of s){if(o.has(a))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(a)));o.set(a,i)}}return new e({typeName:Re.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...He(n)})}};function W4(e,t){let r=kc(e),n=kc(t);if(e===t)return{valid:!0,data:e};if(r===he.object&&n===he.object){let o=Pt.objectKeys(t),i=Pt.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let l=W4(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(r===he.array&&n===he.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],l=W4(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return r===he.date&&n===he.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Ap=class extends We{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(z4(i)||z4(s))return Be;let a=W4(i.value,s.value);return a.valid?((H4(i)||H4(s))&&r.dirty(),{status:r.value,value:a.data}):(de(n,{code:se.invalid_intersection_types}),Be)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ap.create=(e,t,r)=>new Ap({left:e,right:t,typeName:Re.ZodIntersection,...He(r)});var ra=class e extends We{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==he.array)return de(n,{code:se.invalid_type,expected:he.array,received:n.parsedType}),Be;if(n.data.length<this._def.items.length)return de(n,{code:se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Be;!this._def.rest&&n.data.length>this._def.items.length&&(de(n,{code:se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new vi(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>Rn.mergeArray(r,s)):Rn.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ra.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ra({items:e,typeName:Re.ZodTuple,rest:null,...He(t)})};var X2=class e extends We{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==he.object)return de(n,{code:se.invalid_type,expected:he.object,received:n.parsedType}),Be;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new vi(n,a,n.path,a)),value:s._parse(new vi(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Rn.mergeObjectAsync(r,o):Rn.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof We?new e({keyType:t,valueType:r,typeName:Re.ZodRecord,...He(n)}):new e({keyType:Dc.create(),valueType:t,typeName:Re.ZodRecord,...He(r)})}},Sm=class extends We{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==he.map)return de(n,{code:se.invalid_type,expected:he.map,received:n.parsedType}),Be;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,l],u)=>({key:o._parse(new vi(n,a,n.path,[u,"key"])),value:i._parse(new vi(n,l,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return Be;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let l of s){let u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return Be;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}};Sm.create=(e,t,r)=>new Sm({valueType:t,keyType:e,typeName:Re.ZodMap,...He(r)});var Cm=class e extends We{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==he.set)return de(n,{code:se.invalid_type,expected:he.set,received:n.parsedType}),Be;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(de(n,{code:se.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(de(n,{code:se.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(l){let u=new Set;for(let d of l){if(d.status==="aborted")return Be;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((l,u)=>i._parse(new vi(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:Me.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Me.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Cm.create=(e,t)=>new Cm({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,...He(t)});var Y2=class e extends We{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==he.function)return de(r,{code:se.invalid_type,expected:he.function,received:r.parsedType}),Be;function n(a,l){return W2({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,H2(),vm].filter(u=>!!u),issueData:{code:se.invalid_arguments,argumentsError:l}})}function o(a,l){return W2({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,H2(),vm].filter(u=>!!u),issueData:{code:se.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Lc){let a=this;return Jn(async function(...l){let u=new $o([]),d=await a._def.args.parseAsync(l,i).catch(b=>{throw u.addIssue(n(l,b)),u}),f=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(f,i).catch(b=>{throw u.addIssue(o(f,b)),u})})}else{let a=this;return Jn(function(...l){let u=a._def.args.safeParse(l,i);if(!u.success)throw new $o([n(l,u.error)]);let d=Reflect.apply(s,this,u.data),f=a._def.returns.safeParse(d,i);if(!f.success)throw new $o([o(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ra.create(t).rest(fl.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ra.create([]).rest(fl.create()),returns:r||fl.create(),typeName:Re.ZodFunction,...He(n)})}},kp=class extends We{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};kp.create=(e,t)=>new kp({getter:e,typeName:Re.ZodLazy,...He(t)});var Dp=class extends We{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return de(r,{received:r.data,code:se.invalid_literal,expected:this._def.value}),Be}return{status:"valid",value:t.data}}get value(){return this._def.value}};Dp.create=(e,t)=>new Dp({value:e,typeName:Re.ZodLiteral,...He(t)});function wW(e,t){return new Fp({values:e,typeName:Re.ZodEnum,...He(t)})}var Fp=class e extends We{constructor(){super(...arguments),Ng.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return de(r,{expected:Pt.joinValues(n),received:r.parsedType,code:se.invalid_type}),Be}if(q2(this,Ng,"f")||SW(this,Ng,new Set(this._def.values),"f"),!q2(this,Ng,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return de(r,{received:r.data,code:se.invalid_enum_value,options:n}),Be}return Jn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ng=new WeakMap;Fp.create=wW;var Lp=class extends We{constructor(){super(...arguments),Bg.set(this,void 0)}_parse(t){let r=Pt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==he.string&&n.parsedType!==he.number){let o=Pt.objectValues(r);return de(n,{expected:Pt.joinValues(o),received:n.parsedType,code:se.invalid_type}),Be}if(q2(this,Bg,"f")||SW(this,Bg,new Set(Pt.getValidEnumValues(this._def.values)),"f"),!q2(this,Bg,"f").has(t.data)){let o=Pt.objectValues(r);return de(n,{received:n.data,code:se.invalid_enum_value,options:o}),Be}return Jn(t.data)}get enum(){return this._def.values}};Bg=new WeakMap;Lp.create=(e,t)=>new Lp({values:e,typeName:Re.ZodNativeEnum,...He(t)});var Lc=class extends We{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==he.promise&&r.common.async===!1)return de(r,{code:se.invalid_type,expected:he.promise,received:r.parsedType}),Be;let n=r.parsedType===he.promise?r.data:Promise.resolve(r.data);return Jn(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Lc.create=(e,t)=>new Lc({type:e,typeName:Re.ZodPromise,...He(t)});var jo=class extends We{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{de(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return Be;let l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Be:l.status==="dirty"||r.value==="dirty"?bm(l.value):l});{if(r.value==="aborted")return Be;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?Be:a.status==="dirty"||r.value==="dirty"?bm(a.value):a}}if(o.type==="refinement"){let s=a=>{let l=o.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Be:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Be:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!$g(s))return s;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>$g(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):s);Pt.assertNever(o)}};jo.create=(e,t,r)=>new jo({schema:e,typeName:Re.ZodEffects,effect:t,...He(r)});jo.createWithPreprocess=(e,t,r)=>new jo({schema:t,effect:{type:"preprocess",transform:e},typeName:Re.ZodEffects,...He(r)});var bi=class extends We{_parse(t){return this._getType(t)===he.undefined?Jn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};bi.create=(e,t)=>new bi({innerType:e,typeName:Re.ZodOptional,...He(t)});var na=class extends We{_parse(t){return this._getType(t)===he.null?Jn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};na.create=(e,t)=>new na({innerType:e,typeName:Re.ZodNullable,...He(t)});var Rp=class extends We{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===he.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rp.create=(e,t)=>new Rp({innerType:e,typeName:Re.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...He(t)});var Np=class extends We{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return jg(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new $o(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new $o(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Np.create=(e,t)=>new Np({innerType:e,typeName:Re.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...He(t)});var Pm=class extends We{_parse(t){if(this._getType(t)!==he.nan){let n=this._getOrReturnCtx(t);return de(n,{code:se.invalid_type,expected:he.nan,received:n.parsedType}),Be}return{status:"valid",value:t.data}}};Pm.create=e=>new Pm({typeName:Re.ZodNaN,...He(e)});var N1e=Symbol("zod_brand"),Gg=class extends We{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ug=class e extends We{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Be:i.status==="dirty"?(r.dirty(),bm(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Be:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:Re.ZodPipeline})}},Bp=class extends We{_parse(t){let r=this._def.innerType._parse(t),n=o=>($g(o)&&(o.value=Object.freeze(o.value)),o);return jg(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Bp.create=(e,t)=>new Bp({innerType:e,typeName:Re.ZodReadonly,...He(t)});function MW(e,t={},r){return e?Fc.create().superRefine((n,o)=>{var i,s;if(!e(n)){let a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(s=(i=a.fatal)!==null&&i!==void 0?i:r)!==null&&s!==void 0?s:!0,u=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...u,fatal:l})}}):Fc.create()}var B1e={object:bo.lazycreate},Re;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Re||(Re={}));var $1e=(e,t={message:"Input not instance of ".concat(e.name)})=>MW(r=>r instanceof e,t),OW=Dc.create,EW=Pp.create,j1e=Pm.create,G1e=Tp.create,_W=wp.create,U1e=Mp.create,V1e=xm.create,z1e=Op.create,H1e=Ep.create,W1e=Fc.create,q1e=fl.create,Z1e=Qi.create,X1e=Im.create,Y1e=ml.create,K1e=bo.create,J1e=bo.strictCreate,Q1e=_p.create,e0e=Z2.create,t0e=Ap.create,r0e=ra.create,n0e=X2.create,o0e=Sm.create,i0e=Cm.create,s0e=Y2.create,a0e=kp.create,l0e=Dp.create,c0e=Fp.create,u0e=Lp.create,p0e=Lc.create,xW=jo.create,d0e=bi.create,f0e=na.create,m0e=jo.createWithPreprocess,h0e=Ug.create,y0e=()=>OW().optional(),g0e=()=>EW().optional(),b0e=()=>_W().optional(),v0e={string:e=>Dc.create({...e,coerce:!0}),number:e=>Pp.create({...e,coerce:!0}),boolean:e=>wp.create({...e,coerce:!0}),bigint:e=>Tp.create({...e,coerce:!0}),date:e=>Mp.create({...e,coerce:!0})},x0e=Be,B=Object.freeze({__proto__:null,defaultErrorMap:vm,setErrorMap:x1e,getErrorMap:H2,makeIssue:W2,EMPTY_PATH:I1e,addIssueToContext:de,ParseStatus:Rn,INVALID:Be,DIRTY:bm,OK:Jn,isAborted:z4,isDirty:H4,isValid:$g,isAsync:jg,get util(){return Pt},get objectUtil(){return V4},ZodParsedType:he,getParsedType:kc,ZodType:We,datetimeRegex:TW,ZodString:Dc,ZodNumber:Pp,ZodBigInt:Tp,ZodBoolean:wp,ZodDate:Mp,ZodSymbol:xm,ZodUndefined:Op,ZodNull:Ep,ZodAny:Fc,ZodUnknown:fl,ZodNever:Qi,ZodVoid:Im,ZodArray:ml,ZodObject:bo,ZodUnion:_p,ZodDiscriminatedUnion:Z2,ZodIntersection:Ap,ZodTuple:ra,ZodRecord:X2,ZodMap:Sm,ZodSet:Cm,ZodFunction:Y2,ZodLazy:kp,ZodLiteral:Dp,ZodEnum:Fp,ZodNativeEnum:Lp,ZodPromise:Lc,ZodEffects:jo,ZodTransformer:jo,ZodOptional:bi,ZodNullable:na,ZodDefault:Rp,ZodCatch:Np,ZodNaN:Pm,BRAND:N1e,ZodBranded:Gg,ZodPipeline:Ug,ZodReadonly:Bp,custom:MW,Schema:We,ZodSchema:We,late:B1e,get ZodFirstPartyTypeKind(){return Re},coerce:v0e,any:W1e,array:Y1e,bigint:G1e,boolean:_W,date:U1e,discriminatedUnion:e0e,effect:xW,enum:c0e,function:s0e,instanceof:$1e,intersection:t0e,lazy:a0e,literal:l0e,map:o0e,nan:j1e,nativeEnum:u0e,never:Z1e,null:H1e,nullable:f0e,number:EW,object:K1e,oboolean:b0e,onumber:g0e,optional:d0e,ostring:y0e,pipeline:h0e,preprocess:m0e,promise:p0e,record:n0e,set:i0e,strictObject:J1e,string:OW,symbol:V1e,transformer:xW,tuple:r0e,undefined:z1e,union:Q1e,unknown:q1e,void:X1e,NEVER:x0e,ZodIssueCode:se,quotelessJson:v1e,ZodError:$o});var I0e=B.object({limit:B.enum(["same-floor","same-elevation"]).optional(),radius:B.number().optional(),types:B.array(B.enum(["node","point-of-interest"])).min(1)}),oa,zg,Vg=class{constructor(t){M(this,oa);M(this,zg);_(this,oa,t),_(this,zg,new z2(c(this,oa)))}nearest(t,r){try{I0e.parse(r)}catch(s){$.error(s);return}let n=hg(t);if(!n)return;let o=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let s of c(this,oa).getByType("floor-stack")){let a=s.defaultFloor;a&&o.push(a.id)}else if(r.limit==="same-elevation"){let s=c(this,oa).floorsById[n.floorId];if(s){let a=s==null?void 0:s.elevation;a&&(o=c(this,oa).getByType("floor-stack").map(l=>{var u;return(u=l.floors.find(d=>d.elevation===a))==null?void 0:u.id}).filter(Boolean))}}let i=[];for(let s of YH(r.types))for(let a of o){let l=c(this,zg).getTreeByType(s,c(this,oa).mapName,a).find(n.latitude,n.longitude,r.radius);if(l){let u=c(this,oa).getById(s,l==null?void 0:l.properties.id);u&&i.push({distance:Ji([n.longitude,n.latitude],l.geometry.coordinates),feature:u})}}return i.sort((s,a)=>s.distance-a.distance)}};oa=new WeakMap,zg=new WeakMap;p();p();var Hg,K2=class{constructor(t){M(this,Hg);_(this,Hg,t||[])}get raw(){return c(this,Hg)}};Hg=new WeakMap;var hn,xe,Zt,Wg=class Wg extends zr{constructor(r,n){super(n.mvfData.id);m(this,"__type",Wg.__type);m(this,"id","loc_");m(this,"name","");m(this,"externalId");m(this,"description");m(this,"logo");m(this,"phone");m(this,"social",[]);m(this,"images",[]);m(this,"links",[]);m(this,"website");m(this,"icon");M(this,hn);M(this,xe,{});M(this,Zt);_(this,hn,r),_(this,Zt,n.mvfData);for(let o in n.mvfData)o==="links"?this.links=n.mvfData.links.map(i=>new tp({mvfData:i})):o==="pictures"?this.images=n.mvfData.pictures.map(i=>{var s;return i.url?new np({mvfData:{...i,url:(s=i.url)!=null?s:""},mapData:c(this,hn)}):void 0}).filter(i=>i!=null):o==="website"?n.mvfData.website&&(this.website=new tp({mvfData:n.mvfData.website})):o==="icon"?n.mvfData.icon&&(this.icon=new np({mvfData:{url:n.mvfData.icon},mapData:c(this,hn)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return c(this,Zt)[o]}})}static is(r){return r.__type===Wg.__type}get spaces(){if(c(this,xe).spaces)return c(this,xe).spaces;if(c(this,Zt).spaces==null)return c(this,xe).spaces=[],c(this,xe).spaces;c(this,xe).spaces=[];for(let r=0;r<c(this,Zt).spaces.length;r++){let n=c(this,hn).getById("space",c(this,Zt).spaces[r].id);n&&c(this,xe).spaces.push(n)}return c(this,xe).spaces}get points(){if(c(this,xe).points)return c(this,xe).points;if(c(this,Zt).spaces==null)return c(this,xe).points=[],c(this,xe).points;c(this,xe).points=[];for(let r=0;r<c(this,Zt).spaces.length;r++){let n=c(this,hn).getById("point-of-interest",c(this,Zt).spaces[r].id);n&&c(this,xe).points.push(n)}return c(this,xe).points}get doors(){if(c(this,xe).doors)return c(this,xe).doors;if(c(this,Zt).entrances==null)return c(this,xe).doors=[],c(this,xe).doors;c(this,xe).doors=[];for(let r=0;r<c(this,Zt).entrances.length;r++){let n=c(this,hn).getById("door",c(this,Zt).entrances[r].id);n&&c(this,xe).doors.push(n)}return c(this,xe).doors}get connections(){var n;if(c(this,xe).connections)return c(this,xe).connections;if(c(this,Zt).connections==null)return c(this,xe).connections=[],c(this,xe).connections;let r=new Set;for(let o=0;o<c(this,Zt).connections.length;o++){let i=c(this,Zt).connections[o],s=c(this,hn).mvfConnectionsById[i],l=(s==null?[]:s.nodes).map(u=>c(this,hn).getById("node",u)).filter(Boolean);for(let u of l){if(u==null)continue;let d=Xs([u.coordinate.longitude,u.coordinate.latitude]),h=((n=c(this,hn).connectionSpaceIdsByLatLon[d])!=null?n:[]).map(b=>c(this,hn).connectionsById[b]).filter(b=>b!=null);for(let b of h)r.add(b)}}return c(this,xe).connections=Array.from(r),c(this,xe).connections}get annotations(){if(c(this,xe).annotations)return c(this,xe).annotations;if(c(this,Zt).annotations==null)return c(this,xe).annotations=[],c(this,xe).annotations;c(this,xe).annotations=[];for(let r=0;r<c(this,Zt).annotations.length;r++){let n=c(this,hn).getById("annotation",c(this,Zt).annotations[r].id);n&&c(this,xe).annotations.push(n)}return c(this,xe).annotations}get categories(){return c(this,xe).categories?c(this,xe).categories:c(this,Zt).categories==null?(c(this,xe).categories=[],c(this,xe).categories):(c(this,xe).categories=c(this,Zt).categories.map(r=>c(this,hn).getById("location-category",r)).filter(r=>r!=null),c(this,xe).categories)}get mapObjects(){return c(this,xe).mapObjects?c(this,xe).mapObjects:c(this,Zt).obstructions==null?(c(this,xe).mapObjects=[],c(this,xe).mapObjects):(c(this,xe).mapObjects=c(this,Zt).obstructions.map(r=>c(this,hn).getById("object",r.id)).filter(r=>r!=null),c(this,xe).mapObjects)}get areas(){return c(this,xe).areas?c(this,xe).areas:c(this,Zt).areas==null?(c(this,xe).areas=[],c(this,xe).areas):(c(this,xe).areas=c(this,Zt).areas.map(r=>c(this,hn).getById("area",r.id)).filter(r=>r!=null),c(this,xe).areas)}get focusTarget(){if(c(this,xe).focusTarget)return c(this,xe).focusTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);return c(this,xe).focusTarget=r,r}get openingHours(){var r;return c(this,xe).openingHours?c(this,xe).openingHours:(c(this,xe).openingHours=new K2((r=c(this,Zt).openingHoursSpecification)!=null?r:[]),c(this,xe).openingHours)}get navigationTarget(){if(c(this,xe).navigationTarget)return c(this,xe).navigationTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);for(let n of this.points)r.push(n.focusTarget);return c(this,xe).navigationTarget=r,r}toJSON(){return{id:this.id,name:this.name}}};hn=new WeakMap,xe=new WeakMap,Zt=new WeakMap,m(Wg,"__type","location-profile");var q4=Wg,pm=q4;p();var Rc,vo,$p,qg=class qg extends zr{constructor(r,n){super(n.mvfData.id);m(this,"__type",qg.__type);m(this,"id","cat_");m(this,"name","");m(this,"icon","");M(this,Rc);M(this,vo,{});M(this,$p);_(this,Rc,r),_(this,$p,n.mvfData);for(let o in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)||Object.defineProperty(this,o,{enumerable:!0,get(){return c(this,$p)[o]}})}static is(r){return r.__type===qg.__type}get parent(){return c(this,vo).parent?c(this,vo).parent:(c(this,vo).parent=c(this,$p).parent?c(this,Rc).getById("location-category",c(this,$p).parent):void 0,c(this,vo).parent)}get children(){return c(this,vo).children?c(this,vo).children:(c(this,vo).children=c(this,Rc).locationCategoriesByParentId[this.id]||[],c(this,vo).children)}get locationProfiles(){if(c(this,vo).locationProfiles)return c(this,vo).locationProfiles;let r=[];for(let n of c(this,Rc).locationProfilesByCategoryId[this.id]||[]){let o=c(this,Rc).getById("location-profile",n.id);o&&r.push(o)}return c(this,vo).locationProfiles=r,r}toJSON(){return{id:this.id,name:this.name}}};Rc=new WeakMap,vo=new WeakMap,$p=new WeakMap,m(qg,"__type","location-category");var Z4=qg,D2=Z4;var Oe,J2,AW,Tm,wm=class extends De{constructor(r,n){var a,l,u,d,f;super();M(this,J2);m(this,"Analytics");M(this,Oe,{});m(this,"Query");m(this,"mvf");m(this,"outdoorViewToken");m(this,"spaceIdsByDestinationNodeId");m(this,"objectEntranceNodeIdsByObstructionId");m(this,"obstructionIdByEntranceId");m(this,"venue");m(this,"tokenManager");m(this,"directions");m(this,"enterpriseMode",!1);m(this,"nodesById");m(this,"spacesById");m(this,"floorsById");m(this,"floorStacksById");m(this,"facadesById");m(this,"facadesBySpaceId");m(this,"connectionsById");m(this,"objectsById");m(this,"doorsById");m(this,"pointsOfInterestById");m(this,"annotationsById");m(this,"areasById");m(this,"locationProfilesById");m(this,"locationCategoriesById");m(this,"locationProfilesByExternalId");m(this,"locationsById");m(this,"locationProfilesByCategoryId");m(this,"locationCategoriesByParentId");m(this,"categoriesById");m(this,"doorsByNodeId");m(this,"mvfLocationsBySpaceId");m(this,"locationIdsByNodeId");m(this,"spaceIdsByNodeId");m(this,"mvfAnnotationsById");m(this,"mvfConnectionsById");m(this,"mvfConnectionsByNodeId");m(this,"mvfConnectionIdsByLatLon");m(this,"mvfEntrancesById");m(this,"mvfNodesById");m(this,"mvfObstructionById");m(this,"mvfSpacesById");m(this,"mvfFloorsById");m(this,"mvfFloorStacksById");m(this,"mvfAreasById");m(this,"connectionSpaceIdsByLatLon");m(this,"locationProfilesByAttachedFeatureId");m(this,"spacesByExternalId");m(this,"nodesByExternalId");m(this,"objectsByExternalId");m(this,"poisByExternalId");m(this,"floorsByExternalId");m(this,"floorStacksByExternalId");m(this,"doorsByExternalId");m(this,"areasByExternalId");m(this,"connectionsByExternalId");m(this,"locationsByExternalId");m(this,"categoriesByExternalId");m(this,"mvfNodesByFloorId");m(this,"mvfSpacesByFloorId");m(this,"mvfPoisByFloorId");m(this,"mvfEntrancesByFloorId");m(this,"mvfAnnotationsByFloorId");m(this,"localePacksUrls");m(this,"currentLanguage");m(this,"languagePacks",{});m(this,"tilesets",{});m(this,"binaryBundle");m(this,"envControl");m(this,"getMapDataOptions");M(this,Tm);m(this,"getDirectionsMultiDestination",(r,n,o)=>this.getDirections(r,n,{...o,multiDestination:!0}));m(this,"getDirections",(r,n,o)=>{let{accessible:i=!1,smoothing:s=!0,multiDestination:a=!1}=o||{},l=typeof s=="object"?s.enabled:s,u=typeof s=="object"?s.radius:void 0,d=(o==null?void 0:o.zones)||[],f={accessible:i,zones:d,smoothing:{enabled:l!=null?l:!0,radius:u!=null?u:.75},excludedConnections:(o==null?void 0:o.excludedConnections)||[]};if(a&&Array.isArray(n)){let h=Array.isArray(r)?r:[r],b=[];for(let v of n){let I=Array.isArray(v)?v:[v],x=this.directions.getDirections(h,I,f,this);if(!x){$.error("getDirections failed due to missing directions for one of the segments");return}h=I,b.push(x)}return b}else{let h=Array.isArray(r)?r:[r],b=Array.isArray(n)?n:[n];if(Array.isArray(b[0])){$.error("getDirections does not support multi-destination without multisegment option");return}return h[0].id&&b[0].id&&this.Analytics.sendGetDirectionsEvent(h[0].id,b[0].id),this.directions.getDirections(h,b,f,this)}});m(this,"transformImageRequest",async r=>{var o;if(this.enterpriseMode||!this.getMapDataOptions)return{url:r};if(!AH(r))return{url:r};if(kH(r))return{url:r};let n=E2(r);if(!n)return{url:r};try{let i=await((o=this.tokenManager)==null?void 0:o.getSasTokensAsync()),s=i==null?void 0:i[n.mapId];if(s==null)throw new Error("SAS token not found");let[a]=r.split("?");return{url:"".concat(a,"?").concat(s.token)}}catch(i){return $.error("Failed to append SAS token to image request. Requests for private images may fail.",i),{url:r}}});let o=(a=n==null?void 0:n.env)!=null?a:Xu();if(this.envControl=o,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new Fd,this.localePacksUrls=(l=n==null?void 0:n.localePacksUrls)!=null?l:{},this.mvf=r,this.outdoorViewToken=n==null?void 0:n.outdoorViewToken,this.getMapDataOptions=n==null?void 0:n.getMapDataOptions,((u=r["tileset.json"])==null?void 0:u.default)!=null&&(this.tilesets[r["tileset.json"].default.key]=r["tileset.json"].default,o.updateTileServerBaseUrl(r["tileset.json"].default.url),r["tileset.json"].others!=null))for(let h of r["tileset.json"].others)this.tilesets[h.key]=h;this.enterpriseMode=(d=n==null?void 0:n.enterprise)!=null?d:!1,this.tokenManager=n==null?void 0:n.tokenManager;let i=_H(r,this);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.spaceIdsByDestinationNodeId=i.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=i.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=i.obstructionIdByEntranceId;let s=EH(r,this);if(this.locationsById=s.locationsById,this.categoriesById=s.categoriesById,this.mvfLocationsBySpaceId=s.mvfLocationsBySpaceId,this.locationIdsByNodeId=s.locationIdsByNodeId,this.connectionSpaceIdsByLatLon=i.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=i.locationProfilesByAttachedFeatureId,this.spaceIdsByNodeId=s.spaceIdsByNodeId,this.connectionsByExternalId=s.connectionsByExternalId,this.locationsByExternalId=s.locationsByExternalId,this.categoriesByExternalId=s.categoriesByExternalId,s.venue.name!=null){this.venue=new k4(this,{mvfData:s.venue});let h={};for(let b in s.mvfLocationsById)h[b]=s.mvfLocationsById[b];for(let b in s.locationInstancesById)h[b]=s.locationInstancesById[b];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":h,"enterprise-category":s.mvfCategoriesById,"floor-stack":i.mvfFloorStacksById,floor:i.mvfFloorsById}},(f=n==null?void 0:n.languagePacks)==null||f.forEach(({language:b,localePack:v})=>{this.languagePacks[b.code]=D4(v)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new Vg(this),this.directions=new V2({nodes:r["node.geojson"],geojsonCollection:r.enterprise?r.space:r.obstruction,connections:r["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let r=this;return{get baseUri(){var n;return r.envControl.getBaseUri((n=r.enterpriseMode)!=null?n:!1)},get baseAuthUri(){return r.envControl.getBaseAuthUri()},get analyticsBaseUri(){return r.envControl.getAnalyticsBaseUri()},get tileServerUri(){return r.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?r:""}get mapCenter(){return new Le(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?r:0}get spaces(){return c(this,Oe).spaces==null&&(c(this,Oe).spaces=globalThis.Object.values(this.spacesById)),c(this,Oe).spaces}get objects(){return c(this,Oe).objects==null&&(c(this,Oe).objects=globalThis.Object.values(this.objectsById)),c(this,Oe).objects}get connections(){return c(this,Oe).connections==null&&(c(this,Oe).connections=globalThis.Object.values(this.connectionsById)),c(this,Oe).connections}get floors(){return c(this,Oe).floors==null&&(c(this,Oe).floors=globalThis.Object.values(this.floorsById)),c(this,Oe).floors}get floorStacks(){return c(this,Oe).floorStacks==null&&(c(this,Oe).floorStacks=globalThis.Object.values(this.floorStacksById)),c(this,Oe).floorStacks}get facades(){return c(this,Oe).facades==null&&(c(this,Oe).facades=globalThis.Object.values(this.facadesById)),c(this,Oe).facades}get doors(){return c(this,Oe).doors==null&&(c(this,Oe).doors=globalThis.Object.values(this.doorsById)),c(this,Oe).doors}get pointsOfInterest(){return c(this,Oe).pointsOfInterest==null&&(c(this,Oe).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),c(this,Oe).pointsOfInterest}get annotations(){return c(this,Oe).annotations==null&&(c(this,Oe).annotations=globalThis.Object.values(this.annotationsById)),c(this,Oe).annotations}get areas(){return c(this,Oe).areas==null&&(c(this,Oe).areas=globalThis.Object.values(this.areasById)),c(this,Oe).areas}get nodes(){return c(this,Oe).nodes==null&&(c(this,Oe).nodes=globalThis.Object.values(this.nodesById)),c(this,Oe).nodes}get locations(){return c(this,Oe).locations==null&&(c(this,Oe).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return c(this,Oe).categories==null&&(c(this,Oe).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return c(this,Oe).locationProfiles==null&&(c(this,Oe).locationProfiles=globalThis.Object.values(this.locationProfilesById)),c(this,Oe).locationProfiles}get locationCategories(){return c(this,Oe).locationCategories==null&&(c(this,Oe).locationCategories=globalThis.Object.values(this.locationCategoriesById)),c(this,Oe).locationCategories}get mvfFloors(){return c(this,Oe).mvfFloors==null&&(c(this,Oe).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),c(this,Oe).mvfFloors}get mvfFloorStacks(){return c(this,Oe).mvfFloorStacks==null&&(c(this,Oe).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),c(this,Oe).mvfFloorStacks}getByType(r){switch(r){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(r,n){switch(r){case"location-profile":return this.locationProfilesById[n];case"location-category":return this.locationCategoriesById[n];case"space":return this.spacesById[n];case"floor":return this.floorsById[n];case"floor-stack":return this.floorStacksById[n];case"facade":return this.facadesById[n];case"node":return this.nodesById[n];case"door":return this.doorsById[n];case"connection":let o=this.connectionsById[n];return o==null&&(o=ee(this,J2,AW).call(this,this.mvfConnectionsById[n])),o;case"object":return this.objectsById[n];case"point-of-interest":return this.pointsOfInterestById[n];case"annotation":return this.annotationsById[n];case"area":return this.areasById[n];case"enterprise-location":return this.locationsById[n];case"enterprise-category":return this.categoriesById[n];default:return}}getByExternalId(r,n){var o,i,s,a,l,u,d,f,h,b,v,I;switch(r){case"location-profile":return(o=this.locationProfilesByExternalId[n])!=null?o:[];case"location-category":return[];case"space":return(i=this.spacesByExternalId[n])!=null?i:[];case"floor":return(s=this.floorsByExternalId[n])!=null?s:[];case"floor-stack":return(a=this.floorStacksByExternalId[n])!=null?a:[];case"node":return(l=this.nodesByExternalId[n])!=null?l:[];case"door":return(u=this.doorsByExternalId[n])!=null?u:[];case"connection":return(d=this.connectionsByExternalId[n])!=null?d:[];case"object":return(f=this.objectsByExternalId[n])!=null?f:[];case"point-of-interest":return(h=this.poisByExternalId[n])!=null?h:[];case"area":return(b=this.areasByExternalId[n])!=null?b:[];case"enterprise-location":return(v=this.locationsByExternalId[n])!=null?v:[];case"enterprise-category":return(I=this.categoriesByExternalId[n])!=null?I:[];default:return[]}}getMapDataById(r){var n,o,i,s,a,l,u,d,f,h;return(h=(f=(d=(u=(l=(a=(s=(i=(o=(n=this.spacesById[r])!=null?n:this.floorsById[r])!=null?o:this.floorStacksById[r])!=null?i:this.facadesById[r])!=null?s:this.nodesById[r])!=null?a:this.doorsById[r])!=null?l:this.connectionsById[r])!=null?u:this.objectsById[r])!=null?d:this.pointsOfInterestById[r])!=null?f:this.annotationsById[r])!=null?h:this.areasById[r]}getMVFFeatureById(r,n){switch(r){case"space":return this.mvfSpacesById[n];case"node":return this.mvfNodesById[n];case"obstruction":return this.mvfObstructionById[n];case"floor":return this.mvfFloorsById[n];case"floor-stack":return this.mvfFloorStacksById[n];case"connection":return this.mvfConnectionsById[n];case"entrance":return this.mvfEntrancesById[n];case"annotation":return this.mvfAnnotationsById[n];case"area":return this.mvfAreasById[n];default:throw new Error("Unknown MVF feature type: ".concat(r))}}getMVFFeatureByNodeId(r,n){switch(r){case"connection":return this.mvfConnectionsByNodeId[n];default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getMVFFeatureByType(r){switch(r){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getPropTranslation(r,n,o,i){var l,u;if(!this.currentLanguage)return i;let{code:s}=this.currentLanguage,a=(u=(l=this.languagePacks[s])==null?void 0:l.optimized)==null?void 0:u[r];if(a){let d=a[o];if(d!=null&&d[n]!==void 0)return d[n]}return i}async changeLanguage(r){var a;let n=r.toLowerCase();if(!n){$.error("language code must be defined");return}if(!this.currentLanguage){$.error("languageCode feature is not supported");return}let o=this.currentLanguage.code,i=(a=this.venue)==null?void 0:a.languages.find(({code:l})=>l.toLowerCase()===n.toLowerCase());if(!i){$.warn("language not found");return}if(o===i.code)return;let s=this.languagePacks[i.code];if(!s){let l=this.localePacksUrls[i.code];if(!l){$.error("locale packs url not found for ".concat(i.code));return}c(this,Tm)&&c(this,Tm).abort();let u=new AbortController;_(this,Tm,u);let d;try{d=await dj(l,{signal:u.signal})}catch(f){$.error("failed downloading language pack",f);return}if(!d||u.signal.aborted)return;s=D4(d),this.languagePacks[i.code]=s}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=i,this.publish("language-change",this.currentLanguage)}getDistance(r,n){let o=hg(r),i=hg(n);return Ji([o.longitude,o.latitude],[i.longitude,i.latitude])}async toJSONBundle({downloadLanguagePacks:r=!0}={}){var o;let n=[];if(r&&this.enterpriseMode){let i=new AbortController;for(let s of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[s.code]){let a=await pw(this.localePacksUrls[s.code],{signal:i.signal}),l=await Gf(a);l&&n.push({language:{code:s.code,name:s.name},localePack:l})}}catch(a){$.warn("failed downloading language pack",a)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:r=!0}={}){var o;if(!this.binaryBundle){$.error("binary bundle not found");return}let n=[];if(r&&this.enterpriseMode){let i=new AbortController;for(let s of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[s.code]){let a=await pw(this.localePacksUrls[s.code],{signal:i.signal});a&&n.push({language:{code:s.code,name:s.name},localePack:a})}}catch(a){$.warn("failed downloading language pack",a)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.binaryBundle}}destroy(){for(let r of globalThis.Object.keys(c(this,Oe)))c(this,Oe)[r]=null}};Oe=new WeakMap,J2=new WeakSet,AW=function(r){var a;let n=(a=r==null?void 0:r.nodes)==null?void 0:a[0],o=this.getById("node",n);if(o==null)return;let i=Xs([o.coordinate.longitude,o.coordinate.latitude]),s=this.connectionSpaceIdsByLatLon[i];return s==null?void 0:s.map(l=>this.connectionsById[l]).find(l=>l!=null)},Tm=new WeakMap;p();p();p();p();(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=";p();p();var DW=!1;function FW(){DW=!0}function LW(){return DW}var Q2=class{constructor(t){m(this,"backgroundAlpha",1);m(this,"backgroundColor",new Ft);m(this,"width",0);m(this,"height",0);m(this,"options",{});m(this,"renderer");m(this,"enabledLayers",new Set([0,1]));m(this,"handleWebGLContextCreationError",t=>{var r,n;(n=(r=this.options).onWebGLContextCreationError)==null||n.call(r,t)});m(this,"handleWebGLContextLost",t=>{var r,n;(n=(r=this.options).onWebGLContextLost)==null||n.call(r,t)});m(this,"handleWebGLContextRestored",t=>{var r,n;(n=(r=this.options).onWebGLContextRestored)==null||n.call(r,t)});var r,n,o,i,s;try{this.options=t,LW()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new Ft,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),readRenderTargetPixelsAsync:()=>Promise.resolve([]),setRenderTarget:()=>{},setClearColor:()=>{},clear:()=>{},render:()=>{},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 pE({canvas:t.canvas,alpha:t.alpha||!1,stencil:!1,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new Ft((r=t.backgroundColor)!=null?r:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(a){$.error(a),t.onWebGLRendererError&&t.onWebGLRendererError(a)}(o=this.domElement())==null||o.addEventListener("webglcontextlost",this.handleWebGLContextLost),(i=this.domElement())==null||i.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(s=this.domElement())==null||s.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,r,n,o,i;this.renderer&&((r=(t=this.renderer).dispose)==null||r.call(t)),(n=this.domElement())==null||n.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(o=this.domElement())==null||o.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(i=this.domElement())==null||i.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,r){if(this.renderer){this.renderer.state.reset();for(let n of this.enabledLayers.values())r.layers.enable(n);this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,r),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,r){g.env.NODE_ENV==="test"||!this.renderer||(this.width=t,this.height=r,this.renderer.setSize(t,r,!1))}setBackgroundColor(t,r){this.backgroundColor=t,this.backgroundAlpha=r}domElement(){var t;return(t=this.renderer)==null?void 0:t.domElement}};p();p();var RW='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>J(n,typeof e!="symbol"?e+"":e,t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';p();p();p();p();p();function NW(e,t){return t.x+t.w<e.x+e.w&&t.x>e.x&&t.y>e.y&&t.y+t.h<e.y+e.h}p();function BW(e,t){let[r,n]=t;return r>=e.x&&r<=e.x+e.w&&n>=e.y&&n<=e.y+e.h}p();function $W(e,t){let r=t.x,n=t.y,o=t.x+t.w,i=t.y+t.h,s=e.x,a=e.y,l=e.x+e.w,u=e.y+e.h;return r<l&&s<o&&n<u&&a<i}p();function hl(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}p();var Hr=class{constructor(t,r,n,o,i){m(this,"x");m(this,"y");m(this,"w");m(this,"h");m(this,"userData");this.userData=typeof i>"u"?null:i,this.x=t,this.y=r,this.w=n,this.h=o}contains(t){return t===this?!1:NW(this,t)}intersects(t){return $W(this,t)}intersectsPoint(t){return BW(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};var ia=class e{constructor(t,r){m(this,"topLeft");m(this,"topRight");m(this,"bottomLeft");m(this,"bottomRight");m(this,"divided",!1);m(this,"boundary");m(this,"capacity",16);m(this,"objects",[]);m(this,"parent");this.parent=r,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:r,w:n,h:o}=this.boundary;this.topLeft=new e(new Hr(t,r,n/2,o/2),this),this.topRight=new e(new Hr(t+n/2,r,n/2,o/2),this),this.bottomLeft=new e(new Hr(t,r+o/2,n/2,o/2),this),this.bottomRight=new e(new Hr(t+n/2,r+o/2,n/2,o/2),this),this.divided=!0}queryRect(t){let r=[];if(this.boundary.intersects(t))r.push(...this.objects);else return[];return this.divided&&(hl(r,this.topLeft.queryRect(t)),hl(r,this.topRight.queryRect(t)),hl(r,this.bottomLeft.queryRect(t)),hl(r,this.bottomRight.queryRect(t))),r}queryPoint(t){let r=[];if(this.boundary.intersectsPoint(t))r.push(...this.objects);else return[];return this.divided&&(hl(r,this.topLeft.queryPoint(t)),hl(r,this.topRight.queryPoint(t)),hl(r,this.bottomLeft.queryPoint(t)),hl(r,this.bottomRight.queryPoint(t))),r}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(r=>r.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};p();p();var jW=["","","low","medium","high","always-visible"];function GW(e){return Math.min(5,Math.max(2,e))}function Mm(e){if(typeof e=="number")return GW(e);let t=jW.indexOf(e);return t===-1?3:t}function Zg(e){let t=GW(e);return jW[t]}function VW(e,t,r){let n,o,i,s=null,a=0;r||(r={});let l=function(){a=r.leading===!1?0:Date.now(),s=null,i=e.apply(n,o),s||(n=o=null)};return function(){let u=Date.now();!a&&r.leading===!1&&(a=u);let d=t-(u-a);return n=globalThis,o=arguments,d<=0||d>t?(s&&(clearTimeout(s),s=null),a=u,i=e.apply(n,o),s||(n=o=null)):!s&&r.trailing!==!1&&(s=setTimeout(l,d)),i}}var jp=!1,X4="",C0e=150,eI=class extends De{constructor(r,n,o=X4?new Worker(X4):new Worker(URL.createObjectURL(new Blob([RW],{type:"text/javascript"})))){super();m(this,"worker");m(this,"debugContext");m(this,"debugCanvas");m(this,"collidersDirty",!0);m(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);m(this,"visibleCollidersQTree",new ia(new Hr(0,0,0,0)));m(this,"interactiveCollidersQTree",new ia(new Hr(0,0,0,0)));m(this,"coreState");m(this,"postMessage");m(this,"showCollisionBoxes",()=>{jp=!0,this.debugCanvas.style.display="block"});m(this,"hideCollisionBoxes",()=>{jp=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"});m(this,"currentMsgId","");m(this,"working",!1);m(this,"_postMessage",()=>{this.worker.postMessage(this.packedMessage)});m(this,"componentArray",[]);m(this,"update",(r,n,o="bottom-left",i=!1)=>{let s=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let a;for(let l of this.coreState.geometry2DIdsInScene){let u=this.coreState.geometry2DMap.get(l);u&&(a=u.components[0],this.componentArray.push(a))}this.resize(r,n,o),this.collidersDirty=!1,s=!0}else s=this.componentArray.some(a=>a.collisionDirty===!0);s&&this.componentArray.sort((a,l)=>l.rank-a.rank);for(let a=0;a<this.componentArray.length;a++)if(this.packedMessage){let l=this.componentArray[a].toPackedMessage(i&&!s);this.packedMessage[0][a]==null&&(this.packedMessage[0][a]=[]),this.packedMessage[0][a][0]==null&&(this.packedMessage[0][a][0]=[]),this.packedMessage[0][a][0]=l.bboxes,this.packedMessage[0][a][1]=l.enabled&&this.componentArray[a].visible&&!this.componentArray[a].isOccluded?1:0,this.packedMessage[0][a][2]=l.rank===5?1:0,this.packedMessage[0][a][3]=l.x,this.packedMessage[0][a][4]=l.y,this.packedMessage[0][a][5]=l.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][a][6]=l.lockedToStrategyIndex}this.working||this.postMessage()});m(this,"resolve",r=>{if(this.working=!1,this.collidersDirty||!r.data)return;let n=r.data.colliders,o=-1,i,s,a;jp&&(this.visibleCollidersQTree=new ia(new Hr(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new ia(new Hr(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let l=0;l<this.componentArray.length;l++){let u=this.componentArray[l];n[l]!=null&&(o=n[l][0],i=n[l][2],u.offscreen=n[l][1]===1,o!==-1&&i!=null?(a=new Hr(i.x,i.y,i.w,i.h,{entityId:u.id}),jp&&this.visibleCollidersQTree.insert(a),s=this.coreState.geometry2DMap.get(u.id),(s==null?void 0:s.components[1])!=null&&this.interactiveCollidersQTree.insert(new Hr(i.x,i.y,i.w,i.h,{entityId:u.id})),(u.canShow===!1||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="show"),o!==-1&&o!==u.currentStrategyIndex&&(u.activeBoundingBox=a,u.onStrategySelected(o))):((u.canShow===!0||u.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in u&&(u.visibilityNeedsUpdate="hide"),o!==-1&&o!==u.currentStrategyIndex&&u.onStrategySelected(o)))}jp&&this.drawDebug(),this.publish("visibility-changed")});m(this,"drawDebug",()=>{jp&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))});m(this,"destroy",()=>{this.worker.terminate()});this.coreState=n,this.debugCanvas=r,this.debugContext=r.getContext("2d"),this.worker=o,this.worker.onmessage=i=>this.resolve(i),this.postMessage=VW(this._postMessage,C0e,!1),jp?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(r,n,o){this.packedMessage[6]=o,this.packedMessage[5]=n,this.packedMessage[4]=r,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};function Y4(e){X4=e}p();p();p();p();var tI=class{constructor(t){m(this,"type");m(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}},rI=class{constructor(){m(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,r;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((r=this.taps[1])==null?void 0:r.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(r=>t-r.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};p();function zW(e){let t=new Set;for(let r of e){let n=r.object;for(;n.parent&&!t.has(n.parent);)n=n.parent,n instanceof at&&n.type==="group-container"&&n.visible&&n.components[1]&&t.add(n)}return Array.from(t)}var Om,Yg=class extends De{constructor(r,n,o,i,s){super();m(this,"raycaster",new gs);m(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});m(this,"coreState");m(this,"camera");m(this,"worldPlane");m(this,"_quadtree",new ia(new Hr(0,0,0,0)));m(this,"_container");m(this,"lastPointerEvent");m(this,"cursor","grab");m(this,"touchesCount",0);m(this,"isUserInteracting");m(this,"hasTouched",!1);M(this,Om);m(this,"onPointerMoveRaf",r=>{this.lastPointerEvent=r,c(this,Om)&&cancelAnimationFrame(c(this,Om)),_(this,Om,requestAnimationFrame(()=>{this.onPointerMove(r)}))});m(this,"onPointerMove",r=>{r.preventDefault(),this.updateInteractionStateIfPanning(r),(r.pointerType!=="touch"||r.pointerType===void 0&&this.hasTouched)&&this.handleHover(r),this.handleCursor()});m(this,"tapsControl",new rI);m(this,"onPointerDown",r=>{r.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:r.timeStamp,clientX:r.clientX,clientY:r.clientY},this.lastPointerEvent=r,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),r.pointerType==="touch"&&(this.tapsControl.add(new tI(r)),this.touchesCount=Math.max(0,this.touchesCount+1)))});m(this,"clickTimeout");m(this,"onPointerUp",r=>{this.tapsControl.discardOutsideOfWaitWindow(r.timeStamp),this.lastPointerEvent=r,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(r);let{mouseDownStart:n}=this.state.interaction;!n||this.state.interaction.distanceFromMouseDown==null||(Date.now()<n.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(r.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",r),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(r),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",r),this.flush()):this.handleClick(r)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())});m(this,"dirty3D",!0);m(this,"cachedHitBoxes",{entities:[],groups:[]});m(this,"ndcPoint",new Ee);m(this,"debugPanel");this.isUserInteracting=s,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=o,this._container=r,this.coreState=n,this.worldPlane=i,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(r){this._quadtree=r}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let r=this.state.hovered3DEntity.components[2];r&&(r.dirty=!0)}}getThreeDIntersectsFromXY(r){return this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0),this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(o=>{var i,s;return((i=o.object)==null?void 0:i.name)==="worldPlane"||((s=o.object)==null?void 0:s.visible)})}getGroupContainerIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(i=>i.object.visible),o;return n!=null&&n.length>0&&(o=zW(n)),o}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(r){let n=r||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!n||this.isUserInteracting())return;let{entity3D:o,entity2D:i,position:s,groupContainers:a}=this.intersect(n);(this.detect3DEntityHover(o)||this.detect2DEntityHover(i)||this.detect3DContainerHover(a))&&(this.state.hovered3DEntity=o,this.state.lastHover=o,this.state.hovered2DEntity=i,this.state.hovered3DContainers=a,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:s,groupContainers:a})),this.handleCursor()}handleCursor(){var s;let r=!!(this.state.hovered3DEntity&&((s=this.state.hovered3DEntity)!=null&&s.components[2])||this.state.hovered2DEntity),n=!!this.state.interaction.mouseDownStart,o=this.state.interaction.isPanning,i=M0e(r,o,n);this.cursor!==i&&(this.cursor=i,i==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(r){return this.state.hovered2DEntity!==r}handleClick(r){let n=this.intersect(r);this.publish("click",{entity2D:n.entity2D,entity3D:n.entity3D,position:n.position,groupContainers:n.groupContainers,pointerEvent:{button:r.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let r;for(let n of this.coreState.geometry3DIdsInScene)r=this.coreState.geometry3DMap.get(n),(r==null?void 0:r.type)==="geometry"||(r==null?void 0:r.type)==="model"||(r==null?void 0:r.type)==="path"||(r==null?void 0:r.type)==="custom-geometry"?r.components[0].mesh&&!this.cachedHitBoxes.entities.includes(r.components[0].mesh)&&this.cachedHitBoxes.entities.push(r.components[0].mesh):(r==null?void 0:r.type)==="group-container"&&r.components[1]&&!this.cachedHitBoxes.groups.includes(r)&&this.cachedHitBoxes.groups.push(r);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(r){var x,C,P,w,T;let n=[r.offsetX,r.offsetY],o=this._quadtree.queryPoint(n),[i]=o.filter(O=>O.intersectsPoint(n)),s=this.coreState.containerOffset[0],a=this.coreState.containerOffset[1];this.ndcPoint.x=(r.clientX-a)/this._container.clientWidth*2-1,this.ndcPoint.y=-((r.clientY-s)/this._container.clientHeight)*2+1;let l=this.getThreeDIntersectsFromXY(this.ndcPoint),u=(x=l[0])==null?void 0:x.point,d=[],f=[];for(let O of l.filter(N=>N.object.name!=="worldPlane"))O.object instanceof Ve&&O.object.material.depthTest===!1?d.push(O):f.push(O);let h=(P=(C=d[0])!=null?C:f[0])!=null?P:void 0,b,v;if(h!=null){if(b=E0e(h.object,this.coreState.geometry3DMap),!b){let O=(w=h==null?void 0:h.instanceId)!=null?w:h==null?void 0:h.batchId;b=O!=null&&(h!=null&&h.object.userData.entities)?this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entities[O]):this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entityId)}b!=null&&b.components[2]&&(v=b)}let I=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((T=i==null?void 0:i.userData)==null?void 0:T.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(i==null?void 0:i.userData.entityId),entity3D:v,position:u,groupContainers:I}}detect3DEntityHover(r){return this.state.lastHover!==r&&(this.state.lastHover&&WW(this.state.lastHover,!1,this.coreState),r&&WW(r,!0,this.coreState)),this.state.hovered3DEntity!==r}detect3DContainerHover(r){return!mE(this.state.hovered3DContainers,r)}updateInteractionStateIfPanning(r){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(r.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(r.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.worldPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let r=document.createElement("div");r.style.position="absolute",r.style.top="0",r.style.right="0",r.style.backgroundColor="white",r.style.padding="10px",document.body.append(r),r.id="interaction-debug-panel",this.debugPanel=r,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",n=>{var o,i,s;this.queueDebugMessage("CLICK \n3D: ".concat((o=n.entity3D)==null?void 0:o.id," \n2D: ").concat((i=n.entity2D)==null?void 0:i.id," \nPos: ").concat((s=n.position)==null?void 0:s.toArray().join(", ")),"#fdffb6")}),this.on("hover",n=>{var o,i,s;this.queueDebugMessage("HOVER \n3D: ".concat((o=n.entity3D)==null?void 0:o.id," \n2D: ").concat((i=n.entity2D)==null?void 0:i.id," \nPos: ").concat((s=n.position)==null?void 0:s.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(r,n){var i;let o=document.createElement("pre");o.style.maxWidth="300px",o.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",o.style.backgroundColor=n,o.textContent=r,(i=this.debugPanel)==null||i.prepend(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>{o.remove()},500)},2500)}getCursor(){return this.cursor}};Om=new WeakMap;function WW(e,t,r){var s;let n=e.components[2];n&&n.hover!==!0&&(n.hover=t?"user-interaction":!1,n.dirty=!0);let o=(s=e.components[0].textMesh)==null?void 0:s.userData.entityId;if(!o)return;let i=r.geometry3DMap.get(o);(i==null?void 0:i.type)==="text3d"&&(i.components[1].hoverByPolygon=t,i.components[1].dirty=!0)}function M0e(e,t,r){return t?"grabbing":e?"pointer":r?"grabbing":"grab"}function O0e(e){let t=e;for(;t!=null&&t.parent;){if(t instanceof Vl)return;if(t.userData.isSingleModel)return t;t=t.parent}}function E0e(e,t){let r=O0e(e);return r?t.get(r.userData.entityId):void 0}p();var Sq=fs(l5());var rb=4,Sxe=8,Cxe="0.6",Iq="low-priority-pin",c5=B.object({rank:B.union([B.enum(["low","medium","high","always-visible"]),B.number()]).optional(),interactive:B.union([B.boolean(),B.literal("pointer-events-auto")]).optional(),id:B.string().optional(),anchor:B.union([B.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),B.array(B.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:B.boolean().optional(),zIndex:B.number().optional(),lowPriorityPin:B.object({enabled:B.boolean().optional(),size:B.number().positive().optional(),color:B.string().optional()}).optional()});function Cq(e,t,r){B.array(B.number()).min(2).max(3).parse(e),B.string().parse(t),c5.parse(r)}var Pxe=Object.freeze({enabled:!0,size:Sxe,color:"#666"}),km=class km{constructor(t,r={}){m(this,"id");m(this,"type","marker");m(this,"rank",0);m(this,"initialRank",0);m(this,"activeAnchor","center");m(this,"pointerEvents","none");m(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:{...Pxe}});m(this,"projection",new Ee);m(this,"enabled",!0);m(this,"canShow",!1);m(this,"visible",!0);m(this,"isOccluded",!1);m(this,"offscreen",!1);m(this,"strategyIndex",-1);m(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});m(this,"dimensions",{width:0,height:0});m(this,"markerContainer");m(this,"containerEl");m(this,"contentEl",null);m(this,"contentHtml","");m(this,"style",{top:"0px",left:"0px"});m(this,"dirty",!1);m(this,"attachedDirty",!0);m(this,"collisionDirty",!0);m(this,"visibilityNeedsUpdate","show");m(this,"animation",null);m(this,"currentStrategyIndex",-1);m(this,"onStrategySelected",(t,r=!1)=>{var o,i;if(this.currentStrategyIndex===t&&!r)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activeAnchor="center",this.markerContainer.setAttribute("data-anchor",Iq);let s=this.options.lowPriorityPin,a=s.size,l=s.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(a,"px")),this.markerContainer.style.setProperty("--pin-color",l),this.markerContainer.style.opacity=Cxe,this.style.top=-a/2+"px",this.style.left=-a/2+"px"}else{this.activeAnchor=(i=(o=this.strategies[t])==null?void 0:o.name)!=null?i:"center",this.markerContainer.setAttribute("data-anchor",this.activeAnchor),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:s,height:a}=this.dimensions,l=-a/2+"px",u=-s/2+"px";switch(this.style.top=l,this.style.left=u,this.activeAnchor){case"top":{this.style.top=-a+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-s+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-a+"px",this.style.left=-s+"px";break}case"top-right":{this.style.top=-a+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-s+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=l,this.style.left=u}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left});m(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var n,o,i;if(this.id=(r==null?void 0:r.id)||Et(),this.options=(0,Sq.default)(this.options,r),typeof r.rank=="string")this.rank=Mm(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let s=Math.trunc(g.env.NODE_ENV==="test"?km.testId:km.testId*10)/10;km.testId+=.001,this.rank=s}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(n=this.markerContainer.firstElementChild)!=null?n:null,this.contentEl=(i=(o=this.markerContainer.firstElementChild)==null?void 0:o.firstElementChild)!=null?i:null}updateDimensions(t,r){if(t!=null&&r!=null)this.dimensions={width:t,height:r};else{let{width:n,height:o}=this.markerContainer.getBoundingClientRect();this.dimensions={width:n,height:o}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){var i;let{width:t,height:r}=this.dimensions;if(t===0||r===0)return[];let o=(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(s=>({name:s,getBoundingBox:()=>{let a=r/2,l=r/2,u=t/2,d=t/2;switch(s){case"top":{a=r,l=0;break}case"bottom":{a=0,l=r;break}case"left":{u=t,d=0;break}case"right":{u=0,d=t;break}case"top-left":{a=r,u=t,l=0,d=0;break}case"top-right":{a=r,d=t,l=0,u=0;break}case"bottom-left":{l=r,u=t,a=0,d=0;break}case"bottom-right":{l=r,d=t,a=0,u=0;break}}return[a+rb,l+rb,u+rb,d+rb]}}));if((i=this.options.lowPriorityPin)!=null&&i.enabled){let s={name:Iq,getBoundingBox:()=>{let a=Math.max(2,rb/2);return[this.options.lowPriorityPin.size/2+a,this.options.lowPriorityPin.size/2+a,this.options.lowPriorityPin.size/2+a,this.options.lowPriorityPin.size/2+a]}};o.push(s)}return o}toPackedMessage(t=!1){var n;this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0;let r=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&t&&r&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,r&&this.currentStrategyIndex!==((n=this.packedMessage.bboxes[0])==null?void 0:n[4])){let o=this.packedMessage.bboxes.findIndex(i=>i[4]===this.currentStrategyIndex);if(o!==-1){let i=this.packedMessage.bboxes.splice(o,1)[0];this.packedMessage.bboxes.unshift(i)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let o=0;o<this.strategies.length;o++){let i=this.strategies[o];o===this.currentStrategyIndex&&r?this.packedMessage.bboxes.unshift([...i.getBoundingBox(),o]):this.packedMessage.bboxes.push([...i.getBoundingBox(),o])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var t;return(t=this.options.lowPriorityPin)!=null&&t.enabled?Array.isArray(this.options.anchor)?this.options.anchor.length:1:-1}destroy(){}};m(km,"testId",0);var aa=km;p();p();p();p();p();var Dm=class{constructor(){m(this,"hover",!1);m(this,"dirty",!1)}};p();p();function pI(e){"@babel/helpers - typeof";return pI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pI(e)}var Txe=/^\s+/,wxe=/\s+$/;function Se(e,t){if(e=e||"",t=t||{},e instanceof Se)return e;if(!(this instanceof Se))return new Se(e,t);var r=Mxe(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}Se.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),r,n,o,i,s,a;return r=t.r/255,n=t.g/255,o=t.b/255,r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),o<=.03928?a=o/12.92:a=Math.pow((o+.055)/1.055,2.4),.2126*i+.7152*s+.0722*a},setAlpha:function(t){return this._a=_q(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Tq(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Tq(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+o+"%)":"hsva("+r+", "+n+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=Pq(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Pq(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+o+"%)":"hsla("+r+", "+n+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return wq(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return Axe(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(dr(this._r,255)*100)+"%",g:Math.round(dr(this._g,255)*100)+"%",b:Math.round(dr(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(dr(this._r,255)*100)+"%, "+Math.round(dr(this._g,255)*100)+"%, "+Math.round(dr(this._b,255)*100)+"%)":"rgba("+Math.round(dr(this._r,255)*100)+"%, "+Math.round(dr(this._g,255)*100)+"%, "+Math.round(dr(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Vxe[wq(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+Mq(this._r,this._g,this._b,this._a),n=r,o=this._gradientType?"GradientType = 1, ":"";if(t){var i=Se(t);n="#"+Mq(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var r=!!t;t=t||this._format;var n=!1,o=this._a<1&&this._a>=0,i=!r&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return Se(this.toString())},_applyModification:function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Lxe,arguments)},brighten:function(){return this._applyModification(Rxe,arguments)},darken:function(){return this._applyModification(Nxe,arguments)},desaturate:function(){return this._applyModification(kxe,arguments)},saturate:function(){return this._applyModification(Dxe,arguments)},greyscale:function(){return this._applyModification(Fxe,arguments)},spin:function(){return this._applyModification(Bxe,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(Gxe,arguments)},complement:function(){return this._applyCombination($xe,arguments)},monochromatic:function(){return this._applyCombination(Uxe,arguments)},splitcomplement:function(){return this._applyCombination(jxe,arguments)},triad:function(){return this._applyCombination(Oq,[3])},tetrad:function(){return this._applyCombination(Oq,[4])}};Se.fromRatio=function(e,t){if(pI(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=nb(e[n]));e=r}return Se(e,t)};function Mxe(e){var t={r:0,g:0,b:0},r=1,n=null,o=null,i=null,s=!1,a=!1;return typeof e=="string"&&(e=qxe(e)),pI(e)=="object"&&(bl(e.r)&&bl(e.g)&&bl(e.b)?(t=Oxe(e.r,e.g,e.b),s=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):bl(e.h)&&bl(e.s)&&bl(e.v)?(n=nb(e.s),o=nb(e.v),t=_xe(e.h,n,o),s=!0,a="hsv"):bl(e.h)&&bl(e.s)&&bl(e.l)&&(n=nb(e.s),i=nb(e.l),t=Exe(e.h,n,i),s=!0,a="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=_q(r),{ok:s,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function Oxe(e,t,r){return{r:dr(e,255)*255,g:dr(t,255)*255,b:dr(r,255)*255}}function Pq(e,t,r){e=dr(e,255),t=dr(t,255),r=dr(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),i,s,a=(n+o)/2;if(n==o)i=s=0;else{var l=n-o;switch(s=a>.5?l/(2-n-o):l/(n+o),n){case e:i=(t-r)/l+(t<r?6:0);break;case t:i=(r-e)/l+2;break;case r:i=(e-t)/l+4;break}i/=6}return{h:i,s,l:a}}function Exe(e,t,r){var n,o,i;e=dr(e,360),t=dr(t,100),r=dr(r,100);function s(u,d,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?u+(d-u)*6*f:f<1/2?d:f<2/3?u+(d-u)*(2/3-f)*6:u}if(t===0)n=o=i=r;else{var a=r<.5?r*(1+t):r+t-r*t,l=2*r-a;n=s(l,a,e+1/3),o=s(l,a,e),i=s(l,a,e-1/3)}return{r:n*255,g:o*255,b:i*255}}function Tq(e,t,r){e=dr(e,255),t=dr(t,255),r=dr(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),i,s,a=n,l=n-o;if(s=n===0?0:l/n,n==o)i=0;else{switch(n){case e:i=(t-r)/l+(t<r?6:0);break;case t:i=(r-e)/l+2;break;case r:i=(e-t)/l+4;break}i/=6}return{h:i,s,v:a}}function _xe(e,t,r){e=dr(e,360)*6,t=dr(t,100),r=dr(r,100);var n=Math.floor(e),o=e-n,i=r*(1-t),s=r*(1-o*t),a=r*(1-(1-o)*t),l=n%6,u=[r,s,i,i,a,r][l],d=[a,r,r,s,i,i][l],f=[i,i,a,r,r,s][l];return{r:u*255,g:d*255,b:f*255}}function wq(e,t,r,n){var o=[ts(Math.round(e).toString(16)),ts(Math.round(t).toString(16)),ts(Math.round(r).toString(16))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function Axe(e,t,r,n,o){var i=[ts(Math.round(e).toString(16)),ts(Math.round(t).toString(16)),ts(Math.round(r).toString(16)),ts(Aq(n))];return o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function Mq(e,t,r,n){var o=[ts(Aq(n)),ts(Math.round(e).toString(16)),ts(Math.round(t).toString(16)),ts(Math.round(r).toString(16))];return o.join("")}Se.equals=function(e,t){return!e||!t?!1:Se(e).toRgbString()==Se(t).toRgbString()};Se.random=function(){return Se.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function kxe(e,t){t=t===0?0:t||10;var r=Se(e).toHsl();return r.s-=t/100,r.s=dI(r.s),Se(r)}function Dxe(e,t){t=t===0?0:t||10;var r=Se(e).toHsl();return r.s+=t/100,r.s=dI(r.s),Se(r)}function Fxe(e){return Se(e).desaturate(100)}function Lxe(e,t){t=t===0?0:t||10;var r=Se(e).toHsl();return r.l+=t/100,r.l=dI(r.l),Se(r)}function Rxe(e,t){t=t===0?0:t||10;var r=Se(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),Se(r)}function Nxe(e,t){t=t===0?0:t||10;var r=Se(e).toHsl();return r.l-=t/100,r.l=dI(r.l),Se(r)}function Bxe(e,t){var r=Se(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,Se(r)}function $xe(e){var t=Se(e).toHsl();return t.h=(t.h+180)%360,Se(t)}function Oq(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Se(e).toHsl(),n=[Se(e)],o=360/t,i=1;i<t;i++)n.push(Se({h:(r.h+i*o)%360,s:r.s,l:r.l}));return n}function jxe(e){var t=Se(e).toHsl(),r=t.h;return[Se(e),Se({h:(r+72)%360,s:t.s,l:t.l}),Se({h:(r+216)%360,s:t.s,l:t.l})]}function Gxe(e,t,r){t=t||6,r=r||30;var n=Se(e).toHsl(),o=360/r,i=[Se(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,i.push(Se(n));return i}function Uxe(e,t){t=t||6;for(var r=Se(e).toHsv(),n=r.h,o=r.s,i=r.v,s=[],a=1/t;t--;)s.push(Se({h:n,s:o,v:i})),i=(i+a)%1;return s}Se.mix=function(e,t,r){r=r===0?0:r||50;var n=Se(e).toRgb(),o=Se(t).toRgb(),i=r/100,s={r:(o.r-n.r)*i+n.r,g:(o.g-n.g)*i+n.g,b:(o.b-n.b)*i+n.b,a:(o.a-n.a)*i+n.a};return Se(s)};Se.readability=function(e,t){var r=Se(e),n=Se(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};Se.isReadable=function(e,t,r){var n=Se.readability(e,t),o,i;switch(i=!1,o=Zxe(r),o.level+o.size){case"AAsmall":case"AAAlarge":i=n>=4.5;break;case"AAlarge":i=n>=3;break;case"AAAsmall":i=n>=7;break}return i};Se.mostReadable=function(e,t,r){var n=null,o=0,i,s,a,l;r=r||{},s=r.includeFallbackColors,a=r.level,l=r.size;for(var u=0;u<t.length;u++)i=Se.readability(e,t[u]),i>o&&(o=i,n=Se(t[u]));return Se.isReadable(e,n,{level:a,size:l})||!s?n:(r.includeFallbackColors=!1,Se.mostReadable(e,["#fff","#000"],r))};var u5=Se.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Vxe=Se.hexNames=zxe(u5);function zxe(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function _q(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function dr(e,t){Hxe(e)&&(e="100%");var r=Wxe(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function dI(e){return Math.min(1,Math.max(0,e))}function Go(e){return parseInt(e,16)}function Hxe(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Wxe(e){return typeof e=="string"&&e.indexOf("%")!=-1}function ts(e){return e.length==1?"0"+e:""+e}function nb(e){return e<=1&&(e=e*100+"%"),e}function Aq(e){return Math.round(parseFloat(e)*255).toString(16)}function Eq(e){return Go(e)/255}var es=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function bl(e){return!!es.CSS_UNIT.exec(e)}function qxe(e){e=e.replace(Txe,"").replace(wxe,"").toLowerCase();var t=!1;if(u5[e])e=u5[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=es.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=es.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=es.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=es.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=es.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=es.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=es.hex8.exec(e))?{r:Go(r[1]),g:Go(r[2]),b:Go(r[3]),a:Eq(r[4]),format:t?"name":"hex8"}:(r=es.hex6.exec(e))?{r:Go(r[1]),g:Go(r[2]),b:Go(r[3]),format:t?"name":"hex"}:(r=es.hex4.exec(e))?{r:Go(r[1]+""+r[1]),g:Go(r[2]+""+r[2]),b:Go(r[3]+""+r[3]),a:Eq(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=es.hex3.exec(e))?{r:Go(r[1]+""+r[1]),g:Go(r[2]+""+r[2]),b:Go(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function Zxe(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}var C5=fs(S5());var T5=B.object({rank:B.union([B.enum(["low","medium","high","always-visible"]),B.number()]).optional(),interactive:B.boolean().optional(),appearance:B.object({margin:B.number().min(6).optional(),text:B.object({numLines:B.number().optional(),lineHeight:B.number().optional(),size:B.number().optional(),maxWidth:B.number().optional(),foregroundColor:B.string().optional(),backgroundColor:B.string().optional()}).optional(),marker:B.object({size:B.number().optional(),foregroundColor:B.object({active:B.string().optional(),inactive:B.string().optional()}).optional(),backgroundColor:B.object({active:B.string().optional(),inactive:B.string().optional()}).optional()}).optional()}).optional()});function pZ(e,t,r){B.array(B.number()).min(2).max(3).parse(e),B.string().parse(t),T5.parse(r||{})}var Nm={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},jIe={lightOnDark:{...Nm,text:{...Nm.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...Nm.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...Nm,text:{...Nm.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...Nm.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},GIe="LOW_PRIORITY",lZ=4,UIe=6,VIe=20,zIe=2.5,HIe=2,WIe="cover",qIe=-1/0,cZ=6.5,uZ={heightAbovePolygon:0,appearance:jIe.darkOnLight};var Bm=class Bm{constructor(t,r,n){m(this,"lines",0);m(this,"id");m(this,"rank");m(this,"type","label");m(this,"initialRank");m(this,"contextConfigured",!1);m(this,"fillText");m(this,"newStyle",{});m(this,"opacity",0);m(this,"visibilityNeedsUpdate",!1);m(this,"text");m(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});m(this,"projection",new Ee);m(this,"labelCacheId");m(this,"_cache",{});m(this,"appearance");m(this,"options");m(this,"visible",!0);m(this,"enabled",!0);m(this,"isOccluded",!1);m(this,"offscreen",!1);m(this,"canShow",!1);m(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});m(this,"dimensions",{width:0,height:0});m(this,"currentStrategyIndex",-1);m(this,"totalMarkerSize",0);m(this,"dirty",!0);m(this,"attachedDirty",!0);m(this,"collisionDirty",!0);m(this,"lastTextAlign");m(this,"imageHash");m(this,"markerSize",0);m(this,"iconVisible",!1);m(this,"dp");m(this,"animate",!0);m(this,"onStrategySelected",t=>{if(this.currentStrategyIndex===t)return;let r=this.strategies[t];r&&r.onStrategySelected(this),this.currentStrategyIndex=t;let n=this.style;this.style=this.newStyle,this.newStyle=n});m(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var i,s;if(this.id=(i=r.id)!=null?i:Et(),this.options=(0,C5.default)({},r,uZ),this.text=t,this.dp=(a=1)=>a*n.pixelRatio,typeof r.rank=="string")this.rank=Mm(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let a=Math.trunc(g.env.NODE_ENV==="test"?Bm.testId:Bm.testId*10)/10;Bm.testId+=.001,this.rank=a,this.initialRank=a}let o=(0,C5.default)({},this.options.appearance,uZ.appearance);this.appearance={margin:o.margin,text:{lineHeight:o.text.lineHeight,numLines:o.text.numLines,size:o.text.size,maxWidth:o.text.maxWidth,foregroundColor:o.text.foregroundColor,backgroundColor:o.text.backgroundColor},marker:{foregroundColor:{active:o.marker.foregroundColor.active,inactive:o.marker.foregroundColor.inactive||Se(o.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:o.marker.backgroundColor.active,inactive:o.marker.backgroundColor.inactive||Se(o.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:o.marker.icon,iconSize:o.marker.iconSize||VIe,iconPadding:(s=o.marker.iconPadding)!=null?s:HIe,iconFit:o.marker.iconFit||WIe,iconOverflow:o.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:o.marker.iconVisibleAtZoomLevel==null?qIe:o.marker.iconVisibleAtZoomLevel}}}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(cZ),this.totalMarkerSize=Math.ceil((this.markerSize+zIe)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,o=Math.max(UIe,n),i=this.iconVisible?o/2:0,s=this.iconVisible?this.totalMarkerSize:cZ,a=[{name:"RIGHT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,r);return[l/2+o,l/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+t+o]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.totalMarkerSize/2+lZ,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,r);return[l/2+o,l/2+o,this.totalMarkerSize/2+t+o,this.totalMarkerSize/2+o]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-t-this.totalMarkerSize/2-lZ,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let l=this.dp();return[r+this.totalMarkerSize/2/l+o,this.totalMarkerSize/2+o,t/2+o,t/2+o]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.totalMarkerSize/2,this.newStyle.left=-t/2}},{name:GIe,getBoundingBox:()=>[s/2+i,s/2+i,s/2+i,s/2+i],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o,this.totalMarkerSize/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:a}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){var r;if(this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==((r=this.packedMessage.bboxes[0])==null?void 0:r[4])){let n=this.packedMessage.bboxes.findIndex(o=>o[4]===this.currentStrategyIndex);if(n!==-1){let o=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(o)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let o=this.strategies[n];n===this.currentStrategyIndex&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.bboxes.unshift([...o.getBoundingBox(),n]):this.packedMessage.bboxes.push([...o.getBoundingBox(),n])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};m(Bm,"testId",0);var P5=Bm,la=P5;p();p();var II=class extends De{constructor(r,n){super();m(this,"rendererState");m(this,"convertTo3DMapPosition");m(this,"textSet",new Set);m(this,"batchedTextMap",new Map);m(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var a,l,u;let n,o,i,s=[];for(let d of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(d),(n==null?void 0:n.type)==="text3d"){o=n.components[0],i=n.components[1];let f=(a=o.mesh)==null?void 0:a.parent;if(!f||!(f instanceof at)||!(o instanceof Nc))continue;if("textArea"in o.feature.properties&&o.mesh!=null&&o.polygonEntityId!=null&&o.textMesh==null&&o.mesh.parent!=null&&((u=(l=o.feature.properties)==null?void 0:l.textArea)==null?void 0:u.position)!=null){if(this.textSet.has(o.polygonEntityId))continue;this.textSet.add(o.polygonEntityId),this.batchedTextMap.has(f)||this.batchedTextMap.set(f,$m().then(({BatchedText:v})=>{let I=new v;return I.type="batchedtext",f.add(I),I}));let b=this.batchedTextMap.get(f);if(!b)throw new Error("batched text required");s.push(dZ({entityId:d,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:b,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(o.mesh!=null&&o.textMesh==null&&o.mesh.parent!=null){if(this.textSet.has(d.toString()))continue;this.textSet.add(d.toString()),this.batchedTextMap.has(f)||this.batchedTextMap.set(f,$m().then(({BatchedText:v})=>{let I=new v;return I.type="batchedtext",f.add(I),I}));let b=this.batchedTextMap.get(f);if(!b)throw new Error("batched text required");s.push(dZ({entityId:d,textComponent:o,styleComponent:i,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:b,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let h=this.batchedTextMap.get(f);o.textMesh&&h&&o.polygonEntityId!=null&&Promise.all([h,Promise.resolve({meshComponent:o,styleComponent:i})]).then(([b,{meshComponent:v,styleComponent:I}])=>{let{textMesh:x}=v;if(b&&x){let C=E5(b,x);v.visible&&!C?b.add(x):!v.visible&&C&&b.remove(x)}I.flipToFaceCamera&&this.flipIfNeeded(v,r)})}return Promise.all(s)}flipIfNeeded(r,n){let o=r.textMesh;if(!o)return!1;let i=o.rotation.z,s=QS(i+n);s>Math.PI/2&&s<3*Math.PI/2&&(o.rotation.z=QS(i+Math.PI))}showTextAreaMesh(){let r,n;for(let o of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(o),(r==null?void 0:r.type)==="text3d"&&(n=r.components[0],"textArea"in n.feature.properties)){let i=n.feature.properties.textArea;if(!i)continue;let s=new Ti(i.maxWidth,i.maxHeight),a=new Ve(s,new Br({color:"pink"})),{textMesh:l}=n;if(!l)continue;let u=this.convertTo3DMapPosition(i.position,cb);a.position.copy(u),a.position.z=l.position.z-.1,a.rotation.z=l.rotation.z,w5.identity(),w5.makeRotationAxis(new Ce(0,0,1),l.userData.rotationZ),cb.set(i.maxWidth/2,0,0),cb.applyMatrix4(w5),a.position.x-=cb.x,a.position.y-=cb.y,this.rendererState.entityScene.add(a),this.debugTextAreaMesh.set(o,a)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};function O5(e){$m().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}var w5=new Ci,cb=new Ce,M5;async function fZ(e){let{preloadFont:t}=await $m();return t(e)}function $m(){return M5||(M5=import("./text3d-Z4HFM4UG.js").then(e=>e)),M5}async function dZ({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:o,rendererState:i,type:s="text-area"}){return Promise.all([$m(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:a,createTroikaTextArea:l},u])=>s==="text-area"?l(u.entityId,u.meshComponent,u.styleComponent,n):a(u.entityId,u.meshComponent,u.styleComponent,n)).catch(a=>{$.warn("Trouble creating text: ",a)}).then(a=>{if(!(a!=null&&a.text))return;let l=[Promise.resolve(a.text),o,Promise.resolve()];if(t.polygonEntityId){let u=i.geometry3DMap.get(t.polygonEntityId);if((u==null?void 0:u.type)==="geometry"){let d=u.components[0],f=u.components[1];d.textMesh=a.text,d.mesh!=null&&(a.text.position.z=f.altitude+f.height+ZIe)}}else l[2]=$m().then(({syncText:u})=>u(a.text));return Promise.all(l)}).then(a=>{if(!a)return;let[l,u]=a;u.add(l),t.batchedText||(t.batchedText=u)})}function E5(e,t){return e._members.has(t)}var ZIe=.5;var XIe=B.object({visible:B.boolean(),color:B.string(),flipToFaceCamera:B.boolean(),font:B.string().optional(),fontSize:B.number(),margin:B.union([B.number(),B.tuple([B.number(),B.number(),B.number(),B.number()])]),outlineColor:B.string(),outlineOpacity:B.number(),outlineBlur:B.union([B.number(),B.string()]),outlineWidth:B.number(),outlineOffsetX:B.number(),outlineOffsetY:B.number(),strokeWidth:B.number(),maxWidth:B.number().optional(),maxHeight:B.number().optional(),strokeOpacity:B.number(),strokeColor:B.string(),fillOpacity:B.number(),hoverColor:B.string().optional(),id:B.union([B.string(),B.number()]),type:B.literal("text3d"),position:B.tuple([B.number(),B.number(),B.number()]),content:B.string()}),mZ=XIe.partial().omit({id:!0,type:!0}).strict(),hZ=mZ.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),yZ=B.object({appearance:mZ.optional(),parentId:B.string().optional()}).strict(),Nc=class{constructor(t){m(this,"mesh",new Mi);m(this,"textMesh");m(this,"type","text3d");m(this,"feature");m(this,"parent");m(this,"batchedText");m(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?E5(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};p();var jm=class{constructor(t){m(this,"color");m(this,"dirty",!0);m(this,"visible",!0);m(this,"edgeColors");m(this,"geometry");m(this,"ranges");m(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[3]:0}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[0],this.edgeColors.array[1],this.edgeColors.array[2]]:[0,0,0]}};p();p();p();var SI=class extends rE{constructor(r){let n=r,o=3,i=o*4;super(new Float32Array(r*i),o,r,X1,qO);m(this,"_width");m(this,"_height");m(this,"_propertiesLength");this._width=i,this._height=n,this._propertiesLength=o}setColor(r,n,o){let i=this.image.data,s=r*this._width;i[s]=n.r,i[s+1]=n.g,i[s+2]=n.b,i[s+3]=0,i[s+4]=o.r,i[s+5]=o.g,i[s+6]=o.b,i[s+7]=0,this.needsUpdate=!0}getColor(r){let n=this.image.data,o=r*this._width,i=new Ft(n[o],n[o+1],n[o+2]),s=new Ft(n[o+4],n[o+5],n[o+6]);return{color:i,topColor:s}}setTexture(r,n,o){let i=this.image.data,s=r*this._width;i[s+8]=n?1:0,i[s+9]=o?1:0,i[s+10]=0,i[s+11]=0,this.needsUpdate=!0}};var gZ="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";var bZ="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of `==` comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n";var JIe=-.05,QIe=1,Wp=class extends wi{constructor(r,n,o=1){super(r);m(this,"propertiesTexture");m(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});m(this,"colorSpace",Sa);m(this,"showTextures",r=>{let n=!!this.uniforms.uTexture.value,o=!!this.uniforms.uTopTexture.value;(n||o)&&(this.propertiesTexture.setTexture(r,n,o),this.needsUpdate=!0)});this.propertiesTexture=new SI(n),this.uniforms.uRepeatYFactor.value=o,this.onBeforeCompile=i=>{let s=this.uniforms.uGradientIntensity,a=this.uniforms.uGradientEnd,l=this.uniforms.uGradientStart,u=this.uniforms.uTopTexture,d=this.uniforms.uTexture,f=this.uniforms.uRepeatYFactor,h=this.uniforms.uBlendTexture;this.uniforms=i.uniforms,i.vertexShader=gZ,i.fragmentShader=bZ,Object.assign(this.uniforms,{uGradientIntensity:s,uGradientEnd:a,uGradientStart:l,uMinSideAlpha:{value:JIe},uMaxSideAlpha:{value:QIe},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:u,uTexture:d,uRepeatYFactor:f,uBlendTexture:h})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){r.wrapS=ms,r.wrapT=ms,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=ms,r.wrapT=ms,r.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=r}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(r){r!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=r,this.colorSpace=r?ZO:Sa,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(r,n,o){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=o}setColor(r,n,o){this.propertiesTexture.setColor(r,n,o)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){let n=!!this.uniforms.uTexture.value,o=!!this.uniforms.uTopTexture.value;(n||o)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,n),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};p();function vZ(e,t){var a,l,u;let r=0;for(let d of e)r+=((l=(a=d.components[0])==null?void 0:a.geometry)==null?void 0:l.attributes.position.count)||0;let n=new Ft(t.color),o;o=new Wp({color:n,side:t.side==="back"?zO:t.side==="front"?Z1:Ia,opacity:(u=t.opacity)!=null?u:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let i=new o0(e.length,r,0,o),s;for(let d of e)s=d.components[0],!(!(s instanceof hr)||!s.geometry)&&(s.mesh=i,s.material=o,s.instanceIndex=i.addGeometry(s.geometry),i.addInstance(s.instanceIndex),i.userData.entities[s.instanceIndex]=d.id,o instanceof Wp&&o.setColor(s.instanceIndex,n,t.topColor?new Ft(t.topColor):n));return i.perObjectFrustumCulled=!0,i.matrixAutoUpdate=!1,i}function CI(e){return Se(e).darken(30).toRgbString()}function xZ(e,t,r,n){if(t.length<1)return;e.boundingBox||e.computeBoundingBox();let o=e.boundingBox,i=e.getAttribute("position"),s=e.getAttribute("normal"),a=e.getAttribute("uv"),l,u;e.index?(l=e.index.count/3,u=function(w,T){return e.index.getX(w*3+T)}):(l=i.count/3,u=function(w,T){return w*3+T});let d=new Ci;d.makeRotationFromQuaternion(new xh().setFromEuler(new Ca(0,0,r/180*Math.PI)));let f=t.find(w=>w.face==="top"),h;f&&(h={min:n(f.bounds[1],f.bounds[0],0),max:n(f.bounds[3],f.bounds[2],o.max.z)});let b=t.find(w=>w.face==="side"),v;if(b&&(v={min:n(b.bounds[1],b.bounds[0],0),max:n(b.bounds[3],b.bounds[2],o.max.z)}),!(!v&&!h))for(let w=0;w<l;++w){let T=s.getX(u(w,0))+s.getX(u(w,1))+s.getX(u(w,2)),O=s.getY(u(w,0))+s.getY(u(w,1))+s.getY(u(w,2)),N=s.getZ(u(w,0))+s.getZ(u(w,1))+s.getZ(u(w,2)),k=Math.abs(T),D=Math.abs(O),F=Math.abs(N);var I,x;k<=D&&k<=F?(I="x",D<=F?x="y":x="z"):D<=k&&D<=F?(I="y",k<=F?x="x":x="z"):(I="z",k<=D?x="x":x="y"),I==="z"&&(I=x,x="z");let z,G,j,K,Z,oe;if(x==="z"||I==="z"){if(!b||!v)continue;z=b.repeat.u,G=b.repeat.v,j=b.offset.u,K=b.offset.v,Z=b.rotation,oe=v}else{if(!f||!h)continue;z=f.repeat.u,G=f.repeat.v,j=f.offset.u,K=f.offset.v,Z=(360-r+f.rotation)%360,oe=h}let{min:Q,max:ye}=oe,be=new Pa;be.position.set(Q.x,Q.y,0),be.updateMatrix(),be.updateMatrixWorld();let ue=Q.clone().applyMatrix4(d),_e=ye.clone().applyMatrix4(d),ht=Math.abs(_e.x-ue.x),ot=Math.abs(_e.y-ue.y),Xe=new Ce(ht,ot,ye.z).applyMatrix4(be.matrixWorld),Ue=Math.abs(Xe[I]-Q[I]),pe=Math.abs(Xe[x]-Q[x]),me=Z*Math.PI/180||0,te=Math.cos(me),ie=Math.sin(me),A=be.matrixWorld.clone().invert(),Y=new xh().setFromEuler(new Ca(0,0,r/180*Math.PI));for(let L=0;L<3;L++){let ne=new Ce(i.getX(u(w,L)),i.getY(u(w,L)),i.getZ(u(w,L))).applyMatrix4(A);ne.applyQuaternion(Y);let ae=ne.applyMatrix4(be.matrixWorld),ve=ae.x,cr=ae.y,jn=ae.z;var C,P;I==="x"?C=z*(ve-Q[I])/Ue+j:I==="y"?C=z*(cr-Q[I])/Ue+j:C=z*(jn-Q[I])/Ue+j,x==="x"?P=G*(ve-Q[x])/pe+K:x==="y"?P=G*(cr-Q[x])/pe+K:P=G*(jn-Q[x])/pe+K,C-=.5,P-=.5;let rn=C*te-P*ie+.5,xn=C*ie+P*te+.5;a.setX(u(w,L),rn),a.setY(u(w,L),xn)}}}p();var Gm=class{constructor(){m(this,"focusMesh");m(this,"dirty",!0)}};function gn(e,t,r){if(t!==void 0){if(e.type==="model"||e.type==="path"||e.type==="marker"||e.type==="label"||e.type==="geometry"||e.type==="group-container"||e.type==="custom-geometry")return t===!0?(e instanceof hu&&e.components[1]===void 0?(e.components[1]=new Dm,e.components[1].dirty=!0):e instanceof Tt&&e.components[2]===void 0?(e.components[2]=new Dm,e.components[2].dirty=!0):e instanceof at&&e.components[1]===void 0&&(e.components[1]=new Dm,e.components[1].dirty=!0),!0):(e instanceof hu?e.components[1]=void 0:e instanceof Tt?e.components[2]=void 0:e instanceof at&&(e.components[1]=void 0),!0);if(e.type==="geometry-group"){let n;for(let o of e.userData.entities3D.values())n=r.geometry3DMap.get(o),gn(n,t,r);return!0}}return!1}function IZ(e,t,r){if(!(!(r!=null&&r.color)&&!("topColor"in r))){if(r!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let n,o,i=e.components[0];for(let s of e.userData.entities3D.values())if(n=t.geometry3DMap.get(s),n){o=n.components[1],o.color===i.color&&(o.initialColor=r.color||i.color,o.color=r.color||i.color,o.dirty=!0);let a=n.components[3];a&&(a.color=CI(o.color||i.color),a.dirty=!0),o.topColor===i.topColor&&(o.topColor=r.topColor||i.topColor,o.dirty=!0)}return r.color!==void 0&&(i.color=r.color,i.dirty=!0),"topColor"in r&&(i.topColor=r.topColor,i.dirty=!0),!0}return!1}}function SZ(e,t){if(t!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let r=e.components[0];return r.shading=r.shading||{},r.shading&&(t.start!==r.shading.start||t.end!==r.shading.end||t.intensity!==r.shading.intensity)&&(Object.assign(r.shading,t),e.userData.shadingDirty=!0),!0}return!1}function CZ(e,t){t!==void 0&&e.type==="geometry"&&(t.showImage!==void 0&&(e.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(e.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}function A5(e,t,r){if(r!==void 0){if(e.type==="geometry"){let n=e.components[1];if(n.height!==r)return n.height=r,n.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),!0}else if(e.type==="geometry-group"){let n=e.components[0];for(let o of e.userData.entities3D.values()){let i=t.geometry3DMap.get(o),s;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(s=i.components[1],s.height===n.height&&(i.components[1].height=r,i.components[1].dirty=!0),i.components[3]&&(i.components[3].dirty=!0))}return e.components[0].height=r,!0}}return!1}function k5(e,t){t!==void 0&&(e.type==="path"||e.type==="geometry")&&(t.initialColor!==void 0&&(e.components[1].initialColor=t.initialColor),t.color!==void 0&&t.color!==e.components[1].color&&(e.components[1].color=t.color,e.components[3]&&(e.components[3].color=t.color,e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor),e.components[1].dirty=!0)}function D5(e,t,r){t!==void 0&&(e.type==="label"||e.type==="marker"?(e.object3d.position.copy(r(t[1],t[0],t[2]||0)),e.positionDirty=!0):e.type==="custom-geometry"&&e.components[0].position.copy(r(t[1],t[0],t[2]||0)))}function F5(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof at?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}function PZ(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}function TZ(e,t,r){if(t!==void 0&&e.type==="marker"){let n=e.components[0];if(t.contentHTML!==void 0)return n.containerEl.innerHTML=t.contentHTML,n.contentHtml=t.contentHTML,!0;if(t.anchor!==void 0&&(n.options.anchor=t.anchor,n.collisionDirty=!0),t.dynamicResize!==void 0)return n.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{c5.parse(t.options||{})}catch(o){return $.error(o),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",gn(e,!1,r)):(n.pointerEvents="none",gn(e,t.options.interactive,r))),wZ(e,t.options.rank),!0}}return!1}function wZ(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=Mm(t),!0):!1}function MZ(e,t,r){var n,o,i,s,a;if(t!==void 0&&e.type==="label"){let l=e.components[0];t.text!==void 0&&(l.text=t.text,l.dirty=!0);try{T5.parse(t.options||{})}catch(u){$.error(u);return}((n=t.options)==null?void 0:n.appearance)!==void 0&&Object.keys((o=t.options)==null?void 0:o.appearance).length>0&&(FE(l.appearance,((i=t.options)==null?void 0:i.appearance)||{}),l.dirty=!0),gn(e,(s=t.options)==null?void 0:s.interactive,r),wZ(e,(a=t.options)==null?void 0:a.rank)}}function OZ(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}function EZ(e,t){if(t!==void 0){let r=e.components[2];if(e.type==="geometry"&&r!=null)return r.hover=t,r.dirty=!0,!0}return!1}function L5(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}function ca(e,t,r){if(r!==void 0){if(e.type==="model"||e.type==="path"||e.type==="geometry"||e.type==="custom-geometry"||e.type==="image"||e.type==="text3d"){e.components[1].visible=r,e.components[1].dirty=!0;let n=e.components[3];n&&(n.visible=r,n.dirty=!0)}else e.type==="geometry-group"?e.setVisible(r):e.type==="group-container"?(e.setVisible(r),r===!1&&e.traverse(n=>{if(n instanceof CE){let o=t.geometry2DMap.get(n.userData.entityId);if(o){let i=o.components[0];i instanceof la&&(i.canShow=r)}}})):e.type==="label"&&(e.components[0].visible=r);return!0}return!1}function R5(e,t,r){if(r!==void 0){if(e.type==="geometry-group"){let n=e.components[0];if(n.opacity!==r){for(let o of e.userData.entities3D.values()){let i=t.geometry3DMap.get(o),s;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(s=i.components[1],(!s.opacity||s.opacity===n.opacity)&&(s.opacity=r,s.dirty=!0))}return e.setOpacity(r),n.opacity=r,!0}}else if(e.type==="group-container"&&e.opacity!==r){e.setOpacity(r);let n=1;return e.parent instanceof at&&(n=e.parent.opacity),_Z(e,t,n),!0}}return!1}function _Z(e,t,r=1){if(e.type==="group-container"&&"children"in e&&e.children.length>0){let n=r*e.opacity;e.userData.computedOpacity=n;for(let o of e.children)(o instanceof In&&o.type==="geometry-group"||o instanceof at&&o.type==="group-container")&&_Z(o,t,n)}else if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let o=t.geometry3DMap.get(n),i;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(i=o.components[1],i.dirty=!0)}}function AZ(e,t){if(t!==void 0&&e.type==="geometry-group"){let r=e.components[0];(t==null?void 0:t.texture)!=null&&r.texture!==(t==null?void 0:t.texture)&&(r.texture=t.texture,r.dirty=!0),(t==null?void 0:t.topTexture)!=null&&r.topTexture!==(t==null?void 0:t.topTexture)&&(r.topTexture=t.topTexture,r.dirty=!0)}}function kZ(e,t){if(e.type==="geometry"){let r=!1,n=e.components[1];if((t==null?void 0:t.texture)!=null&&n.texture!==(t==null?void 0:t.texture)&&(n.texture=t.texture,r=!0),(t==null?void 0:t.topTexture)!=null&&n.topTexture!==(t==null?void 0:t.topTexture)&&(n.topTexture=t.topTexture,r=!0),r&&e.components[0]instanceof hr){let o=e.components[0];return o.detached===!1&&(o.detached=!0,o.dirty=!0),!0}}return!1}function DZ(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.opacity!==t){r.opacity=t;let n=e.components[0],o=e.components[3];o&&(o.dirty=!0),n.detached===!1&&(n.detached=!0,n.dirty=!0),t===0?r.visible=!1:r.visible=!0,r.dirty=!0;let i=e.parentObject3D;return(i==null?void 0:i.type)==="geometry-group"&&(i.userData.shadingDirty=!0),!0}}return!1}function PI(e,t){if(t!==void 0)if(e.type==="path"||e.type==="geometry"||e.type==="custom-geometry")e.components[1].altitude=t,e.components[1].dirty=!0;else{if(e.type==="group-container"&&e.altitude!==t)return e.setAltitude(t),!0;if(e.type==="geometry-group")return e.setAltitude(t),!0}return!1}function TI(e,t,r){if(r!==void 0){if(e.type==="geometry-group"&&e.components[0]!=null)for(let n of e.userData.entities3D.values()){let o=t.geometry3DMap.get(n);o instanceof Tt&&TI(o,t,r)}else if(e.type==="geometry"){let n=e.components[3],o=e.components[1];!n&&r===!0?e.components[3]=new jm(o.color):n&&(n.visible=r,n.dirty=!0)}return!0}return!1}function N5(e,t){if(t!==void 0){if(e.type==="geometry"){let r=e.components[0];if(e.type==="geometry"&&r&&r instanceof hr&&r.focusable!==t)return r.focusable=t,!0}else if(e.type==="group-container"){let r=e.components[2]!==void 0;if(t===!0&&!r)return e.components[2]=new Gm,!0;if(t===!1&&r)return e.components[2]=void 0,!0}}return!1}function FZ(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.renderOrder!==t){r.renderOrder=t;let n=e.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=t+1),r.dirty=!0,!0}}return!1}function LZ(e,t,r){let{visible:n,color:o}=r;if(e.type!=="path")return;let i=e.components[0];n!=null&&ca(e,t,n),o!=null&&k5(e,{color:o}),Object.assign(i,B5(r)),_E(r)||(i.materialDirty=!0,(r.nearRadius!=null||r.farRadius!=null)&&(i.dirty=!0),(r.nearZoomLevel!=null||r.farZoomLevel!=null)&&(i.dirty=!0))}function B5(e){return To(e,tSe)}var tSe=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel"];function RZ(e){if(!(e instanceof Tt&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}var wI=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function NZ(e,t,r){ca(e,t,r.visible);let n=e.components[1],o=To(r,wI);"margin"in r&&$.warn("update to margin is not supported atm"),"content"in r&&$.warn("content update is not supported atm");try{hZ.parse(o)}catch(i){$.error(i);return}Object.keys(o).length>0&&(Object.assign(n,o),n.dirty=!0)}var rSe=["color","material","opacity","verticalOffset","rotation","position","scale"];function BZ(e,t){let r=To(t,rSe),n=e.components[1],o=e.components[0];Object.keys(r).length>0&&(r.material&&(n.material=r.material),r.opacity!=null&&(n.opacity=r.opacity,r.opacity===0?n.visible=!1:n.visible=!0,n.dirty=!0),r.verticalOffset!=null&&(n.verticalOffset=r.verticalOffset),r.color!=null&&(n.color=r.color),r.position!=null&&(o.feature.geometry.coordinates=r.position,o.positionDirty=!0),r.rotation!=null&&(n.rotation=r.rotation),r.scale!=null&&(n.scale=r.scale),n.dirty=!0)}var qp,ua,MI,Bc,$Z,pb,OI,jZ,GZ,db,EI,fb,mb,_I,ub=class{constructor(t){M(this,Bc);M(this,qp,null);M(this,ua);m(this,"getCurrentSceneGLTF",async t=>{let r={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},n=await ee(this,Bc,$Z).call(this),o=c(this,MI).call(this,r),i=await n.parseAsync(o,{trs:!1,maxTextureSize:1/0,onlyVisible:r.onlyVisible,binary:r.binary,scale:r.scale}),s;if(i instanceof ArrayBuffer)s=new Blob([i],{type:"application/octet-stream"});else{let a=JSON.stringify(i,null,2);s=new Blob([a],{type:"text/plain"})}return s});M(this,MI,t=>{let{scale:r,light:n,onlyVisible:o}=t,i=new Vl,s=new Xr().setFromObject(c(this,ua).entityScene);if(c(this,pb).call(this,c(this,ua).entityScene,i,o),n){let a=new Q1(16777215,.3*Math.PI);a.position.set(0,Math.max(s.max.x,s.max.y)*r*.5,s.max.y*r*4),a.lookAt(0,0,-1),a.target.position.set(0,0,-1),a.add(a.target),i.add(a)}return i});M(this,pb,(t,r,n)=>{t.material&&(t instanceof Y1?ee(this,Bc,jZ).call(this,t).forEach(o=>r.add(o)):t instanceof Pd&&r.add(ee(this,Bc,GZ).call(this,t))),t.children.forEach(o=>{(!n||o.visible)&&c(this,pb).call(this,o,r,n)})});M(this,OI,(t,r,n)=>{let o=new sE({color:new Ft(t),metalness:0});return o.opacity=r,o.transparent=n,o});M(this,db,t=>{let{geometry:r,material:n,position:o,rotation:i,quaternion:s,scale:a}=t;if(!(r!=null&&r.isBufferGeometry))return t;let l=r.attributes.position,u=r.attributes.normal,d=r.attributes.uv;return c(this,EI).call(this,l,u),c(this,mb).call(this,o,a,i,s),d&&c(this,_I).call(this,d),n!=null&&n.map&&r.type==="PlaneGeometry"&&(t.side=Ia),t});M(this,EI,(t,r)=>{let n=new Ce,o=new Ce;for(let i=0;i<t.count;i++)n.fromBufferAttribute(t,i),c(this,fb).call(this,n),t.setXYZ(i,n.x,n.y,n.z),r&&(o.fromBufferAttribute(r,i),c(this,fb).call(this,o),r.setXYZ(i,o.x,o.y,o.z))});M(this,fb,t=>{let r=t.y;t.y=t.z,t.z=-r});M(this,mb,(t,r,n,o)=>{let i=t.y;t.y=t.z,t.z=-i;let s=r.y;if(r.y=r.z,r.z=s,n instanceof Ca)n.order="YXZ",n.set(n.x,n.y,n.z,n.order);else{let a=o.y;o.set(o.x,o.z,-a,o.w)}});M(this,_I,t=>{for(let r=0;r<t.count;r++){let n=t.getX(r),o=t.getY(r);t.setXY(r,n,o)}});_(this,ua,t),c(this,ua).entityScene=t.entityScene,c(this,ua).geometry3DMap=t.geometry3DMap}destroy(){_(this,qp,null)}};qp=new WeakMap,ua=new WeakMap,MI=new WeakMap,Bc=new WeakSet,$Z=async function(){if(!c(this,qp)){let{GLTFExporter:t}=await import("./GLTFExporter-AXJXTFZG.js");_(this,qp,new t)}return c(this,qp)},pb=new WeakMap,OI=new WeakMap,jZ=function(t){var s,a;let r=[],o=((s=t.userData)!=null&&s.entities?Object.values((a=t.userData)==null?void 0:a.entities):[]).map(l=>c(this,ua).geometry3DMap.get(l)),i=new Map;return o.forEach(l=>{var b;if(!l||!(l instanceof Tt))return;let u=l.components[1],d=l.components[2];if(!u.visible||u instanceof Is&&u.opacity===0||u instanceof Ph||u instanceof l0)return;let f=d!=null&&d.hover?u.hoverColor||c(this,ua).hoverColor:u.color,h="".concat(f,"-").concat(u.opacity,"-").concat(Number(u.visible));i.has(h)||i.set(h,[]),(b=i.get(h))==null||b.push(l)}),i.forEach((l,u)=>{let[d,f,h]=u.split("-"),b=l.reduce((C,P)=>{if(P.type==="custom-geometry")return C;let w=P.components[0];return"geometry"in w&&w.geometry instanceof eE&&C.push(w.geometry),C},[]),v=c(this,OI).call(this,d,Number(f),t.material.transparent),I=zo(b,!0),x=new Ve(I,v);x.position.copy(t.position),x.rotation.copy(t.rotation),x.scale.copy(t.scale),x.visible=!!h,c(this,mb).call(this,x.position,x.scale,x.rotation,x.quaternion),r.push(c(this,db).call(this,x))}),r},GZ=function(t){let r=t.geometry.clone(),n=t.material,o=new Br({color:n.color,side:Ia});o.opacity=n.opacity,o.transparent=n.transparent;let i=new Pd(r,o);return i.position.copy(t.position),i.rotation.copy(t.rotation),i.scale.copy(t.scale),i.visible=t.visible,c(this,db).call(this,i)},db=new WeakMap,EI=new WeakMap,fb=new WeakMap,mb=new WeakMap,_I=new WeakMap;p();p();p();var G5=fs(KZ());function JZ(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}JZ.prototype=Error.prototype;G5.default.Error=function(e){throw new JZ(e)};var qr=G5.default;var X3e="gray",Y3e=.1,gb=100,U5=new qr.ClipperOffset;function K3e(e,t){U5.Clear(),t/=2;let r=e.map(o=>({X:o.x*gb,Y:o.y*gb}));U5.AddPath(r,qr.JoinType.jtMiter,qr.EndType.etClosedPolygon);let n=new qr.Paths;return U5.Execute(n,t*gb),n.length?n.map(i=>i.map(s=>({x:s.X/gb,y:s.Y/gb}))):[e]}function RI(e,t,r){var h,b,v,I,x;let{color:n=X3e,opacity:o=1,altitude:i=0,height:s=Y3e}=r||{};Array.isArray(o)&&(o=1);let a={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:s+i},center:{x:0,y:0,z:(s+i)/2}},u=e.geometry.coordinates[0].map(C=>{let P=t(C[1],C[0]);return a.min.x=Math.min(a.min.x,P.x),a.min.y=Math.min(a.min.y,P.y),a.max.x=Math.max(a.max.x,P.x),a.max.y=Math.max(a.max.y,P.y),P});((b=(h=e.properties)==null?void 0:h.style)==null?void 0:b.edgeOffset)!=null&&e.properties.style.edgeOffset!==0||((v=e.properties)==null?void 0:v.image)!=null?u=K3e(u,((x=(I=e.properties)==null?void 0:I.style)==null?void 0:x.edgeOffset)||0):u=[u];let d=[];for(let C of u){let P=new hs;P.moveTo(C[0].x,C[0].y),C.slice(1).forEach(N=>P.lineTo(N.x,N.y)),P.lineTo(C[0].x,C[0].y);let w=e.geometry.coordinates.slice(1);P.holes=w.map(N=>{let k=N.map(F=>t(F[1],F[0])),D=new Hl;return D.moveTo(k[0].x,k[0].y),k.slice(1).forEach(F=>D.lineTo(F.x,F.y)),D.lineTo(k[0].x,k[0].y),D});let T={bevelEnabled:!1,depth:s},O=new ys(P,T);O.userData={style:{color:n,opacity:o}},d.push(O)}if(d.length===1)return d[0];let f=zo(d);return f.userData={style:{color:n,opacity:o},_split:!0},f}p();var J3e="gray",Q3e=.1;function NI(e,t,r){let{color:n=J3e,opacity:o=1,altitude:i=0,height:s=Q3e}=r||{};Array.isArray(o)&&(o=1);let a={min:{x:1/0,y:1/0,z:i},max:{x:-1/0,y:-1/0,z:s+i}},l={bevelEnabled:!1,depth:s},u=[];e.geometry.coordinates.forEach(f=>{let h=new hs,b=f[0].map(x=>{let C=t(x[1],x[0]);return a.min.x=Math.min(a.min.x,C.x),a.min.y=Math.min(a.min.y,C.y),a.max.x=Math.max(a.max.x,C.x),a.max.y=Math.max(a.max.y,C.y),C});h.moveTo(b[0].x,b[0].y),b.slice(1).forEach(x=>h.lineTo(x.x,x.y)),h.lineTo(b[0].x,b[0].y);let v=f.slice(1);h.holes=v.map(x=>{let C=x.map(w=>t(w[1],w[0])),P=new Hl;return P.moveTo(C[0].x,C[0].y),C.slice(1).forEach(w=>P.lineTo(w.x,w.y)),P.lineTo(C[0].x,C[0].y),P});let I=new ys(h,l);u.push(I)});let d=zo(u);return d.translate(0,0,i||0),d.userData={style:{color:n,opacity:o}},d}p();var eCe="gray",V5=new qr.ClipperOffset,eo=100;function QZ(e,t,r){let{color:n=eCe,opacity:o=1,width:i=1,join:s="round",cap:a="round",height:l=.01,altitude:u=0}=r||{};Array.isArray(o)&&(o=0);let d=[];for(let I=0;I<e.geometry.coordinates.length-1;I++){let x=t(e.geometry.coordinates[I][1],e.geometry.coordinates[I][0]),C=t(e.geometry.coordinates[I+1][1],e.geometry.coordinates[I+1][0]);d.push([x,C])}V5.AddPaths(d.map(I=>I.map(x=>({X:x.x*eo,Y:x.y*eo}))),s==="round"?qr.JoinType.jsRound:s==="miter"?qr.JoinType.jsMiter:qr.JoinType.jsSquare,a==="round"?qr.EndType.etOpenRound:a==="butt"?qr.EndType.etOpenButt:qr.EndType.etOpenSquare);let f=new qr.PolyTree;V5.Execute(f,i/2*eo);let h=[],b={bevelEnabled:!1,depth:l};for(let I of f.m_AllPolys){let x=new hs;if(I.IsHole())continue;let C=I.m_polygon;x.moveTo(C[0].X/eo,C[0].Y/eo),C.slice(1).forEach(P=>x.lineTo(P.X/eo,P.Y/eo)),x.lineTo(C[0].X/eo,C[0].Y/eo),x.holes=I.m_Childs.map(P=>{let w=new Hl,T=P.m_polygon;return w.moveTo(T[0].X/eo,T[0].Y/eo),T.slice(1).forEach(O=>w.lineTo(O.X/eo,O.Y/eo)),w.lineTo(T[0].X/eo,T[0].Y/eo),w}),h.push(new ys(x,b))}let v=zo(h);return v.translate(0,0,u||0),v.userData={style:{color:n,opacity:o}},V5.Clear(),v}p();var to=100,tCe=.22,rCe=.01;function eX(e,t,r={}){let{width:n=tCe,height:o=rCe,color:i="gray",opacity:s=1,altitude:a=0}=r,l={min:{x:1/0,y:1/0,z:a},max:{x:-1/0,y:-1/0,z:a+o}},u={bevelEnabled:!1,depth:o},d=new qr.ClipperOffset,f=e.geometry.coordinates.map(I=>I.map(x=>t(x[1],x[0])));d.AddPaths(f.map(I=>I.map(x=>({X:x.x*to,Y:x.y*to}))),qr.JoinType.jsMiter,qr.EndType.etOpenRound);let h=new qr.PolyTree;d.Execute(h,n/2*to);let b=[];for(let I of h.m_AllPolys){let x=new hs;if(I.IsHole())continue;l.min.x=Math.min(l.min.x,I.m_polygon[0].X),l.min.y=Math.min(l.min.y,I.m_polygon[0].Y),l.max.x=Math.max(l.max.x,I.m_polygon[0].X),l.max.y=Math.max(l.max.y,I.m_polygon[0].Y);let C=I.m_polygon;x.moveTo(C[0].X/to,C[0].Y/to),C.slice(1).forEach(P=>x.lineTo(P.X/to,P.Y/to)),x.lineTo(C[0].X/to,C[0].Y/to),x.holes=I.m_Childs.map(P=>{let w=new Hl,T=P.m_polygon;return w.moveTo(T[0].X/to,T[0].Y/to),T.slice(1).forEach(O=>w.lineTo(O.X/to,O.Y/to)),w.lineTo(T[0].X/to,T[0].Y/to),w}),b.push(new ys(x,u))}let v=zo(b);return v.translate(0,0,a||0),v.userData={style:{color:i,opacity:s}},d.Clear(),v}p();p();var zm=B.object({type:B.enum(["Point"]),coordinates:B.array(B.number()).min(2).max(3)});var nCe=B.object({rotation:B.array(B.number()).length(3).optional(),altitude:B.number().optional(),scale:B.array(B.number()).length(3).optional(),interactive:B.boolean().optional(),verticalOffset:B.number().optional(),id:B.union([B.number(),B.string()]).optional()}),oCe=B.object({type:B.enum(["Feature"]),geometry:zm,properties:nCe}),iCe=B.object({type:B.enum(["FeatureCollection"]),features:B.array(oCe)}),sCe=B.object({color:B.string()}),aCe=B.object({url:B.string(),color:B.string().optional(),opacity:B.number().optional(),material:B.record(B.string(),sCe).optional()});function rX(e,t,r){B.union([B.number(),B.string()]).parse(e),iCe.parse(t),aCe.parse(r)}var bb,vb,Gc=class{constructor(t){m(this,"mesh");m(this,"type","model");m(this,"positionDirty",!0);m(this,"outline");m(this,"geometry");m(this,"material");m(this,"feature");m(this,"instanceIndex",-1);m(this,"visible",!0);m(this,"color",new Ft);m(this,"position",new Ce);M(this,bb,0);M(this,vb,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return c(this,bb)}set altitude(t){this.mesh&&(this.mesh.position.z=t,_(this,bb,t))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(t){this.mesh&&this.mesh.rotation.set(Ye.degToRad(t[0]),Ye.degToRad(t[1]),Ye.degToRad(t[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(t){this.mesh&&this.mesh.scale.set(t[0],t[1],t[2])}get opacity(){return c(this,vb)}set opacity(t){var r,n,o;if(this.mesh){if(this.mesh.children[0]instanceof zl){for(let i of this.mesh.children)if(i instanceof zl){((r=i.userData)==null?void 0:r.originalOpacity)===void 0&&(i.userData.originalOpacity=i.material.opacity);let s=Ss(t,0,(n=i.userData)==null?void 0:n.originalOpacity,0,1);i.material.opacity=s,i.material.transparent=s<1,i.material.needsUpdate=!0}}else(o=this.mesh)==null||o.traverse(i=>{i instanceof Ve&&i.material&&(Array.isArray(i.material)?i.material.forEach(s=>{tX(s,t)}):tX(i.material,t))});_(this,vb,t)}}};bb=new WeakMap,vb=new WeakMap;function tX(e,t){e.opacity!==t&&(t===1?(e.opacity=1,e.transparent=!1):(e.opacity=t,e.transparent=!0),e.needsUpdate=!0)}p();function BI(e){var a,l;let t=e.components[0],r=e.components[1];r.opacity!=null&&r.opacity!==t.opacity&&(t.opacity=r.opacity);let n=r.material,o=r.color;if(n||o){let u=lCe(o,n);(a=t.mesh)==null||a.traverse(d=>{d instanceof Ve&&d.material&&(Array.isArray(d.material)?d.material.forEach(f=>{u[f.name]?f.color.set(u[f.name].color):f.color.set(o)}):u[d.material.name]?d.material.color.set(u[d.material.name].color):d.material.color.set(o))})}let i=(l=t.feature.geometry.coordinates[2])!=null?l:0,s=r.verticalOffset+i;t.altitude!==s&&(t.altitude=s),r.visible!==t.visible&&(t.visible=r.visible),r.rotation&&t.setRotation(r.rotation),r.scale&&t.setScale(r.scale)}function lCe(e,t){let r={};if(e&&Object.assign(r,{Default:{color:e},Fabric:{color:e},Mpdn_Logo:{color:e},CouchLogo:{color:e}}),t)for(let n in t)t[n].color&&(r[n]?r[n].color=t[n].color:r[n]={color:t[n].color});return r}function nX(e,t){var s,a;let r=e.components[0],o=(s=e.components[1].verticalOffset)!=null?s:0,i=r.feature.geometry.coordinates.slice();i[2]=((a=i[2])!=null?a:0)+o,r.mesh?r.mesh.position.copy(t(i)):r.position.copy(t(i))}function cCe(e){let{color:t,opacity:r,topColor:n,texture:o,topTexture:i}=e;return"".concat(t).concat(r).concat(n||"").concat(o||"").concat(i||"")}var uCe=1e4,$I=class extends De{constructor(r,n){super();m(this,"state");m(this,"convertTo3DMapPosition");m(this,"loader");m(this,"optimizePromise",[]);this.state=r,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:r}=await import("./GLTFLoader-V2T33J7P.js");return this.loader=new r,this.loader}createEntityFromFeature(r,n,o){var a,l;let i=new hr(n),s=new Tt(i,new Is({...o,url:(l=(a=n.properties)==null?void 0:a.image)==null?void 0:l.path}));return o!=null&&o.outline&&(s.components[3]=new jm(CI(o.color))),s.id=r,s}createModelFromFeature(r,n,o){let i=new Gc(n),s={...o};n.properties.verticalOffset!=null&&(s.verticalOffset=n.properties.verticalOffset),n.properties.rotation!=null&&(s.rotation=n.properties.rotation),n.properties.scale!=null&&(s.scale=n.properties.scale);let a=new l0(s),l=new Tt(i,a);return l.id=r,l}populateEntityMesh(r,n){let o=r.components[0];o.geometry=n,o.currentHeight=r.components[1].height,o.dirty=!1}async populateModelGroup(r,n,o){let i=new Ci,s=new Ca,a=new xh,l=new Ce,u=new Mi,d=await this.getGLTFLoader(),f=new Promise(h=>{d.load(n,b=>{"entities3D"in o.userData&&(o.userData.entities3D.size>1?b.scene.traverse(v=>{let I=v;if("isMesh"in I&&I.isMesh===!0){let x=new zl(I.geometry,I.material,r.size);x.userData={entities:{}},u.add(x),o.add(u)}}):(b.scene.traverse(v=>{"isMesh"in v&&v.isMesh===!0&&(v.position.set(0,0,0),v.rotation.set(0,0,0),v.scale.set(1,1,1),v.updateMatrix())}),u.add(b.scene),o.add(u),u.userData.isSingleModel=!0,u.userData.entityId=r.values().next().value,u.userData.type="model")),h()})});return this.optimizePromise.push(f.then(()=>{var v,I,x,C,P,w,T,O,N,k,D,F;let h=0,b;for(let z of r.values()){if(b=this.state.geometry3DMap.get(z),!b||(b==null?void 0:b.type)!=="model")continue;let G=b.components[0],j=b.components[1],K=b.components[0].feature;G.mesh=u,G.instanceIndex=h,BI(b),b.components[1].dirty=!1;let{x:Z,y:oe}=this.convertTo3DMapPosition(K.geometry.coordinates[1],K.geometry.coordinates[0],0);G.position.set(Z,oe,G.altitude),s.set(Ye.degToRad((I=(v=j.rotation)==null?void 0:v[0])!=null?I:kd[0]),Ye.degToRad((C=(x=j.rotation)==null?void 0:x[1])!=null?C:kd[1]),Ye.degToRad((w=(P=j.rotation)==null?void 0:P[2])!=null?w:kd[2])),l.set((O=(T=j.scale)==null?void 0:T[0])!=null?O:Ad[0],(k=(N=j.scale)==null?void 0:N[1])!=null?k:Ad[1],(F=(D=j.scale)==null?void 0:D[2])!=null?F:Ad[2]),a.setFromEuler(s),i.compose(G.position,a,l),u.children.forEach(Q=>{!b||(b==null?void 0:b.type)!=="model"||!(Q instanceof zl)||(Q.setMatrixAt(h,i),Q.userData.entities[h]=b.id)}),G.mesh.userData.isSingleModel&&(G.mesh.matrix.copy(i),G.mesh.matrix.decompose(G.mesh.position,G.mesh.quaternion,G.mesh.scale)),h++}this.publish("model-loaded")})),u}populateEntityGroup(r){var a;let n,o,i,s;for(let l of r.values())s=this.state.geometry3DMap.get(l),s.components[0]instanceof hr&&(o=s.components[0].feature,i=s.components[1],o.geometry.type==="Polygon"?(n=RI(o,this.convertTo3DMapPosition,i),(a=o.properties)!=null&&a.textures&&o.properties.textures.length>0&&xZ(n,o.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(s,n)):o.geometry.type==="MultiPolygon"?(n=NI(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(s,n)):o.geometry.type==="LineString"?(n=QZ(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(s,n)):o.geometry.type==="MultiLineString"&&(n=eX(o,this.convertTo3DMapPosition,i),this.populateEntityMesh(s,n)));return r}optimize(r){var n;if(r.visible&&(r instanceof In||r instanceof at)){for(let s of r.children)this.optimize(s);if(r instanceof at||r.userData.dirty===!1)return;let o={};if(!r.userData.modelURL&&r.userData.dirty)try{this.populateEntityGroup(r.userData.entities3D)}catch(s){$.warn(s)}else r.userData.modelURL&&r.userData.dirty&&(this.populateModelGroup(r.userData.entities3D,r.userData.modelURL,r),r.userData.dirty=!1);let i=0;if(r.userData.dirty){let s=0,a;for(let l of r.userData.entities3D.values()){a=this.state.geometry3DMap.get(l);let u=a==null?void 0:a.components[0];if((a==null?void 0:a.type)==="geometry"){let d=a.components[1];s++,s>=uCe&&(s=0,i++);let f=cCe(d)+i;o[f]===void 0&&(o[f]={style:d,entities:[]}),o[f].entities.push(a)}else u&&"mesh"in u&&u.mesh&&((n=u.mesh)==null?void 0:n.parent)!==r&&r.add(u.mesh)}for(let l in o){let u=vZ(o[l].entities,o[l].style);r.add(u),r.userData.dirty=!1}for(let l of r.userData.entities3D.values())if(a=this.state.geometry3DMap.get(l),a!=null&&a.entities2D.size>0)for(let u of a.entities2D.values())u&&(a.attach(u),this.publish("geometry-2d-added"))}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};p();var jI=class{constructor(t,r){m(this,"state");m(this,"dirty",!0);m(this,"domTree");this.state=t,this.domTree=r}update(){if(this.dirty){let t;for(let r of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(r.userData.entityId),t){let n=t.components[0];(!n.enabled||!n.visible||!this.state.geometry2DIdsInScene.has(r.userData.entityId))&&this.domTree.removeChild(r)}else this.domTree.removeChild(r);for(let r of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(r),t){let n=t.components[0];n instanceof aa&&n.enabled&&n.markerContainer&&!this.domTree.contains(n.markerContainer)&&(n.markerContainer.userData={entityId:t.id},this.domTree.appendChild(n.markerContainer),n.updateDimensions())}this.dirty=!1}}};p();var GI=class{constructor(t,r){m(this,"state");m(this,"project");this.state=t,this.project=r}update(){let t,r=0,n,o;for(let i of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(i),t){o=t.components[0];let s=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(s instanceof Tt)if(this.state.geometry3DIdsInScene.has(s.id)){n=s.components[1],o=t.components[0],(n.dirty||t.components[0].attachedDirty)&&(r=n.height,t.setAltitude(r));let a=n.visible&&n.opacity>0;o.visible!==a&&(o.visible=a)}else o.visible===!0&&(o.visible=!1);this.project(t.components[0].projection,t.position),t.components[0].attachedDirty=!1}}};p();p();var pCe=function(){let t,r;return n=>{if((!r||!r)&&(t=document.createElement("canvas"),t.width=500*n,t.height=500*n,t.style.width="500px",t.style.height="500px",r=t.getContext("2d")),!r)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:r}}}(),oX=({text:e,size:t,maxWidth:r,pixelRatio:n,maxLines:o=2,lineHeight:i=1.2,options:s={strokeText:!0}})=>{let a="bold ".concat(t*n,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:l}=pCe(n);l.font=a;let u=[],d=e.split(" "),f=0,h=0,b=0;for(;h<d.length;){let C=d[h];if(f===o&&f>0){u[f-1]+="...";break}if(u[f]==null&&(u[f]=C,h++),d.length===1){u[f]=C;break}if(d[h]==null)break;let{width:P}=l.measureText(u[f]+" "+d[h]);P<=r*n?(u[f]+=" "+d[h],h++):f++}u.forEach(C=>{let{width:P}=l.measureText(C);b=Math.max(P,b)});let v=t*n*i,I=u.length*v;return{maxWidth:b,maxHeight:I,lines:u.length,draw:(C,P,w)=>{u.length===1?(s.strokeText&&C.strokeText(u[0],P,w),C.fillText(u[0],P,w)):(s.strokeText&&(C.strokeText(u[0],P,w-v/2),C.strokeText(u[1],P,w+v/2)),C.fillText(u[0],P,w-v/2),C.fillText(u[1],P,w+v/2))}}};p();function iX(e){let t=new Image;return e&&(/<svg[\s\S]*>/i.test(e)?t.src="data:image/svg+xml;base64,".concat(btoa(e)):t.src=e),t}var dCe=3.5,fCe=2.5,mCe=2,hCe=5,xb=2.5;var UI=class extends De{constructor(r,n,o){super();m(this,"dirty",!1);m(this,"state");m(this,"colliderContext");m(this,"colliderCanvas");m(this,"transformRequestFunc");m(this,"transformRequest",async r=>this.transformRequestFunc?await this.transformRequestFunc(r):{url:r});m(this,"pinCache",{});m(this,"imageCache",{});m(this,"imagePromiseCache",{});m(this,"imageDimensionsCache",{});m(this,"textCache",{});m(this,"update",r=>{let n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let o,i,s,a,l,u,d;for(let f of this.state.geometry2DIdsInScene)if(d=this.state.geometry2DMap.get(f),d!=null&&(u=d.components[0],u instanceof la&&!d.disposed)){if(l=u.appearance.marker.iconVisibleAtZoomLevel,u.appearance.marker.icon!=null&&l&&r>=l!==u.iconVisible&&(u.iconVisible=r>=l,u.dirty=!0),(u.dirty||this.dirty)&&u.calculateMarkerSize(),i=u.appearance.marker.foregroundColor,s=u.appearance.marker.backgroundColor,a=wd(u.markerSize,2),o="".concat(i.active,"-").concat(i.inactive,"-").concat(s.active,"-").concat(s.inactive,"-").concat(a,"-").concat(u.iconVisible),u.labelCacheId=o,this.pinCache[o]||this.prepare(u,o,this.colliderContext),u.appearance.marker.icon&&(!u.imageHash||u.dirty)&&this.cacheImage(u),this.textCache[u.id]==null||u.dirty||this.dirty){u.collisionDirty=!0,this.textCache[u.id]={};let{textDrawFn:h,width:b,height:v}=this.processText(u.text,u.appearance.text.size,u.appearance.text.maxWidth,u.appearance.text.numLines,u.appearance.text.lineHeight);["left","center","right"].forEach(x=>{this.textCache[u.id][x]=this.textToCanvas(h,u.appearance.text.size,x,b,v,u.appearance.text.foregroundColor,u.appearance.text.backgroundColor)}),u.dimensions={width:Math.ceil(b/n),height:Math.ceil(v/n)},u.currentStrategyIndex===-1&&(u.currentStrategyIndex=0);let I=u.strategies[u.currentStrategyIndex];if(I){I.onStrategySelected(u);let x=u.style;u.style=u.newStyle,u.newStyle=x}}u.canShow&&u.visible&&(u.enabled||u.visibilityNeedsUpdate!==!1)&&this.draw(u,o,this.colliderContext),u.dirty=!1}this.dirty=!1});m(this,"processText",(r,n,o,i,s)=>{let a=this.state.pixelRatio,{draw:l,maxWidth:u,maxHeight:d}=oX({text:r,size:n,pixelRatio:a,maxWidth:o,maxLines:i,lineHeight:s});return{textDrawFn:l,width:u+xb*a*2,height:d+xb*a*2}});m(this,"textToCanvas",(r,n,o,i,s,a,l)=>{let u=this.state.pixelRatio,d,f=i,h=s;window.OffscreenCanvas!=null&&!EE()?d=new OffscreenCanvas(f,h):(d=document.createElement("canvas"),d.width=f,d.height=h,d.style.width=f+"px",d.style.height=h+"px");let b=d.getContext("2d",{willReadFrequently:!0});if(!b)return;b.textAlign=o,b.font="bold ".concat(n*u,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),b.textBaseline="middle",b.lineJoin="miter",b.miterLimit=2,b.strokeStyle="white",b.lineWidth=xb*u,b.fillStyle=a,b.strokeStyle=l;let v=o==="left"?0:o==="center"?f/2:f-xb*u/2;return r(b,v,(h+xb*u/2)/2),d});m(this,"cacheImage",r=>{if(!r.appearance.marker.icon)return;let n=RE(r.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(o=>{this.transformRequest(r.appearance.marker.icon).then(i=>{let s=iX(i.url);s.onload=()=>{this.imageCache[n]=s,this.publish("img:loaded"),o(s)}})})),r.imageHash!==n&&(r.imageHash=n,this.imagePromiseCache[n].then(()=>{r.dirty=!0}))});m(this,"createPinCanvas",(r,n,o,i)=>{let s,a=this.state.pixelRatio,l=r.totalMarkerSize*2*a;window.OffscreenCanvas!=null?s=new OffscreenCanvas(l,l):(s=document.createElement("canvas"),s.width=l,s.height=l,s.style.width=l/a+"px",s.style.height=l/a+"px");let u=s.getContext("2d");return u.shadowColor="rgba(0,0,0,0.3)",u.shadowOffsetY=mCe*a,u.shadowBlur=hCe*a,u.beginPath(),u.arc(l/2,l/2,n/2+fCe*a/2,0,2*Math.PI),u.fillStyle=o,u.fill(),u.beginPath(),u.arc(l/2,l/2,n/2,0,2*Math.PI),u.shadowColor="transparent",u.fillStyle=i,u.fill(),s});m(this,"prepare",(r,n,o)=>{let i=this.state.pixelRatio;o.lineWidth=4*i;let s=this.createPinCanvas(r,r.markerSize,r.appearance.marker.backgroundColor.active,r.appearance.marker.foregroundColor.active),a=this.createPinCanvas(r,r.iconVisible?r.markerSize:dCe*i,r.appearance.marker.backgroundColor.inactive,r.appearance.marker.foregroundColor.inactive);this.pinCache[n]=[s,a]});this.state=r,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=o}draw(r,n,o){var u,d;if(!r.canShow||!r.visible)return;o.save(),o.globalAlpha=r.opacity;let i=this.state.pixelRatio,s=r.projection.x*i,a=r.projection.y*i,l=r.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1];if(o.drawImage(l,s-r.totalMarkerSize*i,a-r.totalMarkerSize*i),r.appearance.marker.icon&&r.iconVisible&&r.imageHash&&r.appearance.marker.iconSize&&this.imageCache[r.imageHash]){let f=this.imageCache[r.imageHash],h=(r.appearance.marker.iconSize-r.appearance.marker.iconPadding)*i,b=r.appearance.marker.iconFit,v=h,I=h,x="".concat(r.imageHash,"_").concat(b);if(this.imageDimensionsCache[x])v=this.imageDimensionsCache[x].width,I=this.imageDimensionsCache[x].height;else{let C=f.width*i,P=f.height*i;if(b==="contain"){let w=Math.sqrt(C**2+P**2),T=h/w;v=C*T,I=P*T}if(b==="cover"){let w=h/C,T=h/P,O=Math.max(w,T);v=C*O,I=P*O}}o.save(),o.beginPath(),o.arc(s,a,h/2,0,2*Math.PI),o.closePath(),((d=(u=r==null?void 0:r.appearance)==null?void 0:u.marker)==null?void 0:d.iconOverflow)!=="visible"&&o.clip(),o.drawImage(f,s-v/2,a-I/2,v,I),o.restore()}r.style.textLabelVisible&&r.style.textAlign!=null&&r.style.left&&r.style.top&&o.drawImage(this.textCache[r.id][r.style.textAlign],s+r.style.left*i,a+r.style.top*i),o.restore()}};p();p();var Kp=class Kp{constructor(){m(this,"loader");this.loader=new Td}static getInstance(){return Kp.instance||(Kp.instance=new Kp),Kp.instance}getLoader(){return this.loader}load(t){return new Promise((r,n)=>{this.loader.load(t,r,void 0,n)})}};m(Kp,"instance");var z5=Kp,Uc=z5.getInstance();function yCe(e,t){let r=e.components[2],n=e.components[1];return r!=null&&r.hover?[n.hoverColor||t,n.hoverColor||t]:[n.color,n.topColor||n.color]}var Jp,Ib,VI=class extends De{constructor(r,n){super();M(this,Jp);m(this,"state");m(this,"convertTo3DMapPosition");m(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=n,this.state=r}setShading(r,n){r.material&&r.material.setGradientShading(n.start,n.end,n.intensity)}processTextures(r,n,o){var i;if(n.texture!==r.texture&&n.texture!==""&&ee(this,Jp,Ib).call(this,n.texture,r,"texture"),n.topTexture!==r.topTexture&&n.topTexture!==""&&ee(this,Jp,Ib).call(this,n.topTexture,r,"topTexture"),(r.texture==null||r.topTexture==null)&&Array.isArray((i=r.feature.properties)==null?void 0:i.textures)&&r.feature.properties.textures.length>0)for(let s of r.feature.properties.textures)s.face==="top"&&r.topTexture!==s.path?ee(this,Jp,Ib).call(this,s.path,r,"topTexture"):s.face==="side"&&r.texture!==s.path&&ee(this,Jp,Ib).call(this,s.path,r,"texture"),r.blendTexture=!0;(r.texture!=null||r.topTexture!=null)&&(o!=null&&o.hover&&r.texturesVisible?r.hideTextures():r.texturesVisible||r.showTextures(),n.texture===""&&r.removeSideTexture(),n.topTexture===""&&r.removeTopTexture())}update(){var i,s,a,l,u,d,f,h;let r,n,o;for(let b of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(b),o instanceof In&&o.type==="geometry-group"){let v=o.components[0];if(o.userData.shadingDirty){let I=o.userData.entities3D.values().next().value;if(I==null)continue;let x=this.state.geometry3DMap.get(I);x instanceof Tt&&(x.type==="geometry"||x.type==="custom-geometry")&&(r=x.components[0],o.userData.shadingDirty&&v.shading&&this.setShading(r,v.shading));let C,P;for(let w of o.userData.entities3D.values())C=this.state.geometry3DMap.get(w),P=C.components[0],C.type==="geometry"&&P.detached&&o.userData.shadingDirty&&v.shading&&this.setShading(P,v.shading);o.userData.shadingDirty=!1}if(v.dirty){let I=o.getfirstChildEntityId();if(I){let C=this.state.geometry3DMap.get(I),P=C==null?void 0:C.components[0];P instanceof hr&&this.processTextures(P,v)}let x=v.opacity*yu(o);o.getOpacity()!==x&&o.setOpacity(x),v.dirty=!1}}else if(o&&(o.type==="geometry"||o.type==="custom-geometry")&&((i=o.components[1])!=null&&i.dirty||(s=o.components[2])!=null&&s.dirty)){let v=o.components[0],I=o.components[1];n=o.components[2];let x=yCe(o,this.state.hoverColor);if(v.setColor(x[0],x[1]),I.visible!==v.visible&&(v.visible=I.visible,v instanceof hr&&v.textMesh)){let P=this.state.geometry3DMap.get(v.textMesh.userData.entityId);(P==null?void 0:P.type)==="text3d"&&P.components[0].polygonEntityId!=null&&(P.components[0].visible=I.visible)}I.altitude!==v.altitude&&(v.altitude=I.altitude);let C=I.opacity*yu(o);C!==v.opacity&&(v.opacity=C),I.renderOrder!==v.renderOrder&&(v.renderOrder=I.renderOrder),I.dirty=!1,v instanceof hr&&this.processTextures(v,I,n),o.components[2]&&(o.components[2].dirty=!1)}else if((o==null?void 0:o.type)==="model")o.components[1].dirty&&(BI(o),o.components[1].dirty=!1),o.components[0].positionDirty&&(nX(o,this.convertTo3DMapPosition),o.components[0].positionDirty=!1);else if((o==null?void 0:o.type)==="image"&&((a=o.components[1])!=null&&a.dirty)){r=o.components[0];let v=o.components[1];v.visible!==r.visible&&(r.visible=v.visible),v.dirty=!1}else if((o==null?void 0:o.type)==="text3d"&&((l=o.components[1])!=null&&l.dirty)&&o.components[0].polygonEntityId!=null){r=o.components[0];let v=o.components[1];v.visible!=null&&v.visible!==r.visible&&(r.visible=v.visible);let{textMesh:I}=r;if(I){Object.assign(I,v.getState());let x=(u=v.hoverColor)!=null?u:this.state.text3dHoverColor;I.color=v.hoverByPolygon?x:(d=v.color)!=null?d:_d.color,I.outlineColor=v.hoverByPolygon?x:(f=v.outlineColor)!=null?f:_d.outlineColor,I.strokeColor=v.hoverByPolygon?x:(h=v.strokeColor)!=null?h:_d.strokeColor}v.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async r=>{(await r).dispose()}),this.textureLoadingCache.clear()}};Jp=new WeakSet,Ib=async function(r,n,o){if(!(!r||!n.showTextures))if(this.textureLoadingCache.has(r)){o==="topTexture"?n.topTexture=await this.textureLoadingCache.get(r):n.texture=await this.textureLoadingCache.get(r),n.showTextures();return}else{let i=new Promise((s,a)=>{Uc.getLoader().load(r,l=>{o==="topTexture"?n.topTexture=l:n.texture=l,n.showTextures(),this.publish("texture-loaded"),s(l)},void 0,()=>{$.error("Failed to load texture: ".concat(r)),a("Failed to load texture: ".concat(r))})});this.textureLoadingCache.set(r,i)}};p();var zI=class extends De{constructor(r){super();m(this,"state");m(this,"animating",new Map);m(this,"isAnimating",!1);m(this,"startTime",-1);m(this,"showDuration",300);m(this,"hideDuration",250);m(this,"update",()=>{this.animating.clear();let r,n;for(let o of this.state.geometry2DIdsInScene)r=this.state.geometry2DMap.get(o),r&&(n=r.components[0],n instanceof la&&(n.visibilityNeedsUpdate==="show"?(n.canShow=!0,this.animating.set(n,[n.opacity,1])):n.visibilityNeedsUpdate==="hide"&&this.animating.set(n,[n.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")});m(this,"playAnimations");this.state=r,this.playAnimations=this._playAnimations}_playAnimations(){let r=performance.now();for(let[n,[o,i]]of this.animating.entries()){let s=i===1?this.showDuration:this.hideDuration,a=(r-this.startTime)/s;n.opacity=Ss(a,0,1,o,i,i===0?NE:BE),r-this.startTime>=s&&(i===1?n.canShow=!0:i===0&&(n.canShow=!1),n.visibilityNeedsUpdate=!1,this.animating.delete(n))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};p();var HI=class extends De{constructor(r,n,o,i,s,a,l){super();m(this,"state");m(this,"renderer");m(this,"mode");m(this,"scene");m(this,"cameraObject");m(this,"viewCamera");m(this,"systems");m(this,"needs2DRecompute",!1);m(this,"twoDdirty",!0);m(this,"threeDdirty",!0);m(this,"frameId",null);m(this,"twoDFrameId",null);m(this,"animationFrameId",null);m(this,"nextFrame",null);m(this,"update",(r=!1)=>{var n;if(((n=this.renderer)==null?void 0:n.renderer)==null)return Promise.resolve();if(r){let o=this.commitRenderState();return this.paint(),o}else return this.frameId?Promise.resolve():new Promise(o=>{this.frameId=requestAnimationFrame(()=>{var i,s;return((i=this.renderer)==null?void 0:i.renderer)==null?o():this.mode==="standalone"?(s=this.commitRenderState())==null?void 0:s.then(()=>{this.paint(),o()}):o()})})});m(this,"animate2D",()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})});m(this,"drawEntities2D",()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))});m(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())})});m(this,"commitRenderState",()=>{try{let r=[];this.frameId=null,this.publish("pre-render"),this.state.tweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.scene.updateMatrixWorld(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),DE(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(),kE(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let n=this.systems.meshOptimizationSystem.update();n&&r.push(n),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),r.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isCameraMoving(),this.systems.cameraSystem.lastCameraStoppedMovingTime()),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.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 o=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!o)}),this.systems.drawSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.publish("post-render"),Promise.all(r)}catch(r){$.error("Render failed: ",r)}});this.renderer=r,this.state=n,this.mode=o,this.scene=i,this.cameraObject=s,this.viewCamera=a,this.systems=l,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D),this.systems.cameraSystem.on("pan-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-end",()=>this.needs2DRecompute=!0),this.systems.cameraSystem.on("rotate-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("rotate-end",()=>this.needs2DRecompute=!0)}paint(){var r;(r=this.renderer)!=null&&r.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,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)}};p();var gCe=B.object({interactive:B.boolean().optional(),id:B.string().optional(),nearRadius:B.number().optional(),farRadius:B.number().optional(),accentColor:B.string().optional(),displayArrowsOnPath:B.boolean().optional(),animateArrowsOnPath:B.boolean().optional(),nearZoomLevel:B.number().optional(),farZoomLevel:B.number().optional()}),bCe=B.object({type:B.enum(["Feature"]),geometry:zm,properties:B.object({parentId:B.any().optional()})});function sX(e,t){B.object({features:B.array(bCe)}).parse(e),gCe.parse(t)}var Sb,Vc=class{constructor(t,r){m(this,"type","path");m(this,"mesh",new Mi);m(this,"material");m(this,"geometry");m(this,"outline");m(this,"feature");m(this,"options");m(this,"nearRadius",.2);m(this,"farRadius",.4);m(this,"nearZoomLevel");m(this,"farZoomLevel");m(this,"nearZoomAltitude");m(this,"farZoomAltitude");m(this,"accentColor","blue");m(this,"completeFraction",1);m(this,"altitudeAdjustment",1);m(this,"displayArrowsOnPath",!1);m(this,"animateArrowsOnPath",!1);m(this,"isVertical",!1);m(this,"dirty",!0);m(this,"materialDirty",!0);m(this,"position",new Ce);M(this,Sb,0);var n,o,i,s,a;this.feature=t,this.options=r||{},this.accentColor=(n=r==null?void 0:r.accentColor)!=null?n:this.accentColor,this.nearRadius=(o=r==null?void 0:r.nearRadius)!=null?o:this.nearRadius,this.farRadius=(i=r==null?void 0:r.farRadius)!=null?i:this.farRadius,this.nearZoomLevel=r==null?void 0:r.nearZoomLevel,this.farZoomLevel=r==null?void 0:r.farZoomLevel,this.displayArrowsOnPath=(s=r==null?void 0:r.displayArrowsOnPath)!=null?s:this.displayArrowsOnPath,this.animateArrowsOnPath=(a=r==null?void 0:r.animateArrowsOnPath)!=null?a:this.animateArrowsOnPath}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return c(this,Sb)}set altitude(t){this.mesh&&(this.mesh.position.z=t,_(this,Sb,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Sb=new WeakMap;p();var WI=class{constructor(t){m(this,"rendererState");this.rendererState=t}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(r),t instanceof at&&t.components[0]){let n=t.components[0];if(n.dirty){for(let o of t.children)(o instanceof In||o instanceof at)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));n.dirty=!1}}}};p();p();p();var Ar=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 t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Ar.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?Ar.Bounce.In(e*2)*.5:Ar.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(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),Cb=function(){return performance.now()},W5=function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(r){return t._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var o=0,i=r;o<i.length;o++){var s=i[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=0,o=t;n<o.length;n++){var i=o[n];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,r){t===void 0&&(t=Cb()),r===void 0&&(r=!0);var n=Object.keys(this._tweens);if(n.length!==0)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<n.length;o++){var i=this._tweens[n[o]],s=!r;i&&i.update(t,s)===!1&&!r&&this.remove(i)}n=Object.keys(this._tweensAddedDuringUpdate)}},e}(),Hm={Linear:function(e,t){var r=e.length-1,n=r*t,o=Math.floor(n),i=Hm.Utils.Linear;return t<0?i(e[0],e[1],n):t>1?i(e[r],e[r-1],r-n):i(e[o],e[o+1>r?r:o+1],n-o)},Bezier:function(e,t){for(var r=0,n=e.length-1,o=Math.pow,i=Hm.Utils.Bernstein,s=0;s<=n;s++)r+=o(1-t,n-s)*o(t,s)*e[s]*i(n,s);return r},CatmullRom:function(e,t){var r=e.length-1,n=r*t,o=Math.floor(n),i=Hm.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(o=Math.floor(n=r*(1+t))),i(e[(o-1+r)%r],e[o],e[(o+1)%r],e[(o+2)%r],n-o)):t<0?e[0]-(i(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[r]-(i(e[r],e[r],e[r-1],e[r-1],n-r)-e[r]):i(e[o?o-1:0],e[o],e[r<o+1?r:o+1],e[r<o+2?r:o+2],n-o)},Utils:{Linear:function(e,t,r){return(t-e)*r+e},Bernstein:function(e,t){var r=Hm.Utils.Factorial;return r(e)/r(t)/r(e-t)},Factorial:function(){var e=[1];return function(t){var r=1;if(e[t])return e[t];for(var n=t;n>1;n--)r*=n;return e[t]=r,r}}(),CatmullRom:function(e,t,r,n,o){var i=(r-e)*.5,s=(n-t)*.5,a=o*o,l=o*a;return(2*t-2*r+i+s)*l+(-3*t+3*r-2*i-s)*a+i*o+t}}},aX=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),H5=new W5,xo=function(){function e(t,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ar.Linear.None,this._interpolationFunction=Hm.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=aX.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=H5,H5.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(t,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,r){if(t===void 0&&(t=Cb()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var i in this._valuesEnd)o[i]=this._valuesEnd[i];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,r,n,o,i){for(var s in n){var a=t[s],l=Array.isArray(a),u=l?"array":typeof a,d=!l&&Array.isArray(n[s]);if(!(u==="undefined"||u==="function")){if(d){var f=n[s];if(f.length===0)continue;for(var h=[a],b=0,v=f.length;b<v;b+=1){var I=this._handleRelativeValue(a,f[b]);if(isNaN(I)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}h.push(I)}d&&(n[s]=h)}if((u==="object"||l)&&a&&!d){r[s]=l?[]:{};var x=a;for(var C in x)r[s][C]=x[C];o[s]=l?[]:{};var f=n[s];if(!this._isDynamic){var P={};for(var C in f)P[C]=f[C];n[s]=f=P}this._setupProperties(x,r[s],f,o[s],i)}else(typeof r[s]>"u"||i)&&(r[s]=a),l||(r[s]*=1),d?o[s]=n[s].slice().reverse():o[s]=r[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=Cb()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Cb()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,r=this._chainedTweens.length;t<r;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Ar.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=Hm.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,r){var n=this,o;if(t===void 0&&(t=Cb()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var i;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),l=this._duration+this._repeat*a,u=function(){if(n._duration===0||s>l)return 1;var I=Math.trunc(s/a),x=s-I*a,C=Math.min(x/n._duration,1);return C===0&&s===n._duration?1:C},d=u(),f=this._easingFunction(d);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,d),this._duration===0||s>=this._duration)if(this._repeat>0){var h=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=h);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+=a*h,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var b=0,v=this._chainedTweens.length;b<v;b++)this._chainedTweens[b].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,r,n,o){for(var i in n)if(r[i]!==void 0){var s=r[i]||0,a=n[i],l=Array.isArray(t[i]),u=Array.isArray(a),d=!l&&u;d?t[i]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[i],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[i]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?t+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(t){var r=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=r},e.autoStartOnUpdate=!1,e}();var _ft=aX.nextId,pa=H5,Aft=pa.getAll.bind(pa),kft=pa.removeAll.bind(pa),Dft=pa.add.bind(pa),Fft=pa.remove.bind(pa),Lft=pa.update.bind(pa);p();p();p();var lX=(e,t)=>(t-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,cX=(e,t)=>new Ee(e.clientX-t.offsetLeft,e.clientY-t.offsetTop),q5=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),Pb=(e,t)=>Math.sqrt((t.y-e.y)**2+(t.x-e.x)**2),Z5=(e,t)=>new Ee((e.x+t.x)/2,(e.y+t.y)/2),X5=e=>{let t=0,{wheelDelta:r,detail:n}=e;return r!==void 0?t=r:n!==void 0&&(t=-n),t};var qI=class{constructor(t,r){m(this,"input1");m(this,"input2");m(this,"lastAngle");m(this,"lastDistance");m(this,"totalDistance");m(this,"first");m(this,"second");this.input1=t,this.input2=r,this.lastAngle=q5(t,r),this.lastDistance=Pb(t,r),this.totalDistance=0,this.first=t,this.second=r}update(t,r){let n=Pb(t,r);this.input1=t,this.input2=r;let o=q5(t,r);this.lastAngle=o,this.lastDistance=n,this.totalDistance+=(Pb(this.first,t)+Pb(this.second,r))/2,this.first=Z5(this.first,t),this.second=Z5(this.second,r)}};p();var Tb=class{constructor(t,r,n){m(this,"touch");m(this,"camera");m(this,"cameraPlane");m(this,"viewCoordinate");m(this,"snapHolderMatrix");m(this,"snapCamera");m(this,"cameraPosition");m(this,"raycaster");m(this,"worldCoordinate");m(this,"snapshotted",!1);this.touch=t,this.camera=r,this.cameraPlane=n,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new Ee(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new gs,this.raycaster.setFromCamera(t,this.snapCamera);let r=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=r&&r.length>0?r[0].point:null,this.snapshotted=!0}updateAnchorState(t,r){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(r),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var n,o;let t=new Ee(this.viewCoordinate.x,this.viewCoordinate.y);(n=this.raycaster)==null||n.setFromCamera(t,this.snapCamera);let r=(o=this.raycaster)==null?void 0:o.intersectObject(this.cameraPlane,!0)[0];return r?r.point:void 0}};var Ii={};Ul(Ii,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>xCe,CLIPPING_RADIUS:()=>wb,CONTROL_OPTIONS:()=>vCe,DEFAULT_ANIMATION_DURATION:()=>eO,DEFAULT_BEARING:()=>TCe,DEFAULT_MAX_ZOOM_LEVEL:()=>CCe,DEFAULT_MIN_ZOOM_LEVEL:()=>tO,DEFAULT_PITCH:()=>PCe,DEFAULT_ZOOM_LEVEL:()=>SCe,EVENTS:()=>KI,MAPLIBRE_TILE_SIZE:()=>ZI,MAX_LAT:()=>K5,MAX_MERCATOR_ZOOM_LEVEL:()=>YI,MIN_LAT:()=>Y5,MIN_MERCATOR_ZOOM_LEVEL:()=>XI,ROOM_MERCATOR_ZOOM_LEVEL:()=>ICe,TWO_PI:()=>J5,WHEEL_ZOOM_MULTIPLIER:()=>Q5,ZRANGE:()=>Wm});p();var ZI=512,Y5=-85.051129,K5=85.051129,wb=1e4,vCe={chain:"chain",cancel:"cancel"},J5=Math.PI*2,Wm=100,Q5=1e4,XI=0,YI=24,xCe=17,ICe=20,eO=200,KI=["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"],SCe=18,tO=12,CCe=22,PCe=0,TCe=0;p();function uX(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}function fr(e){for(let t=e.children.length-1;t>=0;t--)fr(e.children[t]);"geometry"in e&&e.geometry&&e.geometry.dispose(),e.parent&&e.parent.remove(e),"material"in e&&Array.isArray(e.material)?e.material.forEach(function(t){uX(t)}):"material"in e&&typeof e.material<"u"&&uX(e.material)}var JI=!1,wCe=!1;var QI,Qp=class extends De{constructor(r,n,o,i,s){super();m(this,"dirty",!1);m(this,"zoomDirty",!1);m(this,"rotationDirty",!1);m(this,"panDirty",!1);M(this,QI,tO);m(this,"zoomSpeed",5);m(this,"rotateSpeed",100);m(this,"enabled",!0);m(this,"enableZoom",!0);m(this,"enablePan",!0);m(this,"enablePedestal",!1);m(this,"maxPedestal",1/0);m(this,"minPedestal",0);m(this,"enableRotate",!0);m(this,"minZoomAltitude",0);m(this,"maxZoomAltitude",1/0);m(this,"ignoreZoomLimits",!1);m(this,"zoomFactor",1);m(this,"panBounds",{min:new Ce(1/0,1/0),max:new Ce(-1/0,-1/0),center:new Ce(0,0,0),radius:1/0});m(this,"minTilt",0);m(this,"maxTilt",1.2);m(this,"MOUSE_BUTTONS",{ORBIT:q1.RIGHT,ZOOM:q1.MIDDLE,PAN:q1.LEFT});m(this,"camera");m(this,"scene");m(this,"renderer");m(this,"elevation");m(this,"orbit");m(this,"cameraPlane");m(this,"raycaster",new gs);m(this,"rendererState");m(this,"options");m(this,"state",-1);m(this,"intersection");m(this,"viewState",null);m(this,"tweens",new Map);m(this,"clock",new lE(!0));m(this,"coords",{mouse:new Ee,rotateStart:new Ee,rotateEnd:new Ee,rotateDelta:new Ee,panStart:new Ce,panCameraStart:new Ce,panEnd:new Ce,panDelta:new Ce,initialShiftPos:new Ee,initialPedestal:0,floorAnchor:new Ce});m(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});m(this,"scrollTimer",null);m(this,"lastWheelTime",0);m(this,"resetZoom",!1);m(this,"zoomStart");m(this,"pedestalScaleFactor",1);m(this,"isUserZooming",!1);m(this,"stayInsideBounds",!0);m(this,"userInteracting",!1);m(this,"cameraMoving",!1);m(this,"lastCameraMoveTime",Date.now());m(this,"raycastToFloor",r=>{this.raycaster.setFromCamera(r,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new Ce});m(this,"isUserInteracting",()=>this.userInteracting);m(this,"getPosition",()=>new Ce(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z));m(this,"getPedestal",()=>this.orbit.position.z);m(this,"pan",(r,n)=>{isNaN(r)||isNaN(n)||(this.setPosition(this.orbit.position.x+r,this.orbit.position.y+n),this.publish("position-updated"))});m(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"))});m(this,"isCameraMoving",()=>this.cameraMoving);m(this,"lastCameraStoppedMovingTime",()=>this.lastCameraMoveTime);m(this,"setPosition",(r,n)=>{r===void 0||n===void 0||isNaN(r)||isNaN(n)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(r,n),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)});m(this,"updateCameraPosition",(r,n)=>{let o=r-this.panBounds.center.x,i=n-this.panBounds.center.y,s=Math.sqrt(o*o+i*i);if(this.stayInsideBounds&&s>this.panBounds.radius){let a=Math.atan2(i,o),l={x:Math.cos(a)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(a)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=l.x,this.orbit.position.y=l.y}else this.orbit.position.x=r,this.orbit.position.y=n});m(this,"tilt",r=>{if(isNaN(r))return;this.state===-1&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(r+this.getTilt(),this.maxTilt),this.minTilt):r+this.getTilt();n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")});m(this,"zoomIn",(r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i/1.5},r,n,o)});m(this,"zoomOut",(r,n,o)=>{let i=this.getZoomAltitude();this.animateCamera({zoom:i*1.5},r,n,o)});m(this,"getRotation",()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2));m(this,"cancelAnimation",()=>{let r=Array.from(this.tweens.keys()),n=r[r.length-1];n.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(n)});m(this,"animateCamera",(r,n,o,i,s,a)=>{let l={interruptible:!0,...a},u={},d={},f=this.getPosition();if(r.position!=null&&(r.position.x!==void 0&&(u.x=f.x,d.x=r.position.x),r.position.y!==void 0&&(u.y=f.y,d.y=r.position.y),r.position.z!==void 0&&(u.z=f.z,d.z=r.position.z)),r.zoom!==void 0&&(u.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.zoom=r.zoom:d.zoom=Math.min(Math.max(r.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),r.rotation!==void 0){let{start:w,end:T}=r0(this.getRotation(),r.rotation);u.rotation=w,d.rotation=T}r.tilt!==void 0&&(u.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?d.tilt=r.tilt:d.tilt=Math.max(Math.min(r.tilt,this.maxTilt),this.minTilt));let h=u.zoom!==d.zoom,b=u.rotation!==d.rotation,v=u.tilt!==d.tilt,I=new xo(u).to(d,g.env.TESTING?0:n).onUpdate(w=>{this.setMulti({x:w.x,y:w.y,z:w.z},w.zoom,w.rotation,w.tilt)}).onComplete(()=>{this.completeTween(I),this.publish("multi-end",{zooming:h,rotating:b,tilting:v}),i&&i()}).onStart(()=>{this.state!==7&&(this.state=7,I.state=7,this.publish("multi-start",{zooming:h,rotating:b,tilting:v})),this.publish("change")});this.rendererState.tweenGroup.add(I);let x=Array.from(this.tweens.entries()),C=x[x.length-1],P=!1;return C!=null&&(C[1].interruptible?(typeof C[1].cancelledCallback=="function"&&C[1].cancelledCallback(),this.completeTween(C[0])):(P=!0,C[0].chain(I))),this.tweens.set(I,{cancelledCallback:s,interruptible:l.interruptible}),o?I.easing(o):I.easing(Ar.Quadratic.In),!r.doNotAutoStart&&!P&&(I.start(),this.publish("change")),I.cameraAnimation=!0,I});m(this,"setMulti",(r,n,o,i,s=!0)=>{this.state===-1&&this.publish("multi-start");let a=!1;r!=null&&(r.x!==void 0&&!isNaN(r.x)&&r.y!==void 0&&!isNaN(r.y)&&(this.updateCameraPosition(r.x,r.y),a=!0),r.z!==void 0&&!isNaN(r.z)&&(this.setPedestal(r.z,!0),a=!0)),a&&this.publish("position-updated");let l={zooming:!1,tilting:!!n,rotating:!1};if(n!==void 0&&!isNaN(n)){let u=this.stayInsideBounds?Math.min(Math.max(n,this.getZoomScaledMin()),this.getZoomScaledMax()):n;u!==this.camera.position.z&&(l.zooming=!0,this.camera.position.z=u,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>wb&&(this.camera.near=n-wb,this.camera.far=n+wb):(this.camera.near=n/Wm,this.camera.far=n*Wm),this.camera.updateProjectionMatrix())}if(o!==void 0&&!isNaN(o)&&o!==this.getRotation()&&(l.rotating=!0,this.orbit.rotation.z=-o,this.publish("rotation-updated")),i!==void 0&&!isNaN(i)){let u=this.stayInsideBounds?Math.max(Math.min(i,this.maxTilt),this.minTilt):i;u!==this.elevation.rotation.x&&(l.tilting=!0,this.elevation.rotation.x=u,this.publish("tilt-updated"))}s&&this.publish("change"),this.state===-1&&this.publish("multi-end",l)});m(this,"getZoomScaledMin",()=>this.minZoomAltitude*this.zoomFactor);m(this,"getZoomScaledMax",()=>{let r=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,r)});m(this,"setRotation",(r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let o=-(r%J5);o!==this.orbit.rotation.z&&(this.orbit.rotation.z=o,n||this.publish("rotation-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0});m(this,"setZoomAltitude",r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.stayInsideBounds?Math.min(Math.max(r,this.getZoomScaledMin()),this.getZoomScaledMax()):r;n!==this.camera.position.z&&(this.camera.position.z=n,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=n/Wm,this.camera.far=n*Wm,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0});m(this,"setZoomLevel",r=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(r))});m(this,"getZoomAltitude",()=>this.camera.position.z);m(this,"getZoomLevel",()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()));m(this,"setTilt",(r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let o=this.stayInsideBounds?Math.max(Math.min(r,this.maxTilt),this.minTilt):r;o!==this.elevation.rotation.x&&(this.elevation.rotation.x=o,n||this.publish("tilt-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0});m(this,"getTilt",()=>this.elevation.rotation.x);m(this,"setCameraPlaneElevation",r=>{this.cameraPlane.position.z=r});m(this,"zoom",r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.getZoomAltitude()-r;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(n,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):n,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")});m(this,"getProjectionScaleFactor",(r,n,o)=>e3(r,n,o));m(this,"update",()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())});m(this,"setPedestal",(r,n=!1)=>{typeof r=="number"&&!isNaN(r)&&(this.orbit.position.z=r,n&&(this.publishPedestalChangeEvent(r),this.publish("pedestal-change",{pedestal:r})),this.publish("change"),this.dirty=!0)});m(this,"dispose",()=>{for(let r of KI)r.endsWith("start")?(this.off(r,this.setCameraMoving),r.startsWith("user")&&this.off(r,this.setUserInteracting)):(r.endsWith("end")||r.endsWith("cancel"))&&(this.off(r,this.unsetCameraMoving),r.startsWith("user")&&this.off(r,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)});m(this,"createCameraPlane",()=>{let r=JI?2e3:1e10,n=JI?100:1,o=new Ti(r,r,n,n),i=new Br({color:0,wireframe:JI,visible:JI}),s=new Ve(o,i);return this.scene.add(s),s});m(this,"addEventListeners",()=>{let{domElement:r}=this.renderer;for(let n of KI)n.endsWith("start")?(this.on(n,this.setCameraMoving),n.startsWith("user")&&this.on(n,this.setUserInteracting)):(n.endsWith("end")||n.endsWith("cancel"))&&(this.on(n,this.unsetCameraMoving),n.startsWith("user")&&this.on(n,this.unsetUserInteracting));r.addEventListener("contextmenu",this.onContextMenu,!1),r.addEventListener("mousedown",this.onMouseDown,!1),r.addEventListener("wheel",this.onMouseWheel,{passive:!1}),r.addEventListener("touchstart",this.onTouchStart,!1),r.addEventListener("touchend",this.onTouchEnd,!1),r.addEventListener("touchmove",this.onTouchMove,!1)});m(this,"addMouseEventListeners",()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)});m(this,"addMouseMoveEventListeners",()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)});m(this,"removeMouseMoveEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)});m(this,"removeEventListeners",()=>{let{domElement:r}=this.renderer;r.removeEventListener("contextmenu",this.onContextMenu,!1),r.removeEventListener("mousedown",this.onMouseDown,!1),r.removeEventListener("wheel",this.onMouseWheel,!1),r.removeEventListener("touchstart",this.onTouchStart,!1),r.removeEventListener("touchend",this.onTouchEnd,!1),r.removeEventListener("touchmove",this.onTouchMove,!1),r.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});m(this,"removeMouseUpEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});m(this,"onContextMenu",r=>{r.preventDefault()});m(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}});m(this,"onMouseMove",r=>{if(this.enabled!==!1)if(r.preventDefault(),this.mouseToScene(r),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(r)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(r)});m(this,"onTouchStart",r=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(r),r.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(r),this.state=9):this.enablePan&&(this.handleTouchStartPan(r),this.state=6);break;case 2:this.touch.inputs=new qI(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}});m(this,"onTouchMove",r=>{if(this.enabled!==!1)switch(this.touchToScene(r),r.touches.length){case 2:r.preventDefault(),r.stopPropagation();let n={...this.touch.inputs.first},o={...this.touch.inputs.second},i=new Ee(this.touch.touches[0].x,this.touch.touches[0].y),s=new Ee(this.touch.touches[1].x,this.touch.touches[1].y);if(this.touch.inputs.update(this.touch.touches[0],this.touch.touches[1]),this.enableRotate&&this.state===4)this.handleTouchMoveTilt(r);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let a=n.y<i.y&&o.y<s.y,l=n.y>i.y&&o.y>s.y;this.enableRotate&&this.state!==4&&(l||a)?(this.handleTouchStartTilt(r),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(r.preventDefault(),r.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(r):this.enablePan&&this.state===6&&this.handleTouchMovePan(r);break;default:this.state=-1}});m(this,"onTouchEnd",r=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}r.touches.length?this.onTouchStart(r):this.state=-1}});m(this,"handleTouchMovePan",r=>{let n=Object.hasOwn(r,"x")?new Ee(r.x,r.y):this.touch.touches[0],o=this.raycastToFloor(n);this.coords.panEnd.set(o.x,o.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});m(this,"handleTouchStartDolly",()=>{let r=this.touch.touches[0].x-this.touch.touches[1].x,n=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let o=new Ee(this.touch.touches[0].x-r/2,this.touch.touches[0].y-n/2);this.coords.floorAnchor=this.raycastToFloor(o),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Tb(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Tb(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")});m(this,"handleMouseMovePan",()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(r.x,r.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0});m(this,"handleTouchStartTilt",r=>{this.coords.rotateStart.set(r.touches[1].clientX,r.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")});m(this,"handleTouchMovePedestal",r=>{this.handleMouseMovePedestal(r.touches[0])});m(this,"handleTouchMoveTilt",r=>{this.coords.rotateEnd.set(r.touches[1].clientX,r.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)});m(this,"handleTouchMoveDolly",()=>{let r=this.touch.inputs.first,n=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:r.x,y:r.y},this.touch.anchor2.viewCoordinate={x:n.x,y:n.y};let o=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);o&&this.setCameraFromTransformMatrix(o),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,r),this.touch.anchor2.updateAnchorState(this.camera,n)});m(this,"handleTouchEnd",()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1});m(this,"handleTouchStartPan",r=>{let n=Object.hasOwn(r,"x")?new Ee(r.x,r.y):this.touch.touches[0],o=this.raycastToFloor(n);this.coords.panStart.set(o.x,o.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")});m(this,"handleTouchStartPedestal",r=>{this.handleMouseDownPedestal(r.touches[0])});m(this,"onMouseDown",r=>{if(this.enabled!==!1){if(this.mouseToScene(r),r.preventDefault(),this.state===3&&this.publish("zoom-end"),r.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(r),this.state=0}else r.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(r),this.state=8));this.state!==-1&&this.addMouseEventListeners()}});m(this,"onMouseWheel",r=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(r.preventDefault(),r.stopPropagation(),this.mouseToScene(r),this.canScrollZoom(r)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(r)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(r))});m(this,"handleMouseWheel",r=>{if(this.publish("zoom-start"),!this.canScrollZoom(r)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let n=this.getZoomAltitude(),o=n-X5(r)*n/Q5*this.zoomSpeed;if(this.setZoomAltitude(o),this.enablePan){let i=o/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")});m(this,"setCameraFromTransformMatrix",r=>{this.orbit.updateMatrixWorld();let n=new Ca;n.setFromRotationMatrix(r,"ZYX");let o=(r.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),i=n.z,s=new Ce(0,0,1);s.applyEuler(n),s.setLength(o);let a=new Ce;a.setFromMatrixPosition(r),a.sub(s),this.enablePan&&this.setPosition(a.x,a.y),this.enableZoom&&this.setZoomAltitude(o),this.enableRotate&&this.setRotation(-i)});m(this,"makeTransformFromTouchAnchors",(r,n)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let o=this.camera.projectionMatrix.clone(),i=r.worldCoordinate,s=n.worldCoordinate,a=r.reUnproject(),l=n.reUnproject();if(!a||!l||!i||!s)return null;let u=r.viewCoordinate,d=n.viewCoordinate,f=s.x-i.x,h=s.y-i.y,b=Math.atan2(h,f),v=l.x-a.x,I=l.y-a.y,x=Math.atan2(I,v),C=lX(b,x),P=new Ci;P.makeRotationZ(-C);let w=P.clone();w.multiply(r.snapHolderMatrix);let T=($Y,jY,GY)=>$Y.elements[(jY-1)*4+GY-1],O=T(o,1,1)*T(w,1,1)-u.x*T(o,3,4)*T(w,3,1),N=T(o,1,1)*T(w,1,2)-u.x*T(o,3,4)*T(w,3,2),k=T(o,1,1)*T(w,1,3)-u.x*T(o,3,4)*T(w,3,3),D=i.x*O+i.y*N+i.z*k,F=T(o,2,2)*T(w,2,1)-u.y*T(o,3,4)*T(w,3,1),z=T(o,2,2)*T(w,2,2)-u.y*T(o,3,4)*T(w,3,2),G=T(o,2,2)*T(w,2,3)-u.y*T(o,3,4)*T(w,3,3),j=i.x*F+i.y*z+i.z*G,K=T(o,1,1)*T(w,1,1)-d.x*T(o,3,4)*T(w,3,1),Z=T(o,1,1)*T(w,1,2)-d.x*T(o,3,4)*T(w,3,2),oe=T(o,1,1)*T(w,1,3)-d.x*T(o,3,4)*T(w,3,3),Q=s.x*K+s.y*Z+s.z*oe,ye=T(o,2,2)*T(w,2,1)-d.y*T(o,3,4)*T(w,3,1),be=T(o,2,2)*T(w,2,2)-d.y*T(o,3,4)*T(w,3,2),ue=T(o,2,2)*T(w,2,3)-d.y*T(o,3,4)*T(w,3,3),_e=s.x*ye+s.y*be+s.z*ue,ht=Math.abs(K-O),ot=Math.abs(Z-N),Xe=Math.abs(oe-k),Ue=Math.abs(K-F),pe=Math.abs(Z-z),me=Math.abs(oe-G),te=Math.abs(ye-O),ie=Math.abs(be-N),A=Math.abs(ue-k),Y=Math.abs(ye-F),L=Math.abs(be-z),le=Math.abs(ue-G),ne=Math.min(ht+ot+Xe,Ue+pe+me),ae=Math.min(te+ie+A,Y+L+le);ne<ae&&(K=ye,Z=be,oe=ue,Q=_e);let ve=F*k-O*G,cr=z*k-N*G,jn=j*k-D*G,rn=K*G-F*oe,xn=Z*G-z*oe,uu=Q*G-j*oe,GS=(uu*cr-jn*xn)/(rn*cr-ve*xn),US=(uu*ve-jn*rn)/(xn*ve-cr*rn),jO=z*O-N*F,RY=G*O-k*F,NY=j*O-D*F,GO=Z*F-z*K,BY=oe*F-G*K,UO=((Q*F-j*K)*jO-NY*GO)/(BY*jO-RY*GO),W1=w.clone();return W1.elements[12]=GS,W1.elements[13]=US,W1.elements[14]=UO,UO>0?W1:null});m(this,"updateTouchOrigin",()=>{let r=this.renderer.domElement;this.touch.origin.offsetLeft=r.getBoundingClientRect().left,this.touch.origin.offsetTop=r.getBoundingClientRect().top});m(this,"touchToScene",r=>{this.touch.touches=[];for(let n=0,o=r.touches.length;n<o;n++){let i=r.touches[n],s=cX(i,this.touch.origin);this.touch.touches.push(new Ee(s.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(s.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]});m(this,"canScrollZoom",r=>{let n=X5(r),o=this.getZoomAltitude();return!(n<0&&o===this.getZoomScaledMax()||n>0&&o===this.getZoomScaledMin())});m(this,"mouseToScene",r=>{let n=this.getMousePos(r);return this.coords.mouse.x=n.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(n.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse});m(this,"getMousePos",r=>({x:r.offsetX,y:r.offsetY}));m(this,"handleMouseDownRotate",r=>{this.coords.rotateStart.set(r.clientX,r.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")});m(this,"handleMouseDownPan",()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(r.x,r.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")});m(this,"handleMouseDownPedestal",r=>{let n=new Ee(r.clientX,r.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=e3(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")});m(this,"handleMouseMovePedestal",r=>{let n={x:r.clientX,y:r.clientY},o=this.coords.initialPedestal+this.pedestalScaleFactor*(n.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(o<this.minPedestal?o=Math.max(o,this.minPedestal):o>this.maxPedestal&&(o=Math.min(o,this.maxPedestal))),o!==this.getPedestal()&&this.setPedestal(o,!0)});m(this,"handleMouseMoveRotate",r=>{this.coords.rotateEnd.set(r.clientX,r.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")});m(this,"publishUserZoomDebounced",Ed(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));m(this,"publishUserZoomEvent",()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())});m(this,"setCameraMoving",()=>{this.cameraMoving=!0});m(this,"unsetCameraMoving",()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()});m(this,"setUserInteracting",()=>{this.userInteracting=!0});m(this,"unsetUserInteracting",()=>{this.userInteracting=!1});m(this,"publishPedestalChangeEvent",r=>{this.publish("pedestal-change",{pedestal:r,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})});m(this,"convertAltitudeToZoomLevel",r=>{let[,n]=this.center,i=r*2*Math.tan(Ye.degToRad(this.camera.fov)/2)/this.options.canvasHeight,s=Math.cos(Ye.degToRad(n))*2*Math.PI*VS/i;return Ye.clamp(Math.log2(s/512),XI,YI)});m(this,"convertZoomLevelToAltitude",r=>{let[,n]=this.center,o=Ye.clamp(r,XI,YI),i=Math.pow(2,o),s=Ye.clamp(n,Y5,K5),a=i*512;return Math.cos(Ye.degToRad(s))*Math.PI*2*VS/a*this.options.canvasHeight/2/Math.tan(Ye.degToRad(this.camera.fov)/2)});m(this,"completeTween",r=>{r.isPlaying()&&r.stop(),this.rendererState.tweenGroup.remove(r),this.tweens.delete(r)});m(this,"debugContainer",new Pa);this.camera=r,this.renderer=o,this.rendererState=i,this.scene=n,this.options=s,this.elevation=r.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=r.position.z,s.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(r){this.minZoomAltitude=this.convertZoomLevelToAltitude(r)}get defaultMinZoomLevel(){return c(this,QI)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(r){this.maxZoomAltitude=this.convertZoomLevelToAltitude(r)}get scrollPercent(){let r=this.minPedestal,n=this.maxPedestal,o=this.getPedestal();return o=Math.min(o,n),o=Math.max(o,r),(o-r)/(n-r)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var i,s,a,l;let r=this.getPosition(),{lat:n,lon:o}=i0((s=(i=this.rendererState.center)==null?void 0:i[1])!=null?s:0,(l=(a=this.rendererState.center)==null?void 0:a[0])!=null?l:0,r.x,r.y);return[o,n]}setCenter(r,n){var s,a,l,u;let{x:o,y:i}=s0((a=(s=this.rendererState.center)==null?void 0:s[1])!=null?a:0,(u=(l=this.rendererState.center)==null?void 0:l[0])!=null?u:0,n,r);this.setPosition(o,i)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(r=>r.cameraAnimation)}getCameraFrameForCoordinates(r,n){let o=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,i=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,s=this.options.canvasWidth,a=this.options.canvasHeight,l=this.getRotation(),u=this.getTilt(),d=this.getPosition();this.setRotation(n.rotation||l,!0),this.setTilt(n.tilt||u,!0);let f=pX(r,{canvasWidth:s,canvasHeight:a,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:o,maxZoom:i,position:d,camera:this.camera,orbit:this.orbit});return this.setRotation(l,!0),this.setTilt(u,!0),{center:f.position,zoomLevel:this.convertAltitudeToZoomLevel(f.zoom)}}focusOn(r,n){if(wCe){this.debugContainer&&fr(this.debugContainer);let x=new Pi(4,4,4),C=new Br({color:65280,depthTest:!1}),P=new zl(x,C,r.length),w=new Ci;r.forEach((T,O)=>{w.setPosition(T),P.setMatrixAt(O,w)}),P.instanceMatrix.needsUpdate=!0,this.debugContainer.add(P),this.scene.add(this.debugContainer)}let o=n.curve,i=n.callback,s=n.cancelledCallback,a=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,l=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,u=this.options.canvasWidth,d=this.options.canvasHeight,f;n.duration!==void 0?f=n.duration:g.env.TESTING==="true"?f=0:f=eO;let h=n.padding,b=this.getRotation(),v=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let I=pX(r,{canvasHeight:d,paddingOption:h,canvasWidth:u,minZoom:a,maxZoom:l,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(b),this.setTilt(v),this.animateCamera({position:I.position,tilt:n.tilt,rotation:n.rotation,zoom:I.zoom},f,o,i,s,n)}resize(r,n){this.options.canvasWidth=r,this.options.canvasHeight=n}};QI=new WeakMap,m(Qp,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);function pX(e,{canvasWidth:t,orbit:r,paddingOption:n,verticalPadding:o=0,canvasHeight:i,minZoom:s,maxZoom:a,camera:l,position:u}){let d={zoom:s,position:u};if(e.length===0)return d;for(let ve of Qp.CAMERA_FRAME_PADDING_SIDES)typeof n[ve]!="number"&&(n[ve]=0);let f=n.type==="portion"?{top:n.top*i,bottom:n.bottom*i,left:n.left*t,right:n.right*t,type:"pixel"}:n;if(f.left+f.right>=t||f.top+f.bottom>=i)return d;r.updateMatrixWorld();let h=l.matrixWorldInverse,b=l.fov*(Math.PI/180)/2,v=b,x=Math.atan(Math.tan(b)*(t/i)),C=new Ce(1/0,1/0,1/0),P=new Ce(-1/0,-1/0,-1/0),w=new Xr,T=new Ce;for(let ve=0,cr=e.length;ve<cr;ve++)T.copy(e[ve]),w.expandByPoint(T),T.applyMatrix4(h),C.min(T),P.max(T),T.copy(e[ve]),T.z-=o,T.applyMatrix4(h),C.min(T),P.max(T),T.copy(e[ve]),T.z+=o,T.applyMatrix4(h),C.min(T),P.max(T);let O=P.x-C.x,N=P.y-C.y,k=t-f.left-f.right,D=i-f.top-f.bottom,F=(P.x+C.x)/2,z=(P.y+C.y)/2,G=O/k,j=N/D,K=s,Z=a,oe=K*Math.tan(x)*2,Q=Z*Math.tan(x)*2,ye=oe/t,be=Q/t,ue=Math.max(G,j);ue=Ye.clamp(ue,ye,be);let _e=k*ue,ht=D*ue,ot={min:{x:F-_e/2-f.left*ue,y:z-ht/2-f.bottom*ue},max:{x:F+_e/2+f.right*ue,y:z+ht/2+f.top*ue}},Xe=(ot.min.x+ot.max.x)/2,Ue=(ot.min.y+ot.max.y)/2,pe=w.getCenter(new Ce),me=Math.abs(Xe-ot.min.x),te=Math.abs(Ue-ot.min.y),ie=me/Math.tan(x),A=te/Math.tan(v),Y=new Ce;Y.set(Xe,Ue,P.z+Math.max(ie,A)),Y.applyMatrix4(l.matrixWorld);let L=new Ce;L.set(Xe,Ue,P.z),L.applyMatrix4(l.matrixWorld);let le=new Ce().subVectors(L,Y),ne=(pe.z-Y.z)/le.z,ae=new Ce().copy(Y).add(le.clone().multiplyScalar(ne));return L.set(ae.x,ae.y,ae.z),Y.sub(L),{position:ae,zoom:Y.length()}}p();var MCe=300,Mb,Ob,eS=class{constructor(t){m(this,"state");M(this,Mb,new Ce);M(this,Ob,new Ce);this.state=t}update(t){var o;let r,n;this.state.cameraObject.getWorldPosition(c(this,Ob));for(let i of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(i),r&&(n=r.components[0],n&&"containerEl"in n&&n.markerContainer!=null)){if(n.visibilityNeedsUpdate!==!1&&(n.visibilityNeedsUpdate==="show"?n.canShow=!0:n.canShow=!1),(n.canShow&&n.visible===!0||((o=n.animation)==null?void 0:o.pending)===!0)&&!n.offscreen)if(n.options.zIndex!=null)n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(n.options.zIndex,"px)");else{r.object3d.getWorldPosition(c(this,Mb));let s=c(this,Ob).distanceTo(c(this,Mb));n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(-s,"px)")}if(n.canShow===!0&&n.visible===!0?n.markerContainer.style.pointerEvents=t?"none":n.pointerEvents:n.markerContainer.style.pointerEvents="none",n.currentStrategyIndex===-1&&n.visible&&n.visibilityNeedsUpdate==="show")continue;n.visibilityNeedsUpdate!==!1&&!n.offscreen&&(n.visibilityNeedsUpdate==="show"&&(n.markerContainer.style.opacity="0"),n.animation&&n.animation.cancel(),n.animation=n.markerContainer.animate([{opacity:n.canShow&&n.visible?"1":"0"}],{duration:MCe,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};Mb=new WeakMap,Ob=new WeakMap;p();var tS=class{constructor(){m(this,"percentExpanded",0);m(this,"activeId","");m(this,"gap",20);m(this,"dirty",!0)}};p();var rS=class extends De{constructor(r,n){super();m(this,"state");m(this,"dirty",!0);m(this,"domTree");m(this,"observers",new Map);m(this,"updateDimensions",r=>{r.forEach(n=>{var s;let i=(s=n.target.parentElement)==null?void 0:s.getAttribute("data-marker-id");if(i){let a=this.state.geometry2DMap.get(i),l=a==null?void 0:a.components[0];a&&l instanceof aa&&(l.updateDimensions(n.contentRect.width,n.contentRect.height),l.collisionDirty=!0)}}),this.publish("dimensions-update")});this.state=r,this.domTree=n}setupObserver(){var o;if(this.observers){for(let i of this.observers.values())i.disconnect();this.observers.clear()}let r,n;for(let i of this.domTree.children){let s=i.getAttribute("data-marker-id");if(s!=null&&(r=this.state.geometry2DMap.get(s),n=r.components[0],(o=n.options)!=null&&o.dynamicResize)){let a=new ResizeObserver(this.updateDimensions);a.observe(n.containerEl),this.observers.set(i.userData.entityId,a)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let r of this.observers.values())r.disconnect();this.observers.clear()}};p();var OCe=0,ECe=90,_Ce=(g.env.NODE_ENV==="test",!1),Sl={linear:Ar.Linear.None,"ease-in":Ar.Quadratic.In,"ease-out":Ar.Quadratic.Out,"ease-in-out":Ar.Quadratic.InOut},ACe=-50,Pe,Ne,zc,Eb,_b,nO,nS=class{constructor(t,r,n){M(this,_b);M(this,Pe);M(this,Ne);M(this,zc);M(this,Eb);_(this,Pe,t),_(this,Ne,r),_(this,zc,n),c(this,Ne).cameraSystem.on("pedestal-change",({pedestal:o})=>{c(this,Pe).map&&(c(this,Pe).map.transform.elevation=o,c(this,Pe).map.transform.minElevationForCurrentTile=ACe,c(this,Pe).map.triggerRepaint()),c(this,Ne).cameraSystem.setCameraPlaneElevation(o)})}get center(){return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?c(this,Pe).map.getCenter().toArray():c(this,Ne).cameraSystem.center}setCenter(t){var r;if(c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map){(r=c(this,Pe).map)==null||r.setCenter(t),c(this,Ne).interactionSystem.handleHover();return}c(this,Ne).cameraSystem.setCenter(t[0],t[1]),c(this,Ne).interactionSystem.handleHover()}get zoomLevel(){var t;return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(t=c(this,Pe).map)==null?void 0:t.getZoom():c(this,Ne).cameraSystem.getZoomLevel()}setZoomLevel(t){var r;c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map&&((r=c(this,Pe).map)==null||r.setZoom(t)),c(this,Ne).cameraSystem.setZoomLevel(bs(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get isAnimating(){return c(this,Ne).cameraSystem.isAnimating}cancelAnimation(){c(this,Ne).cameraSystem.cancelAnimation()}get maxZoomLevel(){return c(this,Ne).cameraSystem.maxZoomLevel}get minZoomLevel(){return c(this,Ne).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){c(this,Ne).panBoundsSystem.autoMinZoomLevel=t,t&&(c(this,Ne).panBoundsSystem.dirty=!0,c(this,Ne).panBoundsSystem.update())}get autoMinZoomLevel(){return c(this,Ne).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,r=!1){var o;r&&this.setAutoMinZoomLevel(!1);let n=bs(t,Ii.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Ii.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));c(this,Ne).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(o=c(this,Pe).map)==null||o.setMinZoom(n)}setMaxZoomLevel(t){var n;let r=bs(t,this.minZoomLevel,Ii.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Ii.MAX_MERCATOR_ZOOM_LEVEL,"."));c(this,Ne).cameraSystem.setMaxZoomLevel(r),this.zoomLevel>r&&this.setZoomLevel(r),(n=c(this,Pe).map)==null||n.setMaxZoom(r)}get maxPitch(){var t;return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(t=c(this,Pe).map)==null?void 0:t.getMaxPitch():Ye.radToDeg(c(this,Ne).cameraSystem.maxTilt)}get minPitch(){var t;return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(t=c(this,Pe).map)==null?void 0:t.getMinPitch():Ye.radToDeg(c(this,Ne).cameraSystem.minTilt)}setMinPitch(t){var n;let r=Math.max(OCe,t);(n=c(this,Pe).map)==null||n.setMinPitch(r),c(this,Ne).cameraSystem.minTilt=Ye.degToRad(r)}setMaxPitch(t){var n;let r=Math.min(ECe,t);(n=c(this,Pe).map)==null||n.setMaxPitch(r),c(this,Ne).cameraSystem.maxTilt=Ye.degToRad(r)}get bearing(){var t;return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(t=c(this,Pe).map)==null?void 0:t.getBearing():Ye.radToDeg(c(this,Ne).cameraSystem.getRotation())}setBearing(t){var r;if(c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map){(r=c(this,Pe).map)==null||r.setBearing(t);return}c(this,Ne).cameraSystem.setRotation(Ye.degToRad(t))}get pitch(){var t;return c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(t=c(this,Pe).map)==null?void 0:t.getPitch():Ye.radToDeg(c(this,Ne).cameraSystem.getTilt())}setPitch(t){var r;if(c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map){(r=c(this,Pe).map)==null||r.setPitch(t);return}c(this,Ne).cameraSystem.setTilt(Ye.degToRad(bs(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return c(this,Ne).cameraSystem.getPedestal()}setElevation(t){c(this,Ne).cameraSystem.setPedestal(t,!0)}animateElevation(t,r){return c(this,Eb)&&c(this,Eb).stop(),new Promise(n=>{var i;let o=c(this,Ne).cameraSystem.getPosition();o.z=t,c(this,Ne).cameraSystem.animateCamera({position:o},(r==null?void 0:r.duration)||300,Sl[(r==null?void 0:r.easing)||"ease-in-out"],n,n,{interruptible:(i=r==null?void 0:r.interruptible)!=null?i:!0})})}get insetsPadding(){return c(this,zc).insetsPadding}get panMode(){return c(this,Ne).cameraSystem.enablePan===!1&&c(this,Ne).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(c(this,Ne).cameraSystem.enablePan=!0,c(this,Ne).cameraSystem.enablePedestal=!1):(c(this,Ne).cameraSystem.enablePan=!1,c(this,Ne).cameraSystem.enablePedestal=!0))}setInsetPadding(t){c(this,zc).insetsPadding=Object.assign({},Sh,t)}animateTo(t){var s,a,l,u,d,f;if(c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map)return(f=c(this,Pe).map)==null||f.flyTo({center:(s=t.center)!=null?s:this.center,zoom:(a=t.zoomLevel)!=null?a:this.zoomLevel,bearing:(l=t.bearing)!=null?l:this.bearing,pitch:(u=t.pitch)!=null?u:this.pitch,duration:(d=t.duration)!=null?d:600}),Promise.resolve();let r=t.center?c(this,Pe).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?c(this,Ne).cameraSystem.convertZoomLevelToAltitude(bs(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,o=t.bearing!==void 0?Ye.degToRad(t.bearing):void 0,i=t.pitch!==void 0?Ye.degToRad(bs(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(h=>{var b;c(this,Ne).cameraSystem.animateCamera({position:r,zoom:n,rotation:o,tilt:i},t.duration||0,Sl[t.easing||"ease-in-out"],()=>{c(this,Ne).interactionSystem.handleHover(),h()},h,{interruptible:(b=t==null?void 0:t.interruptible)!=null?b:!0})})}getCameraFrameForCoordinates(t,r){let n=ee(this,_b,nO).call(this,r||{},()=>Promise.resolve()),{pointCloud:o}=dX(t,c(this,Pe),c(this,zc).geometry3DMap);if(o.length===0)return $.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:i,zoomLevel:s}=c(this,Ne).cameraSystem.getCameraFrameForCoordinates(o,n);return{center:c(this,Pe).convert3DMapPositionToCoordinate(i),zoomLevel:s}}focusOn(t,r){var s,a,l,u;let{pointCloud:n,geoBounds:o,firstPosition:i}=dX(t,c(this,Pe),c(this,zc).geometry3DMap);return n.length===0?($.error("No valid coordinates found in targets:",t),Promise.resolve()):c(this,Pe).mode==="outdoors-overlay"&&c(this,Pe).map?(n.length===1&&i?(s=c(this,Pe).map)==null||s.flyTo({center:[i[0],i[1]],duration:(r==null?void 0:r.duration)||c(this,Pe).map.getBearing(),animate:!0,bearing:(r==null?void 0:r.bearing)===void 0?c(this,Pe).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?c(this,Pe).map.getPitch():r==null?void 0:r.pitch,zoom:(r==null?void 0:r.maxZoomLevel)||c(this,Pe).map.getMaxZoom()}):(_Ce&&kCe(c(this,Pe),o),(u=c(this,Pe).map)==null||u.fitBounds(o,{duration:(a=r==null?void 0:r.duration)!=null?a:Ii.DEFAULT_ANIMATION_DURATION,bearing:(r==null?void 0:r.bearing)===void 0?c(this,Pe).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?c(this,Pe).map.getPitch():r==null?void 0:r.pitch,maxZoom:(l=r==null?void 0:r.maxZoomLevel)!=null?l:c(this,Pe).map.getMaxZoom()})),c(this,Ne).interactionSystem.handleHover(),Promise.resolve()):new Promise(d=>{c(this,Ne).cameraSystem.focusOn(n,ee(this,_b,nO).call(this,r||{},d))})}};Pe=new WeakMap,Ne=new WeakMap,zc=new WeakMap,Eb=new WeakMap,_b=new WeakSet,nO=function(t,r){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:c(this,Ne).cameraSystem.convertZoomLevelToAltitude(bs(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:c(this,Ne).cameraSystem.convertZoomLevelToAltitude(bs(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:t!=null&&t.padding?Object.assign({},Sh,t==null?void 0:t.padding):this.insetsPadding,curve:Sl[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:Ye.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?Ye.degToRad(bs(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:t==null?void 0:t.duration,callback:()=>{c(this,Ne).interactionSystem.handleHover(),r()},cancelledCallback:r,interruptible:(n=t==null?void 0:t.interruptible)!=null?n:!0,verticalPadding:t==null?void 0:t.verticalPadding}};function rO(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function dX(e,t,r){var a;let n=[],o=[1/0,1/0,-1/0,-1/0],i=null;if(!e||!Array.isArray(e)||e.length===0)return{pointCloud:n,geoBounds:o,firstPosition:i};let s=t.getSystems().renderSystem;(s.threeDdirty||s.twoDdirty)&&t.renderSync();for(let l of e)if(typeof l=="string"){let u=r.get(l);if(!u){$.error("Entity not found with id:",l);continue}let d=new Xr;OE(t,"userData"in u&&(a=u.userData.entityId)!=null?a:u.id,n,d,u instanceof at?u.position.z:void 0);let f=t.convert3DMapPositionToCoordinate(d.min),h=t.convert3DMapPositionToCoordinate(d.max);rO(o,f),rO(o,h),i||(i=t.convert3DMapPositionToCoordinate(d.getCenter(new Ce)))}else n.push(t.convertTo3DMapPosition(l[1],l[0],l[2]||0)),rO(o,l),i||(i=l);return{pointCloud:n,geoBounds:o,firstPosition:i}}function kCe(e,t){var n,o,i,s;let r=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(n=e.map)!=null&&n.getLayer("bounds-outline")&&e.map.removeLayer("bounds-outline"),(o=e.map)!=null&&o.getSource("bounds-source")&&e.map.removeSource("bounds-source"),(i=e.map)==null||i.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:r}}}),(s=e.map)==null||s.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}p();var fX="uniform vec4 uSize;\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n // Scale the position by the size of the quad\n // and shift to top left corner for 0,0\n vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);\n // Apply width .x and height .y of image\n transformed += vec2(uSize.x, -uSize.y);\n // Apply left .w and top .z offset\n transformed += vec2(uSize.w, -uSize.z) * 2.0;\n gl_Position = vec4(transformed, 1.0, 1.0);\n}";var mX="varying vec2 vUv;\nuniform sampler2D uTexture;\nuniform float uOpacity;\nvoid main() {\n #ifndef debug\n vec4 texture = texture2D(uTexture, vUv);\n gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);\n #else\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n #endif\n}";p();var hX=4.291666666666667,yX=15,gX=25,bX=43/60;p();var vX=["horizontal","icon"],LCe=new Map([[vX[0],'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z"/>\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z"/>\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z"/>\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z"/>\n </svg>'],[vX[1],'<svg viewBox="0 0 43 60">\n <path d="M14.0291 7.06645C14.0291 10.9691 10.8885 14.1329 7.01453 14.1329C3.14051 14.1329 0 10.9691 0 7.06645C0 3.16376 3.14051 0 7.01453 0C10.8885 0 14.0291 3.16376 14.0291 7.06645Z"/>\n <path d="M28.7335 18.3468H35.1045C36.7455 18.3468 37.5178 19.0599 37.5821 20.6158V57.7309C37.5821 59.2868 36.8099 60 35.1367 60H28.9588C27.1569 60 26.642 59.7406 25.6767 58.282L12.6452 38.282V57.7309C12.6452 59.2868 11.8729 60 10.1997 60H3.82873C2.15554 60 1.3833 59.2868 1.3833 57.7309V20.6158C1.3833 19.0599 2.15554 18.3468 3.82873 18.3468H10.1032C11.9051 18.4116 12.4843 18.671 13.3852 20.0648L26.3524 40.162V20.6158C26.3524 19.0599 27.1247 18.3468 28.7335 18.3468Z"/>\n <path d="M41.5 60C42.3362 60 43 59.3143 43 58.5V58.4914C43 57.6771 42.3448 57 41.5 57C40.6638 57 40 57.6857 40 58.5V58.5086C40 59.3229 40.6552 60 41.5 60ZM41.5 59.8371C40.7414 59.8371 40.1724 59.2371 40.1724 58.5086V58.5C40.1724 57.7714 40.75 57.1629 41.5 57.1629C42.2586 57.1629 42.8276 57.7629 42.8276 58.4914V58.5C42.8276 59.2286 42.25 59.8371 41.5 59.8371ZM40.9138 59.2286H41.2069V58.7057H41.5259L41.8879 59.2286H42.2414L41.8362 58.6543C42.0431 58.5943 42.1897 58.44 42.1897 58.1914C42.1897 57.8743 41.9397 57.7114 41.6034 57.7114H40.9138V59.2286ZM41.2069 58.4657V57.9686H41.5776C41.7759 57.9686 41.8879 58.0543 41.8879 58.2171C41.8879 58.3629 41.7759 58.4657 41.5776 58.4657H41.2069Z"/>\n </svg>']]),RCe=/<svg([^>]*)>/g;function xX(e,t,r,n){let o=LCe.get(e);return o?o.replace(RCe,'<svg$1 width="'.concat(r,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}var IX=!1,zt,Cl,qm,Nn,ro,ed,rs,da,oS=class extends De{constructor(r,n,o){super();M(this,zt,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},interactive:!0,visible:!0});M(this,Cl);M(this,qm);M(this,Nn);M(this,ro);M(this,ed);M(this,rs,0);M(this,da,0);m(this,"dirty",!0);m(this,"getPositionAlignedCanvasCoordinates",(r,n)=>({"top-left":{x:0,y:0},"top-right":{x:r,y:0},"bottom-left":{x:0,y:n},"bottom-right":{x:r,y:n},center:{x:r/2,y:n/2},top:{x:r/2,y:0},bottom:{x:r/2,y:n},left:{x:0,y:n/2},right:{x:r,y:n/2}})[c(this,zt).position]);m(this,"getPositionAlignedPadding",()=>{var o,i,s,a;let r=c(this,zt).padding;if(typeof r=="number")return{"top-left":{x:r,y:r},"top-right":{x:-r,y:r},"bottom-left":{x:r,y:-r},"bottom-right":{x:-r,y:-r},center:{x:0,y:0},top:{x:0,y:r},bottom:{x:0,y:-r},left:{x:r,y:0},right:{x:-r,y:0}}[c(this,zt).position];let n={top:(o=r.top)!=null?o:0,right:(i=r.right)!=null?i:0,bottom:(s=r.bottom)!=null?s:0,left:(a=r.left)!=null?a:0};return{x:n.left-n.right,y:n.top-n.bottom}});o&&Object.entries(o).forEach(([i,s])=>{s!==void 0&&(c(this,zt)[i]=s)}),_(this,qm,r),_(this,Cl,n)}get color(){return c(this,zt).color==="light"?"white":"#293136"}get iconName(){return c(this,zt).iconOnly?"icon":"horizontal"}get minWidth(){return c(this,zt).iconOnly?yX:75}get defaultWidth(){return c(this,zt).iconOnly?gX:150}get aspectRatio(){return c(this,zt).iconOnly?bX:hX}get options(){return{...c(this,zt)}}set options(r){var n;_(this,zt,{padding:r.padding||c(this,zt).padding,position:r.position||c(this,zt).position,iconOnly:r.iconOnly||c(this,zt).iconOnly,color:r.color||c(this,zt).color,scale:r.scale||c(this,zt).scale,onClick:c(this,zt).onClick,interactive:(n=r.interactive)!=null?n:c(this,zt).interactive,visible:r.visible||c(this,zt).visible})}get icon(){return xX(this.iconName,this.color,c(this,rs)*c(this,Cl).pixelRatio,c(this,da)*c(this,Cl).pixelRatio)}setSize(r,n){c(this,ro)&&(c(this,ro).uniforms.uSize.value.x=r,c(this,ro).uniforms.uSize.value.y=n)}setXY(r,n){c(this,ro)&&(c(this,ro).uniforms.uSize.value.w=r,c(this,ro).uniforms.uSize.value.z=n)}get width(){return c(this,rs)}get height(){return c(this,da)}getPositionAlignedOffset(r,n){return{"top-left":{x:0,y:0},"top-right":{x:-r,y:0},"bottom-left":{x:0,y:-n},"bottom-right":{x:-r,y:-n},center:{x:-(r/2),y:-(n/2)},top:{x:-(r/2),y:0},bottom:{x:-(r/2),y:-n},left:{x:0,y:-(n/2)},right:{x:-r,y:-(n/2)}}[c(this,zt).position]}insertIntoQuadTree(r){c(this,ed)!=null&&typeof c(this,zt).onClick=="function"&&c(this,zt).interactive&&r.insert(c(this,ed))}resize(r,n){if(c(this,zt).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(r,n),i=this.getPositionAlignedPadding(),s=this.getPositionAlignedOffset(c(this,rs),c(this,da)),a=Math.min(r-c(this,rs),Math.max(0,o.x+i.x+s.x)),l=Math.min(n-c(this,da),Math.max(0,o.y+i.y+s.y));this.setSize(c(this,rs)/r,c(this,da)/n),this.setXY(a/r,l/n),_(this,ed,new Hr(a,l,c(this,rs),c(this,da),{entityId:"watermark"}))}update(){this.dirty&&c(this,zt).visible===!0&&(_(this,rs,Math.min(c(this,Cl).canvasWidth,Math.max(this.minWidth,this.defaultWidth*c(this,zt).scale))),_(this,da,c(this,rs)/this.aspectRatio),Uc.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),r=>{if(_(this,ro,new pu({uniforms:{uTexture:{value:r},uSize:{value:new KO(0,0,0,0)},uOpacity:{value:.7}},vertexShader:fX,fragmentShader:mX,depthWrite:!1,depthTest:!1,defines:{debug:IX},wireframe:IX,transparent:!0,visible:!0})),c(this,Nn))c(this,Nn).material=c(this,ro),c(this,Nn).material.needsUpdate=!0;else{let n=new Ti(2,2,1,1);_(this,Nn,new Ve(n,c(this,ro))),c(this,Nn).position.set(0,0,-1),c(this,Nn).frustumCulled=!1,c(this,Nn).renderOrder=999;let o=new Pi(1,1,1),i=new Ve(o,new Br({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));i.frustumCulled=!1,i.layers.set(1),c(this,Nn).add(i),c(this,qm).add(c(this,Nn))}this.resize(c(this,Cl).canvasWidth,c(this,Cl).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){c(this,Nn)&&(c(this,qm).remove(c(this,Nn)),fr(c(this,Nn))),_(this,Nn,void 0),c(this,ro)&&c(this,ro).dispose(),_(this,ro,void 0),_(this,ed,void 0)}};zt=new WeakMap,Cl=new WeakMap,qm=new WeakMap,Nn=new WeakMap,ro=new WeakMap,ed=new WeakMap,rs=new WeakMap,da=new WeakMap;p();var iS=100,$Ce=!1,aS=class extends De{constructor(r,n){super();m(this,"currentTotalBoundingBox");m(this,"state");m(this,"cameraSystem");m(this,"debugMesh",null);m(this,"dirty",!0);m(this,"autoMinZoomLevel",!0);this.state=r,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new Xr,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new Ce(0,0,0),new Ce(iS*2,iS*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(iS)));let r=new Xr().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(r);let n=r.getSize(new Ce),o=Math.max(n.x,n.y,n.z);for(let s of this.state.geometry2DMap.values())s.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(s.position),s.positionDirty=!1);let i=sS.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(o,iS)).getBoundingSphere(jCe).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new Ce),min:sS.min,max:sS.max,radius:i},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,$Ce&&this.state.entityScene.parent instanceof Vl){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Pa,this.debugMesh.add(new Ve(new J1(this.cameraSystem.panBounds.radius),new Br({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let s=new Ce;sS.getSize(s);let a=new Pi(s.x,s.y,s.z),l=new Br({color:65280,wireframe:!0,transparent:!0,opacity:.5}),u=new Ve(a,l);u.position.copy(this.currentTotalBoundingBox.getCenter(new Ce)),this.debugMesh.add(u)}}}},sS=new Xr,jCe=new QO;p();var SX="\xA9 Mappedin",GCe="https://info.mappedin.com/feedback",iO=["top-left","top-right","bottom-left","bottom-right"],UCe=640,VCe=()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>",oO={custom:[],position:"bottom-right",feedback:!0},lS=class{constructor(t){m(this,"controlContainerEl");m(this,"controlPositions");m(this,"compact");m(this,"attribContainerEl");m(this,"attribInnerEl");m(this,"attribButtonEl");m(this,"feedbackLinkEl");m(this,"attribHTML",SX);m(this,"customAttributions",[]);m(this,"toggleAttribution",t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))});this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=iO.reduce((r,n)=>{let o=document.createElement("div");return o.classList.add("mappedin-ctrl-".concat(n)),this.controlContainerEl.appendChild(o),r[n]=o,r},{})}addAttributionControl(t=oO){var o;let r=t.position&&iO.includes(t.position)?t.position:oO.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(r)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[r].appendChild(this.attribContainerEl),this.attribButtonEl=document.createElement("summary"),this.attribButtonEl.addEventListener("click",this.toggleAttribution),this.attribButtonEl.classList.add("mappedin-ctrl-attrib-button"),this.attribButtonEl.title="Toggle attribution",this.attribButtonEl.ariaLabel="Toggle attribution",this.attribButtonEl.tabIndex=0,this.attribButtonEl.innerHTML=VCe(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((o=t.feedback)!=null?o:oO.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=GCe,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)),t.custom&&(this.customAttributions=t.custom),this.updateAttributionDisplay()}updateAttribution(t){if(!t.style||!this.attribInnerEl||!this.attribContainerEl)return;let r=[SX],n=t.style.sourceCaches;for(let o in n){let i=n[o];if(i.used||i.usedForTerrain){let s=i.getSource();s.attribution&&r.indexOf(s.attribution)<0&&r.push(s.attribution)}}r=r.filter(o=>String(o).trim()),r=r.filter((o,i)=>{for(let s=i+1;s<r.length;s++)if(r[s].indexOf(o)>=0)return!1;return!0}),this.attribHTML=r.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=UCe||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(t){this.resizeAttribution(t)}updateData(t){this.updateAttribution(t)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};p();var Ab,Zm=class{constructor(t,r){m(this,"mesh");m(this,"type","custom-geometry");m(this,"dirty",!0);m(this,"feature");m(this,"builder");m(this,"outline");m(this,"color",new Ft);M(this,Ab,0);this.mesh=new Mi,this.feature=t,this.builder=r}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){$.warn("TODO: implement custom geometry opacity")}get opacity(){return $.warn("TODO: implement custom geometry opacity"),0}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return c(this,Ab)}set altitude(t){this.mesh&&(this.mesh.position.z=t,_(this,Ab,t))}get renderOrder(){return $.warn("TODO: implement custom geometry opacity"),-1}set renderOrder(t){$.warn("TODO: implement custom geometry render order")}};Ab=new WeakMap;p();var cS=class{constructor(t,r){m(this,"state");m(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=r}update(){let t,r;for(let n of this.state.geometry3DIdsInScene){let o=this.state.geometry3DMap.get(n);(o==null?void 0:o.type)==="custom-geometry"&&(t=o.components[0],r=o.components[1],t.dirty&&r.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],r.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(i=>{i.userData={entityId:n,type:"custom-geometry"}}),t.dirty=!1),r.visible!==!1&&t.builder.update(t.mesh))}}};p();p();function CX(e){return e.children.some(t=>t.userData.isOutline)}var WCe=80,td,Xm,pS,dS,uS=class{constructor(t){m(this,"rendererState");m(this,"outlineOpacitiesDirty",!0);M(this,td,!0);M(this,Xm,-1/0);M(this,pS,new Map);M(this,dS,new HS({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:Z1}));this.rendererState=t}get geometries3DDirty(){return c(this,td)}set geometries3DDirty(t){_(this,td,t)}update(t,r=!0){let n;if(this.geometries3DDirty){for(let i of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(i),n instanceof In&&n.components[0].outline&&n.visible&&!CX(n)&&n.userData.entities3D.size>0)for(let s of n.userData.entities3D.values()){let a=this.rendererState.geometry3DMap.get(s),l=[];if(a instanceof Tt&&a.type==="geometry"&&a.components[3]&&a.components[3].dirty===!0&&a.components[0].geometry!=null&&a.components[0].material!=null){let I=a.components[0].geometry;if(!I)return null;l.push([a.components[3],new WS(I,WCe)])}let u=zo(l.map(I=>I[1]),!1);if(u==null)continue;let d=u.getAttribute("position"),f=new Float32Array(d.count*4),h=new Ta(f,4);u.setAttribute("color",h);let b=0;for(let I=0;I<l.length;I++){let[x,C]=l[I],P=C.getAttribute("position").count;x.edgeColors=h,x.geometry=u,x.ranges={count:P,start:b},b+=P,C.dispose()}let v=new Pd(u,c(this,dS));v.userData.isOutline=!0,n.add(v)}_(this,td,!1),this.outlineOpacitiesDirty=!0}for(let i of this.rendererState.geometry3DIdsInScene){let s=this.rendererState.geometry3DMap.get(i);if(s instanceof Tt&&s.type==="geometry"&&s.components[3]&&s.components[3].dirty===!0&&s.components[0].geometry!=null&&s.components[0].material!=null&&s.parentObject3D instanceof In){let a=s.components[3].geometry;if(!a)continue;let l=s.components[3];if(!l)continue;let u=l.edgeColors;if(!u)continue;let d=new Ft(l.color);for(let I=0;I<l.ranges.count;I++){let x=l.ranges.start+I;u.setXYZ(x,d.r,d.g,d.b)}let f=s.components[1].height,b=a.getAttribute("position").array,v=-1/0;for(let I=0;I<l.ranges.count;I++){let C=(l.ranges.start+I)*3,P=b[C+2];v=Math.max(v,P)}for(let I=0;I<l.ranges.count;I++){let C=(l.ranges.start+I)*3,P=b[C+2];Math.abs(P-v)<1e-4&&(b[C+2]=Math.max(f,2e-4))}a.attributes.color.needsUpdate=!0,a.attributes.position.needsUpdate=!0,l.dirty=!1}}let o=r?Ss(t,16,19,0,1):c(this,Xm);if((o!==c(this,Xm)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let i of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(i),(n==null?void 0:n.type)==="geometry"&&n.components[0]instanceof hr){let s=n.components[3];if(s&&s.edgeColors&&s.geometry){let a=s.visible,l=Math.min(o,a?n.components[1].opacity*yu(n):0);if(s.currentOpacity!==l){for(let u=0;u<s.ranges.count;u++){let d=s.ranges.start+u;s.edgeColors.setW(d,l)}s.geometry.attributes.color.needsUpdate=!0}}}}_(this,Xm,o),_(this,td,!1),this.outlineOpacitiesDirty=!1}destroy(){c(this,pS).clear()}};td=new WeakMap,Xm=new WeakMap,pS=new WeakMap,dS=new WeakMap;p();p();var fS=class extends Ve{constructor(){super(...arguments);m(this,"userData",{entityId:""})}},qCe=B.object({flipImageToFaceCamera:B.boolean().optional(),url:B.string()}),ZCe=B.object({type:B.enum(["Feature"]),properties:B.object({width:B.number(),height:B.number(),rotation:B.number().min(0).max(360).optional(),verticalOffset:B.number().optional()}),geometry:zm});function PX(e,t,r){B.union([B.number(),B.string()]).parse(e),ZCe.parse(t),qCe.parse(r)}var mS=class{constructor(t){m(this,"mesh",new Mi);m(this,"imageMesh");m(this,"outline");m(this,"type","image");m(this,"instanceIndex",-1);m(this,"geometry");m(this,"material");m(this,"feature");m(this,"position",new Ce);this.feature=t}get visible(){var t,r;return(r=(t=this.mesh)==null?void 0:t.visible)!=null?r:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};p();function sO(e,t){return{x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)}}function XCe(e,t){return e.map(r=>sO(r,t))}function YCe(e){let t=1/0,r=1/0,n=-1/0,o=-1/0;for(let i of e)t=Math.min(t,i.x),r=Math.min(r,i.y),n=Math.max(n,i.x),o=Math.max(o,i.y);return{minX:t,minY:r,maxX:n,maxY:o}}function KCe(e,t){let r=!1;for(let n=0,o=t.length-1;n<t.length;o=n++){let i=t[n].x,s=t[n].y,a=t[o].x,l=t[o].y;s>e.y!=l>e.y&&e.x<(a-i)*(e.y-s)/(l-s)+i&&(r=!r)}return r}function TX(e,t,r,n,o){for(let i=0;i<o;i++)for(let s=0;s<n;s++)if(e[r+i][t+s]!==1)return!1;return!0}function JCe(e,t,r){let n=e.maxX-e.minX,o=e.maxY-e.minY,i,s,a={...e};return n/o>t?(s=o/r,i=s*t,a.minX+=(n-i*r)/2):(i=n/r,s=i/t,a.minY+=(o-s*r)/2),{dx:i,dy:s,gridBounds:a}}function QCe(e,t,r,n,o){let i=Array(r).fill(0).map(()=>Array(r).fill(0));for(let s=0;s<r;s++)for(let a=0;a<r;a++){let l={x:t.minX+a*n,y:t.minY+s*o};KCe(l,e)&&(i[s][a]=1)}return i}function ePe(e,t){let r=Array(t).fill(0).map(()=>Array(t).fill(0));for(let n=0;n<t;n++)for(let o=0;o<t;o++)if(e[n][o]===1){let i=0;for(let s=1;s<=Math.min(t-o,t-n)&&TX(e,o,n,s,s);s++)i=s;r[n][o]=i}return r}function tPe(e,t,r,n,o,i){let s=0,a=0,l=0;for(let u=0;u<n;u++)for(let d=0;d<n;d++)if(e[u][d]===1){let f=Math.pow(t[u][d],2),h=r.minX+d*o,b=r.minY+u*i;s+=f,a+=h*f,l+=b*f}return{x:a/s,y:l/s}}function rPe(e,t,r,n,o,i,s){let a=-1/0,l=null,u=e.length,d=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let f=0;f<u;f++)for(let h=0;h<u;h++)if(e[f][h]===1)for(let b=1;b<=u-h;b++){let v=b;if(!(v>u-f)&&TX(e,h,f,b,v)){let I=b*v,x=t.minX+(h+b/2)*r,C=t.minY+(f+v/2)*n,P={x,y:C},T=Math.sqrt(Math.pow(P.x-o.x,2)+Math.pow(P.y-o.y,2))/d,O=I*(1-i)-T*i*I;O>a&&(a=O,l={center:P,width:b*r*s,height:b*n*s})}}return l}function aO(e,t,r,n={}){let{scaleFactor:o=.9,centerPriority:i=.5,resolution:s=100,minimumSizeRatio:a=.5}=n,l=dE(r),u=e.width/e.height,d=XCe(t,l),f=YCe(d),{dx:h,dy:b,gridBounds:v}=JCe(f,u,s),I=QCe(d,v,s,h,b),x=ePe(I,s),C=tPe(I,x,v,s,h,b),P=rPe(I,v,h,b,C,i,o);return!P||P.width<e.width*a||P.height<e.height*a?e:{...P,center:sO(P.center,-l),rotation:r,polygonCenter:sO(C,-l)}}var kb=Math.PI*2,nPe=Math.PI/2,oPe=Math.PI*1.5,iPe=wd(nPe,2),sPe=wd(oPe,2),aPe=.01,wX=!1,hS=class extends De{constructor(r,n,o=0,i=0,s={}){super();m(this,"rendererState");m(this,"convertTo3DMapPosition");m(this,"initialBearing",0);m(this,"naturalBearing",0);m(this,"imagePlacementOptions");m(this,"imageLoadingCache",new Map);this.rendererState=r,this.convertTo3DMapPosition=n,this.initialBearing=o,this.naturalBearing=i,this.imagePlacementOptions=s}createImageMesh(r,n,o,i=0,s,a){var v,I,x;let l={width:o.width,height:o.height,center:this.convertTo3DMapPosition(s),rotation:(v=o.rotation)!=null?v:0},u=(I=this.imagePlacementOptions.mode)!=null?I:"default",d=(()=>{switch(u){case"fit-nearest-90":let C=(this.initialBearing-this.naturalBearing+360)%180;return C>=45&&C<=135?aO(l,a,l.rotation+90,this.imagePlacementOptions):l;case"fit-initial-bearing":return aO(l,a,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return l}})();if(wX&&d.polygonCenter){let C=new Ve(new J1(1),new wi({color:65280}));C.position.set(d.polygonCenter.x,d.polygonCenter.y,i),this.rendererState.entityScene.add(C)}let f=new wi({transparent:!0,depthWrite:!1,side:Ia}),h=new Ti(d.width,d.height),b=new fS(h);if(b.visible=!1,(x=this.getOrDownloadImage(n))==null||x.then(C=>{f.map=C,f.needsUpdate=!0,f.map.colorSpace=Sa,b.visible=!0,this.publish("image-loaded")}),b.userData.entityId=r,b.material=f,wX){let C=new Ve(new Ti(o.width,o.height),new wi({color:"gray"}));b.add(C);let P=new uE;b.add(P),P.scale.set(10,10,10)}return b.position.set(d.center.x,d.center.y,i+aPe),b.rotation.z=(-Ye.degToRad(d.rotation)+kb)%kb,b}getOrDownloadImage(r){var n;if(this.imageLoadingCache.has(r))return(n=this.imageLoadingCache.get(r))==null?void 0:n.promise;{let o=new Promise(i=>{Uc.getLoader().load(r,s=>{let a=this.imageLoadingCache.get(r);a&&!a.loaded&&(a.loaded=!0),i(s)})});return this.imageLoadingCache.set(r,{loaded:!1,promise:o}),o}}flipIfNeeded(r,n){if(r.imageMesh==null)return;let o=-n,i=r.imageMesh.rotation.z,s=wd((i-o+kb)%kb,2);s>iPe&&s<sPe&&(r.imageMesh.rotation.z=(i+Math.PI)%kb)}update(r){var s,a,l,u,d;let n,o,i;for(let f of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(f),(n==null?void 0:n.type)==="image"){if(o=n.components[0],i=n.components[1],i.url&&o.imageMesh==null){let h=this.convertTo3DMapPosition(o.feature.geometry.coordinates),b={x:h.x,y:h.y};o.imageMesh=this.createImageMesh(n.id,i.url,o.feature.properties,o.feature.properties.verticalOffset,o.feature.geometry.coordinates,[b]),o.mesh.add(o.imageMesh),o.position.copy(o.imageMesh.position)}o.imageMesh&&i.flipImageToFaceCamera&&this.flipIfNeeded(o,r)}else if((n==null?void 0:n.type)==="geometry"){if(o=n.components[0],i=n.components[1],i.showImage&&((s=o.feature.properties)!=null&&s.image)&&o.imageMesh==null&&o.visible&&o.mesh!=null&&o.mesh.parent!=null&&((a=o.feature.properties)==null?void 0:a.image.position)!=null&&o.feature.geometry.coordinates!=null&&o.feature.geometry.coordinates.length>0){let h=o.feature.geometry.coordinates[0].map(v=>{let I=this.convertTo3DMapPosition(v);return{x:I.x,y:I.y}}),b=this.createImageMesh(f,(l=o.feature.properties)==null?void 0:l.image.path,(u=o.feature.properties)==null?void 0:u.image,i.height,(d=o.feature.properties)==null?void 0:d.image.position,h);o.mesh.parent.add(b),o.imageMesh=b}if(o.imageMesh){if(!o.visible)o.imageMesh.visible=!1;else if(i.showImage&&!o.imageMesh.visible)if(i.url){let h=this.imageLoadingCache.get(i.url);h&&h.loaded&&(o.imageMesh.visible=!0)}else o.imageMesh.visible=!0;else!i.showImage&&o.imageMesh.visible&&(o.imageMesh.visible=!1);i.flipImageToFaceCamera&&this.flipIfNeeded(o,r)}}}};p();var lPe=250,Hc,yS=class extends De{constructor(r,n){super();m(this,"cameraDirty",!0);m(this,"focusablesDirty",!0);m(this,"state");m(this,"camera");m(this,"debugEl",null);m(this,"raycasters",[]);m(this,"collisions",new Map);m(this,"focusableEntities",new Set);m(this,"debugRaycasters",!1);M(this,Hc);m(this,"update",(r=!1,n=Date.now())=>{r||Date.now()-n>lPe||(c(this,Hc)&&cancelAnimationFrame(c(this,Hc)),_(this,Hc,requestAnimationFrame(()=>{this.updateRaf()})))});this.state=r,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let r=new Ee(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new Ee(r.x/1.2,r.y/1.2),o=new Ee(r.x+(r.x-n.x),n.y),i=new Ee(n.x,r.y+(r.y-n.y)),s=new Ee(o.x,i.y),a=new Ee(r.x,r.y/1.5),l=new Ee(r.x,r.y+(r.y-a.y));this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[r,a,l,n,o,i,s].map((u,d)=>{if(this.debugRaycasters){let I=document.createElement("div");I.style.position="absolute",I.style.top=u.y+"px",I.style.left=u.x+"px",I.style.width="10px",I.style.height="10px",I.style.backgroundColor="red",this.debugEl.append(I)}let f=u.x/this.state.canvasWidth*2-1,h=-(u.y/this.state.canvasHeight)*2+1,b=new Ee(f,h),v=new gs;return v.setFromCamera(b,this.camera),[v,b,d===0?10:d<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let r,n;for(let o of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(o),n!=null){if(n.type==="group-container"&&n.components[2]!==void 0&&n.components[2]instanceof Gm){let i=n.components[2];if(i.dirty===!0||i.focusMesh==null){i.focusMesh&&fr(i.focusMesh);let s=new Xr;s.setFromObject(n);let a=new Pi(s.max.x-s.min.x,s.max.y-s.min.y,s.max.z-s.min.z),l=new Br({transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters}),u=new Ve(a,l);u.position.set((s.min.x+s.max.x)/2,(s.min.y+s.max.y)/2,(s.min.z+s.max.z)/2),u.userData={entityId:n.userData.entityId},i.focusMesh=u,n.add(u),n.components[2].dirty=!1}this.focusableEntities.add(i.focusMesh)}else if(n.components[0]&&n.components[0]instanceof hr&&n.components[0].focusable&&n.components[0].geometry!=null&&(r=n.components[0],r instanceof hr&&r.focusable&&r.geometry!=null)){if(r.focusMesh==null){let i=new Ve(r.geometry);i.userData={entityId:n.id},r.focusMesh=i}this.focusableEntities.add(r.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.cameraDirty){if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.raycast()}}raycast(){this.collisions.clear();for(let[n,o]of this.raycasters)n.setFromCamera(o,this.camera);for(let[n,o,i]of this.raycasters)n.intersectObjects(Array.from(this.focusableEntities.values())).forEach(a=>{var l;if((a==null?void 0:a.object)!=null&&"isMesh"in a.object&&(a!=null&&a.object.isMesh)){let u=a.object.userData.entityId,d=(l=this.collisions.get(u))!=null?l:0;this.collisions.set(u,d+i)}});let r=Array.from(this.collisions,([n,o])=>({entityId:n,weight:o})).sort((n,o)=>o.weight-n.weight).map(({entityId:n})=>n);this.publish("geometry-in-focus",r),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){c(this,Hc)&&cancelAnimationFrame(c(this,Hc)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Hc=new WeakMap;p();p();p();p();function gS(e,t){t===void 0&&(t={});var r=Uf(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return cPe(r,t);case"MultiPolygon":return uPe(r,t);default:throw new Error("invalid poly")}}function cPe(e,t){t===void 0&&(t={});var r=Uf(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{};return MX(n,o)}function uPe(e,t){t===void 0&&(t={});var r=Uf(e),n=r.coordinates,o=t.properties?t.properties:e.type==="Feature"?e.properties:{},i=[];return n.forEach(function(s){i.push(MX(s,o))}),mu(i)}function MX(e,t){return e.length>1?yE(e,t):wa(e[0],t)}function pPe(e,t){var r=!0;return xs(e,function(n){xs(t,function(o){if(r===!1)return!1;r=dPe(n.geometry,o.geometry)})}),r}function dPe(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return!yPe(e.coordinates,t.coordinates);case"LineString":return!OX(t,e);case"Polygon":return!cl(e,t)}break;case"LineString":switch(t.type){case"Point":return!OX(e,t);case"LineString":return!fPe(e,t);case"Polygon":return!EX(t,e)}break;case"Polygon":switch(t.type){case"Point":return!cl(t,e);case"LineString":return!EX(e,t);case"Polygon":return!mPe(t,e)}}return!1}function OX(e,t){for(var r=0;r<e.coordinates.length-1;r++)if(hPe(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}function fPe(e,t){var r=em(e,t);return r.features.length>0}function EX(e,t){for(var r=0,n=t.coordinates;r<n.length;r++){var o=n[r];if(cl(o,e))return!0}var i=em(t,gS(e));return i.features.length>0}function mPe(e,t){for(var r=0,n=e.coordinates[0];r<n.length;r++){var o=n[r];if(cl(o,t))return!0}for(var i=0,s=t.coordinates[0];i<s.length;i++){var a=s[i];if(cl(a,e))return!0}var l=em(gS(e),gS(t));return l.features.length>0}function hPe(e,t,r){var n=r[0]-e[0],o=r[1]-e[1],i=t[0]-e[0],s=t[1]-e[1],a=n*s-o*i;return a!==0?!1:Math.abs(i)>=Math.abs(s)?i>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:s>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}function yPe(e,t){return e[0]===t[0]&&e[1]===t[1]}var _X=pPe;function lO(e,t){var r=!1;return xs(e,function(n){xs(t,function(o){if(r===!0)return!0;r=!_X(n.geometry,o.geometry)})}),r}var AX=20,Wc,rd,nd,vS,Db,bS=class{constructor(t){m(this,"dirty",!0);m(this,"map");m(this,"stylesheetId","");m(this,"userHiddenLayers",new Set);m(this,"hiddenLayersInStyle",new Set);m(this,"centerPoint");m(this,"bbox");m(this,"polygons");m(this,"handleRender",async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(c(this,Wc)&&(c(this,vS).call(this),_(this,Wc,!1)),this.centerPoint){let t=this.map.project(this.centerPoint),r=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});if(r.length>0){for(let n of r)this.expr.push(["!=",["id"],n.id]);this.expr.length>0&&this.hiddenLayersInStyle.forEach(n=>{this.map.setFilter(n,["all",...this.expr])}),this.expr=[],_(this,Wc,!1),this.dirty=!1}}else if(this.bbox&&this.polygons){let t=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(t.length>0){_(this,Wc,!0);for(let r=0;r<t.length;r+=AX){let n=t.slice(r,r+AX);c(this,rd).push(()=>{for(let o of n)if(o.geometry!=null&&"coordinates"in o.geometry){if(this.polygons==null)return;let i;if(o.geometry.type==="Polygon"?i=n0(o.geometry.coordinates):o.geometry.type==="MultiPolygon"&&(i=gE(o.geometry.coordinates)),!i)continue;for(let s of this.polygons)if(lO(s,i)){this.expr.push(["!=",["id"],o.id]);continue}}})}c(this,Db).call(this)}}}});m(this,"expr",[]);M(this,Wc,!1);M(this,rd,[]);M(this,nd,null);M(this,vS,()=>{c(this,nd)&&(globalThis.cancelAnimationFrame(c(this,nd)),_(this,nd,null)),_(this,rd,[])});M(this,Db,()=>{let t=c(this,rd).pop();typeof t=="function"&&(t(),c(this,rd).length>0&&_(this,nd,globalThis.requestAnimationFrame(c(this,Db)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(r=>{this.map.setFilter(r,["all",...this.expr])}),this.dirty=!1),this.expr=[],_(this,Wc,!1)});m(this,"handleStyleChange",t=>{var r,n;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let o=(n=(r=t==null?void 0:t.style)==null?void 0:r.stylesheet)==null?void 0:n.id;(!o||o!==this.stylesheetId)&&(this.stylesheetId=o,this.filterStylesInMap(),this.dirty=!0)}});t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,r){this.centerPoint=t;for(let n of r)this.userHiddenLayers.add(n);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,r,n){this.bbox=t,this.polygons=r.reduce((o,i)=>{if(i.geometry.type==="Polygon"){let s=n0(i.geometry.coordinates);o.push(s)}else i.geometry.type==="MultiPolygon"&&o.push(...i.geometry.coordinates.map(s=>n0(s)));return o},[]);for(let o of n)this.userHiddenLayers.add(o);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};Wc=new WeakMap,rd=new WeakMap,nd=new WeakMap,vS=new WeakMap,Db=new WeakMap;p();p();p();var cO="attribute float pathDistance;\nattribute vec3 pathNormal;\nattribute vec3 pathTangent;\n\nuniform vec2 uvScale;\nuniform float vertexes;\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform float nearZoom;\nuniform float farZoom;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform vec2 cameraParameters;\nuniform float flattenFactor;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main() {\n fragPathDistance = pathDistance;\n\n // We can get an origin point for the cross-section of the path by\n // subtracting the surface normal times the radius, since the surface normal\n // points strictly away from the centre.\n vec3 origin = position - nearRadius * normal;\n\n // Inflate the path along its surface normal to increase its radius from\n // `nearRadius` to `farRadius` when the camera is at `farZoom`.\n vec3 adjustedPosition = position;\n zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);\n adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;\n\n // Determine how far the path extends \"up\" or \"down\" in the direction of the\n // path normal.\n float height = dot(adjustedPosition - origin, pathNormal);\n\n // Flatten the bottom half of the path entirely so that it's flat\n // against the floor. This makes the path look nicer when it's\n // semitransparent behind opaque geometry, so you don't see it\n // peeking through.\n float desiredHeight = max(height, 0.0);\n\n desiredHeight = desiredHeight * flattenFactor;\n\n float flattenMagnitude = height - desiredHeight;\n adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;\n\n // Transform the vertices into NDC.\n vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n fragTexcoord = uv;\n\n // Compute a texture coordinate for mapping the arrow texture to the path.\n // We don't want to use the u-value that Three.js provides, because the\n // path may end up twisting arbitrarily -- but we want the arrow texture to\n // always be on the top of the path.\n vec3 bitangent = cross(normal, pathTangent);\n fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;\n\n radius = mix(nearRadius, farRadius, zoomLevel);\n}\n";var uO='#define ARROW_FADING_POINT 0.15\n\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform float opacityMultiplier;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of `pathRadius`. Since we\'ve\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered "long", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered "short", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path\'s length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // Compute the opacity of the path based on the distance from the current\n // fragment to the `complete` value as it varies from 0.0 to 1.0.\n // Fragments that are at the `complete` value or past it will be fully\n // transparent, while fragments that are at `complete - completeLength`\n // or before it will be fully opaque. However, we adjust the `complete`\n // value here so that it overshoots by one full `completeLength`, so that\n // the entire path will be opaque when the `complete` value is at 1.0.\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n // Push in the texture coordinates so that they ramp up\n // at `arrowMargin` instead of at zero; this remapping looks somewhat\n // like this:\n // 1 ^ ___\n // | /\n // | /\n // | /\n // | /\n // |___/\n // 0 +---------->\n // 0 ^ 1\n // arrowMargin\n // Making the arrows narrower on the path.\n float u = fragTopTextureU;\n u = clamp(\n u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n 0.0,\n 1.0\n );\n\n float arrowSpacing = clampRemap(\n pathLength,\n shortPathLength * radius,\n longPathLength * radius,\n arrowSpacingOnShortPath,\n arrowSpacingOnLongPath\n );\n\n // Reduce the spacing between arrows when the camera zooms out, as increasing\n // the path radius will increase the arrow size and thus be able to fit\n // fewer arrows on in total, and this secondary movement of the arrows\n // "zooming off" the end of the path is unpleasant\n float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n float effectiveArrowSpacing =\n arrowSpacing * 1.0 / expandAmount +\n arrowMargin * 2.0;\n\n float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n // Adjust the slope of the vertical texture coordinate so that it goes\n // from 0 to 1 along the length of the arrow plus the spacing between\n // arrows, and adjust its x-intercept so that one arrow moves to the\n // exact position of the next arrow as `arrowAnimationTimer` goes\n // from 0 to 1\n float v = (\n fragTexcoord.x * (pathLength / effectiveArrowLength)\n - arrowAnimationTimer * (1. + effectiveArrowSpacing)\n );\n\n // Compute a "looping sawtooth" wave for determining the vertical texture\n // coordinates of the arrow texture, roughly as follows:\n // 3 ^ /\n // | ___/\n // 2 | /\n // | ___/\n // 1 | /\n // |___/\n // 0 +--------------->\n // 0 ^ ^\n // ^ |_|\n // | effectiveArrowLength\n // |___|\n // effectiveArrowSpacing\n //\n // This is effectively equivalent to this sort of sawtooth wave:\n // ^\n // 1 | / / /\n // |___/ ___/ ___/\n // 0 +--------------->\n //\n // Causing the image of the arrow to repeat, with dead space (the bottom\n // edge of the texture stretched out) between the arrows at the provided\n // spacing. The reason why the "looping" design is preferred is because\n // it takes advantage of WebGL\'s `GL_REPEAT` texture wrapping behaviour\n // to avoid the discontinuity that can end up causing visual artifacts.\n if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n } else {\n v = ceil(v / (1. + effectiveArrowSpacing));\n }\n\n // Use the r-component of the texture to determine whether the arrow covers\n // this fragment or not\n vec2 sampleTexcoord = vec2(u, v);\n float arrowAmount = 0.0;\n vec3 secondColor = pulseColor;\n\n if (displayArrowsOnPath) {\n arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);\n secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));\n }\n\n if (showPulse) {\n // Add the pulse color to the path by determining how far the current fragment\n // is from `pulse`\n float pulseLocation = remap(\n pulse,\n 0.0,\n 1.0,\n -pulseLength,\n 1.0 + pulseLength\n );\n float pulseDistance = smoothstep(\n 0.0,\n pulseLength,\n abs(fragPathDistance - pulseLocation)\n );\n\n // Blend the pulse color to the path based on how close this fragment is to\n // the `pulse` value and whether it\'s covered by an arrow -- but if it\'s\n // covered by *both*, then we go back to using the regular path color\n // (making arrows look like "holes" when they\'re overlapping the pulse.)\n float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);\n } else if (displayArrowsOnPath) {\n gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);\n } else {\n gl_FragColor = vec4(color, opacity * opacityMultiplier);\n }\n #include <colorspace_fragment>\n}';var kX="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 xPe=new Td;function DX(e,t,r){let{nearRadius:n,farRadius:o,accentColor:i,completeFraction:s,isVertical:a}=t,{color:l}=r,u=!0,d=0,f=1/0,h=t.displayArrowsOnPath,b=!a,v=!0,I=h,x=n/2+IPe,C=0;e[0].z+=x;for(let te=1;te<e.length;++te){e[te].z+=x;let ie=e[te].x-e[te-1].x,A=e[te].z-e[te-1].z;if(a)C+=Math.sqrt(ie*ie+A*A);else{let Y=e[te].y-e[te-1].y;C+=Math.sqrt(ie*ie+Y*Y+A*A)}}if(!a){let te=e[0],ie=e[e.length-1];e.push(ie.clone().setZ(ie.z-.01)),e.unshift(te.clone().setZ(te.z-.01))}let P=new YO;I&&(P=xPe.load(kX),P.colorSpace=Sa);let w=new Ft(l),T=new Ft(i),O={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new Ee(1,1)},cameraParameters:{type:"v2",value:new Ee(d,0)},complete:{type:"f",value:u?0:1},color:{type:"c",value:w},pathLength:{type:"f",value:C},nearRadius:{type:"f",value:n},farRadius:{type:"f",value:o},nearZoom:{type:"f",value:d},farZoom:{type:"f",value:f},pulseColor:{type:"c",value:T},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:a},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:P},displayArrowsOnPath:{type:"b",value:h},flattenFactor:{type:"f",value:b?.05:1},showPulse:{type:"b",value:v},opacityMultiplier:{type:"f",value:1}},N=new oE(e);N.curveType="catmullrom",N.tension=0;let k=30,D=8,F=k*e.length,z=new iE(N,F,n,D,!1),G=new Float32Array(z.attributes.position.count);for(let te=e.length;te<G.length;te++)G[te]=te;z.setAttribute("vertexIndex",new Ta(G,1));let j=new Float32Array(z.attributes.position.count),K=new Ta(j,1);for(let te=0;te<=F;te++)for(let ie=0;ie<=D;++ie)K.setX(te*(D+1)+ie,te/F);z.setAttribute("pathDistance",K);let Z=new Float32Array(z.attributes.normal.count*3),oe=new Ta(Z,3);for(let te=0;te<F;te++){let ie=z.tangents[te];for(let A=0;A<=D;++A)oe.setXYZ(te*(D+1)+A,ie.x,ie.y,ie.z)}z.setAttribute("pathTangent",oe);let Q=new Float32Array(z.attributes.normal.count*3),ye=new Ta(Q,3);for(let te=0;te<F;te++){let ie=z.tangents[te];var be,ue,_e;a?(be=ie.x*ie.y,ue=-1+ie.y*ie.y,_e=ie.z*ie.y):(be=-ie.x*ie.z,ue=-ie.y*ie.z,_e=1-ie.z*ie.z);let A=Math.sqrt(be*be+ue*ue+_e*_e);A===0&&(A=1);let Y=be/A,L=ue/A,le=_e/A;for(let ne=0;ne<=D;++ne)ye.setXYZ(te*(D+1)+ne,Y,L,le)}z.setAttribute("pathNormal",ye);let ht=new pu({uniforms:O,vertexShader:cO,fragmentShader:uO});ht.transparent=!0,ht.alphaTest=.5,O.resolution.value.x=1,O.resolution.value.y=1,O.vertexes.value=G.length,O.arrowTexture.value.wrapS=ms,O.arrowTexture.value.wrapT=ms,O.arrowTexture.value.anisotropy=16,O.complete.value=s;let ot=new Ve(z,ht),Xe=ot.clone(),Ue={...O,opacityMultiplier:{type:"f",value:.25}};Ue.complete.value=1,Xe.material=new pu({uniforms:Ue,vertexShader:cO,fragmentShader:uO}),Xe.material.transparent=!0,Xe.material.alphaTest=.5,Xe.material.depthWrite=!1,Xe.material.depthTest=!1,Xe.renderOrder=1,Ue.resolution.value.x=1,Ue.resolution.value.y=1,Ue.vertexes.value=G.length,Ue.arrowTexture.value.wrapS=ms,Ue.arrowTexture.value.wrapT=ms,Ue.arrowTexture.value.anisotropy=16,Ue.complete.value=s,ot.userData=Xe.userData=t.mesh.userData;let pe=t.mesh;pe.add(ot),pe.add(Xe),z.computeBoundingBox();let me=new Ce;return z.boundingBox.getCenter(me),{mesh:pe,material:ht,center:me}}var IPe=.15;var Fb=class extends De{constructor(r,n,o,i){super();m(this,"rendererState");m(this,"altitudeDirty",!0);m(this,"convertTo3DMapPosition");m(this,"getParentContainer");m(this,"convertZoomLevelToAltitude");this.rendererState=r,this.convertTo3DMapPosition=n,this.getParentContainer=o,this.convertZoomLevelToAltitude=i}update(r,n,o){let i,s=!1;for(let a of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(a),i&&i.type==="path"&&i.components[0].type==="path"){let l=i.components[0],u=i.components[1],d=l.isVertical&&this.altitudeDirty;if(!(l instanceof Vc))continue;if(l.dirty||d){if(l.mesh.parent!=null)for(let h=l.mesh.children.length-1;h>=0;h--)fr(l.mesh.children[0]);let f=[];if(l.feature.features.forEach(h=>{let b=h.geometry.coordinates[2]||0,v;if(h.properties.parentId&&(v=this.getParentContainer(h.properties.parentId,!0),v!=null&&v.altitude!=null&&(b+=v.altitude,l.isVertical=!0)),!h.properties.parentId||v!=null&&v.visible){let I=this.convertTo3DMapPosition(h.geometry.coordinates[1],h.geometry.coordinates[0],b);f.push(I)}}),f.length>1){let{mesh:h,material:b,center:v}=DX(f,l,{color:u.color});l.mesh=h,l.material=b,l.position=v}l.dirty&&(l.nearZoomLevel!=null&&(l.nearZoomAltitude=this.convertZoomLevelToAltitude(l.nearZoomLevel)),l.farZoomLevel!=null&&(l.farZoomAltitude=this.convertZoomLevelToAltitude(l.farZoomLevel))),l.dirty=!1}u.dirty&&(l.mesh.children.forEach(f=>{f.material.uniforms.color.value.set(u.color),f.material.needsUpdate=!0}),l.mesh.position.z=u.altitude,u.dirty=!1),l.material&&(l.mesh.children.forEach(f=>{var b,v;let h=f.material.uniforms;h.nearZoom.value=(b=l.nearZoomAltitude)!=null?b:r,h.farZoom.value=(v=l.farZoomAltitude)!=null?v:n,h.cameraParameters.value.x=o,l.materialDirty&&(h.nearRadius.value=l.nearRadius,h.displayArrowsOnPath.value=l.displayArrowsOnPath,h.farRadius.value=l.farRadius,h.pulseColor.value.set(l.accentColor),h.complete.value=l.completeFraction),f.material.needsUpdate=!0}),l.displayArrowsOnPath&&l.animateArrowsOnPath&&(l.mesh.children.forEach(f=>{f.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,f.material.needsUpdate=!0}),s=!0),l.materialDirty=!1)}this.altitudeDirty=!1,s&&this.publish("animate:path")}};p();var Zr,Ym,Pl,xS=class{constructor(t){m(this,"rendererState");m(this,"dirty",!1);M(this,Zr);M(this,Ym);M(this,Pl);this.rendererState=t}updateOne(t){if(t instanceof Tt&&t.components[0]instanceof hr&&t.components[1]instanceof Is&&t.parentObject3D instanceof In&&(_(this,Zr,t.components[0]),_(this,Pl,t.components[1]),c(this,Zr).detached&&c(this,Zr).dirty&&c(this,Zr).geometry!=null&&c(this,Zr).material!=null)){_(this,Ym,t.parentObject3D),c(this,Zr).visible=!1;let r=new Ft(c(this,Pl).color),n=c(this,Pl).opacity*yu(t),o=new Wp({color:r,side:Ia,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,c(this,Zr).material.repeatYFactor),i=new o0(1,c(this,Zr).geometry.attributes.position.count||0,0,o),s=i.addGeometry(c(this,Zr).geometry);i.addInstance(s),i.userData={entities:{0:t.id},detached:!0},c(this,Zr).instanceIndex=s,c(this,Zr).material.setColor(c(this,Zr).instanceIndex,r,c(this,Pl).topColor?new Ft(c(this,Pl).topColor):r),c(this,Zr).mesh=i,c(this,Zr).material=o,c(this,Ym).add(i),c(this,Zr).dirty=!1}}update(){if(!this.dirty)return;let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){_(this,Zr,void 0),_(this,Ym,void 0),_(this,Pl,void 0)}};Zr=new WeakMap,Ym=new WeakMap,Pl=new WeakMap;p();p();function FX(e,t,r){var n;if(e.geometry!=null){let o=t||1e-4,i=o/e.currentHeight,s=o/r;e.geometry.scale(1,1,i),e.material&&(e.material.repeatYFactor=s),(n=e.mesh)==null||n.setGeometryAt(e.instanceIndex,e.geometry),e.currentHeight=o}}var od,qc,IS=class{constructor(t){m(this,"rendererState");m(this,"dirty",!1);M(this,od);M(this,qc);this.rendererState=t}updateOne(t){var r;t instanceof Tt&&t.type==="geometry"&&((r=t.components[1])!=null&&r.dirty)&&(_(this,od,t.components[0]),_(this,qc,t.components[1]),t.type==="geometry"&&c(this,qc).height!==c(this,od).currentHeight&&FX(c(this,od),c(this,qc).height,c(this,qc).initialHeight))}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.cleanup()}cleanup(){_(this,od,void 0),_(this,qc,void 0)}};od=new WeakMap,qc=new WeakMap;p();var SPe={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},SS=class{constructor(t){m(this,"state",SPe);m(this,"core");this.core=t}update(t){let r={};for(let[n,o]of Object.entries(t))n in this.state&&this.state[n]!==t[n]&&(this.state[n]=o,r[n]=o);this.handleUpdate(r)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap!=null&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),t.showCollisionBoxes!=null&&(t.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};p();var Lb=9,CPe=!1,LX=.1;function PPe(e,t,r){for(let n=0;n<t;n++){let o=(r&16711680)>>16,i=(r&65280)>>8,s=r&255;e[n*3]=o/255,e[n*3+1]=i/255,e[n*3+2]=s/255}}var CS=class{constructor(t,r,n){m(this,"state");m(this,"renderer");m(this,"renderService");m(this,"pickingTexture");m(this,"pickingMaterial");m(this,"pixelBuffer");m(this,"width",0);m(this,"height",0);m(this,"scale",1/2);m(this,"color",1);m(this,"convertTo3DMapPosition");m(this,"destroyed",!1);m(this,"enabled",!1);m(this,"backgroundId",16777215);m(this,"resize",()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new JO(this.width,this.height,{format:X1,type:WO,internalFormat:"RGBA"})});m(this,"shouldShowByXY",(t,r,n)=>{if(this.pixelBuffer==null)return!1;let o=t+(this.height-r-1)*this.width,i=this.pixelBuffer[o*4],s=this.pixelBuffer[o*4+1],a=this.pixelBuffer[o*4+2],l=i<<16|s<<8|a;return l===n||l===this.backgroundId});m(this,"activeOccluders",new Set);m(this,"update",()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,r;for(let o of this.state.geometry3DIdsInScene){let i=this.state.geometry3DMap.get(o);if(i&&i instanceof at&&i.userData.occluderFeature!=null&&i.userData.occluderId!=null&&(this.activeOccluders.add(i.userData.occluderId),i.userData.occluderDirty)){if(t=i.userData.occluderFeature,t.geometry.type==="Polygon"){let s=RI(t,this.convertTo3DMapPosition,{color:"white",height:LX});r=this.createOccluderMesh(s,i.userData.occluderId),i.add(r)}else if(t.geometry.type==="MultiPolygon"){let s=NI(t,this.convertTo3DMapPosition,{color:"white",height:LX});r=this.createOccluderMesh(s,i.userData.occluderId),i==null||i.add(r)}i.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new Ft(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(Lb),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(Lb),CPe?this.renderService.enabledLayers.add(Lb):this.renderService.enabledLayers.delete(Lb),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let o of this.state.geometry2DIdsInScene){let i=this.state.geometry2DMap.get(o);if(i&&(i==null?void 0:i.occluderId)!=null&&this.activeOccluders.has(i==null?void 0:i.occluderId)){let s=i.components[0].projection,a=Math.floor(s.x*this.scale),l=Math.floor(s.y*this.scale),u=this.shouldShowByXY(a,l,i.occluderId);i.components[0].isOccluded=!u}}})});if(this.state=t,this.convertTo3DMapPosition=r,(n==null?void 0:n.renderer)==null)throw new Error("No Renderer");this.renderService=n,this.renderer=n.renderer,this.resize(),this.pickingMaterial=new pu({glslVersion:XO,vertexShader:"\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec3 vColor;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(vColor, 1.0);\n }\n "})}applyId(t,r){let n=t.attributes.position,o=new Float32Array(n.count*3);PPe(o,n.count,r),t.setAttribute("color",new Ta(o,3))}createOccluderMesh(t,r){let n=new Ve(t,this.pickingMaterial);return n.layers.set(Lb),this.applyId(n.geometry,r),n.userData.occluderId=r,n}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var t;this.destroyed=!0,(t=this.pickingTexture)==null||t.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};var RX=new gs;var{DEFAULT_PITCH:hO,DEFAULT_BEARING:yO,DEFAULT_ZOOM_LEVEL:gO,DEFAULT_MIN_ZOOM_LEVEL:TPe,DEFAULT_MAX_ZOOM_LEVEL:wPe}=Ii,MPe=Ye.radToDeg(.6435011087932844),Tr,xr,id,Rb,Km,Zc,sd,Jm,bn,dO,V,jt,ns,Ir,fa,tn,U,Nb,Rr,Ht,NX,BX,$X,Xc,Bb,$b,jb,Gb,PS,Ub,Vb,zb,Qm,fO,ad,Hb,no,oo,mO,eh,Wb,pO=class extends De{constructor(r,n={}){var h,b,v,I,x,C,P,w,T,O,N;super();M(this,bn);m(this,"options");m(this,"container");m(this,"Debug");M(this,Tr);M(this,xr);M(this,id);M(this,Rb);M(this,Km);M(this,Zc);M(this,sd);M(this,Jm);m(this,"rendererDomElement");M(this,V,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new at("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:Sh,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new W5,cameraObject:new zS,naturalBearing:0,containerOffset:[0,0]});m(this,"camera");M(this,jt);M(this,ns);M(this,Ir);M(this,fa);M(this,tn);M(this,U,{});M(this,Nb,window.matchMedia("screen and (min-resolution: 2dppx)"));m(this,"map");M(this,Rr,()=>{c(this,U).renderSystem.twoDdirty=!0});M(this,Ht,()=>{c(this,U).renderSystem.threeDdirty=!0});M(this,Xc,"standalone");M(this,Bb,r=>Math.trunc(r*10)/10);M(this,$b,()=>{c(this,U).twoDDrawSystem.dirty=!0,ee(this,bn,dO).call(this,Od()),c(this,U).watermarkSystem.dirty=!0,c(this,U).occlusion2DSystem.resize(),this.render()});M(this,jb,()=>{c(this,Gb).call(this)});M(this,Gb,(r,n)=>{let o=r!=null?r:this.rendererDomElement.clientWidth,i=n!=null?n:this.rendererDomElement.clientHeight;if(o===0||i===0)return;c(this,V).canvasWidth=o,c(this,V).canvasHeight=i,ee(this,bn,dO).call(this,Od()),c(this,Qm).call(this),ee(this,bn,$X).call(this),c(this,U).cameraSystem.resize(this.canvasWidth,this.canvasHeight),c(this,U).cameraSystem.dirty=!0,c(this,U).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),c(this,U).htmlControlsSystem.resize(this.canvasWidth),c(this,U).geometryInFocusSystem.resize(),c(this,U).occlusion2DSystem.resize();let{top:s,left:a}=this.container.getBoundingClientRect();c(this,V).containerOffset=[s,a],this.publish("resize"),this.render()});M(this,PS,()=>{this.renderSync()});M(this,Ub,new Ce);M(this,Vb,(r,n)=>{let o=this.mode==="standalone"?c(this,xr):this.viewCamera;if(c(this,xr).position.z+this.camera.elevation>n.z){c(this,Ub).copy(n);let i=c(this,Ub).project(o),s=(i.x+1)/2*this.canvasWidth-0/2,a=(-i.y+1)/2*this.canvasHeight-0/2,l=c(this,Bb).call(this,s),u=c(this,Bb).call(this,a);r.x=l,r.y=u}else r.x=-1e3,r.y=-1e3});M(this,zb,(r,n)=>{c(this,tn).setBufferSize(r,n),c(this,xr).aspect=r/n,c(this,xr).updateProjectionMatrix(),c(this,xr).updateMatrixWorld(!0),c(this,Km).x=r,c(this,Km).y=n});M(this,Qm,()=>{var s;let r=c(this,V).canvasWidth=this.rendererDomElement.clientWidth,n=c(this,V).canvasHeight=this.rendererDomElement.clientHeight,o=Math.floor(r*this.resolutionScale),i=Math.floor(n*this.resolutionScale);c(this,zb).call(this,o,i),(s=this.map)==null||s.resize(),c(this,V).shouldMeasureCanvas=!1});m(this,"getParentContainer",(r,n=!0)=>{if(!r)return n?c(this,V).entityScene:void 0;if(typeof r=="string"||typeof r=="number"){let o=c(this,V).geometry3DMap.get(r);return o instanceof at?o:($.warn("Parent (".concat(typeof r=="object"?r.id:r,") is not a valid container, adding to scene")),n?c(this,V).entityScene:void 0)}else if(r.type==="group-container"){let o=c(this,V).geometry3DMap.get(r.id);if(o instanceof at)return o}return n?c(this,V).entityScene:void 0});m(this,"showCollisionBoxes",()=>{c(this,U).collisionSystem.showCollisionBoxes(),this.render()});m(this,"hideCollisionBoxes",()=>{c(this,U).collisionSystem.hideCollisionBoxes(),this.render()});m(this,"projectScreenXYToCoordinate",(r,n,o=!1)=>{var h,b;let i=c(this,V).containerOffset[0],s=c(this,V).containerOffset[1],a=(r-s)/c(this,V).canvasWidth*2-1,l=-((n-i)/c(this,V).canvasHeight)*2+1,u=new Ee(a,l),d,f;if(o)RX.setFromCamera(u,c(this,xr)),d=(h=RX.intersectObject(c(this,Zc),!1)[0])==null?void 0:h.point;else{let v=c(this,U).interactionSystem.getThreeDIntersectsFromXY(u);d=(b=v==null?void 0:v[0])==null?void 0:b.point,f=c(this,U).interactionSystem.getGroupContainerIntersectsFromXY(u)}if(d)return{coordinate:this.convert3DMapPositionToCoordinate(d),groupContainers:f}});m(this,"projectCoordinateToScreenXY",r=>{let n=this.convertTo3DMapPosition(r[1],r[0],r[2]||0),o=new Ee;return c(this,Vb).call(this,o,n),{x:o.x,y:o.y}});m(this,"convert3DMapPositionToCoordinate",r=>{var i,s,a,l;let{lat:n,lon:o}=i0((s=(i=c(this,V).center)==null?void 0:i[1])!=null?s:0,(l=(a=c(this,V).center)==null?void 0:a[0])!=null?l:0,r.x,r.y);return[o,n,r.z]});m(this,"setBackgroundColor",(r,n)=>{c(this,tn).setBackgroundColor(r,n)});m(this,"getMetresPerPixel",()=>{let r=this.container.clientWidth,n=this.container.clientHeight/2,o=this.projectScreenXYToCoordinate(0,n,!0),i=this.projectScreenXYToCoordinate(r,n,!0);return o==null||i==null?void 0:t0(o.coordinate,i.coordinate)/r});m(this,"hideOutdoorLayersUnderPoint",(r,n)=>{!this.map||(n==null?void 0:n.length)===0||(c(this,U).outdoorLayersSystem.hideLayersUnderPoint(r,n),this.render())});m(this,"hideOutdoorLayersIntersectingPolygons",(r,n,o)=>{c(this,U).outdoorLayersSystem.hideLayersIntersectingPolygons(r,n,o),this.render()});M(this,ad,new nE);M(this,Hb,new Ci);m(this,"render",()=>{var r;if(((r=c(this,U))==null?void 0:r.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return c(this,U).renderSystem.update()});m(this,"renderSync",()=>c(this,U).renderSystem.update(!0));M(this,no,Ed(()=>{this.publish("user-interaction-start",void 0)},0,!0));M(this,oo,Ed(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));m(this,"on",(r,n)=>{super.on(r,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(r)&&this.mode==="standalone"&&g.env.NODE_ENV!=="test"&&($.warn('"'.concat(r,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(r))});m(this,"off",(r,n)=>{super.off(r,n)});m(this,"getCursor",()=>c(this,U).interactionSystem.getCursor());m(this,"destroy",()=>{var r;c(this,U)&&(c(this,U).cameraSystem.off("user-dolly-start",c(this,no)),c(this,U).cameraSystem.off("user-pan-start",c(this,no)),c(this,U).cameraSystem.off("user-rotate-start",c(this,no)),c(this,U).cameraSystem.off("user-zoom-start",c(this,no)),c(this,U).cameraSystem.off("user-tilt-start",c(this,no)),c(this,U).cameraSystem.off("user-pedestal-start",c(this,no)),c(this,U).cameraSystem.off("user-dolly-end",c(this,oo)),c(this,U).cameraSystem.off("user-pan-end",c(this,oo)),c(this,U).cameraSystem.off("user-rotate-end",c(this,oo)),c(this,U).cameraSystem.off("user-zoom-end",c(this,oo)),c(this,U).cameraSystem.off("user-tilt-end",c(this,oo)),c(this,U).cameraSystem.off("user-pedestal-end",c(this,oo)),c(this,U).renderSystem.off("measure-canvas",c(this,Qm)),c(this,U).meshOptimizationSystem.off("geometry-2d-added",this.render),c(this,U).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),c(this,Rr).call(this),c(this,Ht).call(this),this.renderSync(),c(this,U).renderSystem.destroy(),c(this,U).cameraSystem.off("change",this.render),c(this,U).pathSystem.off("animate:path",this.render),c(this,U).cameraSystem.dispose(),c(this,U).exporterSystem.destroy(),c(this,U).outdoorLayersSystem.destroy(),c(this,U).drawSystem.destroy(),window.removeEventListener("resize",c(this,jb),!1),c(this,Nb).removeEventListener("change",c(this,$b)),c(this,sd)&&c(this,sd).disconnect(),this._subscribers={},c(this,tn).destroy(),(r=c(this,Tr))==null||r.traverse(n=>{fr(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),_(this,Tr,void 0),c(this,U).htmlControlsSystem.destroy(),c(this,U).collisionSystem.destroy(),c(this,U).interactionSystem.destroy(),c(this,U).domMutationSystem.destroy(),c(this,U).geometryInFocusSystem.destroy(),_(this,U,void 0),c(this,Xc)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(c(this,fa)),this.container.removeChild(c(this,jt)),_(this,tn,void 0))});M(this,eh,new Ce);M(this,Wb,new Ce);if(c(this,V).naturalBearing=(h=n.naturalBearing)!=null?h:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!r.clientWidth||!r.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(n.mode==="outdoors-interleaved"||n.mode==="outdoors-overlay")&&n.map&&(_(this,Xc,n.mode),this.map=n.map),c(this,V).entityScene.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),c(this,V).entityScene.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),c(this,V).geometry3DMap.set(c(this,V).entityScene.userData.entityId,c(this,V).entityScene),n.center&&(c(this,V).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=r,ee(this,bn,NX).call(this),ee(this,bn,BX).call(this),c(this,U).htmlControlsSystem=new lS(this.container),c(this,Xc)!=="outdoors-overlay"&&c(this,U).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),g.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),_(this,tn,new Q2({antialias:typeof n.antialias=="boolean"?n.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(b=n.gl)==null?void 0:b.canvas:void 0,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:k=>{var D;(D=n.onWebGLContextRestored)==null||D.call(n,k),c(this,Rr).call(this),c(this,Ht).call(this),this.render()},onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(v=n.backgroundAlpha)!=null?v:1})),_(this,Tr,new Vl),c(this,Tr).add(c(this,V).entityScene);let o=window.__THREE_DEVTOOLS__;g.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:c(this,Tr)})),o.dispatchEvent(new CustomEvent("observe",{detail:c(this,tn)}))),_(this,xr,new zS(MPe,this.aspect,50,1e5)),c(this,V).cameraObject=c(this,xr),_(this,Rb,new tE),c(this,xr).renderOrder=999;let i=new Pa;i.add(c(this,xr)),_(this,Jm,new Pa),c(this,Jm).add(i),c(this,Tr).add(c(this,Jm)),c(this,xr).updateProjectionMatrix(),c(this,xr).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=c(this,tn).domElement(),_(this,Km,new Ee);let s=new Ti(1e6,1e6),a=new Br({color:0,visible:!1});_(this,Zc,new Ve(s,a)),c(this,Zc).name="worldPlane",c(this,Tr).add(c(this,Zc)),(I=n.gl)!=null&&I.canvas||r.appendChild(this.rendererDomElement),window.addEventListener("resize",c(this,jb),!1),c(this,Nb).addEventListener("change",c(this,$b)),typeof ResizeObserver=="function"&&((x=g.env)==null?void 0:x.NODE_ENV)!=="test"&&(_(this,sd,new ResizeObserver(TE(k=>{c(this,Gb).call(this,k[0].contentRect.width,k[0].contentRect.height)},50))),(C=c(this,sd))==null||C.observe(r)),r.classList.add("mappedin-map"),this.rendererDomElement.style.width=(P=globalThis.MappedinDebug)!=null&&P.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(w=globalThis.MappedinDebug)!=null&&w.TEST_IOS?"1920px":"100%",g.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),c(this,V).canvasWidth=this.rendererDomElement.clientWidth,c(this,V).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let l=this.canvasWidth,u=this.canvasHeight;c(this,U).watermarkSystem=new oS(c(this,xr),c(this,V),n==null?void 0:n.watermark),c(this,U).watermarkSystem.on("texture-loaded",this.render),c(this,V).shouldMeasureCanvas=!0,c(this,V).pixelRatio=this.resolutionScale,c(this,zb).call(this,Math.floor(l*this.resolutionScale),Math.floor(u*this.resolutionScale));let d=new Q1(16777215,.3*Math.PI);d.position.set(-150,-150,350),c(this,Tr).add(d);let f=new aE(16777215,.741*Math.PI);c(this,Tr).add(f),c(this,U).cameraSystem=new Qp(c(this,xr),c(this,Tr),c(this,tn).renderer,c(this,V),{mode:this.mode,canvasHeight:u,canvasWidth:l}),c(this,U).cameraSystem.on("user-dolly-start",c(this,no)),c(this,U).cameraSystem.on("user-pan-start",c(this,no)),c(this,U).cameraSystem.on("user-rotate-start",c(this,no)),c(this,U).cameraSystem.on("user-zoom-start",c(this,no)),c(this,U).cameraSystem.on("user-tilt-start",c(this,no)),c(this,U).cameraSystem.on("user-pedestal-start",c(this,no)),c(this,U).cameraSystem.on("user-dolly-end",c(this,oo)),c(this,U).cameraSystem.on("user-pan-end",c(this,oo)),c(this,U).cameraSystem.on("user-rotate-end",c(this,oo)),c(this,U).cameraSystem.on("user-zoom-end",c(this,oo)),c(this,U).cameraSystem.on("user-tilt-end",c(this,oo)),c(this,U).cameraSystem.on("user-pedestal-end",c(this,oo)),c(this,U).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),c(this,U).geometryInFocusSystem&&(c(this,U).geometryInFocusSystem.cameraDirty=!0),this.render()}),c(this,U).pathSystem=new Fb(c(this,V),this.convertTo3DMapPosition,this.getParentContainer,c(this,U).cameraSystem.convertZoomLevelToAltitude),c(this,U).pathSystem.on("animate:path",this.render),c(this,U).panBoundsSystem=new aS(c(this,V),c(this,U).cameraSystem),c(this,U).panBoundsSystem.on("update",()=>{let{panBounds:k,fov:D,convertAltitudeToZoomLevel:F}=c(this,U).cameraSystem;if(c(this,U).panBoundsSystem.autoMinZoomLevel){if(k.radius<=0)return;let z=Math.min(c(this,V).canvasWidth/c(this,V).canvasHeight,1),G=D*Math.PI/180*z,j=Math.tan(G/2),{radius:K,center:Z}=c(this,U).cameraSystem.panBounds,oe=K/j,Q=this.getThreeCamera().getWorldPosition(new Ce),ye=Z.distanceTo(Q),be=Math.abs(Q.z-Z.z),ue=oe*be/ye,_e=F(ue);jE(_e,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(_e)}}),this.camera=new nS(this,c(this,U),c(this,V)),this.camera.setZoomLevel((T=n.zoomLevel)!=null?T:gO),this.camera.setBearing((O=n.bearing)!=null?O:yO),this.camera.setPitch((N=n.pitch)!=null?N:hO),this.camera.setMaxZoomLevel(wPe),this.camera.setMinZoomLevel(TPe),c(this,U).domVisiblitySystem=new jI(c(this,V),c(this,fa)),c(this,U).domMutationSystem=new rS(c(this,V),c(this,fa)),c(this,U).domMutationSystem.on("dimensions-update",()=>{c(this,U).collisionSystem.collidersDirty=!0,this.render()}),c(this,U).domDrawSystem=new eS(c(this,V)),c(this,U).collisionSystem=new eI(c(this,ns),c(this,V)),c(this,U).twoDDrawSystem=new UI(c(this,V),c(this,Ir),n.transformImageRequest),c(this,U).twoDDrawSystem.on("img:loaded",this.render),c(this,U).interactionSystem=new Yg(this.rendererDomElement,c(this,V),c(this,xr),c(this,Zc),c(this,U).cameraSystem.isUserInteracting),c(this,U).interactionSystem.on("doubletap-with-onefinger",k=>{var D;this.camera.animateTo({center:(D=this.projectScreenXYToCoordinate(k.clientX,k.clientY))==null?void 0:D.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:JS,easing:"ease-out"})}),c(this,U).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:JS,easing:"ease-out"})}),c(this,U).interactionSystem.on("hover",this.render),c(this,U).interactionSystem.on("click",k=>{var D,F,z,G,j,K;if(((D=k.entity2D)==null?void 0:D.id)==="watermark"&&typeof c(this,U).watermarkSystem.options.onClick=="function"&&c(this,U).watermarkSystem.options.interactive){c(this,U).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(k.position),geometry:k.entity3D?[(F=k.entity3D)==null?void 0:F.id]:[],paths:((z=k.entity3D)==null?void 0:z.components[0])instanceof Vc?[k.entity3D.id]:[],markers:((G=k.entity2D)==null?void 0:G.components[0])instanceof aa?[k.entity2D.id]:[],models:((j=k.entity3D)==null?void 0:j.components[0])instanceof Gc?[k.entity3D.id]:[],labels:((K=k.entity2D)==null?void 0:K.components[0])instanceof la?[k.entity2D.id]:[],containers:Array.isArray(k.groupContainers)?k.groupContainers.map(Z=>Z.userData.entityId):[],pointerEvent:k.pointerEvent})}),c(this,U).interactionSystem.on("hover",k=>{var D,F,z,G,j,K;k.position&&((D=k.entity2D)==null?void 0:D.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(k.position),geometry:k.entity3D?[(F=k.entity3D)==null?void 0:F.id]:[],paths:((z=k.entity3D)==null?void 0:z.components[0])instanceof Vc?[k.entity3D.id]:[],markers:((G=k.entity2D)==null?void 0:G.components[0])instanceof aa?[k.entity2D.id]:[],models:((j=k.entity3D)==null?void 0:j.components[0])instanceof Gc?[k.entity3D.id]:[],labels:((K=k.entity2D)==null?void 0:K.components[0])instanceof la?[k.entity2D.id]:[],containers:Array.isArray(k.groupContainers)?k.groupContainers.map(Z=>Z.userData.entityId):[]})}),c(this,U).geometryInFocusSystem=new yS(c(this,V),c(this,xr)),c(this,U).geometryInFocusSystem.on("geometry-in-focus",k=>{this.publish("geometry-in-focus",k)}),c(this,U).twoDVisiblitySystem=new zI(c(this,V)),c(this,U).drawSystem=new VI(c(this,V),this.convertTo3DMapPosition),c(this,U).drawSystem.on("texture-loaded",this.render),c(this,U).stackSystem=new WI(c(this,V)),c(this,U).twoDProjectionSystem=new GI(c(this,V),c(this,Vb)),c(this,U).exporterSystem=new ub(c(this,V)),c(this,U).meshOptimizationSystem=new $I(c(this,V),this.convertTo3DMapPosition),c(this,U).meshOptimizationSystem.on("model-loaded",this.render),c(this,U).meshOptimizationSystem.on("geometry-2d-added",this.render),c(this,U).meshDetachmentSystem=new xS(c(this,V)),c(this,U).meshModificationSystem=new IS(c(this,V)),c(this,U).customGeometrySystem=new cS(c(this,V),this.convertTo3DMapPosition),c(this,U).outlineInterpolationSystem=new uS(c(this,V)),c(this,U).renderSystem=new HI(c(this,tn),c(this,V),this.mode,c(this,Tr),c(this,xr),this.viewCamera,c(this,U)),c(this,U).imageSystem=new hS(c(this,V),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),c(this,U).text3DSystem=new II(c(this,V),this.convertTo3DMapPosition),c(this,U).text3DSystem.on("render",this.render),c(this,U).imageSystem.on("image-loaded",this.render),c(this,U).renderSystem.on("pre-render",()=>this.publish("pre-render")),c(this,U).renderSystem.on("post-render",()=>this.publish("post-render")),c(this,U).renderSystem.on("measure-canvas",c(this,Qm)),c(this,U).outdoorLayersSystem=new bS(this.map),c(this,U).occlusion2DSystem=new CS(c(this,V),this.convertTo3DMapPosition,c(this,tn)),n.occlusionEnabled&&c(this,U).occlusion2DSystem.enable(),this.Debug=new SS(this),n.environment!==!1&&_(this,id,ee(this,bn,mO).call(this)),c(this,PS).call(this)}get viewCamera(){return c(this,Rb)}get canvasWidth(){return c(this,V).canvasWidth}get canvasHeight(){return c(this,V).canvasHeight}get resolutionScale(){var r,n;return(n=(r=this.map)==null?void 0:r._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:Od()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return c(this,Xc)}addGroupContainer(r,n,o){if(!c(this,V).geometry3DMap.has(r)&&!c(this,V).geometry2DMap.has(r)){let i=new at(r);i.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),i.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),(n==null?void 0:n.visible)!==void 0&&(i.visible=n.visible),(n==null?void 0:n.altitude)!==void 0&&i.setAltitude(n.altitude),(n==null?void 0:n.interactive)!==void 0&&gn(i,n.interactive,c(this,V)),(n==null?void 0:n.focusable)!==void 0&&N5(i,n.focusable),c(this,V).geometry3DMap.set(r,i);let s=this.getParentContainer(o);s instanceof at&&s.addEntity(i),c(this,Ht).call(this),this.render()}else $.error("Group container with ID '".concat(r,"' already exists. The group container cannot be added."));return{id:r,type:"group-container"}}addStackContainer(r,n,o){if(c(this,V).geometry3DMap.has(r))$.error("Stack container with ID '".concat(r,"' already exists. The stack container cannot be added."));else{let i=new at(r);i.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),i.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),i.components[0]=new tS,(n==null?void 0:n.visible)!==void 0&&(i.visible=n.visible),c(this,V).geometry3DMap.set(r,i);let s=this.getParentContainer(o);s instanceof at&&s.addEntity(i)}return{id:r,type:"stack-container"}}addCustomGeometry(r,n,o,i,s){if(c(this,V).geometry3DMap.has(r))$.error("Custom geometry with ID '".concat(r,"' already exists. The custom geometry cannot be added."));else{let a=new Zm(n,o),l=new Tt(a,new Is(i));(i==null?void 0:i.interactive)!==void 0&&gn(l,i.interactive,c(this,V)),l.id=r,a.mesh.userData={entityId:r,type:"custom-geometry"},c(this,V).geometry3DMap.set(l.id,l);let u=this.getParentContainer(s);u instanceof at&&u.addEntity(l),c(this,Ht).call(this),this.render()}return{id:r,type:"custom-geometry"}}addGeometryGroup(r,n,o,i){var s,a;if(!c(this,V).geometry3DMap.has(r)&&!c(this,V).geometry2DMap.has(r)){let l=new In(r,new YS(o));l.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),l.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),l.userData.dirty=!0,c(this,V).geometry3DMap.set(r,l);for(let d of n.features){if(d.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(d.geometry.type))continue;let f=(d==null?void 0:d.id)||((s=d==null?void 0:d.properties)==null?void 0:s.id)||Et(),{visible:h,...b}=o||{color:SE},v=c(this,U).meshOptimizationSystem.createEntityFromFeature(f,d,{...b,outline:!0});c(this,V).geometry3DMap.set(f,v),l.userData.entities3D.add(f)}l.setVisible((a=o==null?void 0:o.visible)!=null?a:!0),(o==null?void 0:o.altitude)!=null&&l.setAltitude(o.altitude);let u=this.getParentContainer(i);u instanceof at&&u.addEntity(l),c(this,Ht).call(this),this.render()}else $.error("Geometry group with ID '".concat(r,"' already exists. The geometry group cannot be added."));return c(this,U).outlineInterpolationSystem.geometries3DDirty=!0,{id:r,type:"geometry-group"}}addOccluder(r,n){let o=this.getParentContainer(n),i=c(this,U).occlusion2DSystem.reserveOccluderId();return o==null||o.addOccluderFeature(r,i),i}addImage(r,n,o,i){try{PX(r,n,o)}catch(s){$.error(s);return}if(!c(this,V).geometry3DMap.has(r)&&!c(this,V).geometry2DMap.has(r)){let s=new mS(n),a=new Tt(s,new Is(o));a.id=r||Et(),s.mesh.userData={entityId:a.id,type:"path"},c(this,V).geometry3DMap.set(a.id,a);let l=this.getParentContainer(i);l instanceof at&&l.addEntity(a),c(this,Ht).call(this),this.render()}else $.error("Image with ID '".concat(r,"' already exists. The image cannot be added."));return{id:r,type:"image"}}addModelGroup(r,n,o,{parent:i,onComplete:s}={}){var a,l;try{rX(r,n,o)}catch(u){$.error(u);return}if(!c(this,V).geometry3DMap.has(r)&&!c(this,V).geometry2DMap.has(r)){let u=new In(r,new YS({...o,outline:!1}));u.addEventListener("childadded",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),u.addEventListener("childremoved",()=>{c(this,Ht).call(this),c(this,Rr).call(this)}),c(this,V).geometry3DMap.set(r,u),u.userData.dirty=!0,u.userData.modelURL=o.url;for(let f of n.features){let h=f.id||f.properties.id||Et(),b=c(this,U).meshOptimizationSystem.createModelFromFeature(h,f,o);(f.properties.interactive!==void 0||o.interactive!=null)&&gn(b,(a=f.properties.interactive)!=null?a:o.interactive,c(this,V)),c(this,V).geometry3DMap.set(h,b),u.userData.entities3D.add(h)}let d=this.getParentContainer(i);d instanceof at&&d.addEntity(u),c(this,Ht).call(this),(l=this.render())==null||l.then(s)}else $.error("Model group with ID '".concat(r,"' already exists. The model group cannot be added."));return{id:r,type:"geometry-group"}}addMarker2D(r,n,o,i){var a;let s=o==null?void 0:o.id;try{Cq(r,n,o||{})}catch(l){$.error(l);return}if(s===void 0||!c(this,V).geometry2DMap.has(s)&&!c(this,V).geometry3DMap.has(s)){let l=ee(this,bn,fO).call(this,r,new aa(n,o),o==null?void 0:o.occluderId,o==null?void 0:o.verticalOffset);l.id=s||String(l.id),s=l.id,(o==null?void 0:o.interactive)!=null&&o.interactive!=="pointer-events-auto"&&gn(l,o==null?void 0:o.interactive,c(this,V));let u=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?c(this,V).geometry3DMap.get(o.attachTo):void 0;u instanceof Tt&&u.attach(l),(a=this.getParentContainer(i))==null||a.addEntity(l),this.render()}else $.error("Marker2D with ID '".concat(s,"' already exists. The marker cannot be added."));return{id:s,type:"marker"}}addText3D(r,n,o,i){if(!c(this,V).geometry3DMap.has(r)&&!c(this,V).geometry2DMap.has(r)){let s=new Nc({...n,properties:{...n.properties,id:r,content:n.properties.text}}),a=new Tt(s,new Ph(o==null?void 0:o.appearance));a.id=r,s.mesh.userData.entityId=r.toString(),s.mesh.userData.type="text3d",c(this,V).geometry3DMap.set(r,a);let l=this.getParentContainer(i);l instanceof at&&l.addEntity(a),c(this,Ht).call(this),this.render()}else $.error("Text3D with ID '".concat(r,"' already exists. The text3d cannot be added."));return{id:r,type:"text3d"}}labelText3D(r,n,o={}){var u,d;try{if(!n||!r)throw new Error("content and meshGeometryId are required");yZ.parse(o)}catch(f){$.error(f);return}let i=c(this,V).geometry3DMap.get(r);if((i==null?void 0:i.type)!=="geometry"){$.error(".labelText3D failed: target incorrect");return}let s=i==null?void 0:i.components[0];if(!s.feature.properties.textArea)return;if(s.textEntityId){let f=c(this,V).geometry3DMap.get(s.textEntityId);if((f==null?void 0:f.type)!=="text3d"){$.error(".labelText3D failed: existing text3d not found");return}return{id:f.id,type:f.type}}let a=new Nc({type:"Feature",geometry:{coordinates:(u=s.feature.properties.textArea)==null?void 0:u.position,type:"Point"},properties:{textArea:s.feature.properties.textArea,content:n,id:Et()}});a.polygonEntityId=r;let l=new Tt(a,new Ph(o==null?void 0:o.appearance));return s.textEntityId=l.id.toString(),a.mesh.userData.entityId=l.id.toString(),a.mesh.userData.type="text3d",c(this,V).geometry3DMap.set(l.id.toString(),l),o.parentId&&((d=this.getParentContainer(o.parentId))==null||d.addEntity(l)),this.render(),{id:l.id,type:"text3d"}}addLabel2D(r,n,o,i){var a;let s=o==null?void 0:o.id;try{pZ(r,n,o||{})}catch(l){$.error(l);return}if(s===void 0||!c(this,V).geometry2DMap.has(s)&&!c(this,V).geometry3DMap.has(s)){let l=ee(this,bn,fO).call(this,r,new la(n,o||{},c(this,V)),o==null?void 0:o.occluderId,o==null?void 0:o.verticalOffset);l.id=s||String(l.id),s=l.id,(o==null?void 0:o.interactive)!=null&&gn(l,o==null?void 0:o.interactive,c(this,V));let u=typeof(o==null?void 0:o.attachTo)=="string"||typeof(o==null?void 0:o.attachTo)=="number"?c(this,V).geometry3DMap.get(o.attachTo):void 0;u instanceof Tt&&u.attach(l),(a=this.getParentContainer(i))==null||a.addEntity(l),c(this,Rr).call(this),this.render()}else $.error("Label2D with ID '".concat(s,"' already exists. The label cannot be added."));return{id:s,type:"label"}}addPath(r,n={},o){var l;try{sX(r,n||{})}catch(u){$.error(u);return}let i=new Vc(r,B5(n)),s=new Tt(i,new Is({color:(l=n==null?void 0:n.color)!=null?l:"#ff834c"}));s.id=(n==null?void 0:n.id)||Et(),i.mesh.userData={entityId:s.id,type:"path"},c(this,V).geometry3DMap.set(s.id,s),(n==null?void 0:n.interactive)!=null&&gn(s,n==null?void 0:n.interactive,c(this,V));let a=this.getParentContainer(o);return a instanceof at&&a.addEntity(s),c(this,Ht).call(this),this.render(),{id:s.id,type:"path"}}updateWatermark(r){c(this,U).watermarkSystem.options=r,c(this,U).watermarkSystem.dirty=!0,c(this,U).collisionSystem.collidersDirty=!0,this.render()}remove(r){var o;let n;if(typeof r=="string"||typeof r=="number"?(n=c(this,V).geometry2DMap.get(r),n==null&&(n=c(this,V).geometry3DMap.get(r))):typeof r.id=="string"||typeof r.id=="number"?(n=c(this,V).geometry2DMap.get(r.id),n==null&&(n=c(this,V).geometry3DMap.get(r.id))):n=r,n!=null){if(n.type==="custom-geometry")c(this,V).geometry3DMap.delete(n.id),n.object3d&&fr(n.object3d);else if(n.type==="group-container"){c(this,V).geometry3DMap.delete(n.userData.entityId);for(let s of n.childrenIds.values())this.remove(s),n.userData.entities2D.delete(s);let i=n.components[2];i&&i.focusMesh&&fr(i.focusMesh),fr(n)}else if(n.type==="geometry-group"){c(this,V).geometry3DMap.delete(n.userData.entityId);for(let i of n.userData.entities3D.values())this.remove(i),n.userData.entities3D.delete(i);fr(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let i=n.components[0];if(n.entities2D.size>0){for(let s of n.entities2D.values())this.remove(s);n.removeAllEntities()}if(n.object3d&&(((o=n.parentObject3D)==null?void 0:o.type)==="geometry-group"&&n.parentObject3D.userData.entities3D.delete(n.id),fr(n.object3d)),n.type==="geometry"){let s=n.components[3];s&&(s.visible=!1,s.dirty=!0)}"focusMesh"in i&&i.focusMesh!=null&&fr(i.focusMesh),"textMesh"in i&&i.textMesh!=null&&this.remove(i.textMesh.userData.entityId),c(this,V).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let i=n.attachedTo;if(i){let s=c(this,V).geometry3DMap.get(i);s instanceof Tt&&s.detach(n)}n.object3d&&fr(n.object3d),n.type==="label"&&delete c(this,U).twoDDrawSystem.textCache[n.id],c(this,V).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&fr(n.object3d),c(this,V).geometry3DMap.delete(n.id);else if(n.type==="text3d"){fr(n.object3d);let{batchedText:i,textMesh:s,polygonEntityId:a}=n.components[0];if(s&&(i&&i.removeText(s),fr(s)),a){c(this,U).text3DSystem.remove(a);let l=c(this,V).geometry3DMap.get(a);(l==null?void 0:l.type)==="geometry"&&(l.components[0].textMesh=void 0,l.components[0].textEntityId=void 0)}c(this,V).geometry3DMap.delete(n.id)}c(this,Ht).call(this),c(this,Rr).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return c(this,Tr)}getThreeCamera(){return c(this,xr)}async setEnvironment(r){if(c(this,Tr))if(r==="basic"){c(this,id)||_(this,id,ee(this,bn,mO).call(this));let n=await c(this,id);c(this,Tr).environment=n}else c(this,Tr).environment=null}getEnvironment(){var r;return(r=c(this,Tr))!=null&&r.environment?"basic":!1}getCurrentSceneGLTF(r){return c(this,U).exporterSystem.getCurrentSceneGLTF(r)}getBoundingArea(r){(c(this,U).renderSystem.threeDdirty||c(this,U).renderSystem.twoDdirty)&&this.renderSync();let n=new Xr;if(r==null)n.setFromObject(c(this,V).entityScene);else{let o=Ch(c(this,V),r);if((o==null?void 0:o.type)==="geometry"&&(o==null?void 0:o.object3d)!=null){let i=o.components[0],s=i instanceof hr?i.geometry:void 0;i.mesh instanceof Y1&&s?(s.computeBoundingBox(),s.boundingBox&&n.union(s.boundingBox)):n.setFromObject(o.object3d)}else((o==null?void 0:o.type)==="geometry-group"||(o==null?void 0:o.type)==="group-container")&&(o==null?void 0:o.userData.entityId)!=null&&n.setFromObject(o)}if(du(n))return ME(n).map(this.convert3DMapPositionToCoordinate)}getState(r){var o,i,s,a,l,u,d,f,h,b;if(r==null)return{type:"map-view",hoverColor:c(this,V).hoverColor,text3dHoverColor:c(this,V).text3dHoverColor};let n=Ch(c(this,V),r);if((n==null?void 0:n.type)==="custom-geometry"){let v=n.components[0],I=n.components[1];return{id:n.id,type:"custom-geometry",visible:I.visible,altitude:I.altitude,parent:(o=n.parentObject3D)==null?void 0:o.userData.entityId,position:this.convert3DMapPositionToCoordinate(v.position)}}else if((n==null?void 0:n.type)==="geometry-group"){let v=[];for(let x of n.userData.entities3D.values()){let C=this.getState(x);((C==null?void 0:C.type)==="geometry"||(C==null?void 0:C.type)==="model")&&v.push(C)}let I=n.components[0];return{id:n.userData.entityId,type:"geometry-group",visible:n.visible,opacity:I.opacity,color:I.color,initialColor:I.initialColor,height:I.height,altitude:n.altitude,topColor:I.topColor,outline:I.outline,shading:I.shading,texture:I.texture,topTexture:I.topTexture,interactive:Array.from(n.userData.entities3D.values()).map(x=>c(this,V).geometry3DMap.get(x)).every(x=>x&&x.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(x=>this.getState(x)).filter(Boolean)}}else{if((n==null?void 0:n.type)==="group-container")return{id:n.userData.entityId,type:"group-container",visible:n.visible,altitude:n.altitude,opacity:n.opacity,interactive:!!n.components[1],children:Array.from(n.childrenIds.values()).map(v=>this.getState(v)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let v=n.components[0],I=n.object3d.parent,x=I==null?void 0:I.userData.entityId;return{id:n.id,type:"label",text:v.text||"",parent:{id:x,type:I==null?void 0:I.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:v.enabled,visible:v.visible,initialRank:Zg(v.initialRank),options:{rank:Zg(v.rank),appearance:v.appearance,interactive:n.components[1]!=null,verticalOffset:n.verticalOffset,attachTo:n.attachedTo}}}else if((n==null?void 0:n.type)==="marker"){let v=n.components[0],I=n.object3d.parent,x=I==null?void 0:I.userData.entityId;return{id:n.id,type:"marker",enabled:v.enabled,visible:v.visible,anchor:v.options.anchor,dynamicResize:v.options.dynamicResize,parent:{id:x,type:I==null?void 0:I.type},position:this.convert3DMapPositionToCoordinate(n.position),element:v.containerEl,initialRank:Zg(v.initialRank),options:{rank:Zg(v.rank),interactive:n.components[1]!=null||!1,verticalOffset:n.verticalOffset,attachTo:n.attachedTo,lowPriorityPin:v.options.lowPriorityPin}}}else if((n==null?void 0:n.type)==="geometry"){let{color:v,hoverColor:I,initialColor:x,initialTopColor:C,topColor:P}=n.components[1],w=n.components[0],T=n.components[1],O=n.components[2],N=n.components[3],k=n.parentObject3D;return{id:n.id,type:"geometry",opacity:T.opacity,initialColor:x,color:v,focusable:w.focusable,initialTopColor:C,topColor:P,hoverColor:I,hovered:!!(O!=null&&O.hover),height:T.height,visible:T.visible,outline:N==null?void 0:N.visible,showImage:T.showImage,texture:T.texture,topTexture:T.topTexture,flipImageToFaceCamera:T.flipImageToFaceCamera,parent:{id:k==null?void 0:k.userData.entityId,type:k==null?void 0:k.type},position:this.convert3DMapPositionToCoordinate(w.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let v=n.components[0],I=n.components[1],x=n.components[2];return{id:n.id,type:"model",position:v.mesh?this.convert3DMapPositionToCoordinate((i=v.mesh)==null?void 0:i.getWorldPosition(new Ce)):this.convert3DMapPositionToCoordinate(v.position),interactive:x!=null,material:I.material,parent:(s=n.parentObject3D)!=null&&s.parent?{id:n.parentObject3D.parent.userData.entityId,type:n.parentObject3D.parent.type}:void 0,visible:I.visible,verticalOffset:I.verticalOffset,color:I.color,opacity:I.opacity,rotation:(a=I.rotation)!=null?a:kd,scale:(l=I.scale)!=null?l:Ad}}else if((n==null?void 0:n.type)==="path"){let v=n.components[0],I=n.components[2],x=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(v.position),visible:x.visible,interactive:I!=null,completeFraction:v.completeFraction,color:x.color,accentColor:v.accentColor,nearRadius:v.nearRadius,farRadius:v.farRadius,animateArrowsOnPath:v.animateArrowsOnPath,displayArrowsOnPath:v.displayArrowsOnPath,nearZoomLevel:v.nearZoomLevel,farZoomLevel:v.farZoomLevel}}else if((n==null?void 0:n.type)==="image"){let v=n.components[0];return{id:n.id,type:"image",position:this.convert3DMapPositionToCoordinate(v.position),visible:n.components[1].visible,verticalOffset:(u=v.feature.properties.verticalOffset)!=null?u:0,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof Nc&&"textArea"in n.components[0].feature.properties){RZ(n);let v=n.components[0],I=n.components[1],{textMesh:x}=v,C=(d=v.mesh)==null?void 0:d.parent;C instanceof at&&((f=C.children.find(T=>T.type==="batchedtext"))==null||f.getWorldPosition(c(this,Wb))),c(this,eh).set(0,0,0);let P=x?x.getWorldPosition(c(this,eh)):c(this,eh);return Object.assign({},_d,I.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(P.add(c(this,Wb))),visible:(h=v.visible)!=null?h:!1,content:(b=v.feature.properties.content)!=null?b:""})}else return}}setState(r,n){var i,s;if(typeof r=="object"&&n==null){"hoverColor"in r&&(c(this,V).hoverColor=(i=r.hoverColor)!=null?i:c(this,V).hoverColor),"text3dHoverColor"in r&&(c(this,V).text3dHoverColor=(s=r.text3dHoverColor)!=null?s:c(this,V).text3dHoverColor);return}let o=Ch(c(this,V),r);if(o!=null){if(o.type==="custom-geometry"){let a=c(this,V).geometry3DMap.get(o.id);if(a instanceof Tt&&a.components[0]instanceof Zm){let l=n;ca(o,c(this,V),l.visible),PI(o,l.altitude),D5(o,l.position,this.convertTo3DMapPosition),F5(o,this.getParentContainer(l.parent,!1))}}else if(o.type==="path"){let a=n;gn(o,a.interactive,c(this,V))&&c(this,Ht).call(this),PI(o,a.altitude),LZ(o,c(this,V),a)}else if(o.type==="model"){let a=n;gn(o,a.interactive,c(this,V))&&c(this,Ht).call(this),ca(o,c(this,V),a.visible),BZ(o,a)}else if(o.type==="group-container"){let a=n;ca(o,c(this,V),a.visible)&&(c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0,c(this,U).pathSystem.altitudeDirty=!0),PI(o,a.altitude)&&(c(this,U).pathSystem.altitudeDirty=!0),gn(o,a.interactive,c(this,V))&&c(this,Ht).call(this),R5(o,c(this,V),a.opacity)&&(c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0)}else if(o.type==="geometry-group"){let a=n;ca(o,c(this,V),a.visible)&&(c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0),IZ(o,c(this,V),a),TI(o,c(this,V),a.outline),a.height!=null&&A5(o,c(this,V),a.height),a.altitude!=null&&o.setAltitude(a.altitude),AZ(o,a),SZ(o,a.shading),R5(o,c(this,V),a.opacity)&&(c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0),gn(o,a.interactive,c(this,V))&&(c(this,Ht).call(this),c(this,Rr).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof hr){let a=n;ca(o,c(this,V),a.visible)&&(c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0),TI(o,c(this,V),a.outline),CZ(o,a),N5(o,a.focusable)&&(c(this,U).geometryInFocusSystem.focusablesDirty=!0),FZ(o,a.renderOrder)&&(c(this,U).meshDetachmentSystem.dirty=!0),DZ(o,a.opacity)&&(c(this,U).meshDetachmentSystem.dirty=!0,c(this,U).outlineInterpolationSystem.outlineOpacitiesDirty=!0),L5(o,a.flipImageToFaceCamera),a.height!=null&&A5(o,c(this,V),a.height),kZ(o,a)&&(c(this,U).meshDetachmentSystem.dirty=!0),k5(o,a),OZ(o,a.hoverColor),gn(o,a.interactive,c(this,V)),EZ(o,a.hovered)}c(this,Ht).call(this)}else if(o.type==="label"||o.type==="marker"){let a=n;MZ(o,n,c(this,V)),TZ(o,n,c(this,V))&&(c(this,Rr).call(this),c(this,U).domMutationSystem.dirty=!0),D5(o,a.position,this.convertTo3DMapPosition),F5(o,this.getParentContainer(a.parent,!1))&&(c(this,Rr).call(this),c(this,U).panBoundsSystem.dirty=!0),PZ(o,a.enabled),ca(o,c(this,V),a.visible)}else if(o.type==="image"){let a=n;ca(o,c(this,V),a.visible),L5(o,a.flipImageToFaceCamera)}else if(o.type==="text3d"){let a=n;NZ(o,c(this,V),a)}this.render()}}convertTo3DMapPosition(r,n,o=0,i){var l,u,d,f,h;if(Array.isArray(r))return this.convertTo3DMapPosition(r[1],r[0],(l=r[2])!=null?l:o,typeof n=="function"?n:void 0);if(typeof n!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:s,y:a}=s0((d=(u=c(this,V).center)==null?void 0:u[1])!=null?d:0,(h=(f=c(this,V).center)==null?void 0:f[0])!=null?h:0,r,n);return i?(i.set(s,a,o),i):new Ce(s,a,o)}get backgroundColor(){return typeof c(this,tn).backgroundColor=="string"?c(this,tn).backgroundColor:"#".concat(c(this,tn).backgroundColor.getHexString())}get backgroundAlpha(){return c(this,tn).backgroundAlpha}getThreeRenderer(){return c(this,tn)}getCenter(r){let n=Array.isArray(r)?r:this.getBoundingArea(r);return n?$E(n):void 0}isInView(r){let n=Ch(c(this,V),r);if(c(this,Hb).identity().multiply(c(this,xr).projectionMatrix).multiply(c(this,xr).matrixWorldInverse),c(this,ad).setFromProjectionMatrix(c(this,Hb)),n instanceof hu)return c(this,ad).containsPoint(n.position);if(n instanceof Tt){let o=n==null?void 0:n.components[0];if(o instanceof Zm||o instanceof Gc)return c(this,ad).containsPoint(this.convertTo3DMapPosition(o.feature.geometry.coordinates));if(o instanceof hr){let i=new Xr(this.convertTo3DMapPosition(o.featureBbox[1],o.featureBbox[0],0),this.convertTo3DMapPosition(o.featureBbox[3],o.featureBbox[2],0));return c(this,ad).intersectsBox(i)}}return!1}getSystems(){return c(this,U)}getInternalState(){return c(this,V)}getTweenGroup(){return c(this,V).tweenGroup}};Tr=new WeakMap,xr=new WeakMap,id=new WeakMap,Rb=new WeakMap,Km=new WeakMap,Zc=new WeakMap,sd=new WeakMap,Jm=new WeakMap,bn=new WeakSet,dO=function(r){var n;c(this,Xc)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(r)),c(this,V).pixelRatio=this.resolutionScale},V=new WeakMap,jt=new WeakMap,ns=new WeakMap,Ir=new WeakMap,fa=new WeakMap,tn=new WeakMap,U=new WeakMap,Nb=new WeakMap,Rr=new WeakMap,Ht=new WeakMap,NX=function(){_(this,jt,document.createElement("div")),c(this,jt).classList.add("mappedin__smart-collision-engine__container"),_(this,ns,document.createElement("canvas")),c(this,ns).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(c(this,jt)),_(this,Ir,document.createElement("canvas")),c(this,Ir).classList.add("mappedin__smart-collision-engine__container"),c(this,Ir).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Ir).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Ir).style.width=c(this,jt).clientWidth+"px",c(this,Ir).style.height=c(this,jt).clientHeight+"px",c(this,jt).appendChild(c(this,ns)),c(this,jt).appendChild(c(this,Ir)),c(this,ns).width=c(this,jt).clientWidth,c(this,ns).height=c(this,jt).clientHeight,c(this,Ir).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Ir).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Ir).style.width=c(this,jt).clientWidth+"px",c(this,Ir).style.height=c(this,jt).clientHeight+"px"},BX=function(){_(this,fa,document.createElement("div")),c(this,fa).classList.add("mappedin-2d-entities"),Object.assign(c(this,fa).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(c(this,fa))},$X=function(){c(this,Ir).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Ir).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Ir).style.width=c(this,jt).clientWidth+"px",c(this,Ir).style.height=c(this,jt).clientHeight+"px",c(this,ns).width=c(this,jt).clientWidth,c(this,ns).height=c(this,jt).clientHeight,c(this,Ir).width=c(this,jt).clientWidth*this.resolutionScale,c(this,Ir).height=c(this,jt).clientHeight*this.resolutionScale,c(this,Ir).style.width=c(this,jt).clientWidth+"px",c(this,Ir).style.height=c(this,jt).clientHeight+"px",c(this,U).collisionSystem.collidersDirty=!0},Xc=new WeakMap,Bb=new WeakMap,$b=new WeakMap,jb=new WeakMap,Gb=new WeakMap,PS=new WeakMap,Ub=new WeakMap,Vb=new WeakMap,zb=new WeakMap,Qm=new WeakMap,fO=function(r,n,o,i){let s=new hu(n,this.convertTo3DMapPosition(r[1],r[0],r[2]||0),i);return s.occluderId=o!=null?o:c(this,U).occlusion2DSystem.backgroundId,c(this,V).geometry2DMap.set(s.id,s),s},ad=new WeakMap,Hb=new WeakMap,no=new WeakMap,oo=new WeakMap,mO=async function(){return Uc.load(kW).then(r=>{var n;return c(this,Tr)&&((n=c(this,Tr).environment)==null||n.dispose(),r.mapping=HO,c(this,Tr).environment=r,this.render()),r})},eh=new WeakMap,Wb=new WeakMap;var qb=pO;p();function OPe(e,t){EPe(e,t)(e.getScene(),t),_Pe(e,t),t.addFolder("Export").add({export:async()=>{let s=await e.getCurrentSceneGLTF({binary:!0}),a=new Blob([s],{type:"application/octet-stream"});var l=document.createElement("a");document.body.appendChild(l),l.style.display="none";let u=window.URL.createObjectURL(a);l.href=u,l.download="scene.glb",l.click(),window.URL.revokeObjectURL(u)}},"export");let o=t.addFolder("Camera"),i={get bearing(){return e.camera.bearing},set bearing(s){e.camera.setBearing(s)},get pitch(){return e.camera.pitch},set pitch(s){e.camera.setPitch(s)},get zoomLevel(){return e.camera.zoomLevel},set zoomLevel(s){e.camera.setZoomLevel(s)}};o.add(i,"bearing",-359,359,1),o.add(i,"pitch",e.camera.minPitch,e.camera.maxPitch,1),o.add(i,"zoomLevel",e.camera.minZoomLevel,e.camera.maxZoomLevel,.1)}function EPe(e,t){let r=t;return function n(o,i){let s=i.addFolder("".concat([o.type]," ").concat(o.id.slice(0,16)));if(i.close(),o.type==="geometry"||o.type==="model"||o.type==="path"||o.type==="image"){let a={get height(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.height:0},set height(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(o,{height:l})},set flipImageToFaceCamera(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="image"&&e.setState(o,{flipImageToFaceCamera:l})},get flipImageToFaceCamera(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="image"?l.flipImageToFaceCamera:!1},set visible(l){let u=e.getState(o.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="path"||(u==null?void 0:u.type)==="image")&&e.setState(o,{visible:l})},get visible(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?l.visible:!1},set outline(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(o,{outline:l})},get outline(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.outline:!1},get opacity(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.opacity:1},set opacity(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(u,{opacity:l})},get color(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"&&l.color?Se(l.color).toHexString():"#ffffff"},set color(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry"&&e.setState(u,{color:l})},set interactive(l){let u=e.getState(o.id);((u==null?void 0:u.type)==="geometry"||(u==null?void 0:u.type)==="model"||(u==null?void 0:u.type)==="path")&&(e.setState(o,{interactive:l}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"?l.interactive:!1},get completeFraction(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="path"?l.completeFraction:1},set completeFraction(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="path"&&e.setState(u,{completeFraction:l})},focus:()=>{}};s.add(a,"focus").onChange(()=>{let l=e.getState(o.id);(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?e.camera.focusOn([l.position]):(l==null?void 0:l.type)==="geometry"&&e.camera.focusOn(e.getBoundingArea(l))}),s.add(a,"visible"),o.type==="image"?s.add(a,"flipImageToFaceCamera"):(s.add(a,"interactive"),o.type==="path"&&s.add(a,"completeFraction",0,1,.1),o.type!=="model"&&(s.addColor(a,"color"),s.add(a,"outline"))),o.type==="geometry"&&(s.add(a,"height"),s.add(a,"opacity",0,1,.1))}else if(o.type==="marker"){let a={get interactive(){var u;let l=e.getState(o.id);return(l==null?void 0:l.type)==="marker"?(u=l.options)==null?void 0:u.interactive:!1},set interactive(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="marker"&&(e.setState(u,{options:{interactive:l}}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},focus:()=>{}};s.add(a,"focus").onChange(()=>{let l=e.getState(o.id);(l==null?void 0:l.type)==="marker"&&e.camera.focusOn([l.position])}),s.add(a,"interactive")}else if(o.type==="label"){let a={get interactive(){var u;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(u=l.options)==null?void 0:u.interactive:!1},set interactive(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&(e.setState(u,{options:{interactive:l}}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},get text(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?l.text:""},set text(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:l})},get"Text Color"(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(d=(u=l.options.appearance)==null?void 0:u.text)==null?void 0:d.foregroundColor:"#000000"},set"Text Color"(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(o.id,{text:a.text,options:{appearance:{text:{foregroundColor:l}}}})},get"Text Size"(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(d=(u=l.options.appearance)==null?void 0:u.text)==null?void 0:d.size:10},set"Text Size"(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{text:{size:l}}}})},get"Icon Size"(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(d=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:d.iconSize:10},set"Icon Size"(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{marker:{iconSize:l}}}})},get"Active Foreground Color"(){var u,d,f;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(d=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:d.foregroundColor)==null?void 0:f.active:"#000000"},set"Active Foreground Color"(l){var d,f;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{marker:{foregroundColor:{...(f=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:f.foregroundColor,active:l}}}}})},get"Inactive Foreground Color"(){var u,d,f;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(d=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:d.foregroundColor)==null?void 0:f.inactive:"#000000"},set"Inactive Foreground Color"(l){var d,f;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{marker:{foregroundColor:{...(f=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:f.foregroundColor,inactive:l}}}}})},get"Active Background Color"(){var u,d,f;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(d=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:d.backgroundColor)==null?void 0:f.active:"#000000"},set"Active Background Color"(l){var d,f;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{marker:{backgroundColor:{...(f=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:f.backgroundColor,active:l}}}}})},get"Inactive Background Color"(){var u,d,f;let l=e.getState(o.id);return(l==null?void 0:l.type)==="label"?(f=(d=(u=l.options.appearance)==null?void 0:u.marker)==null?void 0:d.backgroundColor)==null?void 0:f.inactive:"#000000"},set"Inactive Background Color"(l){var d,f;let u=e.getState(o.id);(u==null?void 0:u.type)==="label"&&e.setState(u,{text:a.text,options:{appearance:{marker:{backgroundColor:{...(f=(d=u.options.appearance)==null?void 0:d.marker)==null?void 0:f.backgroundColor,inactive:l}}}}})},focus:()=>{}};s.add(a,"focus").onChange(()=>{let l=e.getState(o.id);(l==null?void 0:l.type)==="label"&&e.camera.focusOn([l.position])}),s.add(a,"interactive"),s.add(a,"text"),s.add(a,"Text Size",10,50),s.add(a,"Icon Size",10,50),s.addColor(a,"Text Color"),s.addColor(a,"Active Background Color"),s.addColor(a,"Inactive Background Color"),s.addColor(a,"Active Foreground Color"),s.addColor(a,"Inactive Foreground Color")}else if(o.type==="geometry-group"){let a={get opacity(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.opacity:1},set opacity(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(o,{opacity:l})},set visible(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(o,{visible:l})},get visible(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.visible:!1},set outline(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(o,{outline:l})},get outline(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.outline:!1},set interactive(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&(e.setState(o,{interactive:l}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.interactive:!1},get shadingStart(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(u=l.shading)==null?void 0:u.start)!=null?d:0},set shadingStart(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(u,{shading:{start:l}})},get shadingEnd(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(u=l.shading)==null?void 0:u.end)!=null?d:0},set shadingEnd(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(u,{shading:{end:l}})},get shadingIntensity(){var u,d;let l=e.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(d=(u=l.shading)==null?void 0:u.intensity)!=null?d:0},set shadingIntensity(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="geometry-group"&&e.setState(u,{shading:{intensity:l}})}};s.add(a,"visible"),s.add(a,"opacity",0,1,.1),s.add(a,"interactive"),s.add(a,"outline"),s.add(a,"shadingStart",0,1,.1),s.add(a,"shadingEnd",0,1,.1),s.add(a,"shadingIntensity",0,1,.1)}else if(o.type==="group-container"){let a={set visible(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="group-container"&&e.setState(o,{visible:l})},get visible(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="group-container"?l.visible:!1},set interactive(l){let u=e.getState(o.id);(u==null?void 0:u.type)==="group-container"&&(e.setState(u,{interactive:l}),r.controllersRecursive().forEach(d=>d.updateDisplay()))},get interactive(){let l=e.getState(o.id);return(l==null?void 0:l.type)==="group-container"?l.interactive:!1}};s.add(a,"visible"),s.add(a,"interactive")}if(s.close(),o.children)for(let a of o.children.values())n(a,s)}}function _Pe(e,t){let r=t.addFolder("Watermark"),n={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};r.add(n,"padding",0,100,1),r.add(n,"scale",.5,1.5,.1),r.add(n,"color",["dark","light"]),r.add(n,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),r.add(n,"iconOnly"),r.onChange(()=>{e.updateWatermark(n)})}var jX="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",APe="https://auth.mappedin.com/oauth2/token";async function GX(e,t){var r,n,o,i,s;if((r=t==null?void 0:t.outdoorView)!=null&&r.enabled){let{Map:a,MercatorCoordinate:l}=await import("./outdoor-context-v4-DTIGSNLG.js"),u=t.outdoorView.headers;u==null&&(u=await LE(APe));let d=t.center||[0,0],f=new a({container:e,style:t.outdoorView.style||jX,center:d,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:gO,pitch:(o=t.pitch)!=null?o:hO,bearing:(i=t.bearing)!=null?i:yO,transformRequest:AE(u),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:Od(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),h=f.painter.context.gl,b=new qb(e,{center:d,zoomLevel:f.getZoom(),pitch:f.getPitch(),bearing:f.getBearing(),gl:h,map:f,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias,occlusionEnabled:t.occlusionEnabled,transformImageRequest:t.transformImageRequest,naturalBearing:(s=t.naturalBearing)!=null?s:0,imagePlacementOptions:t.imagePlacementOptions,onWebGLContextCreationError:t.onWebGLContextCreationError,onWebGLContextLost:t.onWebGLContextLost,onWebGLContextRestored:t.onWebGLContextRestored,onWebGLRendererError:t.onWebGLRendererError}),v={center:f.getCenter().toArray(),zoom:f.getZoom(),bearing:f.getBearing(),pitch:f.getPitch()};f.setMinZoom(b.camera.minZoomLevel),f.setMaxZoom(b.camera.maxZoomLevel),b.on("camera-change",T=>{v.center=T.center,v.zoom=T.zoomLevel,v.bearing=T.bearing,v.pitch=T.pitch,f.jumpTo(v)});let I=l.fromLngLat(d,0),x=a0(I,b.viewCamera,b.camera,()=>{b.renderSync()});f.on("style.load",async()=>{f&&(f.addLayer(x),b.renderSync())});let C=!1,P=!1;f.on("idle",()=>{f&&(C||(b.publish("outdoor-view-loaded"),C=!0),P||(P=!0,b.publish("outdoor-style-loaded")))});let w=T=>{T&&(T.sourceDataType==="metadata"||T.sourceDataType==="visibility"||T.dataType==="style"||T.type==="terrain")&&b.getSystems().htmlControlsSystem.updateData(f)};return f.on("styledata",T=>{f&&T&&T.dataType==="style"&&T.type==="styledata"&&(P=!1),w(T)}),f.on("sourcedata",w),f.on("terrain",w),f.on("error",T=>{var O;if(((O=T.error)==null?void 0:O.url)===jX){$.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(u["x-mappedin-tiles-key"],'"'));return}$.warn(T)}),b}else return new qb(e,t)}p();p();p();var j2=(r=>(r.Exterior="exterior-walls",r.Interior="interior-walls",r))(j2||{}),G2=(r=>(r.Interior="interior-doors",r.Exterior="exterior-doors",r))(G2||{});p();p();var Zb=class Zb{constructor(t,r,n){m(this,"id");m(this,"text");m(this,"target");m(this,"__type",Zb.__type);this.id=t,this.text=r,this.target=n}static is(t){return t.__type===Zb.__type}get focusTarget(){return this.target.anchorTarget}};m(Zb,"__type","Label");var Yc=Zb;p();var ld,Xb=class Xb{constructor(t,r,n){m(this,"id");M(this,ld);m(this,"__type",Xb.__type);m(this,"contentEl");this.id=t,this.contentEl=r,_(this,ld,n)}get target(){return c(this,ld)}get coordinate(){return c(this,ld).anchorTarget}static is(t){return t.__type===Xb.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){_(this,ld,t)}};ld=new WeakMap,m(Xb,"__type","Marker");var Tl=Xb;p();var Jb,Qb,Yb=class Yb{constructor(t,r,n){M(this,Jb);M(this,Qb);m(this,"target");m(this,"__type",Yb.__type);_(this,Jb,t),_(this,Qb,r),this.target=n}static is(t){return t.__type===Yb.__type}get id(){return c(this,Jb)}get url(){return c(this,Qb)}};Jb=new WeakMap,Qb=new WeakMap,m(Yb,"__type","Image");var Kb=Yb;p();var th,e1=class e1{constructor(t,r,n){m(this,"id");m(this,"groupId");m(this,"__type",e1.__type);M(this,th);this.id=t,this.groupId=r,_(this,th,n)}get target(){return c(this,th)}static is(t){return t.__type===e1.__type}updateTarget(t){_(this,th,t)}};th=new WeakMap,m(e1,"__type","Model");var cd=e1;p();var t1=class t1{constructor(t,r){m(this,"id");m(this,"coordinates");m(this,"__type",t1.__type);this.id=t,this.coordinates=r}static is(t){return t.__type===t1.__type}get focusTarget(){return this.coordinates}};m(t1,"__type","PathSegment");var rh=t1,r1=class r1{constructor(t,r,n,o){m(this,"id");m(this,"animation");m(this,"coordinates");m(this,"segments");m(this,"__type",r1.__type);this.id=t,this.animation=r,this.coordinates=n,this.segments=o.map(({id:i,coordinates:s})=>new rh(i.toString(),s))}static is(t){return t.__type===r1.__type}get focusTarget(){return this.coordinates}};m(r1,"__type","Path");var os=r1;p();var Kc,n1=class{constructor(t){M(this,Kc);_(this,Kc,t)}get center(){return c(this,Kc).center}get bearing(){return c(this,Kc).bearing}get pitch(){return c(this,Kc).pitch}get zoomLevel(){return c(this,Kc).zoomLevel}};Kc=new WeakMap;p();var o1=class o1{constructor(t){m(this,"id");m(this,"__type",o1.__type);this.id=t}static is(t){return t.__type===o1.__type}get focusTarget(){return this}};m(o1,"__type","Shape");var Jc=o1;p();var TS=class TS{constructor(t,r){m(this,"id");m(this,"target");m(this,"__type","Text3D");this.id=t,this.target=r}static is(t){return t.__type===TS.__type}};m(TS,"__type","Text3D");var Qc=TS;p();p();p();var kPe=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n // Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),DPe=/<svg([^>]*)>/g;function UX(e,t,r){let n=kPe.get(e);return n?n.replace(DPe,'<svg$1 style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}var FPe=e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(e,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),LPe=e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(e,'"\n />\n </svg>\n '),bO="#722ED1",vO="#1890FF",VX=({type:e="departure",color:t=vO})=>'<div class="dropped-pin-wrapper">\n '.concat(e==="departure"?FPe(t):LPe(t),"\n </div>"),RPe=e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},zX=({type:e="stairs",color:t=bO,direction:r="up"})=>{let n=RPe("default"),o=n/2+2,i=r&&r!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(n,"px; height:").concat(n,'px;"\n >\n ').concat(UX("connection-"+e+"-16x16","white",o)||"","\n </div>\n ").concat(i?'<div style="margin-left: -'.concat(n*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(n,"px; height: ").concat(n,'px;">\n <div class="').concat(r==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(o,"px; height: ").concat(o,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")};p();var HX=async e=>new Promise(t=>setTimeout(t,e));var NPe={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},BPe={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},eu={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:NPe,inactivePathOptions:BPe,markerOptions:{departureColor:vO,destinationColor:bO},animatePathDrawing:!0},wl,is,Ml,st,s1,Ol,ud,Nr,ss,Io,as,tu,wr,WX,qX,xO,wS,nh,IO,oh,i1=class{constructor(t,r,n){M(this,wr);M(this,wl,new Map);M(this,is);M(this,Ml);M(this,st,eu);M(this,s1);M(this,Ol);M(this,ud);M(this,Nr,[]);M(this,ss);M(this,Io,new Map);M(this,as,new Map);M(this,tu,new Map);M(this,oh,t=>{var r;if((r=c(this,st).createMarkers)!=null&&r.connection&&t.markers.length>0){let{instruction:n}=c(this,wl).get(t.markers[0]);n!=null&&n.action.toFloor&&(c(this,st).setMapOnConnectionClick&&this.currentMap.setFloor(n.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:n,fromFloor:n.action.fromFloor,toFloor:n.action.toFloor}))}});_(this,is,t),_(this,s1,n),_(this,Ml,r)}get currentMap(){return c(this,s1).call(this)}get isMultiFloor(){if(!c(this,Nr).length)return!1;let t=new Set;for(let r of c(this,Nr))for(let n of r.coordinates)if(n.floorId&&(t.add(n.floorId),t.size>1))return!0;return!1}getPathById(t){return c(this,Io).get(t)}getMarkerById(t){return c(this,wl).get(t)}get paths(){let t=new Set;return c(this,Io).forEach(({path:r})=>t.add(r)),Array.from(t)}get activeDirections(){return c(this,tu).get(c(this,ss))}get activePath(){var t;if(c(this,ss))return(t=c(this,Io).get(c(this,ss).id))==null?void 0:t.path}get floorStacks(){let t=c(this,Ml).getMapData();if(!c(this,Nr).length||!t)return[];let r=new Set;for(let n of c(this,Nr))for(let o of n.coordinates)if(o.floorId){let i=t.getById("floor",o.floorId);i&&r.add(i.floorStack)}return Array.from(r)}get floors(){let t=c(this,Ml).getMapData();if(!c(this,Nr).length||!t)return[];let r=new Set;for(let n of c(this,Nr))for(let o of n.coordinates)if(o.floorId){let i=t.getById("floor",o.floorId);i&&r.add(i)}return Array.from(r)}setActivePathByIndex(t){let r=c(this,Nr)[t];if(!c(this,Nr).length){$.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!c(this,Nr)[t]){$.warn("Direction #".concat(t," does not exist"));return}let n=c(this,as).get(r);if(!n){$.warn("The direction is not a part of muli-direcional path");return}ee(this,wr,wS).call(this,n)}setActivePath(t){if(!c(this,Nr).length){$.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!c(this,tu).get(t)){$.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}ee(this,wr,wS).call(this,t)}setActivePathByDirections(t){if(!c(this,Nr).length){$.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let r=c(this,as).get(t);if(!r){$.warn("The direction is not a part of muli-direcional path");return}ee(this,wr,wS).call(this,r)}drawSync(t,r={}){var a,l,u;c(this,ud)&&this.clear(),_(this,ud,!0),ee(this,wr,xO).call(this,r);let n=Array.isArray(t)?t:[t],o=n[0],i=n[n.length-1],s=o.coordinates[0];_(this,Nr,n),s.floorId&&c(this,st).setMapToDeparture&&this.currentMap.setFloor(s.floorId),(a=c(this,st).createMarkers)!=null&&a.departure&&ee(this,wr,nh).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let d=0;d<n.length;d++){let f=n[d],h=d?{...c(this,st).inactivePathOptions}:{...c(this,st).pathOptions};if(f.coordinates.length<2){$.warn("Directions must have at least 2 coordinates");return}let b=this.currentMap.Paths.add(f.coordinates,{...h,animateDrawing:c(this,st).animatePathDrawing}),v=b.paths.map(x=>x.id.toString()),I=new os(Et(),b.animation,f.coordinates,b.paths);for(let x of v){c(this,Io).set(x,{path:I,entityIds:v});let C=d?{...c(this,st).inactivePathOptions,altitude:0}:{...c(this,st).pathOptions,altitude:.05};c(this,is).setState(x,C)}c(this,Io).set(I.id,{path:I,entityIds:v}),c(this,as).set(f,I),c(this,tu).set(I,f),(l=c(this,st).createMarkers)!=null&&l.connection&&ee(this,wr,IO).call(this,f.instructions,"connection"),d===0&&(_(this,ss,c(this,as).get(c(this,Nr)[0])),c(this,is).on("click",c(this,oh)))}(u=c(this,st).createMarkers)!=null&&u.destination&&ee(this,wr,nh).call(this,i.coordinates[i.coordinates.length-1],"destination",i.instructions[i.instructions.length-1]),c(this,Ml).mapObjects.forEach(d=>{d.processFloorChange(d.currentFloorId)})}async draw(t,r={}){c(this,Ol)&&this.clear(),ee(this,wr,xO).call(this,r);let n=Array.isArray(t)?t:[t],i=n[0].coordinates[0];return _(this,Nr,n),i.floorId&&c(this,st).setMapToDeparture&&this.currentMap.setFloor(i.floorId),ee(this,wr,qX).call(this,n)}clear(){c(this,wl).forEach((t,r)=>{this.currentMap.Markers.remove(r.toString())}),c(this,wl).clear(),c(this,Io).forEach(({path:t,entityIds:r})=>{c(this,Io).delete(t.id),r.forEach(n=>c(this,Io).delete(n)),this.currentMap.Paths.remove(r)}),c(this,Ol)&&(c(this,Ol).cancel(),_(this,Ol,void 0)),c(this,ud)&&_(this,ud,!1),_(this,Nr,[]),c(this,as).clear(),c(this,tu).clear(),_(this,ss,void 0),c(this,is).off("click",c(this,oh)),c(this,Ml).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};wl=new WeakMap,is=new WeakMap,Ml=new WeakMap,st=new WeakMap,s1=new WeakMap,Ol=new WeakMap,ud=new WeakMap,Nr=new WeakMap,ss=new WeakMap,Io=new WeakMap,as=new WeakMap,tu=new WeakMap,wr=new WeakSet,WX=function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},qX=function(t){let r=t[0],n=t[t.length-1],o=!1;return _(this,Ol,{promise:new Promise(async i=>{var s,a,l;if(g.env.NODE_ENV!=="test"&&await HX(500),o||!t.length){i();return}(s=c(this,st).createMarkers)!=null&&s.departure&&ee(this,wr,nh).call(this,r.coordinates[0],"departure",r.instructions[0]);for(let u=0;u<t.length;u++){let d=t[u],f=u?{...c(this,st).inactivePathOptions}:{...c(this,st).pathOptions};if(d.coordinates.length<2){$.warn("Directions must have at least 2 coordinates"),i();return}let h=this.currentMap.Paths.add(d.coordinates,{...f,animateDrawing:c(this,st).animatePathDrawing}),b=h.paths.map(I=>I.id.toString()),v=new os(Et(),h.animation,d.coordinates,h.paths);for(let I of b){c(this,Io).set(I,{path:v,entityIds:b});let x=u?{...c(this,st).inactivePathOptions,altitude:0}:{...c(this,st).pathOptions,altitude:.05};c(this,is).setState(I,x)}if(c(this,Io).set(v.id,{path:v,entityIds:b}),c(this,as).set(d,v),c(this,tu).set(v,d),g.env.NODE_ENV!=="test"&&await h.animation,o){i();return}(a=c(this,st).createMarkers)!=null&&a.connection&&ee(this,wr,IO).call(this,d.instructions,"connection"),u===0&&(_(this,ss,c(this,as).get(c(this,Nr)[0])),c(this,is).on("click",c(this,oh)))}if((l=c(this,st).createMarkers)!=null&&l.destination&&ee(this,wr,nh).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),o){i();return}c(this,Ml).mapObjects.forEach(u=>{u.processFloorChange(u.currentFloorId)}),i()}),cancel:()=>{o=!0}}),c(this,Ol).promise},xO=function(t){var r,n,o;_(this,st,{setMapOnConnectionClick:(r=t.setMapOnConnectionClick)!=null?r:eu.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:eu.setMapToDeparture,pathOptions:{...eu.pathOptions,...t.pathOptions},inactivePathOptions:{...eu.inactivePathOptions,...t.inactivePathOptions},createMarkers:{...eu.createMarkers,...t.createMarkers},markerOptions:{...eu.markerOptions,...t.markerOptions},animatePathDrawing:(o=t.animatePathDrawing)!=null?o:eu.animatePathDrawing})},wS=function(t){_(this,ss,t),c(this,Nr).forEach(r=>{let n=c(this,as).get(r);if(n){let o=c(this,Io).get(n.id),i=o.path.id===c(this,ss).id?{...c(this,st).pathOptions,altitude:.05}:{...c(this,st).inactivePathOptions,altitude:0};o.entityIds.forEach(s=>{c(this,is).setState(s,i)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},nh=function(t,r,n){var o,i,s,a,l;if(r==="connection"&&n){let u=n.action.type==="ExitConnection"?c(this,st).markerOptions.departureColor:c(this,st).markerOptions.destinationColor,d;if(typeof((o=c(this,st).createMarkers)==null?void 0:o.connection)=="function"){let h=c(this,st).createMarkers.connection(n);c(this,is).setState(h.id.toString(),{options:{interactive:!0}}),d={id:h.id,type:"marker"}}else d=this.currentMap.Markers.add(n.coordinate,zX({type:(s=(i=n.action.connection)==null?void 0:i.type)!=null?s:n.action.connectionType,color:u,direction:n.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let f=this.currentMap.Markers.getContentEl(d.id.toString());if(!f)throw new Error("marker component should exist");c(this,wl).set(d.id,{instruction:n,marker:new Tl(d.id.toString(),f,n.coordinate)})}else{let u=r==="departure"?c(this,st).markerOptions.departureColor:c(this,st).markerOptions.destinationColor,d;typeof((a=c(this,st).createMarkers)==null?void 0:a.departure)=="function"&&r==="departure"?d={id:c(this,st).createMarkers.departure(n).id,type:"marker"}:typeof((l=c(this,st).createMarkers)==null?void 0:l.destination)=="function"&&r==="destination"?d={id:c(this,st).createMarkers.destination(n).id,type:"marker"}:d=this.currentMap.Markers.add(t,VX({type:r,color:u}),{anchor:"top",rank:"always-visible"}),c(this,wl).set(d.id,void 0)}},IO=function(t,r){t.filter(o=>ee(this,wr,WX).call(this,o.action)).forEach(o=>{ee(this,wr,nh).call(this,o.coordinate,r,o)})},oh=new WeakMap;p();p();p();var $Pe=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),jPe=/<svg([^>]*)>/g;function ZX(e,t,r){let n=$Pe.get(e);return n?n.replace(jPe,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}var pd,ih,So,SO,XX,YX,CO,KX,MS=class{constructor(t,r){M(this,So);M(this,pd);M(this,ih);m(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});_(this,pd,t),_(this,ih,r)}auto(){let t=[],r=c(this,ih)[Object.keys(c(this,ih))[0]];return[...r.getByType("connection"),...r.getByType("point-of-interest"),...r.getByType("space")].forEach(n=>{if(n.__type==="connection")n.coordinates.forEach(o=>{let i=n.name||n.externalId;if(i){let s=c(this,pd).Labels.add(o,i,ee(this,So,SO).call(this,n));t.push(s)}});else{n.__type==="space"&&n.name!==""&&c(this,pd).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let o=n.name;if(o){let i=c(this,pd).Labels.add(n,o,ee(this,So,SO).call(this,n));t.push(i)}}}),{labels:t}}};pd=new WeakMap,ih=new WeakMap,So=new WeakSet,SO=function(t){let r=ZX(ee(this,So,XX).call(this,t),"white",12);return{appearance:{text:{foregroundColor:ee(this,So,CO).call(this,t)},marker:{foregroundColor:{active:ee(this,So,CO).call(this,t)},icon:r,iconSize:12}},interactive:!0,rank:ee(this,So,KX).call(this,t)}},XX=function(t){return t.__type==="connection"?ee(this,So,YX).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},YX=function(t){let r="";switch(t){case"elevator":r="connection-elevator-12x12";break;case"escalator":r="connection-escalator-12x12";break;case"stairs":r="connection-stairs-12x12";break}return r},CO=function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},KX=function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")};var OS=class{constructor(t,r){m(this,"Labels");m(this,"auto",()=>this.Labels.auto());this.Labels=new MS(t,r)}};p();var $e,l1,El,ES,PO,a1=class{constructor(t){M(this,El);M(this,$e);M(this,l1);m(this,"interactions",{set:t=>{(t==null?void 0:t.pan)!=null&&(c(this,$e).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(c(this,$e).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(c(this,$e).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},enable:()=>{c(this,$e).getSystems().cameraSystem.enablePan=!0,c(this,$e).getSystems().cameraSystem.enableZoom=!0,c(this,$e).getSystems().cameraSystem.enableRotate=!0},disable:()=>{c(this,$e).getSystems().cameraSystem.enablePan=!1,c(this,$e).getSystems().cameraSystem.enableZoom=!1,c(this,$e).getSystems().cameraSystem.enableRotate=!1}});m(this,"setMinPitch",t=>{c(this,$e).camera.setMinPitch(t)});m(this,"setMaxPitch",t=>{c(this,$e).camera.setMaxPitch(t)});m(this,"setMinZoomLevel",t=>{c(this,$e).camera.setMinZoomLevel(t,!0)});m(this,"setMaxZoomLevel",t=>{c(this,$e).camera.setMaxZoomLevel(t)});_(this,l1,t),_(this,$e,t.core)}setScreenOffsets(t){c(this,$e).camera.setInsetPadding(t)}get screenOffsets(){return c(this,$e).camera.insetsPadding}get panMode(){return c(this,$e).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&c(this,$e).camera.setPanMode(t)}getFocusOnTransform(t,r){var o;let n=c(this,$e).camera.getCameraFrameForCoordinates(ee(this,El,PO).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,verticalPadding:(o=r==null?void 0:r.axisAlignedPadding)==null?void 0:o.vertical,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,easing:r==null?void 0:r.easing});return{center:new Le(n.center[1],n.center[0]),zoomLevel:n.zoomLevel}}focusOn(t,r){var n;return c(this,$e).camera.focusOn(ee(this,El,PO).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,verticalPadding:(n=r==null?void 0:r.axisAlignedPadding)==null?void 0:n.vertical,easing:r==null?void 0:r.easing})}animateTo(t,r){var l;let{center:n,zoomLevel:o,bearing:i,pitch:s}=t,a=n!=null?n:this.center;return c(this,$e).camera.animateTo({center:n!=null?[a.longitude,a.latitude,c(this,$e).camera.elevation]:void 0,zoomLevel:o,bearing:i,pitch:s,duration:(l=r==null?void 0:r.duration)!=null?l:600,easing:r==null?void 0:r.easing})}set(t){let{center:r=this.center,zoomLevel:n=this.zoomLevel,bearing:o=this.bearing,pitch:i=this.pitch}=t,s=[r.longitude,r.latitude];c(this,$e).camera.setCenter(s),c(this,$e).camera.setZoomLevel(n),c(this,$e).camera.setBearing(o),c(this,$e).camera.setPitch(i)}get center(){let t=c(this,$e).camera.center;return new Le(t[1],t[0],void 0)}setAutoMinZoomLevel(t){c(this,$e).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return c(this,$e).camera.autoMinZoomLevel}get zoomLevel(){return c(this,$e).camera.zoomLevel}get pitch(){return c(this,$e).camera.pitch}get minPitch(){return c(this,$e).camera.minPitch}get maxPitch(){return c(this,$e).camera.maxPitch}get bearing(){let t=c(this,$e).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return c(this,$e).camera.minZoomLevel}get maxZoomLevel(){return c(this,$e).camera.maxZoomLevel}setElevation(t){c(this,$e).camera.setElevation(t)}get elevation(){return c(this,$e).camera.elevation}animateElevation(t,r){return c(this,$e).camera.animateElevation(t,r)}updateFacadesInView(){c(this,$e).getSystems().geometryInFocusSystem.raycast()}};$e=new WeakMap,l1=new WeakMap,El=new WeakSet,ES=function(t){var n,o,i,s,a,l;let r=c(this,$e).camera.elevation;return Le.is(t)&&t.floorId!=null?(o=(n=c(this,$e).getState(t.floorId))==null?void 0:n.altitude)!=null?o:r:Ro.is(t)?(s=(i=c(this,$e).getState(t.id))==null?void 0:i.altitude)!=null?s:r:"floor"in t&&Ro.is(t.floor)&&(l=(a=c(this,$e).getState(t.floor.id))==null?void 0:a.altitude)!=null?l:r},PO=function(t){var i;let r=[],o=(Array.isArray(t)?t:[t]).flatMap(s=>{var a;return(a=s==null?void 0:s.focusTarget)!=null?a:[s]});for(let s of o)if(s!=null)if(Le.is(s)){let a=ee(this,El,ES).call(this,s);r.push([s.longitude,s.latitude,a])}else if((s==null?void 0:s.id)!=null){let a=ee(this,El,ES).call(this,s);if(Ro.is(s)&&((i=c(this,l1).getMapDataInternal())!=null&&i.enterpriseMode)){r.push(s.id);continue}else if("geoJSON"in s&&s.geoJSON.geometry.coordinates.length>0){xE(s.geoJSON,u=>{r.push([u[0],u[1],a])});continue}let l=c(this,$e).getBoundingArea(s.id);if(l)r.push(...l.map(u=>[u[0],u[1],a]));else if("geoJSONBoundingBox"in s){let u=ee(this,El,ES).call(this,s);if(s.geoJSONBoundingBox!=null){let d=[[s.geoJSONBoundingBox[0],s.geoJSONBoundingBox[1],u],[s.geoJSONBoundingBox[2],s.geoJSONBoundingBox[3],u]];r.push(...d)}}}else d4(s)&&r.push(s);return r};p();var sh,c1=class{constructor({currentMapGetter:t}){M(this,sh);_(this,sh,t)}get currentMap(){return c(this,sh).call(this)}async getCurrentSceneGLTF(t){let r=c(this,sh).call(this);return r?r==null?void 0:r.Exporter.getCurrentSceneGLTF(t):($.error("There is no map to export. Please load a map first."),new Blob)}};sh=new WeakMap;p();var ma,p1,u1=class{constructor({currentMapGetter:t}){M(this,ma,new Map);M(this,p1);_(this,p1,t)}get currentMap(){return c(this,p1).call(this)}getById(t){return c(this,ma).get(t)}add(t,r,n){let o=t.anchorTarget,i=this.currentMap;if(!i)throw new Error("currentMap should exist");let s=i.Labels.add(o,r,{...n,attachTo:mm(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank}),a=new Yc(s.id.toString(),r,t);return c(this,ma).set(a.id,{label:a,entityId:a.id}),a}all(t){var n;let r=[];return(n=this.currentMap)==null||n.Labels.all({onCreate:(o,i,s)=>{let a=new Yc(o.toString(),i,s);c(this,ma).set(a.id,{label:a,entityId:a.id}),r.push(a)},labelOptions:t}),r}remove(t){var n;let r=c(this,ma).get(t.id);r&&((n=this.currentMap)==null||n.Labels.remove(r),c(this,ma).delete(t.id.toString()))}removeAll(){let t=[];return c(this,ma).forEach(({label:r})=>{this.remove(r),t.push(r),c(this,ma).delete(r.id.toString())}),t}};ma=new WeakMap,p1=new WeakMap;p();p();var TO={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},JX={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},QX=.5,_l=class{constructor(t,r,n=new Map){m(this,"containerId");m(this,"layers");m(this,"renderer");this.containerId=r,this.layers=n,this.renderer=t}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}},dd,d1=class{constructor(t,r,n,o,i,s,a,l){m(this,"id");m(this,"name");m(this,"elevation");m(this,"containerId");m(this,"externalId");m(this,"metadata");m(this,"shortName");m(this,"subtitle");m(this,"occluderId");m(this,"loaded",!1);m(this,"styleMap",{});m(this,"obstructions");m(this,"entrances");m(this,"spaces");m(this,"floorImages");m(this,"floorText");m(this,"renderer");m(this,"options");m(this,"layers",new Map);m(this,"footprint");m(this,"floorStackId");m(this,"multiFloorView");m(this,"mapDataInternal");m(this,"facadesByStyleId",new Map);M(this,dd);m(this,"load",()=>{var o,i,s,a,l,u,d,f,h,b,v,I,x,C;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(al,"-").concat(this.id),{},this.id);this.layers.set(al,new _l(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer("".concat(Qs,"-").concat(this.id),{},this.id);this.layers.set(Qs,new _l(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat(Er,"-").concat(this.id),{},this.id);if(this.layers.set(Er,new _l(this.renderer,n.id.toString())),((o=this.footprint)==null?void 0:o.geometry)!=null&&((i=this.footprint)==null?void 0:i.geometry.coordinates.length)!==0){let P=TO;if(this.obstructions!=null&&this.obstructions.features.length>0){let O=this.obstructions.features.filter(N=>N.geometry.type==="LineString"&&N.properties.kind==="Wall"&&N.properties.footprintComponent===!0);O!=null&&O.length>0&&(P=this.styleMap[(s=O[0].properties)==null?void 0:s.id])}let w=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...P,height:(l=(a=this.multiFloorView)==null?void 0:a.floorHeight)!=null?l:10,altitude:0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":P.color,renderOrder:2},this.id);this.layers.set(yg,new _l(this.renderer,w.id.toString()));let T=this.renderer.addGroupContainer("".concat(am,"-").concat(this.id),{},this.id);this.layers.set(am,new _l(this.renderer,T.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,T.id)}if(this.spaces!=null&&this.spaces.features.length>0){let P=[],w=new Map;this.spaces.features.filter(k=>{var D;return k.geometry.type==="Polygon"&&((D=k.properties.kind)==null?void 0:D.toLowerCase())!=="void"}).forEach(k=>{var F;let D=(F=this.mapDataInternal)==null?void 0:F.facadesBySpaceId[k.properties.id];if(D){let z=w.get(D.id)||[];w.set(D.id,[...z,k])}else P.push(k)});let T=B2(P,this.styleMap),O=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),N=0;for(let[k,D]of T){let F=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(N),{features:D},fm(k,this.options),O);N++;let z=O.id.toString();this.layers.get(Er).layers.set(k.id||z,F.id.toString())}if(w.size>0){let k=this.renderer.addGroupContainer("".concat(up,"-").concat(this.id),{},this.id);this.layers.set(up,new _l(this.renderer,k.id.toString()));for(let[D,F]of w){let z=this.renderer.addGroupContainer(D,{focusable:!0},k),G=this.renderer.addGroupContainer("".concat(D,"-geometry"),{},z),j=B2(F,this.styleMap),K=0;for(let[Z,oe]of j){let Q=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(D,"-").concat(K),{features:oe},{...fm(Z,this.options),renderOrder:3},G);K++;let ye=Z.id||Q.id.toString();this.layers.get(up).layers.set("".concat(D,"-").concat(ye),Q.id.toString()),this.facadesByStyleId.has(ye)?(u=this.facadesByStyleId.get(ye))==null||u.push(D):this.facadesByStyleId.set(ye,[D])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let P=this.obstructions.features.filter(G=>G.geometry.type==="Polygon"&&G.properties.kind==="object"),w=B2(P,this.styleMap),T=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),O=0;for(let[G,j]of w){let K=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(O),{features:j},fm(G,this.options),T);O++;let Z=T.id.toString();this.layers.get(Er).layers.set(G.id||Z,K.id.toString())}let N=this.obstructions.features.filter(G=>G.geometry.type==="LineString"&&G.properties.kind==="Wall"&&G.properties.footprintComponent===!1),k=this.obstructions.features.filter(G=>G.geometry.type==="LineString"&&G.properties.kind==="Wall"&&G.properties.footprintComponent===!0),D=this.entrances,F=TO,z=TO;if(N!=null&&N.length>0){let G=this.styleMap[(d=N[0].properties)==null?void 0:d.id];G!=null&&(F={...G}),z=F;let{walls:j,entrances:K}=N4(N,(D==null?void 0:D.features)||[]),Z=Math.max(F.height-.11,QX),oe={...JX,height:Z},Q=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),K,oe,n);this.layers.get(Er).layers.set(im,Q.id.toString());let ye=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[j]},fm(F,this.options),n);this.layers.get(Er).layers.set(Tc,ye.id.toString())}if(k!=null&&k.length>0){let G=this.styleMap[(f=k[0].properties)==null?void 0:f.id];G!=null&&(z={...G,id:Js});let{walls:j,entrances:K}=N4(k,(D==null?void 0:D.features)||[]),Z=Math.max(z.height-.11,QX),oe={...JX,height:Z},Q=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),K,oe,n);this.layers.get(Er).layers.set(sm,Q.id.toString());let ye=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[j]},fm(z,this.options),n);this.layers.get(Er).layers.set(Js,ye.id.toString())}}if(this.floorImages!=null){let P=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let w of this.floorImages.features||[])"anchorId"in w.properties||"anchorId"in w.properties&&((h=w.properties)==null?void 0:h.anchorId)==null||this.renderer.addImage(Et(),w,{url:w.properties.path,flipImageToFaceCamera:(b=this.options.flipImagesToFaceCamera)!=null?b:!0},P);this.layers.set(wH,new _l(this.renderer,P.id.toString()))}if(this.floorText!=null)for(let P of this.floorText.features||[]){let w=0;"geometryId"in P.properties?w=(I=(v=this.renderer.getState(P.properties.geometryId))==null?void 0:v.height)!=null?I:0:w=(x=P.properties.verticalOffset)!=null?x:0,this.renderer.addText3D(Et(),{...P,properties:{...P.properties,verticalOffset:w}},{},this.id)}return(C=this.multiFloorView)!=null&&C.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this});var d,f,h,b;this.id=r.id,this.options=i;let u=n.addGroupContainer(this.id,{visible:!1,interactive:!0},t);this.containerId=u.id.toString(),this.externalId=r.externalId,this.metadata=r.metadata,this.shortName=r.shortName,this.subtitle=r.subtitle,this.name=r.name,this.elevation=r.elevation,s!=null&&a!=null&&(this.styleMap=a,this.spaces=s.space[this.id],this.entrances=s.entrance[this.id],this.obstructions=s.obstruction[this.id],this.floorImages=(d=s.floorImages)==null?void 0:d[this.id],this.floorText=(h=(f=s.enterprise)==null?void 0:f.floorText)==null?void 0:h[this.id],this.footprint=(b=s["floor.geojson"])==null?void 0:b.features.find(v=>v.properties.id===r.id)),this.renderer=n,this.floorStackId=t,this.multiFloorView=o,this.mapDataInternal=l}get geoJSONBoundingBox(){if(c(this,dd))return c(this,dd);if(!this.footprint){$.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return _(this,dd,$2(this.footprint)),c(this,dd)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};dd=new WeakMap;p();var MO=50,OO=!1,GPe=1e3,mr,ah,ha,ls,vn,m1,nu,lh,fd,Co,_O,md,h1,y1,g1,b1,Al,nY,v1,ou,AO,oY,iY,hd,f1=class extends De{constructor({currentMapGetter:r}){super();M(this,Co);M(this,mr);M(this,ah,0);M(this,ha);M(this,ls,!1);M(this,vn,[]);M(this,m1,0);M(this,nu,MO);M(this,lh,!1);M(this,fd,"collapsed");m(this,"expandedFactor",0);M(this,md,"all-floors");M(this,h1,()=>{let r=c(this,mr).call(this);if(c(this,m1)===this.expandedFactor||r==null||!c(this,ls))return;_(this,m1,this.expandedFactor);let n=Ss(this.expandedFactor,0,1,0,this.distanceBetweenFloors),i=Ss(this.expandedFactor,0,.1,0,1)===0;c(this,vn).forEach((s,a)=>{r.api.updateState(s.containerId,{visible:i?s.id===r.currentFloorId:!0,altitude:n*a})}),this.expandedFactor===0?(_(this,ls,!1),r.renderer.camera.setPanMode("default"),c(this,ou)&&c(this,ou).call(this)):this.expandedFactor===1&&(_(this,ls,!1),c(this,ou)&&c(this,ou).call(this))});M(this,y1,()=>{var r,n,o;this.expanded&&_(this,ah,(n=(r=c(this,mr).call(this))==null?void 0:r.renderer.camera.elevation)!=null?n:0),(o=c(this,mr).call(this))==null||o.renderer.on("user-interaction-end",c(this,b1))});M(this,g1,()=>{var n;let r=c(this,mr).call(this);if(r!=null&&this.expanded&&c(this,lh)&&!c(this,ls)){let o=r.currentFloorId,i=[1/0,r.currentFloorId];for(let s=0;s<c(this,vn).length;s++){let a=c(this,vn)[s],l=Math.abs(((n=r.renderer.camera.elevation)!=null?n:0)-s*this.distanceBetweenFloors);l<this.distanceBetweenFloors/3&&(i[0]=l,i[1]=a.id)}i[1]!==r.currentFloorId&&(r.currentFloorId=i[1],c(this,vn).forEach(s=>{r.api.updateState(s.containerId,{visible:c(this,md)==="all-floors"?!0:r.currentFloor.id===s.id})}),r.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:r.currentFloorId,previousFloorId:o}))}});M(this,b1,()=>{var n,o;let r=c(this,mr).call(this);if(this.expanded&&r&&c(this,ah)!==((n=r.renderer.camera.elevation)!=null?n:0)){let i=[1/0,r.currentFloorId,0];for(let s=0;s<c(this,vn).length;s++){let a=c(this,vn)[s],l=Math.abs(((o=r.renderer.camera.elevation)!=null?o:0)-s*this.distanceBetweenFloors);l<i[0]&&(i[0]=l,i[1]=a.id,i[2]=s*this.distanceBetweenFloors)}c(this,lh)&&ee(this,Co,nY).call(this,i[2]),_(this,ah,0),r.renderer.off("user-interaction-end",c(this,b1))}});M(this,Al,null);M(this,v1,null);M(this,ou);M(this,hd);_(this,mr,r);let n=c(this,mr).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",c(this,y1)),n.renderer.on("camera-change",c(this,g1)),n.renderer.on("pre-render",c(this,h1)))}get state(){return c(this,fd)}get expanded(){return c(this,fd)!=="collapsed"}get distanceBetweenFloors(){if(c(this,nu)==="auto"){if(c(this,hd)!=null)return c(this,hd);let r=ee(this,Co,iY).call(this);if(r)return _(this,hd,r),r}return typeof c(this,nu)=="number"?c(this,nu):MO}clearCachedFloorSeparationDistance(){_(this,hd,void 0)}get includedFloors(){var r;return(r=c(this,Co,_O))!=null&&r.api.mapData?c(this,vn).map(n=>{var o,i;return(i=(o=c(this,Co,_O))==null?void 0:o.api.mapData)==null?void 0:i.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return c(this,md)}setFloorVisiblityMode(r){_(this,md,r);let n=c(this,mr).call(this);n!=null&&c(this,vn).forEach(o=>{n.api.updateState(o.containerId,{visible:c(this,md)==="all-floors"?!0:n.currentFloor.id===o.id})})}changeFloorOnElevationChanges(r){_(this,lh,r)}async expand(r){var o,i,s;let n=c(this,mr).call(this);if(n!=null)return(r==null?void 0:r.distanceBetweenFloors)==="auto"?_(this,nu,"auto"):_(this,nu,(o=r==null?void 0:r.distanceBetweenFloors)!=null?o:MO),_(this,vn,(r==null?void 0:r.includedFloors)!=null&&(r==null?void 0:r.includedFloors.length)>0?r==null?void 0:r.includedFloors.map(a=>n.floorsById.get(a.id)).filter(Boolean):n.currentFloorStack.floorObjects),c(this,vn).sort((a,l)=>a.elevation-l.elevation),c(this,vn).length<=1||this.expanded===!0?Promise.resolve():(_(this,ls,!0),n.api.Camera.setPanMode((i=r==null?void 0:r.cameraPanMode)!=null?i:"elevation"),this.changeFloorOnElevationChanges((s=r==null?void 0:r.changeFloorOnElevationChanges)!=null?s:!0),ee(this,Co,AO).call(this,"expand",r).then(()=>{_(this,fd,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{_(this,ls,!1)}))}async collapse(r){let n=c(this,mr).call(this);if(n!=null)return this.expanded===!0?(_(this,ls,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),ee(this,Co,AO).call(this,"collapse",r).then(()=>{_(this,fd,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{_(this,ls,!1)})):Promise.resolve()}destroy(){let r=c(this,mr).call(this);r!=null&&(r.renderer.off("user-interaction-start",c(this,y1)),r.renderer.off("camera-change",c(this,g1)),r.renderer.off("pre-render",c(this,h1)))}};mr=new WeakMap,ah=new WeakMap,ha=new WeakMap,ls=new WeakMap,vn=new WeakMap,m1=new WeakMap,nu=new WeakMap,lh=new WeakMap,fd=new WeakMap,Co=new WeakSet,_O=function(){return c(this,mr).call(this)},md=new WeakMap,h1=new WeakMap,y1=new WeakMap,g1=new WeakMap,b1=new WeakMap,Al=new WeakMap,nY=function(r){var o,i,s;c(this,Al)&&c(this,Al).stop();let n=c(this,mr).call(this);n!=null&&(_(this,Al,new xo({elevation:(o=n.renderer.camera.elevation)!=null?o:0}).to({elevation:r},150).easing(Ar.Quadratic.Out).onComplete(()=>{var a;c(this,Al)&&((a=c(this,mr).call(this))==null||a.renderer.getTweenGroup().remove(c(this,Al)))}).onUpdate(({elevation:a})=>{n.renderer.camera.setElevation(a)}).start()),(i=c(this,mr).call(this))==null||i.renderer.getTweenGroup().add(c(this,Al)),(s=c(this,mr).call(this))==null||s.renderer.render())},v1=new WeakMap,ou=new WeakMap,AO=function(r,n){var a,l,u,d;c(this,ha)&&c(this,ha).stop();let o=c(this,mr).call(this);if(o==null)return Promise.reject(new Error("No current map"));let i=c(this,vn).indexOf(o.currentFloor),s=(a=o.renderer.camera.elevation)!=null?a:0;return _(this,v1,new Promise(f=>{_(this,ou,f)})),_(this,ha,new xo({percentExpanded:this.expandedFactor}).to({percentExpanded:r==="expand"?1:0},(l=n==null?void 0:n.duration)!=null?l:GPe).easing(Sl[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:f})=>{this.expandedFactor=f;let h=i*this.distanceBetweenFloors;o.renderer.camera.setElevation(r==="expand"?h*f:s*f)}).onComplete(()=>{var f;c(this,ha)&&((f=c(this,mr).call(this))==null||f.renderer.getTweenGroup().remove(c(this,ha)))}).start()),c(this,ha).cameraAnimation=!0,(u=c(this,mr).call(this))==null||u.renderer.getTweenGroup().add(c(this,ha)),(d=c(this,mr).call(this))==null||d.renderer.render(),c(this,v1)},oY=function(r,n,o,i){let s=EO(r,o),a=n.clone(),l=EO(a,o);if(!du(s)||!du(l))return-1;let u=0,d;OO&&i.querySelectorAll(".debug-box").forEach(h=>h.remove());do{if(u>1e4)return-1;if(u+=20,a.position.z=u,a.updateMatrixWorld(),l.makeEmpty(),EO(a,o,l),d=s.intersectsBox(l),OO){let f=rY(s,"blue",i),h=rY(l,d?"red":"green",i);f.classList.add("debug-box"),h.classList.add("debug-box")}}while(d);return u},iY=function(){let r=c(this,mr).call(this);if(!r)return;let n=r.renderer,o=n.getThreeScene();if(!r.api.mapData||!o)return;let s=c(this,vn).length>0?c(this,vn):r.currentFloorStack.floorObjects;if(s.length<2)return;let a=n.getInternalState().geometry3DMap.get(s[0].id),l=n.getInternalState().geometry3DMap.get(s[1].id);if(!a||!l)return;if(qS(a,"group-container"),qS(l,"group-container"),OO){let d=new Xr;d.setFromObject(a);let f=new Xr;if(f.setFromObject(l),a.children.forEach(P=>{P instanceof Ve&&P.userData.debugBox&&fr(P)}),l.children.forEach(P=>{P instanceof Ve&&P.userData.debugBox&&fr(P)}),!du(d)||!du(f))return;let h=new Pi(d.max.x-d.min.x,d.max.y-d.min.y,d.max.z-d.min.z),b=new Br({color:255,transparent:!0,opacity:.5}),v=new Ve(h,b);v.position.set((d.min.x+d.max.x)/2,(d.min.y+d.max.y)/2,(d.min.z+d.max.z)/2),v.userData.debugBox=!0;let I=new Pi(f.max.x-f.min.x,f.max.y-f.min.y,f.max.z-f.min.z),x=new Br({color:"cyan",transparent:!0,opacity:.5}),C=new Ve(I,x);C.position.set((f.min.x+f.max.x)/2,(f.min.y+f.max.y)/2,(f.min.z+f.max.z)/2),C.userData.debugBox=!0,a.add(v),l.add(C)}let u=ee(this,Co,oY).call(this,a,l,n.getThreeCamera(),n.container);if(u!==-1)return u},hd=new WeakMap;var ru=new Ce,eY=new Ee;function EO(e,t,r=new cE){return e.traverse(n=>{if(n instanceof Ve){let i=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let a=0;a<i.count;a++)ru.fromBufferAttribute(i,a),ru.applyMatrix4(n.matrixWorld),ru.applyMatrix4(t.matrixWorldInverse),ru.applyMatrix4(t.projectionMatrix),ru.z<1&&ru.z>0&&(eY.set(ru.x,ru.y),r.expandByPoint(eY))}}),r}function tY(e,t){let r=t.clientWidth,n=t.clientHeight;return new Ee((e.x+1)*r/2,(1-e.y)*n/2)}function rY(e,t,r){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(t),n.style.pointerEvents="none";let o=tY(new Ee(e.min.x,e.min.y),r),i=tY(new Ee(e.max.x,e.max.y),r);n.style.left="".concat(o.x,"px"),n.style.top="".concat(i.y,"px");let s=Math.abs(i.x-o.x),a=Math.abs(i.y-o.y);return n.style.width="".concat(s,"px"),n.style.height="".concat(a,"px"),r.appendChild(n),n}p();p();function UPe(e,t){return"".concat(t," ").concat(e)}var Bn=class extends Error{constructor(t,r=VO){super(UPe(t,r)),this.name="MappedinError"}};var ch,x1=class{constructor(t,r,n,o){m(this,"id");m(this,"externalId");m(this,"name");m(this,"type");m(this,"floorIds");m(this,"defaultFloorId");m(this,"floorObjects",[]);m(this,"floorObjectsByElevation",new Map);m(this,"metadata");m(this,"containerId");m(this,"facade");m(this,"renderer");M(this,ch);var s;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(s=t.floors)!=null?s:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=n;let i=n.addGroupContainer(this.id,{visible:!0,interactive:!0},r);this.containerId=i.id.toString(),this.facade=o}get defaultFloor(){if(c(this,ch)==null){if(this.floorObjects.length===0)throw new Bn("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(r=>r.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r)),_(this,ch,t)}return c(this,ch)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){$.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var r,n;(n=(r=this.facade)==null?void 0:r.spaces)==null||n.forEach(o=>{this.renderer.setState(o.spaceId,{visible:t})})}};ch=new WeakMap;p();function sY(e,t,r,n){let o={outdoorOpacity:1,floorStates:[]},i=e.sort((d,f)=>d.elevation-f.elevation),s=Math.min(0,i[0].elevation),a=i[i.length-1].elevation,l,u;for(let d=s;d<=a;d++){let f=i.find(x=>x.elevation===d);if(f==null){d>=0&&(l==null?l=d:u=d);continue}let h=0,b=d<0?Math.abs(f.elevation)*r:r,v=!1;if(l===0&&u!=null){let x=r*u;h=-x,b=x,v=!0}else if(l!=null&&u!=null){let x=l,C=e.find(w=>w.elevation===x-1),P=o.floorStates.find(w=>w.floor===C);if(P){let w=r*(u-l+2);P.state.footprint={...P.state.footprint,altitude:0,height:w,visible:!0}}}l=void 0,u=void 0;let I={floor:f,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};o.floorStates.push(I),f.id===t.id?(I.state.visible=!0,I.state.geometry.visible=!0,I.state.labels.enabled=!0,I.state.markers.enabled=!0,I.state.occlusion.enabled=!0,(f.elevation<0||v)&&(f.elevation<0&&(o.outdoorOpacity=.2),I.state.footprint.height=b,I.state.footprint.altitude=h,I.state.footprint.visible=!0)):n.includes(f.id)&&f.elevation<t.elevation?(I.state.visible=!0,I.state.geometry.visible=!0,I.state.markers.enabled=!0,I.state.occlusion.enabled=!0,I.state.footprint.visible=!0,f.elevation<0?(I.state.footprint.height=b,I.state.footprint.altitude=h,o.outdoorOpacity=.2):(I.state.footprint.height=b,I.state.footprint.altitude=h)):t.elevation>0&&f.elevation<t.elevation&&f.elevation>=0&&(I.state.visible=!0,I.state.footprint.visible=!0,I.state.footprint.height=r,I.state.footprint.altitude=h)}return o}var VPe={linear:Ar.Linear.None,easeIn:Ar.Quadratic.In,easeOut:Ar.Quadratic.Out,easeInOut:Ar.Quadratic.InOut},ya,I1=class extends De{constructor(r,n,o,i){var u,d,f,h;super();m(this,"floorStacksById",new Map);m(this,"floorsById",new Map);m(this,"currentFloorId","");m(this,"currentFloorStackId","");m(this,"outdoorFloorStacks",new Set);m(this,"id");m(this,"renderer");m(this,"api");m(this,"mvf");m(this,"options",{});m(this,"styleMap");m(this,"StackedMaps");m(this,"animations",new Map);m(this,"Models",{add:(r,n,o)=>{let{floorId:i,scale:s,...a}=o,l=i?this.floorsById.get(i):this.currentFloor,u={...a};s!=null&&(u.scale=Array.isArray(o.scale)?o.scale:[o.scale,o.scale,o.scale]);let d=this.renderer.addModelGroup(r,{type:"FeatureCollection",features:n.map(f=>{var h;return{type:"Feature",properties:{id:Et(),rotation:o.rotation,scale:u.scale,interactive:o.interactive,verticalOffset:f.verticalOffset+((h=o.verticalOffset)!=null?h:0)},geometry:{type:"Point",coordinates:yi(f)}}})},u,{parent:l.id});if(d==null)throw new Bn("error creating model");return this.renderer.getState(d).children},remove:(r,n)=>{this.renderer.remove(r),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)}});m(this,"Images",{add:(r,n,o)=>{let{floorId:i,flipImageToFaceCamera:s,...a}=o,l=i?this.floorsById.get(i):this.currentFloor,u={type:"Feature",properties:a,geometry:{type:"Point",coordinates:r}};return this.renderer.addImage(Et(),u,{url:n,flipImageToFaceCamera:s!=null?s:!1},l.id)},remove:r=>{this.renderer.remove(r)},removeAll:()=>{}});m(this,"Markers",{add:(r,n,o)=>{let i=j4(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),{attachTo:s,...a}=o,l=a;a.rank==="initial"&&(l.rank="medium");let u=i.layers.get(Qs),d=this.renderer.addMarker2D(yi(r),n,{...l,occluderId:i==null?void 0:i.occluderId,attachTo:s},u==null?void 0:u.containerId);if(!d)throw new Bn("Failed to create Marker");return d},remove:r=>{this.renderer.remove(r)},getContentEl:r=>{let n=this.renderer.getState(r);if((n==null?void 0:n.type)==="marker")return n.element},removeAll:()=>{},setPosition:(r,n,o)=>{var a;let i=this.renderer.getState(r),s=o?this.floorsById.get(o):this.currentFloor;if(!i){$.error('Failed to retrieve state for Marker with id "'.concat(r,'".'));return}if(i.type!=="marker"){$.error('Geometry with id "'.concat(r,'" is not of type "marker".'));return}this.renderer.setState(i,{position:n,parent:(a=s==null?void 0:s.layers.get(Qs))==null?void 0:a.containerId})},animateTo:(r,n,o,i)=>{let s=this.renderer.getState(r),a=o?this.floorsById.get(o):this.currentFloor;if(!s)return $.error('Failed to retrieve state for Marker with id "'.concat(r,'".')),Promise.resolve();if(s.type!=="marker")return $.error('Geometry with id "'.concat(r,'" is not of type "marker".')),Promise.resolve();let l={duration:1e3,easing:"ease-in-out",...i};this.cancelAnimation(r);let u=new xo({lon:s.position[0],lat:s.position[1]}).to({lon:n[0],lat:n[1]},l.duration).easing(VPe[l.easing]).onUpdate(({lon:d,lat:f})=>{var b;if(!this.renderer.getState(r))this.cancelAnimation(r);else{let v=(b=a==null?void 0:a.layers.get(Qs))==null?void 0:b.containerId;v&&this.Markers.setPosition(r,[d,f],v)}}).start();return this.renderer.getTweenGroup().add(u),this.renderer.render(),this.animations.set(r,u),$4(u).then(()=>{this.animations.delete(r)})}});m(this,"Exporter",{getCurrentSceneGLTF:async r=>this.renderer.getCurrentSceneGLTF(r)});m(this,"Shapes",{add:(r,n,o)=>{let i=o!=null&&o.floorId?this.floorsById.get(o==null?void 0:o.floorId):this.currentFloor,s=Et();return this.renderer.addGeometryGroup(s,r,n,i.id),s},remove:r=>(this.renderer.remove(r.id),r.id)});m(this,"Text3D",{label:(r,n,o)=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode)){$.warn("Enterprise mode is not enabled, skipping label creation");return}let i=aY(this.renderer,r,n,o);if(i)return{textInfo:i,target:r}},labelAll:(r={})=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode))return $.warn("Enterprise mode is not enabled, skipping label creation"),[];let n=this.api.getMapData();if(!n)return[];let o=[];return n.getByType("space").forEach(s=>{var a,l;if(s.locations[0]){let u=aY(this.renderer,s,(l=(a=s.locations[0])==null?void 0:a.name)!=null?l:s.name,r);u&&o.push({textInfo:u,target:s})}}),o},remove:r=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){$.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(r),r}});m(this,"Labels",{all:({onCreate:r,labelOptions:n={}})=>{for(let o of Object.entries(this.mvf.space)){let[i,s]=o;s&&s.features.forEach(a=>{var I,x,C,P,w;let l=(I=this.api.getMapData())==null?void 0:I.getById("space",a.properties.id);if(!l)return;let u=(x=this.styleMap[a.properties.id])==null?void 0:x.showImage,d=(C=a.properties.details)==null?void 0:C.images,h={marker:{...u&&((P=d==null?void 0:d[0])!=null&&P.url)?{icon:d[0].url}:{},...(w=n.appearance)==null?void 0:w.marker},...n.appearance},v=(i?this.floorsById.get(i):this.currentFloor).layers.get(al);if(a.properties.center&&l.name!==""){let T=this.renderer.addLabel2D(a.properties.center,l.name,{id:a.properties.id+"-label",...n,appearance:h,rank:n.rank,attachTo:mm(l)},Qr.is(l)?l.id:v==null?void 0:v.containerId);T&&r(T.id,l.name,l)}})}},add:(r,n,o={})=>{let{attachTo:i,...s}=o,a=j4(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),l=a.layers.get(al),u=this.renderer.addLabel2D(yi(r),n,{...s,occluderId:a.occluderId,attachTo:i},l==null?void 0:l.containerId);if(!u)throw new Bn("label creating failed");return u},remove:({entityId:r})=>{this.renderer.remove(r)},removeAll:()=>{}});m(this,"Paths",{add:(r,n)=>{var u;let o=(u=n==null?void 0:n.animateDrawing)!=null?u:!0,i=[],s=r[0].floorId||"root",a=0;for(let d of r){let{floorId:f="root",latitude:h,longitude:b}=d;f!==s&&(a++,s=f),i[a]==null&&i.push({floorId:f,coordinates:[]});let v=f===d.floorId?d:new Le({longitude:b,latitude:h,floorId:f});i[a].coordinates.push(v)}let l=i.reduce((d,{floorId:f,coordinates:h},b)=>{if(b!==0){let I=i[b-1],x=I.coordinates[I.coordinates.length-1],C=h[0],P=yi(x),w=yi(C),T=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:I.floorId},geometry:{type:"Point",coordinates:P}},{type:"Feature",properties:{parentId:f},geometry:{type:"Point",coordinates:w}}]},n,this.id);T&&(n!=null&&n.animateDrawing&&this.renderer.setState(T.id,{completeFraction:0}),d.push({...T,coordinates:[x,C]}))}let v=this.renderer.addPath({type:"FeatureCollection",features:h.map(I=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:yi(I)}}))},n,f);return v&&(n!=null&&n.animateDrawing&&this.renderer.setState(v.id,{completeFraction:0}),d.push({...v,coordinates:h})),d},[]);if(o){let d=[],f=this.api.getMapData();return l.forEach(h=>{var v;let b=KH(h,f,this.api);d.push(new xo({fraction:0}).to({fraction:1},b===!1?0:(v=n==null?void 0:n.drawDuration)!=null?v:1500).onUpdate(I=>{this.renderer.setState(h.id,{completeFraction:I.fraction})}))}),d.forEach((h,b)=>{b<d.length-1&&h.chain(d[b+1]),this.renderer.getTweenGroup().add(h)}),d[0].start(),this.renderer.render(),this.animations.set(l[0].id.toString(),d[0]),{paths:l,animation:$4(d[d.length-1]).then(()=>{this.animations.delete(l[0].id.toString())})}}else return{paths:l,animation:Promise.resolve()}},remove:r=>{r.forEach(n=>{this.cancelAnimation(n),this.renderer.remove(n)})}});M(this,ya,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=i.core,this.api=i,this.id=r,this.renderer.addGroupContainer(r,{},"root"),this.options=o!=null?o:{},this.StackedMaps=new f1({currentMapGetter:()=>this}),this.mvf=(u=n==null?void 0:n.mvf)!=null?u:{};let s=qH(this.mvf["styles.json"]||{});if(this.styleMap=s,_(this,ya,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0,...o==null?void 0:o.multiFloorView}),!n){this.id!=="outdoors-container"&&$.warn("Map (".concat(this.id,") created with no data."));let b=new x1({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(b.id,b),this.currentFloorStackId=b.id;let v=new d1(b.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,c(this,ya),o!=null?o:{});b.addFloor(v),this.floorsById.set(v.id,v),this.setFloor(v.id);return}let a=n.getMVFFeatureByType("floor-stack");if(a==null||a.length===0)throw new Bn("MVF does not contain any Floor Stacks.");for(let b of a){let v=new x1(b,this.id,this.renderer,(d=this.mvf.facade)==null?void 0:d[b.id]);if(v.floorIds.length!==0){for(let I of v.floorIds){let x=n.getMVFFeatureById("floor",I);if(x!=null){let C=this.mvf.space[x.id],P=this.mvf.obstruction[x.id];if((C==null||C.features.length===0)&&(P==null||P.features.length===0))continue;let w=new d1(v.id,x,this.renderer,c(this,ya),o!=null?o:{},this.mvf,s,n);v.addFloor(w),this.floorsById.set(w.id,w)}}this.floorStacksById.set(b.id,v),this.currentFloorStackId||(this.currentFloorStackId=b.id)}}for(let[b]of Object.entries(n.facadesBySpaceId)){let v=n.getById("space",b);v&&(this.outdoorFloorStacks.add(v.floor.floorStack.id),(f=this.floorsById.get(v.floor.id))==null||f.setVisible(!0))}let l=(h=this.mvf.enterprise)==null?void 0:h.venue.defaultMap;if(o!=null&&o.initialFloor){let b=ag(o.initialFloor);b&&this.floorsById.has(b)?l=b:$.error("Invalid initial floor specified (".concat(o.initialFloor,"), using default behavior instead"))}l||(l=this.currentFloorStack.defaultFloor.id),this.setFloor(l)}get currentFloorStack(){let r=this.floorStacksById.get(this.currentFloorStackId);if(!r)throw new Bn('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return r}setFloorStack(r,n){if(this.currentFloorStackId===r)return;let o=this.floorStacksById.get(r);if(o==null){$.error("Invalid floor stack passed to setFloorStack (".concat(r,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(o.floorObjects.length===0){$.error("Floor stack (".concat(r,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(o.defaultFloor.id,n)}get currentFloor(){let r=this.floorsById.get(this.currentFloorId);if(!r)throw new Bn('Floor with id "'.concat(this.currentFloorId,'" not found'));return r}get floors(){return Array.from(this.floorsById.values())}processFloorChange(r){var i,s,a,l,u;if(this.api.manualFloorVisibility===!0||this.StackedMaps.expandedFactor!==0)return;let n=this.floorsById.get(r),o=this.floorStacksById.get(this.currentFloorStackId);if(n&&o)if(!((i=c(this,ya))!=null&&i.enabled)||n.floorStackId!==(o==null?void 0:o.id))for(let d of this.floorStacksById.values())d.floorObjects.forEach(f=>{f.id!==r&&f.setVisible(!1)});else{let d=sY(this.currentFloorStack.floorObjects,n,c(this,ya).floorHeight,((a=(s=this.api.Navigation)==null?void 0:s.floors)==null?void 0:a.map(f=>f.id))||[]);(u=(l=this.api)==null?void 0:l.Outdoor)==null||u.setOpacity(d.outdoorOpacity),d.floorStates.forEach(f=>{f.floor&&this.api.updateState(f.floor.id,f.state)}),c(this,ya).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*c(this,ya).floorHeight)}}setFloor(r,n){if(this.currentFloorId===r)return;if(!this.floorsById.get(r)){$.error("Invalid floor passed to setFloor (".concat(r,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let i=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:i,floorId:r,reason:n}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.processFloorChange(r),this.currentFloorId=r,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.publish("floor-change",{reason:n,floorId:this.currentFloor.id,previousFloorId:i})}cancelAnimation(r){let n=this.animations.get(r);n&&(n.stop(),this.animations.delete(r),this.renderer.getTweenGroup().remove(n))}};ya=new WeakMap;function aY(e,t,r,n){return e.labelText3D(t.id,r!=null?r:t.name,{...n,parentId:t.floor.id})}p();var cs,C1,S1=class{constructor({currentMapGetter:t}){M(this,cs,new Map);M(this,C1);_(this,C1,t)}get currentMap(){return c(this,C1).call(this)}getById(t){return c(this,cs).get(t)}add(t,r,n){let o=t.anchorTarget;if(!o)throw new Error("get coordinate failed");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let s=i.Markers.add(o,r,{...n,rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(n==null?void 0:n.dynamicResize)||!1,attachTo:mm(t)});if(s==null)throw new Error("error creating marker");let a=i.Markers.getContentEl(s.id.toString());if(!a)throw new Error("marker component should exist");let l=new Tl(s.id.toString(),a,t);return c(this,cs).set(l.id,{marker:l,entityId:s.id.toString()}),l}remove(t){var n;let r=c(this,cs).get(t.id);r&&((n=this.currentMap)==null||n.Markers.remove(r.entityId),c(this,cs).delete(t.id.toString()))}removeAll(){let t=[];return c(this,cs).forEach(({marker:r})=>{this.remove(r),t.push(r),c(this,cs).delete(r.id.toString())}),t}setPosition(t,r){var s;let n=r.anchorTarget;if(!n){$.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){$.error("Cannot determine the current map.");return}let i=c(this,cs).get(t.id);if(!i){$.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(i.entityId,yi(n),(s=n.floorId)!=null?s:o.currentFloorId),i.marker.updateTarget(r)}animateTo(t,r,n){var a;let o=r.anchorTarget;if(!o)return $.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return $.error("Cannot determine the current map."),Promise.resolve();let s=c(this,cs).get(t.id);return s?(s.marker.updateTarget(r),i.Markers.animateTo(s.entityId,yi(o),(a=o.floorId)!=null?a:i.currentFloorId,n)):($.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};cs=new WeakMap,C1=new WeakMap;p();var kl,T1,P1=class{constructor({currentMapGetter:t}){M(this,kl,new Map);M(this,T1);_(this,T1,t)}get currentMap(){return c(this,T1).call(this)}getById(t){return c(this,kl).get(t)}add(t,r,n){var l;let o=t.anchorTarget;if(!o)throw new Error("Target does not implement IAnchorable.");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let s=i.Images.add(yi(o),r,{...n,floorId:o.floorId,verticalOffset:o.verticalOffset+((l=n.verticalOffset)!=null?l:0)});if(!s)throw new Error("image component should exist");let a=new Kb(s.id.toString(),r,t);return c(this,kl).set(a.id,{image:a,entityId:s.id.toString()}),a}remove(t){var n;let r=c(this,kl).get(t.id);r&&((n=this.currentMap)==null||n.Images.remove(r.entityId),c(this,kl).delete(t.id.toString()))}removeAll(){let t=[];return c(this,kl).forEach(({image:r})=>{this.remove(r),t.push(r),c(this,kl).delete(r.id.toString())}),t}};kl=new WeakMap,T1=new WeakMap;p();var ga,M1,w1=class{constructor({currentMapGetter:t}){M(this,ga,new Map);M(this,M1);_(this,M1,t)}get currentMap(){return c(this,M1).call(this)}getById(t){return c(this,ga).get(t)}add(t,r,n){let o=[t],i=o.reduce((l,u)=>{var d;return u?(l.has(u.floorId)||l.set(u.floorId,[]),(d=l.get(u.floorId))==null||d.push(u),l):($.error("Cannot determine coordinate from options."),l)},new Map);if(!o.length)throw new Error("targets should not be empty when adding a model");let s=this.currentMap;if(!s)throw new Error("currentMap should exist");let a=[];return i.forEach((l,u)=>{let d=Et();s.Models.add(d,l,{...n,url:r,floorId:u}).forEach(({id:h})=>{let b=new cd(h.toString(),d,l[0]);c(this,ga).set(b.id,{model:b,entityId:h.toString(),groupId:d}),a.push(b)})}),a[0]}remove(t){var n;let r=c(this,ga).get(t.id);r&&((n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),c(this,ga).delete(t.id.toString()))}removeAll(){let t=[];return c(this,ga).forEach(({model:r})=>{var o;let n=c(this,ga).get(r.id);n&&(t.push(r),(o=this.currentMap)==null||o.Models.remove(n.entityId,n.groupId),c(this,ga).delete(r.id.toString()))}),t}};ga=new WeakMap,M1=new WeakMap;p();var ba,E1,O1=class{constructor({currentMapGetter:t}){M(this,ba,new Map);M(this,E1);_(this,E1,t)}get currentMap(){return c(this,E1).call(this)}getById(t){return c(this,ba).get(t)}add(t,r){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let o=n.Paths.add(t,r),i=o.paths.map(a=>a.id.toString()),s=new os(Et(),o.animation,t,o.paths);for(let a of i)c(this,ba).set(a,{path:s,entityIds:i});return c(this,ba).set(s.id,{path:s,entityIds:i}),s}remove(t){var n;let r=c(this,ba).get(t.id);r&&((n=this.currentMap)==null||n.Paths.remove(r.entityIds),c(this,ba).delete(t.id),r.entityIds.forEach(o=>c(this,ba).delete(o)))}removeAll(){let t=[];return c(this,ba).forEach(({path:r})=>{this.remove(r),t.push(r)}),t}};ba=new WeakMap,E1=new WeakMap;p();var vY=fs(S5(),1);p();var kO="#2266ff",zPe="#808080",lY="#f5f5f5";var cY={radius:10,color:kO,inactiveColor:zPe,heading:{color:kO,opacity:.7},accuracyRing:{color:kO,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};p();var uY="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";p();var pY=(e,t,r=0)=>{if(Math.abs(e)>=Math.PI)throw new Error("Sector angle too wide!");let n=r/Math.tan(e/2),o=r/Math.sin(e/2),i=o+t,s=10,a=new hs;a.moveTo(-o*Math.sin(e/2),o*Math.cos(e/2)-n);for(let l=0;l<s;l++)a.lineTo(-(i*Math.sin(e/2-e/s*l)),i*Math.cos(e/2-e/s*l)-n);for(let l=0;l<s;l++)a.lineTo(-(r*Math.sin(Math.PI/-2+Math.PI/s*l)),r*Math.cos(Math.PI/-2+Math.PI/s*l));return new ys(a,{depth:.1,bevelEnabled:!1,UVGenerator:WPe(t)})},DO=(e,t,r)=>{let o=Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/r;return o>1?o=1:o<0&&(o=0),new Ee(0,o)},WPe=e=>({generateTopUV:(t,r,n,o,i)=>{let s=r[n*3],a=r[n*3+1],l=r[o*3],u=r[o*3+1],d=r[i*3],f=r[i*3+1];return[DO(s,a,e),DO(l,u,e),DO(d,f,e)]},generateSideWallUV:()=>[new Ee(0,1),new Ee(0,1),new Ee(0,1),new Ee(0,1)]});function dY(e,t){if(t==null)return e;let r={latitude:e==null?void 0:e.latitude,longitude:e==null?void 0:e.longitude,accuracy:e==null?void 0:e.accuracy,floor:e==null?void 0:e.floor,heading:e==null?void 0:e.heading};return"latitude"in t&&(r.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?e==null?void 0:e.latitude:t.latitude),"longitude"in t&&(r.longitude=t.longitude==null||t.longitude==="device"?e==null?void 0:e.longitude:t.longitude),"accuracy"in t&&(r.accuracy=t.accuracy==="device"?e==null?void 0:e.accuracy:t.accuracy),"floor"in t&&(r.floor=t.floor==="device"?e==null?void 0:e.floor:t.floor),"heading"in t&&(r.heading=t.heading==="device"?e==null?void 0:e.heading:t.heading),r}function qPe([e,t],[r,n],[o,i]){let s=r-e,a=n-t,l=s**2+a**2;if(l===0)return;let u=((o-e)*s+(i-t)*a)/l,d;u<=0?d=[e,t]:u>=1?d=[r,n]:d=[e+u*s,t+u*a];let f=t0([o,i],d);return{proportion:Math.max(0,Math.min(1,u)),intersection:d,distance:f}}function fY(e,t){if(e==null||e.length<2)return;let r=Number.MAX_SAFE_INTEGER,n,o=0,i=0;for(let s=0;s<e.length-1;s++){let a=e[s],l=e[s+1],u=qPe(a,l,t);u!=null&&u.distance<r&&(r=u.distance,n=u.intersection,o=s,i=u.proportion)}if(n)return{intersection:n,distance:r,segmentIndex:o,proportion:i}}function mY(e,t){let r=new wi({color:e,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,o=.35*4,i=pY(Math.PI/6,o,n);new Td().load(uY,a=>{r.alphaMap=a,r.needsUpdate=!0});let s=new Ve(i,r);return s.position.z=-.05,s.renderOrder=0,s}function hY(e,t){let r=new K1(1,1,.05,32),n=new wi({transparent:!0,color:e,opacity:t,depthTest:!1,depthWrite:!1}),o=new Ve(r,n);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}function yY(e){let t=new K1(.35,.35,.07,32),r=new wi({transparent:!0,color:lY,depthTest:!1,depthWrite:!1}),n=new Ve(t,r);n.renderOrder=2;let o=new K1(.35*.8,.35*.8,.01,32),i=new wi({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),s=new Ve(o,i);return s.renderOrder=3,n.rotation.x=Math.PI/2,n.position.z=.07/2,s.rotation.x=Math.PI/2,s.position.z=.07,{outerMesh:n,innerMesh:s}}var xY=fs(gY(),1);var DS="blue-dot",yd,Dl,Uo,Vo,Fl,gd,bd,vd,kr,Po,_1,Ll,A1,k1,D1,F1,AS,va,Rl,kS,xd,L1,xa,ph=class extends De{constructor(r,n){super();this.core=r;this.geoJSONApi=n;M(this,yd,null);m(this,"geometry");M(this,Dl);M(this,Uo);M(this,Vo);M(this,Fl);M(this,gd);M(this,bd);M(this,vd);M(this,kr,cY);M(this,Po,1);M(this,_1);M(this,Ll);m(this,"state","disabled");m(this,"following",!1);M(this,A1,r=>{var n;return(n=this.geoJSONApi.getMapData())==null?void 0:n.getById("floor",r)});M(this,k1,r=>{var o;let n;if(r!=null){let i=(o=this.geoJSONApi.currentMap)==null?void 0:o.currentFloorStack.floorObjectsByElevation.get(r);n=i?c(this,A1).call(this,i.id):void 0}return n});M(this,D1,r=>{if(this.state==="hidden"||this.state==="disabled")return;let[n,o,i,s]=r.children;if(c(this,AS).call(this),o.scale.set(c(this,Po),c(this,Po),c(this,Po)),o.position.z=.07/2*c(this,Po),i.scale.set(c(this,Po),c(this,Po),c(this,Po)),i.position.z=.07*c(this,Po),this.state==="active"){i.material.color.set(c(this,kr).color);let a=this.accuracy;a!=null?(n.visible=!0,c(this,bd)&&c(this,bd).stop(),_(this,bd,new xo({scale:n.scale.x}).to({scale:a/2},150).onUpdate(({scale:u})=>{n.scale.set(u,1,u)}).start()),this.core.getTweenGroup().add(c(this,bd))):n.visible=!1;let l=this.heading;if(l!=null){s.visible=!0,c(this,vd)&&c(this,vd).stop();let{start:u,end:d}=r0(s.rotation.z,-Ye.degToRad(l));_(this,vd,new xo({rotation:u}).to({rotation:d},150).onUpdate(({rotation:f})=>{s.rotation.z=f}).start()),this.core.getTweenGroup().add(c(this,vd)),s.scale.set(c(this,Po),c(this,Po),1)}else s.visible=!1}else this.state==="inactive"&&(i.material.color.set(c(this,kr).inactiveColor),s.visible=!1,n.visible=!1)});M(this,F1,r=>{var s,a;let n;try{n=JPe.parse(dY(r,c(this,Uo)))}catch(l){c(this,va).call(this,"error"),$.error("BlueDot: Position parse failed",l instanceof B.ZodError?l.message:String(l)),this.publish("error");return}c(this,kr).debug&&$.log("BlueDot: Parsed position",n),_(this,Vo,n),c(this,va).call(this,"position-update"),c(this,Fl)&&clearTimeout(c(this,Fl)),typeof c(this,kr).timeout=="number"&&c(this,kr).timeout<1/0&&_(this,Fl,setTimeout(()=>{c(this,kr).debug&&$.log("BlueDot: Position timed out after ".concat(c(this,kr).timeout,"ms")),c(this,va).call(this,"timeout"),this.core.render()},c(this,kr).timeout)),(a=this.geoJSONApi.getMapDataInternal())==null||a.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:n.latitude,longitude:n.longitude,floorLevel:(s=n.floor)==null?void 0:s.elevation,accuracy:n.accuracy}});let o=n.floor!=null?n.floor.id:"outdoors-container",i=[n.longitude,n.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(DS,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:i}},{setup:l=>{let u=hY(c(this,kr).accuracyRing.color,c(this,kr).accuracyRing.opacity),{outerMesh:d,innerMesh:f}=yY(c(this,kr).color),h=mY(c(this,kr).heading.color,c(this,kr).heading.opacity);l.add(u),u.visible=!1,l.add(d),l.add(f),l.add(h),h.visible=!1,c(this,D1).call(this,l)},update:c(this,D1)},{visible:!0,interactive:!0},o);else{let l=this.core.getState(this.geometry);i=[l.position[0],l.position[1]]}c(this,gd)&&c(this,gd).stop(),_(this,gd,new xo(i).to([n.longitude,n.latitude],1e3).easing(Ar.Cubic.Out).onUpdate(l=>{if(this.geometry){let u={position:[l[0],l[1]]};u.parent=o,this.core.setState(this.geometry,u)}}).start()),this.core.getTweenGroup().add(c(this,gd)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()});m(this,"onPositionUpdate",r=>{var n,o,i,s,a;if(this.state!=="disabled"){try{KPe.parse(r)}catch(l){c(this,va).call(this,"error"),$.error("BlueDot: Browser sent invalid position",l instanceof B.ZodError?l.message:String(l)),this.publish("error");return}_(this,Dl,{latitude:(n=r.coords)==null?void 0:n.latitude,longitude:(o=r.coords)==null?void 0:o.longitude,accuracy:(i=r.coords)==null?void 0:i.accuracy,heading:(s=r.coords)==null?void 0:s.heading,floor:c(this,k1).call(this,(a=r.coords)==null?void 0:a.floorLevel)}),c(this,F1).call(this,c(this,Dl))}});m(this,"onPositionError",r=>{var n;switch(c(this,va).call(this,"error"),r.code){case r.PERMISSION_DENIED:$.error("Geolocation permission denied by the user.",r),(n=this.geoJSONApi.getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case r.POSITION_UNAVAILABLE:$.error("Geolocation position unavailable.",r);break;case r.TIMEOUT:$.error("Geolocation request timed out.",r);break;default:$.error("An unknown geolocation error occurred.",r);break}this.publish("error",r)});M(this,AS,()=>{var n;let r=Math.round(this.core.camera.zoomLevel*1e5);if(r!==c(this,_1)){_(this,_1,r);let o=(n=this.core.getMetresPerPixel())!=null?n:1;_(this,Po,Math.max(c(this,kr).radius/(.35/o),1))}});M(this,va,r=>{let n=YPe[this.state].actions[r];if(n){switch(c(this,kr).debug&&$.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(n," using ").concat(r)),n){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==n&&(this.publish("state-change",{state:n,action:r}),this.state=n)}else $.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(r))});M(this,Rl);M(this,kS,()=>{if(c(this,Rl)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let n=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(o=>o.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(o=>o.floorId===this.geoJSONApi.currentFloor.id);_(this,Rl,(0,xY.default)(n.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return c(this,Rl)});M(this,xd,()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),c(this,xa)&&(this.off("position-update",c(this,xa)),_(this,xa,void 0)),this.following=!1,_(this,Rl,void 0),this.core.off("user-interaction-start",c(this,xd)),this.geoJSONApi.currentMap.off("navigation-active-path-change",c(this,L1)),this.publish("follow-change",{following:!1})});M(this,L1,()=>{_(this,Rl,void 0)});M(this,xa);m(this,"follow",(r,n)=>{var i,s,a,l;if(r===!1){c(this,xd).call(this);return}r!=="position-only"&&(n==null?void 0:n.bearing)!=null&&$.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(r,"'. To control the bearing manually, use mode 'position-only'."));let o={zoomLevel:(i=n==null?void 0:n.zoomLevel)!=null?i:21,bearing:r==="position-only"?n==null?void 0:n.bearing:void 0,pitch:(s=n==null?void 0:n.pitch)!=null?s:45,duration:(a=n==null?void 0:n.duration)!=null?a:1e3,easing:(l=n==null?void 0:n.easing)!=null?l:"ease-in-out"};this.following?c(this,xa)&&this.off("position-update",c(this,xa)):(this.following=!0,this.core.on("user-interaction-start",c(this,xd)),this.geoJSONApi.currentMap.on("navigation-active-path-change",c(this,L1))),_(this,xa,u=>{let{coordinate:d,heading:f,floor:h}=u;if(o.center=[d.longitude,d.latitude],h!=null&&h.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(h.id),_(this,Rl,void 0)),r==="position-and-heading")o.bearing=f!=null?f:void 0;else if(r==="position-and-path-direction"){let b=c(this,kS).call(this);if(b!=null){let v=fY(b,[d.longitude,d.latitude]);if(v!=null){let I=b[v.segmentIndex],x=b[v.segmentIndex+1];o.bearing=fE(I,x)}}}this.core.camera.animateTo(o)}),this.on("position-update",c(this,xa)),this.publish("follow-change",{following:!0,mode:r})})}get heading(){var r;return(r=c(this,Vo))==null?void 0:r.heading}get accuracy(){var r;return(r=c(this,Vo))==null?void 0:r.accuracy}get coordinate(){var r,n;if(c(this,Vo)!=null)return(c(this,Ll)==null||((r=this.floor)==null?void 0:r.id)!==c(this,Ll).floorId||c(this,Vo).latitude!==c(this,Ll).latitude||c(this,Vo).longitude!==c(this,Ll).longitude)&&_(this,Ll,new Le(c(this,Vo).latitude,c(this,Vo).longitude,(n=this.floor)==null?void 0:n.id)),c(this,Ll)}get floor(){var r;return(r=c(this,Vo))==null?void 0:r.floor}enable(r){_(this,kr,(0,vY.default)({},r,c(this,kr))),c(this,va).call(this,"enable"),this.watchDevicePosition(c(this,kr).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),c(this,Fl)&&(clearTimeout(c(this,Fl)),_(this,Fl,void 0)),this.following&&c(this,xd).call(this),this.watchDevicePosition(!1),_(this,Vo,void 0),_(this,Uo,void 0),c(this,va).call(this,"disable")}watchDevicePosition(r){if(c(this,yd)&&(navigator.geolocation.clearWatch(c(this,yd)),_(this,yd,null)),c(this,Dl)&&_(this,Dl,void 0),r){if(this.state==="disabled"){$.warn("BlueDot must be enabled before watching browser position.");return}_(this,yd,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(r){var o,i;r==null?_(this,Uo,void 0):"coords"in r?_(this,Uo,Object.assign({},c(this,Uo),{latitude:r.coords.latitude,longitude:r.coords.longitude,accuracy:r.coords.accuracy,heading:r.coords.heading,floor:c(this,k1).call(this,r.coords.floorLevel)})):(_(this,Uo,Object.assign({},c(this,Uo),r)),"floorOrFloorId"in r&&(c(this,Uo).floor=typeof r.floorOrFloorId=="string"&&r.floorOrFloorId!=="device"?c(this,A1).call(this,r.floorOrFloorId):r.floorOrFloorId)),(((o=c(this,Uo))==null?void 0:o.latitude)!=null&&((i=c(this,Uo))==null?void 0:i.longitude)!=null||c(this,Dl)!=null)&&c(this,F1).call(this,c(this,Dl))}};yd=new WeakMap,Dl=new WeakMap,Uo=new WeakMap,Vo=new WeakMap,Fl=new WeakMap,gd=new WeakMap,bd=new WeakMap,vd=new WeakMap,kr=new WeakMap,Po=new WeakMap,_1=new WeakMap,Ll=new WeakMap,A1=new WeakMap,k1=new WeakMap,D1=new WeakMap,F1=new WeakMap,AS=new WeakMap,va=new WeakMap,Rl=new WeakMap,kS=new WeakMap,xd=new WeakMap,L1=new WeakMap,xa=new WeakMap;var YPe={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",disable:"disabled",timeout:"hidden"}},active:{actions:{enable:"active",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},inactive:{actions:{enable:"inactive",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},disabled:{actions:{enable:"hidden",disable:"disabled"}}},KPe=B.object({coords:B.object({latitude:B.number(),longitude:B.number(),accuracy:B.number(),altitude:B.number().optional().nullable(),altitudeAccuracy:B.number().optional().nullable(),heading:B.number().optional().nullable(),speed:B.number().optional().nullable(),floorLevel:B.number().optional().nullable()}),timestamp:B.number()}),JPe=B.object({latitude:B.number(),longitude:B.number(),floor:B.custom().optional(),accuracy:B.number().optional(),heading:B.number().optional().nullable()});p();var Nl,N1,R1=class{constructor({currentMapGetter:t}){M(this,Nl,new Map);M(this,N1);_(this,N1,t)}get currentMap(){return c(this,N1).call(this)}getById(t){return c(this,Nl).get(t)}add(t,r,n){let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let i=o.Shapes.add(t,r||{},{floorId:n==null?void 0:n.id}),s=new Jc(i);return c(this,Nl).set(s.id,s),s}remove(t){var n;c(this,Nl).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),c(this,Nl).delete(t.id.toString()))}removeAll(){let t=[];return c(this,Nl).forEach(r=>{this.remove(r),t.push(r.id),c(this,Nl).delete(r.id.toString())}),t}};Nl=new WeakMap,N1=new WeakMap;p();var $1,B1=class{constructor({currentMapGetter:t}){M(this,$1);_(this,$1,t)}get currentMap(){return c(this,$1).call(this)}setFromStyleCollection(t){var r,n,o,i;for(let s in t)for(let a of((r=this.currentMap)==null?void 0:r.floors)||[]){if(t[s]==null||!a.layers.has(Er))continue;let l=a.layers.get(Er);if(l!=null&&l.layers.has(s)&&"color"in t[s]){let f=l.layers.get(s);f&&((n=this.currentMap)==null||n.renderer.setState(f,{color:t[s].color}))}if(l&&s===Tc&&!(Js in t)){let f=l.layers.get(Js);f&&"color"in t[s]&&((o=this.currentMap)==null||o.renderer.setState(f,{color:t[s].color}))}if(!a.layers.has(up))continue;let u=a.layers.get(up),d=a.facadesByStyleId.get(s);if(d&&d.length>0)for(let f of d){let h=u.layers.get("".concat(f,"-").concat(s));h&&"color"in t[s]&&((i=this.currentMap)==null||i.renderer.setState(h,{color:t[s].color}))}}}};$1=new WeakMap;p();var FO={opacity:1},$n,j1,G1,su,Bl,Id,LO,IY,dh=class{constructor(t,r){M(this,Id);M(this,$n);M(this,j1,[]);M(this,G1,{opacity:"initial"});M(this,su,{opacity:new Map});M(this,Bl,new Set);_(this,$n,t),_(this,j1,r||[]);let n=c(this,$n).map;n&&n.on("idle",()=>{c(this,su).opacity.size||ee(this,Id,LO).call(this,n)})}setStyle(t){var r,n;if(c(this,$n).map){(r=c(this,$n).map)==null||r.setStyle(t),c(this,Bl).size&&(c(this,Bl).clear(),this.hide()),ee(this,Id,IY).call(this),ee(this,Id,LO).call(this,c(this,$n).map),this.setOpacity(c(this,G1).opacity),(n=c(this,$n).map)==null||n.moveLayer(KS);for(let[o,i,s]of c(this,j1)||[])c(this,$n).hideOutdoorLayersIntersectingPolygons(o,i,s)}}get map(){return c(this,$n).map}get enabled(){return!!c(this,$n).map}get visible(){return c(this,Bl).size===0}show(){let t=c(this,$n).map;if(!t)return;let r=t.getStyle().layers;r&&(r.forEach(n=>{c(this,Bl).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),c(this,Bl).clear())}hide(t=[]){let r=c(this,$n).map;if(!r)return;let n=r.getStyle().layers;n&&n.forEach(o=>{let i=r.getLayoutProperty(o.id,"visibility");!t.includes(o.id)&&i!=="none"&&(r.setLayoutProperty(o.id,"visibility","none"),c(this,Bl).add(o.id))})}setOpacity(t,r=[]){var i,s;let n=c(this,$n).map;if(!n)return;let o=(s=(i=c(this,$n).map)==null?void 0:i.getStyle())==null?void 0:s.layers;o&&n.once("idle",()=>{o.forEach(a=>{let l=n.getLayoutProperty(a.id,"visibility");if(!r.includes(a.id)&&l!=="none")try{let u=c(this,su).opacity.get(a.id);u!==void 0&&(a.id==="background"||(a.type==="symbol"?(n.setPaintProperty(a.id,"icon-opacity",t==="initial"?u[0]:t),n.setPaintProperty(a.id,"text-opacity",t==="initial"?u[1]:t)):n.setPaintProperty(a.id,"".concat(a.type,"-opacity"),t==="initial"?u[0]:t)),c(this,G1).opacity=t)}catch(u){$.warn("Error setting opacity:",u)}})})}};$n=new WeakMap,j1=new WeakMap,G1=new WeakMap,su=new WeakMap,Bl=new WeakMap,Id=new WeakSet,LO=function(t){let r=t.getStyle().layers;r&&r.forEach(n=>{var i,s,a;t.getLayoutProperty(n.id,"visibility")!=="none"&&(n.id==="background"||(n.type==="symbol"?c(this,su).opacity.set(n.id,[(i=t.getPaintProperty(n.id,"icon-opacity"))!=null?i:FO.opacity,(s=t.getPaintProperty(n.id,"text-opacity"))!=null?s:FO.opacity]):c(this,su).opacity.set(n.id,[(a=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?a:FO.opacity,void 0])))})},IY=function(){Object.values(c(this,su)).forEach(t=>t.clear())};p();function QPe(){O5(!1)}var $l,jl,au,FS=class{constructor({currentMapGetter:t}){M(this,$l);M(this,jl,new Map);M(this,au,new Map);_(this,$l,t)}labelAll(t={}){var o,i;let r=[],n=new Set;return(i=(o=c(this,$l).call(this))==null?void 0:o.Text3D.labelAll(t))==null||i.forEach(({textInfo:s,target:a})=>{let l=s.id.toString(),u=c(this,au).get(l);if(u){n.has(l)||r.push(u.text3DView),n.add(l);return}n.add(l);let d=new Qc(l,a);c(this,jl).set(d.id,{targetId:a.id,text3d:l,text3DView:d}),c(this,au).set(l,{text3DView:d}),r.push(d)}),r}label(t,r,n={}){var i;if(c(this,$l).call(this))if(Qr.is(t)){let s=(i=c(this,$l).call(this))==null?void 0:i.Text3D.label(t,r,n);if(!s)return;let a=s.textInfo.id.toString(),l=c(this,au).get(a);if(l)return l.text3DView;let u=new Qc(a,s.target);return c(this,jl).set(u.id,{targetId:s.target.id,text3d:a,text3DView:u}),c(this,au).set(a,{text3DView:u}),u}else throw new Error("Non-space target is not supported")}remove(t){var o;let r=typeof t=="string"?t:t.id,n=c(this,jl).get(r);n&&((o=c(this,$l).call(this))==null||o.Text3D.remove(n.text3d),c(this,jl).delete(r),c(this,au).delete(n.text3d))}removeAll(){c(this,jl).forEach(t=>{var r;(r=c(this,$l).call(this))==null||r.Text3D.remove(t.text3d)}),c(this,jl).clear()}};$l=new WeakMap,jl=new WeakMap,au=new WeakMap;var LS=.05,U1=class{constructor(t,r){m(this,"core");m(this,"mapObjects",[]);m(this,"id");m(this,"mapDataExternal",{});m(this,"mapsByFloorId",{});m(this,"mapData");m(this,"currentMap");m(this,"hiddenOutdoorGeometries",[]);m(this,"lastFacadeIntersected");m(this,"manualFloorVisibility",!1);m(this,"mapView");m(this,"Camera");m(this,"Labels");m(this,"Text3D");m(this,"Markers");m(this,"Models");m(this,"Paths");m(this,"Exporter");m(this,"Navigation");m(this,"Outdoor");m(this,"BlueDot");m(this,"Shapes");m(this,"Style");m(this,"Images");m(this,"update",()=>{this.core.render()});this.core=t,this.mapView=r,this.Camera=new a1(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new I1("outdoors-container",void 0,void 0,this);this.mapObjects.push(n),this.currentMap=n,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")}),this.core.on("resize",()=>{this.mapView.publish("resize")}),this.core.on("geometry-in-focus",l=>{this.mapView.publish("facades-in-view-change",{facades:l.map(u=>{var d;return(d=this.getMapDataInternal())==null?void 0:d.facadesById[u]}).filter(u=>u!=null)})});let o=new n1(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let i=l=>u=>{var N,k,D;let d=[],f=[],h=[],b=[];u.labels.forEach(F=>{let z=this.Labels.getById(F.toString());z&&d.push(z.label)}),u.markers.forEach(F=>{let z=this.Markers.getById(F.toString())||this.Navigation.getMarkerById(F.toString());z&&f.push(z.marker)}),u.models.forEach(F=>{let z=this.Models.getById(F.toString());z&&h.push(z.model)}),u.paths.forEach(F=>{let z=this.Paths.getById(F.toString())||this.Navigation.getPathById(F.toString());z&&b.push(z.path)});let v=u.geometry.includes(DS),I=u.geometry.filter(F=>F!==DS)[0],x;I&&(x=(N=this.getMapDataInternal())==null?void 0:N.getById("space",I)),x||(x=(k=this.getMapDataInternal())==null?void 0:k.getById("object",I));let C=u.containers.reduce((F,z)=>{var j;let G=(j=this.getMapDataInternal())==null?void 0:j.getById("floor",z);return G&&Ro.is(G)&&F.push(G),F},[]),P,w=0;if(C.length>0){P=C[0].id;let F=this.core.getState(P);w=u.coordinate[2]?u.coordinate[2]-F.altitude:w}let T;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!1})}),x&&Qr.is(x)&&(T=(D=this.getMapDataInternal())==null?void 0:D.facadesBySpaceId[I],T&&T.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!0})})),this.lastFacadeIntersected=T;let O={coordinate:new Le({latitude:u.coordinate[1],longitude:u.coordinate[0],floorId:P,verticalOffset:w}),spaces:x&&Qr.is(x)?[x]:[],objects:x&&No.is(x)?[x]:[],markers:f,labels:d,models:h,paths:b,blueDot:v,floors:C,facades:T?[T]:[]};"pointerEvent"in u&&(O.pointerEvent=u.pointerEvent),this.mapView.publish(l,O)};this.core.on("hover",i("hover")),this.core.on("click",i("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let s={currentMapGetter:()=>this.currentMap};this.Markers=new S1(s),this.Models=new w1(s),this.Labels=new u1(s),this.Text3D=new FS(s),this.Exporter=new c1(s),this.Paths=new O1(s),this.Navigation=new i1(this.core,this,s.currentMapGetter),this.BlueDot=new ph(this.core,this),this.BlueDot.on("position-update",l=>{this.mapView.publish("blue-dot-position-update",l)}),this.BlueDot.on("state-change",l=>{this.mapView.publish("blue-dot-state-change",l)}),this.BlueDot.on("error",l=>{this.mapView.publish("blue-dot-error",l)}),this.BlueDot.on("follow-change",l=>{this.mapView.publish("blue-dot-follow-change",l)}),this.Outdoor=new dh(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{this.mapView.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{this.mapView.publish("outdoor-style-loaded")})),this.Images=new P1(s),this.Shapes=new R1(s),this.Style=new B1(s);let a=new OS(r,this.mapDataExternal);this.auto=a.auto}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,r){if(t==="interior-walls"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Er);if(i){let s=i.layers.get(Tc);s&&this.core.setState(s,B4(r,this.core.getState(s)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Er);if(i){let s=i.layers.get(Js);s&&this.core.setState(s,B4(r,this.core.getState(s)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Er);if(i){let s=i.layers.get(im);s&&this.core.setState(s,N2(r,this.core.getState(s)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(o=>{let i=o.layers.get(Er);if(i){let s=i.layers.get(sm);s&&this.core.setState(s,N2(r,this.core.getState(s)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if(Yc.is(n))return this.core.setState(n.id,UH({...r,type:"label"},this.core.getState(n.id)));if(Tl.is(n))return this.core.setState(n.id,VH({...r,type:"marker"},this.core.getState(n.id)));if((Qr.is(n)||No.is(n))&&this.core.setState(n.id,zH({...r,type:"geometry"},this.core.getState(n.id))),Ys.is(n)&&this.core.setState(n.id,N2({...r,type:"doors"},this.core.getState(n.id))),Jc.is(n)&&this.core.setState(n.id,To(r,["altitude","color","opacity"])),cd.is(n)){let{position:o,scale:i,...s}=r,a=s;o&&(a.position=[o.longitude,o.latitude,o.verticalOffset]),i!=null&&(Array.isArray(i)?a.scale=i:a.scale=[i,i,i]),o&&n.updateTarget(o),this.core.setState(n.id,a)}if(Ro.is(n)){let o=this.currentMap.floorsById.get(n.id);if(o==null)return;this.core.setState(n.id,To(r,["visible","altitude"]));let i=o.layers.get(Er);i!=null&&"geometry"in r&&this.core.setState(i.containerId,To(r.geometry,["opacity","visible"]));let s=o.layers.get(al);s!=null&&"labels"in r&&"enabled"in r.labels&&typeof r.labels.enabled=="boolean"&&s.setVisible(r.labels.enabled);let a=o.layers.get(Qs);a!=null&&"markers"in r&&"enabled"in r.markers&&typeof r.markers.enabled=="boolean"&&a.setVisible(r.markers.enabled);let l=o.layers.get(yg);l!=null&&"footprint"in r&&this.core.setState(l.containerId,To(r.footprint,["visible","height","opacity","side","color","altitude"]));let u=o.layers.get(am);u!=null&&"occlusion"in r&&"enabled"in r.occlusion&&typeof r.occlusion.enabled=="boolean"&&u.setVisible(r.occlusion.enabled)}if(Xi.is(n)){let o=this.core.getState(n.id);for(let i of o.children)i.type==="group-container"&&this.core.setState(i.id,To(r,["opacity","visible"]))}if(Qc.is(n)&&this.core.setState(n.id,To(r,wI)),os.is(n))for(let o of n.segments)this.core.setState(o.id,To(r,["color","nearRadius","farRadius","visible","completeFraction"]));rh.is(n)&&this.core.setState(n.id,To(r,["color"]))}}getMapDataObject(t){var r;return(r=this.getMapDataInternal())==null?void 0:r.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return Ah(this.mapData)}getMapData(){return this.mapData}addMap(t,r){return new Promise(n=>{var f,h,b,v;let o;try{o=Ah(t)}catch(I){$.error("Error adding map",I),n(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:i}=o,s=i["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new Le(s[1],s[0])});let a=i["manifest.geojson"].features[0].properties.name,l=new I1("mapObject-".concat(a),o,r,this),u=this.core.getBoundingArea(l.currentFloor.id);u==null&&$.error("Could not determine bounding box for map:",l.currentFloor.id);let d=(h=(f=r==null?void 0:r.outdoorView)==null?void 0:f.layersHiddenByGeometry)!=null?h:[];if(d.length>0){let I,x=[];for(let C of l.floorStacksById.values())if(C.defaultFloor.footprint&&C.defaultFloor.footprint.geometry!=null&&((b=C.defaultFloor.footprint.geometry)==null?void 0:b.coordinates.length)>0){let P=C.defaultFloor.footprint,w=$2(P);I==null?I=w:XH(I,w),x.push(P)}x.length>0&&I!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(I,x,d),this.hiddenOutdoorGeometries.push([I,x,d]))}if(this.mapObjects.push(l),o.getMVFFeatureByType("floor").forEach(I=>{this.mapsByFloorId[I.id]=l}),l.on("navigation-connection-click",I=>{this.mapView.publish("navigation-connection-click",I)}),l.on("navigation-active-path-change",I=>{this.mapView.publish("navigation-active-path-change",I)}),l.StackedMaps.on("stacked-maps-state-change",({state:I})=>{this.mapView.publish("stacked-maps-state-change",{state:I})}),l.on("floor-change-start",I=>{var x,C,P,w;this.mapView.publish("floor-change-start",{reason:I.reason,floor:(C=(x=this.getMapDataInternal())==null?void 0:x.getById("floor",I.floorId))!=null?C:this.currentFloor,previousFloor:(w=(P=this.getMapDataInternal())==null?void 0:P.getById("floor",I.previousFloorId))!=null?w:this.currentFloor})}),l.on("floor-change",I=>{var x,C;this.mapView.publish("floor-change",{reason:I.reason,floor:this.currentFloor,previousFloor:(C=(x=this.getMapDataInternal())==null?void 0:x.getById("floor",I.previousFloorId))!=null?C:this.currentFloor})}),this.currentMap=l,this.mapData=t,(r==null?void 0:r.zoomLevel)!=null)this.core.camera.setZoomLevel(r.zoomLevel),n(t);else if(this.core.mode!=="outdoors-overlay"&&u){let I=(v=r==null?void 0:r.screenOffsets)!=null?v:{top:LS*this.core.canvasHeight,left:LS*this.core.canvasWidth,right:LS*this.core.canvasWidth,bottom:LS*this.core.canvasHeight};this.core.camera.focusOn(u,{duration:TH,padding:I}).then(()=>{n(t)})}else n(t)})}setFloor(t,r){return this.currentMap.setFloor(ag(t),r)}setFloorStack(t,r){return this.currentMap.setFloorStack(ag(t),r)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var n;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Bn("Missing currentFloorStack.");let r=(n=this.mapData)==null?void 0:n.getById("floor-stack",t);if(!r)throw new Bn("FloorStack was not found in map data.");return r}get currentFloor(){var n;let t=this.currentMap.currentFloor.id;if(!t)throw new Bn("Missing currentFloor object from GeoJsonApi");let r=(n=this.mapData)==null?void 0:n.getById("floor",t);if(!r)throw new Bn("Missing currentFloor");return r}getState(t){var o,i,s,a,l,u,d,f,h,b,v,I,x,C,P,w,T,O,N,k;typeof t=="object"&&os.is(t)&&$.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let r=ZH(t,this),n=this.core.getState(r);if(n)if(["interior-walls","exterior-walls"].includes(t)){let{color:D,topColor:F,texture:z,topTexture:G,visible:j,height:K,opacity:Z}=n;return{type:"walls",visible:j,color:D,topColor:F,texture:z?{url:z}:void 0,topTexture:G?{url:G}:void 0,height:K,opacity:Z}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:D,topColor:F,texture:z,topTexture:G,visible:j,opacity:K}=n;return{type:"doors",visible:j,color:D,topColor:F,opacity:K,texture:z?{url:z}:void 0,topTexture:G?{url:G}:void 0}}else{if(n.type==="geometry")return{type:"geometry",interactive:n.interactive,hoverColor:n.hoverColor,color:n.color,visible:n.visible,opacity:n.opacity,height:n.height,texture:n.texture?{url:n.texture}:void 0,topTexture:n.topTexture?{url:n.topTexture}:void 0,flipImageToFaceCamera:n.flipImageToFaceCamera,topColor:n.topColor};if(n.type==="label"&&n.options.appearance&&n.options.rank!==void 0&&n.options.interactive!==void 0)return{type:"label",text:n.text,appearance:n.options.appearance,rank:n.options.rank,enabled:n.enabled,interactive:n.options.interactive};if(n.type==="marker"&&((o=n.options)==null?void 0:o.rank)!==void 0&&n.options.interactive!==void 0){let D=typeof n.parent=="object"?n.parent.id:n.parent,F=this.Markers.getById(n.id.toString()),z=F!=null&&F.marker.target?F==null?void 0:F.marker.target.anchorTarget:void 0;return z==null&&(z=new Le(n.position[1],n.position[0],D.toString())),{type:"marker",rank:n.options.rank,interactive:n.options.interactive,enabled:n.enabled,element:n.element,anchor:n.anchor,zIndex:n.options.zIndex,dynamicResize:n.dynamicResize,lowPriorityPin:n.options.lowPriorityPin}}else if(n.type==="model"){let D=n!=null&&typeof n.parent=="object"?n.parent.id.toString():(i=n.parent)==null?void 0:i.toString();return delete n.parent,{...n,position:new Le({latitude:n.position[1],longitude:n.position[0],verticalOffset:n.position[2],floorId:D}),type:"model"}}else{if(n.type==="image")return{type:"image"};if(n.type==="text3d")return n;if(n.type==="geometry-group"&&t&&typeof t!="string"&&Jc.is(t)){let[D]=n.children;if(D.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(s=n.altitude)!=null?s:0,visible:n.visible,color:n.color,height:D.height,opacity:n.opacity}}else{if(n.type==="path")return{type:"path",color:n.color,visible:n.visible,nearRadius:n.nearRadius,farRadius:n.farRadius,completeFraction:n.completeFraction};if(n.type==="group-container"&&typeof t!="string"&&Ro.is(t)){let D=(a=this.currentMap.floorsById.get(t.id))==null?void 0:a.layers.get(Er),F=D?this.core.getState(D.containerId):void 0,z=(l=this.currentMap.floorsById.get(t.id))==null?void 0:l.layers.get(al),G=(u=this.currentMap.floorsById.get(t.id))==null?void 0:u.layers.get(Qs),j=(d=this.currentMap.floorsById.get(t.id))==null?void 0:d.layers.get(yg),K=j?this.core.getState(j.containerId):void 0,Z=(f=this.currentMap.floorsById.get(t.id))==null?void 0:f.layers.get(am),oe=Z?this.core.getState(Z.containerId):void 0;return{type:"floor",geometry:{opacity:(h=F==null?void 0:F.opacity)!=null?h:0,visible:(b=F==null?void 0:F.visible)!=null?b:!0},labels:{enabled:(v=z==null?void 0:z.visible)!=null?v:!1},markers:{enabled:(I=G==null?void 0:G.visible)!=null?I:!1},footprint:{altitude:(x=K==null?void 0:K.altitude)!=null?x:0,visible:(C=K==null?void 0:K.visible)!=null?C:!1,height:(P=K==null?void 0:K.height)!=null?P:0,opacity:(w=K==null?void 0:K.opacity)!=null?w:0,side:(T=K==null?void 0:K.side)!=null?T:"double",color:(O=K==null?void 0:K.color)!=null?O:"white"},occlusion:{enabled:(N=oe==null?void 0:oe.visible)!=null?N:!1},visible:n.visible,altitude:(k=n.altitude)!=null?k:0}}else if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&Xi.is(t)){let D=this.core.getState(n.children[0].id);return{type:"facade",opacity:D.opacity,visible:D.visible}}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,r,n){var l;if(n!=null){let u=this.core.projectScreenXYToCoordinate(t,r,!0);return u?new Le(u.coordinate[1],u.coordinate[0],n.id):void 0}let o=this.core.projectScreenXYToCoordinate(t,r);if(o==null||o.coordinate==null)return;let{coordinate:i,groupContainers:s}=o,a=(l=s==null?void 0:s.find(u=>{let d=u.userData.entityId.toString();return d.includes("f_")||d.includes("m_")}))==null?void 0:l.userData.entityId.toString();return new Le(i[1],i[0],a)}getScreenCoordinateFromCoordinate(t){return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){return{labels:this.Labels.all()}}tween(t){let r=new xo(t);return this.core.getTweenGroup().add(r),this.core.render(),r}removeTween(t){this.core.getTweenGroup().remove(t)}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};function eTe(e){wE("".concat(e,"/maplibre-worker.csp.js")),Y4("".concat(e,"/collision-worker.csp.js"))}p();p();var RS=class{constructor(t){m(this,"state");m(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};p();var SY=B.object({environment:B.union([B.literal("basic"),B.literal(!1)]).optional(),text3d:B.object({hoverColor:B.string().optional()}).optional(),geometry:B.object({hoverColor:B.string().optional()}).optional(),backgroundColor:B.string().optional(),backgroundAlpha:B.number().optional()}).strict();p();var NS=fs(l5(),1);var CY=e=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(r=>e.startsWith(r)))return!0;let t=console.warn;return console.warn=()=>{},e==="white"||RO(e).some(r=>r<1)?!0:(console.warn=t,!1)},RO=e=>{let t=new Ft(e);return[t.r,t.g,t.b]},tTe=e=>{let t=new Ft;return t.setRGB(e[0],e[1],e[2],Sa),"#"+t.getHexString()},PY=(e,t)=>{let r=(0,NS.default)({},e),n=(0,NS.default)({},e,t),o=(i,s,a)=>{for(let l in s){let u=i[l],d=s[l];if(typeof d=="number"&&typeof u=="number")i[l]=u+(d-u)*a;else if(typeof d=="string"&&typeof u=="string"){if(CY(u)&&CY(d)){let f=RO(u),h=RO(d);f&&h?i[l]=tTe([f[0]+(h[0]-f[0])*a,f[1]+(h[1]-f[1])*a,f[2]+(h[2]-f[2])*a]):$.warn('Color "'.concat(l,'" could not be animated!'))}}else typeof d=="object"&&d!==null&&typeof u=="object"&&u!==null?o(u,d,a):$.warn('Value "'.concat(l,'" could not be animated!'))}};return i=>{if(i=Math.min(Math.max(i,0),1),i===0)return e;if(i===1)return n;let s=(0,NS.default)({},r);return o(s,t,i),s}};var V1,Ie,Gl,fh=class extends De{constructor(r){super();M(this,V1,{});M(this,Ie);M(this,Gl);m(this,"Camera");m(this,"Labels");m(this,"Text3D");m(this,"Markers");m(this,"Images");m(this,"Models");m(this,"Paths");m(this,"Exporter");m(this,"Navigation");m(this,"BlueDot");m(this,"Style");m(this,"Shapes");m(this,"Outdoor");m(this,"update",()=>{c(this,Ie).core.render()});m(this,"getDirections",(r,n,o)=>{var i;return(i=c(this,Ie).getMapData())==null?void 0:i.getDirections(r,n,o)});m(this,"getDirectionsMultiDestination",(r,n,o)=>{var i;return(i=c(this,Ie).getMapData())==null?void 0:i.getDirectionsMultiDestination(r,n,o)});m(this,"on",(r,n)=>{super.on(r,n)});m(this,"off",(r,n)=>{super.off(r,n)});m(this,"Debug");_(this,Gl,r);let n=new U1(r,this);_(this,Ie,n),this.Camera=c(this,Ie).Camera,_(this,V1,c(this,Ie).mapDataExternal),this.Markers=c(this,Ie).Markers,this.Models=c(this,Ie).Models,this.Labels=c(this,Ie).Labels,this.Text3D=c(this,Ie).Text3D,this.Exporter=c(this,Ie).Exporter,this.Paths=c(this,Ie).Paths,this.Navigation=c(this,Ie).Navigation,this.BlueDot=c(this,Ie).BlueDot,this.Shapes=c(this,Ie).Shapes,this.Style=c(this,Ie).Style,this.auto=c(this,Ie).auto,this.Outdoor=c(this,Ie).Outdoor,this.Images=c(this,Ie).Images,c(this,Gl).container.dataset.version=g.env.npm_package_version,this.Debug=new RS(c(this,Ie).core)}get StackedMaps(){return c(this,Ie).currentMap.StackedMaps}updateState(r,n){return c(this,Ie).updateState(r,n)}animateState(r,n,o){var u;let i=c(this,Ie).getState(r);if(i==null)return $.warn("Cannot animate state of ".concat(r,".")),new Promise(f=>f());let s=PY(i,n),a=c(this,Ie).tween({percent:0}).to({percent:1},(u=o==null?void 0:o.duration)!=null?u:1e3).onUpdate(({percent:d})=>{c(this,Ie).updateState(r,s(d))});o!=null&&o.easing&&o.easing in Sl&&a.easing(Sl[o.easing]);let l=new Promise(d=>{a.onComplete(()=>{c(this,Ie).removeTween(a),d()}).onStop(()=>{c(this,Ie).removeTween(a),d()}),a.start()});return l.cancel=()=>{a.stop(),c(this,Ie).updateState(r,s(0))},l}updateGlobalState(r){var n,o,i,s;try{SY.parse(r)}catch(a){$.error("updateGlobalState",a);return}if(typeof r=="object"){let a={};if((n=r.text3d)!=null&&n.hoverColor&&(a.text3dHoverColor=r.text3d.hoverColor),(o=r.geometry)!=null&&o.hoverColor&&(a.hoverColor=r.geometry.hoverColor),r.backgroundColor||r.backgroundAlpha!==void 0){let l=(i=r.backgroundColor)!=null?i:c(this,Ie).core.backgroundColor,u=(s=r.backgroundAlpha)!=null?s:c(this,Ie).core.backgroundAlpha;c(this,Ie).core.setBackgroundColor(l,u)}r.environment!=null&&c(this,Ie).core.setEnvironment(r.environment),c(this,Ie).core.setState(a)}}getGlobalState(){let r=c(this,Ie).core.getState();return{backgroundColor:c(this,Ie).core.backgroundColor,backgroundAlpha:c(this,Ie).core.backgroundAlpha,environment:c(this,Ie).core.getEnvironment(),geometry:{hoverColor:r.hoverColor},text3d:{hoverColor:r.text3dHoverColor}}}getMapData(){return c(this,V1)}getDimensions(){return{width:c(this,Gl).canvasWidth,height:c(this,Gl).canvasHeight}}expand(r){var n;return(n=c(this,Ie).currentMap)==null?void 0:n.StackedMaps.expand(r)}collapse(r){var n;return(n=c(this,Ie).currentMap)==null?void 0:n.StackedMaps.collapse(r)}addMap(r,n){return c(this,Ie).addMap(r,n)}setFloor(r,n){return c(this,Ie).setFloor(r,n==null?void 0:n.context)}setFloorStack(r,n){return c(this,Ie).setFloorStack(r,n==null?void 0:n.context)}tween(r){return c(this,Ie).tween(r)}removeTween(r){c(this,Ie).removeTween(r)}get currentFloorStack(){return c(this,Ie).currentFloorStack}get currentFloor(){return c(this,Ie).currentFloor}updateWatermark(r){c(this,Ie).updateWatermark(r)}getState(r){return c(this,Ie).getState(r)}setHoverColor(r){c(this,Ie).setHoverColor(r)}getHoverColor(){return c(this,Ie).getHoverColor()}convertAltitudeToMercatorZoomLevel(r){return c(this,Ie).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(r)}convertMercatorZoomLevelToAltitude(r){return c(this,Ie).core.getSystems().cameraSystem.convertZoomLevelToAltitude(r)}isInView(r){return c(this,Ie).isInView(r)}getDistance(r,n){var o;return(o=c(this,Ie).getMapData())==null?void 0:o.getDistance(r,n)}createCoordinate(r,n,o){return typeof r=="object"?new Le(r):new Le(r,n,o==null?void 0:o.id)}createCoordinateFromScreenCoordinate(r,n,o){return c(this,Ie).createCoordinateFromScreenCoordinate(r,n,o)}getScreenCoordinateFromCoordinate(r){return c(this,Ie).getScreenCoordinateFromCoordinate(r)}auto(){return{labels:this.Labels.all()}}get __core(){if(g.env.INTERNAL==="true")return c(this,Ie).core;throw new Error("__core is not available.")}clear(){c(this,Ie).clear()}destroy(){c(this,Ie).destroy()}async enableDebug(r={}){let{Inspector:n}=await import("./inspector-4UPV6G6H.js");await new n(this,c(this,Ie)).enable(r)}async takeScreenshot(){return await c(this,Gl).renderSync(),c(this,Gl).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return c(this,Ie).manualFloorVisibility}set manualFloorVisibility(r){c(this,Ie).manualFloorVisibility=r}};V1=new WeakMap,Ie=new WeakMap,Gl=new WeakMap;p();p();var BS=class extends De{constructor(r){super();m(this,"gl");m(this,"el",document.createElement("div"));m(this,"core");m(this,"origin");m(this,"map");m(this,"layer");m(this,"handleStyleChange",()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))});m(this,"handleMove",()=>{if(!this.map)return;let[r,n]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(r,n),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(Ye.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(Ye.degToRad(this.map.getPitch()))});m(this,"handleError",r=>{$.warn(r)});this.origin=r}onAdd(r){this.origin=this.origin||r.getCenter().toArray(),this.gl=r.painter.context.gl,this.core=new qb(r._container,{center:this.origin,zoomLevel:r.getZoom(),pitch:r.getPitch(),bearing:r.getBearing(),gl:this.gl,map:r,mode:"outdoors-overlay"}),this.map=r,this.core.camera.setMinZoomLevel(r.getMinZoom()),this.core.camera.setMaxZoomLevel(r.getMaxZoom()),this.core.camera.setMinPitch(r.getMinPitch()),this.core.camera.setMaxPitch(r.getMaxPitch()),this.map.on("error",this.handleError);let n=PE.fromLngLat(this.origin,0);return this.layer=a0(n,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};var Sd,mh,lu,Cd,$S=class $S extends De{constructor(r,n,o){super();M(this,Sd);M(this,mh);M(this,lu);M(this,Cd);m(this,"on",(r,n)=>{super.on(r,n)});m(this,"off",(r,n)=>{super.off(r,n)});_(this,Cd,new BS(r)),_(this,Sd,n),_(this,mh,o)}onAdd(r){var i,s;let n=c(this,Cd).onAdd(r),o={...cp,...(i=c(this,mh))!=null?i:{},outdoorView:{token:c(this,Sd).outdoorViewToken,...(s=c(this,mh))==null?void 0:s.outdoorView}};return _(this,lu,new fh(c(this,Cd).core)),c(this,lu).addMap(c(this,Sd),o).then(()=>{this.publish("loaded",{mapView:c(this,lu),mapData:c(this,Sd)})}),n}onRemove(){c(this,lu)&&c(this,lu).clear(),$S.instance=null,c(this,Cd).onRemove()}};Sd=new WeakMap,mh=new WeakMap,lu=new WeakMap,Cd=new WeakMap,m($S,"instance");var hh=$S;p();var rTe=1e3*60*60*2,cu,gh,Qt,us,ps,Si,ds,bh,vh,H1,lr,TY,wY,yh,jS,NO,BO,$O,z1=class{constructor(t,r){M(this,lr);M(this,cu,new De);M(this,gh);M(this,Qt);M(this,us);M(this,ps);M(this,Si);M(this,ds);M(this,bh);M(this,vh);M(this,H1,()=>{"key"in c(this,Qt)&&"secret"in c(this,Qt)&&ee(this,lr,yh).call(this),ee(this,lr,jS).call(this)});m(this,"on",(t,r)=>c(this,cu).on(t,r));m(this,"off",(t,r)=>c(this,cu).off(t,r));_(this,gh,t),_(this,Qt,r)}setMapIds(t){_(this,gh,t)}setEnterprise(t){c(this,Qt).enterprise=t}async readySync(){if((!("key"in c(this,Qt))||!("secret"in c(this,Qt)))&&!("accessToken"in c(this,Qt))){$.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[ee(this,lr,yh).call(this),null];c(this,Qt).enterprise||(t[1]=this.getSasTokensAsync());let[r,n]=await Promise.all(t);ee(this,lr,$O).call(this),ee(this,lr,NO).call(this,r),n!=null&&ee(this,lr,BO).call(this,n),window!=null&&typeof window.addEventListener=="function"&&window.addEventListener("focus",c(this,H1))}async refreshing(){let t=[];return c(this,us)!=null&&t.push(c(this,us)),c(this,ps)!=null&&t.push(c(this,ps)),Promise.all(t)}getAccessTokenAsync(){return ee(this,lr,yh).call(this)}getSasTokensAsync(){return ee(this,lr,jS).call(this)}getAccessToken(){return c(this,Si)==null?($.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):c(this,Si)}getSasToken(t){return this.isEnterpriseMode()?($.error("SAS tokens are not available in the enterprise mode!"),{token:""}):c(this,ds)==null?($.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in c(this,ds).tokens?c(this,ds).tokens[t]:($.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=c(this,Qt).enterprise)!=null?t:!1}destroy(){ee(this,lr,$O).call(this),c(this,cu).destroy(),window!=null&&typeof window.removeEventListener=="function"&&window.removeEventListener("focus",c(this,H1))}};cu=new WeakMap,gh=new WeakMap,Qt=new WeakMap,us=new WeakMap,ps=new WeakMap,Si=new WeakMap,ds=new WeakMap,bh=new WeakMap,vh=new WeakMap,H1=new WeakMap,lr=new WeakSet,TY=function(t){var n;let r=t.token!==((n=c(this,Si))==null?void 0:n.token);_(this,Si,t),r&&c(this,cu).publish("access-token-refreshed",{accessToken:t})},wY=function(t){var n;let r=JSON.stringify(t.tokens)!==JSON.stringify((n=c(this,ds))==null?void 0:n.tokens);_(this,ds,t),r&&c(this,cu).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},yh=async function(t=!1){var r;if("accessToken"in c(this,Qt)&&typeof c(this,Qt).accessToken=="string"){let n={token:c(this,Qt).accessToken,expires:Date.now()+72e5};return _(this,Si,n),n}if(!("key"in c(this,Qt))||!("secret"in c(this,Qt))||typeof c(this,Qt).key!="string"||typeof c(this,Qt).secret!="string")throw new Error("No API keys or access token provided!");return c(this,us)!=null?c(this,us):c(this,Si)!=null&&c(this,Si).expires!=null&&c(this,Si).expires>Date.now()&&!t?c(this,Si):(_(this,us,$y({...c(this,Qt),key:c(this,Qt).key,secret:c(this,Qt).secret},(r=c(this,Qt).enterprise)!=null?r:!1).then(n=>{let o={token:n.accessToken,expires:n.expiresTimestamp*1e3};return ee(this,lr,TY).call(this,o),o})),c(this,us).finally(()=>{_(this,us,void 0)}),c(this,us))},jS=async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:c(this,ps)!=null?c(this,ps):c(this,ds)!=null&&c(this,ds).expires>Date.now()&&!t?c(this,ds):(_(this,ps,new Promise((r,n)=>{ee(this,lr,yh).call(this).then(o=>{let i={},s=c(this,gh).map(a=>cw({...c(this,Qt),mapId:a},o.token).then(l=>{i[a]={token:l.token,expires:l.expires}}).catch(l=>{$.error("Error getting SAS token for map ".concat(a,":"),l)}));Promise.all(s).then(()=>{let a={tokens:i,expires:Math.min(...Object.values(i).map(l=>{var u;return(u=l.expires)!=null?u:1/0}))};ee(this,lr,wY).call(this,a),r(a)})}).catch(o=>{n(o)})})),c(this,ps).catch(r=>{throw r}).finally(()=>{_(this,ps,void 0)}),c(this,ps))},NO=function(t){if(!("key"in c(this,Qt))||!("secret"in c(this,Qt)))return;let r=t.expires!=null?t.expires-Date.now():rTe;isFinite(r)&&_(this,bh,setTimeout(()=>{ee(this,lr,yh).call(this,!0).then(n=>{ee(this,lr,NO).call(this,n)})},r-nj))},BO=function(t){let r=t.expires-Date.now();isFinite(r)&&_(this,vh,setTimeout(()=>{ee(this,lr,jS).call(this,!0).then(n=>{ee(this,lr,BO).call(this,n)})},r-sj))},$O=function(){c(this,bh)!=null&&clearTimeout(c(this,bh)),c(this,vh)!=null&&clearTimeout(c(this,vh))};p();var MY=(e,{id:t}={})=>{let r=Array.isArray(e)?e:[e];if(!r.every(i=>typeof i=="string"))return;let n=r.join(""),o=null;if(t){let i=document.getElementById(t);i instanceof HTMLStyleElement&&(o=i)}o==null&&(o=document.createElement("style")),t&&t!==""&&(o.id=t),o.textContent=n,document.head.appendChild(o)};var OY=":root {\n --pin-shadow-hover-scale: 0.9;\n --pin-shadow-width: 12px;\n --pin-shadow-height: 5px;\n --pin-shadow-opacity: 0.35;\n --pin-drop-animation-duration-ms: 250ms;\n}\n\n@keyframes drop-pin {\n 0% {\n transform: translateY(-200%);\n }\n\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes pin-shadow {\n 0% {\n transform: scale(var(--pin-shadow-hover-scale));\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n.mappedin-dropped-pin-wrapper {\n position: relative;\n\n width: fit-content;\n height: fit-content;\n width: 36px;\n height: 42px;\n\n & svg {\n position: absolute;\n left: calc(50% - var(--pin-shadow-width));\n animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;\n }\n\n & > .pin-shadow {\n position: absolute;\n left: calc(50% - (var(--pin-shadow-width) / 2));\n bottom: 0;\n\n height: var(--pin-shadow-height);\n width: var(--pin-shadow-width);\n border-radius: 100%;\n\n opacity: var(--pin-shadow-opacity);\n\n animation: pin-shadow 250ms ease-in;\n }\n}\n\n@keyframes bounce {\n 0% {\n transform: translateY(-10px);\n opacity: 0;\n }\n 12.5% {\n transform: translateY(0);\n opacity: 1;\n }\n 25% {\n transform: translateY(0);\n }\n 37.5% {\n transform: translateY(-10px);\n }\n 50% {\n transform: translateY(0);\n }\n 62.5% {\n transform: translateY(-10px);\n }\n 75% {\n transform: translateY(0);\n }\n 87.5% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n.mappedin-connection-marker {\n position: relative;\n display: flex;\n\n .bouncey {\n animation: bounce 2.5s linear;\n }\n\n .arrow--down {\n transform: rotate(180deg);\n }\n\n .connection-circle {\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 2px solid white;\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);\n background: #595959;\n }\n}\n";var EY='.mappedin-marker {\n font-family: \'InterUI-Regular\', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n transition: transform 300ms linear;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide all content including text nodes by setting font-size to 0 */\n.mappedin-marker[data-anchor="low-priority-pin"] {\n font-size: 0;\n line-height: 0;\n}\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor="low-priority-pin"]>* {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker[data-anchor="low-priority-pin"]::before {\n content: \'\';\n display: block;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n';var _Y=".mappedin__smart-collision-engine__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n /* Enables colliders to use translate3D */\n transform-style: preserve-3d;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n}\n\n.mappedin__smart-collision-engine-debug__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n transition: opacity 300ms ease-in-out;\n pointer-events: none;\n will-change: opacity;\n &.interacting {\n opacity: 0.2;\n }\n}\n";var AY=".mappedin-map {\n .mappedin-interactive {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &.mappedin-interaction-hover {\n cursor: pointer;\n }\n }\n}\n";var kY=".mappedin-map {\n .mappedin-control-container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n\n .mappedin-ctrl-top-left,\n .mappedin-ctrl-top-right,\n .mappedin-ctrl-bottom-left,\n .mappedin-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n }\n\n .mappedin-ctrl-top-left {\n top: 0;\n left: 0;\n }\n\n .mappedin-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n .mappedin-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n }\n\n .mappedin-ctrl-bottom-right {\n bottom: 0;\n right: 0;\n }\n\n .mappedin-ctrl-attrib {\n display: block;\n position: relative;\n pointer-events: auto;\n font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;\n padding: 3px 5px 1px 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n min-width: 11px;\n min-height: 11px;\n user-select: none;\n\n summary.mappedin-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n summary.mappedin-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n &.mappedin-compact .mappedin-ctrl-attrib-button,\n &.mappedin-compact-show .mappedin-ctrl-attrib-inner {\n display: inline-block;\n }\n\n &.mappedin-compact {\n background-color: transparent;\n }\n\n &.mappedin-compact-show {\n min-width: 15px;\n min-height: 15px;\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 0.5);\n }\n }\n\n .mappedin-ctrl-attrib-top-left {\n float: left;\n border-bottom-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-top-right {\n float: right;\n border-bottom-left-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-left {\n float: left;\n border-top-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-right {\n float: right;\n border-top-left-radius: 4px;\n }\n .mappedin-ctrl-attrib-top-left,\n .mappedin-ctrl-attrib-bottom-left {\n padding: 3px 5px 1px 20px;\n }\n\n .mappedin-ctrl-attrib-inner {\n display: inline-block;\n margin-right: 12px;\n }\n\n .mappedin-ctrl-attrib-inner,\n .mappedin-ctrl-attrib-inner a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n }\n\n .mappedin-ctrl-attrib-inner-bold,\n .mappedin-ctrl-attrib-inner-bold a {\n font-weight: bold;\n }\n\n .mappedin-ctrl-attrib-inner a:hover {\n color: #017ef1;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .mappedin-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 15px;\n height: 15px;\n box-sizing: border-box;\n border-radius: 50%;\n top: 0;\n right: 2px;\n border: 1px;\n }\n .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,\n .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {\n left: 2px;\n }\n }\n}\n";var DY='.maplibregl-map {\n font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\n.maplibregl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.maplibregl-map:fullscreen {\n width: 100%;\n height: 100%;\n}\n\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {\n cursor: pointer;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive:active,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: pinch-zoom;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-ctrl-top-left,\n.maplibregl-ctrl-top-right,\n.maplibregl-ctrl-bottom-left,\n.maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n\n.maplibregl-ctrl-top-left { top: 0; left: 0; }\n\n.maplibregl-ctrl-top-right { top: 0; right: 0; }\n\n.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }\n\n.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.maplibregl-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; }\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; }\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; }\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; }\n\n.maplibregl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.maplibregl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.maplibregl-ctrl-group button + button {\n border-top: 1px solid #ddd;\n}\n\n.maplibregl-ctrl button .maplibregl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-icon {\n background-color: transparent;\n }\n\n .maplibregl-ctrl-group button + button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.maplibregl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.maplibregl-ctrl-attrib-button:focus,\n.maplibregl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {\n opacity: 0.25;\n}\n\n.maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.maplibregl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.maplibregl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.maplibregl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n @svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {\n fill: #fff;\n #south { fill: #999; }\n }\n\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);\n }\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain-enabled);\n}\n\n@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #fff;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #000;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #aaa;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #999;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #666;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e58978;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e54e33;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {\n animation: maplibregl-spin 2s infinite linear;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-black);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-black);\n }\n}\n\n@keyframes maplibregl-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\na.maplibregl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: svg-load("svg/maplibregl-ctrl-logo.svg");\n}\n\na.maplibregl-ctrl-logo.maplibregl-compact {\n width: 14px;\n}\n\n@media (-ms-high-contrast: active) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; }\n #fill { opacity: 1; }\n }\n\n background-color: transparent;\n background-image: svg-inline(ctrl-logo-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; fill: #fff; stroke: #fff; }\n #fill { opacity: 1; fill: #000; }\n }\n\n background-image: svg-inline(ctrl-logo-black);\n }\n}\n\n.maplibregl-ctrl.maplibregl-ctrl-attrib {\n padding: 0 5px;\n background-color: rgb(255 255 255 / 50%);\n margin: 0;\n}\n\n@media screen {\n .maplibregl-ctrl-attrib.maplibregl-compact {\n min-height: 20px;\n padding: 2px 24px 2px 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n color: #000;\n border-radius: 12px;\n box-sizing: content-box;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 28px 2px 8px;\n visibility: visible;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 8px 2px 28px;\n border-radius: 12px;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {\n display: none;\n }\n\n .maplibregl-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n background-color: rgb(255 255 255 / 50%);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n outline: none;\n top: 0;\n right: 0;\n border: 0;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {\n left: 0;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {\n display: block;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {\n background-color: rgb(0 0 0 / 5%);\n }\n\n .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n left: 0;\n }\n\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n }\n}\n\n.maplibregl-ctrl-attrib a {\n color: rgb(0 0 0 / 75%);\n text-decoration: none;\n}\n\n.maplibregl-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n.maplibregl-attrib-empty {\n display: none;\n}\n\n.maplibregl-ctrl-scale {\n background-color: rgb(255 255 255 / 75%);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n\n.maplibregl-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n\n.maplibregl-popup-anchor-top,\n.maplibregl-popup-anchor-top-left,\n.maplibregl-popup-anchor-top-right {\n flex-direction: column;\n}\n\n.maplibregl-popup-anchor-bottom,\n.maplibregl-popup-anchor-bottom-left,\n.maplibregl-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n\n.maplibregl-popup-anchor-left {\n flex-direction: row;\n}\n\n.maplibregl-popup-anchor-right {\n flex-direction: row-reverse;\n}\n\n.maplibregl-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n\n.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-left: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n align-self: center;\n border-bottom: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-bottom: none;\n border-left: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-bottom: none;\n border-right: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n align-self: center;\n border-left: none;\n border-right-color: #fff;\n}\n\n.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n\n.maplibregl-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.maplibregl-popup-close-button:hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n padding: 15px 10px;\n pointer-events: auto;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-content {\n border-top-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-content {\n border-top-right-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {\n border-bottom-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {\n border-bottom-right-radius: 0;\n}\n\n.maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-popup-track-pointer * {\n pointer-events: none;\n user-select: none;\n}\n\n.maplibregl-map:hover .maplibregl-popup-track-pointer {\n display: flex;\n}\n\n.maplibregl-map:active .maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-marker {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n transition: opacity 0.2s;\n}\n\n.maplibregl-user-location-dot {\n background-color: #1da1f2;\n width: 15px;\n height: 15px;\n border-radius: 50%;\n}\n\n.maplibregl-user-location-dot::before {\n background-color: #1da1f2;\n content: "";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n position: absolute;\n animation: maplibregl-user-location-dot-pulse 2s infinite;\n}\n\n.maplibregl-user-location-dot::after {\n border-radius: 50%;\n border: 2px solid #fff;\n content: "";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgb(0 0 0 / 35%);\n}\n\n@keyframes maplibregl-user-location-dot-pulse {\n 0% { transform: scale(1); opacity: 1; }\n 70% { transform: scale(3); opacity: 0; }\n 100% { transform: scale(1); opacity: 0; }\n}\n\n.maplibregl-user-location-dot-stale {\n background-color: #aaa;\n}\n\n.maplibregl-user-location-dot-stale::after {\n display: none;\n}\n\n.maplibregl-user-location-accuracy-circle {\n background-color: #1da1f233;\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n\n.maplibregl-crosshair,\n.maplibregl-crosshair .maplibregl-interactive,\n.maplibregl-crosshair .maplibregl-interactive:active {\n cursor: crosshair;\n}\n\n.maplibregl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n}\n\n.maplibregl-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.maplibregl-cooperative-gesture-screen.maplibregl-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {\n display: none;\n }\n\n .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: block;\n }\n}\n\n.maplibregl-pseudo-fullscreen {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 99999;\n}\n';var cTe=[OY,EY,_Y,AY,kY,DY],FY;function qIt(e){FY=e}var ZIt=async(e,t)=>{let r,n=Xu();t&&n.updateByUserOption(t);try{t&&(r=(await $y({...t,baseAuthUri:n.getBaseAuthUri()})).accessToken)}catch(s){$.warn("Getting access token failed. Outdoor map disabled.",s)}let o=new wm(e,{outdoorViewToken:r,languagePacks:t==null?void 0:t.languagePacks,env:n});return new u0(o)},LY=!1;function XIt(e){LY=e}var YIt=async(e,t)=>{var b,v,I,x,C,P,w;let r=(I="mvfVersion"in(t!=null?t:{})?t==null?void 0:t.mvfVersion:void 0)!=null?I:"options"in e&&"version"in((b=e.options)!=null?b:{})?(v=e.options)==null?void 0:v.version:void 0,n={...t||{},mvfVersion:r},o,i=Xu();i.updateByUserOption(n);let s={};if("type"in e&&typeof e.type=="string"){if(s.enterprise=(x=e.options)==null?void 0:x.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){o=await gw(e.main,n.mvfVersion),s.languagePacks=[];for(let T of(C=e.languagePacks)!=null?C:[])T.localePack instanceof Uint8Array&&s.languagePacks.push({language:T.language,localePack:await Gf(T.localePack)})}else if(e.type==="json")o=e.main,s.languagePacks=(P=e.languagePacks)!=null?P:[];else throw new Error("Invalid backup type");e.type==="binary"&&e.main instanceof Uint8Array&&(s.binaryBundle=e.main)}else o=e,s.enterprise=o.enterprise!=null;let a=yw(o),l=a.length>0?a:[n.mapId],u=new z1(l,{...n,enterprise:s.enterprise}),d;if("accessToken"in n)d=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=i.getBaseAuthUri(s.enterprise);let T=await u.getAccessTokenAsync();d=(T==null?void 0:T.token)||""}s.outdoorViewToken=d,s.env=i,s.getMapDataOptions=n;try{await u.readySync()}catch(T){$.error("Failed to ready token manager!",T)}let f=new wm(o,s);d&&f.Analytics.init({accessToken:d,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0,...n.analytics,baseUri:i.getAnalyticsBaseUri(),context:(w=n.analytics)==null?void 0:w.context});let h=new u0(f);if("language"in n)try{await h.changeLanguage(n.language)}catch{}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(o),h},uTe=async e=>{var I;let t=LY,r,n=Xu();n.updateByUserOption(e);let o={...e},i=new z1([o.mapId],o);if("accessToken"in o){r=o.accessToken;let{aud:x,sub:C}=e0(r);(MH.some(P=>x.includes(P))||C&&C.startsWith("client"))&&(t=!0,i.setEnterprise(t))}else if("key"in o&&"secret"in o)o.key.startsWith("mik_")||(t=!0,i.setEnterprise(t)),o.baseAuthUri=n.getBaseAuthUri(t),r=(await i.getAccessTokenAsync()).token;else throw new Error("Missing key or secret.");o.layoutId!=null&&(t?o.layoutId!=="draft"&&$.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):$.warn("layoutId is currently unsupported!")),o.baseUri=n.getBaseUri(t);let s=performance.now(),a,l;if(t){let x={...o,venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0",perspective:o.viewId,useDraftData:o.layoutId==="draft"},C=await dw(x);a=C.compressed,l=C.localePacks}else a=await fw(o,r);let u=performance.now(),d=await gw(a,o.mvfVersion),f=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(d);let h=yw(d);h.length>0?i.setMapIds(h):i.setMapIds([o.mapId]);try{await i.readySync()}catch(x){$.error("Failed to ready token manager!",x)}let b=new wm(d,{env:n,outdoorViewToken:r,tokenManager:i,enterprise:t,localePacksUrls:l,binaryBundle:a,getMapDataOptions:o}),v=new u0(b,{search:e.search});if(b.Analytics.init({accessToken:r,mapId:o.mapId,key:"key"in o?o.key:void 0,secret:"secret"in o?o.secret:void 0,...o.analytics,baseUri:n.getAnalyticsBaseUri(),context:(I=o.analytics)==null?void 0:I.context}),b.Analytics.sendGetMapDataEvent({parseDuration:f-u,downloadDuration:u-s,viewId:o.viewId}),"language"in o)try{await v.changeLanguage(o.language)}catch{}return v},KIt=uTe,JIt=(e,t)=>{hh.instance!=null&&$.warn("Only a single map venue is supported at this time.");let r=new hh([e.mapCenter.longitude,e.mapCenter.latitude],e,t);return hh.instance=r,r},pTe=async(e,t,r)=>{var u,d,f,h,b,v,I,x,C,P,w,T,O;let n=performance.now(),o=x4(r,t);o&&v4(o),((u=o.injectStyles)==null||u)&&MY(cTe,{id:"mappedin__styles"});let i=OH((d=t.outdoorViewToken)!=null?d:""),s=Ah(t);(f=o.outdoorView)!=null&&f.style&&s.envControl.updateTileServerBaseUrl((h=o.outdoorView)==null?void 0:h.style);let a=await GX(e,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(b=o.style)==null?void 0:b.backgroundAlpha,backgroundColor:(v=o.style)==null?void 0:v.backgroundColor,outdoorView:(I=o.outdoorView)!=null&&I.token?{headers:{"x-mappedin-tiles-key":(x=o.outdoorView)==null?void 0:x.token},style:t.getEnv().tileServerUri,enabled:!!((C=o.outdoorView)!=null&&C.enabled),lowDpi:(P=o.outdoorView)==null?void 0:P.lowDpi}:void 0,watermark:{...o.watermark,visible:((w=o.watermark)==null?void 0:w.visible)||!s.enterpriseMode&&!i.remove_watermark,onClick:FY||void 0},attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((T=o.antialiasing)!=null&&T.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(O=o.occlusion)==null?void 0:O.enabled,transformImageRequest:s.enterpriseMode?void 0:s.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:o.imagePlacementOptions,onWebGLContextCreationError:o.onWebGLContextCreationError,onWebGLContextLost:o.onWebGLContextLost,onWebGLContextRestored:o.onWebGLContextRestored,onWebGLRendererError:o.onWebGLRendererError}),l=new fh(a);return await l.addMap(t,o),s.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:l.getDimensions()}),l},QIt=pTe;export{Le as a,vc as b,tp as c,np as d,Ic as e,Ys as f,Qr as g,Ro as h,Kbe as i,pp as j,No as k,Cc as l,Pc as m,A2 as n,Xi as o,sl as p,k2 as q,k4 as r,mw as s,hw as t,B as u,pm as v,D2 as w,S5 as x,FW as y,fZ as z,OPe as A,j2 as B,G2 as C,QPe as D,eTe as E,qIt as F,ZIt as G,XIt as H,YIt as I,uTe as J,KIt as K,JIt as L,pTe as M,QIt as N};