@arenarium/maps 1.0.53 → 1.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,71 +1,6 @@
1
1
  ## Usage
2
2
 
3
- #### Web
4
-
5
- ```html
6
- <html lang="en">
7
- <head>
8
- <script src="https://unpkg.com/@arenarium/maps@latest/dist/index.js"></script>
9
- <link href="https://unpkg.com/@arenarium/maps@latest/dist/style.css" rel="stylesheet" />
10
- </head>
11
- <body>
12
- <div id="map"></div>
13
- <script>
14
- const map = arenarium.mountMap({
15
- // Id of the HTML element that contains the map,
16
- container: 'map'
17
- // The initial position and zoomof the map
18
- position: {
19
- center: { lat: 51.505, lng: -0.09 },
20
- zoom: 13
21
- },
22
- // The initial style of the map
23
- style: {
24
- name: 'light',
25
- colors: {
26
- primary: '#007bff',
27
- background: '#fff',
28
- text: '#000'
29
- }
30
- }
31
- });
32
- </script>
33
- </body>
34
- </html>
35
- ```
36
-
37
- #### Svelte
38
-
39
- ```bash
40
- npm install @arenarium/maps
41
- ```
42
-
43
- ```svelte
44
- <script lang="ts">
45
- import { onMount } from 'svelte';
46
- import { mountMap } from '$lib/index.js';
47
-
48
- onMount(() => {
49
- const map = mountMap({
50
- container: 'map',
51
- position: {
52
- center: { lat: 51.505, lng: -0.09 },
53
- zoom: 13
54
- },
55
- style: {
56
- name: 'light',
57
- colors: {
58
- primary: '#007bff',
59
- background: '#fff',
60
- text: '#000'
61
- }
62
- }
63
- });
64
- });
65
- </script>
66
-
67
- <div id="map"></div>
68
- ```
3
+ https://maps.arenarium.dev
69
4
 
70
5
  ## License
71
6
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function($t,ai){typeof exports=="object"&&typeof module<"u"?ai(exports):typeof define=="function"&&define.amd?define(["exports"],ai):($t=typeof globalThis<"u"?globalThis:$t||self,ai($t.arenarium={}))})(this,function($t){"use strict";var B0=Object.defineProperty;var Jg=$t=>{throw TypeError($t)};var F0=($t,ai,zi)=>ai in $t?B0($t,ai,{enumerable:!0,configurable:!0,writable:!0,value:zi}):$t[ai]=zi;var fs=($t,ai,zi)=>F0($t,typeof ai!="symbol"?ai+"":ai,zi),Jp=($t,ai,zi)=>ai.has($t)||Jg("Cannot "+zi);var Lt=($t,ai,zi)=>(Jp($t,ai,"read from private field"),zi?zi.call($t):ai.get($t)),Cr=($t,ai,zi)=>ai.has($t)?Jg("Cannot add the same private member more than once"):ai instanceof WeakSet?ai.add($t):ai.set($t,zi),fu=($t,ai,zi,mu)=>(Jp($t,ai,"write to private field"),mu?mu.call($t,zi):ai.set($t,zi),zi),Qg=($t,ai,zi)=>(Jp($t,ai,"access private method"),zi);var Va,vo,ql,Yu,e_,mm,ma,bo,Hl,bs;var zi=Array.isArray,mu=Array.prototype.indexOf,dd=Array.from,i_=Object.defineProperty,wl=Object.getOwnPropertyDescriptor,Qp=Object.prototype,r_=Array.prototype,ef=Object.getPrototypeOf,tf=Object.isExtensible;const n_=()=>{};function rf(y){for(var m=0;m<y.length;m++)y[m]()}const bn=2,nf=4,gu=8,pd=16,oa=32,ao=64,_u=128,qr=256,yu=512,jr=1024,la=2048,ms=4096,ca=8192,xu=16384,a_=32768,vu=65536,s_=1<<19,af=1<<20,fd=1<<21,bu=Symbol("$state");function sf(y){return y===this.v}function o_(y,m){return y!=y?m==m:y!==m||y!==null&&typeof y=="object"||typeof y=="function"}function of(y){return!o_(y,this.v)}function l_(y){throw new Error("https://svelte.dev/e/effect_in_teardown")}function c_(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function u_(y){throw new Error("https://svelte.dev/e/effect_orphan")}function h_(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function d_(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function p_(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function f_(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let O0=!1;const m_=1,g_=2,__=16,y_=1,x_=2,Nr=Symbol(),v_=[];function b_(y,m=!1){return wu(y,new Map,"",v_)}function wu(y,m,b,I,z=null){if(typeof y=="object"&&y!==null){var D=m.get(y);if(D!==void 0)return D;if(y instanceof Map)return new Map(y);if(y instanceof Set)return new Set(y);if(zi(y)){var S=Array(y.length);m.set(y,S),z!==null&&m.set(z,S);for(var o=0;o<y.length;o+=1){var le=y[o];o in y&&(S[o]=wu(le,m,b,I))}return S}if(ef(y)===Qp){S={},m.set(y,S),z!==null&&m.set(z,S);for(var he in y)S[he]=wu(y[he],m,b,I);return S}if(y instanceof Date)return structuredClone(y);if(typeof y.toJSON=="function")return wu(y.toJSON(),m,b,I,y)}if(y instanceof EventTarget)return y;try{return structuredClone(y)}catch{return y}}function w_(y){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let Zr=null;function lf(y){Zr=y}function Tu(y,m=!1,b){var I=Zr={p:Zr,c:null,d:!1,e:null,m:!1,s:y,x:null,l:null};xf(()=>{I.d=!0})}function Mu(y){const m=Zr;if(m!==null){y!==void 0&&(m.x=y);const S=m.e;if(S!==null){var b=pi,I=oi;m.e=null;try{for(var z=0;z<S.length;z++){var D=S[z];Da(D.effect),Vn(D.reaction),Iu(D.fn)}}finally{Da(b),Vn(I)}}Zr=m.p,m.m=!0}return y||{}}function cf(){return!0}function ua(y){if(typeof y!="object"||y===null||bu in y)return y;const m=ef(y);if(m!==Qp&&m!==r_)return y;var b=new Map,I=zi(y),z=Ci(0),D=oi,S=o=>{var le=oi;Vn(D);var he=o();return Vn(le),he};return I&&b.set("length",Ci(y.length)),new Proxy(y,{defineProperty(o,le,he){(!("value"in he)||he.configurable===!1||he.enumerable===!1||he.writable===!1)&&d_();var _e=b.get(le);return _e===void 0?(_e=S(()=>Ci(he.value)),b.set(le,_e)):si(_e,S(()=>ua(he.value))),!0},deleteProperty(o,le){var he=b.get(le);if(he===void 0)le in o&&(b.set(le,S(()=>Ci(Nr))),md(z));else{if(I&&typeof le=="string"){var _e=b.get("length"),Re=Number(le);Number.isInteger(Re)&&Re<_e.v&&si(_e,Re)}si(he,Nr),md(z)}return!0},get(o,le,he){var ne;if(le===bu)return y;var _e=b.get(le),Re=le in o;if(_e===void 0&&(!Re||(ne=wl(o,le))!=null&&ne.writable)&&(_e=S(()=>Ci(ua(Re?o[le]:Nr))),b.set(le,_e)),_e!==void 0){var ve=Qe(_e);return ve===Nr?void 0:ve}return Reflect.get(o,le,he)},getOwnPropertyDescriptor(o,le){var he=Reflect.getOwnPropertyDescriptor(o,le);if(he&&"value"in he){var _e=b.get(le);_e&&(he.value=Qe(_e))}else if(he===void 0){var Re=b.get(le),ve=Re==null?void 0:Re.v;if(Re!==void 0&&ve!==Nr)return{enumerable:!0,configurable:!0,value:ve,writable:!0}}return he},has(o,le){var ve;if(le===bu)return!0;var he=b.get(le),_e=he!==void 0&&he.v!==Nr||Reflect.has(o,le);if(he!==void 0||pi!==null&&(!_e||(ve=wl(o,le))!=null&&ve.writable)){he===void 0&&(he=S(()=>Ci(_e?ua(o[le]):Nr)),b.set(le,he));var Re=Qe(he);if(Re===Nr)return!1}return _e},set(o,le,he,_e){var Dt;var Re=b.get(le),ve=le in o;if(I&&le==="length")for(var ne=he;ne<Re.v;ne+=1){var De=b.get(ne+"");De!==void 0?si(De,Nr):ne in o&&(De=S(()=>Ci(Nr)),b.set(ne+"",De))}Re===void 0?(!ve||(Dt=wl(o,le))!=null&&Dt.writable)&&(Re=S(()=>Ci(void 0)),si(Re,S(()=>ua(he))),b.set(le,Re)):(ve=Re.v!==Nr,si(Re,S(()=>ua(he))));var _t=Reflect.getOwnPropertyDescriptor(o,le);if(_t!=null&&_t.set&&_t.set.call(_e,he),!ve){if(I&&typeof le=="string"){var Rt=b.get("length"),yt=Number(le);Number.isInteger(yt)&&yt>=Rt.v&&si(Rt,yt+1)}md(z)}return!0},ownKeys(o){Qe(z);var le=Reflect.ownKeys(o).filter(Re=>{var ve=b.get(Re);return ve===void 0||ve.v!==Nr});for(var[he,_e]of b)_e.v!==Nr&&!(he in o)&&le.push(he);return le},setPrototypeOf(){p_()}})}function md(y,m=1){si(y,y.v+m)}function gd(y){var m=bn|la,b=oi!==null&&(oi.f&bn)!==0?oi:null;return pi===null||b!==null&&(b.f&qr)!==0?m|=qr:pi.f|=af,{ctx:Zr,deps:null,effects:null,equals:sf,f:m,fn:y,reactions:null,rv:0,v:null,wv:0,parent:b??pi}}function Su(y){const m=gd(y);return kf(m),m}function T_(y){const m=gd(y);return m.equals=of,m}function uf(y){var m=y.effects;if(m!==null){y.effects=null;for(var b=0;b<m.length;b+=1)ha(m[b])}}function M_(y){for(var m=y.parent;m!==null;){if((m.f&bn)===0)return m;m=m.parent}return null}function hf(y){var m,b=pi;Da(M_(y));try{uf(y),m=Lf(y)}finally{Da(b)}return m}function df(y){var m=hf(y),b=(La||(y.f&qr)!==0)&&y.deps!==null?ms:jr;wn(y,b),y.equals(m)||(y.v=m,y.wv=Af())}const Tl=new Map;function so(y,m){var b={f:0,v:y,reactions:null,equals:sf,rv:0,wv:0};return b}function Ci(y,m){const b=so(y);return kf(b),b}function S_(y,m=!1){const b=so(y);return m||(b.equals=of),b}function si(y,m,b=!1){oi!==null&&!Zn&&cf()&&(oi.f&(bn|pd))!==0&&!(Ir!=null&&Ir.includes(y))&&f_();let I=b?ua(m):m;return pf(y,I)}function pf(y,m){if(!y.equals(m)){var b=y.v;Pl?Tl.set(y,m):Tl.set(y,b),y.v=m,(y.f&bn)!==0&&((y.f&la)!==0&&hf(y),wn(y,(y.f&qr)===0?jr:ms)),y.wv=Af(),ff(y,la),pi!==null&&(pi.f&jr)!==0&&(pi.f&(oa|ao))===0&&(ln===null?B_([y]):ln.push(y))}return m}function ff(y,m){var b=y.reactions;if(b!==null)for(var I=b.length,z=0;z<I;z++){var D=b[z],S=D.f;(S&la)===0&&(wn(D,m),(S&(jr|qr))!==0&&((S&bn)!==0?ff(D,ms):ju(D)))}}let P_=!1;var _d,mf,gf,_f;function C_(){if(_d===void 0){_d=window,mf=/Firefox/.test(navigator.userAgent);var y=Element.prototype,m=Node.prototype,b=Text.prototype;gf=wl(m,"firstChild").get,_f=wl(m,"nextSibling").get,tf(y)&&(y.__click=void 0,y.__className=void 0,y.__attributes=null,y.__style=void 0,y.__e=void 0),tf(b)&&(b.__t=void 0)}}function yf(y=""){return document.createTextNode(y)}function Pu(y){return gf.call(y)}function Cu(y){return _f.call(y)}function Ml(y,m){return Pu(y)}function I_(y,m){{var b=Pu(y);return b instanceof Comment&&b.data===""?Cu(b):b}}function yd(y,m=1,b=!1){let I=y;for(;m--;)I=Cu(I);return I}function E_(y){y.textContent=""}function k_(y){pi===null&&oi===null&&u_(),oi!==null&&(oi.f&qr)!==0&&pi===null&&c_(),Pl&&l_()}function z_(y,m){var b=m.last;b===null?m.last=m.first=y:(b.next=y,y.prev=b,m.last=y)}function oo(y,m,b,I=!0){var z=pi,D={ctx:Zr,deps:null,nodes_start:null,nodes_end:null,f:y|la,first:null,fn:m,last:null,next:null,parent:z,prev:null,teardown:null,transitions:null,wv:0};if(b)try{bd(D),D.f|=a_}catch(le){throw ha(D),le}else m!==null&&ju(D);var S=b&&D.deps===null&&D.first===null&&D.nodes_start===null&&D.teardown===null&&(D.f&(af|_u))===0;if(!S&&I&&(z!==null&&z_(D,z),oi!==null&&(oi.f&bn)!==0)){var o=oi;(o.effects??(o.effects=[])).push(D)}return D}function xf(y){const m=oo(gu,null,!1);return wn(m,jr),m.teardown=y,m}function lo(y){k_();var m=pi!==null&&(pi.f&oa)!==0&&Zr!==null&&!Zr.m;if(m){var b=Zr;(b.e??(b.e=[])).push({fn:y,effect:pi,reaction:oi})}else{var I=Iu(y);return I}}function A_(y){const m=oo(ao,y,!0);return(b={})=>new Promise(I=>{b.outro?zu(m,()=>{ha(m),I(void 0)}):(ha(m),I(void 0))})}function Iu(y){return oo(nf,y,!1)}function vf(y){return oo(gu,y,!0)}function Eu(y,m=[],b=gd){const I=m.map(b);return ku(()=>y(...I.map(Qe)))}function ku(y,m=0){return oo(gu|pd|m,y,!0)}function co(y,m=!0){return oo(gu|oa,y,!0,m)}function bf(y){var m=y.teardown;if(m!==null){const b=Pl,I=oi;Ef(!0),Vn(null);try{m.call(null)}finally{Ef(b),Vn(I)}}}function wf(y,m=!1){var b=y.first;for(y.first=y.last=null;b!==null;){var I=b.next;(b.f&ao)!==0?b.parent=null:ha(b,m),b=I}}function R_(y){for(var m=y.first;m!==null;){var b=m.next;(m.f&oa)===0&&ha(m),m=b}}function ha(y,m=!0){var b=!1;(m||(y.f&s_)!==0)&&y.nodes_start!==null&&(D_(y.nodes_start,y.nodes_end),b=!0),wf(y,m&&!b),Ou(y,0),wn(y,xu);var I=y.transitions;if(I!==null)for(const D of I)D.stop();bf(y);var z=y.parent;z!==null&&z.first!==null&&Tf(y),y.next=y.prev=y.teardown=y.ctx=y.deps=y.fn=y.nodes_start=y.nodes_end=null}function D_(y,m){for(;y!==null;){var b=y===m?null:Cu(y);y.remove(),y=b}}function Tf(y){var m=y.parent,b=y.prev,I=y.next;b!==null&&(b.next=I),I!==null&&(I.prev=b),m!==null&&(m.first===y&&(m.first=I),m.last===y&&(m.last=b))}function zu(y,m){var b=[];xd(y,b,!0),Mf(b,()=>{ha(y),m&&m()})}function Mf(y,m){var b=y.length;if(b>0){var I=()=>--b||m();for(var z of y)z.out(I)}else m()}function xd(y,m,b){if((y.f&ca)===0){if(y.f^=ca,y.transitions!==null)for(const S of y.transitions)(S.is_global||b)&&m.push(S);for(var I=y.first;I!==null;){var z=I.next,D=(I.f&vu)!==0||(I.f&oa)!==0;xd(I,m,D?b:!1),I=z}}}function Au(y){Sf(y,!0)}function Sf(y,m){if((y.f&ca)!==0){y.f^=ca,(y.f&jr)===0&&(y.f^=jr),Il(y)&&(wn(y,la),ju(y));for(var b=y.first;b!==null;){var I=b.next,z=(b.f&vu)!==0||(b.f&oa)!==0;Sf(b,z?m:!1),b=I}if(y.transitions!==null)for(const D of y.transitions)(D.is_global||m)&&D.in()}}let Sl=[],vd=[];function Pf(){var y=Sl;Sl=[],rf(y)}function L_(){var y=vd;vd=[],rf(y)}function Cf(y){Sl.length===0&&queueMicrotask(Pf),Sl.push(y)}function If(){Sl.length>0&&Pf(),vd.length>0&&L_()}let Ru=!1,Du=!1,Lu=null,gs=!1,Pl=!1;function Ef(y){Pl=y}let Cl=[],j0=[],oi=null,Zn=!1;function Vn(y){oi=y}let pi=null;function Da(y){pi=y}let Ir=null;function kf(y){oi!==null&&oi.f&fd&&(Ir===null?Ir=[y]:Ir.push(y))}let Er=null,Hr=0,ln=null;function B_(y){ln=y}let zf=1,Bu=0,La=!1;function Af(){return++zf}function Il(y){var Re;var m=y.f;if((m&la)!==0)return!0;if((m&ms)!==0){var b=y.deps,I=(m&qr)!==0;if(b!==null){var z,D,S=(m&yu)!==0,o=I&&pi!==null&&!La,le=b.length;if(S||o){var he=y,_e=he.parent;for(z=0;z<le;z++)D=b[z],(S||!((Re=D==null?void 0:D.reactions)!=null&&Re.includes(he)))&&(D.reactions??(D.reactions=[])).push(he);S&&(he.f^=yu),o&&_e!==null&&(_e.f&qr)===0&&(he.f^=qr)}for(z=0;z<le;z++)if(D=b[z],Il(D)&&df(D),D.wv>y.wv)return!0}(!I||pi!==null&&!La)&&wn(y,jr)}return!1}function F_(y,m){for(var b=m;b!==null;){if((b.f&_u)!==0)try{b.fn(y);return}catch{b.f^=_u}b=b.parent}throw Ru=!1,y}function Rf(y){return(y.f&xu)===0&&(y.parent===null||(y.parent.f&_u)===0)}function Fu(y,m,b,I){if(Ru){if(b===null&&(Ru=!1),Rf(m))throw y;return}if(b!==null&&(Ru=!0),F_(y,m),Rf(m))throw y}function Df(y,m,b=!0){var I=y.reactions;if(I!==null)for(var z=0;z<I.length;z++){var D=I[z];Ir!=null&&Ir.includes(y)||((D.f&bn)!==0?Df(D,m,!1):m===D&&(b?wn(D,la):(D.f&jr)!==0&&wn(D,ms),ju(D)))}}function Lf(y){var ne;var m=Er,b=Hr,I=ln,z=oi,D=La,S=Ir,o=Zr,le=Zn,he=y.f;Er=null,Hr=0,ln=null,La=(he&qr)!==0&&(Zn||!gs||oi===null),oi=(he&(oa|ao))===0?y:null,Ir=null,lf(y.ctx),Zn=!1,Bu++,y.f|=fd;try{var _e=(0,y.fn)(),Re=y.deps;if(Er!==null){var ve;if(Ou(y,Hr),Re!==null&&Hr>0)for(Re.length=Hr+Er.length,ve=0;ve<Er.length;ve++)Re[Hr+ve]=Er[ve];else y.deps=Re=Er;if(!La)for(ve=Hr;ve<Re.length;ve++)((ne=Re[ve]).reactions??(ne.reactions=[])).push(y)}else Re!==null&&Hr<Re.length&&(Ou(y,Hr),Re.length=Hr);if(cf()&&ln!==null&&!Zn&&Re!==null&&(y.f&(bn|ms|la))===0)for(ve=0;ve<ln.length;ve++)Df(ln[ve],y);return z!==null&&z!==y&&(Bu++,ln!==null&&(I===null?I=ln:I.push(...ln))),_e}finally{Er=m,Hr=b,ln=I,oi=z,La=D,Ir=S,lf(o),Zn=le,y.f^=fd}}function O_(y,m){let b=m.reactions;if(b!==null){var I=mu.call(b,y);if(I!==-1){var z=b.length-1;z===0?b=m.reactions=null:(b[I]=b[z],b.pop())}}b===null&&(m.f&bn)!==0&&(Er===null||!Er.includes(m))&&(wn(m,ms),(m.f&(qr|yu))===0&&(m.f^=yu),uf(m),Ou(m,0))}function Ou(y,m){var b=y.deps;if(b!==null)for(var I=m;I<b.length;I++)O_(y,b[I])}function bd(y){var m=y.f;if((m&xu)===0){wn(y,jr);var b=pi,I=Zr,z=gs;pi=y,gs=!0;try{(m&pd)!==0?R_(y):wf(y),bf(y);var D=Lf(y);y.teardown=typeof D=="function"?D:null,y.wv=zf;var S=y.deps,o}catch(le){Fu(le,y,b,I||y.ctx)}finally{gs=z,pi=b}}}function j_(){try{h_()}catch(y){if(Lu!==null)Fu(y,Lu,null);else throw y}}function Bf(){var y=gs;try{var m=0;for(gs=!0;Cl.length>0;){m++>1e3&&j_();var b=Cl,I=b.length;Cl=[];for(var z=0;z<I;z++){var D=Z_(b[z]);N_(D)}Tl.clear()}}finally{Du=!1,gs=y,Lu=null}}function N_(y){var m=y.length;if(m!==0)for(var b=0;b<m;b++){var I=y[b];if((I.f&(xu|ca))===0)try{Il(I)&&(bd(I),I.deps===null&&I.first===null&&I.nodes_start===null&&(I.teardown===null?Tf(I):I.fn=null))}catch(z){Fu(z,I,null,I.ctx)}}}function ju(y){Du||(Du=!0,queueMicrotask(Bf));for(var m=Lu=y;m.parent!==null;){m=m.parent;var b=m.f;if((b&(ao|oa))!==0){if((b&jr)===0)return;m.f^=jr}}Cl.push(m)}function Z_(y){for(var m=[],b=y;b!==null;){var I=b.f,z=(I&(oa|ao))!==0,D=z&&(I&jr)!==0;if(!D&&(I&ca)===0){if((I&nf)!==0)m.push(b);else if(z)b.f^=jr;else try{Il(b)&&bd(b)}catch(le){Fu(le,b,null,b.ctx)}var S=b.first;if(S!==null){b=S;continue}}var o=b.parent;for(b=b.next;b===null&&o!==null;)b=o.next,o=o.parent}return m}function V_(y){var m;for(If();Cl.length>0;)Du=!0,Bf(),If();return m}async function U_(){await Promise.resolve(),V_()}function Qe(y){var m=y.f,b=(m&bn)!==0;if(oi!==null&&!Zn){if(!(Ir!=null&&Ir.includes(y))){var I=oi.deps;y.rv<Bu&&(y.rv=Bu,Er===null&&I!==null&&I[Hr]===y?Hr++:Er===null?Er=[y]:(!La||!Er.includes(y))&&Er.push(y))}}else if(b&&y.deps===null&&y.effects===null){var z=y,D=z.parent;D!==null&&(D.f&qr)===0&&(z.f^=qr)}return b&&(z=y,Il(z)&&df(z)),Pl&&Tl.has(y)?Tl.get(y):y.v}function wd(y){var m=Zn;try{return Zn=!0,y()}finally{Zn=m}}const $_=-7169;function wn(y,m){y.f=y.f&$_|m}const G_=["touchstart","touchmove"];function q_(y){return G_.includes(y)}function H_(y){var m=oi,b=pi;Vn(null),Da(null);try{return y()}finally{Vn(m),Da(b)}}const Ff=new Set,Td=new Set;function W_(y,m,b,I={}){function z(D){if(I.capture||El.call(m,D),!D.cancelBubble)return H_(()=>b==null?void 0:b.call(this,D))}return y.startsWith("pointer")||y.startsWith("touch")||y==="wheel"?Cf(()=>{m.addEventListener(y,z,I)}):m.addEventListener(y,z,I),z}function X_(y,m,b,I,z){var D={capture:I,passive:z},S=W_(y,m,b,D);(m===document.body||m===window||m===document)&&xf(()=>{m.removeEventListener(y,S,D)})}function K_(y){for(var m=0;m<y.length;m++)Ff.add(y[m]);for(var b of Td)b(y)}function El(y){var Dt;var m=this,b=m.ownerDocument,I=y.type,z=((Dt=y.composedPath)==null?void 0:Dt.call(y))||[],D=z[0]||y.target,S=0,o=y.__root;if(o){var le=z.indexOf(o);if(le!==-1&&(m===document||m===window)){y.__root=m;return}var he=z.indexOf(m);if(he===-1)return;le<=he&&(S=le)}if(D=z[S]||y.target,D!==m){i_(y,"currentTarget",{configurable:!0,get(){return D||b}});var _e=oi,Re=pi;Vn(null),Da(null);try{for(var ve,ne=[];D!==null;){var De=D.assignedSlot||D.parentNode||D.host||null;try{var _t=D["__"+I];if(_t!=null&&(!D.disabled||y.target===D))if(zi(_t)){var[Rt,...yt]=_t;Rt.apply(D,[y,...yt])}else _t.call(D,y)}catch(Jt){ve?ne.push(Jt):ve=Jt}if(y.cancelBubble||De===m||De===null)break;D=De}if(ve){for(let Jt of ne)queueMicrotask(()=>{throw Jt});throw ve}}finally{y.__root=m,delete y.currentTarget,Vn(_e),Da(Re)}}}function Y_(y){var m=document.createElement("template");return m.innerHTML=y,m.content}function Of(y,m){var b=pi;b.nodes_start===null&&(b.nodes_start=y,b.nodes_end=m)}function uo(y,m){var b=(m&y_)!==0,I=(m&x_)!==0,z,D=!y.startsWith("<!>");return()=>{z===void 0&&(z=Y_(D?y:"<!>"+y),b||(z=Pu(z)));var S=I||mf?document.importNode(z,!0):z.cloneNode(!0);if(b){var o=Pu(S),le=S.lastChild;Of(o,le)}else Of(S,S);return S}}function ho(y,m){y!==null&&y.before(m)}function J_(y,m){return Q_(y,m)}const po=new Map;function Q_(y,{target:m,anchor:b,props:I={},events:z,context:D,intro:S=!0}){C_();var o=new Set,le=Re=>{for(var ve=0;ve<Re.length;ve++){var ne=Re[ve];if(!o.has(ne)){o.add(ne);var De=q_(ne);m.addEventListener(ne,El,{passive:De});var _t=po.get(ne);_t===void 0?(document.addEventListener(ne,El,{passive:De}),po.set(ne,1)):po.set(ne,_t+1)}}};le(dd(Ff)),Td.add(le);var he=void 0,_e=A_(()=>{var Re=b??m.appendChild(yf());return co(()=>{if(D){Tu({});var ve=Zr;ve.c=D}z&&(I.$$events=z),he=y(Re,I)||{},D&&Mu()}),()=>{var De;for(var ve of o){m.removeEventListener(ve,El);var ne=po.get(ve);--ne===0?(document.removeEventListener(ve,El),po.delete(ve)):po.set(ve,ne)}Td.delete(le),Re!==b&&((De=Re.parentNode)==null||De.removeChild(Re))}});return Md.set(he,_e),he}let Md=new WeakMap;function ey(y,m){const b=Md.get(y);return b?(Md.delete(y),b(m)):Promise.resolve()}function ty(y,m,[b,I]=[0,0]){var z=y,D=null,S=null,o=Nr,le=b>0?vu:0,he=!1;const _e=(ve,ne=!0)=>{he=!0,Re(ne,ve)},Re=(ve,ne)=>{o!==(o=ve)&&(o?(D?Au(D):ne&&(D=co(()=>ne(z))),S&&zu(S,()=>{S=null})):(S?Au(S):ne&&(S=co(()=>ne(z,[b+1,I]))),D&&zu(D,()=>{D=null})))};ku(()=>{he=!1,m(_e),he||Re(null,null)},le)}function iy(y,m,b,I){for(var z=[],D=m.length,S=0;S<D;S++)xd(m[S].e,z,!0);var o=D>0&&z.length===0&&b!==null;if(o){var le=b.parentNode;E_(le),le.append(b),I.clear(),Ba(y,m[0].prev,m[D-1].next)}Mf(z,()=>{for(var he=0;he<D;he++){var _e=m[he];o||(I.delete(_e.k),Ba(y,_e.prev,_e.next)),ha(_e.e,!o)}})}function ry(y,m,b,I,z,D=null){var S=y,o={flags:m,items:new Map,first:null};{var le=y;S=le.appendChild(yf())}var he=null,_e=!1,Re=T_(()=>{var ve=b();return zi(ve)?ve:ve==null?[]:dd(ve)});ku(()=>{var ve=Qe(Re),ne=ve.length;_e&&ne===0||(_e=ne===0,ny(ve,o,S,z,m,I,b),D!==null&&(ne===0?he?Au(he):he=co(()=>D(S)):he!==null&&zu(he,()=>{he=null})),Qe(Re))})}function ny(y,m,b,I,z,D,S){var o=y.length,le=m.items,he=m.first,_e=he,Re,ve=null,ne=[],De=[],_t,Rt,yt,Dt;for(Dt=0;Dt<o;Dt+=1){if(_t=y[Dt],Rt=D(_t,Dt),yt=le.get(Rt),yt===void 0){var Jt=_e?_e.e.nodes_start:b;ve=sy(Jt,m,ve,ve===null?m.first:ve.next,_t,Rt,Dt,I,z,S),le.set(Rt,ve),ne=[],De=[],_e=ve.next;continue}if(ay(yt,_t,Dt),(yt.e.f&ca)!==0&&Au(yt.e),yt!==_e){if(Re!==void 0&&Re.has(yt)){if(ne.length<De.length){var Xt=De[0],Et;ve=Xt.prev;var Bt=ne[0],Ri=ne[ne.length-1];for(Et=0;Et<ne.length;Et+=1)jf(ne[Et],Xt,b);for(Et=0;Et<De.length;Et+=1)Re.delete(De[Et]);Ba(m,Bt.prev,Ri.next),Ba(m,ve,Bt),Ba(m,Ri,Xt),_e=Xt,ve=Ri,Dt-=1,ne=[],De=[]}else Re.delete(yt),jf(yt,_e,b),Ba(m,yt.prev,yt.next),Ba(m,yt,ve===null?m.first:ve.next),Ba(m,ve,yt),ve=yt;continue}for(ne=[],De=[];_e!==null&&_e.k!==Rt;)(_e.e.f&ca)===0&&(Re??(Re=new Set)).add(_e),De.push(_e),_e=_e.next;if(_e===null)continue;yt=_e}ne.push(yt),ve=yt,_e=yt.next}if(_e!==null||Re!==void 0){for(var jt=Re===void 0?[]:dd(Re);_e!==null;)(_e.e.f&ca)===0&&jt.push(_e),_e=_e.next;var xr=jt.length;if(xr>0){var cn=o===0?b:null;iy(m,jt,cn,le)}}pi.first=m.first&&m.first.e,pi.last=ve&&ve.e}function ay(y,m,b,I){pf(y.v,m),y.i=b}function sy(y,m,b,I,z,D,S,o,le,he){var _e=(le&m_)!==0,Re=(le&__)===0,ve=_e?Re?S_(z):so(z):z,ne=(le&g_)===0?S:so(S),De={i:ne,v:ve,k:D,a:null,e:null,prev:b,next:I};try{return De.e=co(()=>o(y,ve,ne,he),P_),De.e.prev=b&&b.e,De.e.next=I&&I.e,b===null?m.first=De:(b.next=De,b.e.next=De.e),I!==null&&(I.prev=De,I.e.prev=De.e),De}finally{}}function jf(y,m,b){for(var I=y.next?y.next.e.nodes_start:b,z=m?m.e.nodes_start:b,D=y.e.nodes_start;D!==I;){var S=Cu(D);z.before(D),D=S}}function Ba(y,m,b){m===null?y.first=b:(m.next=b,m.e.next=b&&b.e),b!==null&&(b.prev=m,b.e.prev=m&&m.e)}function oy(y,m,...b){var I=y,z=n_,D;ku(()=>{z!==(z=m())&&(D&&(ha(D),D=null),D=co(()=>z(I,...b)))},vu)}const Nf=[...`
2
- \r\f \v\uFEFF`];function ly(y,m,b){var I=y==null?"":""+y;if(b){for(var z in b)if(b[z])I=I?I+" "+z:z;else if(I.length)for(var D=z.length,S=0;(S=I.indexOf(z,S))>=0;){var o=S+D;(S===0||Nf.includes(I[S-1]))&&(o===I.length||Nf.includes(I[o]))?I=(S===0?"":I.substring(0,S))+I.substring(o+1):S=o}}return I===""?null:I}function Zf(y,m=!1){var b=m?" !important;":";",I="";for(var z in y){var D=y[z];D!=null&&D!==""&&(I+=" "+z+": "+D+b)}return I}function Sd(y){return y[0]!=="-"||y[1]!=="-"?y.toLowerCase():y}function cy(y,m){if(m){var b="",I,z;if(Array.isArray(m)?(I=m[0],z=m[1]):I=m,y){y=String(y).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var D=!1,S=0,o=!1,le=[];I&&le.push(...Object.keys(I).map(Sd)),z&&le.push(...Object.keys(z).map(Sd));var he=0,_e=-1;const _t=y.length;for(var Re=0;Re<_t;Re++){var ve=y[Re];if(o?ve==="/"&&y[Re-1]==="*"&&(o=!1):D?D===ve&&(D=!1):ve==="/"&&y[Re+1]==="*"?o=!0:ve==='"'||ve==="'"?D=ve:ve==="("?S++:ve===")"&&S--,!o&&D===!1&&S===0){if(ve===":"&&_e===-1)_e=Re;else if(ve===";"||Re===_t-1){if(_e!==-1){var ne=Sd(y.substring(he,_e).trim());if(!le.includes(ne)){ve!==";"&&Re++;var De=y.substring(he,Re).trim();b+=" "+De+";"}}he=Re+1,_e=-1}}}}return I&&(b+=Zf(I)),z&&(b+=Zf(z,!0)),b=b.trim(),b===""?null:b}return y==null?null:String(y)}function Vf(y,m,b,I,z,D){var S=y.__className;if(S!==b||S===void 0){var o=ly(b,I,D);o==null?y.removeAttribute("class"):y.className=o,y.__className=b}else if(D&&z!==D)for(var le in D){var he=!!D[le];(z==null||he!==!!z[le])&&y.classList.toggle(le,he)}return D}function Pd(y,m={},b,I){for(var z in b){var D=b[z];m[z]!==D&&(b[z]==null?y.style.removeProperty(z):y.style.setProperty(z,D,I))}}function Nu(y,m,b,I){var z=y.__style;if(z!==m){var D=cy(m,I);D==null?y.removeAttribute("style"):y.style.cssText=D,y.__style=m}else I&&(Array.isArray(I)?(Pd(y,b==null?void 0:b[0],I[0]),Pd(y,b==null?void 0:b[1],I[1],"important")):Pd(y,b,I));return I}const uy=()=>performance.now(),Un={tick:y=>requestAnimationFrame(y),now:()=>uy(),tasks:new Set};function Uf(){const y=Un.now();Un.tasks.forEach(m=>{m.c(y)||(Un.tasks.delete(m),m.f())}),Un.tasks.size!==0&&Un.tick(Uf)}function hy(y){let m;return Un.tasks.size===0&&Un.tick(Uf),{promise:new Promise(b=>{Un.tasks.add(m={c:y,f:b})}),abort(){Un.tasks.delete(m)}}}const Ju=class Ju{constructor(m){Cr(this,Yu);Cr(this,Va,new WeakMap);Cr(this,vo);Cr(this,ql);fu(this,ql,m)}observe(m,b){var I=Lt(this,Va).get(m)||new Set;return I.add(b),Lt(this,Va).set(m,I),Qg(this,Yu,e_).call(this).observe(m,Lt(this,ql)),()=>{var z=Lt(this,Va).get(m);z.delete(b),z.size===0&&(Lt(this,Va).delete(m),Lt(this,vo).unobserve(m))}}};Va=new WeakMap,vo=new WeakMap,ql=new WeakMap,Yu=new WeakSet,e_=function(){return Lt(this,vo)??fu(this,vo,new ResizeObserver(m=>{for(var b of m){Ju.entries.set(b.target,b);for(var I of Lt(this,Va).get(b.target)||[])I(b)}}))},fs(Ju,"entries",new WeakMap);let Cd=Ju;var dy=new Cd({box:"border-box"});function $f(y,m,b){var I=dy.observe(y,()=>b(y[m]));Iu(()=>(wd(()=>b(y[m])),I))}function Gf(y,m){return y===m||(y==null?void 0:y[bu])===m}function Fa(y={},m,b,I){return Iu(()=>{var z,D;return vf(()=>{z=D,D=(I==null?void 0:I())||[],wd(()=>{y!==b(...D)&&(m(y,...D),z&&Gf(b(...z),y)&&m(null,...z))})}),()=>{Cf(()=>{D&&Gf(b(...D),y)&&m(null,...D)})}}),y}function qf(y){Zr===null&&w_(),lo(()=>{const m=wd(y);if(typeof m=="function")return m})}const py="5";typeof window<"u"&&((mm=window.__svelte??(window.__svelte={})).v??(mm.v=new Set)).add(py);function Hf(y){return Object.prototype.toString.call(y)==="[object Date]"}function fy(y){return y}function my(y){return-.5*(Math.cos(Math.PI*y)-1)}function Id(y,m){if(y===m||y!==y)return()=>y;const b=typeof y;if(b!==typeof m||Array.isArray(y)!==Array.isArray(m))throw new Error("Cannot interpolate values of different type");if(Array.isArray(y)){const I=m.map((z,D)=>Id(y[D],z));return z=>I.map(D=>D(z))}if(b==="object"){if(!y||!m)throw new Error("Object cannot be null");if(Hf(y)&&Hf(m)){const D=y.getTime(),o=m.getTime()-D;return le=>new Date(D+le*o)}const I=Object.keys(m),z={};return I.forEach(D=>{z[D]=Id(y[D],m[D])}),D=>{const S={};return I.forEach(o=>{S[o]=z[o](D)}),S}}if(b==="number"){const I=m-y;return z=>y+z*I}return()=>m}const Nd=class Nd{constructor(m,b={}){Cr(this,ma,so(void 0));Cr(this,bo,so(void 0));Cr(this,Hl);Cr(this,bs,null);Lt(this,ma).v=Lt(this,bo).v=m,fu(this,Hl,b)}static of(m,b){const I=new Nd(m(),b);return vf(()=>{I.set(m())}),I}set(m,b){var Re;si(Lt(this,bo),m);let{delay:I=0,duration:z=400,easing:D=fy,interpolate:S=Id}={...Lt(this,Hl),...b};if(z===0)return(Re=Lt(this,bs))==null||Re.abort(),si(Lt(this,ma),m),Promise.resolve();const o=Un.now()+I;let le,he=!1,_e=Lt(this,bs);return fu(this,bs,hy(ve=>{if(ve<o)return!0;if(!he){he=!0;const De=Lt(this,ma).v;le=S(De,m),typeof z=="function"&&(z=z(De,m)),_e==null||_e.abort()}const ne=ve-o;return ne>z?(si(Lt(this,ma),m),!1):(si(Lt(this,ma),le(D(ne/z))),!0)})),Lt(this,bs).promise}get current(){return Qe(Lt(this,ma))}get target(){return Qe(Lt(this,bo))}set target(m){this.set(m)}};ma=new WeakMap,bo=new WeakMap,Hl=new WeakMap,bs=new WeakMap;let Ed=Nd;function Wf(y,m,b){const I=b*(Math.PI/180),z=y/2,D=m/2,S=Math.sqrt(z*z+D*D),o=Math.atan(D/z)*(180/Math.PI),le=o,he=180-o,_e=180+o,Re=360-o;switch(!0){case(le<=b&&b<=he):return{offsetX:S*Math.cos(I)-z,offsetY:0};case(he<=b&&b<=_e):return{offsetX:-y,offsetY:S*Math.sin(I)-D};case(_e<=b&&b<=Re):return{offsetX:S*Math.cos(I)-z,offsetY:-m};default:return{offsetX:0,offsetY:S*Math.sin(I)-D}}}function gy(y,m,b){const I=Wf(y,m,b),z=I.offsetX,D=I.offsetY,S=m,o=y,le=Wf(S,o,b),he=S/2+le.offsetX,_e=o/2+le.offsetY,ve=Math.atan2(_e,he)/Math.PI*180-45,ne=0,De=30,_t=z+y/2,Rt=D+m/2,yt=Math.sqrt(_t*_t+Rt*Rt),Dt=Math.min(y,m)/2,Jt=Math.sqrt(y*y+m*m)/2,Xt=(yt-Dt)/(Jt-Dt),Et=ne+Xt*(De-ne);return{markerOffsetX:z,markerOffsetY:D,pinAngleDeg:ve,pinSkewDeg:Et}}const Xf=512,kd=0,Zu=18,_y=10,Kf=3,yy=.5,zd=270,xy=8;var vy=uo('<div><div class="pin svelte-p9fs91"></div> <div class="marker svelte-p9fs91"><div class="popup svelte-p9fs91"><!></div></div></div>');function by(y,m){Tu(m,!0);let b=Ci(!0),I=Ci(!1);function z(mt){si(b,mt,!0)}function D(mt){si(I,!mt)}function S(){return!Qe(I)}let o=zd,le=zd,he=new Ed(zd,{easing:my,interpolate:Re}),_e=!1;lo(()=>{Qe(I)&&(he.set(o,{duration:0}),le=o,Jt(le))}),lo(()=>{le=he.current});function Re(mt,_i){if(Math.abs(_i-mt)<180)return li=>mt+li*(_i-mt);{const li=360-Math.abs(_i-mt),Ni=mt<_i?-1:1;return vr=>(360+mt+vr*li*Ni)%360}}function ve(){o!=le&&(Jt(le),window.requestAnimationFrame(ve))}function ne(mt){mt!=o&&(o=mt,_e?(he.set(mt,{duration:400}),window.requestAnimationFrame(ve)):(he.set(mt,{duration:0}),le=mt,Jt(le))),_e=!0}let De=Ci(0),_t=Ci(0),Rt,yt,Dt;lo(()=>{Qe(De)&&Qe(_t)&&(Dt.style.width=`${Math.min(Qe(De),Qe(_t))/4}px`,Dt.style.height=`${Math.min(Qe(De),Qe(_t))/4}px`)}),lo(()=>{Qe(De)&&Qe(_t)&&Jt(le)});function Jt(mt){if(!Rt||!yt||!Dt)return;const _i=gy(Qe(De),Qe(_t),mt),li=Math.round(_i.markerOffsetX),Ni=Math.round(_i.markerOffsetY);yt.style.transform=`translate(${li}px, ${Ni}px)`;const vr=_i.pinAngleDeg,un=_i.pinSkewDeg;Dt.style.transform=`rotate(${vr}deg) skew(${un}deg, ${un}deg)`;const Ft=-1-2*(li/Qe(De)),zr=-1-2*(Ni/Qe(_t));Rt.style.filter=` drop-shadow(0px 0px 4px rgba(0,0,0,0.4)) drop-shadow(${Ft}px ${zr}px 2px rgba(0,0,0,0.4))`}const Xt=()=>Qe(De),Et=()=>Qe(_t);var Bt=vy();let Ri;var jt=Ml(Bt);Fa(jt,mt=>Dt=mt,()=>Dt);var xr=yd(jt,2);Nu(xr,"",{},{padding:xy+"px"});var cn=Ml(xr),Vr=Ml(cn);return oy(Vr,()=>m.children),Fa(xr,mt=>yt=mt,()=>yt),Fa(Bt,mt=>Rt=mt,()=>Rt),Eu(mt=>Ri=Vf(Bt,1,"anchor svelte-p9fs91",null,Ri,mt),[()=>({collapsed:Qe(b),hidden:Qe(I)})]),$f(xr,"clientWidth",mt=>si(De,mt)),$f(xr,"clientHeight",mt=>si(_t,mt)),ho(y,Bt),Mu({setCollapsed:z,setDisplayed:D,getDisplayed:S,setAngle:ne,getWidth:Xt,getHeight:Et})}var wy=uo("<div></div>");function Ty(y,m){Tu(m,!0);let b=Ci(!0),I=Ci(0),z=Su(()=>1-.5*Qe(I)),D=Su(()=>Qe(b)?"":`scale(${Qe(z)})`),S=Su(()=>Qe(b)?"":`grayscale(${.5*Qe(I)})`),o=Su(()=>Qe(b)||Qe(I)>0?"":"pulsing");function le(ne){si(b,ne,!0)}function he(ne){si(I,Math.max(0,Math.min(1,ne)),!0)}var _e=wy();let Re,ve;return Eu(ne=>{Re=Vf(_e,1,"circle svelte-q2d1i5",null,Re,ne),ve=Nu(_e,"",ve,{transform:Qe(D),filter:Qe(S)})},[()=>({collapsed:Qe(b),pulsing:Qe(o)})]),ho(y,_e),Mu({setCollapsed:le,setDistance:he})}async function My(y){return await Sy(y)}async function Sy(y){const b=await fetch("https://api.maps.areanarium.dev/v1/markers",{method:"POST",body:JSON.stringify(y)});if(!b.ok||!b.body)throw new Error("Failed to get markers");return await b.json()}function Py(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var Vu={exports:{}};/**
2
+ \r\f \v\uFEFF`];function ly(y,m,b){var I=y==null?"":""+y;if(b){for(var z in b)if(b[z])I=I?I+" "+z:z;else if(I.length)for(var D=z.length,S=0;(S=I.indexOf(z,S))>=0;){var o=S+D;(S===0||Nf.includes(I[S-1]))&&(o===I.length||Nf.includes(I[o]))?I=(S===0?"":I.substring(0,S))+I.substring(o+1):S=o}}return I===""?null:I}function Zf(y,m=!1){var b=m?" !important;":";",I="";for(var z in y){var D=y[z];D!=null&&D!==""&&(I+=" "+z+": "+D+b)}return I}function Sd(y){return y[0]!=="-"||y[1]!=="-"?y.toLowerCase():y}function cy(y,m){if(m){var b="",I,z;if(Array.isArray(m)?(I=m[0],z=m[1]):I=m,y){y=String(y).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var D=!1,S=0,o=!1,le=[];I&&le.push(...Object.keys(I).map(Sd)),z&&le.push(...Object.keys(z).map(Sd));var he=0,_e=-1;const _t=y.length;for(var Re=0;Re<_t;Re++){var ve=y[Re];if(o?ve==="/"&&y[Re-1]==="*"&&(o=!1):D?D===ve&&(D=!1):ve==="/"&&y[Re+1]==="*"?o=!0:ve==='"'||ve==="'"?D=ve:ve==="("?S++:ve===")"&&S--,!o&&D===!1&&S===0){if(ve===":"&&_e===-1)_e=Re;else if(ve===";"||Re===_t-1){if(_e!==-1){var ne=Sd(y.substring(he,_e).trim());if(!le.includes(ne)){ve!==";"&&Re++;var De=y.substring(he,Re).trim();b+=" "+De+";"}}he=Re+1,_e=-1}}}}return I&&(b+=Zf(I)),z&&(b+=Zf(z,!0)),b=b.trim(),b===""?null:b}return y==null?null:String(y)}function Vf(y,m,b,I,z,D){var S=y.__className;if(S!==b||S===void 0){var o=ly(b,I,D);o==null?y.removeAttribute("class"):y.className=o,y.__className=b}else if(D&&z!==D)for(var le in D){var he=!!D[le];(z==null||he!==!!z[le])&&y.classList.toggle(le,he)}return D}function Pd(y,m={},b,I){for(var z in b){var D=b[z];m[z]!==D&&(b[z]==null?y.style.removeProperty(z):y.style.setProperty(z,D,I))}}function Nu(y,m,b,I){var z=y.__style;if(z!==m){var D=cy(m,I);D==null?y.removeAttribute("style"):y.style.cssText=D,y.__style=m}else I&&(Array.isArray(I)?(Pd(y,b==null?void 0:b[0],I[0]),Pd(y,b==null?void 0:b[1],I[1],"important")):Pd(y,b,I));return I}const uy=()=>performance.now(),Un={tick:y=>requestAnimationFrame(y),now:()=>uy(),tasks:new Set};function Uf(){const y=Un.now();Un.tasks.forEach(m=>{m.c(y)||(Un.tasks.delete(m),m.f())}),Un.tasks.size!==0&&Un.tick(Uf)}function hy(y){let m;return Un.tasks.size===0&&Un.tick(Uf),{promise:new Promise(b=>{Un.tasks.add(m={c:y,f:b})}),abort(){Un.tasks.delete(m)}}}const Ju=class Ju{constructor(m){Cr(this,Yu);Cr(this,Va,new WeakMap);Cr(this,vo);Cr(this,ql);fu(this,ql,m)}observe(m,b){var I=Lt(this,Va).get(m)||new Set;return I.add(b),Lt(this,Va).set(m,I),Qg(this,Yu,e_).call(this).observe(m,Lt(this,ql)),()=>{var z=Lt(this,Va).get(m);z.delete(b),z.size===0&&(Lt(this,Va).delete(m),Lt(this,vo).unobserve(m))}}};Va=new WeakMap,vo=new WeakMap,ql=new WeakMap,Yu=new WeakSet,e_=function(){return Lt(this,vo)??fu(this,vo,new ResizeObserver(m=>{for(var b of m){Ju.entries.set(b.target,b);for(var I of Lt(this,Va).get(b.target)||[])I(b)}}))},fs(Ju,"entries",new WeakMap);let Cd=Ju;var dy=new Cd({box:"border-box"});function $f(y,m,b){var I=dy.observe(y,()=>b(y[m]));Iu(()=>(wd(()=>b(y[m])),I))}function Gf(y,m){return y===m||(y==null?void 0:y[bu])===m}function Fa(y={},m,b,I){return Iu(()=>{var z,D;return vf(()=>{z=D,D=(I==null?void 0:I())||[],wd(()=>{y!==b(...D)&&(m(y,...D),z&&Gf(b(...z),y)&&m(null,...z))})}),()=>{Cf(()=>{D&&Gf(b(...D),y)&&m(null,...D)})}}),y}function qf(y){Zr===null&&w_(),lo(()=>{const m=wd(y);if(typeof m=="function")return m})}const py="5";typeof window<"u"&&((mm=window.__svelte??(window.__svelte={})).v??(mm.v=new Set)).add(py);function Hf(y){return Object.prototype.toString.call(y)==="[object Date]"}function fy(y){return y}function my(y){return-.5*(Math.cos(Math.PI*y)-1)}function Id(y,m){if(y===m||y!==y)return()=>y;const b=typeof y;if(b!==typeof m||Array.isArray(y)!==Array.isArray(m))throw new Error("Cannot interpolate values of different type");if(Array.isArray(y)){const I=m.map((z,D)=>Id(y[D],z));return z=>I.map(D=>D(z))}if(b==="object"){if(!y||!m)throw new Error("Object cannot be null");if(Hf(y)&&Hf(m)){const D=y.getTime(),o=m.getTime()-D;return le=>new Date(D+le*o)}const I=Object.keys(m),z={};return I.forEach(D=>{z[D]=Id(y[D],m[D])}),D=>{const S={};return I.forEach(o=>{S[o]=z[o](D)}),S}}if(b==="number"){const I=m-y;return z=>y+z*I}return()=>m}const Nd=class Nd{constructor(m,b={}){Cr(this,ma,so(void 0));Cr(this,bo,so(void 0));Cr(this,Hl);Cr(this,bs,null);Lt(this,ma).v=Lt(this,bo).v=m,fu(this,Hl,b)}static of(m,b){const I=new Nd(m(),b);return vf(()=>{I.set(m())}),I}set(m,b){var Re;si(Lt(this,bo),m);let{delay:I=0,duration:z=400,easing:D=fy,interpolate:S=Id}={...Lt(this,Hl),...b};if(z===0)return(Re=Lt(this,bs))==null||Re.abort(),si(Lt(this,ma),m),Promise.resolve();const o=Un.now()+I;let le,he=!1,_e=Lt(this,bs);return fu(this,bs,hy(ve=>{if(ve<o)return!0;if(!he){he=!0;const De=Lt(this,ma).v;le=S(De,m),typeof z=="function"&&(z=z(De,m)),_e==null||_e.abort()}const ne=ve-o;return ne>z?(si(Lt(this,ma),m),!1):(si(Lt(this,ma),le(D(ne/z))),!0)})),Lt(this,bs).promise}get current(){return Qe(Lt(this,ma))}get target(){return Qe(Lt(this,bo))}set target(m){this.set(m)}};ma=new WeakMap,bo=new WeakMap,Hl=new WeakMap,bs=new WeakMap;let Ed=Nd;function Wf(y,m,b){const I=b*(Math.PI/180),z=y/2,D=m/2,S=Math.sqrt(z*z+D*D),o=Math.atan(D/z)*(180/Math.PI),le=o,he=180-o,_e=180+o,Re=360-o;switch(!0){case(le<=b&&b<=he):return{offsetX:S*Math.cos(I)-z,offsetY:0};case(he<=b&&b<=_e):return{offsetX:-y,offsetY:S*Math.sin(I)-D};case(_e<=b&&b<=Re):return{offsetX:S*Math.cos(I)-z,offsetY:-m};default:return{offsetX:0,offsetY:S*Math.sin(I)-D}}}function gy(y,m,b){const I=Wf(y,m,b),z=I.offsetX,D=I.offsetY,S=m,o=y,le=Wf(S,o,b),he=S/2+le.offsetX,_e=o/2+le.offsetY,ve=Math.atan2(_e,he)/Math.PI*180-45,ne=0,De=30,_t=z+y/2,Rt=D+m/2,yt=Math.sqrt(_t*_t+Rt*Rt),Dt=Math.min(y,m)/2,Jt=Math.sqrt(y*y+m*m)/2,Xt=(yt-Dt)/(Jt-Dt),Et=ne+Xt*(De-ne);return{markerOffsetX:z,markerOffsetY:D,pinAngleDeg:ve,pinSkewDeg:Et}}const Xf=512,kd=0,Zu=18,_y=10,Kf=3,yy=.5,zd=270,xy=8;var vy=uo('<div><div class="pin svelte-p9fs91"></div> <div class="marker svelte-p9fs91"><div class="popup svelte-p9fs91"><!></div></div></div>');function by(y,m){Tu(m,!0);let b=Ci(!0),I=Ci(!1);function z(mt){si(b,mt,!0)}function D(mt){si(I,!mt)}function S(){return!Qe(I)}let o=zd,le=zd,he=new Ed(zd,{easing:my,interpolate:Re}),_e=!1;lo(()=>{Qe(I)&&(he.set(o,{duration:0}),le=o,Jt(le))}),lo(()=>{le=he.current});function Re(mt,_i){if(Math.abs(_i-mt)<180)return li=>mt+li*(_i-mt);{const li=360-Math.abs(_i-mt),Ni=mt<_i?-1:1;return vr=>(360+mt+vr*li*Ni)%360}}function ve(){o!=le&&(Jt(le),window.requestAnimationFrame(ve))}function ne(mt){mt!=o&&(o=mt,_e?(he.set(mt,{duration:400}),window.requestAnimationFrame(ve)):(he.set(mt,{duration:0}),le=mt,Jt(le))),_e=!0}let De=Ci(0),_t=Ci(0),Rt,yt,Dt;lo(()=>{Qe(De)&&Qe(_t)&&(Dt.style.width=`${Math.min(Qe(De),Qe(_t))/4}px`,Dt.style.height=`${Math.min(Qe(De),Qe(_t))/4}px`)}),lo(()=>{Qe(De)&&Qe(_t)&&Jt(le)});function Jt(mt){if(!Rt||!yt||!Dt)return;const _i=gy(Qe(De),Qe(_t),mt),li=Math.round(_i.markerOffsetX),Ni=Math.round(_i.markerOffsetY);yt.style.transform=`translate(${li}px, ${Ni}px)`;const vr=_i.pinAngleDeg,un=_i.pinSkewDeg;Dt.style.transform=`rotate(${vr}deg) skew(${un}deg, ${un}deg)`;const Ft=-1-2*(li/Qe(De)),zr=-1-2*(Ni/Qe(_t));Rt.style.filter=` drop-shadow(0px 0px 4px rgba(0,0,0,0.4)) drop-shadow(${Ft}px ${zr}px 2px rgba(0,0,0,0.4))`}const Xt=()=>Qe(De),Et=()=>Qe(_t);var Bt=vy();let Ri;var jt=Ml(Bt);Fa(jt,mt=>Dt=mt,()=>Dt);var xr=yd(jt,2);Nu(xr,"",{},{padding:xy+"px"});var cn=Ml(xr),Vr=Ml(cn);return oy(Vr,()=>m.children),Fa(xr,mt=>yt=mt,()=>yt),Fa(Bt,mt=>Rt=mt,()=>Rt),Eu(mt=>Ri=Vf(Bt,1,"anchor svelte-p9fs91",null,Ri,mt),[()=>({collapsed:Qe(b),hidden:Qe(I)})]),$f(xr,"clientWidth",mt=>si(De,mt)),$f(xr,"clientHeight",mt=>si(_t,mt)),ho(y,Bt),Mu({setCollapsed:z,setDisplayed:D,getDisplayed:S,setAngle:ne,getWidth:Xt,getHeight:Et})}var wy=uo("<div></div>");function Ty(y,m){Tu(m,!0);let b=Ci(!0),I=Ci(0),z=Su(()=>1-.5*Qe(I)),D=Su(()=>Qe(b)?"":`scale(${Qe(z)})`),S=Su(()=>Qe(b)?"":`grayscale(${.5*Qe(I)})`),o=Su(()=>Qe(b)||Qe(I)>0?"":"pulsing");function le(ne){si(b,ne,!0)}function he(ne){si(I,Math.max(0,Math.min(1,ne)),!0)}var _e=wy();let Re,ve;return Eu(ne=>{Re=Vf(_e,1,"circle svelte-q2d1i5",null,Re,ne),ve=Nu(_e,"",ve,{transform:Qe(D),filter:Qe(S)})},[()=>({collapsed:Qe(b),pulsing:Qe(o)})]),ho(y,_e),Mu({setCollapsed:le,setDistance:he})}async function My(y){return await Sy(y)}async function Sy(y){const b=await fetch("https://api.maps.arenarium.dev/v1/markers",{method:"POST",body:JSON.stringify(y)});if(!b.ok||!b.body)throw new Error("Failed to get markers");return await b.json()}function Py(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var Vu={exports:{}};/**
3
3
  * MapLibre GL JS
4
4
  * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.4.0/LICENSE.txt
5
5
  */var Cy=Vu.exports,Yf;function Iy(){return Yf||(Yf=1,function(y,m){(function(b,I){y.exports=I()})(Cy,function(){var b={},I={};function z(S,o,le){if(I[S]=le,S==="index"){var he="var sharedModule = {}; ("+I.shared+")(sharedModule); ("+I.worker+")(sharedModule);",_e={};return I.shared(_e),I.index(b,_e),typeof window<"u"&&b.setWorkerUrl(window.URL.createObjectURL(new Blob([he],{type:"text/javascript"}))),b}}z("shared",["exports"],function(S){function o(r,t,n,a){return new(n||(n=Promise))(function(c,d){function p(w){try{x(a.next(w))}catch(M){d(M)}}function g(w){try{x(a.throw(w))}catch(M){d(M)}}function x(w){var M;w.done?c(w.value):(M=w.value,M instanceof n?M:new n(function(C){C(M)})).then(p,g)}x((a=a.apply(r,t||[])).next())})}function le(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var he,_e;function Re(){if(_e)return he;function r(t,n){this.x=t,this.y=n}return _e=1,he=r,r.prototype={clone:function(){return new r(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,n){return this.clone()._rotateAround(t,n)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var n=t.x-this.x,a=t.y-this.y;return n*n+a*a},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult:function(t){var n=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var n=Math.cos(t),a=Math.sin(t),c=a*this.x+n*this.y;return this.x=n*this.x-a*this.y,this.y=c,this},_rotateAround:function(t,n){var a=Math.cos(t),c=Math.sin(t),d=n.y+c*(this.x-n.x)+a*(this.y-n.y);return this.x=n.x+a*(this.x-n.x)-c*(this.y-n.y),this.y=d,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},r.convert=function(t){return t instanceof r?t:Array.isArray(t)?new r(t[0],t[1]):t},he}typeof SuppressedError=="function"&&SuppressedError;var ve,ne,De=le(Re()),_t=function(){if(ne)return ve;function r(t,n,a,c){this.cx=3*t,this.bx=3*(a-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(c-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=a,this.p2y=c}return ne=1,ve=r,r.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,n){if(n===void 0&&(n=1e-6),t<0)return 0;if(t>1)return 1;for(var a=t,c=0;c<8;c++){var d=this.sampleCurveX(a)-t;if(Math.abs(d)<n)return a;var p=this.sampleCurveDerivativeX(a);if(Math.abs(p)<1e-6)break;a-=d/p}var g=0,x=1;for(a=t,c=0;c<20&&(d=this.sampleCurveX(a),!(Math.abs(d-t)<n));c++)t>d?g=a:x=a,a=.5*(x-g)+g;return a},solve:function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))}},ve}(),Rt=le(_t);let yt,Dt;function Jt(){return yt==null&&(yt=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),yt}function Xt(){if(Dt==null&&(Dt=!1,Jt())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let a=0;a<5*5;a++){const c=4*a;t.fillStyle=`rgb(${c},${c+1},${c+2})`,t.fillRect(a%5,Math.floor(a/5),1,1)}const n=t.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!=3&&n[a]!==a){Dt=!0;break}}}return Dt||!1}var Et=1e-6,Bt=typeof Float32Array<"u"?Float32Array:Array;function Ri(){var r=new Bt(9);return Bt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function jt(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function xr(){var r=new Bt(3);return Bt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function cn(r){return Math.hypot(r[0],r[1],r[2])}function Vr(r,t,n){var a=new Bt(3);return a[0]=r,a[1]=t,a[2]=n,a}Math.hypot||(Math.hypot=function(){for(var r=0,t=arguments.length;t--;)r+=arguments[t]*arguments[t];return Math.sqrt(r)});var mt,_i=cn;function li(r,t,n){var a=t[0],c=t[1],d=t[2],p=t[3];return r[0]=n[0]*a+n[4]*c+n[8]*d+n[12]*p,r[1]=n[1]*a+n[5]*c+n[9]*d+n[13]*p,r[2]=n[2]*a+n[6]*c+n[10]*d+n[14]*p,r[3]=n[3]*a+n[7]*c+n[11]*d+n[15]*p,r}function Ni(){var r=new Bt(4);return Bt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function vr(){var r=new Bt(2);return Bt!=Float32Array&&(r[0]=0,r[1]=0),r}function un(r,t){var n=new Bt(2);return n[0]=r,n[1]=t,n}xr(),mt=new Bt(4),Bt!=Float32Array&&(mt[0]=0,mt[1]=0,mt[2]=0,mt[3]=0),xr(),Vr(1,0,0),Vr(0,1,0),Ni(),Ni(),Ri(),vr();const Ft=8192;function zr(r,t,n){return t*(Ft/(r.tileSize*Math.pow(2,n-r.tileID.overscaledZ)))}function Ar(r,t){return(r%t+t)%t}function Hn(r,t,n){return r*(1-n)+t*n}function yi(r){if(r<=0)return 0;if(r>=1)return 1;const t=r*r,n=t*r;return 4*(r<.5?n:3*(r-t)+n-.75)}function Pn(r,t,n,a){const c=new Rt(r,t,n,a);return d=>c.solve(d)}const ir=Pn(.25,.1,.25,1);function Ti(r,t,n){return Math.min(n,Math.max(t,r))}function hn(r,t,n){const a=n-t,c=((r-t)%a+a)%a+t;return c===t?n:c}function hr(r,...t){for(const n of t)for(const a in n)r[a]=n[a];return r}let Wn=1;function Cn(r,t,n){const a={};for(const c in r)a[c]=t.call(this,r[c],c,r);return a}function ga(r,t,n){const a={};for(const c in r)t.call(this,r[c],c,r)&&(a[c]=r[c]);return a}function dr(r){return Array.isArray(r)?r.map(dr):typeof r=="object"&&r?Cn(r,dr):r}const Ki={};function Zi(r){Ki[r]||(typeof console<"u"&&console.warn(r),Ki[r]=!0)}function Wt(r,t,n){return(n.y-r.y)*(t.x-r.x)>(t.y-r.y)*(n.x-r.x)}function rr(r){return typeof WorkerGlobalScope<"u"&&r!==void 0&&r instanceof WorkerGlobalScope}let br=null;function Vi(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}const Xr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Kr(r,t,n,a,c){return o(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const d=new VideoFrame(r,{timestamp:0});try{const p=d==null?void 0:d.format;if(!p||!p.startsWith("BGR")&&!p.startsWith("RGB"))throw new Error(`Unrecognized format ${p}`);const g=p.startsWith("BGR"),x=new Uint8ClampedArray(a*c*4);if(yield d.copyTo(x,function(w,M,C,A,L){const B=4*Math.max(1,0),j=(Math.max(0,C)-C)*A*4+B,$=4*A,X=Math.max(0,M),se=Math.max(0,C);return{rect:{x:X,y:se,width:Math.min(w.width,M+A)-X,height:Math.min(w.height,C+L)-se},layout:[{offset:j,stride:$}]}}(r,t,n,a,c)),g)for(let w=0;w<x.length;w+=4){const M=x[w];x[w]=x[w+2],x[w+2]=M}return x}finally{d.close()}})}let Di,nr;function Ze(r,t,n,a){return r.addEventListener(t,n,a),{unsubscribe:()=>{r.removeEventListener(t,n,a)}}}function Xe(r){return r/Math.PI*180}const bt={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},Kt={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},fi="AbortError";function kt(){return new Error(fi)}const ut={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Gt(r){return ut.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}const qt="global-dispatcher";class Li extends Error{constructor(t,n,a,c){super(`AJAXError: ${n} (${t}): ${a}`),this.status=t,this.statusText=n,this.url=a,this.body=c}}const Yt=()=>rr(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Mi=function(r,t){if(/:\/\//.test(r.url)&&!/^https?:|^file:/.test(r.url)){const a=Gt(r.url);if(a)return a(r,t);if(rr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:qt},t)}if(!(/^file:/.test(n=r.url)||/^file:/.test(Yt())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(a,c){return o(this,void 0,void 0,function*(){const d=new Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,cache:a.cache,referrer:Yt(),signal:c.signal});let p,g;a.type!=="json"||d.headers.has("Accept")||d.headers.set("Accept","application/json");try{p=yield fetch(d)}catch(w){throw new Li(0,w.message,a.url,new Blob)}if(!p.ok){const w=yield p.blob();throw new Li(p.status,p.statusText,a.url,w)}g=a.type==="arrayBuffer"||a.type==="image"?p.arrayBuffer():a.type==="json"?p.json():p.text();const x=yield g;if(c.signal.aborted)throw kt();return{data:x,cacheControl:p.headers.get("Cache-Control"),expires:p.headers.get("Expires")}})}(r,t);if(rr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:qt},t)}var n;return function(a,c){return new Promise((d,p)=>{var g;const x=new XMLHttpRequest;x.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(x.responseType="arraybuffer");for(const w in a.headers)x.setRequestHeader(w,a.headers[w]);a.type==="json"&&(x.responseType="text",!((g=a.headers)===null||g===void 0)&&g.Accept||x.setRequestHeader("Accept","application/json")),x.withCredentials=a.credentials==="include",x.onerror=()=>{p(new Error(x.statusText))},x.onload=()=>{if(!c.signal.aborted)if((x.status>=200&&x.status<300||x.status===0)&&x.response!==null){let w=x.response;if(a.type==="json")try{w=JSON.parse(x.response)}catch(M){return void p(M)}d({data:w,cacheControl:x.getResponseHeader("Cache-Control"),expires:x.getResponseHeader("Expires")})}else{const w=new Blob([x.response],{type:x.getResponseHeader("Content-Type")});p(new Li(x.status,x.statusText,a.url,w))}},c.signal.addEventListener("abort",()=>{x.abort(),p(kt())}),x.send(a.body)})}(r,t)};function pr(r){if(!r||r.indexOf("://")<=0||r.indexOf("data:image/")===0||r.indexOf("blob:")===0)return!0;const t=new URL(r),n=window.location;return t.protocol===n.protocol&&t.host===n.host}function ue(r,t,n){n[r]&&n[r].indexOf(t)!==-1||(n[r]=n[r]||[],n[r].push(t))}function N(r,t,n){if(n&&n[r]){const a=n[r].indexOf(t);a!==-1&&n[r].splice(a,1)}}class Z{constructor(t,n={}){hr(this,n),this.type=t}}class G extends Z{constructor(t,n={}){super("error",hr({error:t},n))}}class J{on(t,n){return this._listeners=this._listeners||{},ue(t,n,this._listeners),{unsubscribe:()=>{this.off(t,n)}}}off(t,n){return N(t,n,this._listeners),N(t,n,this._oneTimeListeners),this}once(t,n){return n?(this._oneTimeListeners=this._oneTimeListeners||{},ue(t,n,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,n){typeof t=="string"&&(t=new Z(t,n||{}));const a=t.type;if(this.listens(a)){t.target=this;const c=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const g of c)g.call(this,t);const d=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const g of d)N(a,g,this._oneTimeListeners),g.call(this,t);const p=this._eventedParent;p&&(hr(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(t))}else t instanceof G&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,n){return this._eventedParent=t,this._eventedParentData=n,this}}var V={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const ce=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ge(r,t){const n={};for(const a in r)a!=="ref"&&(n[a]=r[a]);return ce.forEach(a=>{a in t&&(n[a]=t[a])}),n}function ie(r,t){if(Array.isArray(r)){if(!Array.isArray(t)||r.length!==t.length)return!1;for(let n=0;n<r.length;n++)if(!ie(r[n],t[n]))return!1;return!0}if(typeof r=="object"&&r!==null&&t!==null){if(typeof t!="object"||Object.keys(r).length!==Object.keys(t).length)return!1;for(const n in r)if(!ie(r[n],t[n]))return!1;return!0}return r===t}function ye(r,t){r.push(t)}function be(r,t,n){ye(n,{command:"addSource",args:[r,t[r]]})}function de(r,t,n){ye(t,{command:"removeSource",args:[r]}),n[r]=!0}function ke(r,t,n,a){de(r,n,a),be(r,t,n)}function Ne(r,t,n){let a;for(a in r[n])if(Object.prototype.hasOwnProperty.call(r[n],a)&&a!=="data"&&!ie(r[n][a],t[n][a]))return!1;for(a in t[n])if(Object.prototype.hasOwnProperty.call(t[n],a)&&a!=="data"&&!ie(r[n][a],t[n][a]))return!1;return!0}function Ve(r,t,n,a,c,d){r=r||{},t=t||{};for(const p in r)Object.prototype.hasOwnProperty.call(r,p)&&(ie(r[p],t[p])||n.push({command:d,args:[a,p,t[p],c]}));for(const p in t)Object.prototype.hasOwnProperty.call(t,p)&&!Object.prototype.hasOwnProperty.call(r,p)&&(ie(r[p],t[p])||n.push({command:d,args:[a,p,t[p],c]}))}function rt(r){return r.id}function dt(r,t){return r[t.id]=t,r}class Me{constructor(t,n,a,c){this.message=(t?`${t}: `:"")+a,c&&(this.identifier=c),n!=null&&n.__line__&&(this.line=n.__line__)}}function at(r,...t){for(const n of t)for(const a in n)r[a]=n[a];return r}class Ct extends Error{constructor(t,n){super(n),this.message=n,this.key=t}}class Vt{constructor(t,n=[]){this.parent=t,this.bindings={};for(const[a,c]of n)this.bindings[a]=c}concat(t){return new Vt(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const It={kind:"null"},Ie={kind:"number"},$e={kind:"string"},et={kind:"boolean"},fr={kind:"color"},ar={kind:"projectionDefinition"},ci={kind:"object"},lt={kind:"value"},ws={kind:"collator"},_a={kind:"formatted"},wo={kind:"padding"},Xn={kind:"resolvedImage"},To={kind:"variableAnchorOffsetCollection"};function Ui(r,t){return{kind:"array",itemType:r,N:t}}function ei(r){if(r.kind==="array"){const t=ei(r.itemType);return typeof r.N=="number"?`array<${t}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${t}>`}return r.kind}const $i=[It,Ie,$e,et,fr,ar,_a,ci,Ui(lt),wo,Xn,To];function Ts(r,t){if(t.kind==="error")return null;if(r.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Ts(r.itemType,t.itemType))&&(typeof r.N!="number"||r.N===t.N))return null}else{if(r.kind===t.kind)return null;if(r.kind==="value"){for(const n of $i)if(!Ts(n,t))return null}}return`Expected ${ei(r)} but found ${ei(t)} instead.`}function Mo(r,t){return t.some(n=>n.kind===r.kind)}function Yr(r,t){return t.some(n=>n==="null"?r===null:n==="array"?Array.isArray(r):n==="object"?r&&!Array.isArray(r)&&typeof r=="object":n===typeof r)}function ya(r,t){return r.kind==="array"&&t.kind==="array"?r.itemType.kind===t.itemType.kind&&typeof r.N=="number":r.kind===t.kind}const Qu=.96422,eh=.82521,Wl=4/29,Ua=6/29,Xl=3*Ua*Ua,Zd=Ua*Ua*Ua,Vd=Math.PI/180,Ud=180/Math.PI;function th(r){return(r%=360)<0&&(r+=360),r}function ih([r,t,n,a]){let c,d;const p=Yl((.2225045*(r=Kl(r))+.7168786*(t=Kl(t))+.0606169*(n=Kl(n)))/1);r===t&&t===n?c=d=p:(c=Yl((.4360747*r+.3850649*t+.1430804*n)/Qu),d=Yl((.0139322*r+.0971045*t+.7141733*n)/eh));const g=116*p-16;return[g<0?0:g,500*(c-p),200*(p-d),a]}function Kl(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function Yl(r){return r>Zd?Math.pow(r,1/3):r/Xl+Wl}function Jl([r,t,n,a]){let c=(r+16)/116,d=isNaN(t)?c:c+t/500,p=isNaN(n)?c:c-n/200;return c=1*Ql(c),d=Qu*Ql(d),p=eh*Ql(p),[xa(3.1338561*d-1.6168667*c-.4906146*p),xa(-.9787684*d+1.9161415*c+.033454*p),xa(.0719453*d-.2289914*c+1.4052427*p),a]}function xa(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function Ql(r){return r>Ua?r*r*r:Xl*(r-Wl)}function So(r){return parseInt(r.padEnd(2,r),16)/255}function $a(r,t){return Ga(t?r/100:r,0,1)}function Ga(r,t,n){return Math.min(Math.max(t,r),n)}function rh(r){return!r.some(Number.isNaN)}const $d={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function In(r,t,n){return r+n*(t-r)}function qa(r,t,n){return r.map((a,c)=>In(a,t[c],n))}class gt{constructor(t,n,a,c=1,d=!0){this.r=t,this.g=n,this.b=a,this.a=c,d||(this.r*=c,this.g*=c,this.b*=c,c||this.overwriteGetter("rgb",[t,n,a,c]))}static parse(t){if(t instanceof gt)return t;if(typeof t!="string")return;const n=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const c=$d[a];if(c){const[p,g,x]=c;return[p/255,g/255,x/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const p=a.length<6?1:2;let g=1;return[So(a.slice(g,g+=p)),So(a.slice(g,g+=p)),So(a.slice(g,g+=p)),So(a.slice(g,g+p)||"ff")]}if(a.startsWith("rgb")){const p=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[g,x,w,M,C,A,L,B,j,$,X,se]=p,Y=[M||" ",L||" ",$].join("");if(Y===" "||Y===" /"||Y===",,"||Y===",,,"){const R=[w,A,j].join(""),U=R==="%%%"?100:R===""?255:0;if(U){const Q=[Ga(+x/U,0,1),Ga(+C/U,0,1),Ga(+B/U,0,1),X?$a(+X,se):1];if(rh(Q))return Q}}return}}const d=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[p,g,x,w,M,C,A,L,B]=d,j=[x||" ",M||" ",A].join("");if(j===" "||j===" /"||j===",,"||j===",,,"){const $=[+g,Ga(+w,0,100),Ga(+C,0,100),L?$a(+L,B):1];if(rh($))return function([X,se,Y,R]){function U(Q){const fe=(Q+X/30)%12,ze=se*Math.min(Y,1-Y);return Y-ze*Math.max(-1,Math.min(fe-3,9-fe,1))}return X=th(X),se/=100,Y/=100,[U(0),U(8),U(4),R]}($)}}}(t);return n?new gt(...n,!1):void 0}get rgb(){const{r:t,g:n,b:a,a:c}=this,d=c||1/0;return this.overwriteGetter("rgb",[t/d,n/d,a/d,c])}get hcl(){return this.overwriteGetter("hcl",function(t){const[n,a,c,d]=ih(t),p=Math.sqrt(a*a+c*c);return[Math.round(1e4*p)?th(Math.atan2(c,a)*Ud):NaN,p,n,d]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ih(this.rgb))}overwriteGetter(t,n){return Object.defineProperty(this,t,{value:n}),n}toString(){const[t,n,a,c]=this.rgb;return`rgba(${[t,n,a].map(d=>Math.round(255*d)).join(",")},${c})`}static interpolate(t,n,a,c="rgb"){switch(c){case"rgb":{const[d,p,g,x]=qa(t.rgb,n.rgb,a);return new gt(d,p,g,x,!1)}case"hcl":{const[d,p,g,x]=t.hcl,[w,M,C,A]=n.hcl;let L,B;if(isNaN(d)||isNaN(w))isNaN(d)?isNaN(w)?L=NaN:(L=w,g!==1&&g!==0||(B=M)):(L=d,C!==1&&C!==0||(B=p));else{let Y=w-d;w>d&&Y>180?Y-=360:w<d&&d-w>180&&(Y+=360),L=d+a*Y}const[j,$,X,se]=function([Y,R,U,Q]){return Y=isNaN(Y)?0:Y*Vd,Jl([U,Math.cos(Y)*R,Math.sin(Y)*R,Q])}([L,B??In(p,M,a),In(g,C,a),In(x,A,a)]);return new gt(j,$,X,se,!1)}case"lab":{const[d,p,g,x]=Jl(qa(t.lab,n.lab,a));return new gt(d,p,g,x,!1)}}}}gt.black=new gt(0,0,0,1),gt.white=new gt(1,1,1,1),gt.transparent=new gt(0,0,0,0),gt.red=new gt(1,0,0,1);class St{constructor(t,n,a){this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,n){return this.collator.compare(t,n)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Ha=["bottom","center","top"];class dn{constructor(t,n,a,c,d,p){this.text=t,this.image=n,this.scale=a,this.fontStack=c,this.textColor=d,this.verticalAlign=p}}class wr{constructor(t){this.sections=t}static fromString(t){return new wr([new dn(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof wr?t:wr.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class sr{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof sr)return t;if(typeof t=="number")return new sr([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const n of t)if(typeof n!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new sr(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,a){return new sr(qa(t.values,n.values,a))}}class xi{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Ms=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Yi{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Yi)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let n=0;n<t.length;n+=2){const a=t[n],c=t[n+1];if(typeof a!="string"||!Ms.has(a)||!Array.isArray(c)||c.length!==2||typeof c[0]!="number"||typeof c[1]!="number")return}return new Yi(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,a){const c=t.values,d=n.values;if(c.length!==d.length)throw new xi(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${n.toString()}`);const p=[];for(let g=0;g<c.length;g+=2){if(c[g]!==d[g])throw new xi(`Cannot interpolate values containing mismatched anchors. from[${g}]: ${c[g]}, to[${g}]: ${d[g]}`);p.push(c[g]);const[x,w]=c[g+1],[M,C]=d[g+1];p.push([In(x,M,a),In(w,C,a)])}return new Yi(p)}}class Rr{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Rr({name:t,available:!1}):null}}class mr{constructor(t,n,a){this.from=t,this.to=n,this.transition=a}static interpolate(t,n,a){return new mr(t,n,a)}static parse(t){return t instanceof mr?t:Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"?new mr(t[0],t[1],t[2]):typeof t=="object"&&typeof t.from=="string"&&typeof t.to=="string"&&typeof t.transition=="number"?new mr(t.from,t.to,t.transition):typeof t=="string"?new mr(t,t,1):void 0}}function Kn(r,t,n,a){return typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof n=="number"&&n>=0&&n<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[r,t,n,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[r,t,n,a]:[r,t,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ss(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof mr||r instanceof gt||r instanceof St||r instanceof wr||r instanceof sr||r instanceof Yi||r instanceof Rr)return!0;if(Array.isArray(r)){for(const t of r)if(!Ss(t))return!1;return!0}if(typeof r=="object"){for(const t in r)if(!Ss(r[t]))return!1;return!0}return!1}function vi(r){if(r===null)return It;if(typeof r=="string")return $e;if(typeof r=="boolean")return et;if(typeof r=="number")return Ie;if(r instanceof gt)return fr;if(r instanceof mr)return ar;if(r instanceof St)return ws;if(r instanceof wr)return _a;if(r instanceof sr)return wo;if(r instanceof Yi)return To;if(r instanceof Rr)return Xn;if(Array.isArray(r)){const t=r.length;let n;for(const a of r){const c=vi(a);if(n){if(n===c)continue;n=lt;break}n=c}return Ui(n||lt,t)}return ci}function pn(r){const t=typeof r;return r===null?"":t==="string"||t==="number"||t==="boolean"?String(r):r instanceof gt||r instanceof mr||r instanceof wr||r instanceof sr||r instanceof Yi||r instanceof Rr?r.toString():JSON.stringify(r)}class Yn{constructor(t,n){this.type=t,this.value=n}static parse(t,n){if(t.length!==2)return n.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Ss(t[1]))return n.error("invalid value");const a=t[1];let c=vi(a);const d=n.expectedType;return c.kind!=="array"||c.N!==0||!d||d.kind!=="array"||typeof d.N=="number"&&d.N!==0||(c=d),new Yn(c,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Ps={string:$e,number:Ie,boolean:et,object:ci};class Ur{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let a,c=1;const d=t[0];if(d==="array"){let g,x;if(t.length>2){const w=t[1];if(typeof w!="string"||!(w in Ps)||w==="object")return n.error('The item type argument of "array" must be one of string, number, boolean',1);g=Ps[w],c++}else g=lt;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return n.error('The length argument to "array" must be a positive integer literal',2);x=t[2],c++}a=Ui(g,x)}else{if(!Ps[d])throw new Error(`Types doesn't contain name = ${d}`);a=Ps[d]}const p=[];for(;c<t.length;c++){const g=n.parse(t[c],c,lt);if(!g)return null;p.push(g)}return new Ur(a,p)}evaluate(t){for(let n=0;n<this.args.length;n++){const a=this.args[n].evaluate(t);if(!Ts(this.type,vi(a)))return a;if(n===this.args.length-1)throw new xi(`Expected value to be of type ${ei(this.type)}, but found ${ei(vi(a))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Cs={"to-boolean":et,"to-color":fr,"to-number":Ie,"to-string":$e};class Nt{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");const a=t[0];if(!Cs[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&t.length!==2)return n.error("Expected one argument.");const c=Cs[a],d=[];for(let p=1;p<t.length;p++){const g=n.parse(t[p],p,lt);if(!g)return null;d.push(g)}return new Nt(c,d)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let n,a;for(const c of this.args){if(n=c.evaluate(t),a=null,n instanceof gt)return n;if(typeof n=="string"){const d=t.parseColor(n);if(d)return d}else if(Array.isArray(n)&&(a=n.length<3||n.length>4?`Invalid rgba value ${JSON.stringify(n)}: expected an array containing either three or four numeric values.`:Kn(n[0],n[1],n[2],n[3]),!a))return new gt(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new xi(a||`Could not parse color from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"padding":{let n;for(const a of this.args){n=a.evaluate(t);const c=sr.parse(n);if(c)return c}throw new xi(`Could not parse padding from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"variableAnchorOffsetCollection":{let n;for(const a of this.args){n=a.evaluate(t);const c=Yi.parse(n);if(c)return c}throw new xi(`Could not parse variableAnchorOffsetCollection from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"number":{let n=null;for(const a of this.args){if(n=a.evaluate(t),n===null)return 0;const c=Number(n);if(!isNaN(c))return c}throw new xi(`Could not convert ${JSON.stringify(n)} to number.`)}case"formatted":return wr.fromString(pn(this.args[0].evaluate(t)));case"resolvedImage":return Rr.fromString(pn(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return pn(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const ec=["Unknown","Point","LineString","Polygon"];class zt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?ec[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let n=this._parseColorCache[t];return n||(n=this._parseColorCache[t]=gt.parse(t)),n}}class pt{constructor(t,n,a=[],c,d=new Vt,p=[]){this.registry=t,this.path=a,this.key=a.map(g=>`[${g}]`).join(""),this.scope=d,this.errors=p,this.expectedType=c,this._isConstant=n}parse(t,n,a,c,d={}){return n?this.concat(n,a,c)._parse(t,d):this._parse(t,d)}_parse(t,n){function a(c,d,p){return p==="assert"?new Ur(d,[c]):p==="coerce"?new Nt(d,[c]):c}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const c=t[0];if(typeof c!="string")return this.error(`Expression name must be a string, but found ${typeof c} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const d=this.registry[c];if(d){let p=d.parse(t,this);if(!p)return null;if(this.expectedType){const g=this.expectedType,x=p.type;if(g.kind!=="string"&&g.kind!=="number"&&g.kind!=="boolean"&&g.kind!=="object"&&g.kind!=="array"||x.kind!=="value")if(g.kind!=="projectionDefinition"||x.kind!=="string"&&x.kind!=="array")if(g.kind!=="color"&&g.kind!=="formatted"&&g.kind!=="resolvedImage"||x.kind!=="value"&&x.kind!=="string")if(g.kind!=="padding"||x.kind!=="value"&&x.kind!=="number"&&x.kind!=="array")if(g.kind!=="variableAnchorOffsetCollection"||x.kind!=="value"&&x.kind!=="array"){if(this.checkSubtype(g,x))return null}else p=a(p,g,n.typeAnnotation||"coerce");else p=a(p,g,n.typeAnnotation||"coerce");else p=a(p,g,n.typeAnnotation||"coerce");else p=a(p,g,n.typeAnnotation||"coerce");else p=a(p,g,n.typeAnnotation||"assert")}if(!(p instanceof Yn)&&p.type.kind!=="resolvedImage"&&this._isConstant(p)){const g=new zt;try{p=new Yn(p.type,p.evaluate(g))}catch(x){return this.error(x.message),null}}return p}return this.error(`Unknown expression "${c}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,n,a){const c=typeof t=="number"?this.path.concat(t):this.path,d=a?this.scope.concat(a):this.scope;return new pt(this.registry,this._isConstant,c,n||null,d,this.errors)}error(t,...n){const a=`${this.key}${n.map(c=>`[${c}]`).join("")}`;this.errors.push(new Ct(a,t))}checkSubtype(t,n){const a=Ts(t,n);return a&&this.error(a),a}}class Wa{constructor(t,n){this.type=n.type,this.bindings=[].concat(t),this.result=n}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const n of this.bindings)t(n[1]);t(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let d=1;d<t.length-1;d+=2){const p=t[d];if(typeof p!="string")return n.error(`Expected string, but found ${typeof p} instead.`,d);if(/[^a-zA-Z0-9_]/.test(p))return n.error("Variable names must contain only alphanumeric characters or '_'.",d);const g=n.parse(t[d+1],d+1);if(!g)return null;a.push([p,g])}const c=n.parse(t[t.length-1],t.length-1,n.expectedType,a);return c?new Wa(a,c):null}outputDefined(){return this.result.outputDefined()}}class Pt{constructor(t,n){this.type=n.type,this.name=t,this.boundExpression=n}static parse(t,n){if(t.length!==2||typeof t[1]!="string")return n.error("'var' expression requires exactly one string literal argument.");const a=t[1];return n.scope.has(a)?new Pt(a,n.scope.get(a)):n.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class Is{constructor(t,n,a){this.type=t,this.index=n,this.input=a}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=n.parse(t[1],1,Ie),c=n.parse(t[2],2,Ui(n.expectedType||lt));return a&&c?new Is(c.type.itemType,a,c):null}evaluate(t){const n=this.index.evaluate(t),a=this.input.evaluate(t);if(n<0)throw new xi(`Array index out of bounds: ${n} < 0.`);if(n>=a.length)throw new xi(`Array index out of bounds: ${n} > ${a.length-1}.`);if(n!==Math.floor(n))throw new xi(`Array index must be an integer, but found ${n} instead.`);return a[n]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Jr{constructor(t,n){this.type=et,this.needle=t,this.haystack=n}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=n.parse(t[1],1,lt),c=n.parse(t[2],2,lt);return a&&c?Mo(a.type,[et,$e,Ie,It,lt])?new Jr(a,c):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${ei(a.type)} instead`):null}evaluate(t){const n=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!a)return!1;if(!Yr(n,["boolean","string","number","null"]))throw new xi(`Expected first argument to be of type boolean, string, number or null, but found ${ei(vi(n))} instead.`);if(!Yr(a,["string","array"]))throw new xi(`Expected second argument to be of type array or string, but found ${ei(vi(a))} instead.`);return a.indexOf(n)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Xa{constructor(t,n,a){this.type=Ie,this.needle=t,this.haystack=n,this.fromIndex=a}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=n.parse(t[1],1,lt),c=n.parse(t[2],2,lt);if(!a||!c)return null;if(!Mo(a.type,[et,$e,Ie,It,lt]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${ei(a.type)} instead`);if(t.length===4){const d=n.parse(t[3],3,Ie);return d?new Xa(a,c,d):null}return new Xa(a,c)}evaluate(t){const n=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!Yr(n,["boolean","string","number","null"]))throw new xi(`Expected first argument to be of type boolean, string, number or null, but found ${ei(vi(n))} instead.`);let c;if(this.fromIndex&&(c=this.fromIndex.evaluate(t)),Yr(a,["string"])){const d=a.indexOf(n,c);return d===-1?-1:[...a.slice(0,d)].length}if(Yr(a,["array"]))return a.indexOf(n,c);throw new xi(`Expected second argument to be of type array or string, but found ${ei(vi(a))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Po{constructor(t,n,a,c,d,p){this.inputType=t,this.type=n,this.input=a,this.cases=c,this.outputs=d,this.otherwise=p}static parse(t,n){if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error("Expected an even number of arguments.");let a,c;n.expectedType&&n.expectedType.kind!=="value"&&(c=n.expectedType);const d={},p=[];for(let w=2;w<t.length-1;w+=2){let M=t[w];const C=t[w+1];Array.isArray(M)||(M=[M]);const A=n.concat(w);if(M.length===0)return A.error("Expected at least one branch label.");for(const B of M){if(typeof B!="number"&&typeof B!="string")return A.error("Branch labels must be numbers or strings.");if(typeof B=="number"&&Math.abs(B)>Number.MAX_SAFE_INTEGER)return A.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof B=="number"&&Math.floor(B)!==B)return A.error("Numeric branch labels must be integer values.");if(a){if(A.checkSubtype(a,vi(B)))return null}else a=vi(B);if(d[String(B)]!==void 0)return A.error("Branch labels must be unique.");d[String(B)]=p.length}const L=n.parse(C,w,c);if(!L)return null;c=c||L.type,p.push(L)}const g=n.parse(t[1],1,lt);if(!g)return null;const x=n.parse(t[t.length-1],t.length-1,c);return x?g.type.kind!=="value"&&n.concat(1).checkSubtype(a,g.type)?null:new Po(a,c,g,d,p,x):null}evaluate(t){const n=this.input.evaluate(t);return(vi(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class Co{constructor(t,n,a){this.type=t,this.branches=n,this.otherwise=a}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error("Expected an odd number of arguments.");let a;n.expectedType&&n.expectedType.kind!=="value"&&(a=n.expectedType);const c=[];for(let p=1;p<t.length-1;p+=2){const g=n.parse(t[p],p,et);if(!g)return null;const x=n.parse(t[p+1],p+1,a);if(!x)return null;c.push([g,x]),a=a||x.type}const d=n.parse(t[t.length-1],t.length-1,a);if(!d)return null;if(!a)throw new Error("Can't infer output type");return new Co(a,c,d)}evaluate(t){for(const[n,a]of this.branches)if(n.evaluate(t))return a.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[n,a]of this.branches)t(n),t(a);t(this.otherwise)}outputDefined(){return this.branches.every(([t,n])=>n.outputDefined())&&this.otherwise.outputDefined()}}class Ka{constructor(t,n,a,c){this.type=t,this.input=n,this.beginIndex=a,this.endIndex=c}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=n.parse(t[1],1,lt),c=n.parse(t[2],2,Ie);if(!a||!c)return null;if(!Mo(a.type,[Ui(lt),$e,lt]))return n.error(`Expected first argument to be of type array or string, but found ${ei(a.type)} instead`);if(t.length===4){const d=n.parse(t[3],3,Ie);return d?new Ka(a.type,a,c,d):null}return new Ka(a.type,a,c)}evaluate(t){const n=this.input.evaluate(t),a=this.beginIndex.evaluate(t);let c;if(this.endIndex&&(c=this.endIndex.evaluate(t)),Yr(n,["string"]))return[...n].slice(a,c).join("");if(Yr(n,["array"]))return n.slice(a,c);throw new xi(`Expected first argument to be of type array or string, but found ${ei(vi(n))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Es(r,t){const n=r.length-1;let a,c,d=0,p=n,g=0;for(;d<=p;)if(g=Math.floor((d+p)/2),a=r[g],c=r[g+1],a<=t){if(g===n||t<c)return g;d=g+1}else{if(!(a>t))throw new xi("Input is not a number.");p=g-1}return 0}class ks{constructor(t,n,a){this.type=t,this.input=n,this.labels=[],this.outputs=[];for(const[c,d]of a)this.labels.push(c),this.outputs.push(d)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");const a=n.parse(t[1],1,Ie);if(!a)return null;const c=[];let d=null;n.expectedType&&n.expectedType.kind!=="value"&&(d=n.expectedType);for(let p=1;p<t.length;p+=2){const g=p===1?-1/0:t[p],x=t[p+1],w=p,M=p+1;if(typeof g!="number")return n.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',w);if(c.length&&c[c.length-1][0]>=g)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',w);const C=n.parse(x,M,d);if(!C)return null;d=d||C.type,c.push([g,C])}return new ks(d,a,c)}evaluate(t){const n=this.labels,a=this.outputs;if(n.length===1)return a[0].evaluate(t);const c=this.input.evaluate(t);if(c<=n[0])return a[0].evaluate(t);const d=n.length;return c>=n[d-1]?a[d-1].evaluate(t):a[Es(n,c)].evaluate(t)}eachChild(t){t(this.input);for(const n of this.outputs)t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function nh(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Io,Ya,or=function(){if(Ya)return Io;function r(t,n,a,c){this.cx=3*t,this.bx=3*(a-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(c-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=a,this.p2y=c}return Ya=1,Io=r,r.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,n){if(n===void 0&&(n=1e-6),t<0)return 0;if(t>1)return 1;for(var a=t,c=0;c<8;c++){var d=this.sampleCurveX(a)-t;if(Math.abs(d)<n)return a;var p=this.sampleCurveDerivativeX(a);if(Math.abs(p)<1e-6)break;a-=d/p}var g=0,x=1;for(a=t,c=0;c<20&&(d=this.sampleCurveX(a),!(Math.abs(d-t)<n));c++)t>d?g=a:x=a,a=.5*(x-g)+g;return a},solve:function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))}},Io}(),Eo=nh(or);class Tr{constructor(t,n,a,c,d){this.type=t,this.operator=n,this.interpolation=a,this.input=c,this.labels=[],this.outputs=[];for(const[p,g]of d)this.labels.push(p),this.outputs.push(g)}static interpolationFactor(t,n,a,c){let d=0;if(t.name==="exponential")d=Ja(n,t.base,a,c);else if(t.name==="linear")d=Ja(n,1,a,c);else if(t.name==="cubic-bezier"){const p=t.controlPoints;d=new Eo(p[0],p[1],p[2],p[3]).solve(Ja(n,1,a,c))}return d}static parse(t,n){let[a,c,d,...p]=t;if(!Array.isArray(c)||c.length===0)return n.error("Expected an interpolation type expression.",1);if(c[0]==="linear")c={name:"linear"};else if(c[0]==="exponential"){const w=c[1];if(typeof w!="number")return n.error("Exponential interpolation requires a numeric base.",1,1);c={name:"exponential",base:w}}else{if(c[0]!=="cubic-bezier")return n.error(`Unknown interpolation type ${String(c[0])}`,1,0);{const w=c.slice(1);if(w.length!==4||w.some(M=>typeof M!="number"||M<0||M>1))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);c={name:"cubic-bezier",controlPoints:w}}}if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(d=n.parse(d,2,Ie),!d)return null;const g=[];let x=null;a==="interpolate-hcl"||a==="interpolate-lab"?x=fr:n.expectedType&&n.expectedType.kind!=="value"&&(x=n.expectedType);for(let w=0;w<p.length;w+=2){const M=p[w],C=p[w+1],A=w+3,L=w+4;if(typeof M!="number")return n.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(g.length&&g[g.length-1][0]>=M)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',A);const B=n.parse(C,L,x);if(!B)return null;x=x||B.type,g.push([M,B])}return ya(x,Ie)||ya(x,ar)||ya(x,fr)||ya(x,wo)||ya(x,To)||ya(x,Ui(Ie))?new Tr(x,a,c,d,g):n.error(`Type ${ei(x)} is not interpolatable.`)}evaluate(t){const n=this.labels,a=this.outputs;if(n.length===1)return a[0].evaluate(t);const c=this.input.evaluate(t);if(c<=n[0])return a[0].evaluate(t);const d=n.length;if(c>=n[d-1])return a[d-1].evaluate(t);const p=Es(n,c),g=Tr.interpolationFactor(this.interpolation,c,n[p],n[p+1]),x=a[p].evaluate(t),w=a[p+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return In(x,w,g);case"color":return gt.interpolate(x,w,g);case"padding":return sr.interpolate(x,w,g);case"variableAnchorOffsetCollection":return Yi.interpolate(x,w,g);case"array":return qa(x,w,g);case"projectionDefinition":return mr.interpolate(x,w,g)}case"interpolate-hcl":return gt.interpolate(x,w,g,"hcl");case"interpolate-lab":return gt.interpolate(x,w,g,"lab")}}eachChild(t){t(this.input);for(const n of this.outputs)t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Ja(r,t,n,a){const c=a-n,d=r-n;return c===0?0:t===1?d/c:(Math.pow(t,d)-1)/(Math.pow(t,c)-1)}const Qt={color:gt.interpolate,number:In,padding:sr.interpolate,variableAnchorOffsetCollection:Yi.interpolate,array:qa};class zs{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let a=null;const c=n.expectedType;c&&c.kind!=="value"&&(a=c);const d=[];for(const g of t.slice(1)){const x=n.parse(g,1+d.length,a,void 0,{typeAnnotation:"omit"});if(!x)return null;a=a||x.type,d.push(x)}if(!a)throw new Error("No output type");const p=c&&d.some(g=>Ts(c,g.type));return new zs(p?lt:a,d)}evaluate(t){let n,a=null,c=0;for(const d of this.args)if(c++,a=d.evaluate(t),a&&a instanceof Rr&&!a.available&&(n||(n=a.name),a=null,c===this.args.length&&(a=n)),a!==null)break;return a}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function ko(r,t){return r==="=="||r==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function tc(r,t,n,a){return a.compare(t,n)===0}function Qa(r,t,n){const a=r!=="=="&&r!=="!=";return class t_{constructor(d,p,g){this.type=et,this.lhs=d,this.rhs=p,this.collator=g,this.hasUntypedArgument=d.type.kind==="value"||p.type.kind==="value"}static parse(d,p){if(d.length!==3&&d.length!==4)return p.error("Expected two or three arguments.");const g=d[0];let x=p.parse(d[1],1,lt);if(!x)return null;if(!ko(g,x.type))return p.concat(1).error(`"${g}" comparisons are not supported for type '${ei(x.type)}'.`);let w=p.parse(d[2],2,lt);if(!w)return null;if(!ko(g,w.type))return p.concat(2).error(`"${g}" comparisons are not supported for type '${ei(w.type)}'.`);if(x.type.kind!==w.type.kind&&x.type.kind!=="value"&&w.type.kind!=="value")return p.error(`Cannot compare types '${ei(x.type)}' and '${ei(w.type)}'.`);a&&(x.type.kind==="value"&&w.type.kind!=="value"?x=new Ur(w.type,[x]):x.type.kind!=="value"&&w.type.kind==="value"&&(w=new Ur(x.type,[w])));let M=null;if(d.length===4){if(x.type.kind!=="string"&&w.type.kind!=="string"&&x.type.kind!=="value"&&w.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(M=p.parse(d[3],3,ws),!M)return null}return new t_(x,w,M)}evaluate(d){const p=this.lhs.evaluate(d),g=this.rhs.evaluate(d);if(a&&this.hasUntypedArgument){const x=vi(p),w=vi(g);if(x.kind!==w.kind||x.kind!=="string"&&x.kind!=="number")throw new xi(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${x.kind}, ${w.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const x=vi(p),w=vi(g);if(x.kind!=="string"||w.kind!=="string")return t(d,p,g)}return this.collator?n(d,p,g,this.collator.evaluate(d)):t(d,p,g)}eachChild(d){d(this.lhs),d(this.rhs),this.collator&&d(this.collator)}outputDefined(){return!0}}}const zo=Qa("==",function(r,t,n){return t===n},tc),ic=Qa("!=",function(r,t,n){return t!==n},function(r,t,n,a){return!tc(0,t,n,a)}),Gd=Qa("<",function(r,t,n){return t<n},function(r,t,n,a){return a.compare(t,n)<0}),Ao=Qa(">",function(r,t,n){return t>n},function(r,t,n,a){return a.compare(t,n)>0}),Ro=Qa("<=",function(r,t,n){return t<=n},function(r,t,n,a){return a.compare(t,n)<=0}),Qr=Qa(">=",function(r,t,n){return t>=n},function(r,t,n,a){return a.compare(t,n)>=0});class As{constructor(t,n,a){this.type=ws,this.locale=a,this.caseSensitive=t,this.diacriticSensitive=n}static parse(t,n){if(t.length!==2)return n.error("Expected one argument.");const a=t[1];if(typeof a!="object"||Array.isArray(a))return n.error("Collator options argument must be an object.");const c=n.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,et);if(!c)return null;const d=n.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,et);if(!d)return null;let p=null;return a.locale&&(p=n.parse(a.locale,1,$e),!p)?null:new As(c,d,p)}evaluate(t){return new St(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class es{constructor(t,n,a,c,d){this.type=$e,this.number=t,this.locale=n,this.currency=a,this.minFractionDigits=c,this.maxFractionDigits=d}static parse(t,n){if(t.length!==3)return n.error("Expected two arguments.");const a=n.parse(t[1],1,Ie);if(!a)return null;const c=t[2];if(typeof c!="object"||Array.isArray(c))return n.error("NumberFormat options argument must be an object.");let d=null;if(c.locale&&(d=n.parse(c.locale,1,$e),!d))return null;let p=null;if(c.currency&&(p=n.parse(c.currency,1,$e),!p))return null;let g=null;if(c["min-fraction-digits"]&&(g=n.parse(c["min-fraction-digits"],1,Ie),!g))return null;let x=null;return c["max-fraction-digits"]&&(x=n.parse(c["max-fraction-digits"],1,Ie),!x)?null:new es(a,d,p,g,x)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Do{constructor(t){this.type=_a,this.sections=t}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&typeof a=="object")return n.error("First argument must be an image or text section.");const c=[];let d=!1;for(let p=1;p<=t.length-1;++p){const g=t[p];if(d&&typeof g=="object"&&!Array.isArray(g)){d=!1;let x=null;if(g["font-scale"]&&(x=n.parse(g["font-scale"],1,Ie),!x))return null;let w=null;if(g["text-font"]&&(w=n.parse(g["text-font"],1,Ui($e)),!w))return null;let M=null;if(g["text-color"]&&(M=n.parse(g["text-color"],1,fr),!M))return null;let C=null;if(g["vertical-align"]){if(typeof g["vertical-align"]=="string"&&!Ha.includes(g["vertical-align"]))return n.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${g["vertical-align"]}' instead.`);if(C=n.parse(g["vertical-align"],1,$e),!C)return null}const A=c[c.length-1];A.scale=x,A.font=w,A.textColor=M,A.verticalAlign=C}else{const x=n.parse(t[p],1,lt);if(!x)return null;const w=x.type.kind;if(w!=="string"&&w!=="value"&&w!=="null"&&w!=="resolvedImage")return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");d=!0,c.push({content:x,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Do(c)}evaluate(t){return new wr(this.sections.map(n=>{const a=n.content.evaluate(t);return vi(a)===Xn?new dn("",a,null,null,null,n.verticalAlign?n.verticalAlign.evaluate(t):null):new dn(pn(a),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null,n.verticalAlign?n.verticalAlign.evaluate(t):null)}))}eachChild(t){for(const n of this.sections)t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor),n.verticalAlign&&t(n.verticalAlign)}outputDefined(){return!1}}class Rs{constructor(t){this.type=Xn,this.input=t}static parse(t,n){if(t.length!==2)return n.error("Expected two arguments.");const a=n.parse(t[1],1,$e);return a?new Rs(a):n.error("No image name provided.")}evaluate(t){const n=this.input.evaluate(t),a=Rr.fromString(n);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(n)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}}class rc{constructor(t){this.type=Ie,this.input=t}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=n.parse(t[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?n.error(`Expected argument of type string or array, but found ${ei(a.type)} instead.`):new rc(a):null}evaluate(t){const n=this.input.evaluate(t);if(typeof n=="string")return[...n].length;if(Array.isArray(n))return n.length;throw new xi(`Expected value to be of type string or array, but found ${ei(vi(n))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const fn=8192;function qd(r,t){const n=(180+r[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,c=Math.pow(2,t.z);return[Math.round(n*c*fn),Math.round(a*c*fn)]}function nc(r,t){const n=Math.pow(2,t.z);return[(c=(r[0]/fn+t.x)/n,360*c-180),(a=(r[1]/fn+t.y)/n,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,c}function Jn(r,t){r[0]=Math.min(r[0],t[0]),r[1]=Math.min(r[1],t[1]),r[2]=Math.max(r[2],t[0]),r[3]=Math.max(r[3],t[1])}function Ds(r,t){return!(r[0]<=t[0]||r[2]>=t[2]||r[1]<=t[1]||r[3]>=t[3])}function ah(r,t,n){const a=r[0]-t[0],c=r[1]-t[1],d=r[0]-n[0],p=r[1]-n[1];return a*p-d*c==0&&a*d<=0&&c*p<=0}function Ls(r,t,n,a){return(c=[a[0]-n[0],a[1]-n[1]])[0]*(d=[t[0]-r[0],t[1]-r[1]])[1]-c[1]*d[0]!=0&&!(!oh(r,t,n,a)||!oh(n,a,r,t));var c,d}function Hd(r,t,n){for(const a of n)for(let c=0;c<a.length-1;++c)if(Ls(r,t,a[c],a[c+1]))return!0;return!1}function va(r,t,n=!1){let a=!1;for(const g of t)for(let x=0;x<g.length-1;x++){if(ah(r,g[x],g[x+1]))return n;(d=g[x])[1]>(c=r)[1]!=(p=g[x+1])[1]>c[1]&&c[0]<(p[0]-d[0])*(c[1]-d[1])/(p[1]-d[1])+d[0]&&(a=!a)}var c,d,p;return a}function Wd(r,t){for(const n of t)if(va(r,n))return!0;return!1}function sh(r,t){for(const n of r)if(!va(n,t))return!1;for(let n=0;n<r.length-1;++n)if(Hd(r[n],r[n+1],t))return!1;return!0}function Xd(r,t){for(const n of t)if(sh(r,n))return!0;return!1}function oh(r,t,n,a){const c=a[0]-n[0],d=a[1]-n[1],p=(r[0]-n[0])*d-c*(r[1]-n[1]),g=(t[0]-n[0])*d-c*(t[1]-n[1]);return p>0&&g<0||p<0&&g>0}function ac(r,t,n){const a=[];for(let c=0;c<r.length;c++){const d=[];for(let p=0;p<r[c].length;p++){const g=qd(r[c][p],n);Jn(t,g),d.push(g)}a.push(d)}return a}function sc(r,t,n){const a=[];for(let c=0;c<r.length;c++){const d=ac(r[c],t,n);a.push(d)}return a}function oc(r,t,n,a){if(r[0]<n[0]||r[0]>n[2]){const c=.5*a;let d=r[0]-n[0]>c?-a:n[0]-r[0]>c?a:0;d===0&&(d=r[0]-n[2]>c?-a:n[2]-r[0]>c?a:0),r[0]+=d}Jn(t,r)}function lc(r,t,n,a){const c=Math.pow(2,a.z)*fn,d=[a.x*fn,a.y*fn],p=[];for(const g of r)for(const x of g){const w=[x.x+d[0],x.y+d[1]];oc(w,t,n,c),p.push(w)}return p}function lh(r,t,n,a){const c=Math.pow(2,a.z)*fn,d=[a.x*fn,a.y*fn],p=[];for(const x of r){const w=[];for(const M of x){const C=[M.x+d[0],M.y+d[1]];Jn(t,C),w.push(C)}p.push(w)}if(t[2]-t[0]<=c/2){(g=t)[0]=g[1]=1/0,g[2]=g[3]=-1/0;for(const x of p)for(const w of x)oc(w,t,n,c)}var g;return p}class ba{constructor(t,n){this.type=et,this.geojson=t,this.geometries=n}static parse(t,n){if(t.length!==2)return n.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Ss(t[1])){const a=t[1];if(a.type==="FeatureCollection"){const c=[];for(const d of a.features){const{type:p,coordinates:g}=d.geometry;p==="Polygon"&&c.push(g),p==="MultiPolygon"&&c.push(...g)}if(c.length)return new ba(a,{type:"MultiPolygon",coordinates:c})}else if(a.type==="Feature"){const c=a.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new ba(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new ba(a,a)}return n.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(n,a){const c=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],p=n.canonicalID();if(a.type==="Polygon"){const g=ac(a.coordinates,d,p),x=lc(n.geometry(),c,d,p);if(!Ds(c,d))return!1;for(const w of x)if(!va(w,g))return!1}if(a.type==="MultiPolygon"){const g=sc(a.coordinates,d,p),x=lc(n.geometry(),c,d,p);if(!Ds(c,d))return!1;for(const w of x)if(!Wd(w,g))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(n,a){const c=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],p=n.canonicalID();if(a.type==="Polygon"){const g=ac(a.coordinates,d,p),x=lh(n.geometry(),c,d,p);if(!Ds(c,d))return!1;for(const w of x)if(!sh(w,g))return!1}if(a.type==="MultiPolygon"){const g=sc(a.coordinates,d,p),x=lh(n.geometry(),c,d,p);if(!Ds(c,d))return!1;for(const w of x)if(!Xd(w,g))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let ch=class{constructor(r=[],t=(n,a)=>n<a?-1:n>a?1:0){if(this.data=r,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;const r=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:t,compare:n}=this,a=t[r];for(;r>0;){const c=r-1>>1,d=t[c];if(n(a,d)>=0)break;t[r]=d,r=c}t[r]=a}_down(r){const{data:t,compare:n}=this,a=this.length>>1,c=t[r];for(;r<a;){let d=1+(r<<1);const p=d+1;if(p<this.length&&n(t[p],t[d])<0&&(d=p),n(t[d],c)>=0)break;t[r]=t[d],r=d}t[r]=c}};function Lo(r,t,n=0,a=r.length-1,c=Kd){for(;a>n;){if(a-n>600){const x=a-n+1,w=t-n+1,M=Math.log(x),C=.5*Math.exp(2*M/3),A=.5*Math.sqrt(M*C*(x-C)/x)*(w-x/2<0?-1:1);Lo(r,t,Math.max(n,Math.floor(t-w*C/x+A)),Math.min(a,Math.floor(t+(x-w)*C/x+A)),c)}const d=r[t];let p=n,g=a;for(Bs(r,n,t),c(r[a],d)>0&&Bs(r,n,a);p<g;){for(Bs(r,p,g),p++,g--;c(r[p],d)<0;)p++;for(;c(r[g],d)>0;)g--}c(r[n],d)===0?Bs(r,n,g):(g++,Bs(r,g,a)),g<=t&&(n=g+1),t<=g&&(a=g-1)}}function Bs(r,t,n){const a=r[t];r[t]=r[n],r[n]=a}function Kd(r,t){return r<t?-1:r>t?1:0}function Bo(r,t){if(r.length<=1)return[r];const n=[];let a,c;for(const d of r){const p=hh(d);p!==0&&(d.area=Math.abs(p),c===void 0&&(c=p<0),c===p<0?(a&&n.push(a),a=[d]):a.push(d))}if(a&&n.push(a),t>1)for(let d=0;d<n.length;d++)n[d].length<=t||(Lo(n[d],t,1,n[d].length-1,uh),n[d]=n[d].slice(0,t));return n}function uh(r,t){return t.area-r.area}function hh(r){let t=0;for(let n,a,c=0,d=r.length,p=d-1;c<d;p=c++)n=r[c],a=r[p],t+=(a.x-n.x)*(n.y+a.y);return t}const dh=1/298.257223563,ph=dh*(2-dh),cc=Math.PI/180;class Fo{constructor(t){const n=6378.137*cc*1e3,a=Math.cos(t*cc),c=1/(1-ph*(1-a*a)),d=Math.sqrt(c);this.kx=n*d*a,this.ky=n*d*c*(1-ph)}distance(t,n){const a=this.wrap(t[0]-n[0])*this.kx,c=(t[1]-n[1])*this.ky;return Math.sqrt(a*a+c*c)}pointOnLine(t,n){let a,c,d,p,g=1/0;for(let x=0;x<t.length-1;x++){let w=t[x][0],M=t[x][1],C=this.wrap(t[x+1][0]-w)*this.kx,A=(t[x+1][1]-M)*this.ky,L=0;C===0&&A===0||(L=(this.wrap(n[0]-w)*this.kx*C+(n[1]-M)*this.ky*A)/(C*C+A*A),L>1?(w=t[x+1][0],M=t[x+1][1]):L>0&&(w+=C/this.kx*L,M+=A/this.ky*L)),C=this.wrap(n[0]-w)*this.kx,A=(n[1]-M)*this.ky;const B=C*C+A*A;B<g&&(g=B,a=w,c=M,d=x,p=L)}return{point:[a,c],index:d,t:Math.max(0,Math.min(1,p))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function fh(r,t){return t[0]-r[0]}function Oo(r){return r[1]-r[0]+1}function En(r,t){return r[1]>=r[0]&&r[1]<t}function jo(r,t){if(r[0]>r[1])return[null,null];const n=Oo(r);if(t){if(n===2)return[r,null];const c=Math.floor(n/2);return[[r[0],r[0]+c],[r[0]+c,r[1]]]}if(n===1)return[r,null];const a=Math.floor(n/2)-1;return[[r[0],r[0]+a],[r[0]+a+1,r[1]]]}function uc(r,t){if(!En(t,r.length))return[1/0,1/0,-1/0,-1/0];const n=[1/0,1/0,-1/0,-1/0];for(let a=t[0];a<=t[1];++a)Jn(n,r[a]);return n}function hc(r){const t=[1/0,1/0,-1/0,-1/0];for(const n of r)for(const a of n)Jn(t,a);return t}function mh(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function dc(r,t,n){if(!mh(r)||!mh(t))return NaN;let a=0,c=0;return r[2]<t[0]&&(a=t[0]-r[2]),r[0]>t[2]&&(a=r[0]-t[2]),r[1]>t[3]&&(c=r[1]-t[3]),r[3]<t[1]&&(c=t[1]-r[3]),n.distance([0,0],[a,c])}function Mt(r,t,n){const a=n.pointOnLine(t,r);return n.distance(r,a.point)}function pc(r,t,n,a,c){const d=Math.min(Mt(r,[n,a],c),Mt(t,[n,a],c)),p=Math.min(Mt(n,[r,t],c),Mt(a,[r,t],c));return Math.min(d,p)}function Yd(r,t,n,a,c){if(!En(t,r.length)||!En(a,n.length))return 1/0;let d=1/0;for(let p=t[0];p<t[1];++p){const g=r[p],x=r[p+1];for(let w=a[0];w<a[1];++w){const M=n[w],C=n[w+1];if(Ls(g,x,M,C))return 0;d=Math.min(d,pc(g,x,M,C,c))}}return d}function Jd(r,t,n,a,c){if(!En(t,r.length)||!En(a,n.length))return NaN;let d=1/0;for(let p=t[0];p<=t[1];++p)for(let g=a[0];g<=a[1];++g)if(d=Math.min(d,c.distance(r[p],n[g])),d===0)return d;return d}function Qd(r,t,n){if(va(r,t,!0))return 0;let a=1/0;for(const c of t){const d=c[0],p=c[c.length-1];if(d!==p&&(a=Math.min(a,Mt(r,[p,d],n)),a===0))return a;const g=n.pointOnLine(c,r);if(a=Math.min(a,n.distance(r,g.point)),a===0)return a}return a}function ep(r,t,n,a){if(!En(t,r.length))return NaN;for(let d=t[0];d<=t[1];++d)if(va(r[d],n,!0))return 0;let c=1/0;for(let d=t[0];d<t[1];++d){const p=r[d],g=r[d+1];for(const x of n)for(let w=0,M=x.length,C=M-1;w<M;C=w++){const A=x[C],L=x[w];if(Ls(p,g,A,L))return 0;c=Math.min(c,pc(p,g,A,L,a))}}return c}function gh(r,t){for(const n of r)for(const a of n)if(va(a,t,!0))return!0;return!1}function tp(r,t,n,a=1/0){const c=hc(r),d=hc(t);if(a!==1/0&&dc(c,d,n)>=a)return a;if(Ds(c,d)){if(gh(r,t))return 0}else if(gh(t,r))return 0;let p=1/0;for(const g of r)for(let x=0,w=g.length,M=w-1;x<w;M=x++){const C=g[M],A=g[x];for(const L of t)for(let B=0,j=L.length,$=j-1;B<j;$=B++){const X=L[$],se=L[B];if(Ls(C,A,X,se))return 0;p=Math.min(p,pc(C,A,X,se,n))}}return p}function _h(r,t,n,a,c,d){if(!d)return;const p=dc(uc(a,d),c,n);p<t&&r.push([p,d,[0,0]])}function No(r,t,n,a,c,d,p){if(!d||!p)return;const g=dc(uc(a,d),uc(c,p),n);g<t&&r.push([g,d,p])}function Zo(r,t,n,a,c=1/0){let d=Math.min(a.distance(r[0],n[0][0]),c);if(d===0)return d;const p=new ch([[0,[0,r.length-1],[0,0]]],fh),g=hc(n);for(;p.length>0;){const x=p.pop();if(x[0]>=d)continue;const w=x[1],M=t?50:100;if(Oo(w)<=M){if(!En(w,r.length))return NaN;if(t){const C=ep(r,w,n,a);if(isNaN(C)||C===0)return C;d=Math.min(d,C)}else for(let C=w[0];C<=w[1];++C){const A=Qd(r[C],n,a);if(d=Math.min(d,A),d===0)return 0}}else{const C=jo(w,t);_h(p,d,a,r,g,C[0]),_h(p,d,a,r,g,C[1])}}return d}function Vo(r,t,n,a,c,d=1/0){let p=Math.min(d,c.distance(r[0],n[0]));if(p===0)return p;const g=new ch([[0,[0,r.length-1],[0,n.length-1]]],fh);for(;g.length>0;){const x=g.pop();if(x[0]>=p)continue;const w=x[1],M=x[2],C=t?50:100,A=a?50:100;if(Oo(w)<=C&&Oo(M)<=A){if(!En(w,r.length)&&En(M,n.length))return NaN;let L;if(t&&a)L=Yd(r,w,n,M,c),p=Math.min(p,L);else if(t&&!a){const B=r.slice(w[0],w[1]+1);for(let j=M[0];j<=M[1];++j)if(L=Mt(n[j],B,c),p=Math.min(p,L),p===0)return p}else if(!t&&a){const B=n.slice(M[0],M[1]+1);for(let j=w[0];j<=w[1];++j)if(L=Mt(r[j],B,c),p=Math.min(p,L),p===0)return p}else L=Jd(r,w,n,M,c),p=Math.min(p,L)}else{const L=jo(w,t),B=jo(M,a);No(g,p,c,r,n,L[0],B[0]),No(g,p,c,r,n,L[0],B[1]),No(g,p,c,r,n,L[1],B[0]),No(g,p,c,r,n,L[1],B[1])}}return p}function fc(r){return r.type==="MultiPolygon"?r.coordinates.map(t=>({type:"Polygon",coordinates:t})):r.type==="MultiLineString"?r.coordinates.map(t=>({type:"LineString",coordinates:t})):r.type==="MultiPoint"?r.coordinates.map(t=>({type:"Point",coordinates:t})):[r]}class wa{constructor(t,n){this.type=Ie,this.geojson=t,this.geometries=n}static parse(t,n){if(t.length!==2)return n.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Ss(t[1])){const a=t[1];if(a.type==="FeatureCollection")return new wa(a,a.features.map(c=>fc(c.geometry)).flat());if(a.type==="Feature")return new wa(a,fc(a.geometry));if("type"in a&&"coordinates"in a)return new wa(a,fc(a))}return n.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(n,a){const c=n.geometry(),d=c.flat().map(x=>nc([x.x,x.y],n.canonical));if(c.length===0)return NaN;const p=new Fo(d[0][1]);let g=1/0;for(const x of a){switch(x.type){case"Point":g=Math.min(g,Vo(d,!1,[x.coordinates],!1,p,g));break;case"LineString":g=Math.min(g,Vo(d,!1,x.coordinates,!0,p,g));break;case"Polygon":g=Math.min(g,Zo(d,!1,x.coordinates,p,g))}if(g===0)return g}return g}(t,this.geometries);if(t.geometryType()==="LineString")return function(n,a){const c=n.geometry(),d=c.flat().map(x=>nc([x.x,x.y],n.canonical));if(c.length===0)return NaN;const p=new Fo(d[0][1]);let g=1/0;for(const x of a){switch(x.type){case"Point":g=Math.min(g,Vo(d,!0,[x.coordinates],!1,p,g));break;case"LineString":g=Math.min(g,Vo(d,!0,x.coordinates,!0,p,g));break;case"Polygon":g=Math.min(g,Zo(d,!0,x.coordinates,p,g))}if(g===0)return g}return g}(t,this.geometries);if(t.geometryType()==="Polygon")return function(n,a){const c=n.geometry();if(c.length===0||c[0].length===0)return NaN;const d=Bo(c,0).map(x=>x.map(w=>w.map(M=>nc([M.x,M.y],n.canonical)))),p=new Fo(d[0][0][0][1]);let g=1/0;for(const x of a)for(const w of d){switch(x.type){case"Point":g=Math.min(g,Zo([x.coordinates],!1,w,p,g));break;case"LineString":g=Math.min(g,Zo(x.coordinates,!0,w,p,g));break;case"Polygon":g=Math.min(g,tp(w,x.coordinates,p,g))}if(g===0)return g}return g}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const ts={"==":zo,"!=":ic,">":Ao,"<":Gd,">=":Qr,"<=":Ro,array:Ur,at:Is,boolean:Ur,case:Co,coalesce:zs,collator:As,format:Do,image:Rs,in:Jr,"index-of":Xa,interpolate:Tr,"interpolate-hcl":Tr,"interpolate-lab":Tr,length:rc,let:Wa,literal:Yn,match:Po,number:Ur,"number-format":es,object:Ur,slice:Ka,step:ks,string:Ur,"to-boolean":Nt,"to-color":Nt,"to-number":Nt,"to-string":Nt,var:Pt,within:ba,distance:wa};class $r{constructor(t,n,a,c){this.name=t,this.type=n,this._evaluate=a,this.args=c}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,n){const a=t[0],c=$r.definitions[a];if(!c)return n.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const d=Array.isArray(c)?c[0]:c.type,p=Array.isArray(c)?[[c[1],c[2]]]:c.overloads,g=p.filter(([w])=>!Array.isArray(w)||w.length===t.length-1);let x=null;for(const[w,M]of g){x=new pt(n.registry,Uo,n.path,null,n.scope);const C=[];let A=!1;for(let L=1;L<t.length;L++){const B=t[L],j=Array.isArray(w)?w[L-1]:w.type,$=x.parse(B,1+C.length,j);if(!$){A=!0;break}C.push($)}if(!A)if(Array.isArray(w)&&w.length!==C.length)x.error(`Expected ${w.length} arguments, but found ${C.length} instead.`);else{for(let L=0;L<C.length;L++){const B=Array.isArray(w)?w[L]:w.type,j=C[L];x.concat(L+1).checkSubtype(B,j.type)}if(x.errors.length===0)return new $r(a,d,M,C)}}if(g.length===1)n.errors.push(...x.errors);else{const w=(g.length?g:p).map(([C])=>{return A=C,Array.isArray(A)?`(${A.map(ei).join(", ")})`:`(${ei(A.type)}...)`;var A}).join(" | "),M=[];for(let C=1;C<t.length;C++){const A=n.parse(t[C],1+M.length);if(!A)return null;M.push(ei(A.type))}n.error(`Expected arguments of type ${w}, but found (${M.join(", ")}) instead.`)}return null}static register(t,n){$r.definitions=n;for(const a in n)t[a]=$r}}function yh(r,[t,n,a,c]){t=t.evaluate(r),n=n.evaluate(r),a=a.evaluate(r);const d=c?c.evaluate(r):1,p=Kn(t,n,a,d);if(p)throw new xi(p);return new gt(t/255,n/255,a/255,d,!1)}function xh(r,t){return r in t}function mc(r,t){const n=t[r];return n===void 0?null:n}function Ta(r){return{type:r}}function Uo(r){if(r instanceof Pt)return Uo(r.boundExpression);if(r instanceof $r&&r.name==="error"||r instanceof As||r instanceof ba||r instanceof wa)return!1;const t=r instanceof Nt||r instanceof Ur;let n=!0;return r.eachChild(a=>{n=t?n&&Uo(a):n&&a instanceof Yn}),!!n&&$o(r)&&Go(r,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function $o(r){if(r instanceof $r&&(r.name==="get"&&r.args.length===1||r.name==="feature-state"||r.name==="has"&&r.args.length===1||r.name==="properties"||r.name==="geometry-type"||r.name==="id"||/^filter-/.test(r.name))||r instanceof ba||r instanceof wa)return!1;let t=!0;return r.eachChild(n=>{t&&!$o(n)&&(t=!1)}),t}function Fs(r){if(r instanceof $r&&r.name==="feature-state")return!1;let t=!0;return r.eachChild(n=>{t&&!Fs(n)&&(t=!1)}),t}function Go(r,t){if(r instanceof $r&&t.indexOf(r.name)>=0)return!1;let n=!0;return r.eachChild(a=>{n&&!Go(a,t)&&(n=!1)}),n}function vh(r){return{result:"success",value:r}}function is(r){return{result:"error",value:r}}function rs(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function bh(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function gc(r){return!!r.expression&&r.expression.interpolated}function At(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function qo(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function ip(r){return r}function Ho(r,t){const n=t.type==="color",a=r.stops&&typeof r.stops[0][0]=="object",c=a||!(a||r.property!==void 0),d=r.type||(gc(t)?"exponential":"interval");if(n||t.type==="padding"){const M=n?gt.parse:sr.parse;(r=at({},r)).stops&&(r.stops=r.stops.map(C=>[C[0],M(C[1])])),r.default=M(r.default?r.default:t.default)}if(r.colorSpace&&(p=r.colorSpace)!=="rgb"&&p!=="hcl"&&p!=="lab")throw new Error(`Unknown color space: "${r.colorSpace}"`);var p;let g,x,w;if(d==="exponential")g=_c;else if(d==="interval")g=np;else if(d==="categorical"){g=rp,x=Object.create(null);for(const M of r.stops)x[M[0]]=M[1];w=typeof r.stops[0][0]}else{if(d!=="identity")throw new Error(`Unknown function type "${d}"`);g=ap}if(a){const M={},C=[];for(let B=0;B<r.stops.length;B++){const j=r.stops[B],$=j[0].zoom;M[$]===void 0&&(M[$]={zoom:$,type:r.type,property:r.property,default:r.default,stops:[]},C.push($)),M[$].stops.push([j[0].value,j[1]])}const A=[];for(const B of C)A.push([M[B].zoom,Ho(M[B],t)]);const L={name:"linear"};return{kind:"composite",interpolationType:L,interpolationFactor:Tr.interpolationFactor.bind(void 0,L),zoomStops:A.map(B=>B[0]),evaluate:({zoom:B},j)=>_c({stops:A,base:r.base},t,B).evaluate(B,j)}}if(c){const M=d==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:M,interpolationFactor:Tr.interpolationFactor.bind(void 0,M),zoomStops:r.stops.map(C=>C[0]),evaluate:({zoom:C})=>g(r,t,C,x,w)}}return{kind:"source",evaluate(M,C){const A=C&&C.properties?C.properties[r.property]:void 0;return A===void 0?Os(r.default,t.default):g(r,t,A,x,w)}}}function Os(r,t,n){return r!==void 0?r:t!==void 0?t:n!==void 0?n:void 0}function rp(r,t,n,a,c){return Os(typeof n===c?a[n]:void 0,r.default,t.default)}function np(r,t,n){if(At(n)!=="number")return Os(r.default,t.default);const a=r.stops.length;if(a===1||n<=r.stops[0][0])return r.stops[0][1];if(n>=r.stops[a-1][0])return r.stops[a-1][1];const c=Es(r.stops.map(d=>d[0]),n);return r.stops[c][1]}function _c(r,t,n){const a=r.base!==void 0?r.base:1;if(At(n)!=="number")return Os(r.default,t.default);const c=r.stops.length;if(c===1||n<=r.stops[0][0])return r.stops[0][1];if(n>=r.stops[c-1][0])return r.stops[c-1][1];const d=Es(r.stops.map(M=>M[0]),n),p=function(M,C,A,L){const B=L-A,j=M-A;return B===0?0:C===1?j/B:(Math.pow(C,j)-1)/(Math.pow(C,B)-1)}(n,a,r.stops[d][0],r.stops[d+1][0]),g=r.stops[d][1],x=r.stops[d+1][1],w=Qt[t.type]||ip;return typeof g.evaluate=="function"?{evaluate(...M){const C=g.evaluate.apply(void 0,M),A=x.evaluate.apply(void 0,M);if(C!==void 0&&A!==void 0)return w(C,A,p,r.colorSpace)}}:w(g,x,p,r.colorSpace)}function ap(r,t,n){switch(t.type){case"color":n=gt.parse(n);break;case"formatted":n=wr.fromString(n.toString());break;case"resolvedImage":n=Rr.fromString(n.toString());break;case"padding":n=sr.parse(n);break;default:At(n)===t.type||t.type==="enum"&&t.values[n]||(n=void 0)}return Os(n,r.default,t.default)}$r.register(ts,{error:[{kind:"error"},[$e],(r,[t])=>{throw new xi(t.evaluate(r))}],typeof:[$e,[lt],(r,[t])=>ei(vi(t.evaluate(r)))],"to-rgba":[Ui(Ie,4),[fr],(r,[t])=>{const[n,a,c,d]=t.evaluate(r).rgb;return[255*n,255*a,255*c,d]}],rgb:[fr,[Ie,Ie,Ie],yh],rgba:[fr,[Ie,Ie,Ie,Ie],yh],has:{type:et,overloads:[[[$e],(r,[t])=>xh(t.evaluate(r),r.properties())],[[$e,ci],(r,[t,n])=>xh(t.evaluate(r),n.evaluate(r))]]},get:{type:lt,overloads:[[[$e],(r,[t])=>mc(t.evaluate(r),r.properties())],[[$e,ci],(r,[t,n])=>mc(t.evaluate(r),n.evaluate(r))]]},"feature-state":[lt,[$e],(r,[t])=>mc(t.evaluate(r),r.featureState||{})],properties:[ci,[],r=>r.properties()],"geometry-type":[$e,[],r=>r.geometryType()],id:[lt,[],r=>r.id()],zoom:[Ie,[],r=>r.globals.zoom],"heatmap-density":[Ie,[],r=>r.globals.heatmapDensity||0],"line-progress":[Ie,[],r=>r.globals.lineProgress||0],accumulated:[lt,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[Ie,Ta(Ie),(r,t)=>{let n=0;for(const a of t)n+=a.evaluate(r);return n}],"*":[Ie,Ta(Ie),(r,t)=>{let n=1;for(const a of t)n*=a.evaluate(r);return n}],"-":{type:Ie,overloads:[[[Ie,Ie],(r,[t,n])=>t.evaluate(r)-n.evaluate(r)],[[Ie],(r,[t])=>-t.evaluate(r)]]},"/":[Ie,[Ie,Ie],(r,[t,n])=>t.evaluate(r)/n.evaluate(r)],"%":[Ie,[Ie,Ie],(r,[t,n])=>t.evaluate(r)%n.evaluate(r)],ln2:[Ie,[],()=>Math.LN2],pi:[Ie,[],()=>Math.PI],e:[Ie,[],()=>Math.E],"^":[Ie,[Ie,Ie],(r,[t,n])=>Math.pow(t.evaluate(r),n.evaluate(r))],sqrt:[Ie,[Ie],(r,[t])=>Math.sqrt(t.evaluate(r))],log10:[Ie,[Ie],(r,[t])=>Math.log(t.evaluate(r))/Math.LN10],ln:[Ie,[Ie],(r,[t])=>Math.log(t.evaluate(r))],log2:[Ie,[Ie],(r,[t])=>Math.log(t.evaluate(r))/Math.LN2],sin:[Ie,[Ie],(r,[t])=>Math.sin(t.evaluate(r))],cos:[Ie,[Ie],(r,[t])=>Math.cos(t.evaluate(r))],tan:[Ie,[Ie],(r,[t])=>Math.tan(t.evaluate(r))],asin:[Ie,[Ie],(r,[t])=>Math.asin(t.evaluate(r))],acos:[Ie,[Ie],(r,[t])=>Math.acos(t.evaluate(r))],atan:[Ie,[Ie],(r,[t])=>Math.atan(t.evaluate(r))],min:[Ie,Ta(Ie),(r,t)=>Math.min(...t.map(n=>n.evaluate(r)))],max:[Ie,Ta(Ie),(r,t)=>Math.max(...t.map(n=>n.evaluate(r)))],abs:[Ie,[Ie],(r,[t])=>Math.abs(t.evaluate(r))],round:[Ie,[Ie],(r,[t])=>{const n=t.evaluate(r);return n<0?-Math.round(-n):Math.round(n)}],floor:[Ie,[Ie],(r,[t])=>Math.floor(t.evaluate(r))],ceil:[Ie,[Ie],(r,[t])=>Math.ceil(t.evaluate(r))],"filter-==":[et,[$e,lt],(r,[t,n])=>r.properties()[t.value]===n.value],"filter-id-==":[et,[lt],(r,[t])=>r.id()===t.value],"filter-type-==":[et,[$e],(r,[t])=>r.geometryType()===t.value],"filter-<":[et,[$e,lt],(r,[t,n])=>{const a=r.properties()[t.value],c=n.value;return typeof a==typeof c&&a<c}],"filter-id-<":[et,[lt],(r,[t])=>{const n=r.id(),a=t.value;return typeof n==typeof a&&n<a}],"filter->":[et,[$e,lt],(r,[t,n])=>{const a=r.properties()[t.value],c=n.value;return typeof a==typeof c&&a>c}],"filter-id->":[et,[lt],(r,[t])=>{const n=r.id(),a=t.value;return typeof n==typeof a&&n>a}],"filter-<=":[et,[$e,lt],(r,[t,n])=>{const a=r.properties()[t.value],c=n.value;return typeof a==typeof c&&a<=c}],"filter-id-<=":[et,[lt],(r,[t])=>{const n=r.id(),a=t.value;return typeof n==typeof a&&n<=a}],"filter->=":[et,[$e,lt],(r,[t,n])=>{const a=r.properties()[t.value],c=n.value;return typeof a==typeof c&&a>=c}],"filter-id->=":[et,[lt],(r,[t])=>{const n=r.id(),a=t.value;return typeof n==typeof a&&n>=a}],"filter-has":[et,[lt],(r,[t])=>t.value in r.properties()],"filter-has-id":[et,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[et,[Ui($e)],(r,[t])=>t.value.indexOf(r.geometryType())>=0],"filter-id-in":[et,[Ui(lt)],(r,[t])=>t.value.indexOf(r.id())>=0],"filter-in-small":[et,[$e,Ui(lt)],(r,[t,n])=>n.value.indexOf(r.properties()[t.value])>=0],"filter-in-large":[et,[$e,Ui(lt)],(r,[t,n])=>function(a,c,d,p){for(;d<=p;){const g=d+p>>1;if(c[g]===a)return!0;c[g]>a?p=g-1:d=g+1}return!1}(r.properties()[t.value],n.value,0,n.value.length-1)],all:{type:et,overloads:[[[et,et],(r,[t,n])=>t.evaluate(r)&&n.evaluate(r)],[Ta(et),(r,t)=>{for(const n of t)if(!n.evaluate(r))return!1;return!0}]]},any:{type:et,overloads:[[[et,et],(r,[t,n])=>t.evaluate(r)||n.evaluate(r)],[Ta(et),(r,t)=>{for(const n of t)if(n.evaluate(r))return!0;return!1}]]},"!":[et,[et],(r,[t])=>!t.evaluate(r)],"is-supported-script":[et,[$e],(r,[t])=>{const n=r.globals&&r.globals.isSupportedScript;return!n||n(t.evaluate(r))}],upcase:[$e,[$e],(r,[t])=>t.evaluate(r).toUpperCase()],downcase:[$e,[$e],(r,[t])=>t.evaluate(r).toLowerCase()],concat:[$e,Ta(lt),(r,t)=>t.map(n=>pn(n.evaluate(r))).join("")],"resolved-locale":[$e,[ws],(r,[t])=>t.evaluate(r).resolvedLocale()]});class yc{constructor(t,n){var a;this.expression=t,this._warningHistory={},this._evaluator=new zt,this._defaultValue=n?(a=n).type==="color"&&qo(a.default)?new gt(0,0,0,0):a.type==="color"?gt.parse(a.default)||null:a.type==="padding"?sr.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?Yi.parse(a.default)||null:a.type==="projectionDefinition"?mr.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=n&&n.type==="enum"?n.values:null}evaluateWithoutErrorHandling(t,n,a,c,d,p){return this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=a,this._evaluator.canonical=c,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(t,n,a,c,d,p){this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=a||null,this._evaluator.canonical=c,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=p||null;try{const g=this.expression.evaluate(this._evaluator);if(g==null||typeof g=="number"&&g!=g)return this._defaultValue;if(this._enumValues&&!(g in this._enumValues))throw new xi(`Expected value to be one of ${Object.keys(this._enumValues).map(x=>JSON.stringify(x)).join(", ")}, but found ${JSON.stringify(g)} instead.`);return g}catch(g){return this._warningHistory[g.message]||(this._warningHistory[g.message]=!0,typeof console<"u"&&console.warn(g.message)),this._defaultValue}}}function Ma(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in ts}function js(r,t){const n=new pt(ts,Uo,[],t?function(c){const d={color:fr,string:$e,number:Ie,enum:$e,boolean:et,formatted:_a,padding:wo,projectionDefinition:ar,resolvedImage:Xn,variableAnchorOffsetCollection:To};return c.type==="array"?Ui(d[c.value]||lt,c.length):d[c.type]}(t):void 0),a=n.parse(r,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?vh(new yc(a,t)):is(n.errors)}class xc{constructor(t,n){this.kind=t,this._styleExpression=n,this.isStateDependent=t!=="constant"&&!Fs(n.expression)}evaluateWithoutErrorHandling(t,n,a,c,d,p){return this._styleExpression.evaluateWithoutErrorHandling(t,n,a,c,d,p)}evaluate(t,n,a,c,d,p){return this._styleExpression.evaluate(t,n,a,c,d,p)}}class vc{constructor(t,n,a,c){this.kind=t,this.zoomStops=a,this._styleExpression=n,this.isStateDependent=t!=="camera"&&!Fs(n.expression),this.interpolationType=c}evaluateWithoutErrorHandling(t,n,a,c,d,p){return this._styleExpression.evaluateWithoutErrorHandling(t,n,a,c,d,p)}evaluate(t,n,a,c,d,p){return this._styleExpression.evaluate(t,n,a,c,d,p)}interpolationFactor(t,n,a){return this.interpolationType?Tr.interpolationFactor(this.interpolationType,t,n,a):0}}function wh(r,t){const n=js(r,t);if(n.result==="error")return n;const a=n.value.expression,c=$o(a);if(!c&&!rs(t))return is([new Ct("","data expressions not supported")]);const d=Go(a,["zoom"]);if(!d&&!bh(t))return is([new Ct("","zoom expressions not supported")]);const p=Xo(a);return p||d?p instanceof Ct?is([p]):p instanceof Tr&&!gc(t)?is([new Ct("",'"interpolate" expressions cannot be used with this property')]):vh(p?new vc(c?"camera":"composite",n.value,p.labels,p instanceof Tr?p.interpolation:void 0):new xc(c?"constant":"source",n.value)):is([new Ct("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Wo{constructor(t,n){this._parameters=t,this._specification=n,at(this,Ho(this._parameters,this._specification))}static deserialize(t){return new Wo(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Xo(r){let t=null;if(r instanceof Wa)t=Xo(r.result);else if(r instanceof zs){for(const n of r.args)if(t=Xo(n),t)break}else(r instanceof ks||r instanceof Tr)&&r.input instanceof $r&&r.input.name==="zoom"&&(t=r);return t instanceof Ct||r.eachChild(n=>{const a=Xo(n);a instanceof Ct?t=a:!t&&a?t=new Ct("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new Ct("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function Ko(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const t of r.slice(1))if(!Ko(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const Th={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function bc(r){if(r==null)return{filter:()=>!0,needGeometry:!1};Ko(r)||(r=Ns(r));const t=js(r,Th);if(t.result==="error")throw new Error(t.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,a,c)=>t.value.evaluate(n,a,{},c),needGeometry:wc(r)}}function sp(r,t){return r<t?-1:r>t?1:0}function wc(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let t=1;t<r.length;t++)if(wc(r[t]))return!0;return!1}function Ns(r){if(!r)return!0;const t=r[0];return r.length<=1?t!=="any":t==="=="?Yo(r[1],r[2],"=="):t==="!="?ns(Yo(r[1],r[2],"==")):t==="<"||t===">"||t==="<="||t===">="?Yo(r[1],r[2],t):t==="any"?(n=r.slice(1),["any"].concat(n.map(Ns))):t==="all"?["all"].concat(r.slice(1).map(Ns)):t==="none"?["all"].concat(r.slice(1).map(Ns).map(ns)):t==="in"?Tc(r[1],r.slice(2)):t==="!in"?ns(Tc(r[1],r.slice(2))):t==="has"?Jo(r[1]):t!=="!has"||ns(Jo(r[1]));var n}function Yo(r,t,n){switch(r){case"$type":return[`filter-type-${n}`,t];case"$id":return[`filter-id-${n}`,t];default:return[`filter-${n}`,r,t]}}function Tc(r,t){if(t.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(n=>typeof n!=typeof t[0])?["filter-in-large",r,["literal",t.sort(sp)]]:["filter-in-small",r,["literal",t]]}}function Jo(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function ns(r){return["!",r]}function Zs(r){const t=typeof r;if(t==="number"||t==="boolean"||t==="string"||r==null)return JSON.stringify(r);if(Array.isArray(r)){let c="[";for(const d of r)c+=`${Zs(d)},`;return`${c}]`}const n=Object.keys(r).sort();let a="{";for(let c=0;c<n.length;c++)a+=`${JSON.stringify(n[c])}:${Zs(r[n[c]])},`;return`${a}}`}function Qo(r){let t="";for(const n of ce)t+=`/${Zs(r[n])}`;return t}function Mh(r){const t=r.value;return t?[new Me(r.key,t,"constants have been deprecated as of v8")]:[]}function Si(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function Sa(r){if(Array.isArray(r))return r.map(Sa);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const t={};for(const n in r)t[n]=Sa(r[n]);return t}return Si(r)}function Gr(r){const t=r.key,n=r.value,a=r.valueSpec||{},c=r.objectElementValidators||{},d=r.style,p=r.styleSpec,g=r.validateSpec;let x=[];const w=At(n);if(w!=="object")return[new Me(t,n,`object expected, ${w} found`)];for(const M in n){const C=M.split(".")[0],A=a[C]||a["*"];let L;if(c[C])L=c[C];else if(a[C])L=g;else if(c["*"])L=c["*"];else{if(!a["*"]){x.push(new Me(t,n[M],`unknown property "${M}"`));continue}L=g}x=x.concat(L({key:(t&&`${t}.`)+M,value:n[M],valueSpec:A,style:d,styleSpec:p,object:n,objectKey:M,validateSpec:g},n))}for(const M in a)c[M]||a[M].required&&a[M].default===void 0&&n[M]===void 0&&x.push(new Me(t,n,`missing required property "${M}"`));return x}function Mc(r){const t=r.value,n=r.valueSpec,a=r.style,c=r.styleSpec,d=r.key,p=r.arrayElementValidator||r.validateSpec;if(At(t)!=="array")return[new Me(d,t,`array expected, ${At(t)} found`)];if(n.length&&t.length!==n.length)return[new Me(d,t,`array length ${n.length} expected, length ${t.length} found`)];if(n["min-length"]&&t.length<n["min-length"])return[new Me(d,t,`array length at least ${n["min-length"]} expected, length ${t.length} found`)];let g={type:n.value,values:n.values};c.$version<7&&(g.function=n.function),At(n.value)==="object"&&(g=n.value);let x=[];for(let w=0;w<t.length;w++)x=x.concat(p({array:t,arrayIndex:w,value:t[w],valueSpec:g,validateSpec:r.validateSpec,style:a,styleSpec:c,key:`${d}[${w}]`}));return x}function Sc(r){const t=r.key,n=r.value,a=r.valueSpec;let c=At(n);return c==="number"&&n!=n&&(c="NaN"),c!=="number"?[new Me(t,n,`number expected, ${c} found`)]:"minimum"in a&&n<a.minimum?[new Me(t,n,`${n} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&n>a.maximum?[new Me(t,n,`${n} is greater than the maximum value ${a.maximum}`)]:[]}function Pc(r){const t=r.valueSpec,n=Si(r.value.type);let a,c,d,p={};const g=n!=="categorical"&&r.value.property===void 0,x=!g,w=At(r.value.stops)==="array"&&At(r.value.stops[0])==="array"&&At(r.value.stops[0][0])==="object",M=Gr({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(L){if(n==="identity")return[new Me(L.key,L.value,'identity function may not have a "stops" property')];let B=[];const j=L.value;return B=B.concat(Mc({key:L.key,value:j,valueSpec:L.valueSpec,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec,arrayElementValidator:C})),At(j)==="array"&&j.length===0&&B.push(new Me(L.key,j,"array must have at least one stop")),B},default:function(L){return L.validateSpec({key:L.key,value:L.value,valueSpec:t,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec})}}});return n==="identity"&&g&&M.push(new Me(r.key,r.value,'missing required property "property"')),n==="identity"||r.value.stops||M.push(new Me(r.key,r.value,'missing required property "stops"')),n==="exponential"&&r.valueSpec.expression&&!gc(r.valueSpec)&&M.push(new Me(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(x&&!rs(r.valueSpec)?M.push(new Me(r.key,r.value,"property functions not supported")):g&&!bh(r.valueSpec)&&M.push(new Me(r.key,r.value,"zoom functions not supported"))),n!=="categorical"&&!w||r.value.property!==void 0||M.push(new Me(r.key,r.value,'"property" property is required')),M;function C(L){let B=[];const j=L.value,$=L.key;if(At(j)!=="array")return[new Me($,j,`array expected, ${At(j)} found`)];if(j.length!==2)return[new Me($,j,`array length 2 expected, length ${j.length} found`)];if(w){if(At(j[0])!=="object")return[new Me($,j,`object expected, ${At(j[0])} found`)];if(j[0].zoom===void 0)return[new Me($,j,"object stop key must have zoom")];if(j[0].value===void 0)return[new Me($,j,"object stop key must have value")];if(d&&d>Si(j[0].zoom))return[new Me($,j[0].zoom,"stop zoom values must appear in ascending order")];Si(j[0].zoom)!==d&&(d=Si(j[0].zoom),c=void 0,p={}),B=B.concat(Gr({key:`${$}[0]`,value:j[0],valueSpec:{zoom:{}},validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec,objectElementValidators:{zoom:Sc,value:A}}))}else B=B.concat(A({key:`${$}[0]`,value:j[0],validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec},j));return Ma(Sa(j[1]))?B.concat([new Me(`${$}[1]`,j[1],"expressions are not allowed in function stops.")]):B.concat(L.validateSpec({key:`${$}[1]`,value:j[1],valueSpec:t,validateSpec:L.validateSpec,style:L.style,styleSpec:L.styleSpec}))}function A(L,B){const j=At(L.value),$=Si(L.value),X=L.value!==null?L.value:B;if(a){if(j!==a)return[new Me(L.key,X,`${j} stop domain type must match previous stop domain type ${a}`)]}else a=j;if(j!=="number"&&j!=="string"&&j!=="boolean")return[new Me(L.key,X,"stop domain value must be a number, string, or boolean")];if(j!=="number"&&n!=="categorical"){let se=`number expected, ${j} found`;return rs(t)&&n===void 0&&(se+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Me(L.key,X,se)]}return n!=="categorical"||j!=="number"||isFinite($)&&Math.floor($)===$?n!=="categorical"&&j==="number"&&c!==void 0&&$<c?[new Me(L.key,X,"stop domain values must appear in ascending order")]:(c=$,n==="categorical"&&$ in p?[new Me(L.key,X,"stop domain values must be unique")]:(p[$]=!0,[])):[new Me(L.key,X,`integer expected, found ${$}`)]}}function Pa(r){const t=(r.expressionContext==="property"?wh:js)(Sa(r.value),r.valueSpec);if(t.result==="error")return t.value.map(a=>new Me(`${r.key}${a.key}`,r.value,a.message));const n=t.value.expression||t.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!n.outputDefined())return[new Me(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Fs(n))return[new Me(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!Fs(n))return[new Me(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!Go(n,["zoom","feature-state"]))return[new Me(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!$o(n))return[new Me(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Qn(r){const t=r.key,n=r.value,a=r.valueSpec,c=[];return Array.isArray(a.values)?a.values.indexOf(Si(n))===-1&&c.push(new Me(t,n,`expected one of [${a.values.join(", ")}], ${JSON.stringify(n)} found`)):Object.keys(a.values).indexOf(Si(n))===-1&&c.push(new Me(t,n,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(n)} found`)),c}function Cc(r){return Ko(Sa(r.value))?Pa(at({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ic(r)}function Ic(r){const t=r.value,n=r.key;if(At(t)!=="array")return[new Me(n,t,`array expected, ${At(t)} found`)];const a=r.styleSpec;let c,d=[];if(t.length<1)return[new Me(n,t,"filter array must have at least 1 element")];switch(d=d.concat(Qn({key:`${n}[0]`,value:t[0],valueSpec:a.filter_operator,style:r.style,styleSpec:r.styleSpec})),Si(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&Si(t[1])==="$type"&&d.push(new Me(n,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&d.push(new Me(n,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(c=At(t[1]),c!=="string"&&d.push(new Me(`${n}[1]`,t[1],`string expected, ${c} found`)));for(let p=2;p<t.length;p++)c=At(t[p]),Si(t[1])==="$type"?d=d.concat(Qn({key:`${n}[${p}]`,value:t[p],valueSpec:a.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&d.push(new Me(`${n}[${p}]`,t[p],`string, number, or boolean expected, ${c} found`));break;case"any":case"all":case"none":for(let p=1;p<t.length;p++)d=d.concat(Ic({key:`${n}[${p}]`,value:t[p],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=At(t[1]),t.length!==2?d.push(new Me(n,t,`filter array for "${t[0]}" operator must have 2 elements`)):c!=="string"&&d.push(new Me(`${n}[1]`,t[1],`string expected, ${c} found`))}return d}function Ec(r,t){const n=r.key,a=r.validateSpec,c=r.style,d=r.styleSpec,p=r.value,g=r.objectKey,x=d[`${t}_${r.layerType}`];if(!x)return[];const w=g.match(/^(.*)-transition$/);if(t==="paint"&&w&&x[w[1]]&&x[w[1]].transition)return a({key:n,value:p,valueSpec:d.transition,style:c,styleSpec:d});const M=r.valueSpec||x[g];if(!M)return[new Me(n,p,`unknown property "${g}"`)];let C;if(At(p)==="string"&&rs(M)&&!M.tokens&&(C=/^{([^}]+)}$/.exec(p)))return[new Me(n,p,`"${g}" does not support interpolation syntax
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arenarium/maps",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "keywords": [
5
5
  "arenarium",
6
6
  "maps",